main_2018.js 2.4 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405
  1. var dom = {
  2. getOffset: function(e, t, i) {
  3. for (left = "left" == e ? t.offsetLeft : t.offsetTop,
  4. i = i || $("body")[0]; (t = t.offsetParent) && t != i; )
  5. left += "left" == e ? t.offsetLeft : t.offsetTop;
  6. return left
  7. }
  8. };
  9. if (function() {
  10. "use strict";
  11. function o(e, t) {
  12. return typeof e === t
  13. }
  14. function a(e, t) {
  15. return e instanceof t
  16. }
  17. function s(e) {
  18. return e && e.nodeType
  19. }
  20. function l(e) {
  21. return s(e) ? e : a(e, y) ? e[0] : void 0
  22. }
  23. function e(e, i, n) {
  24. return y.each(e, function(e, t) {
  25. n = i.call(t, n, e, t)
  26. }),
  27. n
  28. }
  29. function t(e, t, i) {
  30. var n, r, o;
  31. if (e === t)
  32. return !0;
  33. if (!e || !t || e.constructor !== t.constructor)
  34. return !1;
  35. for (n = 0,
  36. r = i.length; n < r; n += 1) {
  37. if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
  38. return !1;
  39. if (e[o] !== t[o])
  40. return !1
  41. }
  42. return !0
  43. }
  44. function c(e, t, i, n) {
  45. this.left = w(e),
  46. this.top = w(t),
  47. this.width = w(i),
  48. this.height = w(n),
  49. this.right = this.left + this.width,
  50. this.bottom = this.top + this.height
  51. }
  52. function h(e, t, i, n) {
  53. this.visible = e || 0,
  54. this.viewport = t || 0,
  55. this.possible = i || 0,
  56. this.rects = n && I({}, n) || null
  57. }
  58. function r(e, t) {
  59. this.els = e,
  60. this.viewport = t
  61. }
  62. function n(e, t) {
  63. return e.val - t.val
  64. }
  65. function u(e, t) {
  66. return t.val - e.val
  67. }
  68. function d(e) {
  69. var t = c.ofContent(e, !0)
  70. , i = c.ofViewport(e, !0)
  71. , n = t.width - i.width
  72. , r = t.height - i.height;
  73. this.content = t,
  74. this.viewport = i,
  75. this.width = n <= 0 ? null : i.left / n,
  76. this.height = r <= 0 ? null : i.top / r,
  77. this.left = i.left,
  78. this.top = i.top,
  79. this.right = t.right - i.right,
  80. this.bottom = t.bottom - i.bottom
  81. }
  82. function p(e) {
  83. this.el = e || window
  84. }
  85. function f(e, t) {
  86. this.context = e,
  87. this.viewport = t,
  88. this.init()
  89. }
  90. function g(e, t, i, n) {
  91. this.context = new r(e,t),
  92. this.property = i,
  93. this.descending = n,
  94. this.init()
  95. }
  96. function m(e) {
  97. e && e !== window && e !== document ? (this.context = e,
  98. this.$autoTarget = y(e)) : this.context = window,
  99. this.init()
  100. }
  101. 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 = {},
  102. v = 1,
  103. function(e) {
  104. return e ? (i[e] || (i[e] = v,
  105. v += 1),
  106. i[e]) : 0
  107. }
  108. );
  109. I(c.prototype, {
  110. equals: function(e) {
  111. return t(this, e, ["left", "top", "width", "height"])
  112. },
  113. area: function() {
  114. return this.width * this.height
  115. },
  116. relativeTo: function(e) {
  117. return new c(this.left - e.left,this.top - e.top,this.width,this.height)
  118. },
  119. intersection: function(e) {
  120. if (!a(e, c))
  121. return null;
  122. var t = _(this.left, e.left)
  123. , i = b(this.right, e.right)
  124. , n = _(this.top, e.top)
  125. , r = i - t
  126. , o = b(this.bottom, e.bottom) - n;
  127. return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
  128. },
  129. envelope: function(e) {
  130. if (!a(e, c))
  131. return this;
  132. var t = b(this.left, e.left)
  133. , i = _(this.right, e.right)
  134. , n = b(this.top, e.top);
  135. return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
  136. }
  137. }),
  138. I(c, {
  139. ofContent: function(e, t) {
  140. 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())
  141. },
  142. ofViewport: function(e, t) {
  143. 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())
  144. },
  145. ofElement: function(e) {
  146. var t = y(e);
  147. if (!t.is(":visible"))
  148. return null;
  149. var i = t.offset();
  150. return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
  151. }
  152. }),
  153. I(h.prototype, {
  154. equals: function(e) {
  155. return this.fracsEqual(e) && this.rectsEqual(e)
  156. },
  157. fracsEqual: function(e) {
  158. return t(this, e, ["visible", "viewport", "possible"])
  159. },
  160. rectsEqual: function(e) {
  161. return t(this.rects, e.rects, ["document", "element", "viewport"])
  162. }
  163. }),
  164. I(h, {
  165. of: function(e, t) {
  166. var i, n, r;
  167. return e = s(e) && c.ofElement(e) || e,
  168. t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
  169. e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
  170. r = b(e.width, t.width) * b(e.height, t.height),
  171. new h(n / e.area(),n / t.area(),n / r,{
  172. document: i,
  173. element: i.relativeTo(e),
  174. viewport: i.relativeTo(t)
  175. })) : new h
  176. }
  177. });
  178. var x = ["width", "height", "left", "right", "top", "bottom"]
  179. , S = ["possible", "visible", "viewport"];
  180. I(r.prototype, {
  181. sorted: function(t, e) {
  182. var i = this.viewport;
  183. return y.map(this.els, function(e) {
  184. return {
  185. el: e,
  186. val: function(e, t, i) {
  187. var n;
  188. return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
  189. n ? n[i] : 0
  190. }(e, i, t)
  191. }
  192. }).sort(e ? u : n)
  193. },
  194. best: function(e, t) {
  195. return this.els.length ? this.sorted(e, t)[0] : null
  196. }
  197. }),
  198. I(d.prototype, {
  199. equals: function(e) {
  200. return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  201. }
  202. }),
  203. I(p.prototype, {
  204. equals: function(e) {
  205. return t(this, e, ["el"])
  206. },
  207. scrollState: function() {
  208. return new d(this.el)
  209. },
  210. scrollTo: function(e, t, i) {
  211. var n = y(this.el === window ? "html,body" : this.el);
  212. e = e || 0,
  213. t = t || 0,
  214. i = isNaN(i) ? 1e3 : i,
  215. n.stop(!0).animate({
  216. scrollLeft: e,
  217. scrollTop: t
  218. }, i)
  219. },
  220. scroll: function(e, t, i) {
  221. var n = this.el === window ? A : y(this.el);
  222. e = e || 0,
  223. t = t || 0,
  224. this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
  225. },
  226. scrollToRect: function(e, t, i, n) {
  227. t = t || 0,
  228. i = i || 0,
  229. this.scrollTo(e.left - t, e.top - i, n)
  230. },
  231. scrollToElement: function(e, t, i, n) {
  232. var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
  233. this.scrollToRect(r, t, i, n)
  234. }
  235. });
  236. var M = {
  237. init: function() {
  238. this.callbacks = y.Callbacks("memory unique"),
  239. this.currVal = null,
  240. this.prevVal = null,
  241. this.checkProxy = y.proxy(this.check, this),
  242. this.autoCheck()
  243. },
  244. bind: function(e) {
  245. this.callbacks.add(e)
  246. },
  247. unbind: function(e) {
  248. e ? this.callbacks.remove(e) : this.callbacks.empty()
  249. },
  250. trigger: function() {
  251. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  252. },
  253. check: function(e) {
  254. var t = this.updatedValue(e);
  255. return void 0 !== t && (this.prevVal = this.currVal,
  256. this.currVal = t,
  257. this.trigger(),
  258. !0)
  259. },
  260. $autoTarget: A,
  261. autoEvents: "load resize scroll",
  262. autoCheck: function(e) {
  263. this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
  264. }
  265. };
  266. I(f.prototype, M, {
  267. updatedValue: function() {
  268. var e = h.of(this.context, this.viewport);
  269. return this.currVal && this.currVal.equals(e) ? void 0 : e
  270. }
  271. }),
  272. I(g.prototype, M, {
  273. updatedValue: function() {
  274. var e = this.context.best(this.property, this.descending);
  275. return e && (e = 0 < e.val ? e.el : null,
  276. this.currVal !== e) ? e : void 0
  277. }
  278. }),
  279. I(m.prototype, M, {
  280. updatedValue: function() {
  281. var e = new d(this.context);
  282. return this.currVal && this.currVal.equals(e) ? void 0 : e
  283. }
  284. });
  285. var R, P, O, L, D, N, F, B, V, k, U = "fracs";
  286. function H(e, t, i, n) {
  287. return i = N(i) ? i.apply(e, t) : i,
  288. N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
  289. }
  290. R = U,
  291. P = {
  292. statics: {
  293. version: "0.15.0",
  294. Rect: c,
  295. Fractions: h,
  296. Group: r,
  297. ScrollState: d,
  298. Viewport: p,
  299. FracsCallbacks: f,
  300. GroupCallbacks: g,
  301. ScrollStateCallbacks: m,
  302. fracs: function(e, t) {
  303. return h.of(e, t)
  304. }
  305. },
  306. methods: {
  307. content: function(e) {
  308. return this.length ? c.ofContent(this[0], e) : null
  309. },
  310. envelope: function() {
  311. return e(this, function(e) {
  312. var t = c.ofElement(this);
  313. return e ? e.envelope(t) : t
  314. })
  315. },
  316. fracs: function(e, i, n) {
  317. o(e, "string") || (n = i,
  318. i = e,
  319. e = null),
  320. E(i) || (n = i,
  321. i = null),
  322. n = l(n);
  323. var r = U + ".fracs." + T(n);
  324. return "unbind" === e ? this.each(function() {
  325. var e = y(this).data(r);
  326. e && e.unbind(i)
  327. }) : "check" === e ? this.each(function() {
  328. var e = y(this).data(r);
  329. e && e.check()
  330. }) : E(i) ? this.each(function() {
  331. var e = y(this)
  332. , t = e.data(r);
  333. t || (t = new f(this,n),
  334. e.data(r, t)),
  335. t.bind(i)
  336. }) : this.length ? h.of(this[0], n) : null
  337. },
  338. intersection: function() {
  339. return e(this, function(e) {
  340. var t = c.ofElement(this);
  341. return e ? e.intersection(t) : t
  342. })
  343. },
  344. max: function(e, t, i) {
  345. return E(t) || (i = t,
  346. t = null),
  347. i = l(i),
  348. t ? (new g(this,i,e,!0).bind(t),
  349. this) : this.pushStack(new r(this,i).best(e, !0).el)
  350. },
  351. min: function(e, t, i) {
  352. return E(t) || (i = t,
  353. t = null),
  354. i = l(i),
  355. t ? (new g(this,i,e).bind(t),
  356. this) : this.pushStack(new r(this,i).best(e).el)
  357. },
  358. rect: function() {
  359. return this.length ? c.ofElement(this[0]) : null
  360. },
  361. scrollState: function(e, i) {
  362. var n = U + ".scrollState";
  363. return o(e, "string") || (i = e,
  364. e = null),
  365. "unbind" === e ? this.each(function() {
  366. var e = y(this).data(n);
  367. e && e.unbind(i)
  368. }) : "check" === e ? this.each(function() {
  369. var e = y(this).data(n);
  370. e && e.check()
  371. }) : E(i) ? this.each(function() {
  372. var e = y(this)
  373. , t = e.data(n);
  374. t || (t = new m(this),
  375. e.data(n, t)),
  376. t.bind(i)
  377. }) : this.length ? new d(this[0]) : null
  378. },
  379. scroll: function(e, t, i) {
  380. return this.each(function() {
  381. new p(this).scroll(e, t, i)
  382. })
  383. },
  384. scrollTo: function(e, t, i, n) {
  385. return y.isNumeric(e) && (n = i,
  386. i = t,
  387. t = e,
  388. e = null),
  389. e = l(e),
  390. this.each(function() {
  391. e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
  392. })
  393. },
  394. scrollToThis: function(e, t, i, n) {
  395. return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
  396. this
  397. },
  398. softLink: function(t, i, n, r) {
  399. return r = new p(l(r)),
  400. this.filter("a[href^=#]").each(function() {
  401. var e = y(this);
  402. e.on("click", function() {
  403. r.scrollToElement(y(e.attr("href"))[0], t, i, n)
  404. })
  405. })
  406. },
  407. sort: function(e, t, i) {
  408. return o(t, "boolean") || (i = t,
  409. t = null),
  410. i = l(i),
  411. this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
  412. return e.el
  413. }))
  414. },
  415. viewport: function(e) {
  416. return this.length ? c.ofViewport(this[0], e) : null
  417. }
  418. },
  419. defaultStatic: "fracs",
  420. defaultMethod: "fracs"
  421. },
  422. O = [].slice,
  423. L = jQuery,
  424. D = L.extend,
  425. N = L.isFunction,
  426. F = D({}, P),
  427. B = function() {
  428. return H(this, O.call(arguments), F.defaultStatic, B)
  429. }
  430. ,
  431. V = function(e) {
  432. return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
  433. }
  434. ,
  435. (k = function(e) {
  436. e && (D(B, e.statics),
  437. D(V, e.methods)),
  438. B.modplug = k
  439. }
  440. ).prev = {
  441. statics: L[R],
  442. methods: L.fn[R]
  443. },
  444. k(P),
  445. L[R] = B,
  446. L.fn[R] = V
  447. }(),
  448. "undefined" == typeof jQuery)
  449. throw new Error("Bootstrap's JavaScript requires jQuery");
  450. !function(m) {
  451. "use strict";
  452. function r(e, t) {
  453. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  454. this.init("tooltip", e, t)
  455. }
  456. r.VERSION = "3.2.0",
  457. r.DEFAULTS = {
  458. animation: !0,
  459. placement: "top",
  460. selector: !1,
  461. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  462. trigger: "hover focus",
  463. title: "",
  464. delay: 0,
  465. html: !1,
  466. container: !1,
  467. viewport: {
  468. selector: "body",
  469. padding: 0
  470. }
  471. },
  472. r.prototype.init = function(e, t, i) {
  473. this.enabled = !0,
  474. this.type = e,
  475. this.$element = m(t),
  476. this.options = this.getOptions(i),
  477. this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
  478. for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
  479. var o = n[r];
  480. if ("click" == o)
  481. this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
  482. else if ("manual" != o) {
  483. var a = "hover" == o ? "mouseenter" : "focusin"
  484. , s = "hover" == o ? "mouseleave" : "focusout";
  485. this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
  486. this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
  487. }
  488. }
  489. this.options.selector ? this._options = m.extend({}, this.options, {
  490. trigger: "manual",
  491. selector: ""
  492. }) : this.fixTitle()
  493. }
  494. ,
  495. r.prototype.getDefaults = function() {
  496. return r.DEFAULTS
  497. }
  498. ,
  499. r.prototype.getOptions = function(e) {
  500. return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
  501. show: e.delay,
  502. hide: e.delay
  503. }),
  504. e
  505. }
  506. ,
  507. r.prototype.getDelegateOptions = function() {
  508. var i = {}
  509. , n = this.getDefaults();
  510. return this._options && m.each(this._options, function(e, t) {
  511. n[e] != t && (i[e] = t)
  512. }),
  513. i
  514. }
  515. ,
  516. r.prototype.enter = function(e) {
  517. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  518. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  519. m(e.currentTarget).data("bs." + this.type, t)),
  520. clearTimeout(t.timeout),
  521. t.hoverState = "in",
  522. t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
  523. }
  524. ,
  525. r.prototype.leave = function(e) {
  526. var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
  527. return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  528. m(e.currentTarget).data("bs." + this.type, t)),
  529. clearTimeout(t.timeout),
  530. t.hoverState = "out",
  531. t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
  532. "out" == t.hoverState && t.hide()
  533. }, t.options.delay.hide)) : t.hide()
  534. }
  535. ,
  536. r.prototype.show = function() {
  537. var e = m.Event("show.bs." + this.type);
  538. if (this.hasContent() && this.enabled) {
  539. this.$element.trigger(e);
  540. var t = m.contains(document.documentElement, this.$element[0]);
  541. if (e.isDefaultPrevented() || !t)
  542. return;
  543. var i = this
  544. , n = this.tip()
  545. , r = this.getUID(this.type);
  546. this.setContent(),
  547. n.attr("id", r),
  548. this.$element.attr("aria-describedby", r),
  549. this.options.animation && n.addClass("fade");
  550. var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
  551. , a = /\s?auto?\s?/i
  552. , s = a.test(o);
  553. s && (o = o.replace(a, "") || "top"),
  554. n.detach().css({
  555. top: 0,
  556. left: 0,
  557. display: "block"
  558. }).addClass(o).data("bs." + this.type, this),
  559. this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
  560. var l = this.getPosition()
  561. , c = n[0].offsetWidth
  562. , h = n[0].offsetHeight;
  563. if (s) {
  564. var u = o
  565. , d = this.$element.parent()
  566. , p = this.getPosition(d);
  567. 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,
  568. n.removeClass(u).addClass(o)
  569. }
  570. var f = this.getCalculatedOffset(o, l, c, h);
  571. this.applyPlacement(f, o);
  572. var g = function() {
  573. i.$element.trigger("shown.bs." + i.type),
  574. i.hoverState = null
  575. };
  576. m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
  577. }
  578. }
  579. ,
  580. r.prototype.applyPlacement = function(e, t) {
  581. var i = this.tip()
  582. , n = i[0].offsetWidth
  583. , r = i[0].offsetHeight
  584. , o = parseInt(i.css("margin-top"), 10)
  585. , a = parseInt(i.css("margin-left"), 10);
  586. isNaN(o) && (o = 0),
  587. isNaN(a) && (a = 0),
  588. e.top = e.top + o,
  589. e.left = e.left + a,
  590. m.offset.setOffset(i[0], m.extend({
  591. using: function(e) {
  592. i.css({
  593. top: Math.round(e.top),
  594. left: Math.round(e.left)
  595. })
  596. }
  597. }, e), 0),
  598. i.addClass("in");
  599. var s = i[0].offsetWidth
  600. , l = i[0].offsetHeight;
  601. "top" == t && l != r && (e.top = e.top + r - l);
  602. var c = this.getViewportAdjustedDelta(t, e, s, l);
  603. c.left ? e.left += c.left : e.top += c.top;
  604. var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
  605. , u = c.left ? "left" : "top"
  606. , d = c.left ? "offsetWidth" : "offsetHeight";
  607. i.offset(e),
  608. this.replaceArrow(h, i[0][d], u)
  609. }
  610. ,
  611. r.prototype.replaceArrow = function(e, t, i) {
  612. this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
  613. }
  614. ,
  615. r.prototype.setContent = function() {
  616. var e = this.tip()
  617. , t = this.getTitle();
  618. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  619. e.removeClass("fade in top bottom left right")
  620. }
  621. ,
  622. r.prototype.hide = function() {
  623. function e() {
  624. "in" != t.hoverState && i.detach(),
  625. t.$element.trigger("hidden.bs." + t.type)
  626. }
  627. var t = this
  628. , i = this.tip()
  629. , n = m.Event("hide.bs." + this.type);
  630. if (this.$element.removeAttr("aria-describedby"),
  631. this.$element.trigger(n),
  632. !n.isDefaultPrevented())
  633. return i.removeClass("in"),
  634. m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  635. this.hoverState = null,
  636. this
  637. }
  638. ,
  639. r.prototype.fixTitle = function() {
  640. var e = this.$element;
  641. !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  642. }
  643. ,
  644. r.prototype.hasContent = function() {
  645. return this.getTitle()
  646. }
  647. ,
  648. r.prototype.getPosition = function(e) {
  649. var t = (e = e || this.$element)[0]
  650. , i = "BODY" == t.tagName;
  651. return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
  652. scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  653. width: i ? m(window).width() : e.outerWidth(),
  654. height: i ? m(window).height() : e.outerHeight()
  655. }, i ? {
  656. top: 0,
  657. left: 0
  658. } : e.offset())
  659. }
  660. ,
  661. r.prototype.getCalculatedOffset = function(e, t, i, n) {
  662. return "bottom" == e ? {
  663. top: t.top + t.height,
  664. left: t.left + t.width / 2 - i / 2
  665. } : "top" == e ? {
  666. top: t.top - n,
  667. left: t.left + t.width / 2 - i / 2
  668. } : "left" == e ? {
  669. top: t.top + t.height / 2 - n / 2,
  670. left: t.left - i
  671. } : {
  672. top: t.top + t.height / 2 - n / 2,
  673. left: t.left + t.width
  674. }
  675. }
  676. ,
  677. r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
  678. var r = {
  679. top: 0,
  680. left: 0
  681. };
  682. if (!this.$viewport)
  683. return r;
  684. var o = this.options.viewport && this.options.viewport.padding || 0
  685. , a = this.getPosition(this.$viewport);
  686. if (/right|left/.test(e)) {
  687. var s = t.top - o - a.scroll
  688. , l = t.top + o - a.scroll + n;
  689. s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
  690. } else {
  691. var c = t.left - o
  692. , h = t.left + o + i;
  693. c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
  694. }
  695. return r
  696. }
  697. ,
  698. r.prototype.getTitle = function() {
  699. var e = this.$element
  700. , t = this.options;
  701. return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
  702. }
  703. ,
  704. r.prototype.getUID = function(e) {
  705. for (; e += ~~(1e6 * Math.random()),
  706. document.getElementById(e); )
  707. ;
  708. return e
  709. }
  710. ,
  711. r.prototype.tip = function() {
  712. return this.$tip = this.$tip || m(this.options.template)
  713. }
  714. ,
  715. r.prototype.arrow = function() {
  716. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  717. }
  718. ,
  719. r.prototype.validate = function() {
  720. this.$element[0].parentNode || (this.hide(),
  721. this.$element = null,
  722. this.options = null)
  723. }
  724. ,
  725. r.prototype.enable = function() {
  726. this.enabled = !0
  727. }
  728. ,
  729. r.prototype.disable = function() {
  730. this.enabled = !1
  731. }
  732. ,
  733. r.prototype.toggleEnabled = function() {
  734. this.enabled = !this.enabled
  735. }
  736. ,
  737. r.prototype.toggle = function(e) {
  738. var t = this;
  739. e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  740. m(e.currentTarget).data("bs." + this.type, t))),
  741. t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
  742. }
  743. ,
  744. r.prototype.destroy = function() {
  745. clearTimeout(this.timeout),
  746. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  747. }
  748. ;
  749. var e = m.fn.tooltip;
  750. m.fn.tooltip = function(n) {
  751. return this.each(function() {
  752. var e = m(this)
  753. , t = e.data("bs.tooltip")
  754. , i = "object" == typeof n && n;
  755. !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
  756. "string" == typeof n && t[n]())
  757. })
  758. }
  759. ,
  760. m.fn.tooltip.Constructor = r,
  761. m.fn.tooltip.noConflict = function() {
  762. return m.fn.tooltip = e,
  763. this
  764. }
  765. }(jQuery),
  766. function(e, t, i) {
  767. "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
  768. }(0, this, function() {
  769. "use strict";
  770. function Keen() {
  771. return _init.apply(this, arguments)
  772. }
  773. function _init(e) {
  774. if (_isUndefined(e))
  775. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  776. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  777. throw new Error("Please provide a projectId");
  778. this.configure(e)
  779. }
  780. function _extend(e) {
  781. for (var t = 1; t < arguments.length; t++)
  782. for (var i in arguments[t])
  783. e[i] = arguments[t][i];
  784. return e
  785. }
  786. function _isUndefined(e) {
  787. return void 0 === e
  788. }
  789. function _type(e) {
  790. var t = e && e.constructor ? e.constructor.toString() : void 0;
  791. return t ? t.match(/function (.*)\(/)[1] : "Null"
  792. }
  793. function _each(e, t, i) {
  794. var n;
  795. if (!e)
  796. return 0;
  797. if (i = i || e,
  798. "array" === _type(e)) {
  799. for (n = 0; n < e.length; n++)
  800. if (!1 === t.call(i, e[n], n, e))
  801. return 0
  802. } else
  803. for (n in e)
  804. if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
  805. return 0;
  806. return 1
  807. }
  808. function _parse_params(e) {
  809. for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
  810. return decodeURIComponent(e.replace(n, " "))
  811. }, a = e.split("?")[1]; t = r.exec(a); )
  812. i[o(t[1])] = o(t[2]);
  813. return i
  814. }
  815. function _set_protocol(e) {
  816. switch (e) {
  817. case "http":
  818. return "http";
  819. case "auto":
  820. return location.protocol.replace(/:/g, "");
  821. case "https":
  822. case void 0:
  823. default:
  824. return "https"
  825. }
  826. }
  827. function _set_request_type(e) {
  828. var t = e || "jsonp"
  829. , i = !1;
  830. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
  831. null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
  832. }
  833. function _build_url(e) {
  834. return this.client.endpoint + "/projects/" + this.client.projectId + e
  835. }
  836. function _uploadEvent(e, t, i, n, r) {
  837. var o = _build_url.apply(this, ["/events/" + e])
  838. , a = {};
  839. for (var s in i = !1 !== i,
  840. this.client.globalProperties && (a = this.client.globalProperties(e)),
  841. t)
  842. t.hasOwnProperty(s) && (a[s] = t[s]);
  843. switch (this.client.requestType) {
  844. case "xhr":
  845. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
  846. break;
  847. case "jsonp":
  848. var l = JSON.stringify(a)
  849. , c = Keen.Base64.encode(l);
  850. o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
  851. _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
  852. break;
  853. case "beacon":
  854. l = JSON.stringify(a),
  855. c = Keen.Base64.encode(l);
  856. o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
  857. o += "&c=clv1",
  858. _request.beacon.apply(this, [o, null, n, r])
  859. }
  860. }
  861. Keen.prototype.configure = function(e) {
  862. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  863. e.protocol = _set_protocol(e.protocol),
  864. e.requestType = _set_request_type(e.requestType),
  865. this.client = {
  866. projectId: e.projectId,
  867. writeKey: e.writeKey,
  868. readKey: e.readKey,
  869. globalProperties: null,
  870. endpoint: e.protocol + "://" + e.host,
  871. requestType: e.requestType
  872. },
  873. Keen.trigger("client", this, e),
  874. this.trigger("ready"),
  875. this
  876. }
  877. ;
  878. var _request = {
  879. xhr: function(e, t, i, n, r, o, a, s) {
  880. if (!r)
  881. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  882. var l = new XMLHttpRequest;
  883. if (l.onreadystatechange = function() {
  884. if (4 == l.readyState)
  885. if (200 <= l.status && l.status < 300) {
  886. var e;
  887. try {
  888. e = JSON.parse(l.responseText)
  889. } catch (e) {
  890. Keen.log("Could not JSON parse HTTP response: " + l.responseText),
  891. s && s(l, e)
  892. }
  893. a && e && a(e)
  894. } else
  895. Keen.log("HTTP request failed."),
  896. s && s(l, null)
  897. }
  898. ,
  899. l.open(e, t, o),
  900. r && l.setRequestHeader("Authorization", r),
  901. n && l.setRequestHeader("Content-Type", "application/json"),
  902. i)
  903. for (var c in i)
  904. i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
  905. var h = n ? JSON.stringify(n) : null;
  906. l.send(h)
  907. },
  908. jsonp: function(e, t, i, n) {
  909. if (!t)
  910. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  911. if (t && e.indexOf("api_key") < 0) {
  912. var r = 0 < e.indexOf("?") ? "&" : "?";
  913. e = e + r + "api_key=" + t
  914. }
  915. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  916. o += "a";
  917. var a = !1;
  918. window[o] = function(e) {
  919. a = !0,
  920. i && e && i(e),
  921. window[o] = void 0
  922. }
  923. ,
  924. e = e + "&jsonp=" + o;
  925. var s = document.createElement("script");
  926. s.id = "keen-jsonp",
  927. s.src = e,
  928. document.getElementsByTagName("head")[0].appendChild(s),
  929. s.onreadystatechange = function() {
  930. !1 === a && "loaded" === this.readyState && (a = !0,
  931. n && n())
  932. }
  933. ,
  934. s.onerror = function() {
  935. !1 === a && (a = !0,
  936. n && n())
  937. }
  938. },
  939. beacon: function(e, t, i, n) {
  940. if (t && e.indexOf("api_key") < 0) {
  941. var r = 0 < e.indexOf("?") ? "&" : "?";
  942. e = e + r + "api_key=" + t
  943. }
  944. var o = document.createElement("img");
  945. o.onload = function() {
  946. if (!0,
  947. "naturalHeight"in this) {
  948. if (this.naturalHeight + this.naturalWidth === 0)
  949. return void this.onerror()
  950. } else if (this.width + this.height === 0)
  951. return void this.onerror();
  952. i && i({
  953. created: !0
  954. })
  955. }
  956. ,
  957. o.onerror = function() {
  958. !0,
  959. n && n()
  960. }
  961. ,
  962. o.src = e
  963. }
  964. }
  965. , Events = Keen.Events = {
  966. on: function(e, t) {
  967. return this.listeners || (this.listeners = {}),
  968. (this.listeners[e] || (this.listeners[e] = [])).push({
  969. callback: t
  970. }),
  971. this
  972. },
  973. off: function(e, t) {
  974. if (!e && !t)
  975. return this.listeners = void 0,
  976. delete this.listeners,
  977. this;
  978. for (var i = this.listeners[e] || [], n = i.length; n--; )
  979. t && t == i[n].callback && this.listeners[e].splice(n, 1),
  980. t && 0 != i.length || (this.listeners[e] = void 0,
  981. delete this.listeners[e]);
  982. return this
  983. },
  984. trigger: function(e) {
  985. if (!this.listeners)
  986. return this;
  987. for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
  988. i[n].callback.apply(this, t);
  989. return this
  990. }
  991. };
  992. _extend(Keen.prototype, Events),
  993. _extend(Keen, Events),
  994. Keen.loaded = !0,
  995. Keen.utils = {
  996. each: _each,
  997. extend: _extend,
  998. parseParams: _parse_params
  999. },
  1000. Keen.ready = function(e) {
  1001. Keen.loaded ? e() : Keen.on("ready", e)
  1002. }
  1003. ,
  1004. Keen.log = function(e) {
  1005. "object" == typeof console && console.log("[Keen IO]", e)
  1006. }
  1007. ;
  1008. var Plugins = Keen.Plugins = {}, Hh, Ih;
  1009. Keen.prototype.addEvent = function() {
  1010. _uploadEvent.apply(this, arguments)
  1011. }
  1012. ,
  1013. Keen.prototype.addEventSync = function(e, t, i, n) {
  1014. _uploadEvent.apply(this, [e, t, !1, i, n])
  1015. }
  1016. ,
  1017. Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
  1018. var o = e
  1019. , a = o.metaKey
  1020. , s = o.target
  1021. , l = !1
  1022. , c = function() {};
  1023. return void 0 === n && (n = 500),
  1024. "A" === s.nodeName ? c = function() {
  1025. a || l || (l = !0,
  1026. window.location = s.href)
  1027. }
  1028. : "FORM" === s.nodeName && (c = function() {
  1029. l || (l = !0,
  1030. s.submit())
  1031. }
  1032. ),
  1033. r && (c = function() {
  1034. l || (l = !0,
  1035. r())
  1036. }
  1037. ),
  1038. _uploadEvent.call(this, t, i, c, c),
  1039. setTimeout(function() {
  1040. c()
  1041. }, n),
  1042. !!a && void 0
  1043. }
  1044. ,
  1045. Keen.prototype.setGlobalProperties = function(e) {
  1046. if (!this.client)
  1047. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1048. if (!e || "function" != typeof e)
  1049. throw new Error("Invalid value for global properties: " + e);
  1050. this.client.globalProperties = e
  1051. }
  1052. ,
  1053. Keen.Base64 = {
  1054. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1055. encode: function(e) {
  1056. var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
  1057. for (e = this.utf8.encode(e); c < e.length; )
  1058. t = e.charCodeAt(c++),
  1059. i = e.charCodeAt(c++),
  1060. n = e.charCodeAt(c++),
  1061. r = t >> 2,
  1062. o = (3 & t) << 4 | i >> 4,
  1063. a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
  1064. s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
  1065. l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
  1066. return l
  1067. },
  1068. decode: function(e) {
  1069. var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
  1070. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1071. t = c.indexOf(e.charAt(l++)),
  1072. o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
  1073. a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
  1074. s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
  1075. return this.utf8.decode(s)
  1076. },
  1077. utf8: {
  1078. encode: function(e) {
  1079. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1080. 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);
  1081. return i
  1082. },
  1083. decode: function(e) {
  1084. for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
  1085. 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];
  1086. return i
  1087. }
  1088. }
  1089. },
  1090. "object" != typeof JSON && (JSON = {}),
  1091. function() {
  1092. function f(e) {
  1093. return e < 10 ? "0" + e : e
  1094. }
  1095. function quote(e) {
  1096. return escapable.lastIndex = 0,
  1097. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1098. var t = meta[e];
  1099. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1100. }) + '"' : '"' + e + '"'
  1101. }
  1102. function str(e, t) {
  1103. var i, n, r, o, a, s = gap, l = t[e];
  1104. switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
  1105. "function" == typeof rep && (l = rep.call(t, e, l)),
  1106. typeof l) {
  1107. case "string":
  1108. return quote(l);
  1109. case "number":
  1110. return isFinite(l) ? String(l) : "null";
  1111. case "boolean":
  1112. case "null":
  1113. return String(l);
  1114. case "object":
  1115. if (!l)
  1116. return "null";
  1117. if (gap += indent,
  1118. a = [],
  1119. "[object Array]" === Object.prototype.toString.apply(l)) {
  1120. for (o = l.length,
  1121. i = 0; i < o; i += 1)
  1122. a[i] = str(i, l) || "null";
  1123. return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
  1124. gap = s,
  1125. r
  1126. }
  1127. if (rep && "object" == typeof rep)
  1128. for (o = rep.length,
  1129. i = 0; i < o; i += 1)
  1130. "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1131. else
  1132. for (n in l)
  1133. Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
  1134. return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
  1135. gap = s,
  1136. r
  1137. }
  1138. }
  1139. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1140. 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
  1141. }
  1142. ,
  1143. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1144. return this.valueOf()
  1145. }
  1146. );
  1147. 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 = {
  1148. "\b": "\\b",
  1149. "\t": "\\t",
  1150. "\n": "\\n",
  1151. "\f": "\\f",
  1152. "\r": "\\r",
  1153. '"': '\\"',
  1154. "\\": "\\\\"
  1155. }, rep;
  1156. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
  1157. var n;
  1158. if (indent = gap = "",
  1159. "number" == typeof i)
  1160. for (n = 0; n < i; n += 1)
  1161. indent += " ";
  1162. else
  1163. "string" == typeof i && (indent = i);
  1164. if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1165. throw new Error("JSON.stringify");
  1166. return str("", {
  1167. "": e
  1168. })
  1169. }
  1170. ),
  1171. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1172. function walk(e, t) {
  1173. var i, n, r = e[t];
  1174. if (r && "object" == typeof r)
  1175. for (i in r)
  1176. Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
  1177. return reviver.call(e, t, r)
  1178. }
  1179. var j;
  1180. if (text = String(text),
  1181. cx.lastIndex = 0,
  1182. cx.test(text) && (text = text.replace(cx, function(e) {
  1183. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1184. })),
  1185. /^[\],:{}\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, "")))
  1186. return j = eval("(" + text + ")"),
  1187. "function" == typeof reviver ? walk({
  1188. "": j
  1189. }, "") : j;
  1190. throw new SyntaxError("JSON.parse")
  1191. }
  1192. )
  1193. }(),
  1194. Hh = Keen.utils,
  1195. Ih = function(i) {
  1196. function e(e) {
  1197. for (u = 1; e = n.shift(); )
  1198. e()
  1199. }
  1200. 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]);
  1201. return r[l] && r[l](s, t = function() {
  1202. r.removeEventListener(s, t, !1),
  1203. e()
  1204. }
  1205. , !1),
  1206. a && r.attachEvent(c, t = function() {
  1207. /^c/.test(r[h]) && (r.detachEvent(c, t),
  1208. e())
  1209. }
  1210. ),
  1211. i = a ? function(t) {
  1212. self != top ? u ? t() : n.push(t) : function() {
  1213. try {
  1214. o.doScroll("left")
  1215. } catch (e) {
  1216. return setTimeout(function() {
  1217. i(t)
  1218. }, 50)
  1219. }
  1220. t()
  1221. }()
  1222. }
  1223. : function(e) {
  1224. u ? e() : n.push(e)
  1225. }
  1226. }
  1227. ,
  1228. "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
  1229. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1230. if (loaded && cached) {
  1231. for (var instance in clients = cached.clients || {},
  1232. ready = cached.ready || [],
  1233. clients)
  1234. if (clients.hasOwnProperty(instance)) {
  1235. var client = clients[instance];
  1236. for (var method in Keen.prototype)
  1237. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1238. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1239. ,
  1240. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1241. ,
  1242. client._config && (client.configure.call(client, client._config),
  1243. delete client._config),
  1244. client._setGlobalProperties) {
  1245. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1246. client.setGlobalProperties.apply(client, globals[i]);
  1247. delete client._setGlobalProperties
  1248. }
  1249. if (client._addEvent) {
  1250. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1251. client.addEvent.apply(client, queue[i]);
  1252. delete client._addEvent
  1253. }
  1254. var callback = client._on || [];
  1255. if (client._on) {
  1256. for (var i = 0; i < callback.length; i++)
  1257. client.on.apply(client, callback[i]);
  1258. client.trigger("ready"),
  1259. delete client._on
  1260. }
  1261. }
  1262. for (var i = 0; i < ready.length; i++) {
  1263. var callback = ready[i];
  1264. Keen.on("ready", function() {
  1265. callback()
  1266. })
  1267. }
  1268. }
  1269. return Keen.loaded && setTimeout(function() {
  1270. Keen.utils.domready(function() {
  1271. Keen.trigger("ready")
  1272. })
  1273. }, 0),
  1274. Keen
  1275. }),
  1276. function() {
  1277. var i = window.analytics = window.analytics || [];
  1278. if (!i.initialize) {
  1279. if (i.invoked)
  1280. return window.console && console.error && console.error("Segment snippet included twice.");
  1281. i.invoked = !0,
  1282. i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1283. i.factory = function(t) {
  1284. return function() {
  1285. var e = Array.prototype.slice.call(arguments);
  1286. return e.unshift(t),
  1287. i.push(e),
  1288. i
  1289. }
  1290. }
  1291. ;
  1292. for (var e = 0; e < i.methods.length; e++) {
  1293. var t = i.methods[e];
  1294. i[t] = i.factory(t)
  1295. }
  1296. i.load = function(e) {
  1297. var t = document.createElement("script");
  1298. t.type = "text/javascript",
  1299. t.async = !0,
  1300. t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
  1301. var i = document.getElementsByTagName("script")[0];
  1302. i.parentNode.insertBefore(t, i)
  1303. }
  1304. ,
  1305. i.SNIPPET_VERSION = "4.0.0"
  1306. }
  1307. }(),
  1308. function(i, u) {
  1309. "use strict";
  1310. var d = "function"
  1311. , p = "undefined"
  1312. , f = "object"
  1313. , e = "major"
  1314. , t = "model"
  1315. , n = "name"
  1316. , r = "type"
  1317. , o = "vendor"
  1318. , a = "version"
  1319. , s = "architecture"
  1320. , l = "console"
  1321. , c = "mobile"
  1322. , h = "tablet"
  1323. , g = {
  1324. has: function(e, t) {
  1325. return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
  1326. },
  1327. lowerize: function(e) {
  1328. return e.toLowerCase()
  1329. }
  1330. }
  1331. , m = {
  1332. rgx: function() {
  1333. for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
  1334. var c = l[s]
  1335. , h = l[s + 1];
  1336. if (typeof e == p)
  1337. for (n in e = {},
  1338. h)
  1339. typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
  1340. for (t = i = 0; t < c.length; t++)
  1341. if (o = c[t].exec(this.getUA())) {
  1342. for (n = 0; n < h.length; n++)
  1343. a = o[++i],
  1344. 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;
  1345. break
  1346. }
  1347. if (o)
  1348. break
  1349. }
  1350. return e
  1351. },
  1352. str: function(e, t) {
  1353. for (var i in t)
  1354. if (typeof t[i] == f && 0 < t[i].length) {
  1355. for (var n = 0; n < t[i].length; n++)
  1356. if (g.has(t[i][n], e))
  1357. return "?" === i ? u : i
  1358. } else if (g.has(t[i], e))
  1359. return "?" === i ? u : i;
  1360. return e
  1361. }
  1362. }
  1363. , v = {
  1364. browser: {
  1365. oldsafari: {
  1366. major: {
  1367. 1: ["/8", "/1", "/3"],
  1368. 2: "/4",
  1369. "?": "/"
  1370. },
  1371. version: {
  1372. "1.0": "/8",
  1373. 1.2: "/1",
  1374. 1.3: "/3",
  1375. "2.0": "/412",
  1376. "2.0.2": "/416",
  1377. "2.0.3": "/417",
  1378. "2.0.4": "/419",
  1379. "?": "/"
  1380. }
  1381. }
  1382. },
  1383. device: {
  1384. sprint: {
  1385. model: {
  1386. "Evo Shift 4G": "7373KT"
  1387. },
  1388. vendor: {
  1389. HTC: "APA",
  1390. Sprint: "Sprint"
  1391. }
  1392. }
  1393. },
  1394. os: {
  1395. windows: {
  1396. version: {
  1397. ME: "4.90",
  1398. "NT 3.11": "NT3.51",
  1399. "NT 4.0": "NT4.0",
  1400. 2e3: "NT 5.0",
  1401. XP: ["NT 5.1", "NT 5.2"],
  1402. Vista: "NT 6.0",
  1403. 7: "NT 6.1",
  1404. 8: "NT 6.2",
  1405. 8.1: "NT 6.3",
  1406. RT: "ARM"
  1407. }
  1408. }
  1409. }
  1410. }
  1411. , y = {
  1412. 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]],
  1413. 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]],
  1414. 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]],
  1415. 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]],
  1416. 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]]
  1417. }
  1418. , A = function(e) {
  1419. var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
  1420. return this instanceof A ? (this.getBrowser = function() {
  1421. return m.rgx.apply(this, y.browser)
  1422. }
  1423. ,
  1424. this.getCPU = function() {
  1425. return m.rgx.apply(this, y.cpu)
  1426. }
  1427. ,
  1428. this.getDevice = function() {
  1429. return m.rgx.apply(this, y.device)
  1430. }
  1431. ,
  1432. this.getEngine = function() {
  1433. return m.rgx.apply(this, y.engine)
  1434. }
  1435. ,
  1436. this.getOS = function() {
  1437. return m.rgx.apply(this, y.os)
  1438. }
  1439. ,
  1440. this.getResult = function() {
  1441. return {
  1442. ua: this.getUA(),
  1443. browser: this.getBrowser(),
  1444. engine: this.getEngine(),
  1445. os: this.getOS(),
  1446. device: this.getDevice(),
  1447. cpu: this.getCPU()
  1448. }
  1449. }
  1450. ,
  1451. this.getUA = function() {
  1452. return t
  1453. }
  1454. ,
  1455. this.setUA = function(e) {
  1456. return t = e,
  1457. this
  1458. }
  1459. ,
  1460. void this.setUA(t)) : new A(e).getResult()
  1461. };
  1462. if (typeof exports != p)
  1463. typeof module != p && module.exports && (exports = module.exports = A),
  1464. exports.UAParser = A;
  1465. else if (i.UAParser = A,
  1466. typeof define == d && define.amd && define(function() {
  1467. return A
  1468. }),
  1469. typeof i.jQuery != p) {
  1470. var C = i.jQuery
  1471. , I = new A;
  1472. C.ua = I.getResult(),
  1473. C.ua.get = function() {
  1474. return I.getUA()
  1475. }
  1476. ,
  1477. C.ua.set = function(e) {
  1478. I.setUA(e);
  1479. var t = I.getResult();
  1480. for (var i in t)
  1481. C.ua[i] = t[i]
  1482. }
  1483. }
  1484. }(this),
  1485. window.Modernizr = function(e, t) {
  1486. function i(e, t) {
  1487. return typeof e === t
  1488. }
  1489. var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
  1490. for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
  1491. return t in e && i(e.constructor.prototype[t], "undefined")
  1492. }
  1493. : function(e, t) {
  1494. return p.call(e, t)
  1495. }
  1496. ,
  1497. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1498. var r = this;
  1499. if ("function" != typeof r)
  1500. throw new TypeError;
  1501. var o = d.call(arguments, 1)
  1502. , a = function() {
  1503. if (this instanceof a) {
  1504. function e() {}
  1505. e.prototype = r.prototype;
  1506. var t = new e
  1507. , i = r.apply(t, o.concat(d.call(arguments)));
  1508. return Object(i) === i ? i : t
  1509. }
  1510. return r.apply(n, o.concat(d.call(arguments)))
  1511. };
  1512. return a
  1513. }
  1514. ),
  1515. h.webgl = function() {
  1516. return !!e.WebGLRenderingContext
  1517. }
  1518. ,
  1519. h)
  1520. r(h, f) && (n = f.toLowerCase(),
  1521. a[n] = h[f](),
  1522. u.push((a[n] ? "" : "no-") + n));
  1523. return a.addTest = function(e, t) {
  1524. if ("object" == typeof e)
  1525. for (var i in e)
  1526. r(e, i) && a.addTest(i, e[i]);
  1527. else {
  1528. if (e = e.toLowerCase(),
  1529. void 0 !== a[e])
  1530. return a;
  1531. t = "function" == typeof t ? t() : t,
  1532. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
  1533. a[e] = t
  1534. }
  1535. return a
  1536. }
  1537. ,
  1538. o = "",
  1539. c.cssText = o,
  1540. l = null,
  1541. a._version = "2.8.2",
  1542. a
  1543. }(this, this.document),
  1544. function(xe, e, Se) {
  1545. "use strict";
  1546. function Me(s, e, n) {
  1547. function a(e) {
  1548. var t = Q.length;
  1549. if (G.old = xe.extend({}, G),
  1550. H = V ? 0 : k[F.horizontal ? "width" : "height"](),
  1551. Y = W[F.horizontal ? "width" : "height"](),
  1552. z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
  1553. Q.length = 0,
  1554. G.start = 0,
  1555. G.end = nt(z - H, 0),
  1556. le) {
  1557. $.length,
  1558. J = U.children(F.itemSelector),
  1559. $.length = 0;
  1560. 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;
  1561. z = 0,
  1562. J.each(function(e, t) {
  1563. var i = xe(t)
  1564. , n = t.getBoundingClientRect()
  1565. , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
  1566. , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
  1567. , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
  1568. , s = r + o + a
  1569. , l = !o || !a
  1570. , c = {};
  1571. c.el = t,
  1572. c.size = l ? r : s,
  1573. c.half = c.size / 2,
  1574. c.start = z + (l ? o : 0),
  1575. c.center = c.start - it(H / 2 - c.size / 2),
  1576. c.end = c.start - H + c.size,
  1577. e || (z += u),
  1578. z += s,
  1579. F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
  1580. e === g && (c.end += d,
  1581. z += d,
  1582. f = l ? a : 0),
  1583. $.push(c),
  1584. h = c
  1585. }),
  1586. U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
  1587. z -= f,
  1588. $.length ? (G.start = $[0][ae ? "center" : "start"],
  1589. G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
  1590. }
  1591. if (G.center = it(G.end / 2 + G.start / 2),
  1592. v(),
  1593. j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
  1594. j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
  1595. X.end = Y - q,
  1596. _e || c()),
  1597. !V && 0 < H) {
  1598. var n = G.start
  1599. , r = "";
  1600. if (le)
  1601. xe.each($, function(e, t) {
  1602. ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
  1603. Q.push(n),
  1604. (n += H) > G.end && n < G.end + H && Q.push(G.end))
  1605. });
  1606. else
  1607. for (; n - H < G.end; )
  1608. Q.push(n),
  1609. n += H;
  1610. if (Z[0] && t !== Q.length) {
  1611. for (var o = 0; o < Q.length; o++)
  1612. r += F.pageBuilder.call(B, o);
  1613. (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
  1614. }
  1615. }
  1616. if (ee.slideeSize = z,
  1617. ee.frameSize = H,
  1618. ee.sbSize = Y,
  1619. ee.handleSize = q,
  1620. le) {
  1621. e && null != F.startAt && (m(F.startAt),
  1622. B[se ? "toCenter" : "toStart"](F.startAt));
  1623. var a = $[ee.activeItem];
  1624. l(se && a ? a.center : Fe(G.dest, G.start, G.end))
  1625. } else
  1626. e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
  1627. L("load")
  1628. }
  1629. function l(e, t, i) {
  1630. if (le && Ie.released && !i) {
  1631. var n = d(e)
  1632. , r = e > G.start && e < G.end;
  1633. se ? (r && (e = $[n.centerItem].center),
  1634. ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
  1635. }
  1636. 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),
  1637. Ae.start = +new Date,
  1638. Ae.time = 0,
  1639. Ae.from = G.cur,
  1640. Ae.to = e,
  1641. Ae.delta = e - G.cur,
  1642. Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
  1643. Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
  1644. Ie.tweese = 0,
  1645. e !== G.dest && (G.dest = e,
  1646. L("change"),
  1647. _e || o()),
  1648. g(),
  1649. v(),
  1650. p(),
  1651. K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
  1652. K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
  1653. L("activePage", ye.page))
  1654. }
  1655. function o() {
  1656. if (B.initialized) {
  1657. if (!_e)
  1658. return _e = Ge(o),
  1659. void (Ie.released && L("moveStart"));
  1660. Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
  1661. $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),
  1662. G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
  1663. Ae.to === G.cur ? (G.cur = Ae.to,
  1664. Ie.tweese = _e = 0) : _e = Ge(o),
  1665. L("move"),
  1666. 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"),
  1667. !_e && Ie.released && L("moveEnd"),
  1668. c()
  1669. }
  1670. }
  1671. function c() {
  1672. 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,
  1673. X.cur = Fe(it(X.cur), X.start, X.end),
  1674. ye.hPos !== X.cur && (ye.hPos = X.cur,
  1675. Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
  1676. }
  1677. function t() {
  1678. Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
  1679. Te = Ie.init ? Ge(t) : 0,
  1680. Ce.now = +new Date,
  1681. Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
  1682. l(Ie.init ? Ce.pos : it(Ce.pos)),
  1683. Ie.init || G.cur !== G.dest || L("moveEnd"),
  1684. Ce.lastTime = Ce.now
  1685. }
  1686. function i(e, t, i) {
  1687. if ("boolean" === Re(t) && (i = t,
  1688. t = Se),
  1689. t === Se)
  1690. l(G[e], i);
  1691. else {
  1692. if (se && "center" !== e)
  1693. return;
  1694. var n = B.getPos(t);
  1695. n && l(n[e], i, !se)
  1696. }
  1697. }
  1698. function h(e) {
  1699. return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
  1700. }
  1701. function u(e) {
  1702. return h(De(e) && e < 0 ? e + $.length : e)
  1703. }
  1704. function m(e, t) {
  1705. var i = h(e);
  1706. return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
  1707. J.eq(i).addClass(F.activeClass),
  1708. ye.active = ee.activeItem = i,
  1709. p(),
  1710. L("active", i)),
  1711. i)
  1712. }
  1713. function d(e) {
  1714. e = Fe(De(e) ? e : G.dest, G.start, G.end);
  1715. var t = {}
  1716. , i = ae ? 0 : H / 2;
  1717. if (!V)
  1718. for (var n = 0, r = Q.length; n < r; n++) {
  1719. if (e >= G.end || n === Q.length - 1) {
  1720. t.activePage = Q.length - 1;
  1721. break
  1722. }
  1723. if (e <= Q[n] + i) {
  1724. t.activePage = n;
  1725. break
  1726. }
  1727. }
  1728. if (le) {
  1729. for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
  1730. if (!1 === o && e <= $[l].start + $[l].half && (o = l),
  1731. !1 === s && e <= $[l].center + $[l].half && (s = l),
  1732. l === c - 1 || e <= $[l].end + $[l].half) {
  1733. a = l;
  1734. break
  1735. }
  1736. t.firstItem = De(o) ? o : 0,
  1737. t.centerItem = De(s) ? s : t.firstItem,
  1738. t.lastItem = De(a) ? a : t.centerItem
  1739. }
  1740. return t
  1741. }
  1742. function v(e) {
  1743. xe.extend(ee, d(e))
  1744. }
  1745. function p() {
  1746. var e = G.dest <= G.start
  1747. , t = G.dest >= G.end
  1748. , i = (e ? 1 : 0) | (t ? 2 : 0);
  1749. if (ye.slideePosState !== i && (ye.slideePosState = i,
  1750. ge.is("button,input") && ge.prop("disabled", e),
  1751. me.is("button,input") && me.prop("disabled", t),
  1752. ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
  1753. me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
  1754. ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
  1755. de.is("button,input") && de.prop("disabled", e),
  1756. ue.is("button,input") && ue.prop("disabled", t)),
  1757. le && null != ee.activeItem) {
  1758. var n = 0 === ee.activeItem
  1759. , r = ee.activeItem >= $.length - 1
  1760. , o = (n ? 1 : 0) | (r ? 2 : 0);
  1761. ye.itemsButtonState !== o && (ye.itemsButtonState = o,
  1762. pe.is("button,input") && pe.prop("disabled", n),
  1763. fe.is("button,input") && fe.prop("disabled", r),
  1764. pe[n ? "addClass" : "removeClass"](F.disabledClass),
  1765. fe[r ? "addClass" : "removeClass"](F.disabledClass))
  1766. }
  1767. }
  1768. function r(e, t, i) {
  1769. if (e = u(e),
  1770. t = u(t),
  1771. -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
  1772. J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
  1773. var n = e < t ? e : i ? t : t - 1
  1774. , r = t < e ? e : i ? t + 1 : t
  1775. , o = t < e;
  1776. 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)),
  1777. a()
  1778. }
  1779. }
  1780. function f(e, t) {
  1781. for (var i = 0, n = ve[e].length; i < n; i++)
  1782. if (ve[e][i] === t)
  1783. return i;
  1784. return -1
  1785. }
  1786. function g() {
  1787. Ie.released && !B.isPaused && B.resume()
  1788. }
  1789. function y(e) {
  1790. return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
  1791. }
  1792. function A() {
  1793. Ie.history[0] = Ie.history[1],
  1794. Ie.history[1] = Ie.history[2],
  1795. Ie.history[2] = Ie.history[3],
  1796. Ie.history[3] = Ie.delta
  1797. }
  1798. function C(e) {
  1799. Ie.released = 0,
  1800. Ie.source = e,
  1801. Ie.slidee = "slidee" === e
  1802. }
  1803. function I(e) {
  1804. var t = "touchstart" === e.type
  1805. , i = e.data.source
  1806. , n = "slidee" === i;
  1807. 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),
  1808. C(i),
  1809. Ie.init = 0,
  1810. Ie.$source = xe(e.target),
  1811. Ie.touch = t,
  1812. Ie.pointer = t ? e.originalEvent.touches[0] : e,
  1813. Ie.initX = Ie.pointer.pageX,
  1814. Ie.initY = Ie.pointer.pageY,
  1815. Ie.initPos = n ? G.cur : X.cur,
  1816. Ie.start = +new Date,
  1817. Ie.time = 0,
  1818. Ie.path = 0,
  1819. Ie.delta = 0,
  1820. Ie.locked = 0,
  1821. Ie.history = [0, 0, 0, 0],
  1822. Ie.pathToLock = n ? t ? 30 : 10 : 0,
  1823. We.on(t ? qe : Ye, E),
  1824. B.pause(1),
  1825. (n ? U : j).addClass(F.draggedClass),
  1826. L("moveStart"),
  1827. n && (be = setInterval(A, 10)))
  1828. }
  1829. function E(e) {
  1830. if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
  1831. Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
  1832. Ie.pathX = Ie.pointer.pageX - Ie.initX,
  1833. Ie.pathY = Ie.pointer.pageY - Ie.initY,
  1834. Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
  1835. Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
  1836. Ie.released || !(Ie.path < 1)) {
  1837. if (!Ie.init) {
  1838. if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
  1839. return _();
  1840. Ie.init = 1
  1841. }
  1842. Pe(e),
  1843. !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
  1844. Ie.$source.on(Ze, Oe)),
  1845. Ie.released && (_(),
  1846. F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
  1847. Ie.delta += Ie.swing,
  1848. Ie.tweese = 10 < $e(Ie.swing))),
  1849. l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
  1850. }
  1851. }
  1852. function _() {
  1853. clearInterval(be),
  1854. Ie.released = !0,
  1855. We.off(Ie.touch ? qe : Ye, E),
  1856. (Ie.slidee ? U : j).removeClass(F.draggedClass),
  1857. setTimeout(function() {
  1858. Ie.$source.off(Ze, Oe)
  1859. }),
  1860. G.cur === G.dest && Ie.init && L("moveEnd"),
  1861. B.resume(1),
  1862. Ie.init = 0
  1863. }
  1864. function b(e) {
  1865. return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
  1866. }
  1867. function w() {
  1868. B.stop(),
  1869. We.off("mouseup", w)
  1870. }
  1871. function T(e) {
  1872. switch (Pe(e),
  1873. this) {
  1874. case ue[0]:
  1875. case de[0]:
  1876. B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
  1877. We.on("mouseup", w);
  1878. break;
  1879. case pe[0]:
  1880. B.prev();
  1881. break;
  1882. case fe[0]:
  1883. B.next();
  1884. break;
  1885. case ge[0]:
  1886. B.prevPage();
  1887. break;
  1888. case me[0]:
  1889. B.nextPage()
  1890. }
  1891. }
  1892. function x(e) {
  1893. e.originalEvent[He] = B;
  1894. var t = +new Date;
  1895. if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
  1896. ot = t;
  1897. else if (F.scrollBy && G.start !== G.end) {
  1898. var i = function(e) {
  1899. return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1900. Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1901. le ? (Ue = +new Date,
  1902. Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
  1903. Ee.last = Ue,
  1904. Ee.delta += Ee.curDelta,
  1905. $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
  1906. Ee.delta %= 1),
  1907. Ee.finalDelta) : Ee.curDelta
  1908. }(e.originalEvent);
  1909. (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
  1910. B.slideBy(F.scrollBy * i)
  1911. }
  1912. }
  1913. function S(e) {
  1914. F.clickBar && e.target === W[0] && (Pe(e),
  1915. l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
  1916. }
  1917. function M(e) {
  1918. if (F.keyboardNavBy)
  1919. switch (e.which) {
  1920. case F.horizontal ? 37 : 38:
  1921. Pe(e),
  1922. B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
  1923. break;
  1924. case F.horizontal ? 39 : 40:
  1925. Pe(e),
  1926. B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
  1927. }
  1928. }
  1929. function R(e) {
  1930. return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
  1931. }
  1932. function P() {
  1933. this.parentNode === Z[0] && B.activatePage(K.index(this))
  1934. }
  1935. function O(e) {
  1936. F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
  1937. }
  1938. function L(e, t) {
  1939. if (ve[e]) {
  1940. for (N = ve[e].length,
  1941. Je.length = 0,
  1942. D = 0; D < N; D++)
  1943. Je.push(ve[e][D]);
  1944. for (D = 0; D < N; D++)
  1945. Je[D].call(B, e, t)
  1946. }
  1947. }
  1948. 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 = {
  1949. start: 0,
  1950. center: 0,
  1951. end: 0,
  1952. cur: 0,
  1953. dest: 0
  1954. }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
  1955. start: 0,
  1956. end: 0,
  1957. cur: 0
  1958. }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
  1959. firstItem: 0,
  1960. lastItem: 0,
  1961. centerItem: 0,
  1962. activeItem: null,
  1963. activePage: 0
  1964. }, 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 = {
  1965. released: 1
  1966. }, Ee = {
  1967. last: 0,
  1968. delta: 0,
  1969. resetTime: 200
  1970. }, _e = 0, be = 0, we = 0, Te = 0;
  1971. V || (s = k[0]),
  1972. B.initialized = 0,
  1973. B.frame = s,
  1974. B.slidee = U[0],
  1975. B.pos = G,
  1976. B.rel = ee,
  1977. B.items = $,
  1978. B.pages = Q,
  1979. B.isPaused = 0,
  1980. B.options = F,
  1981. B.dragging = Ie,
  1982. B.reload = function() {
  1983. a()
  1984. }
  1985. ,
  1986. B.getPos = function(e) {
  1987. if (le) {
  1988. var t = h(e);
  1989. return -1 !== t && $[t]
  1990. }
  1991. var i = U.find(e).eq(0);
  1992. if (i[0]) {
  1993. var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
  1994. , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
  1995. return {
  1996. start: n,
  1997. center: n - H / 2 + r / 2,
  1998. end: n - H + r,
  1999. size: r
  2000. }
  2001. }
  2002. return !1
  2003. }
  2004. ,
  2005. B.moveBy = function(e) {
  2006. Ce.speed = e,
  2007. !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
  2008. Ce.startPos = G.cur,
  2009. C("button"),
  2010. Ie.init = 1,
  2011. L("moveStart"),
  2012. ze(Te),
  2013. t())
  2014. }
  2015. ,
  2016. B.stop = function() {
  2017. "button" === Ie.source && (Ie.init = 0,
  2018. Ie.released = 1)
  2019. }
  2020. ,
  2021. B.prev = function() {
  2022. B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
  2023. }
  2024. ,
  2025. B.next = function() {
  2026. B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
  2027. }
  2028. ,
  2029. B.prevPage = function() {
  2030. B.activatePage(ee.activePage - 1)
  2031. }
  2032. ,
  2033. B.nextPage = function() {
  2034. B.activatePage(ee.activePage + 1)
  2035. }
  2036. ,
  2037. B.slideBy = function(e, t) {
  2038. e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
  2039. }
  2040. ,
  2041. B.slideTo = function(e, t) {
  2042. l(e, t)
  2043. }
  2044. ,
  2045. B.toStart = function(e, t) {
  2046. i("start", e, t)
  2047. }
  2048. ,
  2049. B.toEnd = function(e, t) {
  2050. i("end", e, t)
  2051. }
  2052. ,
  2053. B.toCenter = function(e, t) {
  2054. i("center", e, t)
  2055. }
  2056. ,
  2057. B.getIndex = h,
  2058. B.activate = function(e, t) {
  2059. var i = m(e);
  2060. F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
  2061. }
  2062. ,
  2063. B.activatePage = function(e, t) {
  2064. De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
  2065. }
  2066. ,
  2067. B.resume = function(e) {
  2068. F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
  2069. we ? we = clearTimeout(we) : L("resume"),
  2070. we = setTimeout(function() {
  2071. switch (L("cycle"),
  2072. F.cycleBy) {
  2073. case "items":
  2074. B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
  2075. break;
  2076. case "pages":
  2077. B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
  2078. }
  2079. }, F.cycleInterval))
  2080. }
  2081. ,
  2082. B.pause = function(e) {
  2083. e < B.isPaused || (B.isPaused = e || 100,
  2084. we && (we = clearTimeout(we),
  2085. L("pause")))
  2086. }
  2087. ,
  2088. B.toggle = function() {
  2089. B[we ? "pause" : "resume"]()
  2090. }
  2091. ,
  2092. B.set = function(e, t) {
  2093. xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
  2094. }
  2095. ,
  2096. B.add = function(e, t) {
  2097. var i = xe(e);
  2098. le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
  2099. null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
  2100. a()
  2101. }
  2102. ,
  2103. B.remove = function(e) {
  2104. if (le) {
  2105. var t = u(e);
  2106. if (-1 < t) {
  2107. J.eq(t).remove();
  2108. var i = t === ee.activeItem;
  2109. null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
  2110. a(),
  2111. i && (ye.active = null,
  2112. B.activate(ee.activeItem))
  2113. }
  2114. } else
  2115. xe(e).remove(),
  2116. a()
  2117. }
  2118. ,
  2119. B.moveAfter = function(e, t) {
  2120. r(e, t, 1)
  2121. }
  2122. ,
  2123. B.moveBefore = function(e, t) {
  2124. r(e, t)
  2125. }
  2126. ,
  2127. B.on = function(e, t) {
  2128. if ("object" === Re(e))
  2129. for (var i in e)
  2130. e.hasOwnProperty(i) && B.on(i, e[i]);
  2131. else if ("function" === Re(t))
  2132. for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
  2133. ve[n[r]] = ve[n[r]] || [],
  2134. -1 === f(n[r], t) && ve[n[r]].push(t);
  2135. else if ("array" === Re(t))
  2136. for (var a = 0, s = t.length; a < s; a++)
  2137. B.on(e, t[a])
  2138. }
  2139. ,
  2140. B.one = function(t, i) {
  2141. B.on(t, function e() {
  2142. i.apply(B, arguments),
  2143. B.off(t, e)
  2144. })
  2145. }
  2146. ,
  2147. B.off = function(e, t) {
  2148. if (t instanceof Array)
  2149. for (var i = 0, n = t.length; i < n; i++)
  2150. B.off(e, t[i]);
  2151. else
  2152. for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
  2153. if (ve[r[o]] = ve[r[o]] || [],
  2154. null == t)
  2155. ve[r[o]].length = 0;
  2156. else {
  2157. var s = f(r[o], t);
  2158. -1 !== s && ve[r[o]].splice(s, 1)
  2159. }
  2160. }
  2161. ,
  2162. B.destroy = function() {
  2163. return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
  2164. We.off("keydown", M),
  2165. pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
  2166. J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
  2167. Z.empty(),
  2168. V || (k.off("." + He),
  2169. te.restore(),
  2170. ie.restore(),
  2171. ne.restore(),
  2172. re.restore(),
  2173. xe.removeData(s, He)),
  2174. $.length = Q.length = 0,
  2175. ye = {},
  2176. B.initialized = 0,
  2177. B
  2178. }
  2179. ,
  2180. B.init = function() {
  2181. if (!B.initialized) {
  2182. B.on(n);
  2183. var e = ["overflow", "position"]
  2184. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2185. te.save.apply(te, e),
  2186. ne.save.apply(ne, e),
  2187. ie.save.apply(ie, t),
  2188. re.save.apply(re, t);
  2189. var i = j;
  2190. return V || (i = i.add(U),
  2191. k.css("overflow", "hidden"),
  2192. Ve || "static" !== k.css("position") || k.css("position", "relative")),
  2193. Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
  2194. i.css({
  2195. position: "absolute"
  2196. })),
  2197. F.forward && ue.on(Ke, T),
  2198. F.backward && de.on(Ke, T),
  2199. F.prev && pe.on(Ze, T),
  2200. F.next && fe.on(Ze, T),
  2201. F.prevPage && ge.on(Ze, T),
  2202. F.nextPage && me.on(Ze, T),
  2203. ce.on(Xe, x),
  2204. W[0] && W.on(Ze, S),
  2205. le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
  2206. Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
  2207. he.on(je, {
  2208. source: "slidee"
  2209. }, I),
  2210. j && j.on(je, {
  2211. source: "handle"
  2212. }, I),
  2213. We.on("keydown", M),
  2214. V || (k.on("mouseenter." + He + " mouseleave." + He, O),
  2215. k.on("scroll." + He, Le)),
  2216. B.initialized = 1,
  2217. a(!0),
  2218. F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
  2219. B
  2220. }
  2221. }
  2222. }
  2223. function Re(e) {
  2224. 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
  2225. }
  2226. function Pe(e, t) {
  2227. e.preventDefault(),
  2228. t && e.stopPropagation()
  2229. }
  2230. function Oe(e) {
  2231. Pe(e, 1),
  2232. xe(this).off(e.type, Oe)
  2233. }
  2234. function Le() {
  2235. this.scrollLeft = 0,
  2236. this.scrollTop = 0
  2237. }
  2238. function De(e) {
  2239. return !isNaN(parseFloat(e)) && isFinite(e)
  2240. }
  2241. function Ne(e, t) {
  2242. return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2243. }
  2244. function Fe(e, t, i) {
  2245. return e < t ? t : i < e ? i : e
  2246. }
  2247. function Be(t) {
  2248. var i = {
  2249. style: {},
  2250. save: function() {
  2251. if (t && t.nodeType) {
  2252. for (var e = 0; e < arguments.length; e++)
  2253. i.style[arguments[e]] = t.style[arguments[e]];
  2254. return i
  2255. }
  2256. },
  2257. restore: function() {
  2258. if (t && t.nodeType) {
  2259. for (var e in i.style)
  2260. i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
  2261. return i
  2262. }
  2263. }
  2264. };
  2265. return i
  2266. }
  2267. 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;
  2268. function t(e) {
  2269. for (var t = 0, i = r.length; t < i; t++) {
  2270. var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2271. if (null != o.style[n])
  2272. return n
  2273. }
  2274. }
  2275. We.on(Xe, function(e) {
  2276. var t = e.originalEvent[He]
  2277. , i = +new Date;
  2278. (!t || t.options.scrollHijack < i - ot) && (ot = i)
  2279. }),
  2280. function(t) {
  2281. Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
  2282. var t = (new Date).getTime()
  2283. , i = Math.max(0, 16 - (t - r))
  2284. , n = setTimeout(e, i);
  2285. return r = t,
  2286. n
  2287. }
  2288. ;
  2289. var r = (new Date).getTime()
  2290. , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
  2291. ze = function(e) {
  2292. i.call(t, e)
  2293. }
  2294. }(window),
  2295. r = ["", "webkit", "moz", "ms", "o"],
  2296. o = document.createElement("div"),
  2297. Ve = t("transform"),
  2298. ke = t("perspective") ? "translateZ(0) " : "",
  2299. e.Sly = Me,
  2300. xe.fn.sly = function(n, r) {
  2301. var o, a;
  2302. return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
  2303. a = Array.prototype.slice.call(arguments, 1)),
  2304. n = {}),
  2305. this.each(function(e, t) {
  2306. var i = xe.data(t, He);
  2307. i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
  2308. })
  2309. }
  2310. ,
  2311. Me.defaults = {
  2312. slidee: null,
  2313. horizontal: !1,
  2314. itemNav: null,
  2315. itemSelector: null,
  2316. smart: !1,
  2317. activateOn: null,
  2318. activateMiddle: !1,
  2319. scrollSource: null,
  2320. scrollBy: 0,
  2321. scrollHijack: 300,
  2322. scrollTrap: !1,
  2323. dragSource: null,
  2324. mouseDragging: !1,
  2325. touchDragging: !1,
  2326. releaseSwing: !1,
  2327. swingSpeed: .2,
  2328. elasticBounds: !1,
  2329. interactive: null,
  2330. scrollBar: null,
  2331. dragHandle: !1,
  2332. dynamicHandle: !1,
  2333. minHandleSize: 50,
  2334. clickBar: !1,
  2335. syncSpeed: .5,
  2336. pagesBar: null,
  2337. activatePageOn: null,
  2338. pageBuilder: function(e) {
  2339. return "<li>" + (e + 1) + "</li>"
  2340. },
  2341. forward: null,
  2342. backward: null,
  2343. prev: null,
  2344. next: null,
  2345. prevPage: null,
  2346. nextPage: null,
  2347. cycleBy: null,
  2348. cycleInterval: 5e3,
  2349. pauseOnHover: !1,
  2350. startPaused: !1,
  2351. moveBy: 300,
  2352. speed: 0,
  2353. easing: "swing",
  2354. startAt: null,
  2355. keyboardNavBy: null,
  2356. draggedClass: "dragged",
  2357. activeClass: "active",
  2358. disabledClass: "disabled"
  2359. }
  2360. }(jQuery, window),
  2361. function o(a, s, l) {
  2362. function c(i, e) {
  2363. if (!s[i]) {
  2364. if (!a[i]) {
  2365. var t = "function" == typeof require && require;
  2366. if (!e && t)
  2367. return t(i, !0);
  2368. if (h)
  2369. return h(i, !0);
  2370. var n = new Error("Cannot find module '" + i + "'");
  2371. throw n.code = "MODULE_NOT_FOUND",
  2372. n
  2373. }
  2374. var r = s[i] = {
  2375. exports: {}
  2376. };
  2377. a[i][0].call(r.exports, function(e) {
  2378. var t = a[i][1][e];
  2379. return c(t || e)
  2380. }, r, r.exports, o, a, s, l)
  2381. }
  2382. return s[i].exports
  2383. }
  2384. for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
  2385. c(l[e]);
  2386. return c
  2387. }({
  2388. 1: [function(p, f, e) {
  2389. (function(e) {
  2390. "use strict";
  2391. function t(e) {
  2392. this.player = null,
  2393. this.director = null,
  2394. this.modelManager = null,
  2395. this.container = null,
  2396. this.tagManager = null,
  2397. this.fadeInSpeed = e,
  2398. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2399. }
  2400. var r = p("three")
  2401. , i = p("./util/logger")
  2402. , n = (p("./util/common"),
  2403. p("./enum/PlayerEvents"))
  2404. , o = p("./enum/DirectorEvents")
  2405. , a = p("./settings")
  2406. , s = p("./enum/Viewmode")
  2407. , l = (p("./enum/WarpStyle"),
  2408. p("./enum/BlackoutStyle"),
  2409. p("./enum/ModelManagerEvents"))
  2410. , c = p("./enum/tagEvents")
  2411. , h = p("./util/transitions")
  2412. , u = p("./util/lerp")
  2413. , d = new i(e);
  2414. window.THREE = r,
  2415. t.prototype.init = function(e, t, i, n, r) {
  2416. (window.app = this).player = t,
  2417. this.director = e,
  2418. this.modelManager = i,
  2419. this.tagManager = n,
  2420. this.container = r,
  2421. this.updateModel(),
  2422. this.bindEvents()
  2423. }
  2424. ,
  2425. t.prototype.bindEvents = function() {
  2426. this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
  2427. this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2428. this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2429. this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2430. this.player.on(n.StartInside, this.handleStartInside.bind(this)),
  2431. this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
  2432. this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
  2433. this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2434. this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
  2435. this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
  2436. }
  2437. ,
  2438. t.prototype.updateModel = function() {
  2439. this.model = this.modelManager.getActiveModel()
  2440. }
  2441. ,
  2442. t.prototype.handleWarpStarted = function() {
  2443. this.hidePlayerReticule()
  2444. }
  2445. ,
  2446. t.prototype.ontagActivated = function() {
  2447. this.hidePlayerReticule()
  2448. }
  2449. ,
  2450. t.prototype.onNavigationTotag = function() {
  2451. this.hidePlayerReticule()
  2452. }
  2453. ,
  2454. t.prototype.handlePlayerModeChanging = function(e, t, i) {
  2455. var n = this.modelManager.getActiveModel()
  2456. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
  2457. n.fadePanoMarkers(r),
  2458. n.setMode(t)
  2459. }
  2460. ,
  2461. t.prototype.handlePlayerModeChanged = function(e, t) {
  2462. var i = this.modelManager.getActiveModel()
  2463. , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
  2464. i.setSide(n),
  2465. i.setMode(t)
  2466. }
  2467. ,
  2468. t.prototype.handleClosestPanoChanging = function(e, t, i) {
  2469. i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2470. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2471. }
  2472. ,
  2473. t.prototype.handleActionInterruption = function() {}
  2474. ,
  2475. t.prototype.handleStartInside = function(e) {
  2476. var t = a[this.player.mode]
  2477. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2478. this.fadeIn(this.fadeInSpeed),
  2479. this.model.alpha = 0,
  2480. this.model.skybox.material.uniforms.opacity.value = 1,
  2481. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2482. var n = this.player.reticule;
  2483. h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2484. }
  2485. ,
  2486. t.prototype.handleStartOutside = function(e) {
  2487. this.fadeIn(e)
  2488. }
  2489. ,
  2490. t.prototype.fadeIn = function(e) {
  2491. null != e || (e = 2e3,
  2492. d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2493. $(this.container).fadeIn(e)
  2494. }
  2495. ,
  2496. t.prototype.hidePlayerReticule = function() {
  2497. this.player.reticule.hide()
  2498. }
  2499. ,
  2500. f.exports = t
  2501. }
  2502. ).call(this, "/js/DisplayController.js")
  2503. }
  2504. , {
  2505. "./enum/BlackoutStyle": 18,
  2506. "./enum/DirectorEvents": 23,
  2507. "./enum/tagEvents": 32,
  2508. "./enum/ModelManagerEvents": 33,
  2509. "./enum/PlayerEvents": 40,
  2510. "./enum/Viewmode": 51,
  2511. "./enum/WarpStyle": 52,
  2512. "./settings": 166,
  2513. "./util/common": 185,
  2514. "./util/lerp": 188,
  2515. "./util/logger": 189,
  2516. "./util/transitions": 195,
  2517. three: 217
  2518. }],
  2519. 2: [function(e, t, i) {
  2520. "use strict";
  2521. function n() {
  2522. this.baseStartTime = performance.timing.navigationStart,
  2523. this.loadingStartTime = null,
  2524. this.waitingStartTime = null,
  2525. this.appReadyTime = null
  2526. }
  2527. n.prototype.setBaseStartTime = function(e) {
  2528. this.baseStartTime = e || Date.now()
  2529. }
  2530. ,
  2531. n.prototype.setWaitingStartTime = function(e) {
  2532. this.waitingStartTime = e || Date.now()
  2533. }
  2534. ,
  2535. n.prototype.setLoadingStartTime = function(e) {
  2536. this.loadingStartTime = e || Date.now()
  2537. }
  2538. ,
  2539. n.prototype.setAppReadyTime = function(e) {
  2540. this.appReadyTime = e || Date.now()
  2541. }
  2542. ,
  2543. n.prototype.calcFullLoadingTime = function() {
  2544. var e = this.appReadyTime - this.baseStartTime;
  2545. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2546. e
  2547. }
  2548. ,
  2549. t.exports = n
  2550. }
  2551. , {}],
  2552. 3: [function(i, n, e) {
  2553. (function(e) {
  2554. "use strict";
  2555. function a() {
  2556. return 100 * Math.random()
  2557. }
  2558. var t = i("./util/logger")
  2559. , s = i("./util/browser")
  2560. , l = new t(e)
  2561. , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2562. initialized: !1,
  2563. init: function(e, t) {
  2564. if (t = t || {},
  2565. !this.initialized) {
  2566. for (var i in this.initialized = !0,
  2567. s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
  2568. s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
  2569. e) {
  2570. var n = i.match("^sc_tilegen_([0-9]+)$");
  2571. n && (c.tilegen = a() < parseInt(n[1]));
  2572. var r = i.match("^sc_imgopt_([0-9]+)$");
  2573. r && (c.imgopt = a() < parseInt(r[1]))
  2574. }
  2575. for (var o in t)
  2576. c[o] = t[o],
  2577. l.debug("A/B override:", o, c[o])
  2578. }
  2579. },
  2580. changeIfTileGenerating: function(e) {
  2581. return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
  2582. e += ""),
  2583. e
  2584. },
  2585. changeIfImageOptimzing: function(e) {
  2586. if(e.includes("blob:http"))return e;//add
  2587. return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
  2588. e += ""),
  2589. e
  2590. },
  2591. tilegen: !1,
  2592. imgopt: !1
  2593. };
  2594. n.exports = c
  2595. }
  2596. ).call(this, "/js/ab.js")
  2597. }
  2598. , {
  2599. "./util/browser": 182,
  2600. "./util/logger": 189
  2601. }],
  2602. 4: [function(u, d, e) {
  2603. (function(e) {
  2604. "use strict";
  2605. function r(n, e, t, i) {
  2606. function r(e) {
  2607. a[e.sid] = !0;
  2608. var t = e.billboard.media && e.billboard.media.type
  2609. , i = {
  2610. tag_id: e.sid,
  2611. tags_visited: Object.keys(a).length,
  2612. tag_count: Object.keys(n.tags).length,
  2613. tag_view_count: ++d,
  2614. has_media: !!t
  2615. };
  2616. t && (i.media_type = t),
  2617. g("tag_opened", i)
  2618. }
  2619. var o, a = {}, s = Date.now() - P, l = null;
  2620. i && (l = Date.now() - window.navigationStart);
  2621. try {
  2622. o = n.data.player_options.highlight_reel && 0 < n.heroLocations.length
  2623. } catch (n) {
  2624. o = !1
  2625. }
  2626. var c, h = n.supportsVR;
  2627. h || (c = "VR disabled at the model/account level",
  2628. 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"))),
  2629. g("model_loaded", {
  2630. duration: s,
  2631. duration_from_navigation_start: l,
  2632. has_hlr: o,
  2633. has_vr: h,
  2634. vr_reason: c
  2635. });
  2636. var u = 0;
  2637. n.panos.forEach(function(e) {
  2638. e.on("enter", function() {
  2639. f("pano_viewed", {
  2640. pano_id: e.id,
  2641. pano_view_count: ++u,
  2642. alignment_type: e.alignmentType,
  2643. interaction_source: R,
  2644. navigation_source: v
  2645. })
  2646. })
  2647. });
  2648. var d = 0;
  2649. for (var p in n.tags)
  2650. n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
  2651. e.on("tour_auto", function(e) {
  2652. v = "tour_" + e
  2653. }),
  2654. e.on("tour_manual", function(e) {
  2655. R = "gui-" + e,
  2656. v = "tour_manual"
  2657. }),
  2658. t.on(C.InteractionKey, function() {
  2659. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
  2660. }),
  2661. t.on(C.InteractionDirect, function() {
  2662. e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
  2663. }),
  2664. function(t) {
  2665. I.on(T.OPENED, function() {
  2666. f("showcase_share_intent", {
  2667. pano_id: t.currentPano && t.currentPano.id
  2668. })
  2669. }),
  2670. I.on(T.LINK_CLICKED, function(e) {
  2671. f("showcase_share_action", {
  2672. channel: e.channel,
  2673. pano_id: t.currentPano && t.currentPano.id
  2674. })
  2675. }),
  2676. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2677. f("showcase_share_origin_link_clicked")
  2678. })
  2679. }(e),
  2680. function() {
  2681. _.on(S.OPENED, f.bind(this, "showcase_gui", {
  2682. gui_action: "click_vr_button"
  2683. })),
  2684. _.on(S.LAUNCH, function(e) {
  2685. f("showcase_gui", {
  2686. gui_action: "launch_vr",
  2687. vr_platform: e.vr_platform,
  2688. vr_app: e.vr_app
  2689. })
  2690. }),
  2691. _.on(S.PREV, f.bind(this, "showcase_gui", {
  2692. gui_action: "vr_modal_prev"
  2693. })),
  2694. _.on(S.NEXT, function(e) {
  2695. f("showcase_gui", {
  2696. gui_action: e.nextAction
  2697. })
  2698. }),
  2699. _.on(S.CLOSED, f.bind(this, "showcase_gui", {
  2700. gui_action: "vr_modal_close"
  2701. })),
  2702. _.on(S.falseICECHOSEN, function(e) {
  2703. f("showcase_gui", {
  2704. gui_action: e.name + " "
  2705. })
  2706. }),
  2707. _.on(S.STORE, function(e) {
  2708. f("showcase_gui", {
  2709. gui_action: "launch_store",
  2710. store: e
  2711. })
  2712. })
  2713. }()
  2714. }
  2715. function f(e, t) {
  2716. if (t = t || {},
  2717. i)
  2718. try {
  2719. window.analytics.track(e, s.extendObject(t, c), {
  2720. context: {
  2721. app: {
  2722. name: "showcase",
  2723. version: "2.25.6-0-gd87e5b1"
  2724. },
  2725. screen: {
  2726. width: window.screen.width,
  2727. height: window.screen.height,
  2728. density: window.devicePixelRatio
  2729. }
  2730. }
  2731. })
  2732. } catch (t) {
  2733. console.warn("Failed to send data to segment for " + e)
  2734. }
  2735. }
  2736. function g(e, t) {
  2737. f(e, t = t || {})
  2738. }
  2739. function m(e, t) {
  2740. R = e === C.InteractionGui ? "gui-" + t : e,
  2741. v = "self_guided"
  2742. }
  2743. var v, o, a = (u("three"),
  2744. u("./util/ajax"),
  2745. u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
  2746. 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"),
  2747. "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
  2748. d.exports = {
  2749. report: function(e, t, i, n) {
  2750. !function(e, t) {
  2751. if (o)
  2752. try {
  2753. o.addEvent(e, s.extendObject({
  2754. host: window.location.host,
  2755. keen: {
  2756. addons: [{
  2757. name: "keen:ua_parser",
  2758. input: {
  2759. ua_string: "user_agent"
  2760. },
  2761. output: "parsed_user_agent"
  2762. }]
  2763. },
  2764. user_agent: "${keen.user_agent}",
  2765. referrer: {
  2766. url: s.normalizeUrl(document.referrer),
  2767. domain: s.domainFromUrl(document.referrer),
  2768. url_original: document.referrer
  2769. },
  2770. embedded: y.inIframe(),
  2771. is_mobile: y.isMobile(),
  2772. version: "2.25.6-0-gd87e5b1"
  2773. }, t))
  2774. } catch (e) {
  2775. l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2776. }
  2777. }("Session starts", {
  2778. model: e,
  2779. status: t,
  2780. loadtime: Date.now() - (P || Date.now()),
  2781. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2782. autoplay: i,
  2783. quickstart: n,
  2784. ab_tilegen: a.tilegen,
  2785. ab_imgopt: a.imgopt
  2786. })
  2787. },
  2788. impression: function(e) {
  2789. g("impression", {
  2790. visible: void 0 === (e = e || {}).isVisible || e.isVisible,
  2791. url_params: (void 0 !== e.immediate && e.immediate,
  2792. window.location.search.substr(1).split("&"))
  2793. })
  2794. },
  2795. initKeen: function(e) {
  2796. return e.token && e.appId ? void (o = new Keen({
  2797. projectId: e.appId,
  2798. writeKey: e.token,
  2799. readKey: "",
  2800. requestType: "xhr"
  2801. })) : void l.warn("no keen token/appId")
  2802. },
  2803. initSegment: function(e) {
  2804. return e.token ? (i = e.token,
  2805. window.analytics.load(e.token),
  2806. c = {
  2807. model_id: e.model,
  2808. start_source: e.startSource,
  2809. autoplay: e.autoplay,
  2810. quickstart: e.quickstart,
  2811. language_tag: t.languageTag,
  2812. is_mobile: y.isMobile(),
  2813. iframe: y.inIframe(),
  2814. aspect_ratio: y.aspectRatio(),
  2815. session_id: h,
  2816. window: {
  2817. width: $("#player").width(),
  2818. height: $("#player").height()
  2819. },
  2820. platform: {
  2821. browser: {
  2822. name: $.ua.browser.name,
  2823. major: $.ua.browser.major,
  2824. version: $.ua.browser.version
  2825. },
  2826. os: {
  2827. name: $.ua.os.name,
  2828. version: $.ua.os.version
  2829. },
  2830. device: {
  2831. vendor: $.ua.device.vendor,
  2832. model: $.ua.device.model,
  2833. type: $.ua.device.type
  2834. }
  2835. }
  2836. },
  2837. n = Math.random() < t.analytics.sessionTrackingRate,
  2838. l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
  2839. void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
  2840. },
  2841. sessionStart: function(e) {
  2842. l.debug("analytics user_session_start"),
  2843. f("session_started"),
  2844. P = Date.now(),
  2845. window.addEventListener("unload", function() {
  2846. !function(e, t) {
  2847. if (t = t || {},
  2848. navigator.sendBeacon && i)
  2849. try {
  2850. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2851. event: e,
  2852. anonymousId: window.analytics.user().anonymousId(),
  2853. properties: s.extendObject(t, c),
  2854. writeKey: i,
  2855. sentAt: Date.now(),
  2856. type: "track",
  2857. context: {
  2858. userAgent: y.userAgent(),
  2859. library: {
  2860. name: "showcase-beacon",
  2861. version: "2.25.6-0-gd87e5b1"
  2862. },
  2863. app: {
  2864. name: "showcase",
  2865. version: "2.25.6-0-gd87e5b1"
  2866. }
  2867. }
  2868. }))
  2869. } catch (e) {
  2870. console.warn("Failed to send async segment request")
  2871. }
  2872. }("session_ended", {
  2873. duration: Date.now() - P
  2874. })
  2875. })
  2876. },
  2877. modelLoaded: function(e, t, i, n) {
  2878. r(e, t, i, n)
  2879. },
  2880. loadComplete: function(e) {
  2881. f("load_times", {
  2882. time_to_app_start: e
  2883. })
  2884. },
  2885. track: function(e, t) {
  2886. n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2887. f(e, t))
  2888. },
  2889. trackAlways: function(e, t) {
  2890. l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2891. f(e, t)
  2892. },
  2893. getSessionId: function() {
  2894. return h
  2895. },
  2896. updateInteraction: m
  2897. }
  2898. }
  2899. ).call(this, "/js/analytics.js")
  2900. }
  2901. , {
  2902. "./ab": 3,
  2903. "./enum/ControlEvents": 21,
  2904. "./enum/PlayerEvents": 40,
  2905. "./enum/VROption": 47,
  2906. "./enum/VRPlatforms": 49,
  2907. "./enum/Viewmode": 51,
  2908. "./gui/sharing/ShareEvents": 76,
  2909. "./gui/sharing/modal": 77,
  2910. "./gui/title/TitleEvents": 80,
  2911. "./gui/title/titleBar": 82,
  2912. "./gui/vr/vrEvent": 85,
  2913. "./gui/vr/vrModal": 87,
  2914. "./localization/localize": 108,
  2915. "./tag/Billboard/BillboardEvent": 120,
  2916. "./settings": 166,
  2917. "./util/ajax": 181,
  2918. "./util/browser": 182,
  2919. "./util/common": 185,
  2920. "./util/logger": 189,
  2921. three: 217
  2922. }],
  2923. 5: [function(e, t, i) {
  2924. "use strict";
  2925. function n() {
  2926. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2927. this.controls = null
  2928. }
  2929. var r = e("three")
  2930. , o = e("../constants")
  2931. , a = e("../util/cameraLight");
  2932. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2933. this.aspect = e,
  2934. this.updateProjectionMatrix()
  2935. }
  2936. ,
  2937. t.exports = n
  2938. }
  2939. , {
  2940. "../constants": 8,
  2941. "../util/cameraLight": 184,
  2942. three: 217
  2943. }],
  2944. 6: [function(e, t, i) {
  2945. "use strict";
  2946. function n() {
  2947. var e = $("#player").width() / $("#player").height();
  2948. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  2949. this.controls = null,
  2950. this.updateAspect(e)
  2951. }
  2952. var r = e("three")
  2953. , o = e("../constants");
  2954. (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
  2955. this.aspect = e,
  2956. this.top = o.orthoBase / e,
  2957. this.bottom = -o.orthoBase / e,
  2958. this.updateProjectionMatrix()
  2959. }
  2960. ,
  2961. t.exports = n
  2962. }
  2963. , {
  2964. "../constants": 8,
  2965. three: 217
  2966. }],
  2967. 7: [function(e, t, i) {
  2968. "use strict";
  2969. function n() {
  2970. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  2971. this.controls = null
  2972. }
  2973. var r = e("three")
  2974. , o = e("../settings")
  2975. , a = e("../util/cameraLight");
  2976. (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
  2977. this.aspect = e,
  2978. this.updateProjectionMatrix()
  2979. }
  2980. ,
  2981. t.exports = n
  2982. }
  2983. , {
  2984. "../settings": 166,
  2985. "../util/cameraLight": 184,
  2986. three: 217
  2987. }],
  2988. 8: [function(e, t, i) {
  2989. "use strict";
  2990. t.exports = {
  2991. signedUrlDefaultExpireTime: 24e4,
  2992. signedUrlCheckInterval: 1e4,
  2993. signedUrlRefreshBuffer: 15e3,
  2994. dollhouseFOV: 70,
  2995. dollhouseNear: 1,
  2996. dollhouseFar: 5e3,
  2997. insideFOV: 70,
  2998. insideFOVMax: 120,
  2999. insideNear: .1,
  3000. insideFar: 5e3,
  3001. insideLookSpeed: .12,
  3002. insideLookLimitUp: 40,
  3003. insideLookLimitDown: -40,
  3004. orthoNear: 1,
  3005. orthoFar: 5e3,
  3006. orthoBase: 10,
  3007. narrowLandscapeHeight: 290,
  3008. reallyNarrowLandscapeHeight: 250,
  3009. visionTilingStartDate: new Date("8/26/2016"),
  3010. visionTilingStartVersion: "1.1.407.13667",
  3011. windowHeightHighQualityThreshold: 900,
  3012. tourStepDelayDefault: 3500,
  3013. tourStepDelaySlideShow: 5e3,
  3014. workshopApsect: 9 / 16,
  3015. highQualityMaxZoom: 2,
  3016. ultraHighQualityMaxZoom: 3
  3017. }
  3018. }
  3019. , {}],
  3020. 9: [function(e, t, i) {
  3021. "use strict";
  3022. function n() {
  3023. this.activeControl = null,
  3024. this.controls = {},
  3025. this.cameras = {}
  3026. }
  3027. var a = e("./PanoramaControls")
  3028. , s = e("./DollhouseControls")
  3029. , l = e("./FloorplanControls")
  3030. , c = e("../cameras/PanoramaCamera")
  3031. , h = e("../cameras/DollhouseCamera")
  3032. , u = e("../cameras/FloorplanCamera")
  3033. , r = e("events").EventEmitter
  3034. , d = e("../enum/ControlEvents")
  3035. , o = e("../enum/ModelManagerEvents")
  3036. , p = e("../enum/Viewmode")
  3037. , f = e("../settings");
  3038. (n.prototype = Object.create(r.prototype)).init = function(e, t) {
  3039. this.setUpControls(),
  3040. this.bindEvents(e, t)
  3041. }
  3042. ,
  3043. n.prototype.activateControls = function(e) {
  3044. this.activeControl && (this.activeControl.reset(),
  3045. this.activeControl.enabled = !1),
  3046. this.controls[e] && (this.controls[e].enabled = !0),
  3047. this.activeControl = this.controls[e]
  3048. }
  3049. ,
  3050. n.prototype.setUpControls = function() {
  3051. var i = {}
  3052. , n = {}
  3053. , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3054. , r = [c, h, u]
  3055. , o = [a, s, l];
  3056. e.forEach(function(e, t) {
  3057. i[e] = new r[t],
  3058. n[e] = new o[t](i[e]),
  3059. n[e].on(d.Move, this.emit.bind(this, d.Move)),
  3060. n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
  3061. n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
  3062. n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
  3063. n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
  3064. n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
  3065. }
  3066. .bind(this)),
  3067. this.controls = n,
  3068. this.cameras = i
  3069. }
  3070. ,
  3071. n.prototype.bindEvents = function(e, t) {
  3072. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3073. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3074. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3075. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3076. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
  3077. passive: !1
  3078. }),
  3079. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3080. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3081. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3082. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3083. e.addEventListener("contextmenu", function(e) {
  3084. e.preventDefault()
  3085. }),
  3086. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3087. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3088. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3089. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3090. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3091. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3092. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3093. t.on(o.ActiveModelChanged, function(e) {
  3094. this.setModelForControls(e.model)
  3095. }
  3096. .bind(this))
  3097. }
  3098. ,
  3099. n.prototype.setModelForControls = function(e) {
  3100. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3101. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3102. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3103. this.controls[e].setBounds(t)
  3104. }
  3105. .bind(this))
  3106. }
  3107. ,
  3108. n.prototype.onMouseDown = function(e) {
  3109. e.preventDefault(),
  3110. this.activeControl && this.activeControl.onMouseDown(e)
  3111. }
  3112. ,
  3113. n.prototype.onMouseMove = function(e) {
  3114. e.preventDefault(),
  3115. this.activeControl && this.activeControl.onMouseMove(e)
  3116. }
  3117. ,
  3118. n.prototype.onMouseUp = function(e) {
  3119. e.preventDefault(),
  3120. this.activeControl && this.activeControl.onMouseUp(e)
  3121. }
  3122. ,
  3123. n.prototype.onMouseOver = function(e) {
  3124. e.preventDefault(),
  3125. this.activeControl && this.activeControl.onMouseOver(e)
  3126. }
  3127. ,
  3128. n.prototype.onMouseWheel = function(e) {
  3129. e.preventDefault(),
  3130. this.activeControl && this.activeControl.onMouseWheel(e)
  3131. }
  3132. ,
  3133. n.prototype.onTouchStart = function(e) {
  3134. e.preventDefault(),
  3135. this.activeControl && this.activeControl.onTouchStart(e),
  3136. $("#hotListWrap")[0].classList.remove("hotListActive"),
  3137. $("#hotListContent ul .active").removeClass("active"),
  3138. $("#hotList")[0].classList.remove("active")
  3139. }
  3140. ,
  3141. n.prototype.onTouchMove = function(e) {
  3142. e.preventDefault(),
  3143. this.activeControl && this.activeControl.onTouchMove(e)
  3144. }
  3145. ,
  3146. n.prototype.onTouchEnd = function(e) {
  3147. e.preventDefault(),
  3148. this.activeControl && this.activeControl.onTouchEnd(e)
  3149. }
  3150. ,
  3151. n.prototype.onPointerDown = function(e) {
  3152. if (e.preventDefault(),
  3153. this.activeControl)
  3154. switch (e.pointerType) {
  3155. case "mouse":
  3156. this.activeControl.onMouseDown(e);
  3157. break;
  3158. default:
  3159. this.activeControl.onPointerDown(e)
  3160. }
  3161. }
  3162. ,
  3163. n.prototype.onPointerMove = function(e) {
  3164. if (e.preventDefault(),
  3165. this.activeControl)
  3166. switch (e.pointerType) {
  3167. case "mouse":
  3168. this.activeControl.onMouseMove(e);
  3169. break;
  3170. default:
  3171. this.activeControl.onPointerMove(e)
  3172. }
  3173. }
  3174. ,
  3175. n.prototype.onPointerUp = function(e) {
  3176. if (e.preventDefault(),
  3177. this.activeControl)
  3178. switch (e.pointerType) {
  3179. case "mouse":
  3180. this.activeControl.onMouseUp(e);
  3181. break;
  3182. default:
  3183. this.activeControl.onPointerUp(e)
  3184. }
  3185. }
  3186. ,
  3187. n.prototype.onPointerCancel = function(e) {
  3188. e.preventDefault(),
  3189. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3190. }
  3191. ,
  3192. n.prototype.onKeyDown = function(e) {
  3193. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3194. this.activeControl && this.activeControl.onKeyDown(e))
  3195. }
  3196. ,
  3197. n.prototype.onKeyUp = function(e) {
  3198. e.preventDefault(),
  3199. this.activeControl && this.activeControl.onKeyUp(e)
  3200. }
  3201. ,
  3202. t.exports = n
  3203. }
  3204. , {
  3205. "../cameras/DollhouseCamera": 5,
  3206. "../cameras/FloorplanCamera": 6,
  3207. "../cameras/PanoramaCamera": 7,
  3208. "../enum/ControlEvents": 21,
  3209. "../enum/ModelManagerEvents": 33,
  3210. "../enum/Viewmode": 51,
  3211. "../settings": 166,
  3212. "./DollhouseControls": 10,
  3213. "./FloorplanControls": 11,
  3214. "./PanoramaControls": 13,
  3215. events: 202
  3216. }],
  3217. 10: [function(e, t, i) {
  3218. "use strict";
  3219. function n(e) {
  3220. a.call(this, e),
  3221. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3222. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3223. this.minDistance = o.dollhouseDefault.minDistance,
  3224. this.maxDistance = o.dollhouseDefault.maxDistance,
  3225. this.adjustedMinDistance = this.minDistance,
  3226. this.adjustedMaxDistance = this.maxDistance
  3227. }
  3228. var r = e("three")
  3229. , o = e("../settings")
  3230. , a = e("./OutsideControls");
  3231. (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
  3232. this.camera.updateMatrix();
  3233. var i = this.camera.position.clone().sub(this.target).length();
  3234. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3235. this.panLeft(2 * e * i / $("#player").height()),
  3236. this.panUp(-2 * t * i / $("#player").height())
  3237. }
  3238. ,
  3239. n.prototype.updateZoom = function() {
  3240. return this.offset.length() * this.scale
  3241. }
  3242. ,
  3243. n.prototype.setZoomBounds = function(e) {
  3244. var t = e.min.distanceTo(e.max);
  3245. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3246. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3247. this.minDistance = this.adjustedMinDistance,
  3248. this.maxDistance = this.adjustedMaxDistance
  3249. }
  3250. ,
  3251. n.prototype.resetRanges = function(e, t) {
  3252. e ? (this.minDistance = Math.min(e, this.minDistance),
  3253. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3254. this.maxDistance = this.adjustedMaxDistance),
  3255. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3256. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3257. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3258. }
  3259. ,
  3260. n.prototype.toJSON = function() {
  3261. return a.prototype.toJSON.call(this)
  3262. }
  3263. ,
  3264. t.exports = n
  3265. }
  3266. , {
  3267. "../settings": 166,
  3268. "./OutsideControls": 12,
  3269. three: 217
  3270. }],
  3271. 11: [function(e, t, i) {
  3272. "use strict";
  3273. function n(e) {
  3274. c.call(this, e),
  3275. this.minDistance = 15,
  3276. this.maxDistance = 50,
  3277. this.noRotateUpDown = !0,
  3278. this.minPolarAngle = 0,
  3279. this.maxPolarAngle = 0,
  3280. this.mouseActions[u.LEFT] = h.PAN,
  3281. this.mouseActions[u.MIDDLE] = h.DOLLY,
  3282. this.mouseActions[u.RIGHT] = h.ROTATE,
  3283. this.touchActions[1] = h.PAN,
  3284. this.touchActions[2] = h.ROTATE_DOLLY,
  3285. this.absoluteScale = 1,
  3286. this.currentScale = 1
  3287. }
  3288. 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");
  3289. (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
  3290. var t = Math.max(e.x, e.z)
  3291. , i = Math.min(e.x, e.z)
  3292. , n = Math.max(t, i * this.camera.aspect)
  3293. , r = Math.max(i, t * this.camera.aspect);
  3294. this.absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2,
  3295. this.currentScale = this.absoluteScale
  3296. }
  3297. ,
  3298. n.prototype.rotateToView = function(e, t) {
  3299. var i = 0;
  3300. p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
  3301. this.rotateLeft(i),
  3302. this.update(0)
  3303. }
  3304. ,
  3305. n.prototype.pan = function(e, t) {
  3306. this.camera.updateMatrix(),
  3307. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3308. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3309. }
  3310. ,
  3311. n.prototype.updateZoom = function() {
  3312. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3313. this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
  3314. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3315. this.camera.left = -l.orthoBase * this.currentScale,
  3316. this.camera.right = l.orthoBase * this.currentScale,
  3317. this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
  3318. this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
  3319. this.camera.updateProjectionMatrix(),
  3320. this.offset.length()
  3321. }
  3322. ,
  3323. n.prototype.toJSON = (r = new s.Quaternion,
  3324. o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
  3325. a = new s.Quaternion,
  3326. function() {
  3327. var e = c.prototype.toJSON.call(this);
  3328. return r.copy(e.camera_quaternion),
  3329. a.copy(o),
  3330. a.multiply(r),
  3331. e.camera_quaternion.x = d.toPrecision(a.x, 4),
  3332. e.camera_quaternion.y = d.toPrecision(a.y, 4),
  3333. e.camera_quaternion.z = d.toPrecision(a.z, 4),
  3334. e.camera_quaternion.w = d.toPrecision(a.w, 4),
  3335. e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
  3336. e
  3337. }
  3338. ),
  3339. t.exports = n
  3340. }
  3341. , {
  3342. "../enum/ControlActions": 20,
  3343. "../enum/MouseButton": 34,
  3344. "../settings": 166,
  3345. "../util/browser": 182,
  3346. "../util/math": 190,
  3347. "./OutsideControls": 12,
  3348. three: 217
  3349. }],
  3350. 12: [function(e, t, i) {
  3351. "use strict";
  3352. function n(e) {
  3353. this.camera = e,
  3354. (this.camera.controls = this).enabled = !1,
  3355. this.target = new a.Vector3,
  3356. this.targetBounds = new a.Box3,
  3357. this.zoomSpeed = 1,
  3358. this.minDistance = 0,
  3359. this.maxDistance = 1 / 0,
  3360. this.noRotateUpDown = !1,
  3361. this.rotateSpeed = 1,
  3362. this.keyboardZoomSpeed = 0,
  3363. this.keyPanSpeed = 7,
  3364. this.autoRotate = !1,
  3365. this.autoRotateSpeed = 2,
  3366. this.autoPan = !1,
  3367. this.autoPanPosition = new a.Vector3,
  3368. this.minPolarAngle = a.Math.degToRad(25),
  3369. this.maxPolarAngle = a.Math.degToRad(65),
  3370. this.rotationAcceleration = new a.Vector2,
  3371. this.rotationSpeed = new a.Vector2,
  3372. this.panAcceleration = new a.Vector2,
  3373. this.panSpeed = new a.Vector2,
  3374. this.rotateStart = new a.Vector2,
  3375. this.rotateEnd = new a.Vector2,
  3376. this.rotateDelta = new a.Vector2,
  3377. this.panStart = new a.Vector2,
  3378. this.panEnd = new a.Vector2,
  3379. this.panDelta = new a.Vector2,
  3380. this.panOffset = new a.Vector3,
  3381. this.offset = new a.Vector3,
  3382. this.dollyStart = new a.Vector2,
  3383. this.dollyEnd = new a.Vector2,
  3384. this.dollyDelta = new a.Vector2,
  3385. this.phiDelta = 0,
  3386. this.thetaDelta = 0,
  3387. this.scale = 1,
  3388. this.panVector = new a.Vector3,
  3389. this.lastPosition = new a.Vector3,
  3390. this.state = u.NONE,
  3391. this.mouseActions = {},
  3392. this.mouseActions[d.LEFT] = u.ROTATE,
  3393. this.mouseActions[d.MIDDLE] = u.DOLLY,
  3394. this.mouseActions[d.RIGHT] = u.PAN,
  3395. this.touchActions = {},
  3396. this.touchActions[1] = u.ROTATE,
  3397. this.touchActions[2] = u.PAN_DOLLY,
  3398. this.lastMoveTime = 0,
  3399. this.pointersLimit = 2,
  3400. this.pointers = []
  3401. }
  3402. 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;
  3403. (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
  3404. this.targetBounds = e
  3405. }
  3406. ,
  3407. n.prototype.isEngaged = function() {
  3408. return this.state !== u.NONE
  3409. }
  3410. ,
  3411. n.prototype.rotateLeft = function(e) {
  3412. void 0 === e && (e = this.getAutoRotationAngle()),
  3413. this.thetaDelta -= e
  3414. }
  3415. ,
  3416. n.prototype.rotateUp = function(e) {
  3417. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3418. this.phiDelta -= e)
  3419. }
  3420. ,
  3421. n.prototype.panLeft = function(e) {
  3422. var t = this.camera.matrix.elements;
  3423. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3424. this.panOffset.multiplyScalar(-e),
  3425. this.panVector.add(this.panOffset)
  3426. }
  3427. ,
  3428. n.prototype.panUp = function(e) {
  3429. var t = this.camera.matrix.elements;
  3430. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3431. this.panOffset.multiplyScalar(-e),
  3432. this.panVector.add(this.panOffset)
  3433. }
  3434. ,
  3435. n.prototype.startRotating = function(e, t) {
  3436. e && this.navRotationAcc("x", e),
  3437. t && this.navRotationAcc("y", t)
  3438. }
  3439. ,
  3440. n.prototype.stopRotating = function(e) {
  3441. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3442. this.navRotationAcc("x", 0),
  3443. this.navRotationAcc("y", 0)
  3444. }
  3445. ,
  3446. n.prototype.setAutoPanPosition = (r = new a.Vector3,
  3447. o = new a.Vector3,
  3448. function(e, t) {
  3449. r.copy(this.camera.position),
  3450. void 0 === e && null === e || r.setX(e),
  3451. void 0 === t && null === t || r.setZ(t);
  3452. var i = this.camera.position.distanceTo(this.target)
  3453. , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3454. this.targetClamped = !1,
  3455. o.copy(r).addScaledVector(n, i),
  3456. this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
  3457. r.copy(o).addScaledVector(n, -i),
  3458. this.targetClamped = !0),
  3459. this.autoPanPosition.x = r.x,
  3460. this.autoPanPosition.z = r.z,
  3461. this.autoPan && this.stopAutoPanning()
  3462. }
  3463. ),
  3464. n.prototype.stopAutoPanning = function() {
  3465. var e = this.autoPan;
  3466. this.autoPan = !1,
  3467. this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
  3468. }
  3469. ,
  3470. n.prototype.dollyIn = function(e) {
  3471. void 0 === e && (e = this.getZoomScale()),
  3472. this.scale /= e
  3473. }
  3474. ,
  3475. n.prototype.dollyOut = function(e) {
  3476. void 0 === e && (e = this.getZoomScale()),
  3477. this.scale *= e
  3478. }
  3479. ,
  3480. n.prototype.updatePan = function(e) {
  3481. if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
  3482. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3483. this.autoPan) {
  3484. var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3485. t.setY(0).clampLength(0, 50 * e),
  3486. this.target.add(t),
  3487. this.camera.position.add(t),
  3488. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3489. this.stopAutoPanning())
  3490. }
  3491. }
  3492. ,
  3493. n.prototype.update = function(e) {
  3494. e = e || 1 / 60,
  3495. this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
  3496. this.rotateLeft(-this.rotationSpeed.x),
  3497. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3498. this.updatePan(e);
  3499. var t = this.camera.position;
  3500. this.offset.copy(t).sub(this.target);
  3501. var i = Math.atan2(this.offset.x, this.offset.z)
  3502. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3503. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3504. i += this.thetaDelta,
  3505. n += this.phiDelta,
  3506. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3507. n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
  3508. var r = this.updateZoom();
  3509. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3510. this.target.add(this.panVector),
  3511. this.targetBounds.clampPoint(this.target, this.target),
  3512. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3513. this.offset.y = r * Math.cos(n),
  3514. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3515. t.copy(this.target).add(this.offset),
  3516. this.camera.lookAt(this.target),
  3517. this.thetaDelta = 0,
  3518. this.phiDelta = 0,
  3519. this.scale = 1,
  3520. this.panVector.set(0, 0, 0),
  3521. 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
  3522. }
  3523. ,
  3524. n.prototype.getAutoRotationAngle = function() {
  3525. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3526. }
  3527. ,
  3528. n.prototype.getZoomScale = function() {
  3529. return Math.pow(.95, this.zoomSpeed)
  3530. }
  3531. ,
  3532. n.prototype.onMouseDown = function(e) {
  3533. if (this.enabled) {
  3534. switch (e.preventDefault(),
  3535. this.stopAutoPanning(),
  3536. this.mouseDown = !0,
  3537. this.state = this.mouseActions[e.button],
  3538. this.state) {
  3539. case u.ROTATE:
  3540. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3541. this.rotationSpeed.set(0, 0);
  3542. break;
  3543. case u.DOLLY:
  3544. this.dollyStart.set(e.clientX, e.clientY);
  3545. break;
  3546. case u.PAN:
  3547. this.panStart.set(e.clientX, e.clientY)
  3548. }
  3549. this.emit(f.InputStart, "mouse")
  3550. }
  3551. }
  3552. ,
  3553. n.prototype.onMouseMove = function(e) {
  3554. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3555. switch (e.preventDefault(),
  3556. this.state) {
  3557. case u.ROTATE:
  3558. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3559. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3560. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3561. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3562. this.rotateStart.copy(this.rotateEnd);
  3563. break;
  3564. case u.DOLLY:
  3565. this.dollyEnd.set(e.clientX, e.clientY),
  3566. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
  3567. (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
  3568. this.dollyStart.copy(this.dollyEnd);
  3569. break;
  3570. case u.PAN:
  3571. this.panEnd.set(e.clientX, e.clientY),
  3572. this.panDelta.subVectors(this.panEnd, this.panStart),
  3573. this.pan(this.panDelta.x, this.panDelta.y),
  3574. this.panStart.copy(this.panEnd)
  3575. }
  3576. this.emit(f.Move, "mouse"),
  3577. this.lastMoveTime = e.timeStamp,
  3578. this.update()
  3579. }
  3580. }
  3581. ,
  3582. n.prototype.onMouseUp = function(e) {
  3583. this.enabled && (this.mouseDown = !1,
  3584. this.state = u.NONE,
  3585. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3586. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3587. this.update(),
  3588. this.rotationAcceleration.set(0, 0),
  3589. this.rotateDelta.set(0, 0)))
  3590. }
  3591. ,
  3592. n.prototype.onMouseOver = function(e) {
  3593. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3594. }
  3595. ,
  3596. n.prototype.onMouseWheel = function(e) {
  3597. this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
  3598. (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
  3599. this.update())
  3600. }
  3601. ,
  3602. n.prototype.onKeyDown = function(e) {
  3603. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3604. this.handleKeyDown(e.which)))
  3605. }
  3606. ,
  3607. n.prototype.navRotationAcc = function(e, t) {
  3608. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3609. }
  3610. ,
  3611. n.prototype.navPanAcc = function(e, t) {
  3612. this.stopAutoPanning(),
  3613. this.panAcceleration[e] = t
  3614. }
  3615. ,
  3616. n.prototype.handleKeyDown = function(e) {
  3617. var t = !0;
  3618. switch (e) {
  3619. case p.UPARROW:
  3620. case p.I:
  3621. this.navRotationAcc("y", 1);
  3622. break;
  3623. case p.DOWNARROW:
  3624. case p.K:
  3625. this.navRotationAcc("y", -1);
  3626. break;
  3627. case p.LEFTARROW:
  3628. case p.J:
  3629. this.navRotationAcc("x", -1);
  3630. break;
  3631. case p.RIGHTARROW:
  3632. case p.L:
  3633. this.navRotationAcc("x", 1);
  3634. break;
  3635. case p.W:
  3636. this.navPanAcc("y", 1);
  3637. break;
  3638. case p.S:
  3639. this.navPanAcc("y", -1);
  3640. break;
  3641. case p.A:
  3642. this.navPanAcc("x", -1);
  3643. break;
  3644. case p.D:
  3645. this.navPanAcc("x", 1);
  3646. break;
  3647. default:
  3648. t = !1
  3649. }
  3650. t && this.emit(f.Move, "key")
  3651. }
  3652. ,
  3653. n.prototype.onKeyUp = function(e) {
  3654. this.enabled && (e.preventDefault(),
  3655. e.stopPropagation(),
  3656. this.handleKeyUp(e.which))
  3657. }
  3658. ,
  3659. n.prototype.handleKeyUp = function(e) {
  3660. switch (e) {
  3661. case p.I:
  3662. case p.K:
  3663. case p.UPARROW:
  3664. case p.DOWNARROW:
  3665. this.keyboardZoomSpeed = 0,
  3666. this.rotationAcceleration.y = 0;
  3667. break;
  3668. case p.J:
  3669. case p.L:
  3670. case p.LEFTARROW:
  3671. case p.RIGHTARROW:
  3672. this.rotationAcceleration.x = 0;
  3673. break;
  3674. case p.S:
  3675. case p.W:
  3676. this.panAcceleration.y = 0;
  3677. break;
  3678. case p.A:
  3679. case p.D:
  3680. this.panAcceleration.x = 0
  3681. }
  3682. }
  3683. ,
  3684. n.prototype.onTouchStart = function(i) {
  3685. if (this.enabled || this.state === u.NONE) {
  3686. i.preventDefault(),
  3687. i.stopPropagation(),
  3688. this.stopAutoPanning();
  3689. var e = function() {
  3690. if (2 === i.touches.length) {
  3691. var e = i.touches[0].pageX - i.touches[1].pageX
  3692. , t = i.touches[0].pageY - i.touches[1].pageY;
  3693. this.dollyStart.set(e, t)
  3694. }
  3695. }
  3696. .bind(this)
  3697. , t = function() {
  3698. this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3699. }
  3700. .bind(this)
  3701. , n = function() {
  3702. this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
  3703. }
  3704. .bind(this);
  3705. switch (this.state = this.touchActions[i.touches.length],
  3706. this.state) {
  3707. case u.PAN_DOLLY:
  3708. e();
  3709. case u.PAN:
  3710. t();
  3711. break;
  3712. case u.ROTATE_DOLLY:
  3713. e();
  3714. case u.ROTATE:
  3715. n()
  3716. }
  3717. this.rotationSpeed.set(0, 0),
  3718. this.emit(f.InputStart, "touch")
  3719. }
  3720. }
  3721. ,
  3722. n.prototype.onTouchMove = function(a) {
  3723. if (this.enabled && this.state !== u.NONE) {
  3724. a.preventDefault(),
  3725. a.stopPropagation();
  3726. var s = function() {
  3727. var e = a.touches[0].pageX - a.touches[1].pageX
  3728. , t = a.touches[0].pageY - a.touches[1].pageY;
  3729. this.dollyEnd.set(e, t);
  3730. var i = this.dollyStart.length() - this.dollyEnd.length();
  3731. 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
  3732. this.dollyStart.copy(this.dollyEnd)
  3733. }
  3734. .bind(this)
  3735. , e = function() {
  3736. this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3737. this.panDelta.subVectors(this.panEnd, this.panStart),
  3738. this.pan(this.panDelta.x, this.panDelta.y),
  3739. this.panStart.copy(this.panEnd),
  3740. this.rotateDelta.set(0, 0)
  3741. }
  3742. .bind(this)
  3743. , l = function() {
  3744. this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
  3745. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3746. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3747. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3748. this.rotateStart.copy(this.rotateEnd)
  3749. }
  3750. .bind(this)
  3751. , t = function() {
  3752. if (2 === a.touches.length) {
  3753. var e = window.devicePixelRatio || 1
  3754. , t = a.touches[1].pageX - a.touches[0].pageX
  3755. , i = a.touches[1].pageY - a.touches[0].pageY
  3756. , n = Math.sqrt(t * t + i * i);
  3757. if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
  3758. this.state = u.DOLLY,
  3759. s();
  3760. else {
  3761. var r = h.average(a.touches, "pageX")
  3762. , o = h.average(a.touches, "pageY");
  3763. this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
  3764. this.rotateStart.set(r, o),
  3765. l())
  3766. }
  3767. }
  3768. }
  3769. .bind(this);
  3770. switch (this.state) {
  3771. case u.PAN_DOLLY:
  3772. s();
  3773. case u.PAN:
  3774. e();
  3775. break;
  3776. case u.ROTATE_DOLLY:
  3777. t();
  3778. break;
  3779. case u.DOLLY:
  3780. s();
  3781. break;
  3782. case u.ROTATE:
  3783. l();
  3784. break;
  3785. default:
  3786. this.state = u.NONE
  3787. }
  3788. this.lastMoveTime = a.timeStamp,
  3789. this.emit(f.Move, "touch")
  3790. }
  3791. }
  3792. ,
  3793. n.prototype.onTouchEnd = function(e) {
  3794. this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3795. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3796. this.state = u.NONE,
  3797. this.update(),
  3798. this.rotationAcceleration.set(0, 0),
  3799. this.rotateDelta.set(0, 0))
  3800. }
  3801. ,
  3802. n.prototype.onPointerDown = function(e) {
  3803. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3804. id: e.pointerId,
  3805. pageX: e.pageX,
  3806. pageY: e.pageY
  3807. }),
  3808. e.touches = this.pointers,
  3809. this.onTouchStart(e)),
  3810. this.emit(f.InputStart, "pointer"))
  3811. }
  3812. ,
  3813. n.prototype.onPointerMove = function(t) {
  3814. this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  3815. t.pointerId === e.id && (e.pageX = t.pageX,
  3816. e.pageY = t.pageY)
  3817. }),
  3818. t.touches = this.pointers,
  3819. this.onTouchMove(t))
  3820. }
  3821. ,
  3822. n.prototype.onPointerUp = function(i) {
  3823. this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  3824. i.pointerId === e.id && this.pointers.splice(t, 1)
  3825. }
  3826. .bind(this)),
  3827. i.touches = this.pointers,
  3828. this.onTouchEnd(i))
  3829. }
  3830. ,
  3831. n.prototype.reset = function() {
  3832. this.state = u.NONE,
  3833. this.stopAutoPanning(),
  3834. this.rotationSpeed.set(0, 0),
  3835. this.rotationAcceleration.set(0, 0),
  3836. this.panSpeed.set(0, 0),
  3837. this.panAcceleration.set(0, 0)
  3838. }
  3839. ,
  3840. n.prototype.toJSON = function() {
  3841. return {
  3842. camera_position: {
  3843. x: s.toPrecision(this.camera.position.x, 4),
  3844. y: s.toPrecision(this.camera.position.y, 4),
  3845. z: s.toPrecision(this.camera.position.z, 4)
  3846. },
  3847. camera_quaternion: {
  3848. x: s.toPrecision(this.camera.quaternion.x, 4),
  3849. y: s.toPrecision(this.camera.quaternion.y, 4),
  3850. z: s.toPrecision(this.camera.quaternion.z, 4),
  3851. w: s.toPrecision(this.camera.quaternion.w, 4)
  3852. }
  3853. }
  3854. }
  3855. ,
  3856. t.exports = n
  3857. }
  3858. , {
  3859. "../enum/ControlActions": 20,
  3860. "../enum/ControlEvents": 21,
  3861. "../enum/Keys": 30,
  3862. "../enum/MouseButton": 34,
  3863. "../enum/Vectors": 50,
  3864. "../settings": 166,
  3865. "../util/common": 185,
  3866. "../util/math": 190,
  3867. events: 202,
  3868. three: 217
  3869. }],
  3870. 13: [function(u, d, e) {
  3871. (function(e) {
  3872. "use strict";
  3873. function t(e) {
  3874. this.camera = e,
  3875. (this.camera.controls = this).target = new s.Vector3(0,0,0),
  3876. this.lookVector = new s.Vector3,
  3877. this.lookSpeed = .05,
  3878. this.rotationAcc = new s.Vector2,
  3879. this.rotationSpeed = new s.Vector2,
  3880. this.lat = 0,
  3881. this.lon = 0,
  3882. this.phi = 0,
  3883. this.theta = 0,
  3884. this.enabled = !1,
  3885. this.locked = !1,
  3886. this.pointer = new s.Vector2(0,0),
  3887. this.rotationHistory = [],
  3888. this.rotationDifference = new s.Vector2,
  3889. this.pointerDragOn = !1,
  3890. this.pointerDragStart = new s.Vector2(0,0),
  3891. this.pinchDistance = 0,
  3892. this.moveStart = new s.Vector2,
  3893. this.moveTolerance = .01,
  3894. this.pointersLimit = 2,
  3895. this.pointers = []
  3896. }
  3897. var s = u("three")
  3898. , i = u("../util/logger")
  3899. , n = u("../settings")
  3900. , r = u("../util/common")
  3901. , o = u("../util/math")
  3902. , a = (u("../enum/Vectors"),
  3903. u("../enum/MouseButton"))
  3904. , l = u("../enum/Keys")
  3905. , c = u("../enum/ControlEvents")
  3906. , h = u("events").EventEmitter;
  3907. new i(e),
  3908. (t.prototype = Object.create(h.prototype)).usable = function() {
  3909. return this.enabled && !this.locked
  3910. }
  3911. ,
  3912. t.prototype.lookAt = function(e) {
  3913. var t = this.camera.position.clone().sub(e)
  3914. , i = Math.atan(t.z / t.x);
  3915. i += t.x < 0 ? Math.PI : 0,
  3916. i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
  3917. this.lon = s.Math.radToDeg(i) + 180;
  3918. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  3919. , r = Math.atan(t.y / n);
  3920. this.lat = -s.Math.radToDeg(r)
  3921. }
  3922. ,
  3923. t.prototype.startRotationFrom = function(e, t) {
  3924. o.convertScreenPositionToNDC(e, t, this.pointer),
  3925. this.pointerDragOn = !0,
  3926. this.pointerDragStart.copy(this.pointer),
  3927. this.moveStart.copy(this.pointer),
  3928. this.rotationHistory = [],
  3929. this.rotationSpeed.set(0, 0)
  3930. }
  3931. ,
  3932. t.prototype.onMouseOver = function(e) {
  3933. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3934. }
  3935. ,
  3936. t.prototype.onTouchStart = function(e) {
  3937. if (this.usable()) {
  3938. switch (e.preventDefault(),
  3939. e.stopPropagation(),
  3940. e.touches.length) {
  3941. case 1:
  3942. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  3943. break;
  3944. case 2:
  3945. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  3946. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  3947. this.pinchDistance = Math.sqrt(t * t + i * i)
  3948. }
  3949. this.emit(c.InputStart, "touch")
  3950. }
  3951. }
  3952. ,
  3953. t.prototype.onPointerDown = function(e) {
  3954. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3955. id: e.pointerId,
  3956. clientX: e.clientX,
  3957. clientY: e.clientY
  3958. }),
  3959. e.touches = this.pointers,
  3960. this.onTouchStart(e),
  3961. this.emit(c.InputStart, "pointer"))
  3962. }
  3963. ,
  3964. t.prototype.onMouseDown = function(e) {
  3965. if (this.usable()) {
  3966. switch (e.preventDefault(),
  3967. e.stopPropagation(),
  3968. e.button) {
  3969. case a.LEFT:
  3970. this.startRotationFrom(e.clientX, e.clientY)
  3971. }
  3972. this.emit(c.InputStart, "mouse")
  3973. }
  3974. }
  3975. ,
  3976. t.prototype.updateRotation = function() {
  3977. if (this.usable() && this.pointerDragOn) {
  3978. var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  3979. , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  3980. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  3981. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  3982. , r = Math.atan2(e.y, i)
  3983. , o = Math.atan2(t.y, n);
  3984. this.rotationDifference.y = s.Math.radToDeg(r - o),
  3985. e.y = 0,
  3986. t.y = 0;
  3987. var a = Math.acos(e.dot(t) / e.length() / t.length());
  3988. isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
  3989. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  3990. this.pointerDragStart.copy(this.pointer)
  3991. }
  3992. }
  3993. ,
  3994. t.prototype.onMouseMove = function(e) {
  3995. this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  3996. 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"))
  3997. }
  3998. ,
  3999. t.prototype.onTouchMove = function(e) {
  4000. if (this.usable())
  4001. switch (this.emit(c.Move, "touch"),
  4002. e.touches.length) {
  4003. case 1:
  4004. o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4005. break;
  4006. case 2:
  4007. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4008. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4009. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4010. .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
  4011. this.emit(c.Pinch, n),
  4012. this.pinchDistance -= n)
  4013. }
  4014. }
  4015. ,
  4016. t.prototype.onPointerMove = function(t) {
  4017. this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
  4018. t.pointerId === e.id && (e.clientX = t.clientX,
  4019. e.clientY = t.clientY)
  4020. }),
  4021. t.touches = this.pointers,
  4022. this.onTouchMove(t))
  4023. }
  4024. ,
  4025. t.prototype.endRotation = function() {
  4026. this.pointerDragOn = !1;
  4027. var e = r.averageVectors(this.rotationHistory);
  4028. this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
  4029. }
  4030. ,
  4031. t.prototype.onTouchEnd = function(e) {
  4032. this.usable() && (e.preventDefault(),
  4033. e.stopPropagation(),
  4034. this.endRotation())
  4035. }
  4036. ,
  4037. t.prototype.onMouseUp = function(e) {
  4038. this.usable() && (e.preventDefault(),
  4039. e.stopPropagation(),
  4040. this.endRotation())
  4041. }
  4042. ,
  4043. t.prototype.onPointerUp = function(i) {
  4044. this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
  4045. i.pointerId === e.id && this.pointers.splice(t, 1)
  4046. }
  4047. .bind(this)),
  4048. i.touches = this.pointers,
  4049. this.onTouchEnd(i))
  4050. }
  4051. ,
  4052. t.prototype.update = function(e) {
  4053. for (this.lon,
  4054. this.lat,
  4055. this.updateRotation(),
  4056. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
  4057. this.rotationHistory.shift();
  4058. this.lon += this.rotationDifference.x,
  4059. this.lat += this.rotationDifference.y,
  4060. this.rotationDifference.set(0, 0),
  4061. this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
  4062. this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
  4063. this.lon += this.rotationSpeed.x * e,
  4064. this.lat += this.rotationSpeed.y * e,
  4065. this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
  4066. this.phi = s.Math.degToRad(90 - this.lat),
  4067. this.theta = s.Math.degToRad(this.lon),
  4068. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4069. this.lookVector.y = Math.cos(this.phi),
  4070. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4071. this.target.copy(this.lookVector).add(this.camera.position),
  4072. this.camera.lookAt(this.target)
  4073. }
  4074. ,
  4075. t.prototype.onMouseWheel = function(e) {
  4076. if (this.usable()) {
  4077. var t = e.wheelDelta || -e.detail;
  4078. this.emit(c.InteractionDirect),
  4079. this.emit(c.Scroll, t)
  4080. }
  4081. }
  4082. ,
  4083. t.prototype.onKeyDown = function(e) {
  4084. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4085. this.handleKeyDown(e.which)))
  4086. }
  4087. ,
  4088. t.prototype.handleKeyDown = function(e) {
  4089. var t = function(e, t) {
  4090. this.rotationAcc[e] = t
  4091. }
  4092. .bind(this);
  4093. this.emit(c.InteractionKey);
  4094. var i = !0;
  4095. switch (e) {
  4096. case l.LEFTARROW:
  4097. case l.J:
  4098. t("x", -1);
  4099. break;
  4100. case l.RIGHTARROW:
  4101. case l.L:
  4102. t("x", 1);
  4103. break;
  4104. case l.I:
  4105. t("y", 1);
  4106. break;
  4107. case l.K:
  4108. t("y", -1);
  4109. break;
  4110. default:
  4111. i = !1
  4112. }
  4113. i && this.emit(c.Move, "key")
  4114. }
  4115. ,
  4116. t.prototype.onKeyUp = function(e) {
  4117. this.usable() && (e.preventDefault(),
  4118. e.stopPropagation(),
  4119. this.handleKeyUp(e.which))
  4120. }
  4121. ,
  4122. t.prototype.handleKeyUp = function(e) {
  4123. switch (e) {
  4124. case l.LEFTARROW:
  4125. case l.J:
  4126. case l.RIGHTARROW:
  4127. case l.L:
  4128. this.rotationAcc.x = 0;
  4129. break;
  4130. case l.I:
  4131. case l.K:
  4132. this.rotationAcc.y = 0
  4133. }
  4134. }
  4135. ,
  4136. t.prototype.startRotating = function(e, t) {
  4137. e && (this.rotationAcc.x = e),
  4138. t && (this.rotationAcc.y = t)
  4139. }
  4140. ,
  4141. t.prototype.stopRotating = function(e) {
  4142. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4143. this.rotationAcc.set(0, 0)
  4144. }
  4145. ,
  4146. t.prototype.reset = function() {
  4147. this.pointerDragOn = !1,
  4148. this.rotationAcc.set(0, 0),
  4149. this.rotationSpeed.set(0, 0),
  4150. this.pointers = []
  4151. }
  4152. ,
  4153. t.prototype.toJSON = function() {
  4154. return {
  4155. camera_position: {
  4156. x: o.toPrecision(this.camera.position.x, 4),
  4157. y: o.toPrecision(this.camera.position.y, 4),
  4158. z: o.toPrecision(this.camera.position.z, 4)
  4159. },
  4160. camera_quaternion: {
  4161. x: o.toPrecision(this.camera.quaternion.x, 4),
  4162. y: o.toPrecision(this.camera.quaternion.y, 4),
  4163. z: o.toPrecision(this.camera.quaternion.z, 4),
  4164. w: o.toPrecision(this.camera.quaternion.w, 4)
  4165. }
  4166. }
  4167. }
  4168. ,
  4169. t.prototype.setStateFromJSON = function(e) {
  4170. this.camera.position.copy(e.camera_position),
  4171. this.camera.quaternion.copy(e.camera_quaternion)
  4172. }
  4173. ,
  4174. d.exports = t
  4175. }
  4176. ).call(this, "/js/controls/PanoramaControls.js")
  4177. }
  4178. , {
  4179. "../enum/ControlEvents": 21,
  4180. "../enum/Keys": 30,
  4181. "../enum/MouseButton": 34,
  4182. "../enum/Vectors": 50,
  4183. "../settings": 166,
  4184. "../util/common": 185,
  4185. "../util/logger": 189,
  4186. "../util/math": 190,
  4187. events: 202,
  4188. three: 217
  4189. }],
  4190. 14: [function(t, i, e) {
  4191. (function(e) {
  4192. "use strict";
  4193. var c = t("three")
  4194. , h = t("../enum/Viewmode")
  4195. , u = new (t("../util/logger"))(e);
  4196. i.exports = {
  4197. serialize: function(e) {
  4198. return encodeURI(JSON.stringify(e))
  4199. },
  4200. deserialize: function(e) {
  4201. function t(e) {
  4202. return e.reduce(function(e, t) {
  4203. return e && "number" == typeof t && !isNaN(t)
  4204. }, !0)
  4205. }
  4206. try {
  4207. var i = JSON.parse(decodeURI(e))
  4208. , n = {
  4209. mode: h.fromInt(i.camera_mode),
  4210. panoId: i.scan_id,
  4211. position: (new c.Vector3).copy(i.camera_position),
  4212. quaternion: (new c.Quaternion).copy(i.camera_quaternion),
  4213. zoom: i.ortho_zoom,
  4214. floorVisibility: i.floor_visibility
  4215. }
  4216. , r = n.position;
  4217. t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
  4218. var o = n.quaternion;
  4219. return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
  4220. n
  4221. } catch (i) {
  4222. u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4223. try {
  4224. var a = e.split(",")
  4225. , s = {
  4226. x: parseFloat(a[2]),
  4227. y: parseFloat(a[3]),
  4228. z: parseFloat(a[4])
  4229. }
  4230. , l = {
  4231. x: parseFloat(a[5]),
  4232. y: parseFloat(a[6]),
  4233. z: parseFloat(a[7]),
  4234. w: parseFloat(a[8])
  4235. };
  4236. return t([s.x, s.y, s.z]) || (s.x = 0,
  4237. s.y = 0,
  4238. s.z = 0),
  4239. t([l.x, l.y, l.z, l.w]) || (l.x = 0,
  4240. l.y = 0,
  4241. l.z = 0,
  4242. l.w = 1),
  4243. {
  4244. mode: h.fromInt(a[0]),
  4245. panoId: a[1],
  4246. position: (new c.Vector3).copy(s),
  4247. quaternion: (new c.Quaternion).copy(l)
  4248. }
  4249. } catch (t) {
  4250. u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4251. }
  4252. }
  4253. return null
  4254. }
  4255. }
  4256. }
  4257. ).call(this, "/js/controls/serializer.js")
  4258. }
  4259. , {
  4260. "../enum/Viewmode": 51,
  4261. "../util/logger": 189,
  4262. three: 217
  4263. }],
  4264. 15: [function(C, I, e) {
  4265. (function(e) {
  4266. "use strict";
  4267. function t() {
  4268. this.endlessLoop = r.warp.loop,
  4269. this.clock = new i.Clock(!0),
  4270. this.model = null,
  4271. this.player = null,
  4272. this.currentItem = null,
  4273. this.destinationItem = null,
  4274. this.tourIsPlaying = !1,
  4275. this.transitionStage = v.None,
  4276. this.nextFunc = null,
  4277. this.onTheBus = !1,
  4278. this.tourInProgress = !1,
  4279. this.reachSource = null,
  4280. this.interrupted = !1,
  4281. this.nItems = 0,
  4282. this.walkingSectionPaused = !1
  4283. }
  4284. var i = C("three")
  4285. , n = C("./util/logger")
  4286. , r = C("./settings")
  4287. , o = C("./util/transitions")
  4288. , a = C("events").EventEmitter
  4289. , s = C("./enum/Viewmode")
  4290. , l = C("./analytics")
  4291. , c = C("./enum/WarpStyle")
  4292. , h = (o = C("./util/transitions"),
  4293. C("./model/ModelManager"),
  4294. C("./enum/ModelManagerEvents"))
  4295. , u = C("./enum/DirectorEvents")
  4296. , d = C("./enum/PlayerEvents")
  4297. , p = (C("./enum/ControlEvents"),
  4298. C("./enum/BlackoutStyle"))
  4299. , f = C("./enum/PathDiscardMode")
  4300. , g = C("./enum/PathDisplayMode")
  4301. , m = (C("./player"),
  4302. new n(e))
  4303. , v = Object.freeze({
  4304. None: 0,
  4305. Moving: 1,
  4306. Aiming: 2,
  4307. Interlude: 3
  4308. })
  4309. , y = Object.freeze({
  4310. Forward: 1,
  4311. NoChange: 0,
  4312. Backwards: -1
  4313. })
  4314. , A = o.getUniqueId();
  4315. (t.prototype = Object.create(a.prototype)).init = function(e, t) {
  4316. this.player = e,
  4317. this.modelManager = t,
  4318. this.updateModel(),
  4319. this.resetAll(),
  4320. this.bindEvents()
  4321. }
  4322. ,
  4323. t.prototype.resetAll = function() {
  4324. if (this.currentItem = null,
  4325. this.destinationItem = null,
  4326. this.tourIsPlaying = !1,
  4327. this.bgmReplay(),
  4328. this.transitionStage = v.None,
  4329. this.nextFunc = null,
  4330. this.onTheBus = !1,
  4331. this.reachSource = null,
  4332. this.interrupted = !1,
  4333. this.model) {
  4334. var e = r.path.typ === c.WALK ? c.WALK : c.STD;
  4335. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
  4336. } else
  4337. this.defaultWarpStyle = c.BLACK,
  4338. m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4339. this.resetSpecialTransition()
  4340. }
  4341. ,
  4342. t.prototype.updateModel = function() {
  4343. this.model = this.modelManager.getActiveModel(),
  4344. this.nItems = this.model.heroLocations.length
  4345. }
  4346. ,
  4347. t.prototype.bindEvents = function() {
  4348. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  4349. this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4350. this.player.on(d.Move, this.handlePlayerMove.bind(this)),
  4351. this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4352. this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4353. this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
  4354. this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4355. this.player.once(d.Move, function() {
  4356. o.cancelById(A)
  4357. })
  4358. }
  4359. ,
  4360. t.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4361. return e === c.WALK && (this.interrupt(p.NONE),
  4362. this.pauseWalkingSection(),
  4363. this.player.fastForwardActivePanoFlight(),
  4364. !0)
  4365. }
  4366. ,
  4367. t.prototype.handlePlayerMove = function(e) {
  4368. this.transitionStage === v.Interlude && this.interrupt(p.NONE),
  4369. this.emit("update.controls")
  4370. }
  4371. ,
  4372. t.prototype.handlePlayerPanoChosen = function(e, t) {
  4373. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4374. this.emit("update.controls"))
  4375. }
  4376. ,
  4377. t.prototype.handlePlayerModeChanged = function(e, t) {
  4378. this.intermediateState() || e === t || (this.onTheBus = !1,
  4379. this.emit("update.controls"))
  4380. }
  4381. ,
  4382. t.prototype.handlePlayerInputStart = function(e) {
  4383. this.transitionStage === v.Interlude && this.interrupt(p.NONE)
  4384. }
  4385. ,
  4386. t.prototype.handlePlayerFlyingStarted = function() {
  4387. this.clearWalkingSectionPaused()
  4388. }
  4389. ,
  4390. t.prototype.describe = function() {
  4391. return {
  4392. nItems: this.nItems,
  4393. currentItem: this.currentItem,
  4394. destinationItem: this.destinationItem,
  4395. tourIsPlaying: this.tourIsPlaying,
  4396. onTheBus: this.onTheBus,
  4397. endlessLoop: this.endlessLoop,
  4398. viewMode: this.player.mode,
  4399. inTransition: this._inTransition(),
  4400. transitionStage: this.transitionStage,
  4401. tourInProgress: this.tourInProgress
  4402. }
  4403. }
  4404. ,
  4405. t.prototype._inTransition = function() {
  4406. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
  4407. }
  4408. ,
  4409. t.prototype.bounceable = function() {
  4410. var e = this.clock.getDelta();
  4411. return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
  4412. }
  4413. ,
  4414. t.prototype.currentMoveDirection = function() {
  4415. return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4416. }
  4417. ,
  4418. t.prototype.clearPath = function() {
  4419. this._inTransition() || this.player.path.discardPathObject()
  4420. }
  4421. ,
  4422. t.prototype.allFloors = function() {
  4423. this.model.toggleAllFloors()
  4424. }
  4425. ,
  4426. t.prototype.actionComplete = function(e) {
  4427. if (this.interrupted = !1,
  4428. this.transitionStage = v.None,
  4429. this.resetSpecialTransition(),
  4430. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4431. this.tourIsPlaying || (this.player.disablePreRendering(),
  4432. this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4433. this.emit("update.controls"),
  4434. this.nextFunc) {
  4435. var t = this.nextFunc;
  4436. this.nextFunc = null,
  4437. t()
  4438. }
  4439. }
  4440. ,
  4441. t.prototype.awaitCompletion = function(e, t) {
  4442. this.nextFunc = t,
  4443. e()
  4444. }
  4445. ,
  4446. t.prototype.updateSuccessFunction = function(e) {
  4447. this.nextFunc = e
  4448. }
  4449. ,
  4450. t.prototype.interrupt = function(e, t) {
  4451. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4452. this.tourIsPlaying = !1,
  4453. this.bgmReplay(),
  4454. this.interrupted = !0,
  4455. this.nextFunc = null,
  4456. this.emit(u.ActionInterrupted),
  4457. null != e || (e = p.BEGINNING),
  4458. this.player.interruptAndFastForward(e, t),
  4459. !0)
  4460. }
  4461. ,
  4462. t.prototype.wouldInterrupt = function() {
  4463. return this.transitionStage !== v.None
  4464. }
  4465. ,
  4466. t.prototype.intermediateState = function() {
  4467. return this.transitionStage !== v.None
  4468. }
  4469. ,
  4470. t.prototype.isInterrupted = function() {
  4471. return this.interrupted
  4472. }
  4473. ,
  4474. t.prototype.pauseWalkingSection = function() {
  4475. this.walkingSectionPaused = !0
  4476. }
  4477. ,
  4478. t.prototype.clearWalkingSectionPaused = function() {
  4479. this.walkingSectionPaused = !1
  4480. }
  4481. ,
  4482. t.prototype.autoTour = function() {
  4483. var i = Date.now();
  4484. this.model.auxDataPromise.then(function() {
  4485. i = Date.now() - i;
  4486. var e = r.warp.auto
  4487. , t = this.model.data && this.model.data.player_options && this.model.data.player_options.highlight_reel;
  4488. 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
  4489. duration: Math.max(1e3 * Math.min(300, e) - i, 0),
  4490. done: function() {
  4491. this.playTour()
  4492. }
  4493. .bind(this),
  4494. name: "_atr",
  4495. id: A
  4496. })
  4497. }
  4498. .bind(this))
  4499. }
  4500. ,
  4501. t.prototype.atDestinationPano = function() {
  4502. if (!this.player.currentPano || null === this.destinationItem)
  4503. return !1;
  4504. var e = this.player.currentPano.id;
  4505. if (void 0 === e)
  4506. return !1;
  4507. var t = this.model.heroLocations;
  4508. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4509. }
  4510. ,
  4511. t.prototype.redirectToItem = function(e, t) {
  4512. if (null != e)
  4513. if (this.wouldInterrupt())
  4514. if (this.player.mode !== s.TRANSITIONING) {
  4515. m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4516. var i = function() {
  4517. o.setTimeout(function() {
  4518. this.setDestinationItem(e),
  4519. this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
  4520. }
  4521. .bind(this), 0)
  4522. }
  4523. .bind(this);
  4524. this.interrupt(p.END, 0),
  4525. this.updateSuccessFunction(i)
  4526. } else
  4527. m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4528. else
  4529. m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4530. else
  4531. m.warn("Director.redirectToItem() -> Redirecting to null item.")
  4532. }
  4533. ,
  4534. t.prototype.useSpecialTransition = function(e) {
  4535. void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
  4536. this.nextWarpStyle = c.BLACK
  4537. }
  4538. ,
  4539. t.prototype.resetSpecialTransition = function() {
  4540. this.nextWarpStyle = this.defaultWarpStyle
  4541. }
  4542. ,
  4543. t.prototype.arrivedAtDestination = function(e) {
  4544. if (this.player.flying || this.player.isWarping())
  4545. m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4546. else {
  4547. this.transitionStage = v.Aiming;
  4548. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4549. this.player.model.fadePanoMarkers(0),
  4550. this.awaitCompletion(function() {
  4551. this.resetSpecialTransition(),
  4552. e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4553. }
  4554. .bind(this), t)
  4555. }
  4556. }
  4557. ,
  4558. t.prototype.goToDestination = function(e, t, i, n) {
  4559. if (void 0 !== g_data2.tourAudio && null !== g_data2.tourAudio) {
  4560. var r = g_data2.tourAudio[this.model.heroLocations[this.destinationItem].sid];
  4561. if (r && 0 < r.music.length) {
  4562. var o = g_Prefix + r.music;
  4563. g_tourAudio.src = o,
  4564. g_tourAudio.load(),
  4565. g_tourAudio.crossOrigin = "anonymous",
  4566. g_tourAudio.oncanplaythrough = function() {
  4567. g_tourAudio.play()
  4568. }
  4569. }
  4570. }
  4571. if (this.onTheBus = !0,
  4572. this.emit("update.controls"),
  4573. this.player.updateLastView(),
  4574. n || !this.atDestinationPano())
  4575. if (this.player.flying || this.player.isWarping())
  4576. m.warn("Cannot go to new destination while player is flying or warping.");
  4577. else {
  4578. var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4579. , s = null
  4580. , l = null;
  4581. if (a.isPano()) {
  4582. o = window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
  4583. l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o, !0, i, this.actionComplete.bind(this)),
  4584. s = this.arrivedAtDestination.bind(this, !0)
  4585. } else
  4586. l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4587. s = this.arrivedAtDestination.bind(this, !1);
  4588. this.transitionStage = v.Moving,
  4589. this.model.fadePanoMarkers(0),
  4590. this.awaitCompletion(function() {
  4591. l()
  4592. }
  4593. .bind(this), s),
  4594. this.emit("update.controls")
  4595. }
  4596. else
  4597. this.arrivedAtDestination(!0)
  4598. }
  4599. ,
  4600. t.prototype.tourInterlude = function() {
  4601. if (l.trackAlways("reach_highlight", {
  4602. reach_source: this.reachSource
  4603. }),
  4604. this.model.fadePanoMarkers(0),
  4605. this.emit("update.controls"),
  4606. this.tourIsPlaying)
  4607. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4608. this.stopTour(),
  4609. this.emit(u.TourEnd),
  4610. void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4611. this.transitionStage = v.Interlude,
  4612. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4613. }
  4614. .bind(this), this.goNext.bind(this))
  4615. }
  4616. ,
  4617. t.prototype.playTour = function() {
  4618. if (!this.bounceable())
  4619. return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4620. this.tourInProgress = !0,
  4621. this.reachSource = "play",
  4622. this.tourIsPlaying = !0,
  4623. this.wasZoomEnabled = this.player.zoomEnabled,
  4624. this.player.zoomEnabled = !1,
  4625. this.resetSpecialTransition(),
  4626. this.emit("update.controls"),
  4627. this.emit(u.TourStart),
  4628. this.player.enablePreRendering(),
  4629. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4630. this.goToDestination()) : this.goNext()))
  4631. }
  4632. ,
  4633. t.prototype.bgmReplay = function() {
  4634. g_tourAudio && g_tourAudio.paused && g_bgAudio && g_bgAudio.paused && (g_playAudio = g_bgAudio,
  4635. window.tourAudio && window.tourAudio.pause(),
  4636. g_bgAudio.play())
  4637. }
  4638. ,
  4639. t.prototype.stopTour = function() {
  4640. this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4641. this.tourIsPlaying = !1,
  4642. this.bgmReplay(),
  4643. this.interrupt(),
  4644. this.clearWalkingSectionPaused(),
  4645. this.resetSpecialTransition(),
  4646. this.emit("update.controls")),
  4647. window.tourAudio && window.tourAudio.pause(),
  4648. g_tourAudio && 0 == g_tourAudio.paused && (g_tourAudio.pause(),
  4649. g_tourAudio.src = "")
  4650. }
  4651. ,
  4652. t.prototype.endTourProgress = function() {
  4653. this.tourInProgress = !1,
  4654. this.emit("update.controls"),
  4655. this.emit(u.TourEnd)
  4656. }
  4657. ,
  4658. t.prototype.goToHighlight = function(e) {
  4659. if (this.wouldInterrupt())
  4660. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4661. else {
  4662. if (m.debug("<tour.goto " + e + ">"),
  4663. this.isInterrupted())
  4664. return;
  4665. this.clearWalkingSectionPaused(),
  4666. this.setDestinationItem(e),
  4667. this.useSpecialTransition("Hilight"),
  4668. this.goToDestination(),
  4669. l.trackAlways("reach_highlight", {
  4670. reach_source: "thumb"
  4671. })
  4672. }
  4673. }
  4674. ,
  4675. t.prototype.prevHighlight = function() {
  4676. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4677. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4678. this.reachSource = "prev",
  4679. this.goPrev()))
  4680. }
  4681. ,
  4682. t.prototype.nextHighlight = function() {
  4683. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4684. this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4685. this.reachSource = "next",
  4686. this.goNext()))
  4687. }
  4688. ,
  4689. t.prototype.changeMode = function(e) {
  4690. var t = $.Deferred()
  4691. , i = t.resolve.bind(t)
  4692. , n = t.reject.bind(t);
  4693. if (this.emit(u.StartModeChange),
  4694. !function() {
  4695. return this.clearWalkingSectionPaused(),
  4696. !!this.wouldInterrupt() && (this.interrupt(),
  4697. !0)
  4698. }
  4699. .bind(this)()) {
  4700. switch (e) {
  4701. case s.PANORAMA:
  4702. 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);
  4703. break;
  4704. case s.DOLLHOUSE:
  4705. case s.FLOORPLAN:
  4706. this.player.flyToNewMode({
  4707. mode: e
  4708. }).done(i).fail(n);
  4709. break;
  4710. case s.OUTDOOR:
  4711. 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)
  4712. }
  4713. return t.promise()
  4714. }
  4715. }
  4716. ,
  4717. t.prototype.atEndOfTour = function() {
  4718. return this.currentItem >= this.nItems - 1
  4719. }
  4720. ,
  4721. t.prototype.firstDestination = function() {
  4722. return 0 < this.nItems ? 0 : null
  4723. }
  4724. ,
  4725. t.prototype.finalDestination = function() {
  4726. return 0 < this.nItems ? this.nItems - 1 : null
  4727. }
  4728. ,
  4729. t.prototype.goPrev = function() {
  4730. this.tourAdvance(-1)
  4731. }
  4732. ,
  4733. t.prototype.goNext = function() {
  4734. this.tourAdvance(1)
  4735. }
  4736. ,
  4737. t.prototype.setDestinationItem = function(e) {
  4738. this.destinationItem = e,
  4739. this.emit("update.controls")
  4740. }
  4741. ,
  4742. t.prototype.setCurrentItem = function(e) {
  4743. this.currentItem = e,
  4744. this.emit("update.controls")
  4745. }
  4746. ,
  4747. t.prototype.nextItem = function(e) {
  4748. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4749. }
  4750. ,
  4751. t.prototype.prevItem = function(e) {
  4752. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4753. }
  4754. ,
  4755. t.prototype.tourAdvance = function(e) {
  4756. if (m.debug("tourAdvance(" + e + ")"),
  4757. null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4758. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4759. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4760. this.useSpecialTransition("looping back to start")),
  4761. "black" === window.MP_PREFETCHED_MODELDATA.momentTour) {
  4762. var i = this.player.zoomLevel;
  4763. this.player.zoomEnabled = !0;
  4764. var t = function(e, t) {
  4765. this.player.zoomTo((1 - e) * i, !0)
  4766. }
  4767. .bind(this);
  4768. o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
  4769. }
  4770. this.goToDestination()
  4771. }
  4772. ,
  4773. I.exports = t
  4774. }
  4775. ).call(this, "/js/director.js")
  4776. }
  4777. , {
  4778. "./analytics": 4,
  4779. "./enum/BlackoutStyle": 18,
  4780. "./enum/ControlEvents": 21,
  4781. "./enum/DirectorEvents": 23,
  4782. "./enum/ModelManagerEvents": 33,
  4783. "./enum/PathDiscardMode": 38,
  4784. "./enum/PathDisplayMode": 39,
  4785. "./enum/PlayerEvents": 40,
  4786. "./enum/Viewmode": 51,
  4787. "./enum/WarpStyle": 52,
  4788. "./model/ModelManager": 140,
  4789. "./player": 155,
  4790. "./settings": 166,
  4791. "./util/logger": 189,
  4792. "./util/transitions": 195,
  4793. events: 202,
  4794. three: 217
  4795. }],
  4796. 16: [function(e, t, i) {
  4797. "use strict";
  4798. var n = e("three")
  4799. , r = e("./enum/Viewmode")
  4800. , o = (e("./settings"),
  4801. e("./util/transitions"))
  4802. , a = e("./enum/PlayerEvents")
  4803. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4804. , l = new n.ShaderPass(n.VerticalBlurShader);
  4805. l.renderToScreen = !0;
  4806. var c = $("#player").width() / $("#player").height();
  4807. isNaN(c) && (c = 1);
  4808. var h = {
  4809. currentBlur: 0,
  4810. aspect: c,
  4811. blurStrength: 1,
  4812. hblurPass: s,
  4813. vblurPass: l,
  4814. bindEvents: function(e) {
  4815. e.on(a.ModeChanged, function(e, t) {
  4816. e === r.PANORAMA && (o.cancel(h.blur),
  4817. o.cancel(h.addBlur),
  4818. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4819. })
  4820. },
  4821. blur: function(e) {
  4822. var t = (h.currentBlur = e) * h.blurStrength;
  4823. l.uniforms.v.value = t / 512 * h.aspect,
  4824. s.uniforms.h.value = t / 512
  4825. },
  4826. addBlur: function(e) {
  4827. e = Math.max(e, h.currentBlur),
  4828. h.blur(e)
  4829. },
  4830. removeBlur: function(e) {
  4831. e = Math.min(1 - e, h.currentBlur),
  4832. h.blur(e)
  4833. }
  4834. };
  4835. h.blur(0),
  4836. t.exports = h
  4837. }
  4838. , {
  4839. "./enum/PlayerEvents": 40,
  4840. "./enum/Viewmode": 51,
  4841. "./settings": 166,
  4842. "./util/transitions": 195,
  4843. three: 217
  4844. }],
  4845. 17: [function(e, t, i) {
  4846. "use strict";
  4847. t.exports = {
  4848. UNKNOWN: 0,
  4849. ALIGNED: 1,
  4850. UNALIGNED: 2,
  4851. PLACED: 3
  4852. }
  4853. }
  4854. , {}],
  4855. 18: [function(e, t, i) {
  4856. "use strict";
  4857. t.exports = {
  4858. NONE: 0,
  4859. MIDDLE: 1,
  4860. END: 2,
  4861. BEGINNING: 3,
  4862. FADEIN: 4
  4863. }
  4864. }
  4865. , {}],
  4866. 19: [function(e, t, i) {
  4867. "use strict";
  4868. var r = e("three");
  4869. t.exports = {
  4870. newBlue: new r.Color(4967932),
  4871. altBlue: new r.Color(47355),
  4872. tagDefault: new r.Color(223357),
  4873. classicBlue: new r.Color(53759),
  4874. mpYellow: new r.Color(16502016),
  4875. mpOrange: new r.Color(16428055),
  4876. mpBlue: new r.Color(12096),
  4877. mpLtGrey: new r.Color(13751252),
  4878. mpDkGrey: new r.Color(10000019),
  4879. mpRed: new r.Color(12525854),
  4880. mpOrangeDesat: new r.Color(16764529),
  4881. mpBlueDesat: new r.Color(4034734),
  4882. mpRedDesat: new r.Color(14705505),
  4883. white: new r.Color(16777215),
  4884. black: new r.Color(0),
  4885. _desat: function(e, t) {
  4886. var i = t || .3
  4887. , n = (new r.Color).copy(e).getHSL();
  4888. return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
  4889. },
  4890. _darken: function(e, t) {
  4891. var i = t || .2
  4892. , n = e.getHSL();
  4893. return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
  4894. }
  4895. }
  4896. }
  4897. , {
  4898. three: 217
  4899. }],
  4900. 20: [function(e, t, i) {
  4901. "use strict";
  4902. t.exports = {
  4903. NONE: -1,
  4904. ROTATE: 0,
  4905. DOLLY: 1,
  4906. PAN: 2,
  4907. ROTATE_DOLLY: 3,
  4908. PAN_DOLLY: 4
  4909. }
  4910. }
  4911. , {}],
  4912. 21: [function(e, t, i) {
  4913. "use strict";
  4914. t.exports = {
  4915. Move: "move",
  4916. InteractionDirect: "interaction.direct",
  4917. InteractionKey: "interaction.key",
  4918. InteractionGui: "interaction.gui",
  4919. FlyInDirection: "fly.direction",
  4920. InputStart: "input.start",
  4921. Pinch: "input.pinch",
  4922. Scroll: "input.scroll",
  4923. AutoPanInterrupt: "autopan.interrupt",
  4924. AutoPanComplete: "autopan.complete",
  4925. AutoPanClamped: "autopan.clamped",
  4926. LongTap: "longtap"
  4927. }
  4928. }
  4929. , {}],
  4930. 22: [function(e, t, i) {
  4931. "use strict";
  4932. t.exports = Object.freeze({
  4933. FORWARD: "FORWARD",
  4934. LEFT: "LEFT",
  4935. RIGHT: "RIGHT",
  4936. BACK: "BACK",
  4937. UP: "UP",
  4938. DOWN: "DOWN"
  4939. })
  4940. }
  4941. , {}],
  4942. 23: [function(e, t, i) {
  4943. "use strict";
  4944. t.exports = {
  4945. ActionInterrupted: "action.interrupted",
  4946. TourStart: "tour.start",
  4947. TourEnd: "tour.end",
  4948. StartModeChange: "mode.startChange"
  4949. }
  4950. }
  4951. , {}],
  4952. 24: [function(e, t, i) {
  4953. "use strict";
  4954. t.exports = Object.freeze({
  4955. None: 0,
  4956. Queued: 1,
  4957. ForceQueued: 2,
  4958. Downloading: 3,
  4959. Downloaded: 4,
  4960. DownloadFailed: 5
  4961. })
  4962. }
  4963. , {}],
  4964. 25: [function(e, t, i) {
  4965. "use strict";
  4966. t.exports = {
  4967. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  4968. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  4969. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  4970. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  4971. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  4972. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  4973. }
  4974. }
  4975. , {}],
  4976. 26: [function(e, t, i) {
  4977. "use strict";
  4978. t.exports = {
  4979. Texture2D: 0,
  4980. TextureCube: 1
  4981. }
  4982. }
  4983. , {}],
  4984. 27: [function(e, t, i) {
  4985. "use strict";
  4986. t.exports = {
  4987. SMALL: "small",
  4988. LARGE: "large"
  4989. }
  4990. }
  4991. , {}],
  4992. 28: [function(e, t, i) {
  4993. "use strict";
  4994. var n = e("./Viewmode")
  4995. , r = {
  4996. LANDING: {},
  4997. NAVIGATION: "navigation",
  4998. MORE_HELP: "moreHelp",
  4999. TOUR_INTERACTION: {}
  5000. };
  5001. r.LANDING[n.PANORAMA] = "panorama.landing",
  5002. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5003. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5004. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5005. r.TOUR_INTERACTION.standard = "standard.tour",
  5006. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5007. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5008. t.exports = r
  5009. }
  5010. , {
  5011. "./Viewmode": 51
  5012. }],
  5013. 29: [function(e, t, i) {
  5014. "use strict";
  5015. var n = {
  5016. UP: 1,
  5017. DOWN: -1,
  5018. LEFT: "L",
  5019. RIGHT: "R",
  5020. FORWARD: "F",
  5021. BACK: "B",
  5022. reverse: {},
  5023. opposite: function(e) {
  5024. return this.reverse[e.toString()]
  5025. }
  5026. };
  5027. n.reverse[n.UP] = n.DOWN,
  5028. n.reverse[n.DOWN] = n.UP,
  5029. n.reverse[n.LEFT] = n.RIGHT,
  5030. n.reverse[n.RIGHT] = n.LEFT,
  5031. n.reverse[n.FORWARD] = n.BACK,
  5032. n.reverse[n.BACK] = n.FORWARD,
  5033. t.exports = n
  5034. }
  5035. , {}],
  5036. 30: [function(e, t, i) {
  5037. "use strict";
  5038. var n = {
  5039. ZERO: 48,
  5040. ONE: 49,
  5041. TWO: 50,
  5042. THREE: 51,
  5043. FOUR: 52,
  5044. FIVE: 53,
  5045. SIX: 54,
  5046. SEVEN: 55,
  5047. EIGHT: 56,
  5048. NINE: 57,
  5049. LEFTARROW: 37,
  5050. UPARROW: 38,
  5051. RIGHTARROW: 39,
  5052. DOWNARROW: 40,
  5053. A: 65,
  5054. B: 66,
  5055. C: 67,
  5056. D: 68,
  5057. E: 69,
  5058. F: 70,
  5059. G: 71,
  5060. H: 72,
  5061. I: 73,
  5062. J: 74,
  5063. K: 75,
  5064. L: 76,
  5065. M: 77,
  5066. N: 78,
  5067. O: 79,
  5068. P: 80,
  5069. Q: 81,
  5070. R: 82,
  5071. S: 83,
  5072. T: 84,
  5073. U: 85,
  5074. V: 86,
  5075. W: 87,
  5076. X: 88,
  5077. Y: 89,
  5078. Z: 90,
  5079. SPACE: 32,
  5080. RETURN: 13,
  5081. SEMICOLON: 186,
  5082. PLUSEQUALS: 187,
  5083. DASHUNDERSCORE: 189,
  5084. OPENBRACKET: 219
  5085. };
  5086. e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
  5087. n.PLUSEQUALS = 61,
  5088. n.DASHUNDERSCORE = 173),
  5089. t.exports = n
  5090. }
  5091. , {
  5092. "../util/browser": 182
  5093. }],
  5094. 31: [function(e, t, i) {
  5095. "use strict";
  5096. t.exports = {
  5097. EN_US: "en-US",
  5098. ES_MX: "es-MX",
  5099. FR_FR: "fr-FR",
  5100. DE_DE: "de-DE",
  5101. RU_RU: "ru-RU",
  5102. CN_CN: "cn-CN",
  5103. JP_JP: "jp-JP"
  5104. }
  5105. }
  5106. , {}],
  5107. 32: [function(e, t, i) {
  5108. "use strict";
  5109. t.exports = {
  5110. TagActivated: "tag.activated",
  5111. TagDismissed: "tag.dismissed",
  5112. TagNavigation: "tag.navigation"
  5113. }
  5114. }
  5115. , {}],
  5116. 33: [function(e, t, i) {
  5117. "use strict";
  5118. t.exports = {
  5119. ModelAdded: "model-added",
  5120. ActiveModelChanged: "active-model-changed"
  5121. }
  5122. }
  5123. , {}],
  5124. 34: [function(e, t, i) {
  5125. "use strict";
  5126. t.exports = {
  5127. LEFT: 0,
  5128. MIDDLE: 1,
  5129. RIGHT: 2
  5130. }
  5131. }
  5132. , {}],
  5133. 35: [function(e, t, i) {
  5134. "use strict";
  5135. t.exports = {
  5136. PanoRenderComplete: "panorama.render.complete",
  5137. TileRenderFailure: "panorama.tile.render.failed",
  5138. TileRenderSuccess: "panorama.tile.render.success",
  5139. TileUploadAttempted: "panorama.tile.upload.attempted",
  5140. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5141. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5142. }
  5143. }
  5144. , {}],
  5145. 36: [function(e, t, i) {
  5146. "use strict";
  5147. t.exports = {
  5148. BASE: 1,
  5149. STANDARD: 2,
  5150. HIGH: 3,
  5151. ULTRAHIGH: 4
  5152. }
  5153. }
  5154. , {}],
  5155. 37: [function(e, t, i) {
  5156. "use strict";
  5157. t.exports = {
  5158. LoadComplete: "panorama.load.complete",
  5159. LoadFailed: "panorama.load.failed",
  5160. TileLoaded: "panorama.tile.loaded"
  5161. }
  5162. }
  5163. , {}],
  5164. 38: [function(e, t, i) {
  5165. "use strict";
  5166. t.exports = Object.freeze({
  5167. Standard: 0,
  5168. Slow: 1,
  5169. Retain: 2
  5170. })
  5171. }
  5172. , {}],
  5173. 39: [function(e, t, i) {
  5174. "use strict";
  5175. t.exports = Object.freeze({
  5176. Show: 0,
  5177. Hide: 1,
  5178. Retain: 2
  5179. })
  5180. }
  5181. , {}],
  5182. 40: [function(e, t, i) {
  5183. "use strict";
  5184. t.exports = {
  5185. Move: "move",
  5186. MoveComplete: "move.complete",
  5187. ModeChanged: "mode.changed",
  5188. ModeChanging: "mode.changing",
  5189. PanoChosen: "pano.chosen",
  5190. ClosestPanoChanging: "closest.pano.changing",
  5191. WarpStarted: "warp.started",
  5192. WarpInterrupted: "warp.interrupted",
  5193. WarpEnded: "warp.ended",
  5194. FlyinFinished: "flyin.finished",
  5195. FlyingStarted: "flying.started",
  5196. FlyingInterrupted: "flying.interrupted",
  5197. FlyingEnded: "flying.ended",
  5198. Ready: "ready",
  5199. StartInside: "start.inside",
  5200. StartOutside: "start.outside",
  5201. ViewChanged: "view.changed",
  5202. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5203. InputStart: "input.start"
  5204. }
  5205. }
  5206. , {}],
  5207. 41: [function(e, t, i) {
  5208. "use strict";
  5209. t.exports = Object.freeze({
  5210. DEFAULT: 0,
  5211. PANOMARKERS: 1,
  5212. RETICULE: 2,
  5213. TAG: 3
  5214. })
  5215. }
  5216. , {}],
  5217. 42: [function(e, t, i) {
  5218. "use strict";
  5219. t.exports = {
  5220. visibleFloor: 1,
  5221. ghostFloor: 3,
  5222. boundingSkybox: 1,
  5223. panoMarker: 2,
  5224. reticule: 3,
  5225. tagStem: 4,
  5226. tagDisc: 5,
  5227. ribbon: 100
  5228. }
  5229. }
  5230. , {}],
  5231. 43: [function(e, t, i) {
  5232. "use strict";
  5233. t.exports = {
  5234. ContextCreated: "scene-renderer-context-created",
  5235. AfterRender: "after-render",
  5236. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5237. }
  5238. }
  5239. , {}],
  5240. 44: [function(e, t, i) {
  5241. "use strict";
  5242. t.exports = {
  5243. IDLE: "idle",
  5244. BROWSE: "browse",
  5245. EXAMINE: "examine"
  5246. }
  5247. }
  5248. , {}],
  5249. 45: [function(e, t, i) {
  5250. "use strict";
  5251. t.exports = {
  5252. TileDownloadSuccess: "tiledownloader.download.success",
  5253. TileDownloadFailure: "tiledownloader.download.failure",
  5254. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5255. }
  5256. }
  5257. , {}],
  5258. 46: [function(e, t, i) {
  5259. "use strict";
  5260. t.exports = {
  5261. CardboardAndroid: "googlevr",
  5262. GearVR: "gearvr",
  5263. CardboardIOS: "googlevrios",
  5264. Cardboard: "googlevr"
  5265. }
  5266. }
  5267. , {}],
  5268. 47: [function(e, t, i) {
  5269. "use strict";
  5270. t.exports = {
  5271. NONE: 0,
  5272. CONTEXTUAL: 1,
  5273. ANDROID: 2
  5274. }
  5275. }
  5276. , {}],
  5277. 48: [function(e, t, i) {
  5278. "use strict";
  5279. var n = {
  5280. Title: 0,
  5281. Cardboard: 1
  5282. }
  5283. , r = {
  5284. Title: 0,
  5285. Cardboard: 1,
  5286. Gear: 2
  5287. };
  5288. [n, r].forEach(function(e) {
  5289. e.pageCount = Object.keys(e).length
  5290. }),
  5291. t.exports.ios = n,
  5292. t.exports.standard = r
  5293. }
  5294. , {}],
  5295. 49: [function(e, t, i) {
  5296. "use strict";
  5297. t.exports = {
  5298. Android: "android",
  5299. IOS: "ios",
  5300. Desktop: "desktop",
  5301. UnsupportedAndroid: "android-unsupported"
  5302. }
  5303. }
  5304. , {}],
  5305. 50: [function(e, t, i) {
  5306. "use strict";
  5307. var n = e("three");
  5308. t.exports = {
  5309. UP: new n.Vector3(0,1,0),
  5310. DOWN: new n.Vector3(0,-1,0),
  5311. LEFT: new n.Vector3(-1,0,0),
  5312. RIGHT: new n.Vector3(1,0,0),
  5313. FORWARD: new n.Vector3(0,0,-1),
  5314. BACK: new n.Vector3(0,0,1)
  5315. }
  5316. }
  5317. , {
  5318. three: 217
  5319. }],
  5320. 51: [function(e, t, i) {
  5321. "use strict";
  5322. var n = e("../exception/ViewmodeConvertException")
  5323. , r = e("./coreViewmodes")
  5324. , o = {
  5325. MESH: "mesh",
  5326. OUTDOOR: "outdoor",
  5327. TRANSITIONING: "transitioning",
  5328. toInt: function(e) {
  5329. switch (e) {
  5330. case this.PANORAMA:
  5331. return 1;
  5332. case this.DOLLHOUSE:
  5333. return 2;
  5334. case this.FLOORPLAN:
  5335. return 3;
  5336. case this.OUTDOOR:
  5337. return 4;
  5338. case this.TRANSITIONING:
  5339. return -1
  5340. }
  5341. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5342. },
  5343. fromInt: function(e) {
  5344. switch (e) {
  5345. case "1":
  5346. case 1:
  5347. return this.PANORAMA;
  5348. case "2":
  5349. case 2:
  5350. return this.DOLLHOUSE;
  5351. case "3":
  5352. case 3:
  5353. return this.FLOORPLAN;
  5354. case "4":
  5355. case 4:
  5356. return this.OUTDOOR
  5357. }
  5358. throw new n("No known conversion for int to viewmode for int: " + e)
  5359. },
  5360. convertWorkshopModeInt: function(e) {
  5361. switch (e) {
  5362. case "0":
  5363. case 0:
  5364. case void 0:
  5365. return this.PANORAMA;
  5366. case "1":
  5367. case 1:
  5368. return this.FLOORPLAN;
  5369. case "2":
  5370. case 2:
  5371. return this.DOLLHOUSE;
  5372. case "3":
  5373. case 3:
  5374. return this.MESH
  5375. }
  5376. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5377. }
  5378. };
  5379. e("../util/common").extendObject(o, r),
  5380. t.exports = o
  5381. }
  5382. , {
  5383. "../exception/ViewmodeConvertException": 58,
  5384. "../util/common": 185,
  5385. "./coreViewmodes": 54
  5386. }],
  5387. 52: [function(e, t, i) {
  5388. "use strict";
  5389. t.exports = {
  5390. BLACK: "black",
  5391. STD: "std",
  5392. WALK: "walk"
  5393. }
  5394. }
  5395. , {}],
  5396. 53: [function(e, t, i) {
  5397. "use strict";
  5398. t.exports = {
  5399. ZoomIn: "zoom.in",
  5400. ZoomOut: "zoom.out",
  5401. ZoomMax: "zoom.max",
  5402. ZoomMin: "zoom.min"
  5403. }
  5404. }
  5405. , {}],
  5406. 54: [function(e, t, i) {
  5407. "use strict";
  5408. t.exports = {
  5409. PANORAMA: "panorama",
  5410. DOLLHOUSE: "dollhouse",
  5411. FLOORPLAN: "floorplan"
  5412. }
  5413. }
  5414. , {}],
  5415. 55: [function(e, t, i) {
  5416. "use strict";
  5417. t.exports = function(e) {
  5418. this.message = e
  5419. }
  5420. }
  5421. , {}],
  5422. 56: [function(e, t, i) {
  5423. "use strict";
  5424. function n(e) {
  5425. r.call(this, e)
  5426. }
  5427. var r = e("./BasicException");
  5428. n.prototype = Object.create(r.prototype),
  5429. t.exports = n
  5430. }
  5431. , {
  5432. "./BasicException": 55
  5433. }],
  5434. 57: [function(e, t, i) {
  5435. "use strict";
  5436. function n(e) {
  5437. r.call(this, e)
  5438. }
  5439. var r = e("./BasicException");
  5440. n.prototype = Object.create(r.prototype),
  5441. t.exports = n
  5442. }
  5443. , {
  5444. "./BasicException": 55
  5445. }],
  5446. 58: [function(e, t, i) {
  5447. "use strict";
  5448. function n(e) {
  5449. r.call(this, e)
  5450. }
  5451. var r = e("./BasicException");
  5452. n.prototype = Object.create(r.prototype),
  5453. t.exports = n
  5454. }
  5455. , {
  5456. "./BasicException": 55
  5457. }],
  5458. 59: [function(a, s, e) {
  5459. (function(e) {
  5460. "use strict";
  5461. var i = a("./util/ajax")
  5462. , n = a("./util/showcase")
  5463. , t = a("./util/logger")
  5464. , r = new t(e)
  5465. , o = {};
  5466. s.exports = {
  5467. loadFeatureFlags: function(e) {
  5468. var t = $.Deferred();
  5469. return i.get(e.urlBase + "", {
  5470. responseType: "json",
  5471. prefetchFrom: "user",
  5472. auth: n.getAuthorizationHeader()
  5473. }).done(function(e) {
  5474. (o = function(e) {
  5475. var t = {};
  5476. if (e) {
  5477. var i = e.flags;
  5478. if (i)
  5479. for (var n in i)
  5480. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5481. return t
  5482. }
  5483. return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5484. null
  5485. }(e)) ? t.resolve(o) : t.reject("loading-failed")
  5486. }).fail(function() {
  5487. r.debug("Retrieval of feature flags failed."),
  5488. t.reject("loading-failed")
  5489. }),
  5490. t.promise()
  5491. },
  5492. getFlags: function() {
  5493. return o
  5494. },
  5495. updateDependentSettings: function(e, t) {
  5496. (e = e || o).labels && (t.labels.enabled = !0),
  5497. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5498. e.showcase_sdk && (t.sdkInit = !0),
  5499. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5500. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5501. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5502. e.hide_sc_sharing && (t.share.enabled = !1)
  5503. }
  5504. }
  5505. }
  5506. ).call(this, "/js/featureflags.js")
  5507. }
  5508. , {
  5509. "./util/ajax": 181,
  5510. "./util/logger": 189,
  5511. "./util/showcase": 193
  5512. }],
  5513. 60: [function(e, t, i) {
  5514. "use strict";
  5515. var n = (e("../util/common"),
  5516. {
  5517. status: 0,
  5518. set: function(e) {
  5519. if (isNaN(e))
  5520. return !1;
  5521. var t = $(".progressbar");
  5522. e < 0 && (e = 0),
  5523. 100 < e && (e = 100);
  5524. var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
  5525. , n = Math.round(e)
  5526. , r = parseInt(i) - 15;
  5527. t.find(".bar").css("width", i),
  5528. t.find(".label").css("left", r),
  5529. t.find(".perc").text(n + "%"),
  5530. this.status = e
  5531. },
  5532. done: function(e) {
  5533. return e || this.status ? (this.status = null,
  5534. this.set(100)) : this
  5535. }
  5536. });
  5537. t.exports.circleLoader = n
  5538. }
  5539. , {
  5540. "../util/common": 185
  5541. }],
  5542. 61: [function(e, t, i) {
  5543. "use strict";
  5544. t.exports = Object.freeze({
  5545. CLOSE: "modal.closer.close"
  5546. })
  5547. }
  5548. , {}],
  5549. 62: [function(e, t, i) {
  5550. "use strict";
  5551. function n(t, e) {
  5552. function i() {
  5553. var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
  5554. e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
  5555. c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
  5556. c.classList.remove("closeByFooter")))
  5557. }
  5558. e ? setTimeout(i, r.guiAnimationSpeed) : i()
  5559. }
  5560. var r = e("../../settings")
  5561. , o = (e("../../tag/Media/MediaEvent"),
  5562. e("../../util/browser"))
  5563. , a = e("../../util/common")
  5564. , s = e("./ModalCloserEvent")
  5565. , l = e("events").EventEmitter
  5566. , c = document.getElementsByClassName("footer")[0]
  5567. , h = c.querySelectorAll(".close")[0]
  5568. , u = null
  5569. , d = null
  5570. , p = null
  5571. , f = (o.isMobile(),
  5572. {
  5573. open: function(e) {
  5574. e && (n(e),
  5575. u && h.removeEventListener("click", u, !0),
  5576. u = function(e, t) {
  5577. t && (t.stopPropagation(),
  5578. t.preventDefault()),
  5579. e && this.emit(s.CLOSE, e),
  5580. f.reset()
  5581. }
  5582. .bind(this, e.id),
  5583. h.addEventListener("click", u, !0),
  5584. d && window.removeEventListener("resize", d, !0),
  5585. d = n.bind(this, e),
  5586. window.addEventListener("resize", d, !0))
  5587. },
  5588. reset: function() {
  5589. c.classList.remove("closeByFooter"),
  5590. h.removeEventListener("click", u, !0),
  5591. window.removeEventListener("resize", d, !0),
  5592. u = d = p = null
  5593. }
  5594. });
  5595. a.extendObject(f, l.prototype),
  5596. t.exports = f
  5597. }
  5598. , {
  5599. "../../tag/Media/MediaEvent": 131,
  5600. "../../settings": 166,
  5601. "../../util/browser": 182,
  5602. "../../util/common": 185,
  5603. "./ModalCloserEvent": 61,
  5604. events: 202
  5605. }],
  5606. 63: [function(e, t, i) {
  5607. "use strict";
  5608. var A = e("../lib/dat.gui")
  5609. , C = e("three")
  5610. , I = e("../util/easing")
  5611. , E = e("../enum/Viewmode")
  5612. , _ = e("../enum/Colors")
  5613. , b = e("../enum/WarpStyle")
  5614. , w = e("../settings");
  5615. e("../tag/tag"),
  5616. A.GUI.prototype.removeFolder = function(e) {
  5617. var t = this.__folders[e];
  5618. t && (t.close(),
  5619. this.__ul.removeChild(t.domElement.parentNode),
  5620. delete this.__folders[e],
  5621. this.onResize())
  5622. }
  5623. ,
  5624. t.exports.toggle = function(t, e, i) {
  5625. var n = new A.GUI({
  5626. width: 400
  5627. })
  5628. , r = n.addFolder("Flydown from Dollhouse");
  5629. r.add(w.flydown, "movementEasing", Object.keys(I)),
  5630. r.add(w.flydown, "movementDelay", 0, 1).step(.01),
  5631. r.add(w.flydown, "rotationEasing", Object.keys(I)),
  5632. r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
  5633. r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
  5634. r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
  5635. r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
  5636. r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
  5637. var o = n.addFolder("Transition between panos");
  5638. o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
  5639. o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5640. w.transition.flyTime = 0,
  5641. o.__controllers.forEach(function(e) {
  5642. e.updateDisplay()
  5643. })
  5644. }),
  5645. o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5646. w.transition.flySpeed = 0,
  5647. o.__controllers.forEach(function(e) {
  5648. e.updateDisplay()
  5649. })
  5650. }),
  5651. o.add(w.transition, "aimTime", 500, 2500).step(50),
  5652. o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
  5653. o.add(w.transition, "movementEasing", Object.keys(I));
  5654. var a = n.addFolder("Path Display");
  5655. a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5656. a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5657. a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5658. a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5659. a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5660. a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5661. a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5662. a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5663. a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5664. a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
  5665. w.path.color = _[w.path.color],
  5666. w.path.colorUp = _._desat(w.path.color),
  5667. w.path.colorDown = _.darken(w.path.color)
  5668. }),
  5669. a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
  5670. w.reticuleColor = _[w.reticuleColor]
  5671. });
  5672. var s = n.addFolder("Warping")
  5673. , l = s.addFolder("Warp/Teleport");
  5674. l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5675. l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5676. l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5677. l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5678. l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5679. l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5680. l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5681. l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5682. l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5683. l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5684. l.add(w.path, "mapGuides").onFinishChange(function() {}),
  5685. l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5686. l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5687. l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
  5688. w.path.typ = b[w.path.typ]
  5689. }),
  5690. l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5691. e.endlessLoop = w.warp.loop
  5692. }),
  5693. l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5694. l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5695. l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5696. var c = s.addFolder("Long Warp Only");
  5697. c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5698. w.warp.flySpeed = 0,
  5699. c.__controllers.forEach(function(e) {
  5700. e.updateDisplay()
  5701. })
  5702. }),
  5703. c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5704. c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5705. c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5706. c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5707. c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5708. c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5709. c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5710. c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5711. c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5712. var h = n.addFolder("Warp Esoterica");
  5713. h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5714. h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
  5715. h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5716. w.warp.minWarpTime = 0,
  5717. h.__controllers.forEach(function(e) {
  5718. e.updateDisplay()
  5719. })
  5720. }),
  5721. h.add(w.warp, "showBunny").onFinishChange(function() {}),
  5722. h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5723. h.add(w.warp, "movementEasing", Object.keys(I));
  5724. var u = n.addFolder("Misc");
  5725. u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
  5726. i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
  5727. }),
  5728. u.add(w, "insideFOV", 10, 180).onChange(function() {
  5729. i.cameras[E.PANORAMA].fov = w.insideFOV
  5730. }),
  5731. u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5732. u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5733. u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5734. var d = n.addFolder("Navigation");
  5735. d.add(w.navigation, "panoScores").onFinishChange(function() {
  5736. w.navigation.panoScores || t.panos.forEach(function(e) {
  5737. e.floor.remove(e.text3d),
  5738. e.text3d = null
  5739. })
  5740. }),
  5741. d.add(w.navigation, "mouseDirection"),
  5742. d.add(w.navigation, "filterStrictness", 0, 1),
  5743. d.add(w.navigation, "angleFactor", -60, 0),
  5744. d.add(w.navigation, "directionFactor", 1, 20),
  5745. d.add(w.navigation, "distanceFactor", -5, 5),
  5746. d.add(w.navigation, "optionalityFactor", .1, 10);
  5747. var p = n.addFolder("tags")
  5748. , f = p.addFolder("Tag Creation");
  5749. f.add(w.tags.pole, "enabled").name("poleEnabled"),
  5750. f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5751. f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5752. f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5753. var g = p.addFolder("Visibility");
  5754. g.add(w.tags.visibility, "anyDistance"),
  5755. g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5756. g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5757. g.add(w.tags.visibility, "hideViaFloor"),
  5758. g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5759. g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5760. var m = p.addFolder("Disc Parameters");
  5761. m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5762. m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5763. m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5764. e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
  5765. }),
  5766. m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5767. w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
  5768. }),
  5769. m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
  5770. m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
  5771. m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5772. var v = p.addFolder("Navigate");
  5773. v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
  5774. v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
  5775. v.add(w.tags.navigate, "reactivate").name("reactivate"),
  5776. v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5777. v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5778. v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5779. var y = n.addFolder("Debug");
  5780. y.add(w, "wireframe").onFinishChange(function() {
  5781. t.chunks.forEach(function(e) {
  5782. e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
  5783. e.wireframeTwin.material.depthWrite = !1,
  5784. e.wireframeTwin.material.depthTest = !1,
  5785. e.wireframeTwin.material.opacity = .5,
  5786. e.wireframeTwin.material.transparent = !0),
  5787. w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
  5788. })
  5789. }),
  5790. y.add(w, "skyboxWireframe").onFinishChange(function() {
  5791. w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
  5792. t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
  5793. t.skybox.wireframe = null)
  5794. }),
  5795. y.add(w, "showSweeps").onFinishChange(function() {
  5796. t.setSweepVisibility(w.showSweeps)
  5797. }),
  5798. y.add(w, "showMesh").onFinishChange(function() {
  5799. t.chunks.forEach(function(e) {
  5800. e.visible = w.showMesh
  5801. })
  5802. }),
  5803. y.add(w, "showFloors").onFinishChange(function() {
  5804. t.floors.forEach(function(e) {
  5805. e.collider.children.forEach(function(e) {
  5806. e.material.visible = w.showFloors
  5807. })
  5808. })
  5809. }),
  5810. y.add(w, "showSkyboxes").onFinishChange(function() {
  5811. t.panos.forEach(function(e) {
  5812. e.skyboxMesh.visible = w.showSkyboxes
  5813. })
  5814. }),
  5815. y.add(w, "showNeighbors").onChange(function() {}),
  5816. y.add(t, "alpha", 0, 1)
  5817. }
  5818. }
  5819. , {
  5820. "../enum/Colors": 19,
  5821. "../enum/Viewmode": 51,
  5822. "../enum/WarpStyle": 52,
  5823. "../lib/dat.gui": 93,
  5824. "../tag/tag": 123,
  5825. "../settings": 166,
  5826. "../util/easing": 186,
  5827. three: 217
  5828. }],
  5829. 64: [function(c, h, e) {
  5830. (function(e) {
  5831. "use strict";
  5832. function i(e, t, i, n) {
  5833. $(".gui-error .error-problem-text").text(e),
  5834. $(".gui-error .error-solution-text").text(t),
  5835. $(".gui-error .error-explanation").text(i),
  5836. $(".gui-error .error-actions").html(n),
  5837. $(window).resize(),
  5838. $(".gui-error").fadeIn(),
  5839. $("#bottom-logo").fadeIn()
  5840. }
  5841. function n(e) {
  5842. 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("");
  5843. i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
  5844. r.isMobile() || $("[rel=tiletip]").tooltip({
  5845. placement: "bottom",
  5846. delay: {
  5847. show: 50,
  5848. hide: 0
  5849. },
  5850. trigger: "hover",
  5851. viewport: {
  5852. selector: "body",
  5853. padding: 10
  5854. }
  5855. })
  5856. }
  5857. function t() {
  5858. var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
  5859. , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
  5860. i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
  5861. r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  5862. e.preventDefault(),
  5863. e.stopPropagation(),
  5864. n(" ")
  5865. })
  5866. }
  5867. var r = c("./../util/browser")
  5868. , o = c("./../analytics")
  5869. , a = c("./../settings")
  5870. , s = c("../localization/localize")
  5871. , l = new (c("./../util/logger"))(e);
  5872. h.exports.error = function(e) {
  5873. if ($("head title").text(a.pageTitle),
  5874. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  5875. $("#gui-loading").fadeOut(250),
  5876. $("#quick-blackout").hide(),
  5877. o.track("showcase_error", {
  5878. error_key: e
  5879. }),
  5880. s.locale || s.init(),
  5881. "webgl-unsupported" === e)
  5882. r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  5883. else if ("webgl-ios" === e)
  5884. 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>.");
  5885. else if ("webgl-safari" === e)
  5886. 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>.");
  5887. else if ("webgl-generic" === e)
  5888. t();
  5889. else if ("missing-urls" === e)
  5890. i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
  5891. else if ("loading-failed" === e)
  5892. 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>.");
  5893. else {
  5894. if ("loading-failed-maintenance" !== e)
  5895. return void l.error("Unhandled error: " + e);
  5896. i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
  5897. }
  5898. }
  5899. }
  5900. ).call(this, "/js/gui/error.js")
  5901. }
  5902. , {
  5903. "../localization/localize": 108,
  5904. "./../analytics": 4,
  5905. "./../settings": 166,
  5906. "./../util/browser": 182,
  5907. "./../util/logger": 189
  5908. }],
  5909. 65: [function(Oe, Le, e) {
  5910. (function(e) {
  5911. "use strict";
  5912. function c() {
  5913. for (var e in Ce)
  5914. if (Ce.hasOwnProperty(e)) {
  5915. var t = Ce[e];
  5916. if (!t.visible)
  5917. for (var i = 0; i < t.elements.length; i++)
  5918. $(t.elements[i]).hide()
  5919. }
  5920. Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  5921. !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
  5922. ge = [],
  5923. Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
  5924. ge.push(".hideTarget", ".pinTop.right")
  5925. }
  5926. function v(e, t) {
  5927. var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
  5928. $("#gui-zoomin").toggle(i),
  5929. $("#gui-zoomout").toggle(i)
  5930. }
  5931. function l() {
  5932. n(),
  5933. $(".pinBottom").toggleClass("open"),
  5934. $("#drawer").toggleClass("open"),
  5935. $(".footer").toggleClass("open"),
  5936. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
  5937. _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
  5938. O.resetDrawer()),
  5939. setTimeout(function() {
  5940. $("#pullTab").toggleClass("opened")
  5941. }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
  5942. $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
  5943. }
  5944. function t(e) {
  5945. var t;
  5946. return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  5947. t = e.position().top + e.outerHeight(),
  5948. e.attr("style", "display: none")),
  5949. $("#player").outerHeight() - 130 < t + 25
  5950. }
  5951. function y(e) {
  5952. "touchstart" === e.type && e.preventDefault(),
  5953. e.stopPropagation()
  5954. }
  5955. function n() {
  5956. w && (w.reload(),
  5957. w.init())
  5958. }
  5959. function r() {
  5960. $("#gui-spinner").stop(!0, !0),
  5961. $("#gui-spinner").fadeOut(1e3),
  5962. !(Ae = !0)
  5963. }
  5964. function A(e, t) {
  5965. var i = e.mode
  5966. , n = t || e.currentPano;
  5967. $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
  5968. $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
  5969. $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
  5970. i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
  5971. M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
  5972. $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
  5973. $("#gui-modes-outside").removeClass("desktop-only")),
  5974. $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
  5975. pe = i,
  5976. $("#gui-modes-outside").addClass("hidden"),
  5977. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  5978. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
  5979. }
  5980. function C(t, i) {
  5981. function e() {
  5982. document.getElementById("vr").classList.remove("hidden"),
  5983. M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
  5984. S.supportsFullscreen() ? function(e) {
  5985. ue.info(e.displayName + " detected, VR button activates WebVR experience"),
  5986. Q.init(t.data, i, e, x),
  5987. Q.on(J.OPENED, _e.bind(gui, "vr")),
  5988. Q.on(J.SHOW_TERMS, W.show.bind(W))
  5989. }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
  5990. $(".improper-embed").toggleClass("hidden", !1),
  5991. n())
  5992. }, function(e) {
  5993. n()
  5994. }) : n()
  5995. }
  5996. function n() {
  5997. var e;
  5998. ue.info("WebVR support not found, VR button activates native app VR modal"),
  5999. X.init(t.data, x),
  6000. X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
  6001. function() {
  6002. _e("vr"),
  6003. V.open(e)
  6004. }
  6005. )),
  6006. X.on(Z.CLOSED, V.reset)
  6007. }
  6008. if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
  6009. switch (M.vr.option) {
  6010. case le.CONTEXTUAL:
  6011. e();
  6012. break;
  6013. case le.ANDROID:
  6014. S.detectAndroid() && e();
  6015. break;
  6016. case le.NONE:
  6017. }
  6018. }
  6019. function h(e, i) {
  6020. for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
  6021. if ("372" !== getQueryVariable("m")) {
  6022. var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
  6023. $(".gui-floor").find(".container").prepend(r)
  6024. }
  6025. n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
  6026. n.on("click", function(e) {
  6027. y(e),
  6028. _e("floor"),
  6029. n.toggleClass("open")
  6030. }),
  6031. $(".floorChoice").on("click", function(e) {
  6032. y(e);
  6033. var t = $(this).data("index");
  6034. "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6035. i.player.gotoFloor(t),
  6036. R.track("showcase_gui", {
  6037. gui_action: "click_floor_select_button",
  6038. interaction_source: "gui"
  6039. })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
  6040. _e("move"),
  6041. i.allFloors(),
  6042. R.track("showcase_gui", {
  6043. gui_action: "click_toggle_all_floors_button",
  6044. interaction_source: "gui"
  6045. })),
  6046. n.removeClass("open")
  6047. })
  6048. }
  6049. function I(e, t) {
  6050. e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
  6051. $(".gui-floor-icon").hide(),
  6052. $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
  6053. $(".gui-floor-icon").show(),
  6054. $(".gui-floor-title").hide()),
  6055. e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
  6056. $(".gui-floor-number").text(se.FLOOR_ALL),
  6057. $(".floorChoice").removeClass("active"),
  6058. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6059. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6060. $(".floorChoice").removeClass("active"),
  6061. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6062. }
  6063. function E() {
  6064. var e = $("#player").width() - 20
  6065. , t = $("#scroller")
  6066. , i = $("#drawer")
  6067. , n = $(".pinBottom");
  6068. $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
  6069. i.addClass("noScroll"),
  6070. n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
  6071. i.toggleClass("noScroll"),
  6072. n.toggleClass("noScroll"))
  6073. }
  6074. function _(e) {
  6075. e.waitQueue.length <= 0 ? r() : ye || function(e) {
  6076. e = e || 0,
  6077. Ae = !1,
  6078. window.setTimeout(function() {
  6079. Ae || (!0,
  6080. $("#gui-spinner").stop(!0, !0).show())
  6081. }
  6082. .bind(this), e)
  6083. }(M.modelComponentLoadSpinnerDelay)
  6084. }
  6085. function b(e, t) {
  6086. for (var i = []; e; )
  6087. i.push(e),
  6088. e = e.parentNode;
  6089. for (; t && -1 === i.indexOf(t); )
  6090. t = t.parentNode;
  6091. return t
  6092. }
  6093. var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
  6094. Oe("../util/ajax"),
  6095. Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
  6096. Oe("../util/camera"),
  6097. Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
  6098. 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"),
  6099. Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
  6100. Oe("../enum/PathDisplayMode"),
  6101. Oe("../enum/DirectorEvents"),
  6102. Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
  6103. Oe("../enum/WarpStyle"),
  6104. Oe("../enum/AlignmentType"),
  6105. Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
  6106. Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
  6107. coBrand: {
  6108. visible: !0,
  6109. elements: [".co-brand", "#loaderCoBrand"]
  6110. },
  6111. help: {
  6112. visible: !0,
  6113. elements: [".nav-help", "#nav-help"]
  6114. },
  6115. tourControls: {
  6116. visible: !0,
  6117. elements: [".next", ".previous", "#play"]
  6118. },
  6119. highlight: {
  6120. visible: !0,
  6121. elements: ["#drawer", "#pullTab"]
  6122. },
  6123. share: {
  6124. visible: !0,
  6125. elements: [".socialButton", "#share"]
  6126. },
  6127. fullScreen: {
  6128. visible: !0,
  6129. elements: ["#gui-fullscreen"]
  6130. },
  6131. floors: {
  6132. visible: !0,
  6133. elements: [".gui-floor"]
  6134. }
  6135. }, Ie = (g = document.getElementById("drawer"),
  6136. function() {
  6137. $("#player").height() < 400 && g.classList.contains("open") && l()
  6138. }
  6139. ), Ee = (f = document.getElementById("meta-info"),
  6140. function() {
  6141. $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
  6142. }
  6143. ), _e = (i = document.getElementById("meta-info"),
  6144. s = document.getElementById("interaction-modal"),
  6145. u = $("#drawer").eq(0),
  6146. d = $(".gui-floor").eq(0),
  6147. p = $(".vr-popup").eq(0),
  6148. function(e) {
  6149. switch (e) {
  6150. case "info":
  6151. we(),
  6152. Te(),
  6153. Ie(),
  6154. Me(),
  6155. Re(),
  6156. xe(),
  6157. Pe();
  6158. break;
  6159. case "terms":
  6160. be(),
  6161. Te(),
  6162. Se(),
  6163. Me(),
  6164. Re(),
  6165. xe(),
  6166. Pe();
  6167. break;
  6168. case "help":
  6169. be(),
  6170. we(),
  6171. Me(),
  6172. Re(),
  6173. xe(),
  6174. Pe();
  6175. break;
  6176. case "vr":
  6177. be(),
  6178. we(),
  6179. Me(),
  6180. Re(),
  6181. Te(),
  6182. Pe(),
  6183. t(p) && Se();
  6184. break;
  6185. case "highlights":
  6186. Ee(),
  6187. we(),
  6188. Me(),
  6189. Re();
  6190. break;
  6191. case "share":
  6192. be(),
  6193. we(),
  6194. Te(),
  6195. Re(),
  6196. xe(),
  6197. Pe();
  6198. break;
  6199. case "floor":
  6200. we(),
  6201. Me(),
  6202. xe();
  6203. break;
  6204. case "view":
  6205. Re(),
  6206. Me(),
  6207. we(),
  6208. xe();
  6209. break;
  6210. case "tour":
  6211. case "move":
  6212. we(),
  6213. Me(),
  6214. Re(),
  6215. xe();
  6216. break;
  6217. case "resize":
  6218. be(),
  6219. Ie(),
  6220. Re();
  6221. break;
  6222. case "tag":
  6223. we(),
  6224. Te(),
  6225. Me(),
  6226. Re(),
  6227. xe()
  6228. }
  6229. }
  6230. );
  6231. function be() {
  6232. i.classList.contains("expand") && z.toggleMeta(!0)
  6233. }
  6234. function we() {
  6235. W.hide()
  6236. }
  6237. function Te() {
  6238. U.close()
  6239. }
  6240. function xe() {
  6241. X.dismiss()
  6242. }
  6243. function Se() {
  6244. u.hasClass("open") && l()
  6245. }
  6246. function Me() {
  6247. K.hide()
  6248. }
  6249. function Re() {
  6250. d.hasClass("open") && d.removeClass("open")
  6251. }
  6252. function Pe() {
  6253. s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
  6254. }
  6255. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  6256. $("#gui-fullscreen").toggle(!S.isFullscreen()),
  6257. $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
  6258. setTimeout(function() {
  6259. $(".icon:visible").hide().show(0)
  6260. }, 100)
  6261. }),
  6262. $("#gui-fullscreen").find("a").on("click", function(e) {
  6263. y(e),
  6264. S.requestFullscreen($("body")[0]),
  6265. R.track("showcase_gui", {
  6266. gui_action: "click_enter_fullscreen",
  6267. interaction_source: "gui"
  6268. })
  6269. }),
  6270. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  6271. y(e),
  6272. S.exitFullscreen(),
  6273. R.track("showcase_gui", {
  6274. gui_action: "click_exit_fullscreen",
  6275. interaction_source: "gui"
  6276. })
  6277. }),
  6278. $("#volume").find("a").on("click", function(e) {
  6279. y(e),
  6280. -1 < $("#volume img")[0].src.indexOf("btn_on.png") ? (g_play = 0,
  6281. g_playAudio && g_playAudio.pause(),
  6282. $("#volume img").attr("src", "./images/Volume btn_off.png"),
  6283. $("#volume").attr("title", "关闭声音")) : -1 < $("#volume img")[0].src.indexOf("btn_off.png") && (g_play = 1,
  6284. g_playAudio && g_playAudio.play(),
  6285. $("#volume img").attr("src", "./images/Volume btn_on.png"),
  6286. $("#volume").attr("title", "打开声音"))
  6287. }),
  6288. $(window).on("resize", function(e) {
  6289. var t = e.target.innerHeight
  6290. , i = e.target.innerWidth;
  6291. t === o && i === a || (Ce.highlight.visible && E(),
  6292. _e("resize"),
  6293. $(".pinTop.right").removeClass("hideUnderMeta"),
  6294. n(),
  6295. o = t,
  6296. a = i)
  6297. }).resize(),
  6298. S.supportsFullscreen() || $("#gui-fullscreen").hide(),
  6299. $("#pullTab").on("click", function(e) {
  6300. y(e),
  6301. $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
  6302. gui_action: "hide_highlight_reel"
  6303. }),
  6304. $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
  6305. gui_action: "show_highlight_reel"
  6306. }),
  6307. $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
  6308. l()
  6309. }),
  6310. "true" === window.MP_PREFETCHED_MODELDATA.showHotListSta && ($("#hotList").css("display", ""),
  6311. $("#hotList").on("click", function(e) {
  6312. y(e);
  6313. var t = $("#hotListWrap")[0];
  6314. t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
  6315. this.classList.remove("active")) : (t.classList.add("hotListActive"),
  6316. this.classList.add("active"))
  6317. }),
  6318. $("#hotListContent ul").on("mouseover", function(e) {
  6319. y(e);
  6320. var t = e.target
  6321. , i = document.getElementById("hotListWrap");
  6322. if ("SPAN" === t.tagName) {
  6323. var n = t.parentElement.parentElement;
  6324. t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
  6325. } else if ("LI" === t.tagName) {
  6326. n = t.parentElement;
  6327. t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
  6328. } else
  6329. i.style.width = ""
  6330. }),
  6331. $("#hotListContent ul").on("click", function(e) {
  6332. y(e),
  6333. this.preElem && this.preElem.classList.remove("active"),
  6334. "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
  6335. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player, !0),
  6336. this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
  6337. e.target.hot && e.target.hot.examine(window.player, !0),
  6338. this.preElem = e.target)
  6339. }),
  6340. $("#hotListClose").on("click", function(e) {
  6341. y(e),
  6342. $("#hotListWrap")[0].classList.remove("hotListActive"),
  6343. $("#hotListContent ul .active").removeClass("active"),
  6344. $("#hotList")[0].classList.remove("active")
  6345. })),
  6346. "true" === window.MP_PREFETCHED_MODELDATA.supportsVR && $("#vr").css("display", ""),
  6347. $("#more-menu-button").on("click", function(e) {
  6348. y(e),
  6349. $("#more-menu").toggleClass("open")
  6350. }),
  6351. Le.exports.init = function(s, l, c, e, t, i, n) {
  6352. var r;
  6353. x = n,
  6354. s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6355. s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6356. F.init(),
  6357. D.init(s, i),
  6358. ce.init(s, l, e),
  6359. $(".icon").on("mouseover", function() {
  6360. l.player && l.player.reticule.hide()
  6361. }),
  6362. function(e, t) {
  6363. var i = t.player;
  6364. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6365. y(e),
  6366. R.updateInteraction(oe.InteractionGui, "inside-button"),
  6367. R.track("USER", {
  6368. event_type: "showcase_gui",
  6369. gui_action: "click_inside_mode_button"
  6370. }),
  6371. t.changeMode(ie.PANORAMA)
  6372. }),
  6373. $("#gui-modes-outside").find("a").on("click", function(e) {
  6374. y(e),
  6375. R.track("showcase_gui", {
  6376. gui_action: "click_outside_mode_button"
  6377. }),
  6378. t.changeMode(pe)
  6379. }),
  6380. $("#gui-modes-floorplan").on("click", function(e) {
  6381. y(e),
  6382. i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
  6383. gui_action: "click_floorplan_mode_button"
  6384. }),
  6385. t.changeMode(ie.FLOORPLAN))
  6386. }),
  6387. $("#gui-modes-dollhouse").on("click", function(e) {
  6388. y(e),
  6389. i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
  6390. gui_action: "click_dollhouse_mode_button"
  6391. }),
  6392. t.changeMode(ie.DOLLHOUSE))
  6393. })
  6394. }(0, l),
  6395. function(e, t) {
  6396. $("#play").find("a").on("mousedown touchstart", function(e) {
  6397. y(e),
  6398. _e("tour"),
  6399. q.play(),
  6400. R.trackAlways("showcase_gui", {
  6401. gui_action: "play_highlights"
  6402. })
  6403. }),
  6404. window.startAndPlay = function(e) {
  6405. _e("tour"),
  6406. q.play(),
  6407. R.trackAlways("showcase_gui", {
  6408. gui_action: "play_highlights"
  6409. })
  6410. }
  6411. ,
  6412. $("#pause").find("a").on("mousedown touchstart", function(e) {
  6413. y(e),
  6414. q.pause(),
  6415. R.trackAlways("showcase_gui", {
  6416. gui_action: "pause_highlights"
  6417. })
  6418. }),
  6419. $("#gui-zoomin").find("a").on("click", function(e) {
  6420. y(e),
  6421. t.player.zoomInIncrementally()
  6422. }),
  6423. $("#gui-zoomout").find("a").on("click", function(e) {
  6424. y(e),
  6425. t.player.zoomOutIncrementally()
  6426. })
  6427. }(0, l),
  6428. s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(s.data.name),
  6429. K.on(ae.OPENED, (r = document.getElementById("share-modal"),
  6430. function() {
  6431. _e("share"),
  6432. V.open(r)
  6433. }
  6434. )),
  6435. K.on(ae.CLOSED, V.reset)),
  6436. //1 < s.heroLocations.length ? function(e, i, t) {
  6437. 0 < s.heroLocations.length ? function(e, i, t) {
  6438. var n = 100 / (fe = e.heroLocations.length) + "%"
  6439. , r = $("#thumb-container")
  6440. , o = $("#progressBar");
  6441. $("#status").find(".totalSteps").text(fe);
  6442. for (var a = 0; a < fe; a++) {
  6443. var s = e.heroLocations[a]
  6444. , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
  6445. if (l.attr("data-index", a),
  6446. Ce.highlight.visible && l.find("img").attr("src", s.thumbUrl),
  6447. s.name) {
  6448. var c = $('<div class="overlay"></div>').text(s.name);
  6449. l.prepend(c)
  6450. }
  6451. if (e.has360Views && s.cameraMode === ie.PANORAMA) {
  6452. var h = e.panos.get(s.panoId)
  6453. , 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>';
  6454. l.prepend(u)
  6455. }
  6456. r.append(l),
  6457. o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
  6458. }
  6459. T = 144 * fe,
  6460. 111 * fe,
  6461. $(".thumbImg").on("mouseover", function() {
  6462. !function(e) {
  6463. return e.describe().inTransition
  6464. }(i) && t.showPathToHeroLocation($(this).data("index"))
  6465. }),
  6466. $(".thumbImg").on("mouseout", function() {
  6467. i.clearPath()
  6468. }),
  6469. $(".thumbImg").on("click", function(e) {
  6470. y(e);
  6471. var t = $(this);
  6472. R.updateInteraction(oe.InteractionGui, "thumbnail"),
  6473. R.trackAlways("showcase_gui", {
  6474. gui_action: "click_highlight"
  6475. }),
  6476. i.goToHighlight(t.data("index"))
  6477. }),
  6478. $(".previous").find("a").on("click", function(e) {
  6479. y(e),
  6480. R.trackAlways("showcase_gui", {
  6481. gui_action: "prev_highlight"
  6482. }),
  6483. i.prevHighlight()
  6484. }),
  6485. $(".next").find("a").on("click", function(e) {
  6486. y(e),
  6487. R.trackAlways("showcase_gui", {
  6488. gui_action: "next_highlight"
  6489. }),
  6490. i.nextHighlight()
  6491. }),
  6492. $("#drawer").on("mouseleave", function(t) {
  6493. var i;
  6494. y(t);
  6495. try {
  6496. i = new MouseEvent("mouseup",{
  6497. clientX: t.clientX,
  6498. clientY: t.clientY,
  6499. screenX: t.screenX,
  6500. screenY: t.screenY
  6501. })
  6502. } catch (e) {
  6503. (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)
  6504. }
  6505. document.dispatchEvent(i)
  6506. }),
  6507. (w = new Sly($("#scrollFrame"),{
  6508. horizontal: !0,
  6509. itemNav: "centered",
  6510. smart: !0,
  6511. scrollTrap: !0,
  6512. scrollBy: 1,
  6513. mouseDragging: !0,
  6514. touchDragging: !0,
  6515. speed: 300,
  6516. dragHandle: !0,
  6517. dynamicHandle: !0,
  6518. clickBar: !0,
  6519. scrollBar: $("#scroller"),
  6520. activateOn: null
  6521. }).init()).on("active", function(e, t) {
  6522. t,
  6523. _e("tour"),
  6524. $(".step").removeClass("active"),
  6525. $("#status").find(".curIdx").text(t + 1);
  6526. for (var i = 0; i <= t; i++)
  6527. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6528. }),
  6529. E()
  6530. }(s, l, c) : (Ce.highlight.visible = !1,
  6531. Ce.tourControls.visible = !1),
  6532. z.on(G.OPEN_INFO, _e.bind(this, "info")),
  6533. function() {
  6534. var n;
  6535. document.body.addEventListener("mousedown", function(e) {
  6536. n = 0 === e.button || 1 === e.which ? e.target : null
  6537. }, !0),
  6538. document.body.addEventListener("mouseup", function(t) {
  6539. n !== t.target && (n = b(n, t.target));
  6540. var e = document.getElementById("gui-parent");
  6541. if (b(e, n) !== e && (n = null),
  6542. n) {
  6543. var i;
  6544. try {
  6545. i = new MouseEvent("click",t)
  6546. } catch (e) {
  6547. (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)
  6548. }
  6549. i.syntheticClick = !0,
  6550. n.dispatchEvent(i),
  6551. n = null
  6552. }
  6553. }, !0),
  6554. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6555. e.syntheticClick || (e.stopPropagation(),
  6556. "A" === e.target.nodeName && e.preventDefault())
  6557. }, !0)
  6558. }(),
  6559. A(c),
  6560. C(s, t),
  6561. s.on("floor.changed", I),
  6562. s.on("waiting", function(e) {
  6563. _(e)
  6564. }
  6565. .bind(this, s)),
  6566. s.on("waiting-done", function(e) {
  6567. _(e)
  6568. }
  6569. .bind(this, s)),
  6570. c.on(re.ModeChanged, function(e, t) {
  6571. A(c),
  6572. v(l, c),
  6573. t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
  6574. U.updateMode(t)
  6575. }),
  6576. e.on(oe.Move, _e.bind(this, "move")),
  6577. c.on(re.Ready, function() {
  6578. O.init(e, c, c.tagManager, l),
  6579. c.on(re.ModeChanged, function(e, t) {
  6580. e !== t && $(".vr-popup").is(":visible") && X.dismiss()
  6581. })
  6582. }),
  6583. c.on(re.PanoChosen, function(e, t) {
  6584. A(c, t),
  6585. U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
  6586. }),
  6587. V.on(k.CLOSE, function(e) {
  6588. switch (e) {
  6589. case "vr-modal":
  6590. X.dismiss();
  6591. break;
  6592. case "share-modal":
  6593. K.hide();
  6594. break;
  6595. case "terms-modal":
  6596. W.hide()
  6597. }
  6598. });
  6599. 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();
  6600. l.on("update.controls", function() {
  6601. var e, t, i, n = l.describe();
  6602. if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
  6603. u.show()),
  6604. n.tourInProgress && (d.forEach(function(e) {
  6605. e.classList.add("playing")
  6606. }),
  6607. p.addClass("playing"),
  6608. f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
  6609. u.hide()),
  6610. n.tourInProgress || (q.stopTour(),
  6611. d.forEach(function(e) {
  6612. e.classList.remove("playing")
  6613. }),
  6614. p.removeClass("playing"),
  6615. f.removeClass("playing"))),
  6616. null !== n.currentItem) {
  6617. var r, o;
  6618. $("#status").find(".curIdx").text(n.currentItem + 1),
  6619. n.onTheBus ? (r = "active",
  6620. o = "recent") : (o = "active",
  6621. r = "recent");
  6622. var a = null === n.destinationItem || n.currentItem === n.destinationItem;
  6623. for (e = 0; e < s.heroLocations.length; e += 1)
  6624. i = g.eq(e),
  6625. t = m.eq(e),
  6626. i.removeClass(o),
  6627. t.removeClass(o),
  6628. n.onTheBus && e === n.destinationItem ? (i.addClass(r),
  6629. t.addClass(r),
  6630. w.activate(e)) : n.onTheBus && a && e === n.currentItem ? (i.addClass(r),
  6631. t.addClass(r)) : (i.removeClass(r),
  6632. t.removeClass(r))
  6633. } else
  6634. for (e = 0; e < s.heroLocations.length; e += 1)
  6635. i = g.eq(e),
  6636. t = m.eq(e),
  6637. i.removeClass("active recent"),
  6638. t.removeClass("active recent");
  6639. v(l, c)
  6640. }),
  6641. document.addEventListener("keydown", function(e) {
  6642. switch (R.updateInteraction(oe.InteractionKey),
  6643. e.which) {
  6644. case te.ZERO:
  6645. M.debug && s.toggleAlpha();
  6646. break;
  6647. case te.NINE:
  6648. M.debug && B.toggle();
  6649. break;
  6650. case te.ONE:
  6651. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
  6652. break;
  6653. case te.TWO:
  6654. s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
  6655. break;
  6656. case te.THREE:
  6657. s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
  6658. break;
  6659. case te.FOUR:
  6660. c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
  6661. break;
  6662. case te.SPACE:
  6663. Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
  6664. break;
  6665. case te.RETURN:
  6666. M.debug && s.toggleExplodeUp();
  6667. break;
  6668. case te.P:
  6669. !function(e) {
  6670. me.gui || (me.gui = function(e) {
  6671. var t = new he.GUI;
  6672. return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6673. e.setSweepVisibility(M.showSweeps)
  6674. }),
  6675. t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6676. t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6677. M.transition.flySpeed = 0,
  6678. t.__controllers.forEach(function(e) {
  6679. e.updateDisplay()
  6680. })
  6681. }),
  6682. t.add(M.path, "opacity", 0, 1).name("Path opacity"),
  6683. $(t.__closeButton).hide(),
  6684. t
  6685. }(me.model)),
  6686. (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
  6687. }(!me.visible);
  6688. break;
  6689. case te.U:
  6690. !function(e) {
  6691. ve.gui || (ve.gui = function(t, i) {
  6692. function e() {
  6693. var e = i.toJSON();
  6694. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
  6695. i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
  6696. }
  6697. var n = {}
  6698. , r = new he.GUI({
  6699. autoPlace: !0,
  6700. width: "60%"
  6701. });
  6702. return e(),
  6703. i.on(re.ViewChanged, e),
  6704. r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
  6705. r.domElement.id = "datLinks",
  6706. [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
  6707. if (!S.detectSafari()) {
  6708. var t = document.createElement("button");
  6709. t.classList.add("btn-deep-link"),
  6710. t.innerText = se.MENU_COPY,
  6711. e.nextSibling.appendChild(t);
  6712. var n = function() {
  6713. alert(se.LINK_ALERT_COPY),
  6714. t.hide()
  6715. };
  6716. t.addEventListener("click", function(e) {
  6717. try {
  6718. var t = e.target.parentNode.childNodes[0];
  6719. t.select();
  6720. var i = document.execCommand("copy");
  6721. t.blur(),
  6722. i || n()
  6723. } catch (e) {
  6724. n()
  6725. }
  6726. })
  6727. }
  6728. }),
  6729. $(r.__closeButton).hide(),
  6730. r
  6731. }(ve.model, ve.player)),
  6732. (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
  6733. }(!ve.visible);
  6734. break;
  6735. case te.X:
  6736. M.debug && s.toggleExplode();
  6737. break;
  6738. case te.PLUSEQUALS:
  6739. l.player.activatePersistentZooming(!0),
  6740. O.hideUi();
  6741. break;
  6742. case te.DASHUNDERSCORE:
  6743. l.player.activatePersistentZooming(!1),
  6744. O.hideUi();
  6745. break;
  6746. case te.SEVEN:
  6747. ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
  6748. break;
  6749. case te.EIGHT:
  6750. l.player.decreaseZoomSpeed();
  6751. break;
  6752. case te.NINE:
  6753. l.player.increaseZoomSpeed()
  6754. }
  6755. return c && c.reticule.hide(),
  6756. !0
  6757. }
  6758. .bind(this)),
  6759. document.addEventListener("keyup", function(e) {
  6760. switch (e.which) {
  6761. case te.PLUSEQUALS:
  6762. l.player.deactivatePersistentZooming();
  6763. break;
  6764. case te.DASHUNDERSCORE:
  6765. l.player.deactivatePersistentZooming()
  6766. }
  6767. }
  6768. .bind(this)),
  6769. function(e) {
  6770. me = {
  6771. gui: null,
  6772. visible: !1,
  6773. model: e
  6774. }
  6775. }(s),
  6776. function(e, t) {
  6777. ve = {
  6778. gui: null,
  6779. visible: !1,
  6780. model: e,
  6781. player: t
  6782. }
  6783. }(s, l.player),
  6784. function(e) {
  6785. function t(e, i) {
  6786. $(e).find("a").each(function(e, t) {
  6787. i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6788. t.style.pointerEvents = i ? "auto" : "none"
  6789. })
  6790. }
  6791. e.on(de.ZoomMax, function() {
  6792. t("#gui-zoomin", !1),
  6793. t("#gui-zoomout", !0)
  6794. }),
  6795. e.on(de.ZoomMin, function() {
  6796. t("#gui-zoomin", !0),
  6797. t("#gui-zoomout", !1)
  6798. }),
  6799. e.on(de.ZoomIn, function() {
  6800. t("#gui-zoomout", !0)
  6801. }),
  6802. e.on(de.ZoomOut, function() {
  6803. t("#gui-zoomin", !0)
  6804. }),
  6805. e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6806. e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6807. }(c),
  6808. P.setAutoPlay(s.heroCount()),
  6809. U.init(c, i.mode),
  6810. U.on(H.OPENED, _e.bind(this, "help")),
  6811. W.init(),
  6812. W.on(j.OPENED, (o = document.getElementById("terms-modal"),
  6813. function() {
  6814. _e("terms"),
  6815. V.open(o)
  6816. }
  6817. )),
  6818. W.on(j.CLOSED, V.reset),
  6819. M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
  6820. (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
  6821. M.profiling.enabled && B.show(),
  6822. q.init(l)
  6823. }
  6824. ,
  6825. Le.exports.startLoading = function(e, t, i, n, r, o) {
  6826. function a() {
  6827. o.setLoadingStartTime(),
  6828. function() {
  6829. function e(e) {
  6830. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
  6831. }
  6832. $("body").css("touch-action", "none"),
  6833. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
  6834. var t = document.getElementById("terms-text")
  6835. , i = document.getElementById("more-help-wrapper")
  6836. , n = (document.getElementById("navigation-help-wrapper"),
  6837. document.getElementById("help-dialog"),
  6838. document.getElementById("tag-billboards"));
  6839. M.useWheel && (document.body.addEventListener("mousewheel", e, {
  6840. passive: !1
  6841. }),
  6842. document.body.addEventListener("DOMMouseScroll", e)),
  6843. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6844. e.stopPropagation()
  6845. })
  6846. }(),
  6847. r ? (D.showMessage(t, i, Ce.coBrand.visible),
  6848. l()) : function(e) {
  6849. L.show(e),
  6850. c()
  6851. }(l)
  6852. }
  6853. var s = $.Deferred()
  6854. , l = s.resolve.bind(s);
  6855. return ye = !0,
  6856. _(e),
  6857. e.data.player_options && function(e) {
  6858. Ce.tourControls.visible = e.tour_buttons && S.valueFromHash("gt", 1),
  6859. Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
  6860. Ce.highlight.visible = e.highlight_reel && 1 !== M.specialEdition && M.showHighlights
  6861. }(e.data.player_options),
  6862. 1 === M.specialEdition && $("body").addClass("specialEdition"),
  6863. se.localizeGUI(),
  6864. function(i) {
  6865. function e(e, t) {
  6866. return !!i.player_options[e] && i[t || e]
  6867. }
  6868. $(".model-title").text(i.name);
  6869. var t = M.pageTitle;
  6870. 2 !== S.valueFromHash("mls", 0) && (t = i.name),
  6871. document.title = t,
  6872. S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6873. delay: {
  6874. show: 50,
  6875. hide: 0
  6876. },
  6877. trigger: "hover",
  6878. html: !1,
  6879. viewport: {
  6880. selector: "body",
  6881. padding: 10
  6882. }
  6883. }),
  6884. S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6885. z.populate({
  6886. name: e("model_name", "name"),
  6887. coBrand: e("presented_by"),
  6888. description: e("model_summary", "summary") || "暂无内容",
  6889. contactName: e("contact_name"),
  6890. address: e("address"),
  6891. phone: e("contact_phone"),
  6892. formattedPhone: i.formatted_contact_phone,
  6893. email: e("contact_email"),
  6894. url: e("external_url"),
  6895. socialSharing: i.enable_social_sharing && i.is_public
  6896. })
  6897. }(e.data),
  6898. r || $(".quick").addClass("hidden"),
  6899. e.data.image && !r && function(e) {
  6900. $("<img/>").attr("src", e).on("load", function() {
  6901. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  6902. $(this).remove()
  6903. })
  6904. }(e.data.image),
  6905. n ? (R.impression(),
  6906. a()) : (o.setWaitingStartTime(),
  6907. N.show(r, a)),
  6908. s
  6909. }
  6910. ,
  6911. Le.exports.endLoading = function(e, t, i) {
  6912. var n = t.player;
  6913. function r() {
  6914. i.dismissExaminedTag(),
  6915. i.disableHovering()
  6916. }
  6917. $("#gui-thumb").fadeOut(2500),
  6918. L.hide(function() {
  6919. ye = !1
  6920. }),
  6921. Y.init(e, i),
  6922. z.finishSetup(Object.keys(e.tags).length),
  6923. i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
  6924. X.on(Z.OPENED, r),
  6925. K.on(ae.OPENED, r),
  6926. U.on(H.OPENED, r),
  6927. W.on(j.OPENED, r);
  6928. var o = i.enableHovering.bind(i);
  6929. if (X.on(Z.CLOSED, o),
  6930. K.on(ae.CLOSED, o),
  6931. U.on(H.CLOSED, o),
  6932. W.on(j.CLOSED, o),
  6933. M.labels.enabled && Object.keys(e.labels).length,
  6934. e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
  6935. I(e.currentFloor, n.mode)),
  6936. "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
  6937. h(e, t)),
  6938. c(),
  6939. v(t, t.player),
  6940. $("#gui").fadeIn(1500),
  6941. Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
  6942. l(),
  6943. (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
  6944. }, 2e3),
  6945. !S.isMobile())
  6946. for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
  6947. $(a[s]).addClass("hasHover");
  6948. _(e),
  6949. z.setupToggling(),
  6950. window.editHotPanel && editHotPanel(),
  6951. function() {
  6952. var i = $("#pullTab")
  6953. , e = {
  6954. bottom: {
  6955. "border-bottom-left-radius": "10px",
  6956. "border-bottom-right-radius": "10px"
  6957. },
  6958. top: {
  6959. "border-top-left-radius": "10px",
  6960. "border-top-right-radius": "10px"
  6961. }
  6962. }
  6963. , t = {
  6964. bottom: {
  6965. "border-top-right-radius": "10px",
  6966. "border-bottom-right-radius": "10px"
  6967. },
  6968. top: {
  6969. "border-bottom-left-radius": "10px",
  6970. "border-top-left-radius": "10px"
  6971. }
  6972. };
  6973. function n(e, t) {
  6974. $("#gui-modes-map > div:visible:last").css(e),
  6975. i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
  6976. }
  6977. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
  6978. (window.MP_PREFETCHED_MODELDATA.model.special || "true" === window.MP_PREFETCHED_MODELDATA.special) && window.specialScene && specialScene.special().afterImplement()
  6979. }(),
  6980. window.EditTools && new EditTools(n.sceneRenderer)
  6981. }
  6982. ,
  6983. Le.exports.onProgress = function(e) {
  6984. L.progress(e)
  6985. }
  6986. }
  6987. ).call(this, "/js/gui/gui.js")
  6988. }
  6989. , {
  6990. "../analytics": 4,
  6991. "../controls/serializer": 14,
  6992. "../enum/AlignmentType": 17,
  6993. "../enum/BlackoutStyle": 18,
  6994. "../enum/ControlEvents": 21,
  6995. "../enum/DirectorEvents": 23,
  6996. "../enum/Keys": 30,
  6997. "../enum/PathDiscardMode": 38,
  6998. "../enum/PathDisplayMode": 39,
  6999. "../enum/PlayerEvents": 40,
  7000. "../enum/VROption": 47,
  7001. "../enum/Vectors": 50,
  7002. "../enum/Viewmode": 51,
  7003. "../enum/WarpStyle": 52,
  7004. "../enum/ZoomEvents": 53,
  7005. "../lib/dat.gui": 93,
  7006. "../localization/localize": 108,
  7007. "../tag/Media/MediaEvent": 131,
  7008. "../objects/Snapshot": 153,
  7009. "../settings": 166,
  7010. "../util/ajax": 181,
  7011. "../util/browser": 182,
  7012. "../util/camera": 183,
  7013. "../util/logger": 189,
  7014. "../util/showcase": 193,
  7015. "../util/transitions": 195,
  7016. "./closer/ModalCloserEvent": 61,
  7017. "./closer/modalCloser": 62,
  7018. "./help/HelpEvent": 66,
  7019. "./help/help": 67,
  7020. "./helpManager": 68,
  7021. "./immersiveMode": 69,
  7022. "./konami": 70,
  7023. "./landingScreen": 71,
  7024. "./loadingScreen": 72,
  7025. "./memoryUsage": 73,
  7026. "./playButton": 74,
  7027. "./populateModal": 75,
  7028. "./sharing/ShareEvents": 76,
  7029. "./sharing/modal": 77,
  7030. "./terms/TermsEvent": 78,
  7031. "./terms/terms": 79,
  7032. "./title/TitleEvents": 80,
  7033. "./title/tagToggle": 81,
  7034. "./title/titleBar": 82,
  7035. "./tourInteraction": 84,
  7036. "./vr/vrEvent": 85,
  7037. "./vr/vrModal": 87,
  7038. "./webvr/WebVrEvent": 88,
  7039. "./webvr/webVRgui": 89,
  7040. three: 217
  7041. }],
  7042. 66: [function(e, t, i) {
  7043. "use strict";
  7044. t.exports = Object.freeze({
  7045. OPENED: "help.opened",
  7046. CLOSED: "help.closed"
  7047. })
  7048. }
  7049. , {}],
  7050. 67: [function(e, t, i) {
  7051. "use strict";
  7052. function n() {
  7053. p.on("click", function(e) {
  7054. T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
  7055. setTimeout(function() {
  7056. x = !1
  7057. }, h.help.modalStayDuration),
  7058. S.emit(l.OPENED),
  7059. f.addClass("open " + T),
  7060. p.addClass("open"),
  7061. o(),
  7062. r(),
  7063. v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
  7064. v.classList.add("fadeIn")))
  7065. }),
  7066. E.on("click", function(e) {
  7067. S.close()
  7068. }),
  7069. C.on("click", function(e) {
  7070. T && T !== a.TRANSITIONING && (o(),
  7071. r())
  7072. }),
  7073. I.on("click", function(e) {
  7074. o(),
  7075. I.addClass("underline-tab"),
  7076. c.fill(b, s.MORE_HELP),
  7077. f.addClass("more-help")
  7078. })
  7079. }
  7080. function r() {
  7081. C.addClass("underline-tab"),
  7082. c.fill(_, s.NAVIGATION, T),
  7083. f.addClass(T)
  7084. }
  7085. function o() {
  7086. f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
  7087. A.forEach(function(e) {
  7088. e.classList.remove("underline-tab")
  7089. })
  7090. }
  7091. var a = e("../../enum/Viewmode")
  7092. , s = e("../../enum/HelpModalType")
  7093. , l = e("./HelpEvent")
  7094. , c = (e("../helpManager"),
  7095. e("./../populateModal"))
  7096. , h = e("../../settings")
  7097. , u = e("../../util/common")
  7098. , d = e("events").EventEmitter
  7099. , p = $(".footer-help").eq(0)
  7100. , f = $("#help-dialog").eq(0)
  7101. , g = document.querySelector("#quick-logo")
  7102. , m = document.querySelector("#loaderCoBrand")
  7103. , v = document.querySelector("#help-dialog")
  7104. , y = document.querySelector(".footer")
  7105. , A = $(".help-tabs").children().toArray()
  7106. , C = $(".navigation-tab").eq(0)
  7107. , I = $(".more-help-tab").eq(0)
  7108. , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7109. f.find(".close").eq(0))
  7110. , _ = f.find(".interactions").toArray()
  7111. , b = f.find(".ui-instructions").toArray()
  7112. , w = a.PANORAMA
  7113. , T = a.PANORAMA
  7114. , x = !1
  7115. , S = {
  7116. init: function(e, t) {
  7117. w = T = t,
  7118. [v, m, g, y].forEach(function(e) {
  7119. e.classList.add(c.deviceType)
  7120. }),
  7121. n()
  7122. },
  7123. close: function() {
  7124. if (f.hasClass("open") && (this.emit(l.CLOSED),
  7125. p.removeClass("open"),
  7126. f.removeClass("open"),
  7127. v.classList.contains("fadeIn"))) {
  7128. v.classList.remove("fadeIn");
  7129. var e = T === a.TRANSITIONING ? w : T;
  7130. c.clear(_, s.NAVIGATION, e)
  7131. }
  7132. },
  7133. updateMode: function(e) {
  7134. w = T,
  7135. T = e
  7136. }
  7137. };
  7138. u.extendObject(S, d.prototype),
  7139. t.exports = S
  7140. }
  7141. , {
  7142. "../../enum/HelpModalType": 28,
  7143. "../../enum/Viewmode": 51,
  7144. "../../settings": 166,
  7145. "../../util/common": 185,
  7146. "../helpManager": 68,
  7147. "./../populateModal": 75,
  7148. "./HelpEvent": 66,
  7149. events: 202
  7150. }],
  7151. 68: [function(s, l, e) {
  7152. (function(e) {
  7153. "use strict";
  7154. var t = s("../util/browser")
  7155. , i = s("./../util/logger")
  7156. , n = s("./../settings")
  7157. , r = new i(e)
  7158. , o = function() {
  7159. var t;
  7160. try {
  7161. return t = window.localStorage.getItem("visitCount") || "0",
  7162. t = (parseFloat(t) + 1).toString(),
  7163. window.localStorage.setItem("visitCount", t),
  7164. r.debug("visitCount = " + t),
  7165. t
  7166. } catch (e) {
  7167. t = "1",
  7168. r.debug("couldn't set local storage")
  7169. }
  7170. }()
  7171. , a = !1;
  7172. l.exports = {
  7173. isHelpDisabled: function() {
  7174. return "0" === t.valueFromHash("help", null) || a
  7175. },
  7176. isLargeHelpEnabled: function() {
  7177. return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
  7178. },
  7179. isSmallHelpEnabled: function() {
  7180. return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
  7181. },
  7182. isHelpEnabled: function() {
  7183. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7184. },
  7185. setAutoPlay: function(e) {
  7186. a = 0 <= n.warp.auto && 1 < e
  7187. }
  7188. }
  7189. }
  7190. ).call(this, "/js/gui/helpManager.js")
  7191. }
  7192. , {
  7193. "../util/browser": 182,
  7194. "./../settings": 166,
  7195. "./../util/logger": 189
  7196. }],
  7197. 69: [function(e, t, i) {
  7198. "use strict";
  7199. function r(e) {
  7200. M || n(e) && C.hasClass("playing") || (clearTimeout(x),
  7201. T = !0,
  7202. h.close(),
  7203. function(e) {
  7204. !n(e) && S ? v.forEach(function(e) {
  7205. e.classList.remove("drawerOpen"),
  7206. e.classList.add("duringTour")
  7207. }) : C.hasClass("open") ? v.forEach(function(e) {
  7208. e.classList.remove("duringTour"),
  7209. e.classList.add("drawerOpen")
  7210. }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
  7211. e.classList.add("fadeOut")
  7212. })
  7213. }(e),
  7214. R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
  7215. C.hasClass("playing") || (y.forEach(function(e) {
  7216. e.classList.add("detectHover")
  7217. }),
  7218. x = setTimeout(a, c.immersive.timeToShowAgain))))
  7219. }
  7220. function o() {
  7221. C.hasClass("playing") || (clearTimeout(x),
  7222. x = setTimeout(a, c.immersive.timeToShowAgain))
  7223. }
  7224. function a() {
  7225. clearTimeout(x),
  7226. T = !1,
  7227. m.forEach(function(e) {
  7228. e.classList.remove("drawerOpen")
  7229. }),
  7230. S || v.forEach(function(e) {
  7231. e.classList.remove("duringTour")
  7232. }),
  7233. y.forEach(function(e) {
  7234. e.classList.remove("detectHover")
  7235. })
  7236. }
  7237. function s() {
  7238. T ? a() : r(),
  7239. M = !0,
  7240. setTimeout(function() {
  7241. M = !1
  7242. }, c.immersive.uiStayDuration)
  7243. }
  7244. function n(e) {
  7245. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7246. }
  7247. var l = e("../util/browser")
  7248. , c = e("../settings")
  7249. , h = e("./help/help")
  7250. , u = e("../enum/tagEvents")
  7251. , d = e("../enum/ControlEvents")
  7252. , p = e("../enum/PlayerEvents")
  7253. , f = e("../enum/DirectorEvents")
  7254. , g = (p = e("../enum/PlayerEvents"),
  7255. e("../enum/Viewmode"))
  7256. , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7257. , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7258. , y = $("#hover-bottom, #hover-top").toArray()
  7259. , A = ($("#pullTab").eq(0),
  7260. $("#playHead").eq(0),
  7261. $(".pinBottom-container").eq(0))
  7262. , C = $("#drawer").eq(0)
  7263. , I = $("#drawer-container").eq(0)
  7264. , E = $("#meta-info").eq(0)
  7265. , _ = $(".pinTop.left").eq(0)
  7266. , b = $("#player").eq(0)
  7267. , w = document.getElementById("pullTab")
  7268. , T = !1
  7269. , x = null
  7270. , S = !1
  7271. , M = !1
  7272. , R = null
  7273. , P = !1;
  7274. t.exports.init = function(e, t, i, n) {
  7275. (function(t, i, e, n) {
  7276. [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
  7277. t.controls[e].on(d.Move, r),
  7278. t.controls[e].on(d.LongTap, s)
  7279. }),
  7280. b.on("mousewheel DOMMouseScroll", r),
  7281. e.on(u.TagActivated, r),
  7282. e.on(u.TagNavigation, r),
  7283. i.on(p.FlyingEnded, o),
  7284. i.on(p.ModeChanging, function(e, t) {
  7285. P = t !== g.PANORAMA && e !== g.PANORAMA
  7286. }),
  7287. i.on(p.ModeChanged, function(e, t) {
  7288. R = i.mode,
  7289. t !== g.TRANSITIONING ? a() : r("modeChange")
  7290. }),
  7291. n.on(f.TourStart, function() {
  7292. S = !0,
  7293. r()
  7294. }),
  7295. n.on(f.TourEnd, function() {
  7296. S = !1,
  7297. a()
  7298. }),
  7299. n.on(f.ActionInterrupted, function() {
  7300. S = !1
  7301. }),
  7302. w.addEventListener("touchend", function() {
  7303. $("#pullTab").hasClass("opened") && !S && a()
  7304. }, !0)
  7305. }
  7306. )(e, t, i, n),
  7307. l.isMobile() ? (y.forEach(function(e) {
  7308. e.classList.add("mobile")
  7309. }),
  7310. A.click(a)) : (y.forEach(function(e) {
  7311. e.addEventListener("mouseleave", function() {
  7312. !b.is(":hover") && y[0].classList.contains("detectHover") && a()
  7313. }, !0)
  7314. }),
  7315. b.mouseleave(function() {
  7316. y[0].classList.contains("detectHover") && a()
  7317. })),
  7318. R = t.mode
  7319. }
  7320. ,
  7321. t.exports.hideUi = r,
  7322. t.exports.resetDrawer = function() {
  7323. I.hasClass("duringTour") || (S = !1,
  7324. r("gui"),
  7325. a())
  7326. }
  7327. }
  7328. , {
  7329. "../enum/ControlEvents": 21,
  7330. "../enum/DirectorEvents": 23,
  7331. "../enum/tagEvents": 32,
  7332. "../enum/PlayerEvents": 40,
  7333. "../enum/Viewmode": 51,
  7334. "../settings": 166,
  7335. "../util/browser": 182,
  7336. "./help/help": 67
  7337. }],
  7338. 70: [function(i, n, e) {
  7339. (function(e) {
  7340. "use strict";
  7341. var t = i("./../util/logger")
  7342. , o = i("./../settings")
  7343. , a = i("./debug")
  7344. , s = i("./../util/common")
  7345. , l = (i("./gui"),
  7346. new t(e));
  7347. o.console && $("body").append('<div id="debug-console"></div>'),
  7348. n.exports.init = function(i, n, r) {
  7349. l.debug("konami has the modelInstance");
  7350. var t = [];
  7351. $(window).on("keydown", function(e) {
  7352. t.push(e.which),
  7353. t.length > o.secretPanelWord.length && t.shift(),
  7354. s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
  7355. o.debug = !0)
  7356. }),
  7357. $(window).on("keydown", function e(t) {
  7358. o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
  7359. $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
  7360. })
  7361. }
  7362. }
  7363. ).call(this, "/js/gui/konami.js")
  7364. }
  7365. , {
  7366. "./../settings": 166,
  7367. "./../util/common": 185,
  7368. "./../util/logger": 189,
  7369. "./debug": 63,
  7370. "./gui": 65
  7371. }],
  7372. 71: [function(e, t, i) {
  7373. "use strict";
  7374. function r() {
  7375. s.clear(m, l.LANDING[v]),
  7376. g.removeClass("fadeIn")
  7377. }
  7378. var o = e("../settings")
  7379. , a = (e("./help/help"),
  7380. e("./helpManager"))
  7381. , s = e("./populateModal")
  7382. , l = e("../enum/HelpModalType")
  7383. , n = e("../enum/Viewmode")
  7384. , c = e("../enum/DirectorEvents")
  7385. , h = e("../enum/PlayerEvents")
  7386. , u = $("#quick-blackout").eq(0)
  7387. , d = $("#quick-logo").eq(0)
  7388. , p = $(".quick-brand").toArray()
  7389. , f = $("#loaderCoBrand").eq(0)
  7390. , g = $("#interaction-modal").eq(0)
  7391. , m = g.find(".interaction").toArray()
  7392. , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7393. "");
  7394. t.exports.delayLanding = function(e) {
  7395. var t = $.Deferred();
  7396. e || t.resolve();
  7397. var i = o.startupFlyinDelay;
  7398. return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
  7399. setTimeout(t.resolve.bind(t), i),
  7400. t
  7401. }
  7402. ,
  7403. t.exports.showMessage = function(e, t, i) {
  7404. var n = 0;
  7405. o.quickstart.enabled && (function(e) {
  7406. e && (f.addClass("quick-brand"),
  7407. d.before(f),
  7408. p = $(".quick-brand").toArray()),
  7409. u.addClass("fadeOut"),
  7410. setTimeout(function() {
  7411. p.forEach(function(e) {
  7412. e.classList.add("fadeIn")
  7413. })
  7414. }, o.quickstart.showTextDelay),
  7415. setTimeout(function() {
  7416. p.forEach(function(e) {
  7417. e.classList.add("fadeOut")
  7418. })
  7419. }, o.quickstart.fadeOutDelay)
  7420. }(i),
  7421. n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
  7422. function(e, t) {
  7423. setTimeout(function() {
  7424. if (a.isHelpEnabled()) {
  7425. if (t(),
  7426. s.init(),
  7427. g.addClass("fadeIn landing " + s.deviceType),
  7428. a.isSmallHelpEnabled())
  7429. return void g.addClass("small");
  7430. s.fill(m, l.LANDING[v]),
  7431. g.addClass(v)
  7432. }
  7433. }, e);
  7434. var i = {
  7435. pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
  7436. mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
  7437. }
  7438. , n = $(".nav-icon .icon");
  7439. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
  7440. function r(e) {
  7441. e.on("click", function() {
  7442. var e = null;
  7443. if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
  7444. i.length < e || e < 1)
  7445. return !1;
  7446. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
  7447. "data-page": e,
  7448. src: i.mobile[e - 1]
  7449. }) : n.attr({
  7450. "data-page": e,
  7451. src: i.pc[e - 1]
  7452. })
  7453. })
  7454. }
  7455. r($(".next-button")),
  7456. r($(".prev-button"))
  7457. }(n, function() {
  7458. e.once(h.Move, r),
  7459. t.once(c.TourStart, r)
  7460. })
  7461. }
  7462. ,
  7463. t.exports.init = function(e, t) {
  7464. v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
  7465. }
  7466. ,
  7467. t.exports.dismissModal = r
  7468. }
  7469. , {
  7470. "../enum/DirectorEvents": 23,
  7471. "../enum/HelpModalType": 28,
  7472. "../enum/PlayerEvents": 40,
  7473. "../enum/Viewmode": 51,
  7474. "../settings": 166,
  7475. "./help/help": 67,
  7476. "./helpManager": 68,
  7477. "./populateModal": 75
  7478. }],
  7479. 72: [function(e, t, i) {
  7480. "use strict";
  7481. var n = e("./circleLoader").circleLoader;
  7482. t.exports = {
  7483. element: $("#gui-loading"),
  7484. hide: function(e) {
  7485. n.done(),
  7486. this.element.fadeOut(1500, e)
  7487. },
  7488. show: function(e) {
  7489. this.element.fadeIn(500, function() {
  7490. this.element.css("display", "table"),
  7491. e && e()
  7492. }
  7493. .bind(this))
  7494. },
  7495. progress: function(e) {
  7496. n.set(e)
  7497. }
  7498. }
  7499. }
  7500. , {
  7501. "./circleLoader": 60
  7502. }],
  7503. 73: [function(e, t, i) {
  7504. "use strict";
  7505. var n = e("../settings")
  7506. , r = $("#memory-info")
  7507. , o = r.find("#memory-gpu")
  7508. , a = !1;
  7509. t.exports = {
  7510. show: function() {
  7511. n.profiling.enabled && (r.show(),
  7512. a = !0)
  7513. },
  7514. hide: function() {
  7515. r.hide(),
  7516. a = !1
  7517. },
  7518. toggle: function() {
  7519. a ? this.hide() : this.show()
  7520. },
  7521. update: function(e) {
  7522. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7523. }
  7524. }
  7525. }
  7526. , {
  7527. "../settings": 166
  7528. }],
  7529. 74: [function(e, t, i) {
  7530. "use strict";
  7531. e("../util/browser"),
  7532. e("../analytics");
  7533. e("../settings"),
  7534. t.exports = {
  7535. show: function(e, t) {
  7536. $("#gui-message").fadeOut(500, function() {
  7537. t()
  7538. })
  7539. }
  7540. }
  7541. }
  7542. , {
  7543. "../analytics": 4,
  7544. "../settings": 166,
  7545. "../util/browser": 182
  7546. }],
  7547. 75: [function(e, t, i) {
  7548. "use strict";
  7549. function n(e, t, i, n) {
  7550. i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  7551. }
  7552. var r = e("../util/browser")
  7553. , o = e("../localization/localize")
  7554. , a = e("../enum/HelpModalType")
  7555. , s = (e("../enum/HelpModalSize"),
  7556. e("../enum/Viewmode"));
  7557. t.exports = {
  7558. init: function() {
  7559. if (!this.hasInitialized) {
  7560. this.hasInitialized = !0,
  7561. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7562. this.assets = {},
  7563. this.assets[a.LANDING[s.PANORAMA]] = {
  7564. desktop: {
  7565. left: {
  7566. "top-info": o.ROTATE,
  7567. "big-image": "images/nav_help_mouse_drag_left.png",
  7568. keyboard: "images/nav_help_keyboard_left_right.png"
  7569. },
  7570. middle: {
  7571. "top-info": o.MOVE,
  7572. "big-image": "images/nav_help_mouse_click.png",
  7573. keyboard: "images/nav_help_keyboard_up_down.png"
  7574. },
  7575. right: {
  7576. "top-info": o.ZOOM,
  7577. "big-image": "images/nav_help_mouse_zoom.png",
  7578. keyboard: "images/nav_help_zoom_keys.png"
  7579. }
  7580. },
  7581. mobile: {
  7582. left: {
  7583. "top-info": o.ROTATE,
  7584. "big-image": "images/nav_help_gesture_drag.png"
  7585. },
  7586. middle: {
  7587. "top-info": o.MOVE,
  7588. "big-image": "images/nav_help_gesture_tap.png"
  7589. },
  7590. right: {
  7591. "top-info": o.ZOOM,
  7592. "big-image": "images/nav_help_gesture_pinch.png"
  7593. }
  7594. }
  7595. },
  7596. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7597. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7598. desktop: {
  7599. left: {
  7600. "top-info": o.ROTATE,
  7601. "big-image": "images/nav_help_mouse_drag_left.png",
  7602. keyboard: "images/nav_help_keyboard_left_right.png"
  7603. },
  7604. middle: {
  7605. "top-info": o.MOVE,
  7606. "big-image": "images/nav_help_mouse_position_right.png"
  7607. }
  7608. },
  7609. mobile: {
  7610. left: {
  7611. "top-info": o.ROTATE,
  7612. "big-image": "images/nav_help_gesture_drag.png"
  7613. },
  7614. middle: {
  7615. "top-info": o.MOVE,
  7616. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7617. }
  7618. }
  7619. },
  7620. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7621. desktop: {
  7622. left: {
  7623. "top-info": o.MOVE,
  7624. "big-image": "images/nav_help_mouse_position_left.png"
  7625. },
  7626. middle: {
  7627. "top-info": o.ROTATE,
  7628. "big-image": "images/nav_help_mouse_drag_right.png",
  7629. keyboard: "images/nav_help_keyboard_left_right.png"
  7630. }
  7631. },
  7632. mobile: {
  7633. left: {
  7634. "top-info": o.MOVE,
  7635. "big-image": "images/nav_help_gesture_position.png"
  7636. },
  7637. middle: {
  7638. "top-info": o.ROTATE,
  7639. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7640. }
  7641. }
  7642. };
  7643. var e = {
  7644. "top-info": o.INSIDE,
  7645. "big-image": "images/nav_help_click_inside.png",
  7646. keyboard: "images/nav_help_inside_key.png"
  7647. };
  7648. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7649. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7650. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7651. var t = {
  7652. "top-info": o.INSIDE,
  7653. "big-image": "images/nav_help_tap_inside.png"
  7654. };
  7655. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7656. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7657. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7658. this.assets[a.NAVIGATION] = {},
  7659. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7660. desktop: {
  7661. left: {
  7662. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7663. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7664. "big-image": "images/nav_help_mouse_drag_left.png",
  7665. keyboard: "images/nav_help_keyboard_left_right.png"
  7666. },
  7667. middle: {
  7668. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7669. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7670. "big-image": "images/nav_help_mouse_click.png",
  7671. keyboard: "images/nav_help_keyboard_up_down.png"
  7672. },
  7673. right: {
  7674. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7675. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7676. "big-image": "images/nav_help_mouse_zoom.png",
  7677. keyboard: "images/nav_help_zoom_keys.png"
  7678. }
  7679. },
  7680. mobile: {
  7681. left: {
  7682. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7683. "big-image": "images/nav_help_gesture_drag.png"
  7684. },
  7685. middle: {
  7686. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7687. "big-image": "images/nav_help_gesture_tap.png"
  7688. },
  7689. right: {
  7690. "top-info": o.HELP_MOBILE_3,
  7691. "big-image": "images/nav_help_gesture_pinch.png"
  7692. }
  7693. }
  7694. },
  7695. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7696. desktop: {
  7697. left: {
  7698. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7699. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7700. "big-image": "images/nav_help_mouse_drag_left.png",
  7701. keyboard: "images/nav_help_keyboard_all.png"
  7702. },
  7703. middle: {
  7704. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7705. "big-image": "images/nav_help_mouse_position_right.png"
  7706. },
  7707. right: {
  7708. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7709. "big-image": "images/nav_help_mouse_zoom.png"
  7710. }
  7711. },
  7712. mobile: {
  7713. left: {
  7714. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7715. "big-image": "images/nav_help_gesture_drag.png"
  7716. },
  7717. middle: {
  7718. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7719. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7720. },
  7721. right: {
  7722. "top-info": o.HELP_MOBILE_3,
  7723. "big-image": "images/nav_help_gesture_pinch.png"
  7724. }
  7725. }
  7726. },
  7727. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7728. desktop: {
  7729. left: {
  7730. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7731. "big-image": "images/nav_help_mouse_position_left.png"
  7732. },
  7733. middle: {
  7734. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7735. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7736. "big-image": "images/nav_help_mouse_drag_right.png",
  7737. keyboard: "images/nav_help_keyboard_left_right.png"
  7738. },
  7739. right: {
  7740. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7741. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7742. "big-image": "images/nav_help_mouse_zoom.png",
  7743. keyboard: "images/nav_help_keyboard_up_down.png"
  7744. }
  7745. },
  7746. mobile: {
  7747. left: {
  7748. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7749. "big-image": "images/nav_help_gesture_position.png"
  7750. },
  7751. middle: {
  7752. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7753. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7754. },
  7755. right: {
  7756. "top-info": o.HELP_MOBILE_3,
  7757. "big-image": "images/nav_help_gesture_pinch.png"
  7758. }
  7759. }
  7760. },
  7761. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7762. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7763. "top-info": o.HELP_DESKTOP_360_2A,
  7764. "bottom-info": o.HELP_DESKTOP_360_2B,
  7765. "big-image": "images/nav_help_click_inside.png",
  7766. keyboard: "images/nav_help_inside_key.png"
  7767. },
  7768. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7769. "top-info": o.HELP_MOBILE_360_2,
  7770. "big-image": "images/nav_help_tap_inside.png"
  7771. },
  7772. this.assets[a.MORE_HELP] = {
  7773. desktop: {
  7774. "more-help-hlr": {
  7775. "top-info": o.HELP_MORE_HLR_A,
  7776. "big-image": "images/nav_help_expand.svg",
  7777. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7778. },
  7779. "more-help-dollhouse": {
  7780. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7781. "big-image": "images/nav_help_dollhouse.svg",
  7782. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7783. },
  7784. "more-help-floors": {
  7785. "top-info": o.HELP_MORE_FLOORS_A,
  7786. "big-image": "images/nav_help_floor picker.svg",
  7787. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7788. },
  7789. "more-help-tag": {
  7790. "top-info": o.HELP_MORE_TAG_A,
  7791. "big-image": "images/nav_help_tag.svg",
  7792. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  7793. },
  7794. "more-help-zoom": {
  7795. "top-info": o.HELP_MORE_ZOOM_A,
  7796. "big-image": "images/nav_help_zoom.svg",
  7797. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  7798. },
  7799. "more-help-tour": {
  7800. "top-info": o.HELP_MORE_TOUR_A,
  7801. "big-image": "images/nav_help_play.png",
  7802. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7803. },
  7804. "more-help-inside": {
  7805. "top-info": o.HELP_MORE_INSIDE_A,
  7806. "big-image": "images/nav_help_inside.svg",
  7807. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  7808. },
  7809. "more-help-vr": {
  7810. "top-info": o.HELP_MORE_VR_A,
  7811. "big-image": "images/nav_help_vr.svg",
  7812. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  7813. },
  7814. "more-help-360": {
  7815. "top-info": o.HELP_MORE_360_A,
  7816. "big-image": "images/nav_help_360.svg",
  7817. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  7818. },
  7819. "more-help-fullscreen": {
  7820. "top-info": o.HELP_MORE_FULLSCREEN_A,
  7821. "big-image": "images/nav_help_fullscreen.svg",
  7822. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  7823. }
  7824. },
  7825. mobile: {
  7826. "more-help-hlr": {
  7827. "top-info": o.HELP_MORE_HLR_A,
  7828. "big-image": "images/nav_help_expand.svg",
  7829. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7830. },
  7831. "more-help-dollhouse": {
  7832. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7833. "big-image": "images/nav_help_dollhouse.svg",
  7834. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  7835. },
  7836. "more-help-floors": {
  7837. "top-info": o.HELP_MORE_FLOORS_A,
  7838. "big-image": "images/nav_help_floor picker.svg",
  7839. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7840. },
  7841. "more-help-tag": {
  7842. "top-info": o.HELP_MORE_TAG_A,
  7843. "big-image": "images/nav_help_tag.svg",
  7844. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  7845. },
  7846. "more-help-tour": {
  7847. "top-info": o.HELP_MORE_TOUR_A,
  7848. "big-image": "images/nav_help_play.png",
  7849. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  7850. },
  7851. "more-help-inside": {
  7852. "top-info": o.HELP_MORE_INSIDE_A,
  7853. "big-image": "images/nav_help_inside.svg",
  7854. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  7855. },
  7856. "more-help-vr": {
  7857. "top-info": o.HELP_MORE_VR_A,
  7858. "big-image": "images/webvr.svg",
  7859. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  7860. },
  7861. "more-help-360": {
  7862. "top-info": o.HELP_MORE_360_A,
  7863. "big-image": "images/nav_help_360.svg",
  7864. "bottom-info": o.HELP_MOBILE_MORE_360_B
  7865. }
  7866. }
  7867. },
  7868. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  7869. desktop: {
  7870. left: {
  7871. "top-info": o.ROTATE,
  7872. "big-image": "images/nav_help_mouse_drag_left.png",
  7873. keyboard: "images/nav_help_keyboard_left_right.png"
  7874. },
  7875. middle: {
  7876. "top-info": o.MOVE,
  7877. "big-image": "images/nav_help_mouse_click.png",
  7878. keyboard: "images/nav_help_keyboard_up_down.png"
  7879. },
  7880. right: {
  7881. "top-info": o.PLAY,
  7882. "big-image": "images/Desktop-help-play-button.svg",
  7883. keyboard: "images/Desktop-help-spacebar-2.svg"
  7884. }
  7885. },
  7886. mobile: {
  7887. left: {
  7888. "top-info": o.ROTATE,
  7889. "big-image": "images/nav_help_gesture_drag.png"
  7890. },
  7891. middle: {
  7892. "top-info": o.MOVE,
  7893. "big-image": "images/nav_help_gesture_tap.png"
  7894. },
  7895. right: {
  7896. "top-info": o.PLAY,
  7897. "big-image": "images/mobile-help-play-button.svg"
  7898. }
  7899. }
  7900. },
  7901. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  7902. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  7903. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  7904. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  7905. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  7906. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  7907. }
  7908. },
  7909. fill: function(e, t, i) {
  7910. n.call(this, e, t, i, !0)
  7911. },
  7912. clear: function(e, t, i) {
  7913. n.call(this, e, t, i, !1)
  7914. }
  7915. }
  7916. }
  7917. , {
  7918. "../enum/HelpModalSize": 27,
  7919. "../enum/HelpModalType": 28,
  7920. "../enum/Viewmode": 51,
  7921. "../localization/localize": 108,
  7922. "../util/browser": 182
  7923. }],
  7924. 76: [function(e, t, i) {
  7925. "use strict";
  7926. t.exports = Object.freeze({
  7927. OPENED: "share.open",
  7928. CLOSED: "share.closed",
  7929. LINK_CLICKED: "share.linked"
  7930. })
  7931. }
  7932. , {}],
  7933. 77: [function(e, t, i) {
  7934. "use strict";
  7935. function n(n) {
  7936. function e(e, t) {
  7937. var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
  7938. I.emit(l.LINK_CLICKED, {
  7939. channel: n
  7940. }),
  7941. window.open(C[n], "shareWindow", i)
  7942. }
  7943. switch (n) {
  7944. case A.FACEBOOK:
  7945. e(580, 420);
  7946. break;
  7947. case A.TWITTER:
  7948. e(550, 440);
  7949. break;
  7950. case A.MAIL:
  7951. I.emit(l.LINK_CLICKED, {
  7952. channel: "email"
  7953. }),
  7954. window.open(C[n], "_blank");
  7955. break;
  7956. case A.LINKEDIN:
  7957. }
  7958. }
  7959. function r(e) {
  7960. I.emit(l.LINK_CLICKED, {
  7961. channel: "copylink"
  7962. });
  7963. var t = document.createRange();
  7964. t.selectNodeContents(v);
  7965. var i = window.getSelection();
  7966. i.removeAllRanges(),
  7967. i.addRange(t),
  7968. document.execCommand("copy"),
  7969. y.classList.remove("hidden"),
  7970. v.classList.add("highlighted")
  7971. }
  7972. function o(e) {
  7973. e && (e.stopPropagation(),
  7974. e.target === v) || (window.getSelection().removeAllRanges(),
  7975. v.classList.remove("highlighted"),
  7976. y.classList.add("hidden"))
  7977. }
  7978. var a = e("../../util/browser")
  7979. , s = e("../../localization/localize")
  7980. , l = e("./ShareEvents")
  7981. , c = e("../../util/common")
  7982. , h = e("events").EventEmitter
  7983. , u = document.getElementById("sharing")
  7984. , d = document.getElementById("share-modal")
  7985. , p = document.getElementById("share-close")
  7986. , f = document.getElementById("facebook-share")
  7987. , g = document.getElementById("twitter-share")
  7988. , m = document.getElementById("mail-share")
  7989. , v = document.getElementById("share-url-text")
  7990. , y = document.getElementById("copy-success")
  7991. , A = Object.freeze({
  7992. FACEBOOK: "facebook",
  7993. TWITTER: "twitter",
  7994. MAIL: "mail",
  7995. LINKEDIN: "linkedin"
  7996. })
  7997. , C = {};
  7998. C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  7999. C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8000. C[A.MAIL] = "mailto:?subject=";
  8001. var I = {
  8002. init: function(e) {
  8003. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8004. C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8005. C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8006. C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8007. u.addEventListener("click", this.toggle.bind(this)),
  8008. p.addEventListener("click", this.hide.bind(this)),
  8009. v.addEventListener("click", r),
  8010. d.addEventListener("click", o),
  8011. f.addEventListener("click", n.bind(this, A.FACEBOOK)),
  8012. g.addEventListener("click", n.bind(this, A.TWITTER)),
  8013. m.addEventListener("click", n.bind(this, A.MAIL)),
  8014. v.textContent = window.location.href + "&utm_source=4",
  8015. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8016. u.classList.remove("hidden")
  8017. },
  8018. show: function() {
  8019. this.emit(l.OPENED),
  8020. d.classList.add("fadeIn")
  8021. },
  8022. hide: function() {
  8023. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8024. document.selection && document.selection.empty(),
  8025. window.getSelection().removeAllRanges(),
  8026. o(),
  8027. d.classList.remove("fadeIn"))
  8028. },
  8029. toggle: function() {
  8030. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8031. }
  8032. };
  8033. c.extendObject(I, h.prototype),
  8034. t.exports = I
  8035. }
  8036. , {
  8037. "../../localization/localize": 108,
  8038. "../../util/browser": 182,
  8039. "../../util/common": 185,
  8040. "./ShareEvents": 76,
  8041. events: 202
  8042. }],
  8043. 78: [function(e, t, i) {
  8044. "use strict";
  8045. t.exports = Object.freeze({
  8046. OPENED: "terms.opened",
  8047. CLOSED: "terms.closed"
  8048. })
  8049. }
  8050. , {}],
  8051. 79: [function(e, t, i) {
  8052. "use strict";
  8053. var n = e("./TermsEvent")
  8054. , r = e("../../localization/localize")
  8055. , o = e("../../analytics")
  8056. , a = e("../../util/ajax")
  8057. , s = e("../../util/common")
  8058. , l = e("events").EventEmitter
  8059. , c = document.getElementById("terms-modal")
  8060. , h = {
  8061. init: function() {
  8062. $(".footer-terms").on("click", function(e) {
  8063. e.preventDefault(),
  8064. this.show()
  8065. }
  8066. .bind(this)),
  8067. $("#terms-modal .close").on("click", this.hide.bind(this))
  8068. },
  8069. show: function() {
  8070. this.emit(n.OPENED),
  8071. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8072. var t = $("#terms-text").html(e);
  8073. o.track("showcase_gui", {
  8074. gui_action: "click_terms_button",
  8075. interaction_source: "gui"
  8076. }),
  8077. t.find("a").attr("target", "_blank")
  8078. }).fail(function() {
  8079. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8080. }),
  8081. c.classList.add("fadeIn")
  8082. },
  8083. hide: function(e) {
  8084. e && e.preventDefault(),
  8085. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8086. c.classList.remove("fadeIn")
  8087. }
  8088. };
  8089. s.extendObject(h, l.prototype),
  8090. t.exports = h
  8091. }
  8092. , {
  8093. "../../analytics": 4,
  8094. "../../localization/localize": 108,
  8095. "../../util/ajax": 181,
  8096. "../../util/common": 185,
  8097. "./TermsEvent": 78,
  8098. events: 202
  8099. }],
  8100. 80: [function(e, t, i) {
  8101. "use strict";
  8102. t.exports = Object.freeze({
  8103. OPEN_INFO: "title.open.info",
  8104. CLOSE_INFO: "title.close.info",
  8105. SHOW_INFO: "title.show.info",
  8106. HIDE_INFO: "title.hide.info",
  8107. LINK_CLICKED: "title.link.click",
  8108. CONTACT_LINK_CLICKED: "title.contact.click",
  8109. ORIGIN_LINK_CLICKED: "title.origin.click"
  8110. })
  8111. }
  8112. , {}],
  8113. 81: [function(e, t, i) {
  8114. "use strict";
  8115. var o = e("../../settings");
  8116. t.exports.init = function(e, t) {
  8117. o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
  8118. function e(e) {
  8119. t.shouldShowtags = "show" === this.value,
  8120. t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
  8121. }
  8122. document.getElementById("tag-toggles").classList.remove("hidden"),
  8123. document.getElementById("radio-tag-show").checked = !0;
  8124. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8125. n[r].addEventListener("change", e)
  8126. }(e, t)
  8127. }
  8128. }
  8129. , {
  8130. "../../settings": 166
  8131. }],
  8132. 82: [function(S, M, e) {
  8133. (function(e) {
  8134. "use strict";
  8135. function i(e) {
  8136. return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
  8137. _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
  8138. _.appendChild(function(e) {
  8139. var t = document.createElement("a");
  8140. return t.id = "url",
  8141. t.target = "_blank",
  8142. t.href = e,
  8143. t.innerText = e,
  8144. t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
  8145. t
  8146. }(e)),
  8147. b.forEach(function(e) {
  8148. e.classList.add("share-link")
  8149. }),
  8150. 0))
  8151. }
  8152. function s(e, t) {
  8153. var i = e
  8154. , n = t;
  8155. return function(e, t) {
  8156. i.push(t || n, e)
  8157. }
  8158. }
  8159. var l = S("../../util/browser")
  8160. , t = S("../../util/common")
  8161. , n = S("../../util/logger")
  8162. , r = S("../../localization/localize")
  8163. , o = S("./titleBarSettings")
  8164. , c = S("../../settings")
  8165. , a = S("./TitleEvents")
  8166. , h = S("events").EventEmitter
  8167. , u = new n(e)
  8168. , d = document.querySelector(".pinTop.left")
  8169. , p = document.getElementsByClassName("title-container")[0]
  8170. , f = document.getElementById("title-toggle").querySelector("i")
  8171. , g = document.getElementById("meta-info-wrapper")
  8172. , m = document.getElementById("meta-info")
  8173. , v = document.getElementById("meta-description")
  8174. , y = document.getElementsByClassName("contact-info")[0]
  8175. , A = document.getElementById("contact-data")
  8176. , C = document.getElementById("addressTxt")
  8177. , I = document.getElementById("tag-toggles")
  8178. , E = document.getElementById("share-origin")
  8179. , _ = document.getElementById("share-link-wrapper")
  8180. , b = [m, g, p]
  8181. , w = !1
  8182. , T = !1
  8183. , x = {
  8184. populate: function(e) {
  8185. if (function(e, t) {
  8186. return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8187. (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
  8188. t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8189. document.getElementById("gui-name").classList.add("noCoBrand"),
  8190. document.getElementById("cobrandTitle").classList.add("hidden")),
  8191. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8192. !1)
  8193. }(e.name, e.coBrand)) {
  8194. if (function(e) {
  8195. e ? (w = !0,
  8196. v.innerHTML = e) : v.classList.add("hidden")
  8197. }(e.description),
  8198. function(e, t, i, n) {
  8199. if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
  8200. w = !0;
  8201. var r = []
  8202. , o = s(r, "<br>");
  8203. if (e && o('<span id="contactName">' + e + "</span>"),
  8204. t) {
  8205. var a = n || t;
  8206. o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
  8207. }
  8208. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8209. r[0] = "",
  8210. A.innerHTML = r.join("")
  8211. } else
  8212. y.classList.add("hidden")
  8213. }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8214. function(e) {
  8215. if ("string" == typeof e)
  8216. try {
  8217. e = JSON.parse(e)
  8218. } catch (e) {
  8219. return u.warn("Unable to parse address data"),
  8220. C.parentElement.classList.add("hidden")
  8221. }
  8222. if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
  8223. w = !0;
  8224. var t = []
  8225. , i = s(t, " ");
  8226. e.address_1 && i(e.address_1),
  8227. e.address_2 && i(e.address_2),
  8228. e.city && i(e.city, ", "),
  8229. e.state && i(e.state, ", "),
  8230. e.zip && i(e.zip, e.state ? " " : ", "),
  8231. t[0] = "",
  8232. C.innerText = t.join("")
  8233. } else
  8234. C.parentElement.classList.add("hidden")
  8235. }(e.address),
  8236. w) {
  8237. var t = document.createElement("br");
  8238. I.insertBefore(t, I.firstElementChild)
  8239. }
  8240. e.socialSharing && c.share.enabled && (T = i(e.url))
  8241. }
  8242. },
  8243. finishSetup: function(e) {
  8244. w = w || !!e,
  8245. document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
  8246. w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
  8247. [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
  8248. e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
  8249. }),
  8250. [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
  8251. e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
  8252. contact_type: e.getAttribute("id")
  8253. }))
  8254. }),
  8255. w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
  8256. },
  8257. toggleMeta: function(e, t) {
  8258. var i = document.getElementById("model-title");
  8259. t && t.preventDefault();
  8260. var n = m.classList.contains("expand");
  8261. e && !n || (n ? (b.forEach(function(e) {
  8262. e.classList.remove("expand")
  8263. }),
  8264. this.emit(a.CLOSE_INFO),
  8265. i.classList.remove("expand")) : (b.forEach(function(e) {
  8266. e.classList.add("expand")
  8267. }),
  8268. i.classList.add("expand"),
  8269. this.emit(a.OPEN_INFO)))
  8270. },
  8271. setupToggling: function() {
  8272. g.style.height = m.offsetHeight + "px",
  8273. m.addEventListener("transitionend", function() {
  8274. g.style.height = m.offsetHeight + "px"
  8275. })
  8276. },
  8277. toggleTitle: function(e) {
  8278. e && e.preventDefault(),
  8279. d.classList.contains("closed") ? (d.classList.add("open"),
  8280. f.classList.remove("icon-dpad-right"),
  8281. f.classList.add("icon-dpad-left"),
  8282. this.emit(a.SHOW_INFO),
  8283. setTimeout(function() {
  8284. d.classList.remove("closed"),
  8285. d.classList.remove("open")
  8286. }, o.removeAnimationClasses)) : (d.classList.add("closed"),
  8287. f.classList.remove("icon-dpad-left"),
  8288. f.classList.add("icon-dpad-right"),
  8289. this.emit(a.HIDE_INFO))
  8290. }
  8291. };
  8292. t.extendObject(x, h.prototype),
  8293. M.exports = x
  8294. }
  8295. ).call(this, "/js/gui/title/titleBar.js")
  8296. }
  8297. , {
  8298. "../../localization/localize": 108,
  8299. "../../settings": 166,
  8300. "../../util/browser": 182,
  8301. "../../util/common": 185,
  8302. "../../util/logger": 189,
  8303. "./TitleEvents": 80,
  8304. "./titleBarSettings": 83,
  8305. events: 202
  8306. }],
  8307. 83: [function(e, t, i) {
  8308. "use strict";
  8309. t.exports = Object.freeze({
  8310. minTooltipCharacters: 19,
  8311. removeAnimationClasses: 500
  8312. })
  8313. }
  8314. , {}],
  8315. 84: [function(e, t, i) {
  8316. "use strict";
  8317. function n() {
  8318. v.playTour(),
  8319. y && clearTimeout(y),
  8320. c(),
  8321. E.removeClass("fadeIn")
  8322. }
  8323. function r() {
  8324. A.classList.contains("playing") && (v.stopTour(),
  8325. E.addClass("fadeIn"),
  8326. setTimeout(function() {
  8327. E.removeClass("fadeIn")
  8328. }, h.tourInteraction.showPauseButton),
  8329. M || (clearTimeout(y),
  8330. y = setTimeout(s, h.tourInteraction.showModal)),
  8331. setTimeout(function() {
  8332. A.classList.remove("playing")
  8333. }, h.tourInteraction.allowNextClick))
  8334. }
  8335. function o() {
  8336. v.tourInProgress && (v.stopTour(),
  8337. v.endTourProgress(),
  8338. A.classList.remove("playing"))
  8339. }
  8340. function a() {
  8341. _.is(":visible") ? n() : r()
  8342. }
  8343. function s() {
  8344. if (!h.tourInteraction.disabled) {
  8345. T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
  8346. T.addClass("fadeIn tour " + p.deviceType);
  8347. var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
  8348. if (!h.tourInteraction.smallModal)
  8349. 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,
  8350. p.fill(x, g.TOUR_INTERACTION[e]),
  8351. T.addClass(e);
  8352. T.addClass(t)
  8353. }
  8354. }
  8355. function l(e, t) {
  8356. if (t) {
  8357. var i = "keydown" === t.type
  8358. , n = t.which === u.SPACE || v.tourIsPlaying;
  8359. i && n || e || (M = !0),
  8360. v.atEndOfTour() && c(),
  8361. !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
  8362. c(),
  8363. t.which !== u.SPACE && o()),
  8364. i && n && a()
  8365. }
  8366. }
  8367. function c() {
  8368. T.removeClass("fadeIn")
  8369. }
  8370. var h = (e("../util/browser"),
  8371. e("../settings"))
  8372. , u = e("../enum/Keys")
  8373. , d = e("../enum/Viewmode")
  8374. , p = (e("./helpManager"),
  8375. e("./populateModal"))
  8376. , f = e("../enum/DirectorEvents")
  8377. , g = e("../enum/HelpModalType")
  8378. , m = e("../enum/HelpModalSize")
  8379. , v = null
  8380. , y = null
  8381. , A = document.getElementById("pause-overlay")
  8382. , C = document.getElementById("player")
  8383. , I = document.getElementById("gui")
  8384. , E = $("#pause-icon").eq(0)
  8385. , _ = $("#play").eq(0)
  8386. , b = $("#playHead").eq(0)
  8387. , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8388. , T = $("#interaction-modal").eq(0)
  8389. , x = $("#interaction-modal .interaction").toArray()
  8390. , S = ["touchstart", "mousedown", "pointerdown"]
  8391. , M = !1;
  8392. t.exports.init = function(e) {
  8393. v = e,
  8394. S.forEach(function(t) {
  8395. C.addEventListener(t, l.bind(this, !1), !0),
  8396. I.addEventListener(t, l.bind(this, !0), !0),
  8397. A.addEventListener(t, r, !0),
  8398. w.forEach(function(e) {
  8399. e.addEventListener(t, o, !0)
  8400. }),
  8401. $("#drawer img").on(t, o)
  8402. }),
  8403. document.addEventListener("keydown", l.bind(this, !1), !0),
  8404. v.on(f.TourStart, function() {
  8405. A.classList.add("playing")
  8406. })
  8407. }
  8408. ,
  8409. t.exports.play = n,
  8410. t.exports.pause = r,
  8411. t.exports.pauseWithoutCTA = o,
  8412. t.exports.togglePlay = a,
  8413. t.exports.stopTour = function() {
  8414. b.hasClass("playing") && (clearTimeout(y),
  8415. v.atEndOfTour() ? (A.classList.remove("playing"),
  8416. s()) : E.removeClass("fadeIn"))
  8417. }
  8418. ,
  8419. t.exports.dismissModal = c
  8420. }
  8421. , {
  8422. "../enum/DirectorEvents": 23,
  8423. "../enum/HelpModalSize": 27,
  8424. "../enum/HelpModalType": 28,
  8425. "../enum/Keys": 30,
  8426. "../enum/Viewmode": 51,
  8427. "../settings": 166,
  8428. "../util/browser": 182,
  8429. "./helpManager": 68,
  8430. "./populateModal": 75
  8431. }],
  8432. 85: [function(e, t, i) {
  8433. "use strict";
  8434. t.exports = Object.freeze({
  8435. OPENED: "vr.modal.opened",
  8436. LAUNCH: "vr.modal.launch",
  8437. CLOSED: "vr.modal.closed",
  8438. NEXT: "vr.modal.next",
  8439. PREV: "vr.modal.prev",
  8440. STORE: "vr.modal.store",
  8441. falseICECHOSEN: "vr.modal.device"
  8442. })
  8443. }
  8444. , {}],
  8445. 86: [function(e, t, i) {
  8446. "use strict";
  8447. var h = e("../../util/browser")
  8448. , u = e("../../enum/VRApps")
  8449. , n = e("../../enum/VRPlatforms")
  8450. , d = e("../../util/ajax")
  8451. , p = e("../../settings")
  8452. , r = {};
  8453. for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8454. r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8455. r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
  8456. u) {
  8457. var a = u[o];
  8458. r[a] += encodeURIComponent(document.referrer + "&display=" + a)
  8459. }
  8460. var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
  8461. "https://" + s);
  8462. t.exports.init = function(e, t, o) {
  8463. function a(e, t, i, n) {
  8464. function r() {
  8465. return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
  8466. }
  8467. 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()
  8468. }
  8469. var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8470. , l = g + "/vr/dlist/?ret=" + s
  8471. , c = g + "/vr/show/?ret=" + s;
  8472. switch (e) {
  8473. case n.IOS:
  8474. !function(t, e, i, n) {
  8475. var r = a(t, e, i, n)
  8476. , o = {
  8477. responseType: "json",
  8478. data: {
  8479. branch_key: p.appConfig.branch_key,
  8480. data: {
  8481. m: e,
  8482. full_url: r,
  8483. $desktop_url: "",
  8484. $og_app_id: "331853976762864119",
  8485. $og_title: i,
  8486. $og_description: n,
  8487. $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
  8488. $canonical_url: window.location.href
  8489. }
  8490. }
  8491. };
  8492. d.post("https://api.branch.io/v1/url", o).done(function(e) {
  8493. f[t] = e.url
  8494. }).fail(function(e) {
  8495. f[t] = e
  8496. }
  8497. .bind(this, r))
  8498. }(u.CardboardIOS, t.sid, t.name, t.summary);
  8499. break;
  8500. default:
  8501. !function(e, t, i) {
  8502. for (var n in u) {
  8503. var r = u[n]
  8504. , o = a(r, e, t, i);
  8505. f[r] = o
  8506. }
  8507. }(t.sid, t.name, t.summary)
  8508. }
  8509. }
  8510. ,
  8511. t.exports.launch = function(e) {
  8512. var t = f[e];
  8513. window.open(t, "_blank")
  8514. }
  8515. ,
  8516. t.exports.launchStore = function(e) {
  8517. var t = r[e];
  8518. window.open(t, "_blank")
  8519. }
  8520. }
  8521. , {
  8522. "../../enum/VRApps": 46,
  8523. "../../enum/VRPlatforms": 49,
  8524. "../../settings": 166,
  8525. "../../util/ajax": 181,
  8526. "../../util/browser": 182
  8527. }],
  8528. 87: [function(e, t, i) {
  8529. "use strict";
  8530. function c(e) {
  8531. var t;
  8532. switch (e) {
  8533. case y.IOS:
  8534. return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
  8535. case y.Android:
  8536. return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
  8537. }
  8538. return !1
  8539. }
  8540. function h(e) {
  8541. switch (e) {
  8542. case y.Android:
  8543. x.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8544. x.filter(".gearvr").off().on("click", q.gear),
  8545. n(k, U, "logo-button", "same-line");
  8546. break;
  8547. case y.UnsupportedAndroid:
  8548. n("", H, "", "");
  8549. break;
  8550. case y.IOS:
  8551. x.filter(".cardboard").off().on("click", q.cardboardIOS),
  8552. n(k, "", "logo-button", "");
  8553. break;
  8554. case y.Desktop:
  8555. x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
  8556. x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
  8557. n(k, U, "logo-button", "same-line"),
  8558. Q.cardboard()
  8559. }
  8560. }
  8561. function u(e) {
  8562. $(".p1, .p2, .p3").hide(),
  8563. l.insertAfter(T),
  8564. w.removeClass("front-page"),
  8565. w.removeClass("details-page"),
  8566. w.removeClass("lastPage"),
  8567. x.removeClass("logo-button"),
  8568. x.removeClass("same-line"),
  8569. T.removeClass("headsetOptions"),
  8570. S.attr("src", ""),
  8571. S.filter(".second").removeClass("gear"),
  8572. S.css("display", "inline-block"),
  8573. S.off(),
  8574. M.filter(".second").css("display", ""),
  8575. O.css("display", "none"),
  8576. $(".p" + (e + 1) + _).show(),
  8577. S.filter(".third").insertBefore(M.filter(".third"))
  8578. }
  8579. function n(e, t, i, n) {
  8580. w.addClass("front-page"),
  8581. S.filter(".first").attr("src", e),
  8582. S.filter(".second").attr("src", t),
  8583. x.filter(".first").addClass(i),
  8584. x.filter(".second").addClass(i),
  8585. x.addClass(n),
  8586. ".show-desktop" === _ && T.insertAfter(l)
  8587. }
  8588. function r(e, t, i) {
  8589. T.addClass("headsetOptions"),
  8590. x.off(),
  8591. S.filter(".second").attr("src", t),
  8592. O.css("display", "block"),
  8593. M.filter(".second").css("display", "none"),
  8594. O.on("click", function() {
  8595. u(b.Title),
  8596. h(y.Desktop)
  8597. }),
  8598. e && (X.emit(C.falseICECHOSEN, {
  8599. name: v.GearVR
  8600. }),
  8601. S.filter(".first").attr("src", e),
  8602. S.filter(".second").addClass("gear"),
  8603. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8604. Q.gearvr()),
  8605. i && (X.emit(C.falseICECHOSEN, {
  8606. name: v.Cardboard
  8607. }),
  8608. S.filter(".third").attr("src", i),
  8609. S.filter(".third").show(),
  8610. S.filter(".third").insertAfter(S.filter(".second")),
  8611. S.filter(".third").addClass("link"),
  8612. S.filter(".second").addClass("link"),
  8613. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8614. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
  8615. Q.cardboard())
  8616. }
  8617. function d(e, t) {
  8618. switch (t) {
  8619. case y.IOS:
  8620. j = W,
  8621. Y = G;
  8622. break;
  8623. case y.Desktop:
  8624. e === b.Cardboard ? (j = N,
  8625. Y = B,
  8626. S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
  8627. S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
  8628. S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
  8629. Y = "");
  8630. break;
  8631. default:
  8632. Y = e === b.Cardboard ? (j = H,
  8633. G) : (j = V,
  8634. z)
  8635. }
  8636. }
  8637. function p(e, t, i) {
  8638. w.find(".inner").addClass("details-page"),
  8639. w.addClass("details-page"),
  8640. S.filter(".first").attr("src", e),
  8641. S.filter(".second").attr("src", t),
  8642. S.filter(".third").attr("src", i)
  8643. }
  8644. function f() {
  8645. var e = 1 < g.aspectRatio() && g.isMobile();
  8646. w.toggleClass("landscape", e).toggleClass("portrait", !e),
  8647. w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
  8648. w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
  8649. }
  8650. var g = e("../../util/browser")
  8651. , m = e("./vrLink")
  8652. , v = e("../../enum/VRApps")
  8653. , y = e("../../enum/VRPlatforms")
  8654. , A = e("../../enum/VRPages")
  8655. , C = e("./vrEvent")
  8656. , o = (e("../../settings"),
  8657. e("../../constants"))
  8658. , I = e("../../localization/localize")
  8659. , a = e("../../util/common")
  8660. , s = e("events").EventEmitter
  8661. , E = 0
  8662. , _ = null
  8663. , b = A.standard
  8664. , w = $(".vr-popup")
  8665. , l = w.find(".vr-popup-body")
  8666. , T = w.find(".vr-images")
  8667. , x = w.find(".img-container")
  8668. , S = w.find(".vr-sm-image")
  8669. , M = x.find(".vr-img-caption")
  8670. , R = $(".vr-buttons").find(".prev-button")
  8671. , P = $(".vr-buttons").find(".next-button")
  8672. , O = T.find(".front-close")
  8673. , L = $(".vr-page")
  8674. , D = w.find("img")
  8675. , N = "images/apple-store.png"
  8676. , F = "images/badge-oculus.png"
  8677. , B = "images/badge-cardboard.png"
  8678. , V = "images/logo-samsung.png"
  8679. , k = "images/headset-cardboard.png"
  8680. , U = "images/headset-gearvr.png"
  8681. , H = "images/ico-android-robot.png"
  8682. , z = "images/ico-gearvr.png"
  8683. , G = "images/ico-vr.png"
  8684. , W = "images/apple-logo-white.svg"
  8685. , j = null
  8686. , Y = null
  8687. , q = {}
  8688. , X = {
  8689. init: function(e, t) {
  8690. function i(e) {
  8691. X.emit(C.STORE, {
  8692. type: e
  8693. }),
  8694. m.launchStore(e)
  8695. }
  8696. function n(e) {
  8697. switch (e !== b.pageCount && (u(e),
  8698. L.text(e + 1 + " / " + b.pageCount)),
  8699. e) {
  8700. case b.Title:
  8701. R.css("display", "none"),
  8702. P.text(a[e]),
  8703. h(r);
  8704. break;
  8705. case b.Cardboard:
  8706. R.css("display", "block"),
  8707. P.text(a[e]),
  8708. x.filter(".cardboard").off(),
  8709. x.filter(".gearvr").off(),
  8710. d(e, r),
  8711. p(k, j, Y);
  8712. break;
  8713. case b.Gear:
  8714. P.text(a[e]),
  8715. d(e, r),
  8716. w.addClass("lastPage"),
  8717. p(U, j, Y);
  8718. break;
  8719. case b.pageCount:
  8720. w.removeClass("fadeIn"),
  8721. X.emit(C.CLOSED)
  8722. }
  8723. D.filter("[src='']").hide()
  8724. }
  8725. var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
  8726. _ = ".show-supported",
  8727. y.Android) : (w.addClass("unsupported"),
  8728. _ = ".show-unsupported",
  8729. y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
  8730. _ = ".show-ios",
  8731. b = A.ios,
  8732. y.IOS) : (w.addClass("desktop"),
  8733. _ = ".show-desktop",
  8734. y.Desktop);
  8735. function o(e) {
  8736. X.emit(C.LAUNCH, {
  8737. vr_platform: r,
  8738. vr_app: e
  8739. }),
  8740. m.launch(e)
  8741. }
  8742. m.init(r, e, t),
  8743. r !== y.Desktop && w.addClass("mobile"),
  8744. q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
  8745. q.gear = o.bind(this, v.GearVR),
  8746. q.cardboardIOS = o.bind(this, v.CardboardIOS),
  8747. f(),
  8748. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8749. $(_).show();
  8750. var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
  8751. , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8752. r === y.IOS && (a.splice(1, 1),
  8753. s.splice(1, 1)),
  8754. $("#vr").on("click", function(e) {
  8755. e.preventDefault(),
  8756. window.vrEnabled || (window.vrEnabled = !0,
  8757. this.classList.add("active"),
  8758. $("#gui div").not("#vrOff").addClass("vrHide"),
  8759. $("#vrOffImg").css({
  8760. display: "inline-block"
  8761. }))
  8762. }),
  8763. $("#vrOff").on("click", function() {
  8764. window.vrEnabled = !1,
  8765. $("#gui div").not("#vrOff").removeClass("vrHide"),
  8766. $("#vrOffImg").css({
  8767. display: "none"
  8768. }),
  8769. $("#player canvas").css({
  8770. width: "",
  8771. height: ""
  8772. }),
  8773. $("#vr").removeClass("active")
  8774. });
  8775. var l = "https://my.port.com/vr/show/?m=" + e.sid;
  8776. r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
  8777. $(".gearLink").on("click", i.bind(this, v.GearVR)),
  8778. $("span.modelLink").text(l),
  8779. R.on("click", function(e) {
  8780. X.emit(C.PREV),
  8781. n(--E)
  8782. }),
  8783. P.on("click", function(e) {
  8784. P.text(),
  8785. X.emit(C.NEXT, {
  8786. nextAction: s[E]
  8787. }),
  8788. n(++E)
  8789. }),
  8790. w.find(".close").on("click", X.dismiss)
  8791. },
  8792. dismiss: function() {
  8793. w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
  8794. X.emit(C.CLOSED))
  8795. },
  8796. isDeviceSupported: c
  8797. };
  8798. a.extendObject(X, s.prototype),
  8799. $(window).resize(f);
  8800. var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
  8801. K = M.filter(".first").find(".gearvr"),
  8802. {
  8803. cardboard: function() {
  8804. K.addClass("hidden"),
  8805. Z.removeClass("hidden")
  8806. },
  8807. gearvr: function() {
  8808. Z.addClass("hidden"),
  8809. K.removeClass("hidden")
  8810. }
  8811. });
  8812. t.exports = X
  8813. }
  8814. , {
  8815. "../../constants": 8,
  8816. "../../enum/VRApps": 46,
  8817. "../../enum/VRPages": 48,
  8818. "../../enum/VRPlatforms": 49,
  8819. "../../localization/localize": 108,
  8820. "../../settings": 166,
  8821. "../../util/browser": 182,
  8822. "../../util/common": 185,
  8823. "./vrEvent": 85,
  8824. "./vrLink": 86,
  8825. events: 202
  8826. }],
  8827. 88: [function(e, t, i) {
  8828. "use strict";
  8829. t.exports = Object.freeze({
  8830. OPENED: "webvr.modal.opened",
  8831. SHOW_TERMS: "webvr.footer.show.terms"
  8832. })
  8833. }
  8834. , {}],
  8835. 89: [function(B, V, e) {
  8836. (function(e) {
  8837. "use strict";
  8838. function a() {
  8839. function t() {
  8840. p.isPresenting || (r.info("exiting webVR"),
  8841. c("webvr_exit_app"),
  8842. -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
  8843. window.removeEventListener("vrdisplaypresentchange", t))
  8844. }
  8845. r.info("Headset mounted"),
  8846. u.suspend();
  8847. var e = document.createElement("canvas");
  8848. for (e.getContext("webgl"),
  8849. e.className = "webvr-canvas",
  8850. document.bgColor = "#000",
  8851. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  8852. document.body.removeChild(document.body.firstChild);
  8853. document.body.appendChild(e),
  8854. c("webvr_enter_app"),
  8855. p.requestPresent([{
  8856. source: e,
  8857. predistorted: !0
  8858. }]).catch(function(e) {
  8859. r.error("Failed to present: " + e),
  8860. c("webvr_exit_calibrate"),
  8861. t()
  8862. }),
  8863. d.then(function() {
  8864. window.dispatchEvent(new Event("vrapp-start"))
  8865. }),
  8866. window.addEventListener("vrdisplaypresentchange", t)
  8867. }
  8868. function s() {
  8869. c("webvr_modal_close"),
  8870. _.find(".enter-button").off("click", a),
  8871. E.fadeOut(g.guiAnimationSpeed, function() {
  8872. _.toggleClass("hidden", !1),
  8873. b.toggleClass("hidden", !0),
  8874. f.exitFullscreen()
  8875. }),
  8876. I.fadeIn(g.guiAnimationSpeed)
  8877. }
  8878. function t() {
  8879. M.toggleClass("hidden", !0),
  8880. S.toggleClass("hidden", !1)
  8881. }
  8882. function l() {
  8883. _.toggleClass("hidden"),
  8884. b.toggleClass("hidden")
  8885. }
  8886. function c(e) {
  8887. var t = f.isLandscape() ? "landscape" : "portrait";
  8888. i.trackAlways("showcase_gui", {
  8889. gui_action: e,
  8890. orientation: t
  8891. })
  8892. }
  8893. function h() {
  8894. var e = f.isLandscape();
  8895. E.toggleClass("landscape", e).toggleClass("portrait", !e)
  8896. }
  8897. var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
  8898. B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
  8899. 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 = {
  8900. init: function(e, t, i, n) {
  8901. function r(e) {
  8902. e.preventDefault(),
  8903. o(e.currentTarget.id)
  8904. }
  8905. function o(i) {
  8906. F[i](),
  8907. Object.keys(F).map(function(e, t) {
  8908. $("#" + e).toggleClass("tabs-underlined", e === i)
  8909. })
  8910. }
  8911. p = i,
  8912. u = t,
  8913. y.init(m.Android, e, n),
  8914. h(),
  8915. new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
  8916. w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
  8917. _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
  8918. w.filter(".device-headset-side").attr("src", R),
  8919. _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
  8920. $("#vr").on("click", function(e) {
  8921. e.preventDefault(),
  8922. c("click_webvr_button"),
  8923. E.is(":hidden") && (N.emit(A.OPENED),
  8924. I.fadeOut(g.guiAnimationSpeed),
  8925. E.fadeIn(g.guiAnimationSpeed),
  8926. function() {
  8927. if (!d) {
  8928. var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
  8929. d = new Promise(function(e, t) {
  8930. var i = document.createElement("script");
  8931. i.type = "text/javascript",
  8932. i.src = n,
  8933. i.onload = e,
  8934. document.head.appendChild(i)
  8935. }
  8936. )
  8937. }
  8938. _.find(".enter-button").on("click", a)
  8939. }())
  8940. }),
  8941. $(".webvr-popup .close").on("click", function(e) {
  8942. e.preventDefault(),
  8943. _.hasClass("hidden") ? (c("webvr_help_close"),
  8944. l()) : s()
  8945. }),
  8946. $("#tabcardboard").on("click", r),
  8947. $("#tabdaydream").on("click", r),
  8948. $("#tabnative").on("click", r),
  8949. $(".webvr-popup .open-with-app").on("click", function(e) {
  8950. e.preventDefault(),
  8951. c("webvr_learn_more"),
  8952. o("tabnative"),
  8953. l()
  8954. }),
  8955. $(".webvr-popup .help").on("click", function(e) {
  8956. e.preventDefault(),
  8957. c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  8958. l()
  8959. }),
  8960. $(".webvr-popup .terms").on("click", function(e) {
  8961. e.preventDefault(),
  8962. c("webvr_click_terms"),
  8963. s(),
  8964. N.emit(A.SHOW_TERMS)
  8965. }),
  8966. T.on("click", function(e) {
  8967. e.preventDefault(),
  8968. c(D),
  8969. window.open(L, "_blank")
  8970. }),
  8971. x.on("click", function(e) {
  8972. e.preventDefault(),
  8973. c("webvr_phone_link"),
  8974. window.open("https://vr.google.com/daydream/phones/", "_blank")
  8975. }),
  8976. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  8977. e.preventDefault(),
  8978. c("webvr_cardboard_link"),
  8979. y.launch(v.CardboardAndroid)
  8980. }),
  8981. $(".webvr-popup .badge-oculus").on("click", function(e) {
  8982. e.preventDefault(),
  8983. c("webvr_oculus_link"),
  8984. y.launch(v.GearVR)
  8985. })
  8986. }
  8987. }, F = {
  8988. tabcardboard: function() {
  8989. w.filter(".device-headset").attr("src", R),
  8990. w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
  8991. L = "https://vr.google.com/cardboard/get-cardboard/",
  8992. D = "webvr_cardboard_link",
  8993. T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
  8994. x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  8995. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  8996. t()
  8997. },
  8998. tabdaydream: function() {
  8999. w.filter(".device-headset").attr("src", "images/device-daydream.png"),
  9000. w.filter(".device-phone").attr("src", "images/device-pixel.png"),
  9001. L = P,
  9002. D = O,
  9003. T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
  9004. x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9005. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9006. t()
  9007. },
  9008. tabnative: function() {
  9009. w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
  9010. w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
  9011. M.toggleClass("hidden", !1),
  9012. S.toggleClass("hidden", !0)
  9013. }
  9014. };
  9015. n.extendObject(N, o.prototype),
  9016. $(window).resize(h),
  9017. V.exports = N
  9018. }
  9019. ).call(this, "/js/gui/webvr/webVRgui.js")
  9020. }
  9021. , {
  9022. "../../analytics": 4,
  9023. "../../constants": 8,
  9024. "../../enum/VRApps": 46,
  9025. "../../enum/VRPlatforms": 49,
  9026. "../../localization/localize": 108,
  9027. "../../settings": 166,
  9028. "../../util/browser": 182,
  9029. "../../util/common": 185,
  9030. "../../util/logger": 189,
  9031. "./../gui": 65,
  9032. "./../vr/vrLink": 86,
  9033. "./WebVrEvent": 88,
  9034. events: 202
  9035. }],
  9036. 90: [function(e, t, i) {
  9037. "use strict";
  9038. function n(e, t, i, n, r) {
  9039. this.floorId = n || 0 === n ? n : -1,
  9040. this.roomId = r || "",
  9041. this.labelId = e,
  9042. this.position = (new o.Vector3).copy(t),
  9043. this.text = i
  9044. }
  9045. var o = e("three")
  9046. , r = e("../util/browser");
  9047. n.prototype.build = function() {
  9048. var e = window.document.createElement("div");
  9049. r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9050. var t = window.document.createElement("div");
  9051. t.setAttribute("class", "gui-floorplan-label-text");
  9052. var i = window.document.createTextNode(this.text);
  9053. t.appendChild(i),
  9054. e.appendChild(t),
  9055. window.document.body.appendChild(e),
  9056. this.labelGui = e,
  9057. this.textBlock = t,
  9058. $(this.labelGui).hide();
  9059. var n = window.getComputedStyle(this.labelGui);
  9060. this.initialTransform = n.transform || n.webkitTransform
  9061. }
  9062. ,
  9063. t.exports = n
  9064. }
  9065. , {
  9066. "../util/browser": 182,
  9067. three: 217
  9068. }],
  9069. 91: [function(e, t, i) {
  9070. "use strict";
  9071. function n() {
  9072. this.player = null,
  9073. this.modelManager = null,
  9074. this.container = null
  9075. }
  9076. var c, o, r = e("three"), a = (e("../util/common"),
  9077. e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
  9078. e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
  9079. e("../util/transitions"),
  9080. e("../util/lerp"),
  9081. e("../util/browser"));
  9082. n.prototype.init = function(e, t, i) {
  9083. this.player = e,
  9084. this.modelManager = t,
  9085. this.container = i,
  9086. this.updateModel(),
  9087. this.bindEvents()
  9088. }
  9089. ,
  9090. n.prototype.bindEvents = function() {
  9091. this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
  9092. this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9093. this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9094. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  9095. this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
  9096. }
  9097. ,
  9098. n.prototype.updateModel = function() {
  9099. this.model = this.modelManager.getActiveModel()
  9100. }
  9101. ,
  9102. n.prototype.handlePlayerViewChanged = function() {
  9103. this.updateLabelVisibility(),
  9104. this.updateLabelDisplay()
  9105. }
  9106. ,
  9107. n.prototype.getLabelsForFloor = function(t, i) {
  9108. return (i = i || []).length = 0,
  9109. this.model.labels.forEach(function(e) {
  9110. this.labelVisibleForFloor(e, t) && i.push(e)
  9111. }
  9112. .bind(this)),
  9113. i
  9114. }
  9115. ,
  9116. n.prototype.getLabelsForCurrentFloor = function(e) {
  9117. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9118. }
  9119. ,
  9120. n.prototype.labelVisibleForFloor = function(e, t) {
  9121. var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
  9122. if (!this.model.showingLabels || !e.labelGui || !i)
  9123. return !1;
  9124. var n = e.floorId === this.model.floors.size() - 1;
  9125. return this.model.allFloorsVisible ? n : e.floorId === t
  9126. }
  9127. ,
  9128. n.prototype.updateLabelVisibility = function(e) {
  9129. this.model.labels.forEach(function(e) {
  9130. 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)
  9131. }
  9132. .bind(this))
  9133. }
  9134. ,
  9135. n.prototype.showAllLabels = function(t, i) {
  9136. this.model.labels.forEach(function(e) {
  9137. this.showLabel(e, t, i)
  9138. }
  9139. .bind(this))
  9140. }
  9141. ,
  9142. n.prototype.hideAllLabels = function(t, i) {
  9143. this.model.labels.forEach(function(e) {
  9144. this.hideLabel(e, t, i)
  9145. }
  9146. .bind(this))
  9147. }
  9148. ,
  9149. n.prototype.showLabel = function(e, t, i) {
  9150. this.model.showingLabels && (e.visible || (e.visible = !0,
  9151. e.labelGui.style.display = "block",
  9152. e.labelGui.style.opacity = 0,
  9153. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9154. }
  9155. ,
  9156. n.prototype.hideLabel = function(e, t, i) {
  9157. e.visible && (e.visible = !1,
  9158. u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9159. }
  9160. ,
  9161. n.prototype.supportedMode = function() {
  9162. return this.player.mode === h.FLOORPLAN
  9163. }
  9164. ,
  9165. n.prototype.updateLabelDisplay = (new r.Vector3,
  9166. new r.Vector3,
  9167. o = [],
  9168. function() {
  9169. var e = this.player.getLabelScaleFactor()
  9170. , t = 1.2 * (1 - e) + .6
  9171. , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
  9172. this.getLabelsForCurrentFloor(o);
  9173. for (var n = 0; n < o.length; n++) {
  9174. var r = o[n];
  9175. this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
  9176. 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)
  9177. }
  9178. }
  9179. ),
  9180. n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
  9181. new r.Vector3,
  9182. function(e, t, i, n, r) {
  9183. t.style.fontSize = 100 * r + "%";
  9184. var o = .5 * $("#player").width()
  9185. , a = .5 * $("#player").height();
  9186. c.copy(i),
  9187. c.project(this.player.camera);
  9188. var s = c.x * o + o
  9189. , l = -c.y * a + a;
  9190. s -= e.offsetWidth / 2,
  9191. l -= e.offsetHeight / 2,
  9192. e.style.left = s + "px",
  9193. e.style.top = l + "px"
  9194. }
  9195. ),
  9196. n.prototype.handleStartInside = function(e) {
  9197. this.updateLabelVisibility()
  9198. }
  9199. ,
  9200. n.prototype.handleStartOutside = function() {
  9201. this.updateLabelVisibility()
  9202. }
  9203. ,
  9204. t.exports = n
  9205. }
  9206. , {
  9207. "../enum/DirectorEvents": 23,
  9208. "../enum/ModelManagerEvents": 33,
  9209. "../enum/PlayerEvents": 40,
  9210. "../enum/Viewmode": 51,
  9211. "../enum/WarpStyle": 52,
  9212. "../settings": 166,
  9213. "../util/browser": 182,
  9214. "../util/common": 185,
  9215. "../util/lerp": 188,
  9216. "../util/transitions": 195,
  9217. three: 217
  9218. }],
  9219. 92: [function(e, t, i) {
  9220. "use strict";
  9221. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9222. if (null == this)
  9223. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9224. if ("function" != typeof e)
  9225. throw new TypeError("predicate must be a function");
  9226. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9227. if (t = i[o],
  9228. e.call(r, t, o, i))
  9229. return o;
  9230. return -1
  9231. }
  9232. ),
  9233. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9234. value: function(e) {
  9235. if (null == this)
  9236. throw new TypeError('"this" is null or not defined');
  9237. var t = Object(this)
  9238. , i = t.length >>> 0;
  9239. if ("function" != typeof e)
  9240. throw new TypeError("predicate must be a function");
  9241. for (var n = arguments[1], r = 0; r < i; ) {
  9242. var o = t[r];
  9243. if (e.call(n, o, r, t))
  9244. return o;
  9245. r++
  9246. }
  9247. }
  9248. })
  9249. }
  9250. , {}],
  9251. 93: [function(e, t, i) {
  9252. "use strict";
  9253. 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 || {};
  9254. function te() {
  9255. this.backgroundElement = document.createElement("div"),
  9256. r.extend(this.backgroundElement.style, {
  9257. backgroundColor: "rgba(0,0,0,0.8)",
  9258. top: 0,
  9259. left: 0,
  9260. display: "none",
  9261. zIndex: "1000",
  9262. opacity: 0,
  9263. WebkitTransition: "opacity 0.2s linear"
  9264. }),
  9265. n.makeFullscreen(this.backgroundElement),
  9266. this.backgroundElement.style.position = "fixed",
  9267. this.domElement = document.createElement("div"),
  9268. r.extend(this.domElement.style, {
  9269. position: "fixed",
  9270. display: "none",
  9271. zIndex: "1001",
  9272. opacity: 0,
  9273. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  9274. }),
  9275. document.body.appendChild(this.backgroundElement),
  9276. document.body.appendChild(this.domElement);
  9277. var e = this;
  9278. n.bind(this.backgroundElement, "click", function() {
  9279. e.hide()
  9280. })
  9281. }
  9282. function ie(e, t, i) {
  9283. Object.defineProperty(e, t, {
  9284. get: function() {
  9285. return "RGB" === this.__state.space || re(this, t, i),
  9286. this.__state[t]
  9287. },
  9288. set: function(e) {
  9289. "RGB" !== this.__state.space && (re(this, t, i),
  9290. this.__state.space = "RGB"),
  9291. this.__state[t] = e
  9292. }
  9293. })
  9294. }
  9295. function ne(e, t) {
  9296. Object.defineProperty(e, t, {
  9297. get: function() {
  9298. return "HSV" === this.__state.space || oe(this),
  9299. this.__state[t]
  9300. },
  9301. set: function(e) {
  9302. "HSV" !== this.__state.space && (oe(this),
  9303. this.__state.space = "HSV"),
  9304. this.__state[t] = e
  9305. }
  9306. })
  9307. }
  9308. function re(e, t, i) {
  9309. if ("HEX" === e.__state.space)
  9310. e.__state[t] = a.component_from_hex(e.__state.hex, i);
  9311. else {
  9312. if ("HSV" !== e.__state.space)
  9313. throw "Corrupted color state";
  9314. l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  9315. }
  9316. }
  9317. function oe(e) {
  9318. var t = a.rgb_to_hsv(e.r, e.g, e.b);
  9319. l.extend(e.__state, {
  9320. s: t.s,
  9321. v: t.v
  9322. }),
  9323. l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
  9324. }
  9325. function ae() {
  9326. if (this.__state = o.apply(this, arguments),
  9327. !1 === this.__state)
  9328. throw "Failed to interpret color arguments";
  9329. this.__state.a = this.__state.a || 1
  9330. }
  9331. function se(e) {
  9332. return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
  9333. }
  9334. function le(e, t) {
  9335. this.initialValue = e[t],
  9336. this.domElement = document.createElement("div"),
  9337. this.object = e,
  9338. this.property = t,
  9339. this.__onChange = void 0,
  9340. this.__onFinishChange = void 0
  9341. }
  9342. (t.exports = ee).gui = ee.gui || {},
  9343. ee.utils = ee.utils || {},
  9344. ee.controllers = ee.controllers || {},
  9345. ee.dom = ee.dom || {},
  9346. ee.color = ee.color || {},
  9347. ee.utils.css = {
  9348. load: function(e, t) {
  9349. var i = (t = t || document).createElement("link");
  9350. i.type = "text/css",
  9351. i.rel = "stylesheet",
  9352. i.href = e,
  9353. t.getElementsByTagName("head")[0].appendChild(i)
  9354. },
  9355. inject: function(e, t) {
  9356. t = t || document;
  9357. var i = document.createElement("style");
  9358. i.type = "text/css",
  9359. i.innerHTML = e,
  9360. t.getElementsByTagName("head")[0].appendChild(i)
  9361. }
  9362. },
  9363. ee.utils.common = (Q = Array.prototype.forEach,
  9364. J = Array.prototype.slice,
  9365. {
  9366. BREAK: {},
  9367. extend: function(i) {
  9368. return this.each(J.call(arguments, 1), function(e) {
  9369. for (var t in e)
  9370. this.isUndefined(e[t]) || (i[t] = e[t])
  9371. }, this),
  9372. i
  9373. },
  9374. defaults: function(i) {
  9375. return this.each(J.call(arguments, 1), function(e) {
  9376. for (var t in e)
  9377. this.isUndefined(i[t]) && (i[t] = e[t])
  9378. }, this),
  9379. i
  9380. },
  9381. compose: function() {
  9382. var i = J.call(arguments);
  9383. return function() {
  9384. for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
  9385. e = [i[t].apply(this, e)];
  9386. return e[0]
  9387. }
  9388. },
  9389. each: function(e, t, i) {
  9390. if (e)
  9391. if (Q && e.forEach && e.forEach === Q)
  9392. e.forEach(t, i);
  9393. else if (e.length === e.length + 0) {
  9394. for (var n = 0, r = e.length; n < r; n++)
  9395. if (n in e && t.call(i, e[n], n) === this.BREAK)
  9396. return
  9397. } else
  9398. for (var n in e)
  9399. if (t.call(i, e[n], n) === this.BREAK)
  9400. return
  9401. },
  9402. defer: function(e) {
  9403. setTimeout(e, 0)
  9404. },
  9405. toArray: function(e) {
  9406. return e.toArray ? e.toArray() : J.call(e)
  9407. },
  9408. isUndefined: function(e) {
  9409. return void 0 === e
  9410. },
  9411. isNull: function(e) {
  9412. return null === e
  9413. },
  9414. isNaN: function(e) {
  9415. return e != e
  9416. },
  9417. isArray: Array.isArray || function(e) {
  9418. return e.constructor === Array
  9419. }
  9420. ,
  9421. isObject: function(e) {
  9422. return e === Object(e)
  9423. },
  9424. isNumber: function(e) {
  9425. return e === e + 0
  9426. },
  9427. isString: function(e) {
  9428. return e === e + ""
  9429. },
  9430. isBoolean: function(e) {
  9431. return !1 === e || !0 === e
  9432. },
  9433. isFunction: function(e) {
  9434. return "[object Function]" === Object.prototype.toString.call(e)
  9435. }
  9436. }),
  9437. ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
  9438. onChange: function(e) {
  9439. return this.__onChange = e,
  9440. this
  9441. },
  9442. onFinishChange: function(e) {
  9443. return this.__onFinishChange = e,
  9444. this
  9445. },
  9446. setValue: function(e) {
  9447. return this.object[this.property] = e,
  9448. this.__onChange && this.__onChange.call(this, e),
  9449. this.updateDisplay(),
  9450. this
  9451. },
  9452. getValue: function() {
  9453. return this.object[this.property]
  9454. },
  9455. updateDisplay: function() {
  9456. return this
  9457. },
  9458. isModified: function() {
  9459. return this.initialValue !== this.getValue()
  9460. }
  9461. }),
  9462. le),
  9463. ee.dom.dom = function(c) {
  9464. function i(e) {
  9465. if ("0" === e || c.isUndefined(e))
  9466. return 0;
  9467. var t = e.match(n);
  9468. return c.isNull(t) ? 0 : parseFloat(t[1])
  9469. }
  9470. var h = {};
  9471. c.each({
  9472. HTMLEvents: ["change"],
  9473. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9474. KeyboardEvents: ["keydown"]
  9475. }, function(e, t) {
  9476. c.each(e, function(e) {
  9477. h[e] = t
  9478. })
  9479. });
  9480. var n = /(\d+(\.\d+)?)px/
  9481. , r = {
  9482. makeSelectable: function(e, t) {
  9483. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9484. return !1
  9485. }
  9486. : function() {}
  9487. ,
  9488. e.style.MozUserSelect = t ? "auto" : "none",
  9489. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9490. e.unselectable = t ? "on" : "off")
  9491. },
  9492. makeFullscreen: function(e, t, i) {
  9493. c.isUndefined(t) && (t = !0),
  9494. c.isUndefined(i) && (i = !0),
  9495. e.style.position = "absolute",
  9496. t && (e.style.left = 0,
  9497. e.style.right = 0),
  9498. i && (e.style.top = 0,
  9499. e.style.bottom = 0)
  9500. },
  9501. fakeEvent: function(e, t, i, n) {
  9502. i = i || {};
  9503. var r = h[t];
  9504. if (!r)
  9505. throw new Error("Event type " + t + " not supported.");
  9506. var o = document.createEvent(r);
  9507. switch (r) {
  9508. case "MouseEvents":
  9509. var a = i.x || i.clientX || 0
  9510. , s = i.y || i.clientY || 0;
  9511. o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
  9512. break;
  9513. case "KeyboardEvents":
  9514. var l = o.initKeyboardEvent || o.initKeyEvent;
  9515. c.defaults(i, {
  9516. cancelable: !0,
  9517. ctrlKey: !1,
  9518. altKey: !1,
  9519. shiftKey: !1,
  9520. metaKey: !1,
  9521. keyCode: void 0,
  9522. charCode: void 0
  9523. }),
  9524. l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
  9525. break;
  9526. default:
  9527. o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
  9528. }
  9529. c.defaults(o, n),
  9530. e.dispatchEvent(o)
  9531. },
  9532. bind: function(e, t, i, n) {
  9533. return n = n || !1,
  9534. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9535. r
  9536. },
  9537. unbind: function(e, t, i, n) {
  9538. return n = n || !1,
  9539. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9540. r
  9541. },
  9542. addClass: function(e, t) {
  9543. if (void 0 === e.className)
  9544. e.className = t;
  9545. else if (e.className !== t) {
  9546. var i = e.className.split(/ +/);
  9547. -1 == i.indexOf(t) && (i.push(t),
  9548. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9549. }
  9550. return r
  9551. },
  9552. removeClass: function(e, t) {
  9553. if (t)
  9554. if (void 0 === e.className)
  9555. ;
  9556. else if (e.className === t)
  9557. e.removeAttribute("class");
  9558. else {
  9559. var i = e.className.split(/ +/)
  9560. , n = i.indexOf(t);
  9561. -1 != n && (i.splice(n, 1),
  9562. e.className = i.join(" "))
  9563. }
  9564. else
  9565. e.className = void 0;
  9566. return r
  9567. },
  9568. hasClass: function(e, t) {
  9569. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9570. },
  9571. getWidth: function(e) {
  9572. var t = getComputedStyle(e);
  9573. return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
  9574. },
  9575. getHeight: function(e) {
  9576. var t = getComputedStyle(e);
  9577. return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
  9578. },
  9579. getOffset: function(e) {
  9580. var t = {
  9581. left: 0,
  9582. top: 0
  9583. };
  9584. if (e.offsetParent)
  9585. for (; t.left += e.offsetLeft,
  9586. t.top += e.offsetTop,
  9587. e = e.offsetParent; )
  9588. ;
  9589. return t
  9590. },
  9591. isActive: function(e) {
  9592. return e === document.activeElement && (e.type || e.href)
  9593. }
  9594. };
  9595. return r
  9596. }(ee.utils.common),
  9597. ee.controllers.OptionController = (q = ee.controllers.Controller,
  9598. X = ee.dom.dom,
  9599. Z = ee.utils.common,
  9600. (K = function(e, t, i) {
  9601. K.superclass.call(this, e, t);
  9602. var n = this;
  9603. if (this.__select = document.createElement("select"),
  9604. Z.isArray(i)) {
  9605. var r = {};
  9606. Z.each(i, function(e) {
  9607. r[e] = e
  9608. }),
  9609. i = r
  9610. }
  9611. Z.each(i, function(e, t) {
  9612. var i = document.createElement("option");
  9613. i.innerHTML = t,
  9614. i.setAttribute("value", e),
  9615. n.__select.appendChild(i)
  9616. }),
  9617. this.updateDisplay(),
  9618. X.bind(this.__select, "change", function() {
  9619. var e = this.options[this.selectedIndex].value;
  9620. n.setValue(e)
  9621. }),
  9622. this.domElement.appendChild(this.__select)
  9623. }
  9624. ).superclass = q,
  9625. Z.extend(K.prototype, q.prototype, {
  9626. setValue: function(e) {
  9627. var t = K.superclass.prototype.setValue.call(this, e);
  9628. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9629. t
  9630. },
  9631. updateDisplay: function() {
  9632. return this.__select.value = this.getValue(),
  9633. K.superclass.prototype.updateDisplay.call(this)
  9634. }
  9635. }),
  9636. K),
  9637. ee.controllers.NumberController = (W = ee.controllers.Controller,
  9638. j = ee.utils.common,
  9639. (Y = function(e, t, i) {
  9640. Y.superclass.call(this, e, t),
  9641. i = i || {},
  9642. this.__min = i.min,
  9643. this.__max = i.max,
  9644. this.__step = i.step,
  9645. 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,
  9646. this.__precision = se(this.__impliedStep)
  9647. }
  9648. ).superclass = W,
  9649. j.extend(Y.prototype, W.prototype, {
  9650. setValue: function(e) {
  9651. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9652. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9653. Y.superclass.prototype.setValue.call(this, e)
  9654. },
  9655. min: function(e) {
  9656. return this.__min = e,
  9657. this
  9658. },
  9659. max: function(e) {
  9660. return this.__max = e,
  9661. this
  9662. },
  9663. step: function(e) {
  9664. return this.__step = e,
  9665. this.__impliedStep = e,
  9666. this.__precision = se(e),
  9667. this
  9668. }
  9669. }),
  9670. Y),
  9671. ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
  9672. H = ee.dom.dom,
  9673. z = ee.utils.common,
  9674. (G = function(e, t, i) {
  9675. function n() {
  9676. var e = parseFloat(s.__input.value);
  9677. z.isNaN(e) || s.setValue(e)
  9678. }
  9679. function r(e) {
  9680. var t = a - e.clientY;
  9681. s.setValue(s.getValue() + t * s.__impliedStep),
  9682. a = e.clientY
  9683. }
  9684. function o() {
  9685. H.unbind(window, "mousemove", r),
  9686. H.unbind(window, "mouseup", o)
  9687. }
  9688. this.__truncationSuspended = !1,
  9689. G.superclass.call(this, e, t, i);
  9690. var a, s = this;
  9691. this.__input = document.createElement("input"),
  9692. this.__input.setAttribute("type", "text"),
  9693. H.bind(this.__input, "change", n),
  9694. H.bind(this.__input, "blur", function() {
  9695. n(),
  9696. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9697. }),
  9698. H.bind(this.__input, "mousedown", function(e) {
  9699. H.bind(window, "mousemove", r),
  9700. H.bind(window, "mouseup", o),
  9701. a = e.clientY
  9702. }),
  9703. H.bind(this.__input, "keydown", function(e) {
  9704. 13 === e.keyCode && (s.__truncationSuspended = !0,
  9705. this.blur(),
  9706. s.__truncationSuspended = !1)
  9707. }),
  9708. this.updateDisplay(),
  9709. this.domElement.appendChild(this.__input)
  9710. }
  9711. ).superclass = U,
  9712. z.extend(G.prototype, U.prototype, {
  9713. updateDisplay: function() {
  9714. return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
  9715. var i = Math.pow(10, t);
  9716. return Math.round(e * i) / i
  9717. }(this.getValue(), this.__precision),
  9718. G.superclass.prototype.updateDisplay.call(this)
  9719. }
  9720. }),
  9721. G),
  9722. ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
  9723. F = ee.dom.dom,
  9724. B = ee.utils.css,
  9725. V = ee.utils.common,
  9726. (k = function(e, t, i, n, r) {
  9727. function o(e) {
  9728. e.preventDefault();
  9729. var t = F.getOffset(s.__background)
  9730. , i = F.getWidth(s.__background);
  9731. return s.setValue(function(e, t, i, n, r) {
  9732. return n + (e - t) / (i - t) * (r - n)
  9733. }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
  9734. !1
  9735. }
  9736. function a() {
  9737. F.unbind(window, "mousemove", o),
  9738. F.unbind(window, "mouseup", a),
  9739. s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
  9740. }
  9741. k.superclass.call(this, e, t, {
  9742. min: i,
  9743. max: n,
  9744. step: r
  9745. });
  9746. var s = this;
  9747. this.__background = document.createElement("div"),
  9748. this.__foreground = document.createElement("div"),
  9749. F.bind(this.__background, "mousedown", function(e) {
  9750. F.bind(window, "mousemove", o),
  9751. F.bind(window, "mouseup", a),
  9752. o(e)
  9753. }),
  9754. F.addClass(this.__background, "slider"),
  9755. F.addClass(this.__foreground, "slider-fg"),
  9756. this.updateDisplay(),
  9757. this.__background.appendChild(this.__foreground),
  9758. this.domElement.appendChild(this.__background)
  9759. }
  9760. ).superclass = N,
  9761. k.useDefaultStyles = function() {
  9762. 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}")
  9763. }
  9764. ,
  9765. V.extend(k.prototype, N.prototype, {
  9766. updateDisplay: function() {
  9767. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9768. return this.__foreground.style.width = 100 * e + "%",
  9769. k.superclass.prototype.updateDisplay.call(this)
  9770. }
  9771. }),
  9772. k),
  9773. ee.controllers.FunctionController = (P = ee.controllers.Controller,
  9774. O = ee.dom.dom,
  9775. L = ee.utils.common,
  9776. (D = function(e, t, i) {
  9777. D.superclass.call(this, e, t);
  9778. var n = this;
  9779. this.__button = document.createElement("div"),
  9780. this.__button.innerHTML = void 0 === i ? "Fire" : i,
  9781. O.bind(this.__button, "click", function(e) {
  9782. return e.preventDefault(),
  9783. n.fire(),
  9784. !1
  9785. }),
  9786. O.addClass(this.__button, "button"),
  9787. this.domElement.appendChild(this.__button)
  9788. }
  9789. ).superclass = P,
  9790. L.extend(D.prototype, P.prototype, {
  9791. fire: function() {
  9792. this.__onChange && this.__onChange.call(this),
  9793. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9794. this.getValue().call(this.object)
  9795. }
  9796. }),
  9797. D),
  9798. ee.controllers.BooleanController = (x = ee.controllers.Controller,
  9799. S = ee.dom.dom,
  9800. M = ee.utils.common,
  9801. (R = function(e, t) {
  9802. R.superclass.call(this, e, t);
  9803. var i = this;
  9804. this.__prev = this.getValue(),
  9805. this.__checkbox = document.createElement("input"),
  9806. this.__checkbox.setAttribute("type", "checkbox"),
  9807. S.bind(this.__checkbox, "change", function() {
  9808. i.setValue(!i.__prev)
  9809. }, !1),
  9810. this.domElement.appendChild(this.__checkbox),
  9811. this.updateDisplay()
  9812. }
  9813. ).superclass = x,
  9814. M.extend(R.prototype, x.prototype, {
  9815. setValue: function(e) {
  9816. var t = R.superclass.prototype.setValue.call(this, e);
  9817. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9818. this.__prev = this.getValue(),
  9819. t
  9820. },
  9821. updateDisplay: function() {
  9822. return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
  9823. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  9824. R.superclass.prototype.updateDisplay.call(this)
  9825. }
  9826. }),
  9827. R),
  9828. ee.color.toString = (T = ee.utils.common,
  9829. function(e) {
  9830. if (1 == e.a || T.isUndefined(e.a)) {
  9831. for (var t = e.hex.toString(16); t.length < 6; )
  9832. t = "0" + t;
  9833. return "#" + t
  9834. }
  9835. return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
  9836. }
  9837. ),
  9838. ee.color.interpret = (I = ee.color.toString,
  9839. E = ee.utils.common,
  9840. w = [{
  9841. litmus: E.isString,
  9842. conversions: {
  9843. THREE_CHAR_HEX: {
  9844. read: function(e) {
  9845. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  9846. return null !== t && {
  9847. space: "HEX",
  9848. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  9849. }
  9850. },
  9851. write: I
  9852. },
  9853. SIX_CHAR_HEX: {
  9854. read: function(e) {
  9855. var t = e.match(/^#([A-F0-9]{6})$/i);
  9856. return null !== t && {
  9857. space: "HEX",
  9858. hex: parseInt("0x" + t[1].toString())
  9859. }
  9860. },
  9861. write: I
  9862. },
  9863. CSS_RGB: {
  9864. read: function(e) {
  9865. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  9866. return null !== t && {
  9867. space: "RGB",
  9868. r: parseFloat(t[1]),
  9869. g: parseFloat(t[2]),
  9870. b: parseFloat(t[3])
  9871. }
  9872. },
  9873. write: I
  9874. },
  9875. CSS_RGBA: {
  9876. read: function(e) {
  9877. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  9878. return null !== t && {
  9879. space: "RGB",
  9880. r: parseFloat(t[1]),
  9881. g: parseFloat(t[2]),
  9882. b: parseFloat(t[3]),
  9883. a: parseFloat(t[4])
  9884. }
  9885. },
  9886. write: I
  9887. }
  9888. }
  9889. }, {
  9890. litmus: E.isNumber,
  9891. conversions: {
  9892. HEX: {
  9893. read: function(e) {
  9894. return {
  9895. space: "HEX",
  9896. hex: e,
  9897. conversionName: "HEX"
  9898. }
  9899. },
  9900. write: function(e) {
  9901. return e.hex
  9902. }
  9903. }
  9904. }
  9905. }, {
  9906. litmus: E.isArray,
  9907. conversions: {
  9908. RGB_ARRAY: {
  9909. read: function(e) {
  9910. return 3 == e.length && {
  9911. space: "RGB",
  9912. r: e[0],
  9913. g: e[1],
  9914. b: e[2]
  9915. }
  9916. },
  9917. write: function(e) {
  9918. return [e.r, e.g, e.b]
  9919. }
  9920. },
  9921. RGBA_ARRAY: {
  9922. read: function(e) {
  9923. return 4 == e.length && {
  9924. space: "RGB",
  9925. r: e[0],
  9926. g: e[1],
  9927. b: e[2],
  9928. a: e[3]
  9929. }
  9930. },
  9931. write: function(e) {
  9932. return [e.r, e.g, e.b, e.a]
  9933. }
  9934. }
  9935. }
  9936. }, {
  9937. litmus: E.isObject,
  9938. conversions: {
  9939. RGBA_OBJ: {
  9940. read: function(e) {
  9941. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
  9942. space: "RGB",
  9943. r: e.r,
  9944. g: e.g,
  9945. b: e.b,
  9946. a: e.a
  9947. }
  9948. },
  9949. write: function(e) {
  9950. return {
  9951. r: e.r,
  9952. g: e.g,
  9953. b: e.b,
  9954. a: e.a
  9955. }
  9956. }
  9957. },
  9958. RGB_OBJ: {
  9959. read: function(e) {
  9960. return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
  9961. space: "RGB",
  9962. r: e.r,
  9963. g: e.g,
  9964. b: e.b
  9965. }
  9966. },
  9967. write: function(e) {
  9968. return {
  9969. r: e.r,
  9970. g: e.g,
  9971. b: e.b
  9972. }
  9973. }
  9974. },
  9975. HSVA_OBJ: {
  9976. read: function(e) {
  9977. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
  9978. space: "HSV",
  9979. h: e.h,
  9980. s: e.s,
  9981. v: e.v,
  9982. a: e.a
  9983. }
  9984. },
  9985. write: function(e) {
  9986. return {
  9987. h: e.h,
  9988. s: e.s,
  9989. v: e.v,
  9990. a: e.a
  9991. }
  9992. }
  9993. },
  9994. HSV_OBJ: {
  9995. read: function(e) {
  9996. return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
  9997. space: "HSV",
  9998. h: e.h,
  9999. s: e.s,
  10000. v: e.v
  10001. }
  10002. },
  10003. write: function(e) {
  10004. return {
  10005. h: e.h,
  10006. s: e.s,
  10007. v: e.v
  10008. }
  10009. }
  10010. }
  10011. }
  10012. }],
  10013. function() {
  10014. b = !1;
  10015. var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
  10016. return E.each(w, function(e) {
  10017. if (e.litmus(i))
  10018. return E.each(e.conversions, function(e, t) {
  10019. if (_ = e.read(i),
  10020. !1 === b && !1 !== _)
  10021. return (b = _).conversionName = t,
  10022. _.conversion = e,
  10023. E.BREAK
  10024. }),
  10025. E.BREAK
  10026. }),
  10027. b
  10028. }
  10029. ),
  10030. ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
  10031. function y(e, t, i, n) {
  10032. if (void 0 === t[i])
  10033. throw new Error("Object " + t + ' has no property "' + i + '"');
  10034. var r;
  10035. if (n.color)
  10036. r = new g(t,i);
  10037. else {
  10038. var o = [t, i].concat(n.factoryArgs);
  10039. r = c.apply(e, o)
  10040. }
  10041. n.before instanceof h && (n.before = n.before.__li),
  10042. C(e, r),
  10043. m.addClass(r.domElement, "c");
  10044. var a = document.createElement("span");
  10045. m.addClass(a, "property-name"),
  10046. a.innerHTML = r.property;
  10047. var s = document.createElement("div");
  10048. s.appendChild(a),
  10049. s.appendChild(r.domElement);
  10050. var l = A(e, s, n.before);
  10051. return m.addClass(l, R.CLASS_CONTROLLER_ROW),
  10052. m.addClass(l, typeof r.getValue()),
  10053. function(t, i, n) {
  10054. if (n.__li = i,
  10055. n.__gui = t,
  10056. v.extend(n, {
  10057. options: function(e) {
  10058. return 1 < arguments.length ? (n.remove(),
  10059. y(t, n.object, n.property, {
  10060. before: n.__li.nextElementSibling,
  10061. factoryArgs: [v.toArray(arguments)]
  10062. })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
  10063. y(t, n.object, n.property, {
  10064. before: n.__li.nextElementSibling,
  10065. factoryArgs: [e]
  10066. })) : void 0
  10067. },
  10068. name: function(e) {
  10069. return n.__li.firstElementChild.firstElementChild.innerHTML = e,
  10070. n
  10071. },
  10072. listen: function() {
  10073. return n.__gui.listen(n),
  10074. n
  10075. },
  10076. remove: function() {
  10077. return n.__gui.remove(n),
  10078. n
  10079. }
  10080. }),
  10081. n instanceof f) {
  10082. var r = new p(n.object,n.property,{
  10083. min: n.__min,
  10084. max: n.__max,
  10085. step: n.__step
  10086. });
  10087. v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10088. var t = n[e]
  10089. , i = r[e];
  10090. n[e] = r[e] = function() {
  10091. var e = Array.prototype.slice.call(arguments);
  10092. return t.apply(n, e),
  10093. i.apply(r, e)
  10094. }
  10095. }),
  10096. m.addClass(i, "has-slider"),
  10097. n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
  10098. } else if (n instanceof p) {
  10099. var e = function(e) {
  10100. return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
  10101. y(t, n.object, n.property, {
  10102. before: n.__li.nextElementSibling,
  10103. factoryArgs: [n.__min, n.__max, n.__step]
  10104. })) : e
  10105. };
  10106. n.min = v.compose(e, n.min),
  10107. n.max = v.compose(e, n.max)
  10108. } else
  10109. n instanceof u ? (m.bind(i, "click", function() {
  10110. m.fakeEvent(n.__checkbox, "click")
  10111. }),
  10112. m.bind(n.__checkbox, "click", function(e) {
  10113. e.stopPropagation()
  10114. })) : n instanceof d ? (m.bind(i, "click", function() {
  10115. m.fakeEvent(n.__button, "click")
  10116. }),
  10117. m.bind(i, "mouseover", function() {
  10118. m.addClass(n.__button, "hover")
  10119. }),
  10120. m.bind(i, "mouseout", function() {
  10121. m.removeClass(n.__button, "hover")
  10122. })) : n instanceof g && (m.addClass(i, "color"),
  10123. n.updateDisplay = v.compose(function(e) {
  10124. return i.style.borderLeftColor = n.__color.toString(),
  10125. e
  10126. }, n.updateDisplay),
  10127. n.updateDisplay());
  10128. n.setValue = v.compose(function(e) {
  10129. return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
  10130. e
  10131. }, n.setValue)
  10132. }(e, l, r),
  10133. e.__controllers.push(r),
  10134. r
  10135. }
  10136. function A(e, t, i) {
  10137. var n = document.createElement("li");
  10138. return t && n.appendChild(t),
  10139. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10140. e.onResize(),
  10141. n
  10142. }
  10143. function C(e, t) {
  10144. var i = e.getRoot()
  10145. , n = i.__rememberedObjects.indexOf(t.object);
  10146. if (-1 != n) {
  10147. var r = i.__rememberedObjectIndecesToControllers[n];
  10148. if (void 0 === r && (r = {},
  10149. i.__rememberedObjectIndecesToControllers[n] = r),
  10150. r[t.property] = t,
  10151. i.load && i.load.remembered) {
  10152. var o, a = i.load.remembered;
  10153. if (a[e.preset])
  10154. o = a[e.preset];
  10155. else {
  10156. if (!a[T])
  10157. return;
  10158. o = a[T]
  10159. }
  10160. if (o[n] && void 0 !== o[n][t.property]) {
  10161. var s = o[n][t.property];
  10162. t.initialValue = s,
  10163. t.setValue(s)
  10164. }
  10165. }
  10166. }
  10167. }
  10168. function I(e, t) {
  10169. return document.location.href + "." + t
  10170. }
  10171. function l(e, t) {
  10172. e.domElement.style.width = t + "px",
  10173. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10174. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10175. }
  10176. function a(r, o) {
  10177. var a = {};
  10178. return v.each(r.__rememberedObjects, function(e, t) {
  10179. var i = {}
  10180. , n = r.__rememberedObjectIndecesToControllers[t];
  10181. v.each(n, function(e, t) {
  10182. i[t] = o ? e.initialValue : e.getValue()
  10183. }),
  10184. a[t] = i
  10185. }),
  10186. a
  10187. }
  10188. function E(e, t, i) {
  10189. var n = document.createElement("option");
  10190. n.innerHTML = t,
  10191. n.value = t,
  10192. e.__preset_select.appendChild(n),
  10193. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10194. }
  10195. function _(e, t) {
  10196. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10197. i.innerHTML = t ? i.value + "*" : i.value
  10198. }
  10199. 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");
  10200. var b, w, T = "Default", x = function() {
  10201. try {
  10202. return "localStorage"in window && null !== window.localStorage
  10203. } catch (e) {
  10204. return !1
  10205. }
  10206. }(), S = !0, s = !1, M = [], R = function(t) {
  10207. var i = this;
  10208. this.domElement = document.createElement("div"),
  10209. this.__ul = document.createElement("ul"),
  10210. this.domElement.appendChild(this.__ul),
  10211. m.addClass(this.domElement, "dg"),
  10212. this.__folders = {},
  10213. this.__controllers = [],
  10214. this.__rememberedObjects = [],
  10215. this.__rememberedObjectIndecesToControllers = [],
  10216. this.__listening = [],
  10217. t = t || {},
  10218. t = v.defaults(t, {
  10219. autoPlace: !0,
  10220. width: R.DEFAULT_WIDTH
  10221. }),
  10222. t = v.defaults(t, {
  10223. resizable: t.autoPlace,
  10224. hideable: t.autoPlace
  10225. }),
  10226. v.isUndefined(t.load) ? t.load = {
  10227. preset: T
  10228. } : t.preset && (t.load.preset = t.preset),
  10229. v.isUndefined(t.parent) && t.hideable && M.push(this),
  10230. t.resizable = v.isUndefined(t.parent) && t.resizable,
  10231. t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
  10232. var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
  10233. if (Object.defineProperties(this, {
  10234. parent: {
  10235. get: function() {
  10236. return t.parent
  10237. }
  10238. },
  10239. scrollable: {
  10240. get: function() {
  10241. return t.scrollable
  10242. }
  10243. },
  10244. autoPlace: {
  10245. get: function() {
  10246. return t.autoPlace
  10247. }
  10248. },
  10249. preset: {
  10250. get: function() {
  10251. return i.parent ? i.getRoot().preset : t.load.preset
  10252. },
  10253. set: function(e) {
  10254. i.parent ? i.getRoot().preset = e : t.load.preset = e,
  10255. function(e) {
  10256. for (var t = 0; t < e.__preset_select.length; t++)
  10257. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10258. }(this),
  10259. i.revert()
  10260. }
  10261. },
  10262. width: {
  10263. get: function() {
  10264. return t.width
  10265. },
  10266. set: function(e) {
  10267. t.width = e,
  10268. l(i, e)
  10269. }
  10270. },
  10271. name: {
  10272. get: function() {
  10273. return t.name
  10274. },
  10275. set: function(e) {
  10276. t.name = e,
  10277. a && (a.innerHTML = t.name)
  10278. }
  10279. },
  10280. closed: {
  10281. get: function() {
  10282. return t.closed
  10283. },
  10284. set: function(e) {
  10285. t.closed = e,
  10286. t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
  10287. this.onResize(),
  10288. i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
  10289. }
  10290. },
  10291. load: {
  10292. get: function() {
  10293. return t.load
  10294. }
  10295. },
  10296. useLocalStorage: {
  10297. get: function() {
  10298. return r
  10299. },
  10300. set: function(e) {
  10301. x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
  10302. localStorage.setItem(I(0, "isLocal"), e))
  10303. }
  10304. }
  10305. }),
  10306. v.isUndefined(t.parent)) {
  10307. if (t.closed = !1,
  10308. m.addClass(this.domElement, R.CLASS_MAIN),
  10309. m.makeSelectable(this.domElement, !1),
  10310. x && r) {
  10311. i.useLocalStorage = !0;
  10312. var o = localStorage.getItem(I(0, "gui"));
  10313. o && (t.load = JSON.parse(o))
  10314. }
  10315. this.__closeButton = document.createElement("div"),
  10316. this.__closeButton.innerHTML = R.TEXT_CLOSED,
  10317. m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
  10318. this.domElement.appendChild(this.__closeButton),
  10319. m.bind(this.__closeButton, "click", function() {
  10320. i.closed = !i.closed
  10321. })
  10322. } else {
  10323. void 0 === t.closed && (t.closed = !0);
  10324. var a = document.createTextNode(t.name);
  10325. m.addClass(a, "controller-name");
  10326. var s = A(i, a);
  10327. m.addClass(this.__ul, R.CLASS_CLOSED),
  10328. m.addClass(s, "title"),
  10329. m.bind(s, "click", function(e) {
  10330. return e.preventDefault(),
  10331. i.closed = !i.closed,
  10332. !1
  10333. }),
  10334. t.closed || (this.closed = !1)
  10335. }
  10336. t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
  10337. m.addClass(w, "dg"),
  10338. m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
  10339. document.body.appendChild(w),
  10340. S = !1),
  10341. w.appendChild(this.domElement),
  10342. m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
  10343. this.parent || l(i, t.width)),
  10344. m.bind(window, "resize", function() {
  10345. i.onResize()
  10346. }),
  10347. m.bind(this.__ul, "webkitTransitionEnd", function() {
  10348. i.onResize()
  10349. }),
  10350. m.bind(this.__ul, "transitionend", function() {
  10351. i.onResize()
  10352. }),
  10353. m.bind(this.__ul, "oTransitionEnd", function() {
  10354. i.onResize()
  10355. }),
  10356. this.onResize(),
  10357. t.resizable && function(t) {
  10358. function e(e) {
  10359. return e.preventDefault(),
  10360. r = e.clientX,
  10361. m.addClass(t.__closeButton, R.CLASS_DRAG),
  10362. m.bind(window, "mousemove", i),
  10363. m.bind(window, "mouseup", n),
  10364. !1
  10365. }
  10366. function i(e) {
  10367. return e.preventDefault(),
  10368. t.width += r - e.clientX,
  10369. t.onResize(),
  10370. r = e.clientX,
  10371. !1
  10372. }
  10373. function n() {
  10374. m.removeClass(t.__closeButton, R.CLASS_DRAG),
  10375. m.unbind(window, "mousemove", i),
  10376. m.unbind(window, "mouseup", n)
  10377. }
  10378. var r;
  10379. t.__resize_handle = document.createElement("div"),
  10380. v.extend(t.__resize_handle.style, {
  10381. width: "6px",
  10382. marginLeft: "-3px",
  10383. height: "200px",
  10384. cursor: "ew-resize",
  10385. position: "absolute"
  10386. }),
  10387. m.bind(t.__resize_handle, "mousedown", e),
  10388. m.bind(t.__closeButton, "mousedown", e),
  10389. t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
  10390. }(this),
  10391. n = function() {
  10392. x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
  10393. }
  10394. ,
  10395. this.saveToLocalStorageIfPossible = n,
  10396. i.getRoot(),
  10397. t.parent || ((e = i.getRoot()).width += 1,
  10398. v.defer(function() {
  10399. e.width -= 1
  10400. }))
  10401. };
  10402. return R.toggleHide = function() {
  10403. s = !s,
  10404. v.each(M, function(e) {
  10405. e.domElement.style.zIndex = s ? -999 : 999,
  10406. e.domElement.style.opacity = s ? 0 : 1
  10407. })
  10408. }
  10409. ,
  10410. R.CLASS_AUTO_PLACE = "a",
  10411. R.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10412. R.CLASS_MAIN = "main",
  10413. R.CLASS_CONTROLLER_ROW = "cr",
  10414. R.CLASS_TOO_TALL = "taller-than-window",
  10415. R.CLASS_CLOSED = "closed",
  10416. R.CLASS_CLOSE_BUTTON = "close-button",
  10417. R.CLASS_DRAG = "drag",
  10418. R.DEFAULT_WIDTH = 245,
  10419. R.TEXT_CLOSED = "Close Controls",
  10420. R.TEXT_OPEN = "Open Controls",
  10421. m.bind(window, "keydown", function(e) {
  10422. "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
  10423. }, !1),
  10424. v.extend(R.prototype, {
  10425. add: function(e, t) {
  10426. return y(this, e, t, {
  10427. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10428. })
  10429. },
  10430. addColor: function(e, t) {
  10431. return y(this, e, t, {
  10432. color: !0
  10433. })
  10434. },
  10435. remove: function(e) {
  10436. this.__ul.removeChild(e.__li),
  10437. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10438. var t = this;
  10439. v.defer(function() {
  10440. t.onResize()
  10441. })
  10442. },
  10443. destroy: function() {
  10444. this.autoPlace && w.removeChild(this.domElement)
  10445. },
  10446. addFolder: function(e) {
  10447. if (void 0 !== this.__folders[e])
  10448. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10449. var t = {
  10450. name: e,
  10451. parent: this
  10452. };
  10453. t.autoPlace = this.autoPlace,
  10454. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10455. t.load = this.load.folders[e]);
  10456. var i = new R(t);
  10457. this.__folders[e] = i;
  10458. var n = A(this, i.domElement);
  10459. return m.addClass(n, "folder"),
  10460. i
  10461. },
  10462. open: function() {
  10463. this.closed = !1
  10464. },
  10465. close: function() {
  10466. this.closed = !0
  10467. },
  10468. onResize: function() {
  10469. var t = this.getRoot();
  10470. if (t.scrollable) {
  10471. var e = m.getOffset(t.__ul).top
  10472. , i = 0;
  10473. v.each(t.__ul.childNodes, function(e) {
  10474. t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
  10475. }),
  10476. $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
  10477. t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
  10478. t.__ul.style.height = "auto")
  10479. }
  10480. t.__resize_handle && v.defer(function() {
  10481. t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
  10482. }),
  10483. t.__closeButton && (t.__closeButton.style.width = t.width + "px")
  10484. },
  10485. remember: function() {
  10486. 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>'),
  10487. this.parent)
  10488. throw new Error("You can only call remember on a top level GUI.");
  10489. var t = this;
  10490. v.each(Array.prototype.slice.call(arguments), function(e) {
  10491. 0 == t.__rememberedObjects.length && function(i) {
  10492. var e = i.__save_row = document.createElement("li");
  10493. m.addClass(i.domElement, "has-save"),
  10494. i.__ul.insertBefore(e, i.__ul.firstChild),
  10495. m.addClass(e, "save-row");
  10496. var t = document.createElement("span");
  10497. t.innerHTML = "&nbsp;",
  10498. m.addClass(t, "button gears");
  10499. var n = document.createElement("span");
  10500. n.innerHTML = "Save",
  10501. m.addClass(n, "button"),
  10502. m.addClass(n, "save");
  10503. var r = document.createElement("span");
  10504. r.innerHTML = "New",
  10505. m.addClass(r, "button"),
  10506. m.addClass(r, "save-as");
  10507. var o = document.createElement("span");
  10508. o.innerHTML = "Revert",
  10509. m.addClass(o, "button"),
  10510. m.addClass(o, "revert");
  10511. var a = i.__preset_select = document.createElement("select");
  10512. if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
  10513. E(i, t, t == i.preset)
  10514. }) : E(i, T, !1),
  10515. m.bind(a, "change", function() {
  10516. for (var e = 0; e < i.__preset_select.length; e++)
  10517. i.__preset_select[e].innerHTML = i.__preset_select[e].value;
  10518. i.preset = this.value
  10519. }),
  10520. e.appendChild(a),
  10521. e.appendChild(t),
  10522. e.appendChild(n),
  10523. e.appendChild(r),
  10524. e.appendChild(o),
  10525. x) {
  10526. var s = document.getElementById("dg-save-locally")
  10527. , l = document.getElementById("dg-local-explain");
  10528. s.style.display = "block";
  10529. var c = document.getElementById("dg-local-storage");
  10530. "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
  10531. var h = function() {
  10532. l.style.display = i.useLocalStorage ? "block" : "none"
  10533. };
  10534. h(),
  10535. m.bind(c, "change", function() {
  10536. i.useLocalStorage = !i.useLocalStorage,
  10537. h()
  10538. })
  10539. }
  10540. var u = document.getElementById("dg-new-constructor");
  10541. m.bind(u, "keydown", function(e) {
  10542. !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
  10543. }),
  10544. m.bind(t, "click", function() {
  10545. u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
  10546. b.show(),
  10547. u.focus(),
  10548. u.select()
  10549. }),
  10550. m.bind(n, "click", function() {
  10551. i.save()
  10552. }),
  10553. m.bind(r, "click", function() {
  10554. var e = prompt("Enter a new preset name.");
  10555. e && i.saveAs(e)
  10556. }),
  10557. m.bind(o, "click", function() {
  10558. i.revert()
  10559. })
  10560. }(t),
  10561. -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
  10562. }),
  10563. this.autoPlace && l(this, this.width)
  10564. },
  10565. getRoot: function() {
  10566. for (var e = this; e.parent; )
  10567. e = e.parent;
  10568. return e
  10569. },
  10570. getSaveObject: function() {
  10571. var i = this.load;
  10572. return i.closed = this.closed,
  10573. 0 < this.__rememberedObjects.length && (i.preset = this.preset,
  10574. i.remembered || (i.remembered = {}),
  10575. i.remembered[this.preset] = a(this)),
  10576. i.folders = {},
  10577. v.each(this.__folders, function(e, t) {
  10578. i.folders[t] = e.getSaveObject()
  10579. }),
  10580. i
  10581. },
  10582. save: function() {
  10583. this.load.remembered || (this.load.remembered = {}),
  10584. this.load.remembered[this.preset] = a(this),
  10585. _(this, !1),
  10586. this.saveToLocalStorageIfPossible()
  10587. },
  10588. saveAs: function(e) {
  10589. this.load.remembered || (this.load.remembered = {},
  10590. this.load.remembered[T] = a(this, !0)),
  10591. this.load.remembered[e] = a(this),
  10592. this.preset = e,
  10593. E(this, e, !0),
  10594. this.saveToLocalStorageIfPossible()
  10595. },
  10596. revert: function(t) {
  10597. v.each(this.__controllers, function(e) {
  10598. this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
  10599. }, this),
  10600. v.each(this.__folders, function(e) {
  10601. e.revert(e)
  10602. }),
  10603. t || _(this.getRoot(), !1)
  10604. },
  10605. listen: function(e) {
  10606. var t = 0 == this.__listening.length;
  10607. this.__listening.push(e),
  10608. t && function e(t) {
  10609. 0 != t.length && r(function() {
  10610. e(t)
  10611. }),
  10612. v.each(t, function(e) {
  10613. e.updateDisplay()
  10614. })
  10615. }(this.__listening)
  10616. }
  10617. }),
  10618. R
  10619. }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
  10620. u = ee.controllers.NumberControllerBox,
  10621. d = ee.controllers.NumberControllerSlider,
  10622. p = ee.controllers.StringController = (v = ee.controllers.Controller,
  10623. y = ee.dom.dom,
  10624. A = ee.utils.common,
  10625. (C = function(e, t) {
  10626. function i() {
  10627. n.setValue(n.__input.value)
  10628. }
  10629. C.superclass.call(this, e, t);
  10630. var n = this;
  10631. this.__input = document.createElement("input"),
  10632. this.__input.setAttribute("type", "text"),
  10633. y.bind(this.__input, "keyup", i),
  10634. y.bind(this.__input, "change", i),
  10635. y.bind(this.__input, "blur", function() {
  10636. n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
  10637. }),
  10638. y.bind(this.__input, "keydown", function(e) {
  10639. 13 === e.keyCode && this.blur()
  10640. }),
  10641. this.updateDisplay(),
  10642. this.domElement.appendChild(this.__input)
  10643. }
  10644. ).superclass = v,
  10645. A.extend(C.prototype, v.prototype, {
  10646. updateDisplay: function() {
  10647. return y.isActive(this.__input) || (this.__input.value = this.getValue()),
  10648. C.superclass.prototype.updateDisplay.call(this)
  10649. }
  10650. }),
  10651. C),
  10652. f = ee.controllers.FunctionController,
  10653. g = ee.controllers.BooleanController,
  10654. m = ee.utils.common,
  10655. function(e, t) {
  10656. var i = e[t];
  10657. 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,{
  10658. min: arguments[2],
  10659. max: arguments[3]
  10660. }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
  10661. }
  10662. ), 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) {
  10663. function f(t, i, n, r) {
  10664. t.style.background = "",
  10665. p.each(o, function(e) {
  10666. t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
  10667. })
  10668. }
  10669. var g = function(e, t) {
  10670. function i(e) {
  10671. a(e),
  10672. h.bind(window, "mousemove", a),
  10673. h.bind(window, "mouseup", n)
  10674. }
  10675. function n() {
  10676. h.unbind(window, "mousemove", a),
  10677. h.unbind(window, "mouseup", n)
  10678. }
  10679. function r() {
  10680. var e = d(this.value);
  10681. !1 !== e ? (l.__color.__state = e,
  10682. l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
  10683. }
  10684. function o() {
  10685. h.unbind(window, "mousemove", s),
  10686. h.unbind(window, "mouseup", o)
  10687. }
  10688. function a(e) {
  10689. e.preventDefault();
  10690. var t = h.getWidth(l.__saturation_field)
  10691. , i = h.getOffset(l.__saturation_field)
  10692. , n = (e.clientX - i.left + document.body.scrollLeft) / t
  10693. , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10694. return 1 < r ? r = 1 : r < 0 && (r = 0),
  10695. 1 < n ? n = 1 : n < 0 && (n = 0),
  10696. l.__color.v = r,
  10697. l.__color.s = n,
  10698. l.setValue(l.__color.toOriginal()),
  10699. !1
  10700. }
  10701. function s(e) {
  10702. e.preventDefault();
  10703. var t = h.getHeight(l.__hue_field)
  10704. , i = h.getOffset(l.__hue_field)
  10705. , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
  10706. return 1 < n ? n = 1 : n < 0 && (n = 0),
  10707. l.__color.h = 360 * n,
  10708. l.setValue(l.__color.toOriginal()),
  10709. !1
  10710. }
  10711. g.superclass.call(this, e, t),
  10712. this.__color = new u(this.getValue()),
  10713. this.__temp = new u(0);
  10714. var l = this;
  10715. this.domElement = document.createElement("div"),
  10716. h.makeSelectable(this.domElement, !1),
  10717. this.__selector = document.createElement("div"),
  10718. this.__selector.className = "selector",
  10719. this.__saturation_field = document.createElement("div"),
  10720. this.__saturation_field.className = "saturation-field",
  10721. this.__field_knob = document.createElement("div"),
  10722. this.__field_knob.className = "field-knob",
  10723. this.__field_knob_border = "2px solid ",
  10724. this.__hue_knob = document.createElement("div"),
  10725. this.__hue_knob.className = "hue-knob",
  10726. this.__hue_field = document.createElement("div"),
  10727. this.__hue_field.className = "hue-field",
  10728. this.__input = document.createElement("input"),
  10729. this.__input.type = "text",
  10730. this.__input_textShadow = "0 1px 1px ",
  10731. h.bind(this.__input, "keydown", function(e) {
  10732. 13 === e.keyCode && r.call(this)
  10733. }),
  10734. h.bind(this.__input, "blur", r),
  10735. h.bind(this.__selector, "mousedown", function(e) {
  10736. h.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10737. h.removeClass(l.__selector, "drag")
  10738. })
  10739. });
  10740. var c = document.createElement("div");
  10741. p.extend(this.__selector.style, {
  10742. width: "122px",
  10743. height: "102px",
  10744. padding: "3px",
  10745. backgroundColor: "#222",
  10746. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10747. }),
  10748. p.extend(this.__field_knob.style, {
  10749. position: "absolute",
  10750. width: "12px",
  10751. height: "12px",
  10752. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10753. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10754. borderRadius: "12px",
  10755. zIndex: 1
  10756. }),
  10757. p.extend(this.__hue_knob.style, {
  10758. position: "absolute",
  10759. width: "15px",
  10760. height: "2px",
  10761. borderRight: "4px solid #fff",
  10762. zIndex: 1
  10763. }),
  10764. p.extend(this.__saturation_field.style, {
  10765. width: "100px",
  10766. height: "100px",
  10767. border: "1px solid #555",
  10768. marginRight: "3px",
  10769. display: "inline-block",
  10770. cursor: "pointer"
  10771. }),
  10772. p.extend(c.style, {
  10773. width: "100%",
  10774. height: "100%",
  10775. background: "none"
  10776. }),
  10777. f(c, "top", "rgba(0,0,0,0)", "#000"),
  10778. p.extend(this.__hue_field.style, {
  10779. width: "15px",
  10780. height: "100px",
  10781. display: "inline-block",
  10782. border: "1px solid #555",
  10783. cursor: "ns-resize"
  10784. }),
  10785. function(e) {
  10786. e.style.background = "",
  10787. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10788. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10789. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10790. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10791. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10792. }(this.__hue_field),
  10793. p.extend(this.__input.style, {
  10794. outline: "none",
  10795. textAlign: "center",
  10796. color: "#fff",
  10797. border: 0,
  10798. fontWeight: "bold",
  10799. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  10800. }),
  10801. h.bind(this.__saturation_field, "mousedown", i),
  10802. h.bind(this.__field_knob, "mousedown", i),
  10803. h.bind(this.__hue_field, "mousedown", function(e) {
  10804. s(e),
  10805. h.bind(window, "mousemove", s),
  10806. h.bind(window, "mouseup", o)
  10807. }),
  10808. this.__saturation_field.appendChild(c),
  10809. this.__selector.appendChild(this.__field_knob),
  10810. this.__selector.appendChild(this.__saturation_field),
  10811. this.__selector.appendChild(this.__hue_field),
  10812. this.__hue_field.appendChild(this.__hue_knob),
  10813. this.domElement.appendChild(this.__input),
  10814. this.domElement.appendChild(this.__selector),
  10815. this.updateDisplay()
  10816. };
  10817. g.superclass = e,
  10818. p.extend(g.prototype, e.prototype, {
  10819. updateDisplay: function() {
  10820. var t = d(this.getValue());
  10821. if (!1 !== t) {
  10822. var i = !1;
  10823. p.each(u.COMPONENTS, function(e) {
  10824. if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
  10825. return i = !0,
  10826. {}
  10827. }, this),
  10828. i && p.extend(this.__color.__state, t)
  10829. }
  10830. p.extend(this.__temp.__state, this.__color.__state),
  10831. this.__temp.a = 1;
  10832. var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
  10833. , n = 255 - e;
  10834. p.extend(this.__field_knob.style, {
  10835. marginLeft: 100 * this.__color.s - 7 + "px",
  10836. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  10837. backgroundColor: this.__temp.toString(),
  10838. border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
  10839. }),
  10840. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  10841. this.__temp.s = 1,
  10842. this.__temp.v = 1,
  10843. f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  10844. p.extend(this.__input.style, {
  10845. backgroundColor: this.__input.value = this.__color.toString(),
  10846. color: "rgb(" + e + "," + e + "," + e + ")",
  10847. textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
  10848. })
  10849. }
  10850. });
  10851. var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  10852. return g
  10853. }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
  10854. a = ee.color.math = {
  10855. hsv_to_rgb: function(e, t, i) {
  10856. var n = Math.floor(e / 60) % 6
  10857. , r = e / 60 - Math.floor(e / 60)
  10858. , o = i * (1 - t)
  10859. , a = i * (1 - r * t)
  10860. , s = i * (1 - (1 - r) * t)
  10861. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  10862. return {
  10863. r: 255 * l[0],
  10864. g: 255 * l[1],
  10865. b: 255 * l[2]
  10866. }
  10867. },
  10868. rgb_to_hsv: function(e, t, i) {
  10869. var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
  10870. return 0 == o ? {
  10871. h: NaN,
  10872. s: 0,
  10873. v: 0
  10874. } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
  10875. (n /= 6) < 0 && (n += 1),
  10876. {
  10877. h: 360 * n,
  10878. s: a / o,
  10879. v: o / 255
  10880. })
  10881. },
  10882. rgb_to_hex: function(e, t, i) {
  10883. var n = this.hex_with_component(0, 2, e);
  10884. return n = this.hex_with_component(n, 1, t),
  10885. this.hex_with_component(n, 0, i)
  10886. },
  10887. component_from_hex: function(e, t) {
  10888. return e >> 8 * t & 255
  10889. },
  10890. hex_with_component: function(e, t, i) {
  10891. return i << (c = 8 * t) | e & ~(255 << c)
  10892. }
  10893. },
  10894. s = ee.color.toString,
  10895. l = ee.utils.common,
  10896. ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  10897. l.extend(ae.prototype, {
  10898. toString: function() {
  10899. return s(this)
  10900. },
  10901. toOriginal: function() {
  10902. return this.__state.conversion.write(this)
  10903. }
  10904. }),
  10905. ie(ae.prototype, "r", 2),
  10906. ie(ae.prototype, "g", 1),
  10907. ie(ae.prototype, "b", 0),
  10908. ne(ae.prototype, "h"),
  10909. ne(ae.prototype, "s"),
  10910. ne(ae.prototype, "v"),
  10911. Object.defineProperty(ae.prototype, "a", {
  10912. get: function() {
  10913. return this.__state.a
  10914. },
  10915. set: function(e) {
  10916. this.__state.a = e
  10917. }
  10918. }),
  10919. Object.defineProperty(ae.prototype, "hex", {
  10920. get: function() {
  10921. return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
  10922. this.__state.hex
  10923. },
  10924. set: function(e) {
  10925. this.__state.space = "HEX",
  10926. this.__state.hex = e
  10927. }
  10928. }),
  10929. ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  10930. window.setTimeout(e, 1e3 / 60)
  10931. }
  10932. , ee.dom.CenteredDiv = (n = ee.dom.dom,
  10933. r = ee.utils.common,
  10934. te.prototype.show = function() {
  10935. var e = this;
  10936. this.backgroundElement.style.display = "block",
  10937. this.domElement.style.display = "block",
  10938. this.domElement.style.opacity = 0,
  10939. this.domElement.style.webkitTransform = "scale(1.1)",
  10940. this.layout(),
  10941. r.defer(function() {
  10942. e.backgroundElement.style.opacity = 1,
  10943. e.domElement.style.opacity = 1,
  10944. e.domElement.style.webkitTransform = "scale(1)"
  10945. })
  10946. }
  10947. ,
  10948. te.prototype.hide = function() {
  10949. var e = this
  10950. , t = function() {
  10951. e.domElement.style.display = "none",
  10952. e.backgroundElement.style.display = "none",
  10953. n.unbind(e.domElement, "webkitTransitionEnd", t),
  10954. n.unbind(e.domElement, "transitionend", t),
  10955. n.unbind(e.domElement, "oTransitionEnd", t)
  10956. };
  10957. n.bind(this.domElement, "webkitTransitionEnd", t),
  10958. n.bind(this.domElement, "transitionend", t),
  10959. n.bind(this.domElement, "oTransitionEnd", t),
  10960. this.backgroundElement.style.opacity = 0,
  10961. this.domElement.style.opacity = 0,
  10962. this.domElement.style.webkitTransform = "scale(1.1)"
  10963. }
  10964. ,
  10965. te.prototype.layout = function() {
  10966. this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
  10967. this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
  10968. }
  10969. ,
  10970. te), ee.dom.dom, ee.utils.common)
  10971. }
  10972. , {}],
  10973. 94: [function(e, t, i) {
  10974. (function(J) {
  10975. "use strict";
  10976. function i(e) {
  10977. function t(e, t) {
  10978. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  10979. for (var a = 1; a <= e[o]; a++)
  10980. r[t[n]] = [],
  10981. r[t[n]][0] = i,
  10982. r[t[n]][1] = o,
  10983. n++,
  10984. i++;
  10985. i *= 2
  10986. }
  10987. return r
  10988. }
  10989. function _(e) {
  10990. for (var t = e[0], i = e[1] - 1; 0 <= i; )
  10991. t & 1 << i && (B |= 1 << V),
  10992. i--,
  10993. --V < 0 && (255 == B ? (b(255),
  10994. b(0)) : b(B),
  10995. V = 7,
  10996. B = 0)
  10997. }
  10998. function b(e) {
  10999. F.push(e)
  11000. }
  11001. function w(e) {
  11002. b(e >> 8 & 255),
  11003. b(255 & e)
  11004. }
  11005. function T(e, t, i, n, r) {
  11006. for (var o, a = r[0], s = r[240], l = function(e, t) {
  11007. var i, n, r, o, a, s, l, c, h, u, d = 0;
  11008. for (h = 0; h < 8; ++h) {
  11009. i = e[d],
  11010. n = e[d + 1],
  11011. r = e[d + 2],
  11012. o = e[d + 3],
  11013. a = e[d + 4],
  11014. s = e[d + 5],
  11015. l = e[d + 6];
  11016. var p = i + (c = e[d + 7])
  11017. , f = i - c
  11018. , g = n + l
  11019. , m = n - l
  11020. , v = r + s
  11021. , y = r - s
  11022. , A = o + a
  11023. , C = o - a
  11024. , I = p + A
  11025. , E = p - A
  11026. , _ = g + v
  11027. , b = g - v;
  11028. e[d] = I + _,
  11029. e[d + 4] = I - _;
  11030. var w = .707106781 * (b + E);
  11031. e[d + 2] = E + w,
  11032. e[d + 6] = E - w;
  11033. var T = .382683433 * ((I = C + y) - (b = m + f))
  11034. , x = .5411961 * I + T
  11035. , S = 1.306562965 * b + T
  11036. , M = .707106781 * (_ = y + m)
  11037. , R = f + M
  11038. , P = f - M;
  11039. e[d + 5] = P + x,
  11040. e[d + 3] = P - x,
  11041. e[d + 1] = R + S,
  11042. e[d + 7] = R - S,
  11043. d += 8
  11044. }
  11045. for (h = d = 0; h < 8; ++h) {
  11046. i = e[d],
  11047. n = e[d + 8],
  11048. r = e[d + 16],
  11049. o = e[d + 24],
  11050. a = e[d + 32],
  11051. s = e[d + 40],
  11052. l = e[d + 48];
  11053. var O = i + (c = e[d + 56])
  11054. , L = i - c
  11055. , D = n + l
  11056. , N = n - l
  11057. , F = r + s
  11058. , B = r - s
  11059. , V = o + a
  11060. , k = o - a
  11061. , U = O + V
  11062. , H = O - V
  11063. , z = D + F
  11064. , G = D - F;
  11065. e[d] = U + z,
  11066. e[d + 32] = U - z;
  11067. var W = .707106781 * (G + H);
  11068. e[d + 16] = H + W,
  11069. e[d + 48] = H - W;
  11070. var j = .382683433 * ((U = k + B) - (G = N + L))
  11071. , Y = .5411961 * U + j
  11072. , q = 1.306562965 * G + j
  11073. , X = .707106781 * (z = B + N)
  11074. , Z = L + X
  11075. , K = L - X;
  11076. e[d + 40] = K + Y,
  11077. e[d + 24] = K - Y,
  11078. e[d + 8] = Z + q,
  11079. e[d + 56] = Z - q,
  11080. d++
  11081. }
  11082. for (h = 0; h < 64; ++h)
  11083. u = e[h] * t[h],
  11084. Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
  11085. return Q
  11086. }(e, t), c = 0; c < 64; ++c)
  11087. A[C[c]] = l[c];
  11088. var h = A[0] - i;
  11089. i = A[0],
  11090. 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
  11091. _(v[o]));
  11092. for (var u = 63; 0 < u && 0 == A[u]; u--)
  11093. ;
  11094. if (0 == u)
  11095. return _(a),
  11096. i;
  11097. for (var d, p = 1; p <= u; ) {
  11098. for (var f = p; 0 == A[p] && p <= u; ++p)
  11099. ;
  11100. var g = p - f;
  11101. if (16 <= g) {
  11102. d = g >> 4;
  11103. for (var m = 1; m <= d; ++m)
  11104. _(s);
  11105. g &= 15
  11106. }
  11107. o = 32767 + A[p],
  11108. _(r[(g << 4) + y[o]]),
  11109. _(v[o]),
  11110. p++
  11111. }
  11112. return 63 != u && _(a),
  11113. i
  11114. }
  11115. function x(e) {
  11116. if (e <= 0 && (e = 1),
  11117. 100 < e && (e = 100),
  11118. i != e) {
  11119. (function(e) {
  11120. 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++) {
  11121. var n = u((t[i] * e + 50) / 100);
  11122. n < 1 ? n = 1 : 255 < n && (n = 255),
  11123. O[C[i]] = n
  11124. }
  11125. 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++) {
  11126. var a = u((r[o] * e + 50) / 100);
  11127. a < 1 ? a = 1 : 255 < a && (a = 255),
  11128. L[C[o]] = a
  11129. }
  11130. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11131. for (var h = 0; h < 8; h++)
  11132. D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
  11133. N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
  11134. l++
  11135. }
  11136. )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
  11137. i = e
  11138. }
  11139. }
  11140. var S, M, R, P, i, u = (Math.round,
  11141. 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];
  11142. this.encode = function(e, t) {
  11143. var i = ((new Date).getTime(),
  11144. t.quality);
  11145. i && x(i),
  11146. F = new Array,
  11147. B = 0,
  11148. V = 7,
  11149. w(65496),
  11150. w(65504),
  11151. w(16),
  11152. b(74),
  11153. b(70),
  11154. b(73),
  11155. b(70),
  11156. b(0),
  11157. b(1),
  11158. b(1),
  11159. b(0),
  11160. w(1),
  11161. w(1),
  11162. b(0),
  11163. b(0),
  11164. function() {
  11165. w(65499),
  11166. w(132),
  11167. b(0);
  11168. for (var e = 0; e < 64; e++)
  11169. b(O[e]);
  11170. b(1);
  11171. for (var t = 0; t < 64; t++)
  11172. b(L[t])
  11173. }(),
  11174. function(e, t) {
  11175. w(65472),
  11176. w(17),
  11177. b(8),
  11178. w(t),
  11179. w(e),
  11180. b(3),
  11181. b(1),
  11182. b(17),
  11183. b(0),
  11184. b(2),
  11185. b(17),
  11186. b(1),
  11187. b(3),
  11188. b(17),
  11189. b(1)
  11190. }(e.width, e.height),
  11191. function() {
  11192. w(65476),
  11193. w(418),
  11194. b(0);
  11195. for (var e = 0; e < 16; e++)
  11196. b(G[e + 1]);
  11197. for (var t = 0; t <= 11; t++)
  11198. b(W[t]);
  11199. b(16);
  11200. for (var i = 0; i < 16; i++)
  11201. b(j[i + 1]);
  11202. for (var n = 0; n <= 161; n++)
  11203. b(Y[n]);
  11204. b(1);
  11205. for (var r = 0; r < 16; r++)
  11206. b(q[r + 1]);
  11207. for (var o = 0; o <= 11; o++)
  11208. b(X[o]);
  11209. b(17);
  11210. for (var a = 0; a < 16; a++)
  11211. b(Z[a + 1]);
  11212. for (var s = 0; s <= 161; s++)
  11213. b(K[s])
  11214. }(),
  11215. w(65498),
  11216. w(12),
  11217. b(3),
  11218. b(1),
  11219. b(0),
  11220. b(2),
  11221. b(17),
  11222. b(3),
  11223. b(17),
  11224. b(0),
  11225. b(63),
  11226. b(0);
  11227. var n = 0
  11228. , r = 0
  11229. , o = 0;
  11230. B = 0,
  11231. V = 7,
  11232. this.encode.displayName = "_encode_";
  11233. 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; ) {
  11234. for (a = 0; a < A; ) {
  11235. for (u = h = A * C + a,
  11236. d = -1,
  11237. f = p = 0; f < 64; f++)
  11238. u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
  11239. v <= C + p && (u -= A * (C + 1 + p - v)),
  11240. A <= a + d && (u -= a + d - A + 4),
  11241. s = g[u++],
  11242. l = g[u++],
  11243. c = g[u++],
  11244. k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
  11245. U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
  11246. H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
  11247. n = T(k, D, n, S, R),
  11248. r = T(U, N, r, M, P),
  11249. o = T(H, N, o, M, P),
  11250. a += 32
  11251. }
  11252. C += I
  11253. }
  11254. if (0 <= V) {
  11255. var E = [];
  11256. E[1] = V + 1,
  11257. E[0] = (1 << V + 1) - 1,
  11258. _(E)
  11259. }
  11260. return w(65497),
  11261. new J(F)
  11262. }
  11263. ,
  11264. (new Date).getTime(),
  11265. e = e || 50,
  11266. function() {
  11267. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11268. n[t] = e(t)
  11269. }(),
  11270. S = t(G, W),
  11271. M = t(q, X),
  11272. R = t(j, Y),
  11273. P = t(Z, K),
  11274. function() {
  11275. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11276. for (var n = e; n < t; n++)
  11277. y[32767 + n] = i,
  11278. v[32767 + n] = [],
  11279. v[32767 + n][1] = i,
  11280. v[32767 + n][0] = n;
  11281. for (var r = -(t - 1); r <= -e; r++)
  11282. y[32767 + r] = i,
  11283. v[32767 + r] = [],
  11284. v[32767 + r][1] = i,
  11285. v[32767 + r][0] = t - 1 + r;
  11286. e <<= 1,
  11287. t <<= 1
  11288. }
  11289. }(),
  11290. function() {
  11291. for (var e = 0; e < 256; e++)
  11292. z[e] = 19595 * e,
  11293. z[e + 256 >> 0] = 38470 * e,
  11294. z[e + 512 >> 0] = 7471 * e + 32768,
  11295. z[e + 768 >> 0] = -11059 * e,
  11296. z[e + 1024 >> 0] = -21709 * e,
  11297. z[e + 1280 >> 0] = 32768 * e + 8421375,
  11298. z[e + 1536 >> 0] = -27439 * e,
  11299. z[e + 1792 >> 0] = -5329 * e
  11300. }(),
  11301. x(e),
  11302. (new Date).getTime()
  11303. }
  11304. t.exports.encode = function(e, t) {
  11305. return (t = t || {}).quality = t.quality || 50,
  11306. {
  11307. data: new i(t.quality).encode(e, t),
  11308. width: e.width,
  11309. height: e.height
  11310. }
  11311. }
  11312. }
  11313. ).call(this, e("buffer").Buffer)
  11314. }
  11315. , {
  11316. buffer: 198
  11317. }],
  11318. 95: [function(e, t, i) {
  11319. "use strict";
  11320. !function() {
  11321. if ("performance"in window == 0 && (window.performance = {}),
  11322. Date.now = Date.now || function() {
  11323. return (new Date).getTime()
  11324. }
  11325. ,
  11326. "now"in window.performance == 0) {
  11327. var e = Date.now();
  11328. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11329. window.performance.now = function() {
  11330. return Date.now() - e
  11331. }
  11332. }
  11333. }()
  11334. }
  11335. , {}],
  11336. 96: [function(e, t, i) {
  11337. "use strict";
  11338. var a = e("three");
  11339. a.EffectComposer = function(e, t) {
  11340. if (this.renderer = e,
  11341. void 0 === t) {
  11342. var i = {
  11343. minFilter: a.LinearFilter,
  11344. magFilter: a.LinearFilter,
  11345. format: a.RGBAFormat,
  11346. stencilBuffer: !1
  11347. }
  11348. , n = e.getSize();
  11349. t = new a.WebGLRenderTarget(n.width,n.height,i)
  11350. }
  11351. this.renderTarget1 = t,
  11352. this.renderTarget2 = t.clone(),
  11353. this.writeBuffer = this.renderTarget1,
  11354. this.readBuffer = this.renderTarget2,
  11355. this.passes = [],
  11356. void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11357. this.copyPass = new a.ShaderPass(a.CopyShader)
  11358. }
  11359. ,
  11360. a.EffectComposer.prototype = {
  11361. swapBuffers: function() {
  11362. var e = this.readBuffer;
  11363. this.readBuffer = this.writeBuffer,
  11364. this.writeBuffer = e
  11365. },
  11366. addPass: function(e) {
  11367. this.passes.push(e)
  11368. },
  11369. insertPass: function(e, t) {
  11370. this.passes.splice(t, 0, e)
  11371. },
  11372. render: function(e) {
  11373. this.writeBuffer = this.renderTarget1,
  11374. this.readBuffer = this.renderTarget2;
  11375. var t, i, n = !1, r = this.passes.length;
  11376. for (i = 0; i < r; i++)
  11377. if ((t = this.passes[i]).enabled) {
  11378. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
  11379. t.needsSwap) {
  11380. if (n) {
  11381. var o = this.renderer.context;
  11382. o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
  11383. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11384. o.stencilFunc(o.EQUAL, 1, 4294967295)
  11385. }
  11386. this.swapBuffers()
  11387. }
  11388. t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
  11389. }
  11390. },
  11391. reset: function(e) {
  11392. if (void 0 === e) {
  11393. var t = this.renderer.getSize();
  11394. (e = this.renderTarget1.clone()).setSize(t.width, t.height)
  11395. }
  11396. this.renderTarget1.dispose(),
  11397. this.renderTarget2.dispose(),
  11398. this.renderTarget1 = e,
  11399. this.renderTarget2 = e.clone(),
  11400. this.writeBuffer = this.renderTarget1,
  11401. this.readBuffer = this.renderTarget2
  11402. },
  11403. setSize: function(e, t) {
  11404. this.renderTarget1.setSize(e, t),
  11405. this.renderTarget2.setSize(e, t)
  11406. }
  11407. }
  11408. }
  11409. , {
  11410. three: 217
  11411. }],
  11412. 97: [function(e, t, i) {
  11413. "use strict";
  11414. var n = e("three");
  11415. n.MaskPass = function(e, t) {
  11416. this.scene = e,
  11417. this.camera = t,
  11418. this.enabled = !0,
  11419. this.clear = !0,
  11420. this.needsSwap = !1,
  11421. this.inverse = !1
  11422. }
  11423. ,
  11424. n.MaskPass.prototype = {
  11425. render: function(e, t, i, n) {
  11426. var r, o, a = e.context;
  11427. a.colorMask(!1, !1, !1, !1),
  11428. a.depthMask(!1),
  11429. o = this.inverse ? (r = 0,
  11430. 1) : (r = 1,
  11431. 0),
  11432. a.enable(a.STENCIL_TEST),
  11433. a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
  11434. a.stencilFunc(a.ALWAYS, r, 4294967295),
  11435. a.clearStencil(o),
  11436. e.render(this.scene, this.camera, i, this.clear),
  11437. e.render(this.scene, this.camera, t, this.clear),
  11438. a.colorMask(!0, !0, !0, !0),
  11439. a.depthMask(!0),
  11440. a.stencilFunc(a.EQUAL, 1, 4294967295),
  11441. a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
  11442. }
  11443. },
  11444. n.ClearMaskPass = function() {
  11445. this.enabled = !0
  11446. }
  11447. ,
  11448. n.ClearMaskPass.prototype = {
  11449. render: function(e, t, i, n) {
  11450. var r = e.context;
  11451. r.disable(r.STENCIL_TEST)
  11452. }
  11453. }
  11454. }
  11455. , {
  11456. three: 217
  11457. }],
  11458. 98: [function(e, t, i) {
  11459. "use strict";
  11460. var o = e("three");
  11461. o.RenderPass = function(e, t, i, n, r) {
  11462. this.scene = e,
  11463. this.camera = t,
  11464. this.overrideMaterial = i,
  11465. this.clearColor = n,
  11466. this.clearAlpha = void 0 !== r ? r : 1,
  11467. this.oldClearColor = new o.Color,
  11468. this.oldClearAlpha = 1,
  11469. this.enabled = !0,
  11470. this.clear = !0,
  11471. this.needsSwap = !1
  11472. }
  11473. ,
  11474. o.RenderPass.prototype = {
  11475. render: function(e, t, i, n) {
  11476. this.scene.overrideMaterial = this.overrideMaterial,
  11477. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11478. this.oldClearAlpha = e.getClearAlpha(),
  11479. e.setClearColor(this.clearColor, this.clearAlpha)),
  11480. e.render(this.scene, this.camera, i, this.clear),
  11481. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11482. this.scene.overrideMaterial = null
  11483. }
  11484. }
  11485. }
  11486. , {
  11487. three: 217
  11488. }],
  11489. 99: [function(e, t, i) {
  11490. "use strict";
  11491. var n = e("three");
  11492. n.ShaderPass = function(e, t) {
  11493. this.textureID = void 0 !== t ? t : "tDiffuse",
  11494. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11495. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11496. this.material = new n.ShaderMaterial({
  11497. defines: e.defines || {},
  11498. uniforms: this.uniforms,
  11499. vertexShader: e.vertexShader,
  11500. fragmentShader: e.fragmentShader
  11501. })),
  11502. this.renderToScreen = !1,
  11503. this.enabled = !0,
  11504. this.needsSwap = !0,
  11505. this.clear = !1,
  11506. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11507. this.scene = new n.Scene,
  11508. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11509. this.scene.add(this.quad)
  11510. }
  11511. ,
  11512. n.ShaderPass.prototype = {
  11513. render: function(e, t, i, n) {
  11514. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11515. this.quad.material = this.material,
  11516. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11517. }
  11518. }
  11519. }
  11520. , {
  11521. three: 217
  11522. }],
  11523. 100: [function(e, t, i) {
  11524. "use strict";
  11525. e("three").CopyShader = {
  11526. uniforms: {
  11527. tDiffuse: {
  11528. type: "t",
  11529. value: null
  11530. },
  11531. opacity: {
  11532. type: "f",
  11533. value: 1
  11534. }
  11535. },
  11536. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11537. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11538. }
  11539. }
  11540. , {
  11541. three: 217
  11542. }],
  11543. 101: [function(e, t, i) {
  11544. "use strict";
  11545. e("three").HorizontalBlurShader = {
  11546. uniforms: {
  11547. tDiffuse: {
  11548. type: "t",
  11549. value: null
  11550. },
  11551. h: {
  11552. type: "f",
  11553. value: 1 / 512
  11554. }
  11555. },
  11556. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11557. 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")
  11558. }
  11559. }
  11560. , {
  11561. three: 217
  11562. }],
  11563. 102: [function(e, t, i) {
  11564. "use strict";
  11565. e("three").VerticalBlurShader = {
  11566. uniforms: {
  11567. tDiffuse: {
  11568. type: "t",
  11569. value: null
  11570. },
  11571. v: {
  11572. type: "f",
  11573. value: 1 / 512
  11574. }
  11575. },
  11576. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11577. 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")
  11578. }
  11579. }
  11580. , {
  11581. three: 217
  11582. }],
  11583. 103: [function(e, t, i) {
  11584. "use strict";
  11585. var z = e("three");
  11586. !function() {
  11587. if ("performance"in window == 0 && (window.performance = {}),
  11588. "now"in window.performance == 0) {
  11589. var e = Date.now();
  11590. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11591. window.performance.now = function() {
  11592. return Date.now() - e
  11593. }
  11594. }
  11595. }(),
  11596. z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11597. var t, i = this.extensions, n = this.context;
  11598. if (e === z.RepeatWrapping)
  11599. return n.REPEAT;
  11600. if (e === z.ClampToEdgeWrapping)
  11601. return n.CLAMP_TO_EDGE;
  11602. if (e === z.MirroredRepeatWrapping)
  11603. return n.MIRRORED_REPEAT;
  11604. if (e === z.NearestFilter)
  11605. return n.NEAREST;
  11606. if (e === z.NearestMipMapNearestFilter)
  11607. return n.NEAREST_MIPMAP_NEAREST;
  11608. if (e === z.NearestMipMapLinearFilter)
  11609. return n.NEAREST_MIPMAP_LINEAR;
  11610. if (e === z.LinearFilter)
  11611. return n.LINEAR;
  11612. if (e === z.LinearMipMapNearestFilter)
  11613. return n.LINEAR_MIPMAP_NEAREST;
  11614. if (e === z.LinearMipMapLinearFilter)
  11615. return n.LINEAR_MIPMAP_LINEAR;
  11616. if (e === z.UnsignedByteType)
  11617. return n.UNSIGNED_BYTE;
  11618. if (e === z.UnsignedShort4444Type)
  11619. return n.UNSIGNED_SHORT_4_4_4_4;
  11620. if (e === z.UnsignedShort5551Type)
  11621. return n.UNSIGNED_SHORT_5_5_5_1;
  11622. if (e === z.UnsignedShort565Type)
  11623. return n.UNSIGNED_SHORT_5_6_5;
  11624. if (e === z.ByteType)
  11625. return n.BYTE;
  11626. if (e === z.ShortType)
  11627. return n.SHORT;
  11628. if (e === z.UnsignedShortType)
  11629. return n.UNSIGNED_SHORT;
  11630. if (e === z.IntType)
  11631. return n.INT;
  11632. if (e === z.UnsignedIntType)
  11633. return n.UNSIGNED_INT;
  11634. if (e === z.FloatType)
  11635. return n.FLOAT;
  11636. if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
  11637. return t.HALF_FLOAT_OES;
  11638. if (e === z.AlphaFormat)
  11639. return n.ALPHA;
  11640. if (e === z.RGBFormat)
  11641. return n.RGB;
  11642. if (e === z.RGBAFormat)
  11643. return n.RGBA;
  11644. if (e === z.LuminanceFormat)
  11645. return n.LUMINANCE;
  11646. if (e === z.LuminanceAlphaFormat)
  11647. return n.LUMINANCE_ALPHA;
  11648. if (e === z.AddEquation)
  11649. return n.FUNC_ADD;
  11650. if (e === z.SubtractEquation)
  11651. return n.FUNC_SUBTRACT;
  11652. if (e === z.ReverseSubtractEquation)
  11653. return n.FUNC_REVERSE_SUBTRACT;
  11654. if (e === z.ZeroFactor)
  11655. return n.ZERO;
  11656. if (e === z.OneFactor)
  11657. return n.ONE;
  11658. if (e === z.SrcColorFactor)
  11659. return n.SRC_COLOR;
  11660. if (e === z.OneMinusSrcColorFactor)
  11661. return n.ONE_MINUS_SRC_COLOR;
  11662. if (e === z.SrcAlphaFactor)
  11663. return n.SRC_ALPHA;
  11664. if (e === z.OneMinusSrcAlphaFactor)
  11665. return n.ONE_MINUS_SRC_ALPHA;
  11666. if (e === z.DstAlphaFactor)
  11667. return n.DST_ALPHA;
  11668. if (e === z.OneMinusDstAlphaFactor)
  11669. return n.ONE_MINUS_DST_ALPHA;
  11670. if (e === z.DstColorFactor)
  11671. return n.DST_COLOR;
  11672. if (e === z.OneMinusDstColorFactor)
  11673. return n.ONE_MINUS_DST_COLOR;
  11674. if (e === z.SrcAlphaSaturateFactor)
  11675. return n.SRC_ALPHA_SATURATE;
  11676. if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
  11677. if (e === z.RGB_S3TC_DXT1_Format)
  11678. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  11679. if (e === z.RGBA_S3TC_DXT1_Format)
  11680. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  11681. if (e === z.RGBA_S3TC_DXT3_Format)
  11682. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  11683. if (e === z.RGBA_S3TC_DXT5_Format)
  11684. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  11685. }
  11686. if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
  11687. if (e === z.RGB_PVRTC_4BPPV1_Format)
  11688. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  11689. if (e === z.RGB_PVRTC_2BPPV1_Format)
  11690. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  11691. if (e === z.RGBA_PVRTC_4BPPV1_Format)
  11692. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  11693. if (e === z.RGBA_PVRTC_2BPPV1_Format)
  11694. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  11695. }
  11696. if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
  11697. return t.COMPRESSED_RGB_ETC1_WEBGL;
  11698. if (null !== (t = i.get("EXT_blend_minmax"))) {
  11699. if (e === z.MinEquation)
  11700. return t.MIN_EXT;
  11701. if (e === z.MaxEquation)
  11702. return t.MAX_EXT
  11703. }
  11704. return 0
  11705. }
  11706. ,
  11707. z.WebGLState = function(l, i, c) {
  11708. var n = this
  11709. , r = new z.Vector4
  11710. , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
  11711. , o = new Uint8Array(e)
  11712. , a = new Uint8Array(e)
  11713. , s = new Uint8Array(e)
  11714. , t = {}
  11715. , h = null
  11716. , u = null
  11717. , d = null
  11718. , p = null
  11719. , f = null
  11720. , g = null
  11721. , m = null
  11722. , v = null
  11723. , y = !1
  11724. , A = null
  11725. , C = null
  11726. , I = null
  11727. , E = null
  11728. , _ = null
  11729. , b = null
  11730. , w = null
  11731. , T = null
  11732. , x = null
  11733. , S = null
  11734. , M = null
  11735. , R = null
  11736. , P = null
  11737. , O = null
  11738. , L = null
  11739. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  11740. , N = void 0
  11741. , F = {}
  11742. , B = new z.Vector4
  11743. , V = null
  11744. , k = null
  11745. , U = new z.Vector4
  11746. , H = new z.Vector4;
  11747. this.init = function() {
  11748. this.clearColor(0, 0, 0, 1),
  11749. this.clearDepth(1),
  11750. this.clearStencil(0),
  11751. this.enable(l.DEPTH_TEST),
  11752. l.depthFunc(l.LEQUAL),
  11753. l.frontFace(l.CCW),
  11754. l.cullFace(l.BACK),
  11755. this.enable(l.CULL_FACE),
  11756. this.enable(l.BLEND),
  11757. l.blendEquation(l.FUNC_ADD),
  11758. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  11759. }
  11760. ,
  11761. this.initAttributes = function() {
  11762. for (var e = 0, t = o.length; e < t; e++)
  11763. o[e] = 0
  11764. }
  11765. ,
  11766. this.enableAttribute = function(e) {
  11767. o[e] = 1,
  11768. 0 === a[e] && (l.enableVertexAttribArray(e),
  11769. a[e] = 1),
  11770. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  11771. s[e] = 0)
  11772. }
  11773. ,
  11774. this.enableAttributeAndDivisor = function(e, t, i) {
  11775. o[e] = 1,
  11776. 0 === a[e] && (l.enableVertexAttribArray(e),
  11777. a[e] = 1),
  11778. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  11779. s[e] = t)
  11780. }
  11781. ,
  11782. this.disableUnusedAttributes = function() {
  11783. for (var e = 0, t = a.length; e < t; e++)
  11784. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  11785. a[e] = 0)
  11786. }
  11787. ,
  11788. this.enable = function(e) {
  11789. !0 !== t[e] && (l.enable(e),
  11790. t[e] = !0)
  11791. }
  11792. ,
  11793. this.disable = function(e) {
  11794. !1 !== t[e] && (l.disable(e),
  11795. t[e] = !1)
  11796. }
  11797. ,
  11798. this.getCompressedTextureFormats = function() {
  11799. if (null === h && (h = [],
  11800. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  11801. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  11802. h.push(e[t]);
  11803. return h
  11804. }
  11805. ,
  11806. this.setBlending = function(e, t, i, n, r, o, a, s) {
  11807. e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  11808. e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11809. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  11810. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11811. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11812. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11813. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  11814. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11815. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  11816. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  11817. u = e,
  11818. y = s),
  11819. e === z.CustomBlending ? (r = r || t,
  11820. o = o || i,
  11821. a = a || n,
  11822. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  11823. d = t,
  11824. g = r),
  11825. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  11826. p = i,
  11827. f = n,
  11828. m = o,
  11829. v = a)) : v = m = g = f = p = d = null
  11830. }
  11831. ,
  11832. this.setDepthFunc = function(e) {
  11833. if (A !== e) {
  11834. if (e)
  11835. switch (e) {
  11836. case z.NeverDepth:
  11837. l.depthFunc(l.NEVER);
  11838. break;
  11839. case z.AlwaysDepth:
  11840. l.depthFunc(l.ALWAYS);
  11841. break;
  11842. case z.LessDepth:
  11843. l.depthFunc(l.LESS);
  11844. break;
  11845. case z.LessEqualDepth:
  11846. l.depthFunc(l.LEQUAL);
  11847. break;
  11848. case z.EqualDepth:
  11849. l.depthFunc(l.EQUAL);
  11850. break;
  11851. case z.GreaterEqualDepth:
  11852. l.depthFunc(l.GEQUAL);
  11853. break;
  11854. case z.GreaterDepth:
  11855. l.depthFunc(l.GREATER);
  11856. break;
  11857. case z.NotEqualDepth:
  11858. l.depthFunc(l.NOTEQUAL);
  11859. break;
  11860. default:
  11861. l.depthFunc(l.LEQUAL)
  11862. }
  11863. else
  11864. l.depthFunc(l.LEQUAL);
  11865. A = e
  11866. }
  11867. }
  11868. ,
  11869. this.setDepthTest = function(e) {
  11870. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  11871. }
  11872. ,
  11873. this.setDepthWrite = function(e) {
  11874. C !== e && (l.depthMask(e),
  11875. C = e)
  11876. }
  11877. ,
  11878. this.setColorWrite = function(e) {
  11879. I !== e && (l.colorMask(e, e, e, e),
  11880. I = e)
  11881. }
  11882. ,
  11883. this.setStencilFunc = function(e, t, i) {
  11884. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  11885. _ = e,
  11886. b = t,
  11887. w = i)
  11888. }
  11889. ,
  11890. this.setStencilOp = function(e, t, i) {
  11891. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  11892. T = e,
  11893. x = t,
  11894. S = i)
  11895. }
  11896. ,
  11897. this.setStencilTest = function(e) {
  11898. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  11899. }
  11900. ,
  11901. this.setStencilWrite = function(e) {
  11902. E !== e && (l.stencilMask(e),
  11903. E = e)
  11904. }
  11905. ,
  11906. this.setFlipSided = function(e) {
  11907. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  11908. M = e)
  11909. }
  11910. ,
  11911. this.setLineWidth = function(e) {
  11912. e !== R && (l.lineWidth(e),
  11913. R = e)
  11914. }
  11915. ,
  11916. this.setPolygonOffset = function(e, t, i) {
  11917. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  11918. !e || P === t && O === i || (l.polygonOffset(t, i),
  11919. P = t,
  11920. O = i)
  11921. }
  11922. ,
  11923. this.getScissorTest = function() {
  11924. return L
  11925. }
  11926. ,
  11927. this.setScissorTest = function(e) {
  11928. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  11929. }
  11930. ,
  11931. this.activeTexture = function(e) {
  11932. void 0 === e && (e = l.TEXTURE0 + D - 1),
  11933. N !== e && (l.activeTexture(e),
  11934. N = e)
  11935. }
  11936. ,
  11937. this.bindTexture = function(e, t) {
  11938. void 0 === N && n.activeTexture();
  11939. var i = F[N];
  11940. void 0 === i && (i = {
  11941. type: void 0,
  11942. texture: void 0
  11943. },
  11944. F[N] = i),
  11945. i.type === e && i.texture === t || (l.bindTexture(e, t),
  11946. i.type = e,
  11947. i.texture = t)
  11948. }
  11949. ,
  11950. this.compressedTexImage2D = function() {
  11951. try {
  11952. l.compressedTexImage2D.apply(l, arguments)
  11953. } catch (e) {
  11954. console.error(e)
  11955. }
  11956. }
  11957. ,
  11958. this.texImage2D = function() {
  11959. try {
  11960. l.texImage2D.apply(l, arguments)
  11961. } catch (e) {
  11962. console.error(e)
  11963. }
  11964. }
  11965. ,
  11966. this.clearColor = function(e, t, i, n) {
  11967. r.set(e, t, i, n),
  11968. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  11969. B.copy(r))
  11970. }
  11971. ,
  11972. this.clearDepth = function(e) {
  11973. V !== e && (l.clearDepth(e),
  11974. V = e)
  11975. }
  11976. ,
  11977. this.clearStencil = function(e) {
  11978. k !== e && (l.clearStencil(e),
  11979. k = e)
  11980. }
  11981. ,
  11982. this.scissor = function(e) {
  11983. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  11984. U.copy(e))
  11985. }
  11986. ,
  11987. this.viewport = function(e) {
  11988. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  11989. H.copy(e))
  11990. }
  11991. ,
  11992. this.reset = function() {
  11993. for (var e = 0; e < a.length; e++)
  11994. 1 === a[e] && (l.disableVertexAttribArray(e),
  11995. a[e] = 0);
  11996. t = {},
  11997. N = void 0,
  11998. F = {},
  11999. M = E = C = I = u = h = null
  12000. }
  12001. }
  12002. }
  12003. , {
  12004. three: 217
  12005. }],
  12006. 104: [function(a, h, e) {
  12007. (function(i, e) {
  12008. "use strict";
  12009. function t(e) {
  12010. this.urls = e;
  12011. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12012. this.builder = n.loadProto(t),
  12013. this.decoder = this.builder.build("binary_mesh")
  12014. }
  12015. var s = a("three")
  12016. , n = a("protobufjs")
  12017. , r = a("../util/logger")
  12018. , o = (a("../util/common"),
  12019. a("../util/ajax"))
  12020. , l = a("../objects/Chunk")
  12021. , c = new r(e);
  12022. t.prototype = {
  12023. constructor: t,
  12024. load: function(t, i, n, r) {
  12025. return c.time("download"),
  12026. o.get(t, {
  12027. responseType: "arraybuffer"
  12028. }).done(function(e) {
  12029. c.timeEnd("download"),
  12030. this.parse(e, t, i, n, r)
  12031. }
  12032. .bind(this)).fail(r)
  12033. },
  12034. parse: function(e, t, i, n, r) {
  12035. var o = this.readProtobuf(e);
  12036. if (!o)
  12037. return r();
  12038. try {
  12039. c.time("convert to webgl"),
  12040. this.convertProtobufToSceneObject(o, t, i, n, r),
  12041. c.timeEnd("convert to webgl")
  12042. } catch (e) {
  12043. return c.error("failed parsing .dam"),
  12044. c.error(e.message),
  12045. r()
  12046. }
  12047. },
  12048. readProtobuf: function(e) {
  12049. var t;
  12050. try {
  12051. c.time("parse proto"),
  12052. t = this.decoder.decode(e),
  12053. c.timeEnd("parse proto")
  12054. } catch (e) {
  12055. return c.error("failed parsing proto for .dam"),
  12056. c.error(e.message),
  12057. null
  12058. }
  12059. return t
  12060. },
  12061. convertProtobufToSceneObject: function(e, i, t, n, r) {
  12062. if (0 === e.chunk.length)
  12063. return c.warn("No chunks in damfile..."),
  12064. t([]);
  12065. var o = new s.Matrix4;
  12066. o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12067. var a = e.chunk.map(function(e) {
  12068. var t = new s.BufferGeometry;
  12069. return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12070. 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12071. t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12072. t.applyMatrix(o),
  12073. t.computeBoundingBox(),
  12074. new l({
  12075. geometry: t,
  12076. textureName: e.material_name,
  12077. name: e.chunk_name,
  12078. meshUrl: i
  12079. })
  12080. });
  12081. return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
  12082. r())
  12083. }
  12084. },
  12085. h.exports = t
  12086. }
  12087. ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
  12088. }
  12089. , {
  12090. "../objects/Chunk": 144,
  12091. "../util/ajax": 181,
  12092. "../util/common": 185,
  12093. "../util/logger": 189,
  12094. buffer: 198,
  12095. protobufjs: 214,
  12096. three: 217
  12097. }],
  12098. 105: [function(n, r, e) {
  12099. (function(e) {
  12100. "use strict";
  12101. var t = (n("three"),
  12102. n("../settings"),
  12103. n("../util/browser"),
  12104. n("./DamLoader"))
  12105. , i = n("../util/logger")
  12106. , u = (n("../ab"),
  12107. new i(e));
  12108. r.exports = {
  12109. getLoaders: function() {
  12110. return [["_50k", ".dam", t], ["", ".dam", t]]
  12111. },
  12112. load: function(e, t, i, n, r, o) {
  12113. var a = this.getLoaders()[o = o || 0];
  12114. if (a) {
  12115. var s = a[0]
  12116. , l = a[1]
  12117. , c = new a[2](t)
  12118. , h = t.get(e + s + l);
  12119. h ? (u.debug("Trying " + s + l),
  12120. c.load(h, i, n, function() {
  12121. this.load(e, t, i, n, r, ++o)
  12122. }
  12123. .bind(this))) : (u.debug("Skipping " + l + ", not available"),
  12124. this.load(e, t, i, n, r, ++o))
  12125. } else
  12126. r && r("No suitable model file found...")
  12127. }
  12128. }
  12129. }
  12130. ).call(this, "/js/loaders/ModelLoader.js")
  12131. }
  12132. , {
  12133. "../ab": 3,
  12134. "../settings": 166,
  12135. "../util/browser": 182,
  12136. "../util/logger": 189,
  12137. "./DamLoader": 104,
  12138. three: 217
  12139. }],
  12140. 106: [function(i, n, e) {
  12141. (function(e) {
  12142. "use strict";
  12143. var l = i("../util/common")
  12144. , c = i("../util/texture")
  12145. , h = i("../util/browser")
  12146. , t = i("../util/logger")
  12147. , u = i("../settings")
  12148. , d = new t(e);
  12149. n.exports = {
  12150. load: function(i, n) {
  12151. if (!i.chunks[0] || !i.chunks[0].meshUrl)
  12152. return $.when();
  12153. var r = l.countUnique(i.chunks.map(function(e) {
  12154. return e.textureName
  12155. }))
  12156. , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
  12157. , t = "_50k" == e ? "high" : "low";
  12158. u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12159. t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
  12160. t = "low"));
  12161. var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
  12162. , a = $.Deferred()
  12163. , s = 0;
  12164. return i.chunks.forEach(function(e) {
  12165. if (!e.material.map && e.textureName) {
  12166. var t = i.urls.get(o + e.textureName);
  12167. e.setTextureMap(c.load(t, function(e, t) {
  12168. e || (n.push(t),
  12169. s++,
  12170. a.notify(s, r),
  12171. s === r && a.resolve())
  12172. }
  12173. .bind(this, c.isLoaded(t))))
  12174. }
  12175. }),
  12176. a.promise()
  12177. }
  12178. }
  12179. }
  12180. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12181. }
  12182. , {
  12183. "../settings": 166,
  12184. "../util/browser": 182,
  12185. "../util/common": 185,
  12186. "../util/logger": 189,
  12187. "../util/texture": 194
  12188. }],
  12189. 107: [function(s, l, e) {
  12190. (function(n, e) {
  12191. "use strict";
  12192. function t(e) {
  12193. this.model = e,
  12194. this.modelDataPath = this.model.urls.get("vision.modeldata"),
  12195. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12196. var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12197. , i = r.loadProto(t);
  12198. this.decoder = i.build("VisionModeldata")
  12199. }
  12200. var r = s("protobufjs")
  12201. , i = s("../util/ajax")
  12202. , o = (s("../util/common"),
  12203. s("../util/math"))
  12204. , a = new (s("../util/logger"))(e);
  12205. t.prototype.load = function() {
  12206. return this.modelDataPath ? (a.info("Using vision.modeldata"),
  12207. this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
  12208. this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
  12209. $.when([]))
  12210. }
  12211. ,
  12212. t.prototype.loadVisionModelData = function() {
  12213. return i.get(this.modelDataPath, {
  12214. responseType: "arraybuffer"
  12215. }).then(function(e) {
  12216. var t;
  12217. try {
  12218. t = this.decoder.decode(e)
  12219. } catch (e) {
  12220. return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12221. this.loadSweepLocationsCSV()
  12222. }
  12223. var i = t.sweepLocations.map(function(e) {
  12224. return {
  12225. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12226. position: {
  12227. x: e.pose.translation.x,
  12228. y: e.pose.translation.y,
  12229. z: e.pose.translation.z
  12230. },
  12231. quaternion: {
  12232. x: e.pose.rotation.x,
  12233. y: e.pose.rotation.y,
  12234. z: e.pose.rotation.z,
  12235. w: e.pose.rotation.w
  12236. },
  12237. puck: {
  12238. x: e.puck.x,
  12239. y: e.puck.y,
  12240. z: e.puck.z
  12241. },
  12242. floor: e.group,
  12243. neighbours: e.visibles,
  12244. alignmentType: e.alignment_type
  12245. }
  12246. }).map(function(e) {
  12247. return e.position = o.convertVisionVector(e.position),
  12248. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12249. e.puck = o.convertVisionVector(e.puck),
  12250. e
  12251. });
  12252. return i.forEach(function(e) {
  12253. e.neighbours = e.neighbours.map(function(e) {
  12254. return i[e].uuid
  12255. })
  12256. }),
  12257. i
  12258. }
  12259. .bind(this), function() {
  12260. return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12261. this.loadSweepLocationsCSV()
  12262. }
  12263. .bind(this))
  12264. }
  12265. ,
  12266. t.prototype.loadSweepLocationsCSV = function() {
  12267. return i.get(this.sweepLocationsPath).then(function(e) {
  12268. return e.split("\n").map(function(e) {
  12269. return e.split(", ")
  12270. }).filter(function(e) {
  12271. return 1 < e.length
  12272. }).map(function(e) {
  12273. return {
  12274. uuid: e[0],
  12275. position: {
  12276. x: parseFloat(e[1]),
  12277. y: parseFloat(e[2]),
  12278. z: parseFloat(e[3])
  12279. },
  12280. quaternion: {
  12281. x: parseFloat(e[4]),
  12282. y: parseFloat(e[5]),
  12283. z: parseFloat(e[6]),
  12284. w: parseFloat(e[7])
  12285. }
  12286. }
  12287. }).map(function(e) {
  12288. return e.position = o.convertVisionVector(e.position),
  12289. e.quaternion = o.convertVisionQuaternion(e.quaternion),
  12290. e
  12291. })
  12292. }).fail(function() {
  12293. a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12294. })
  12295. }
  12296. ,
  12297. l.exports = t
  12298. }
  12299. ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12300. }
  12301. , {
  12302. "../util/ajax": 181,
  12303. "../util/common": 185,
  12304. "../util/logger": 189,
  12305. "../util/math": 190,
  12306. buffer: 198,
  12307. protobufjs: 214
  12308. }],
  12309. 108: [function(s, l, e) {
  12310. (function(e) {
  12311. "use strict";
  12312. function t() {
  12313. this.locale = null
  12314. }
  12315. var i = s("../settings")
  12316. , n = s("../util/common")
  12317. , r = s("../util/logger")
  12318. , o = s("../enum/Locale")
  12319. , a = new r(e);
  12320. t.prototype.init = function() {
  12321. var e;
  12322. switch (i.languageTag) {
  12323. case null:
  12324. case "en":
  12325. case o.EN_US:
  12326. this.locale = o.EN_US,
  12327. e = s("./strings-en-US");
  12328. break;
  12329. case "es":
  12330. case o.ES_MX:
  12331. this.locale = o.ES_MX,
  12332. e = s("./strings-es-MX");
  12333. break;
  12334. case "fr":
  12335. case o.FR_FR:
  12336. this.locale = o.FR_FR,
  12337. e = s("./strings-fr-FR");
  12338. break;
  12339. case "de":
  12340. case o.DE_DE:
  12341. this.locale = o.DE_DE,
  12342. e = s("./strings-de-DE");
  12343. break;
  12344. case "ru":
  12345. case o.RU_RU:
  12346. this.locale = o.RU_RU,
  12347. e = s("./strings-ru-RU");
  12348. break;
  12349. case "cn":
  12350. case o.CN_CN:
  12351. this.locale = o.CN_CN,
  12352. e = s("./strings-cn-CN");
  12353. break;
  12354. case "jp":
  12355. case o.JP_JP:
  12356. this.locale = o.JP_JP,
  12357. e = s("./strings-jp-JP");
  12358. break;
  12359. default:
  12360. a.info("Unsupported language tag, defaulting to 'en-US'"),
  12361. this.locale = o.EN_US,
  12362. e = s("./strings-en-US")
  12363. }
  12364. a.info("Using locale '" + this.locale + "'"),
  12365. n.extendObject(this, e)
  12366. }
  12367. ,
  12368. t.prototype.localizeGUI = function() {
  12369. var e = document.querySelector("#gui-parent");
  12370. this.localizeTree(e),
  12371. this.localizeLoadingText()
  12372. }
  12373. ,
  12374. t.prototype.localizeLoadingText = function() {
  12375. document.querySelector("#help-dialog").classList.add(this.locale),
  12376. document.querySelector("#interaction-modal").classList.add(this.locale),
  12377. document.querySelector("#gui").classList.add(this.locale)
  12378. }
  12379. ,
  12380. t.prototype.localizeTree = function(e) {
  12381. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12382. if (e.nodeType === Node.TEXT_NODE)
  12383. (t = e.data.match(n)) && (i = t[1],
  12384. e.data = this.localizeText(i) || i);
  12385. else if (e.nodeType === Node.ELEMENT_NODE) {
  12386. var r = e.getAttribute("title");
  12387. r && ((t = r.match(n)) && (i = t[1],
  12388. e.setAttribute("title", this.localizeText(i) || i)))
  12389. }
  12390. for (e = e.firstChild; e; )
  12391. this.localizeTree(e),
  12392. e = e.nextSibling
  12393. }
  12394. ,
  12395. t.prototype.localizeText = function(e) {
  12396. var t = this[e];
  12397. return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
  12398. t = s("./strings-en-US")[e]),
  12399. t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
  12400. t
  12401. }
  12402. ,
  12403. l.exports = new t
  12404. }
  12405. ).call(this, "/js/localization/localize.js")
  12406. }
  12407. , {
  12408. "../enum/Locale": 31,
  12409. "../settings": 166,
  12410. "../util/common": 185,
  12411. "../util/logger": 189,
  12412. "./strings-cn-CN": 109,
  12413. "./strings-de-DE": 110,
  12414. "./strings-en-US": 111,
  12415. "./strings-es-MX": 112,
  12416. "./strings-fr-FR": 113,
  12417. "./strings-jp-JP": 114,
  12418. "./strings-ru-RU": 115
  12419. }],
  12420. 109: [function(e, t, i) {
  12421. "use strict";
  12422. t.exports = {
  12423. PAGE_TITLE: "",
  12424. LOADING: "正在加载",
  12425. PRESENTED_BY_CAPS: "呈现者:",
  12426. POWERED_BY: "技术支持:",
  12427. POWERED_BY_CAPS: "技术支持:",
  12428. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12429. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12430. PRESENTED_BY: "呈现者:",
  12431. MORE: "更多 ",
  12432. LESS: "更少 ",
  12433. TAG_CONTENT: "tag™ 内容",
  12434. SHOW: "显示",
  12435. HIDE: "隐藏",
  12436. DOLLHOUSE: "场景屋",
  12437. FLOOR_PLAN: "楼层平面图",
  12438. OPEN_HIGHLIGHTS: "打开精彩片段",
  12439. CLOSE_HIGHLIGHTS: "关闭",
  12440. PREVIOUS: "上一个",
  12441. PLAY: "播放",
  12442. PAUSE: "暂停",
  12443. NEXT: "下一个",
  12444. EXPLORE_3D_SPACE: "探索 3D 空间",
  12445. VIEW_DOLLHOUSE: "观看场景屋",
  12446. SOCIAL_SHARING: "分享这个空间",
  12447. VIEW_IN_VR: "以 VR 观看",
  12448. VIEW_FULLSCREEN: "全屏观看",
  12449. EXIT_FULLSCREEN: " 退出全屏",
  12450. ZOOM_IN: "放大",
  12451. ZOOM_OUT: "缩小",
  12452. FLOOR_NAME: "楼层",
  12453. FLOOR_ALL: "ALL",
  12454. FLOOR_Lang: ["Floor", ""],
  12455. TERMS: "条款",
  12456. PORT_TERMS: "port 条款",
  12457. TERMS_OF_USE: "使用条款",
  12458. CLOSE_TERMS: "关闭",
  12459. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12460. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12461. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12462. WEBVR_ENTER_WEBVR: "进入 VR",
  12463. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12464. WEBVR_LEARN_MORE: "了解更多",
  12465. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12466. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12467. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12468. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12469. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12470. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12471. VR_LEARN_MORE_CAPS: "了解更多",
  12472. VR_PREVIOUS_CAPS: "上一个’,",
  12473. VR_NEXT_CAPS: "下一个",
  12474. VR_GOT_IT_CAPS: "明白了",
  12475. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12476. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12477. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12478. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12479. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12480. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12481. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12482. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12483. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12484. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12485. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12486. VR_APP: "port VR 应用程序",
  12487. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12488. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12489. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12490. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12491. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12492. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12493. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12494. VR_ANDROID_DVICES: "Android 设备",
  12495. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12496. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12497. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12498. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12499. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12500. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12501. VR_DOWNLOAD_HERE: "在此下载",
  12502. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12503. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12504. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12505. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12506. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12507. SHARE_TO: "分享到",
  12508. SHARE_LINK: "直接链接",
  12509. SHARE_EXPLORE: "探索",
  12510. SHARE_AT: "在",
  12511. SHARE_WITH: "使用",
  12512. SHARE_3D: "以 3D",
  12513. SHARE_COPIED: "已复制!",
  12514. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12515. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12516. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12517. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12518. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12519. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12520. ERROR_GENERIC_ACTIONS_3: " 或",
  12521. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12522. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12523. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12524. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12525. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12526. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12527. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12528. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12529. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12530. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12531. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12532. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12533. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12534. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12535. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12536. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12537. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12538. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12539. LINK_TO_LOCATION: "地点链接",
  12540. MENU_COPY: "复制",
  12541. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12542. ROTATE: "旋转",
  12543. MOVE: "移动",
  12544. INSIDE: "内部",
  12545. ZOOM: "缩放",
  12546. HELP: "小帮手",
  12547. HELP_NAVIGATION_TAB: "导航",
  12548. HELP_MORE_HELP_TAB: "更多帮助",
  12549. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12550. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12551. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12552. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12553. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12554. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12555. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12556. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12557. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12558. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12559. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12560. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12561. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12562. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12563. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12564. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12565. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12566. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12567. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12568. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12569. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12570. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12571. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12572. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12573. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12574. HELP_MORE_HLR_A: "精彩片段集锦",
  12575. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12576. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12577. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12578. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12579. HELP_MORE_FLOORS_A: "楼层选择器",
  12580. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12581. HELP_MORE_TAG_A: "tag™ 贴文",
  12582. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12583. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12584. HELP_MORE_ZOOM_A: "缩放控件",
  12585. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12586. HELP_MORE_TOUR_A: "导览控件",
  12587. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12588. HELP_MORE_INSIDE_A: "内部视图",
  12589. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12590. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12591. HELP_MORE_VR_A: "VR 模式",
  12592. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12593. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12594. HELP_MORE_360_A: "360° 视图",
  12595. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12596. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12597. HELP_MORE_FULLSCREEN_A: "全屏",
  12598. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12599. CLOSE: "关闭"
  12600. }
  12601. }
  12602. , {}],
  12603. 110: [function(e, t, i) {
  12604. "use strict";
  12605. t.exports = {
  12606. PAGE_TITLE: "",
  12607. LOADING: "Lädt",
  12608. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12609. POWERED_BY: "Angetrieben von",
  12610. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12611. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12612. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12613. PRESENTED_BY: "Präsentiert von ",
  12614. MORE: "Mehr ",
  12615. LESS: "Weniger ",
  12616. TAG_CONTENT: "tag™ Inhalt",
  12617. SHOW: "Anzeigen",
  12618. HIDE: "Verbergen",
  12619. DOLLHOUSE: "Puppenhaus",
  12620. FLOOR_PLAN: "Grundriss",
  12621. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12622. CLOSE_HIGHLIGHTS: "Schließen",
  12623. PREVIOUS: "Vorheriges",
  12624. PLAY: "Abspielen",
  12625. PAUSE: "Pausieren",
  12626. NEXT: "Nächstes",
  12627. EXPLORE_3D_SPACE: "Innenraum betreten",
  12628. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12629. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12630. VIEW_IN_VR: "In VR ansehen",
  12631. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12632. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12633. ZOOM_IN: "Vergrößern",
  12634. ZOOM_OUT: "Verkleinern",
  12635. FLOOR_NAME: "Etage ",
  12636. FLOOR_ALL: "Alle",
  12637. TERMS: "Bedingungen",
  12638. PORT_TERMS: "port Bedingungen",
  12639. TERMS_OF_USE: "Nutzungsbedingungen",
  12640. TERMS_TEXT_FILE: "terms-de-DE.html",
  12641. CLOSE_TERMS: "Schließen",
  12642. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12643. HELP: "Hilfe",
  12644. HELP_NAVIGATION_TAB: "Navigation",
  12645. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12646. CLOSE: "Schließen",
  12647. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  12648. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  12649. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12650. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  12651. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  12652. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  12653. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  12654. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  12655. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  12656. 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.",
  12657. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12658. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  12659. 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.",
  12660. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  12661. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  12662. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  12663. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  12664. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  12665. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  12666. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  12667. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  12668. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  12669. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  12670. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  12671. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  12672. HELP_MORE_HLR_A: "Liste das Highlight",
  12673. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  12674. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  12675. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12676. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  12677. HELP_MORE_FLOORS_A: "Etage auswählen",
  12678. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  12679. HELP_MORE_TAG_A: "tag™ Posts",
  12680. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  12681. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  12682. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  12683. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  12684. HELP_MORE_TOUR_A: "Tour Steuerung",
  12685. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  12686. HELP_MORE_INSIDE_A: "Innenansicht",
  12687. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  12688. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  12689. HELP_MORE_VR_A: "VR Modus",
  12690. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  12691. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  12692. HELP_MORE_360_A: "360° Views Ansicht ",
  12693. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12694. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  12695. HELP_MORE_FULLSCREEN_A: "Vollbild",
  12696. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  12697. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  12698. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  12699. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  12700. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  12701. WEBVR_LEARN_MORE: "Mehr Infos",
  12702. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12703. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12704. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12705. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  12706. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  12707. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  12708. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12709. VR_APP: "port VR App",
  12710. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  12711. 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",
  12712. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  12713. VR_APP_FOR_ANDROID: "port VR app für Android",
  12714. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  12715. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  12716. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  12717. VR_PREVIOUS_CAPS: "ZURÜCK",
  12718. VR_NEXT_CAPS: "WEITER",
  12719. VR_GOT_IT_CAPS: "VERSTANDEN",
  12720. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  12721. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  12722. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  12723. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  12724. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  12725. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  12726. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12727. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12728. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12729. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  12730. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  12731. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  12732. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  12733. VR_ANDROID_DVICES: "Android Geräte",
  12734. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  12735. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  12736. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  12737. VR_DOWNLOAD_HERE: "Hier runterladen",
  12738. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  12739. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  12740. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  12741. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  12742. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  12743. SHARE_TO: "Teilen auf",
  12744. SHARE_LINK: "Direkter Link",
  12745. SHARE_EXPLORE: "Umsehen",
  12746. SHARE_AT: "auf",
  12747. SHARE_WITH: "mit",
  12748. SHARE_3D: "in 3D",
  12749. SHARE_COPIED: "Kopiert!",
  12750. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  12751. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  12752. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  12753. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  12754. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12755. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  12756. ERROR_GENERIC_ACTIONS_3: " oder ",
  12757. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12758. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  12759. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  12760. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  12761. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  12762. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  12763. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  12764. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  12765. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  12766. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  12767. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  12768. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  12769. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  12770. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  12771. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  12772. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  12773. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  12774. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  12775. LINK_TO_LOCATION: "Link zu",
  12776. MENU_COPY: "Kopieren",
  12777. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  12778. ROTATE: "Drehen",
  12779. INSIDE: "Drinnen",
  12780. MOVE: "Bewegen",
  12781. ZOOM: "Vergrößern"
  12782. }
  12783. }
  12784. , {}],
  12785. 111: [function(e, t, i) {
  12786. "use strict";
  12787. t.exports = {
  12788. PAGE_TITLE: "",
  12789. LOADING: "Loading",
  12790. PRESENTED_BY_CAPS: "PRESENTED BY",
  12791. POWERED_BY: "powered by ",
  12792. POWERED_BY_CAPS: "POWERED BY",
  12793. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  12794. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  12795. PRESENTED_BY: "Presented by ",
  12796. MORE: "More ",
  12797. LESS: "Less ",
  12798. TAG_CONTENT: "tag™ Content",
  12799. SHOW: "Show",
  12800. HIDE: "Hide",
  12801. DOLLHOUSE: "Dollhouse",
  12802. FLOOR_PLAN: "Floor plan",
  12803. OPEN_HIGHLIGHTS: "Open Highlights",
  12804. CLOSE_HIGHLIGHTS: "Close",
  12805. PREVIOUS: "Previous",
  12806. PLAY: "Play",
  12807. PAUSE: "Pause",
  12808. NEXT: "Next",
  12809. EXPLORE_3D_SPACE: "Explore 3D Space",
  12810. VIEW_DOLLHOUSE: "View dollhouse",
  12811. SOCIAL_SHARING: "Share this Space",
  12812. VIEW_IN_VR: "View in VR",
  12813. VIEW_FULLSCREEN: "全屏",
  12814. EXIT_FULLSCREEN: "退出全屏",
  12815. ZOOM_IN: "Zoom in",
  12816. ZOOM_OUT: "Zoom out",
  12817. FLOOR_NAME: "Floor ",
  12818. FLOOR_ALL: "全部",
  12819. TERMS: "Terms",
  12820. PORT_TERMS: "port terms",
  12821. TERMS_OF_USE: "Terms of Use",
  12822. TERMS_TEXT_FILE: "terms-en-US.html",
  12823. CLOSE_TERMS: "Close",
  12824. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  12825. HELP: "Help",
  12826. HELP_NAVIGATION_TAB: "Navigation",
  12827. HELP_MORE_HELP_TAB: "More Help",
  12828. CLOSE: "Close",
  12829. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  12830. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  12831. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  12832. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  12833. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  12834. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  12835. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  12836. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  12837. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  12838. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  12839. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  12840. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  12841. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  12842. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  12843. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  12844. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  12845. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  12846. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  12847. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  12848. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  12849. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  12850. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  12851. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  12852. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  12853. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  12854. HELP_MORE_HLR_A: "Highlight Reel",
  12855. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  12856. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  12857. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  12858. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  12859. HELP_MORE_FLOORS_A: "Floor Selector",
  12860. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  12861. HELP_MORE_TAG_A: "tag™ Posts",
  12862. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  12863. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  12864. HELP_MORE_ZOOM_A: "Zoom Controls",
  12865. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  12866. HELP_MORE_TOUR_A: "Tour Controls",
  12867. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  12868. HELP_MORE_INSIDE_A: "Inside View",
  12869. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  12870. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  12871. HELP_MORE_VR_A: "VR Mode",
  12872. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  12873. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  12874. HELP_MORE_360_A: "360° Views",
  12875. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  12876. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  12877. HELP_MORE_FULLSCREEN_A: "Full screen",
  12878. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  12879. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  12880. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  12881. WEBVR_FOR_DAYDREAM: "For Daydream View",
  12882. WEBVR_ENTER_WEBVR: "ENTER VR",
  12883. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  12884. WEBVR_LEARN_MORE: "Learn more",
  12885. WEBVR_VIEW_SPACE: "View Space in VR",
  12886. WEBVR_DAYDREAM_VIEW: "Daydream View",
  12887. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  12888. VR_VIEW_SPACE: "View Space in Virtual Reality",
  12889. VR_LEARN_MORE_CAPS: "LEARN MORE",
  12890. VR_PREVIOUS_CAPS: "PREVIOUS",
  12891. VR_NEXT_CAPS: "NEXT",
  12892. VR_GOT_IT_CAPS: "GOT IT",
  12893. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  12894. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  12895. VR_SHOW_IOS_1: "Tap to view the space in VR",
  12896. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  12897. VR_WHAT_YOU_NEED: "What You'll Need For...",
  12898. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  12899. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  12900. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  12901. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  12902. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12903. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12904. VR_APP: "port VR App",
  12905. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12906. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12907. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  12908. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  12909. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  12910. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  12911. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  12912. VR_ANDROID_DVICES: "Android Devices",
  12913. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  12914. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  12915. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  12916. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  12917. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  12918. VR_APP_OPEN: "Open with the port VR app instead",
  12919. VR_DOWNLOAD_HERE: "Download here",
  12920. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  12921. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  12922. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  12923. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  12924. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  12925. SHARE_TO: "Share to",
  12926. SHARE_LINK: "Direct Link",
  12927. SHARE_EXPLORE: "Explore ",
  12928. SHARE_AT: "at",
  12929. SHARE_WITH: "with",
  12930. SHARE_3D: " in 3D",
  12931. SHARE_COPIED: "Copied!",
  12932. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  12933. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  12934. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  12935. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  12936. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  12937. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  12938. ERROR_GENERIC_ACTIONS_3: " or ",
  12939. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  12940. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  12941. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  12942. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  12943. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  12944. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  12945. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  12946. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  12947. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  12948. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  12949. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  12950. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  12951. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  12952. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  12953. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  12954. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  12955. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  12956. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  12957. LINK_TO_LOCATION: "Link to location",
  12958. MENU_COPY: "Copy",
  12959. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  12960. ROTATE: "Rotate",
  12961. INSIDE: "Inside",
  12962. MOVE: "Move",
  12963. ZOOM: "Zoom"
  12964. }
  12965. }
  12966. , {}],
  12967. 112: [function(e, t, i) {
  12968. "use strict";
  12969. t.exports = {
  12970. PAGE_TITLE: "",
  12971. LOADING: "Cargando",
  12972. PRESENTED_BY_CAPS: "PRESENTADO POR",
  12973. POWERED_BY: "potenciando por ",
  12974. POWERED_BY_CAPS: "POTENCIADO POR ",
  12975. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  12976. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  12977. PRESENTED_BY: "Presentado por ",
  12978. MORE: "Más ",
  12979. LESS: "Menos ",
  12980. TAG_CONTENT: "Contenido de tag™",
  12981. SHOW: "Mostrar",
  12982. HIDE: "Ocultar",
  12983. DOLLHOUSE: "Dollhouse",
  12984. FLOOR_PLAN: "Planos",
  12985. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  12986. CLOSE_HIGHLIGHTS: "Cerrar",
  12987. PREVIOUS: "Anterior",
  12988. PLAY: "Play",
  12989. PAUSE: "Pausa",
  12990. NEXT: "Siguiente",
  12991. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  12992. VIEW_DOLLHOUSE: "Ver dollhouse",
  12993. SOCIAL_SHARING: "Compartir este espacio",
  12994. VIEW_IN_VR: "Ver en realidad virtual",
  12995. VIEW_FULLSCREEN: "Ver en pantalla completa",
  12996. EXIT_FULLSCREEN: "Salir de pantalla completa",
  12997. ZOOM_IN: "Acercar",
  12998. ZOOM_OUT: "Alejar",
  12999. FLOOR_NAME: "Piso ",
  13000. FLOOR_ALL: "Todas",
  13001. TERMS: "Condiciones",
  13002. PORT_TERMS: "port términos de uso",
  13003. TERMS_OF_USE: "Términos de uso",
  13004. TERMS_TEXT_FILE: "terms-es-MX.html",
  13005. CLOSE_TERMS: "Cerrar",
  13006. 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.",
  13007. HELP: "Ayuda",
  13008. HELP_NAVIGATION_TAB: "Navegación",
  13009. HELP_MORE_HELP_TAB: "Más Ayuda",
  13010. CLOSE: "Cerrar",
  13011. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13012. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13013. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13014. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13015. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13016. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13017. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13018. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13019. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13020. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13021. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13022. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13023. 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.",
  13024. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13025. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13026. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13027. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13028. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13029. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13030. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13031. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13032. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13033. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13034. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13035. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13036. HELP_MORE_HLR_A: "Galería destacada",
  13037. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13038. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13039. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13040. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13041. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13042. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13043. HELP_MORE_TAG_A: "tag™ Posts",
  13044. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13045. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13046. HELP_MORE_ZOOM_A: "Controles de zoom",
  13047. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13048. HELP_MORE_TOUR_A: "Controles de recorrido",
  13049. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13050. HELP_MORE_INSIDE_A: "Vista interior",
  13051. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13052. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13053. HELP_MORE_VR_A: "Modo de realidad virtual",
  13054. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13055. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13056. HELP_MORE_360_A: "360° Views",
  13057. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13058. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13059. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13060. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13061. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13062. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13063. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13064. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13065. WEBVR_LEARN_MORE: "Más información",
  13066. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13067. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13068. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13069. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13070. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13071. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13072. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13073. VR_APP: "port VR App",
  13074. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13075. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13076. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13077. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13078. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13079. VR_PREVIOUS_CAPS: "ANTERIOR",
  13080. VR_NEXT_CAPS: "SIGUIENTE",
  13081. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13082. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13083. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13084. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13085. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13086. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13087. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13088. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13089. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13090. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13091. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13092. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13093. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13094. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13095. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13096. VR_ANDROID_DVICES: "Dispositivos Android",
  13097. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13098. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13099. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13100. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13101. VR_DOWNLOAD_HERE: "Descargar aquí",
  13102. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13103. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13104. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13105. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13106. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13107. SHARE_TO: "Compartir en",
  13108. SHARE_LINK: "Enlace directo",
  13109. SHARE_EXPLORE: "Explorar ",
  13110. SHARE_AT: "en",
  13111. SHARE_WITH: "con",
  13112. SHARE_3D: " en 3D",
  13113. SHARE_COPIED: "¡Copiado!",
  13114. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13115. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13116. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13117. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13118. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13119. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13120. ERROR_GENERIC_ACTIONS_3: " o ",
  13121. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13122. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13123. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13124. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13125. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13126. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13127. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13128. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13129. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13130. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13131. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13132. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13133. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13134. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13135. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13136. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13137. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13138. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13139. LINK_TO_LOCATION: "Enlace a la ubicación",
  13140. MENU_COPY: "Copiar",
  13141. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13142. ROTATE: "Girar",
  13143. INSIDE: "Interior",
  13144. MOVE: "Moverse",
  13145. ZOOM: "Acercar o alejar"
  13146. }
  13147. }
  13148. , {}],
  13149. 113: [function(e, t, i) {
  13150. "use strict";
  13151. t.exports = {
  13152. PAGE_TITLE: "",
  13153. LOADING: "Chargement",
  13154. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13155. POWERED_BY: "alimenté par ",
  13156. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13157. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13158. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13159. PRESENTED_BY: "Présenté par ",
  13160. MORE: "Plus ",
  13161. LESS: "Moins ",
  13162. TAG_CONTENT: "Contenu tag™",
  13163. SHOW: "Montrer",
  13164. HIDE: "Cacher",
  13165. DOLLHOUSE: "Dollhouse",
  13166. FLOOR_PLAN: "Plan de sol",
  13167. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13168. CLOSE_HIGHLIGHTS: "Fermer",
  13169. PREVIOUS: "Précédent",
  13170. PLAY: "Lecture",
  13171. PAUSE: "Pause",
  13172. NEXT: "Suivant",
  13173. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13174. VIEW_DOLLHOUSE: "Voir dollhouse",
  13175. SOCIAL_SHARING: "Partager cet espace",
  13176. VIEW_IN_VR: "Voir en VR",
  13177. VIEW_FULLSCREEN: "Plein écran",
  13178. EXIT_FULLSCREEN: "Fermer plein écran",
  13179. ZOOM_IN: "Zoom avant",
  13180. ZOOM_OUT: "Zoom arrière",
  13181. FLOOR_NAME: "Étage ",
  13182. FLOOR_ALL: "Tous",
  13183. TERMS: "Mentions légales",
  13184. PORT_TERMS: "port mentions légales",
  13185. TERMS_OF_USE: "Conditions d'utilisation",
  13186. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13187. CLOSE_TERMS: "Fermer",
  13188. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13189. HELP: "Aide",
  13190. HELP_NAVIGATION_TAB: "Navigation",
  13191. HELP_MORE_HELP_TAB: "Aide",
  13192. CLOSE: "Fermer",
  13193. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13194. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13195. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13196. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13197. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13198. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13199. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13200. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13201. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13202. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13203. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13204. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13205. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13206. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13207. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13208. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13209. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13210. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13211. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13212. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13213. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13214. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13215. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13216. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13217. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13218. HELP_MORE_HLR_A: "Carrousel",
  13219. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13220. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13221. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13222. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13223. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13224. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13225. HELP_MORE_TAG_A: "tag™ Posts",
  13226. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13227. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13228. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13229. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13230. HELP_MORE_TOUR_A: "Commandes de la visite",
  13231. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13232. HELP_MORE_INSIDE_A: "Vue intérieure",
  13233. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13234. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13235. HELP_MORE_VR_A: "Mode RV",
  13236. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13237. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13238. HELP_MORE_360_A: "Vues 360°",
  13239. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13240. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13241. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13242. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13243. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13244. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13245. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13246. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13247. WEBVR_LEARN_MORE: "En savoir plus",
  13248. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13249. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13250. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13251. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13252. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13253. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13254. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13255. VR_NEXT_CAPS: "SUIVANT",
  13256. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13257. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13258. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13259. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13260. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13261. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13262. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13263. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13264. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13265. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13266. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13267. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13268. VR_APP: "port VR App",
  13269. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13270. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13271. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13272. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13273. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13274. 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",
  13275. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13276. VR_ANDROID_DVICES: "Appareils Android",
  13277. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13278. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13279. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13280. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13281. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13282. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13283. VR_DOWNLOAD_HERE: "Télécharger ici",
  13284. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13285. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13286. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13287. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13288. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13289. SHARE_TO: "Partager sur",
  13290. SHARE_LINK: "Lien direct",
  13291. SHARE_EXPLORE: "Explorer ",
  13292. SHARE_AT: "à",
  13293. SHARE_WITH: "avec",
  13294. SHARE_3D: " en 3D",
  13295. SHARE_COPIED: "Copié!",
  13296. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13297. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13298. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13299. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13300. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13301. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13302. ERROR_GENERIC_ACTIONS_3: " ou ",
  13303. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13304. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13305. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13306. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13307. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13308. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13309. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13310. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13311. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13312. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13313. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13314. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13315. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13316. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13317. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13318. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13319. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13320. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13321. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13322. MENU_COPY: "Copie",
  13323. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13324. ROTATE: "Faire pivoter",
  13325. INSIDE: "Intérieure",
  13326. MOVE: "Se déplacer",
  13327. ZOOM: "Zoom"
  13328. }
  13329. }
  13330. , {}],
  13331. 114: [function(e, t, i) {
  13332. "use strict";
  13333. t.exports = {
  13334. PAGE_TITLE: "",
  13335. LOADING: "読み込み中",
  13336. PRESENTED_BY_CAPS: "PRESENTED BY",
  13337. POWERED_BY: "powered by",
  13338. POWERED_BY_CAPS: "POWERED BY",
  13339. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13340. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13341. PRESENTED_BY: "Presented by ",
  13342. MORE: "全て表示 ",
  13343. LESS: "閉じる ",
  13344. TAG_CONTENT: "tag™コンテンツ ",
  13345. SHOW: "表示",
  13346. HIDE: "非表示",
  13347. DOLLHOUSE: "ドールハウス",
  13348. FLOOR_PLAN: "フロアプラン",
  13349. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13350. CLOSE_HIGHLIGHTS: "閉じる",
  13351. PREVIOUS: "前へ",
  13352. PLAY: "再生",
  13353. PAUSE: "一時停止",
  13354. NEXT: "次へ",
  13355. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13356. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13357. SOCIAL_SHARING: "このSpaceを共有する",
  13358. VIEW_IN_VR: "VRで表示",
  13359. VIEW_FULLSCREEN: "フルスクリーン表示",
  13360. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13361. ZOOM_IN: "ズームイン",
  13362. ZOOM_OUT: "ズームアウト",
  13363. FLOOR_NAME: "フロア ",
  13364. FLOOR_ALL: "すべて",
  13365. TERMS: "規約",
  13366. PORT_TERMS: "port規約",
  13367. TERMS_OF_USE: "利用規約",
  13368. CLOSE_TERMS: "閉じる",
  13369. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13370. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13371. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13372. WEBVR_ENTER_WEBVR: "VRに入る",
  13373. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13374. WEBVR_LEARN_MORE: "もっと詳しく",
  13375. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13376. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13377. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13378. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13379. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13380. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13381. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13382. VR_PREVIOUS_CAPS: "前へ",
  13383. VR_NEXT_CAPS: "次へ",
  13384. VR_GOT_IT_CAPS: "了解",
  13385. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13386. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13387. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13388. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13389. VR_WHAT_YOU_NEED: "必要なもの",
  13390. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13391. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13392. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13393. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13394. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13395. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13396. VR_APP: "port VRアプリ",
  13397. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13398. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13399. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13400. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13401. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13402. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13403. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13404. VR_ANDROID_DVICES: "Androidデバイス",
  13405. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13406. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13407. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13408. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13409. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13410. VR_APP_OPEN: "port VRアプリで開く",
  13411. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13412. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13413. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13414. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13415. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13416. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13417. SHARE_TO: "共有先",
  13418. SHARE_LINK: "ダイレクトリンク",
  13419. SHARE_EXPLORE: "探索",
  13420. SHARE_AT: "場所",
  13421. SHARE_WITH: "使用アプリ",
  13422. SHARE_3D: "3Dで",
  13423. SHARE_COPIED: "コピーされました!",
  13424. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13425. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13426. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13427. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13428. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13429. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13430. ERROR_GENERIC_ACTIONS_3: "または",
  13431. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13432. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13433. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13434. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13435. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13436. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13437. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13438. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13439. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13440. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13441. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13442. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13443. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13444. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13445. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13446. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13447. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13448. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13449. LINK_TO_LOCATION: "ロケーションへのリンク",
  13450. MENU_COPY: "コピー",
  13451. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13452. ROTATE: "回転",
  13453. MOVE: "移動",
  13454. INSIDE: "内側",
  13455. ZOOM: "ズーム",
  13456. HELP: "ヘルプ",
  13457. HELP_NAVIGATION_TAB: "ナビゲーション",
  13458. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13459. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13460. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13461. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13462. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13463. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13464. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13465. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13466. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13467. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13468. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13469. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13470. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13471. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13472. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13473. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13474. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13475. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13476. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13477. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13478. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13479. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13480. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13481. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13482. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13483. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13484. HELP_MORE_HLR_A: "ハイライト",
  13485. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13486. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13487. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13488. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13489. HELP_MORE_FLOORS_A: "フロアセレクター",
  13490. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13491. HELP_MORE_TAG_A: "tag™ Posts",
  13492. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13493. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13494. HELP_MORE_ZOOM_A: "ズームコントロール",
  13495. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13496. HELP_MORE_TOUR_A: "ツアーコントロール",
  13497. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13498. HELP_MORE_INSIDE_A: "内側ビュー",
  13499. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13500. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13501. HELP_MORE_VR_A: "VRモード",
  13502. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13503. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13504. HELP_MORE_360_A: "360° Views",
  13505. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13506. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13507. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13508. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13509. CLOSE: "閉じる"
  13510. }
  13511. }
  13512. , {}],
  13513. 115: [function(e, t, i) {
  13514. "use strict";
  13515. t.exports = {
  13516. PAGE_TITLE: "",
  13517. LOADING: "Загрузка",
  13518. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13519. POWERED_BY: "разработано на платформе ",
  13520. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13521. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13522. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13523. PRESENTED_BY: "Представлено ",
  13524. MORE: "Больше ",
  13525. LESS: "Меньше ",
  13526. TAG_CONTENT: "tag™ Контент",
  13527. SHOW: "Показать",
  13528. HIDE: "Скрыть",
  13529. DOLLHOUSE: "Dollhouse",
  13530. FLOOR_PLAN: "Планировка",
  13531. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13532. CLOSE_HIGHLIGHTS: "Закрыть",
  13533. PREVIOUS: "Предыдущий",
  13534. PLAY: "Воспроизвести",
  13535. PAUSE: "Пауза",
  13536. NEXT: "Следующий",
  13537. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13538. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13539. SOCIAL_SHARING: "Поделиться этой моделью",
  13540. VIEW_IN_VR: "Посмотреть в VR",
  13541. VIEW_FULLSCREEN: "Полный экран",
  13542. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13543. ZOOM_IN: "Увеличить",
  13544. ZOOM_OUT: "Уменьшить",
  13545. FLOOR_NAME: "Этаж ",
  13546. FLOOR_ALL: "Все",
  13547. TERMS: "Условия",
  13548. PORT_TERMS: "Правила пользования",
  13549. TERMS_OF_USE: "Условия использования",
  13550. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13551. CLOSE_TERMS: "Закрыть",
  13552. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13553. HELP: "Помощь",
  13554. HELP_NAVIGATION_TAB: "Навигация",
  13555. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13556. CLOSE: "Закрыть",
  13557. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13558. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13559. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13560. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13561. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13562. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13563. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13564. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13565. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13566. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13567. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13568. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13569. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13570. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13571. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13572. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13573. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13574. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13575. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13576. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13577. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13578. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13579. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13580. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13581. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13582. HELP_MORE_HLR_A: "Фотоколлаж",
  13583. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13584. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13585. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13586. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13587. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13588. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13589. HELP_MORE_TAG_A: "tag™ Posts",
  13590. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13591. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13592. HELP_MORE_ZOOM_A: "Масштаб",
  13593. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13594. HELP_MORE_TOUR_A: "Управление Туром",
  13595. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13596. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13597. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13598. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13599. HELP_MORE_VR_A: "Режим VR",
  13600. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13601. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13602. HELP_MORE_360_A: "360° Views",
  13603. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13604. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13605. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13606. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13607. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13608. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13609. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13610. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13611. WEBVR_LEARN_MORE: "Узнать больше",
  13612. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13613. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13614. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13615. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13616. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13617. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13618. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13619. VR_APP: "port VR App",
  13620. VR_APP_OPEN: "Или открыть через приложение port VR",
  13621. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13622. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13623. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13624. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13625. VR_VIEW_SPACE: "Запустить модель в VR",
  13626. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13627. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13628. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13629. VR_GOT_IT_CAPS: "ЯСНО",
  13630. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13631. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13632. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13633. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13634. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13635. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13636. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13637. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13638. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13639. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13640. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13641. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13642. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13643. VR_ANDROID_DVICES: "Android устройства",
  13644. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13645. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13646. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  13647. VR_DOWNLOAD_HERE: "Скачать здесь",
  13648. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  13649. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  13650. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  13651. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  13652. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  13653. SHARE_TO: "Поделиться",
  13654. SHARE_LINK: "Прямая ссылка",
  13655. SHARE_EXPLORE: "просмотреть",
  13656. SHARE_AT: "на",
  13657. SHARE_WITH: "с",
  13658. SHARE_3D: "в 3D",
  13659. SHARE_COPIED: "Скопировано!",
  13660. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  13661. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  13662. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  13663. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  13664. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  13665. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  13666. ERROR_GENERIC_ACTIONS_3: " или ",
  13667. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  13668. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  13669. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  13670. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  13671. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  13672. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  13673. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  13674. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  13675. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  13676. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  13677. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  13678. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  13679. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  13680. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  13681. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  13682. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  13683. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  13684. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  13685. LINK_TO_LOCATION: "Ссылка на местоположение",
  13686. MENU_COPY: "Копировать",
  13687. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  13688. ROTATE: "Вращать",
  13689. MOVE: "Передвигаться",
  13690. INSIDE: "Вид изнутри",
  13691. ZOOM: "Масштаб"
  13692. }
  13693. }
  13694. , {}],
  13695. 116: [function(r, e, t) {
  13696. (function(i) {
  13697. "use strict";
  13698. function re(e) {
  13699. console.log("e1:" + e),
  13700. e = Math.round(.4 * e * 100),
  13701. console.log("e2:" + e);
  13702. var t = $(".progressbar");
  13703. t.find(".bar").css("width", e + "%"),
  13704. t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
  13705. t.find(".perc").text(e + "%")
  13706. }
  13707. $("#gui-loading").fadeIn(200),
  13708. re(.1);
  13709. var e = g_version ? "modeldata.js" : "someData.json";
  13710. $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
  13711. dataType: "json"
  13712. }).done(function(e) {
  13713. var t = matcher(e);
  13714. t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
  13715. t.user = {
  13716. is_authenticated: !1,
  13717. 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"]
  13718. },
  13719. window.MP_PREFETCHED_MODELDATA = t,
  13720. re(.7),
  13721. function() {
  13722. function y(e) {
  13723. t.update(e)
  13724. }
  13725. function A(e, t) {
  13726. ne.error(t),
  13727. n.error(t),
  13728. N.report(e, "error-" + t)
  13729. }
  13730. function C(e, t, i) {
  13731. try {
  13732. e.start(t)
  13733. } catch (e) {
  13734. throw ne.warn(e.message),
  13735. function(e) {
  13736. var t = O.details();
  13737. t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
  13738. N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
  13739. N.report(e, "error-webgl-generic"))
  13740. }(i.sid),
  13741. e
  13742. }
  13743. }
  13744. function I(e) {
  13745. e.stopPropagation(),
  13746. e.preventDefault()
  13747. }
  13748. window.MP_PREFETCHED_MODELDATA.hoticon && (g_HotImage = {
  13749. point: window.MP_PREFETCHED_MODELDATA.hoticon.default,
  13750. point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt
  13751. });
  13752. window.MP_PREFETCHED_MODELDATA.backgroundMusic ? (g_bgAudio.src = "//" + window.MP_PREFETCHED_MODELDATA.backgroundMusic,
  13753. $("#volume").show()) : "one" === g_version && (g_bgAudio.src = g_Prefix + "/audio/audio" + window.number + "/background.mp3");
  13754. window.MP_PREFETCHED_MODELDATA.loadlogo && showLogo();
  13755. r("./lib/three75-shim"),
  13756. r("./lib/array-polyfill"),
  13757. r("./lib/performance-polyfill"),
  13758. r("./lib/shaders/CopyShader.js"),
  13759. r("./lib/shaders/HorizontalBlurShader.js"),
  13760. r("./lib/shaders/VerticalBlurShader.js"),
  13761. r("./lib/postprocessing/EffectComposer.js"),
  13762. r("./lib/postprocessing/RenderPass.js"),
  13763. r("./lib/postprocessing/MaskPass.js"),
  13764. r("./lib/postprocessing/ShaderPass.js"),
  13765. window.Promise || (window.Promise = r("promise-polyfill"));
  13766. var E = r("three")
  13767. , _ = r("three")
  13768. , b = (r("./util/sentry"),
  13769. r("./player"))
  13770. , w = r("./director")
  13771. , T = r("./controls/CameraControls")
  13772. , x = r("./model/ModelManager")
  13773. , S = r("./DisplayController")
  13774. , M = r("./label/LabelDisplayController")
  13775. , R = r("./enum/Viewmode")
  13776. , e = r("./util/logger")
  13777. , P = r("./showcase")
  13778. , O = r("./util/browser")
  13779. , L = r("./settings")
  13780. , D = r("./gui/gui")
  13781. , n = r("./gui/error")
  13782. , N = r("./analytics")
  13783. , F = r("./util/transitions")
  13784. , B = r("./effects")
  13785. , V = r("./objects/Skybox")
  13786. , k = (r("./util/common"),
  13787. r("./util/PanoramaCollection"),
  13788. r("./util/math"),
  13789. r("./util/showcase"))
  13790. , U = r("./util/camera")
  13791. , H = (r("./objects/Panorama"),
  13792. r("./cameras/PanoramaCamera"),
  13793. r("./preloaders"))
  13794. , z = r("events").EventEmitter
  13795. , G = r("./featureflags")
  13796. , W = (r("./util/lerp"),
  13797. r("./util/ajax"),
  13798. r("./ab"))
  13799. , j = r("./sdk/automation.js")
  13800. , Y = r("./scene/SceneRenderer")
  13801. , q = r("./scene/QuickstartManager")
  13802. , X = r("./tile/QualityManager.js")
  13803. , Z = r("./localization/localize")
  13804. , K = r("./tag/tagManager")
  13805. , Q = r("./tile/TileDownloader")
  13806. , J = r("./tile/PanoRenderer")
  13807. , ee = (r("./enum/PanoSizeClass"),
  13808. r("./enum/PanoramaEvents"),
  13809. r("./enum/SceneRendererEvents"))
  13810. , t = r("./gui/memoryUsage")
  13811. , te = r("./enum/RenderLayers")
  13812. , ie = r("./TimingData")
  13813. , ne = new e(i);
  13814. e.level = L.logLevel,
  13815. e.consoleEnabled = L.console,
  13816. function() {
  13817. var e = k.getModelIDFromQueryString();
  13818. if (!e)
  13819. return A(null, "loading-failed");
  13820. var t = k.parseSidUrl(e)
  13821. , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
  13822. , n = {
  13823. panoElementsToLoad: 6,
  13824. modelElementsToLoad: 0,
  13825. totalElementsLoaded: 0,
  13826. totalElementsToLoad: 0,
  13827. totalPercentageLoaded: 0,
  13828. progressCallback: null
  13829. }
  13830. , r = document.getElementById("player")
  13831. , o = L.quickstart.enabled
  13832. , a = null
  13833. , s = null
  13834. , l = null
  13835. , c = null
  13836. , h = null
  13837. , u = null
  13838. , d = null
  13839. , p = null
  13840. , f = null
  13841. , g = null
  13842. , m = null
  13843. , v = new ie;
  13844. !function(e) {
  13845. ne.info("Version", "2.25.6-0-gd87e5b1"),
  13846. z.defaultMaxListeners = 1e3,
  13847. function(e) {
  13848. e.addEventListener("dragenter", I, !1),
  13849. e.addEventListener("dragover", I, !1)
  13850. }(e),
  13851. O.valueFromHash("title", !0) || $(document).ready(function() {
  13852. $(".model-title").hide()
  13853. })
  13854. }(r),
  13855. function(e) {
  13856. return G.loadFeatureFlags(e).done(function(e) {
  13857. G.updateDependentSettings(e, L)
  13858. })
  13859. }({
  13860. urlBase: t.urlBase
  13861. }).then(function() {
  13862. return Z.init(),
  13863. function(e, t) {
  13864. var i = P.getModel({
  13865. url: t,
  13866. floors: O.valueFromHash("f", !0),
  13867. autoload: !1
  13868. });
  13869. return $.when(i, y).then(null, function(e) {
  13870. return this
  13871. })
  13872. }(0, e)
  13873. }).then(function(e) {
  13874. return re(.9),
  13875. function(e, t, i, n, r) {
  13876. ne.info("Model data loaded"),
  13877. ne.debug("UUID: " + e.data.job.uuid),
  13878. W.init(G.getFlags()),
  13879. i && N.initKeen({
  13880. token: i,
  13881. appId: n
  13882. }),
  13883. N.initSegment({
  13884. model: e.sid,
  13885. version: "2.25.6-0-gd87e5b1",
  13886. startSource: r.startSource,
  13887. token: t,
  13888. autoplay: r.autoplay,
  13889. quickstart: r.quickstart
  13890. })
  13891. }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
  13892. startSource: i,
  13893. autoplay: L.autoplay,
  13894. quickstart: o
  13895. }),
  13896. g.urls.init()
  13897. }).then(function() {
  13898. return g.loadPanos()
  13899. }).then(function() {
  13900. s = U.getStartCameraOptions(g, g.panos),
  13901. d = function(e) {
  13902. var t = new E.PerspectiveCamera;
  13903. t.layers.enable(te.PANOMARKERS),
  13904. t.layers.enable(te.RETICULE),
  13905. t.layers.enable(te.TAG);
  13906. var o = new E.Scene
  13907. , i = new E.AmbientLight(16777215);
  13908. return o.add(i),
  13909. o.skybox = new V,
  13910. o.add(o.skybox),
  13911. o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
  13912. side: E.DoubleSide
  13913. })),
  13914. o.plane.position.y = 0,
  13915. o.plane.rotateX(-Math.PI / 2),
  13916. o.plane.material.visible = !1,
  13917. o.add(o.plane),
  13918. o.updateMatrixWorld(),
  13919. L.showScreenshotLocations && e.data.images.forEach(function(e) {
  13920. if (e.metadata && e.metadata.camera_position) {
  13921. var t = e.metadata.camera_position
  13922. , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
  13923. i.position = t.clone(),
  13924. o.add(i);
  13925. var n = e.metadata.camera_quaternion
  13926. , r = new E.Vector3(0,0,-1).applyQuaternion(n);
  13927. o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
  13928. }
  13929. }),
  13930. L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
  13931. o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
  13932. o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
  13933. new Y(o,t,B)
  13934. }(g),
  13935. m = function(e, t) {
  13936. var i = e ? 1 : 1e3
  13937. , n = W.tilegen || W.imgopt ? 6 : 2;
  13938. n = O.valueFromHash("tileconc", n);
  13939. var r = new X
  13940. , o = new Q({
  13941. concurrentDownloads: n
  13942. })
  13943. , a = new J
  13944. , s = new x
  13945. , l = new w
  13946. , c = new b(t)
  13947. , h = new T
  13948. , u = new S(i)
  13949. , d = new M
  13950. , p = new K;
  13951. return {
  13952. qualityManager: r,
  13953. panoRenderer: a,
  13954. tileDownloader: o,
  13955. player: c,
  13956. director: l,
  13957. modelManager: s,
  13958. tagManager: p,
  13959. displayController: u,
  13960. labelDisplayController: d,
  13961. controls: h
  13962. }
  13963. }(o, s.mode),
  13964. l = m.controls,
  13965. c = m.player,
  13966. h = m.director,
  13967. u = m.tagManager,
  13968. p = m.tileDownloader,
  13969. f = m.qualityManager,
  13970. m.panoRenderer,
  13971. function(e, t, i, n) {
  13972. var r = i.controls
  13973. , o = i.qualityManager
  13974. , a = i.panoRenderer
  13975. , s = i.tileDownloader
  13976. , l = i.modelManager;
  13977. r.init(n, l),
  13978. j.init(i.director, r, i.player, l, t),
  13979. o.init(l),
  13980. s.init(o),
  13981. a.init(t, s, o),
  13982. l.init(s, a, o),
  13983. l.addModel(e),
  13984. t.addComponent(F)
  13985. }(g, d, m, r),
  13986. c.director = h,
  13987. g.supportsTiles && p.start(),
  13988. !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  13989. o = !1);
  13990. var e = null;
  13991. if (o) {
  13992. ne.warn("Quickstart engaged. Hold on to your knickers.");
  13993. var t = l.controls[R.PANORAMA];
  13994. a = new q(f,d.scene,d.camera,t,r),
  13995. C(d, r, g),
  13996. e = a.load(s).then(function() {
  13997. d.addComponent(a),
  13998. d.once(ee.AfterRender, function() {
  13999. ne.warn("First render after quickstart load finished.")
  14000. })
  14001. })
  14002. }
  14003. return window.flyToFirst = function() {
  14004. var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
  14005. , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
  14006. , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
  14007. c.flyToPano({
  14008. pano: e,
  14009. lookAtPoint: i
  14010. })
  14011. }
  14012. ,
  14013. $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
  14014. }).then(function() {
  14015. return function(e, t, i, n, r) {
  14016. return r.progressCallback = t,
  14017. N.sessionStart(),
  14018. e.load(n).progress(function(e, t) {
  14019. e.modelElementsToLoad = t[1],
  14020. function(e) {
  14021. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14022. }(e),
  14023. function(e) {
  14024. e.totalElementsLoaded++,
  14025. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14026. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
  14027. e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
  14028. console.log("pro:" + e.totalPercentageLoaded),
  14029. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14030. }(e)
  14031. }
  14032. .bind(this, r))
  14033. }(g, D.onProgress, 0, !o, n)
  14034. }).then(function() {
  14035. s.quickstart = o,
  14036. function(e, t, i, n) {
  14037. var r = i.qualityManager
  14038. , o = i.panoRenderer
  14039. , a = i.tileDownloader
  14040. , s = i.modelManager
  14041. , l = i.player
  14042. , c = i.director
  14043. , h = i.tagManager
  14044. , u = i.displayController
  14045. , d = i.labelDisplayController
  14046. , p = i.controls;
  14047. t.scene.add(e),
  14048. t.qualityManager = r;
  14049. var f = {
  14050. camera: t.camera,
  14051. director: c,
  14052. modelManager: s,
  14053. tileDownloader: a,
  14054. panoRenderer: o,
  14055. qualityManager: r,
  14056. tagManager: h,
  14057. container: n,
  14058. controls: p
  14059. };
  14060. l.init(f),
  14061. l.setScene(t.scene),
  14062. h.init(s, l),
  14063. c.init(l, s),
  14064. u.init(c, l, s, h, n),
  14065. d.init(l, s, n),
  14066. B.bindEvents(l),
  14067. t.addComponent(h),
  14068. t.addComponent(l),
  14069. t.addComponent(o),
  14070. l.sceneRenderer = t
  14071. }(g, d, m, r),
  14072. d.started || C(d, r, g),
  14073. N.modelLoaded(g, c, l, L.autoplay),
  14074. function(e, t, i, n) {
  14075. return ne.info("Starting player in " + i.mode),
  14076. N.report(t.sid, "started-playing", n, i.quickstart),
  14077. e.start(i)
  14078. }(c, g, s, L.autoplay).done(function() {
  14079. h.autoTour()
  14080. }),
  14081. g.supportsTiles || new H(g,c).start();
  14082. o && (d.removeComponent(a),
  14083. a.destroy(),
  14084. s.pano.enter()),
  14085. D.init(g, h, c, l, d, s, N.getSessionId()),
  14086. D.endLoading(g, h, u),
  14087. d.once(ee.AfterRender, function() {
  14088. v.setAppReadyTime();
  14089. var e = v.calcFullLoadingTime();
  14090. ne.warn("Total load time: " + e / 1e3),
  14091. N.loadComplete(e),
  14092. ne.warn("First render after model load finished.")
  14093. }),
  14094. d.on(ee.MemoryUsageUpdated, y)
  14095. }).fail(A.bind(this, e))
  14096. }()
  14097. }()
  14098. })
  14099. }
  14100. ).call(this, "/js/main.js")
  14101. }
  14102. , {
  14103. "./DisplayController": 1,
  14104. "./TimingData": 2,
  14105. "./ab": 3,
  14106. "./analytics": 4,
  14107. "./cameras/PanoramaCamera": 7,
  14108. "./controls/CameraControls": 9,
  14109. "./director": 15,
  14110. "./effects": 16,
  14111. "./enum/PanoSizeClass": 36,
  14112. "./enum/PanoramaEvents": 37,
  14113. "./enum/RenderLayers": 41,
  14114. "./enum/SceneRendererEvents": 43,
  14115. "./enum/Viewmode": 51,
  14116. "./featureflags": 59,
  14117. "./gui/error": 64,
  14118. "./gui/gui": 65,
  14119. "./gui/memoryUsage": 73,
  14120. "./label/LabelDisplayController": 91,
  14121. "./lib/array-polyfill": 92,
  14122. "./lib/performance-polyfill": 95,
  14123. "./lib/postprocessing/EffectComposer.js": 96,
  14124. "./lib/postprocessing/MaskPass.js": 97,
  14125. "./lib/postprocessing/RenderPass.js": 98,
  14126. "./lib/postprocessing/ShaderPass.js": 99,
  14127. "./lib/shaders/CopyShader.js": 100,
  14128. "./lib/shaders/HorizontalBlurShader.js": 101,
  14129. "./lib/shaders/VerticalBlurShader.js": 102,
  14130. "./lib/three75-shim": 103,
  14131. "./localization/localize": 108,
  14132. "./tag/tagManager": 124,
  14133. "./model/ModelManager": 140,
  14134. "./objects/Panorama": 148,
  14135. "./objects/Skybox": 152,
  14136. "./player": 155,
  14137. "./preloaders": 156,
  14138. "./scene/QuickstartManager": 157,
  14139. "./scene/SceneRenderer": 158,
  14140. "./sdk/automation.js": 164,
  14141. "./settings": 166,
  14142. "./showcase": 168,
  14143. "./tile/PanoRenderer": 169,
  14144. "./tile/QualityManager.js": 170,
  14145. "./tile/TileDownloader": 171,
  14146. "./util/PanoramaCollection": 178,
  14147. "./util/ajax": 181,
  14148. "./util/browser": 182,
  14149. "./util/camera": 183,
  14150. "./util/common": 185,
  14151. "./util/lerp": 188,
  14152. "./util/logger": 189,
  14153. "./util/math": 190,
  14154. "./util/sentry": 192,
  14155. "./util/showcase": 193,
  14156. "./util/transitions": 195,
  14157. events: 202,
  14158. "promise-polyfill": 213,
  14159. three: 217
  14160. }],
  14161. 117: [function(e, t, i) {
  14162. "use strict";
  14163. function n(e) {
  14164. e = e || {},
  14165. r.RawShaderMaterial.call(this, a.extendObject({
  14166. fragmentShader: o.cube.fragmentShader,
  14167. vertexShader: o.cube.vertexShader,
  14168. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14169. name: "CubemapMaterial"
  14170. }, e))
  14171. }
  14172. var r = e("three")
  14173. , o = e("../shaders")
  14174. , a = e("../util/common");
  14175. (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
  14176. t.exports = n
  14177. }
  14178. , {
  14179. "../shaders": 167,
  14180. "../util/common": 185,
  14181. three: 217
  14182. }],
  14183. 118: [function(e, t, i) {
  14184. "use strict";
  14185. function n(e) {
  14186. e = e || {},
  14187. r.RawShaderMaterial.call(this, a.extendObject({
  14188. fragmentShader: o.model.fragmentShader,
  14189. vertexShader: o.model.vertexShader,
  14190. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14191. name: "ModelTextureMaterial"
  14192. }, e))
  14193. }
  14194. var r = e("three")
  14195. , o = e("../shaders")
  14196. , a = e("../util/common");
  14197. ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
  14198. i && (this.uniforms.progress.value = 0),
  14199. e.ensureSkyboxReadyForRender(),
  14200. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14201. this.uniforms.pano0Position.value.copy(e.position),
  14202. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14203. t.ensureSkyboxReadyForRender(),
  14204. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14205. this.uniforms.pano1Position.value.copy(t.position),
  14206. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14207. }
  14208. ,
  14209. t.exports = n
  14210. }
  14211. , {
  14212. "../shaders": 167,
  14213. "../util/common": 185,
  14214. three: 217
  14215. }],
  14216. 119: [function(m, v, e) {
  14217. (function(e) {
  14218. "use strict";
  14219. function t(e, t, i, n) {
  14220. this.div = null,
  14221. this.body = null,
  14222. this.label = e,
  14223. this.description = t,
  14224. this.parsedDescription = [],
  14225. this.media = i || {
  14226. type: null
  14227. },
  14228. this.loadingSpinner = null,
  14229. this.parser = new r({
  14230. supportLinks: !c.valueFromHash("mls"),
  14231. keepLinkLabels: !0
  14232. }),
  14233. this.state = g.CLOSED,
  14234. this.orientation = "",
  14235. this.initialTransform = "",
  14236. this.hovering = !1,
  14237. this.openTransition = null,
  14238. this.closeTransition = null,
  14239. this.openPromise = null,
  14240. this.closePromise = null,
  14241. this.animationTransition = null,
  14242. this.animationScale = 0
  14243. }
  14244. var r = m("../Parser/DescriptionParser")
  14245. , i = m("../Media/Link")
  14246. , n = m("../Media/Image")
  14247. , o = m("../Media/EmbedlyPlayer")
  14248. , a = m("../Media/EmbedlyEmbed")
  14249. , s = m("../../util/transitions")
  14250. , l = m("../../util/lerp")
  14251. , c = m("../../util/browser")
  14252. , b = m("./BillboardEvent")
  14253. , w = m("../Media/MediaEvent")
  14254. , h = m("../Parser/DescriptionChunkType")
  14255. , u = m("events").EventEmitter
  14256. , d = m("./billboardSettings")
  14257. , T = m("./overlaySettings")
  14258. , p = new (m("../../util/logger"))(e)
  14259. , f = document.getElementById("tag-billboards");
  14260. f.addEventListener("touchend", function(e) {
  14261. f.style.pointerEvents = "none"
  14262. }),
  14263. f.addEventListener("touchcancel", function(e) {
  14264. f.style.pointerEvents = "none"
  14265. });
  14266. var g = {
  14267. CLOSED: "closed",
  14268. OPENING: "opening",
  14269. OPEN: "open",
  14270. CLOSING: "closing",
  14271. ACTIVE: "active"
  14272. };
  14273. (t.prototype = Object.create(u.prototype)).build = function(e) {
  14274. this.parsedDescription = this.parser.parse(this.description);
  14275. var t = document.createElement("div");
  14276. t.className = "tag-container has-hotzone",
  14277. this.div = t,
  14278. this.body = document.createElement("div"),
  14279. this.body.className = "tag-body";
  14280. var i = document.createElement("div");
  14281. i.classList.add("tag-content");
  14282. var n = document.createElement("div");
  14283. n.classList.add("tag-text-content");
  14284. var r = document.createElement("div");
  14285. r.className = "tag-label",
  14286. r.textContent = this.label,
  14287. n.appendChild(r);
  14288. var o = document.createElement("div");
  14289. o.className = "tag-desc",
  14290. n.appendChild(o),
  14291. i.appendChild(n),
  14292. this.body.appendChild(i),
  14293. this.appendDescriptionElements(this.parsedDescription, o),
  14294. this.appendMedia(),
  14295. t.appendChild(this.body),
  14296. f.appendChild(t),
  14297. this.bindEvents(t, this.body)
  14298. }
  14299. ,
  14300. t.prototype.bindEvents = function(i, e) {
  14301. function t(n) {
  14302. return function(e) {
  14303. if (!this.div.classList.contains("overlay")) {
  14304. var t, i = document.getElementById("player");
  14305. try {
  14306. t = new MouseEvent(n,e)
  14307. } catch (i) {
  14308. (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)
  14309. }
  14310. i.dispatchEvent(t)
  14311. }
  14312. }
  14313. }
  14314. e.addEventListener("mousedown", function(e) {
  14315. e.stopPropagation()
  14316. }),
  14317. e.addEventListener("mouseup", function(e) {
  14318. e.stopPropagation()
  14319. }),
  14320. i.addEventListener("touchstart", function(e) {
  14321. f.style.pointerEvents = "auto"
  14322. }),
  14323. i.addEventListener("mousedown", t("mousedown").bind(this)),
  14324. i.addEventListener("mouseup", t("mouseup").bind(this)),
  14325. e.addEventListener("mouseover", function(e) {
  14326. this.state === g.OPEN && i.classList.remove("has-hotzone")
  14327. }
  14328. .bind(this)),
  14329. i.addEventListener("mouseenter", function(e) {
  14330. this.state !== g.CLOSING && (this.hovering = !0,
  14331. this.emit(b.ENTER))
  14332. }
  14333. .bind(this)),
  14334. i.addEventListener("mouseleave", function(e) {
  14335. this.hovering = !1,
  14336. this.emit(b.LEAVE)
  14337. }
  14338. .bind(this)),
  14339. i.addEventListener("gesturestart", function(e) {
  14340. e.preventDefault()
  14341. });
  14342. var n = i.querySelector(".tag-text-content")
  14343. , r = 0;
  14344. n.addEventListener("touchstart", function(e) {
  14345. r = e.changedTouches[0].clientY
  14346. }),
  14347. n.addEventListener("touchmove", function(t) {
  14348. function e(e) {
  14349. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14350. }
  14351. return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
  14352. }),
  14353. i.addEventListener("touchmove", function(e) {
  14354. 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14355. })
  14356. }
  14357. ,
  14358. t.prototype.appendDescriptionElements = function(e, i) {
  14359. 0 < e.length && this.div.classList.add("has-text"),
  14360. e.forEach(function(e, t) {
  14361. switch (e.type) {
  14362. case h.TEXT:
  14363. i.appendChild(this.createTextElement(e.text));
  14364. break;
  14365. case h.LINK:
  14366. i.appendChild(this.createLinkElement(e.link))
  14367. }
  14368. }
  14369. .bind(this))
  14370. }
  14371. ,
  14372. t.prototype.appendLoadingSpinner = function() {
  14373. this.loadingSpinner = document.createElement("div"),
  14374. this.loadingSpinner.classList.add("loading-spinner");
  14375. var e = document.createElement("div");
  14376. e.classList.add("gui-spinner-icon"),
  14377. this.loadingSpinner.appendChild(e),
  14378. this.body.appendChild(this.loadingSpinner)
  14379. }
  14380. ,
  14381. t.prototype.onMediaLoadFinished = function() {
  14382. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14383. this.applyOrientation(this.orientation),
  14384. this.loadingSpinner = null)
  14385. }
  14386. ,
  14387. t.prototype.appendMedia = function() {
  14388. if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
  14389. this.appendLoadingSpinner();
  14390. var e = document.createElement("div");
  14391. e.classList.add("tag-media-content");
  14392. var t = document.createElement("i");
  14393. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14394. t.classList.add(e)
  14395. }),
  14396. this.body.appendChild(t),
  14397. this.body.appendChild(e),
  14398. this.media.type) {
  14399. case h.IMAGE:
  14400. e.appendChild(this.createImageElement(this.media, this.body));
  14401. break;
  14402. case h.VIDEO:
  14403. e.appendChild(this.createVideoElement(this.media, this.body));
  14404. break;
  14405. case h.RICH:
  14406. e.appendChild(this.createEmbedElement(this.media, this.body))
  14407. }
  14408. }
  14409. }
  14410. ,
  14411. t.prototype.createTextElement = function(e) {
  14412. var t = document.createElement("span");
  14413. return t.textContent = e,
  14414. t
  14415. }
  14416. ,
  14417. t.prototype.createLinkElement = function(e) {
  14418. var t = new i(e);
  14419. return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
  14420. t.createDomElement()
  14421. }
  14422. ,
  14423. t.prototype.createImageElement = function(t, C) {
  14424. function e() {
  14425. function e() {
  14426. p || (E.classList.remove("view-image"),
  14427. a.classList.add("overlay"),
  14428. t(),
  14429. window.addEventListener("resize", A),
  14430. a.addEventListener("click", i),
  14431. c.addEventListener("click", r),
  14432. o.addEventListener("click", n),
  14433. p = !0,
  14434. _.emit(w.IMAGE_OPENED))
  14435. }
  14436. function t() {
  14437. C.classList.add("show-info"),
  14438. s.classList.remove("collapsible"),
  14439. s.style.height = "";
  14440. var e = parseFloat(getComputedStyle(v).lineHeight)
  14441. , t = g + e
  14442. , i = a.clientWidth - 2 * T.boundaryWidth - m
  14443. , n = a.clientHeight - 2 * T.boundaryHeight - m - t
  14444. , r = n
  14445. , o = r * I.aspect;
  14446. i < o && (r = (o = i) / I.aspect),
  14447. n < r && (o = (r = n) * I.aspect),
  14448. o += m,
  14449. r += m + t,
  14450. C.style.width = o + "px",
  14451. C.style.height = r + "px",
  14452. l.style.paddingTop = e + m + "px",
  14453. 0 < _.description.length && (s.classList.add("collapsible"),
  14454. s.style.height = s.clientHeight + 12 + "px",
  14455. y.style.height = "calc(100% - " + v.clientHeight + "px)")
  14456. }
  14457. function i(e) {
  14458. e.target === a && n()
  14459. }
  14460. function n() {
  14461. p && (p = !1,
  14462. E.classList.add("view-image"),
  14463. a.classList.remove("overlay"),
  14464. s.style.height = "",
  14465. l.style.paddingTop = "",
  14466. C.style.width = "",
  14467. C.style.height = "",
  14468. window.removeEventListener("resize", A),
  14469. a.removeEventListener("click", i),
  14470. c.removeEventListener("click", r),
  14471. o.removeEventListener("click", n),
  14472. _.emit(w.IMAGE_CLOSED),
  14473. _.close(!0))
  14474. }
  14475. function r(e) {
  14476. C.classList.toggle("show-info")
  14477. }
  14478. var a = _.div
  14479. , s = a.getElementsByClassName("tag-content")[0]
  14480. , l = a.getElementsByClassName("tag-media-content")[0]
  14481. , o = C.getElementsByClassName("close")[0]
  14482. , c = s.getElementsByClassName("tag-label")[0];
  14483. a.classList.add("has-image"),
  14484. E.classList.add("view-image"),
  14485. a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
  14486. _.applyOrientation(_.orientation);
  14487. 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,
  14488. function() {
  14489. clearInterval(h),
  14490. clearTimeout(u),
  14491. h = setInterval(function() {
  14492. var e = a.clientHeight;
  14493. d !== e && (t(),
  14494. d = e)
  14495. }, 100),
  14496. u = setTimeout(clearInterval.bind(this, h), 1e3)
  14497. }
  14498. );
  14499. I.on(w.IMAGE_OPENING, e),
  14500. _.on(b.ACTIVATE, e),
  14501. _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
  14502. _.on(b.CLOSING, n)
  14503. }
  14504. var I = new n
  14505. , E = I.createDomElement();
  14506. this.once(b.OPENED, function() {
  14507. I.load(t.src).then(e).catch(function(e) {
  14508. p.warn("Failed to load image:", t.src),
  14509. p.warn("with error:", e)
  14510. }).then(this.onMediaLoadFinished.bind(this))
  14511. });
  14512. var _ = this;
  14513. return E
  14514. }
  14515. ,
  14516. t.prototype.createVideoElement = function(t, e) {
  14517. var i = new o({
  14518. autoPlay: !0,
  14519. autoResume: !0,
  14520. startMuted: !1,
  14521. loop: !1
  14522. })
  14523. , n = i.createDomElement();
  14524. return this.once(b.OPENED, function() {
  14525. i.load(t.src).then(function() {
  14526. this.div.classList.add("has-video"),
  14527. this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
  14528. i.play()),
  14529. this.on(b.OPENING, i.show.bind(i)),
  14530. this.on(b.OPENED, i.play.bind(i)),
  14531. this.on(b.CLOSING, i.pause.bind(i)),
  14532. this.on(b.CLOSED, i.hide.bind(i))
  14533. }
  14534. .bind(this)).catch(function(e) {
  14535. p.warn("Failed to embed video:", t.src),
  14536. p.warn("with error:", e)
  14537. }).then(this.onMediaLoadFinished.bind(this))
  14538. }
  14539. .bind(this)),
  14540. n
  14541. }
  14542. ,
  14543. t.prototype.createEmbedElement = function(t, e) {
  14544. var i = new a
  14545. , n = i.createDomElement();
  14546. return this.once(b.OPENED, function() {
  14547. i.load(t.src).then(function() {
  14548. this.div.classList.add("has-embed"),
  14549. this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
  14550. this.applyOrientation(this.orientation),
  14551. this.on(b.OPENING, i.show.bind(i)),
  14552. this.on(b.CLOSED, i.hide.bind(i))
  14553. }
  14554. .bind(this)).catch(function(e) {
  14555. p.warn("Failed to embed:", t.src),
  14556. p.warn("with error:", e)
  14557. }).then(this.onMediaLoadFinished.bind(this))
  14558. }
  14559. .bind(this)),
  14560. n
  14561. }
  14562. ,
  14563. t.prototype.open = function(e) {
  14564. return this.openPromise = $.Deferred(),
  14565. this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14566. this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
  14567. this.state !== g.OPEN && (this.emit(b.OPENING),
  14568. e && this.emit(b.ACTIVATING),
  14569. this.state = g.OPENING,
  14570. this.animateOpen(function() {
  14571. e && this.setActiveState(),
  14572. this.openPromise.resolve()
  14573. }
  14574. .bind(this)))
  14575. }
  14576. .bind(this), d.animation.openDelay),
  14577. s.cancel(this.closeTransition),
  14578. this.closePromise && this.closePromise.reject(),
  14579. this.closeTransition = void 0,
  14580. this.openPromise.promise())
  14581. }
  14582. ,
  14583. t.prototype.close = function(e) {
  14584. return this.closePromise = $.Deferred(),
  14585. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
  14586. this.state !== g.CLOSED && (this.emit(b.CLOSING),
  14587. this.state = g.CLOSING,
  14588. this.animateClose())
  14589. }
  14590. .bind(this), d.animation.closeDelay)),
  14591. s.cancel(this.openTransition),
  14592. this.openPromise && this.openPromise.reject(),
  14593. this.openTransition = void 0,
  14594. this.closePromise.resolve(),
  14595. this.closePromise.promise())
  14596. }
  14597. ,
  14598. t.prototype.setActiveState = function() {
  14599. this.state !== g.CLOSED && (this.state = g.ACTIVE,
  14600. this.emit(b.ACTIVATE),
  14601. this.div.classList.remove("has-hotzone"))
  14602. }
  14603. ,
  14604. t.prototype.animateOpen = function(e) {
  14605. if (this.state === g.OPENING) {
  14606. if (s.cancel(this.animationTransition),
  14607. c.detectSamsungNative())
  14608. return this.boardOrientation = null,
  14609. this.div.style.visibility = "visible",
  14610. this.emit(b.OPENED),
  14611. this.state = g.OPEN,
  14612. void (e && e());
  14613. this.div.style.webkitTransform = "scale(0)",
  14614. this.div.style.transform = "scale(0)",
  14615. this.div.style.visibility = "visible",
  14616. this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
  14617. this.emit(b.OPENED),
  14618. this.state = g.OPEN,
  14619. e && e()
  14620. }
  14621. .bind(this))
  14622. }
  14623. }
  14624. ,
  14625. t.prototype.animateClose = function(e) {
  14626. this.state === g.CLOSING && (s.cancel(this.animationTransition),
  14627. this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
  14628. this.emit(b.CLOSED),
  14629. this.state = g.CLOSED,
  14630. this.div.style.visibility = "hidden",
  14631. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  14632. e && e()
  14633. }
  14634. .bind(this)))
  14635. }
  14636. ,
  14637. t.prototype.needsUpdate = function() {
  14638. return this.state !== g.CLOSED
  14639. }
  14640. ,
  14641. t.prototype.update = function(e, t) {
  14642. if (this.needsUpdate()) {
  14643. var i = (this.updateOrientation(e),
  14644. this.calcScale(t))
  14645. , n = {
  14646. x: (e.x + 1) * $("#player").width() / 2,
  14647. y: (e.y + 1) * $("#player").height() / 2
  14648. };
  14649. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  14650. this.div.style.webkitTransform = this.div.screenTransform,
  14651. this.div.style.transform = this.div.screenTransform
  14652. }
  14653. }
  14654. ,
  14655. t.prototype.getDimensions = function() {
  14656. return this.div.getBoundingClientRect()
  14657. }
  14658. ,
  14659. t.prototype.calcScale = function(e) {
  14660. return Math.sqrt(e / 40) * d.boardToDiscRatio
  14661. }
  14662. ,
  14663. t.prototype.updateOrientation = function(e) {
  14664. if (this.state !== g.ACTIVE) {
  14665. var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
  14666. , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
  14667. , n = "";
  14668. n += 0 == i ? "right" : 2 == i ? "left" : "",
  14669. n += 0 == t ? "-down" : 2 == t ? "-up" : "",
  14670. 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
  14671. 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  14672. 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
  14673. }
  14674. }
  14675. ,
  14676. t.prototype.applyOrientation = function(e) {
  14677. this.div.style.transform = this.div.style.webkitTransform = "",
  14678. this.div.classList.remove("tag-container-" + this.orientation),
  14679. this.div.classList.add("tag-container-" + e);
  14680. var t = window.getComputedStyle(this.div);
  14681. this.initialTransform = t.transform || t.webkitTransform,
  14682. "none" === this.initialTransform && (this.initialTransform = "");
  14683. var i = t.transform.slice(7, -1).split(",")
  14684. , n = -i[4]
  14685. , r = -i[5];
  14686. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  14687. this.div.style.transformOrigin = n + "px " + r + "px",
  14688. this.orientation = e
  14689. }
  14690. ,
  14691. v.exports = t
  14692. }
  14693. ).call(this, "/js/tag/Billboard/Billboard.js")
  14694. }
  14695. , {
  14696. "../../util/browser": 182,
  14697. "../../util/lerp": 188,
  14698. "../../util/logger": 189,
  14699. "../../util/transitions": 195,
  14700. "../Media/EmbedlyEmbed": 125,
  14701. "../Media/EmbedlyPlayer": 126,
  14702. "../Media/Image": 128,
  14703. "../Media/Link": 129,
  14704. "../Media/MediaEvent": 131,
  14705. "../Parser/DescriptionChunkType": 133,
  14706. "../Parser/DescriptionParser": 134,
  14707. "./BillboardEvent": 120,
  14708. "./billboardSettings": 121,
  14709. "./overlaySettings": 122,
  14710. events: 202
  14711. }],
  14712. 120: [function(e, t, i) {
  14713. "use strict";
  14714. t.exports = Object.freeze({
  14715. ENTER: "billboard.enter",
  14716. LEAVE: "billboard.leave",
  14717. OPENING: "billboard.opening",
  14718. OPENED: "billboard.open",
  14719. CLOSING: "billboard.closing",
  14720. CLOSED: "billboard.closed",
  14721. ACTIVATING: "billboard.activating",
  14722. ACTIVATE: "billboard.activate"
  14723. })
  14724. }
  14725. , {}],
  14726. 121: [function(e, t, i) {
  14727. "use strict";
  14728. t.exports = Object.freeze({
  14729. animation: Object.freeze({
  14730. hoverOnClosing: !1,
  14731. openDelay: 100,
  14732. closeDelay: 50,
  14733. openDuration: 200,
  14734. closeDuration: 100
  14735. }),
  14736. boardToDiscRatio: 1.2
  14737. })
  14738. }
  14739. , {}],
  14740. 122: [function(e, t, i) {
  14741. "use strict";
  14742. t.exports = Object.freeze({
  14743. boundaryWidth: 30,
  14744. boundaryHeight: 0
  14745. })
  14746. }
  14747. , {}],
  14748. hot: [function(e, t, i) {
  14749. "use strict";
  14750. function n(e, t, i) {
  14751. this.sid = e,
  14752. this.position = this.conversionArray(t.position),
  14753. this.rotation = this.conversionArray(t.rotation),
  14754. this.link = t.link,
  14755. this.model = i,
  14756. this.size = t.size;
  14757. this.initStyleImg(t)
  14758. this.build()
  14759. }
  14760. var g = e("three")
  14761. , r = e("../shaders")
  14762. , m = e("../settings")
  14763. , v = e("../enum/Viewmode")
  14764. , d = e("../objects/Panorama")
  14765. , o = e("../util/texture")
  14766. , p = new g.Raycaster
  14767. , a = new g.PlaneBufferGeometry(g_HotMeshSize.g_HotMeshWidth,g_HotMeshSize.g_HotMeshHeight,1,1)
  14768. var defaultTex1 = o.load(g_HotImage.point);
  14769. var defaultTex2 = o.load(g_HotImage.point2)
  14770. n.prototype.initStyleImg = function(t){
  14771. this.styleTex = []
  14772. t.styleImg = t.styleImg || [];
  14773. t.styleImg.forEach((src)=>{
  14774. this.styleTex.push({src:src})
  14775. })
  14776. }
  14777. n.prototype.changeTex = function(){
  14778. var u = this.mesh.material.uniforms
  14779. if(this.styleTex.length){
  14780. u.texture1.value = o.load(this.styleTex[0].src);
  14781. u.texture2.value = o.load(this.styleTex[1]&&this.styleTex[1].src || this.styleTex[0].src);
  14782. }else{
  14783. u.texture1.value = defaultTex1;
  14784. u.texture2.value = defaultTex2;
  14785. }
  14786. }
  14787. ,
  14788. n.prototype.build = function() {
  14789. var t = g.UniformsUtils.clone(r.hot.uniforms);
  14790. var e = new g.Mesh(a, new g.ShaderMaterial({
  14791. uniforms: t,
  14792. vertexShader: r.hot.vertexShader,
  14793. fragmentShader: r.hot.fragmentShader,
  14794. transparent: !0
  14795. }))
  14796. , t = parseFloat(window.MP_PREFETCHED_MODELDATA.hotIconScale);
  14797. e.dynamic = !0,
  14798. e.position.copy((new g.Vector3).fromArray(this.position)),
  14799. e.rotation.copy((new g.Euler).fromArray(this.rotation)),
  14800. t && e.scale.set(t, t, t),
  14801. e.name = this.sid,
  14802. e.type = "hotSprite",
  14803. (e.belongHot = this).link && (e.hotLink = this.link),
  14804. this.mesh = e,
  14805. this.model.add(e),
  14806. g_HotMeshes.push(e);
  14807. this.changeTex()
  14808. }
  14809. ,
  14810. n.prototype.closestPanoTowardTag = function(e, t) {
  14811. var i = []
  14812. , n = []
  14813. , r = this.mesh.position;
  14814. if (e === v.PANORAMA) {
  14815. var o = t.position.clone().sub(r).normalize();
  14816. n.push(d.scoreFunctions.direction(r, o))
  14817. }
  14818. var a = new g.Vector3;
  14819. i.push(function(e) {
  14820. return Math.abs(e.position.x - r.x) > m.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > m.tags.visibility.cameraClearance
  14821. }, function(e) {
  14822. a.copy(r).sub(e.position);
  14823. var t = -g.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  14824. , i = m.tags.navigate.tiltTolerance;
  14825. return m.insideLookLimitDown - i < t && t < m.insideLookLimitUp + i
  14826. }),
  14827. n.push(d.scoreFunctions.distanceSquared(this.mesh, -2));
  14828. var s = t.model.panos.sortByScore(i, n);
  14829. if (s && m.tags.navigate.lineOfSight) {
  14830. for (var l = 0; l < s.length; l++) {
  14831. var c = s[l].pano
  14832. , h = c.position.distanceTo(r);
  14833. p.set(c.position, r.clone().sub(c.position).normalize());
  14834. var u = p.intersectObjects(t.model.colliders);
  14835. if (0 === u.length || u[0].distance > h)
  14836. return console.log(l),
  14837. c
  14838. }
  14839. return null
  14840. }
  14841. return s && 0 < s.length && s[0].pano
  14842. }
  14843. ,
  14844. n.prototype.examine = function(e, options) {
  14845. var i = document.getElementById("popup");
  14846. options = options || {}
  14847. if (this.link && !options.dontOpen) {
  14848. g_currentHot = this,
  14849. i.style.display = "block",
  14850. i.classList.add("wait");
  14851. var n = document.createElement("iframe");
  14852. g_bgAudio && g_bgAudio.pause();
  14853. var r = this.link.substring(this.link.indexOf("html") + 4)
  14854. , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
  14855. -1 == r.indexOf("?") ? n.src = this.link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : n.src = this.link + "&time=" + randomTime().getTime() + "&id=" + window.number + o,
  14856. n.id = "id1",
  14857. n.allowTransparency = "true";
  14858. var a = document.getElementById("id1");
  14859. if (void 0 === a || null == a) {
  14860. document.querySelector(".popup-content").appendChild(n);
  14861. var s = !1;
  14862. window.loaddingSuccess = function() {
  14863. s = !0
  14864. }
  14865. ,
  14866. setTimeout(function e() {
  14867. if (s) {
  14868. var t = document.querySelector("#id1").contentWindow.document;
  14869. t.querySelector("video") && (t.querySelector("video").play(),
  14870. !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
  14871. t.querySelector("audio") && t.querySelector("audio").play()
  14872. } else
  14873. setTimeout(e, 300)
  14874. }, 800)
  14875. }
  14876. }
  14877. var l = e.mode
  14878. , c = m.tags.navigate.nearestPano && this.closestPanoTowardTag(l, e.currentPano) || e.currentPano
  14879. , h = this.mesh.position;
  14880. e.flyingToTag = !0;
  14881. var u = function() {
  14882. e.flyingToTag = !1;
  14883. options.dontOpen || this.link && i.classList.remove("wait")
  14884. }
  14885. .bind(this);
  14886. if (l === v.PANORAMA) {
  14887. var d = {
  14888. pano: c,
  14889. lookAtPoint: h,
  14890. duration: null,
  14891. maxDistanceOverride: null,
  14892. skipWarpingCheck: !1
  14893. };
  14894. e.flyToPano(d, u)
  14895. } else {
  14896. var p = {
  14897. pano: c
  14898. };
  14899. if (h) {
  14900. var f = (new g.Matrix4).lookAt(c.position, h, new g.Vector3(0,1,0));
  14901. p.quaternion = (new g.Quaternion).setFromRotationMatrix(f)
  14902. }
  14903. p.callback = u,
  14904. p.duration = 1500,
  14905. p.mode = v.PANORAMA,
  14906. e.flyToNewMode(p)
  14907. }
  14908. }
  14909. ,
  14910. n.prototype.conversionArray = function(e) {
  14911. if ("[object Array]" == Object.prototype.toString.call(e))
  14912. return e;
  14913. var t = [];
  14914. for (var i in e)
  14915. t.push(e[i]);
  14916. return t
  14917. }
  14918. ,
  14919. t.exports = n
  14920. }
  14921. , {
  14922. three: 217,
  14923. "../shaders": 167,
  14924. "../enum/Viewmode": 51,
  14925. "../objects/Panorama": 148,
  14926. "../util/texture": 194,
  14927. "../settings": 166
  14928. }],
  14929. 123: [function(M, R, e) {
  14930. (function(e) {
  14931. "use strict";
  14932. function d(e, t, i) {
  14933. var n = i.version || "0";
  14934. "0" !== n && w.info("tag defined using version " + n),
  14935. this.model = e,
  14936. this.sid = t,
  14937. this.color = (new f.Color).set(i.color || o.tagDefault),
  14938. this.hoverColor = o._darken(this.color, .2),
  14939. this.floor = null,
  14940. this.floorIndex = i.floor,
  14941. this.mode = m.PANORAMA,
  14942. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  14943. this.obj3d = null,
  14944. this.disc = null,
  14945. this.materials = {
  14946. disc: null,
  14947. pole: null
  14948. },
  14949. this.position = (new f.Vector3).copy(i.position),
  14950. this.discPosition = (new f.Vector3).copy(i.stem.direction),
  14951. this.discWorldPosition = null,
  14952. this.discScale = .05,
  14953. this.poleEnabled = i.stem.enabled,
  14954. this.billboard = new r(i.label,i.description,i.media,this),
  14955. this.visibleTransition = null,
  14956. this.hoveringDisc = !1
  14957. }
  14958. 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"),
  14959. 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);
  14960. d.prototype = Object.create(b.prototype),
  14961. d.raycaster = new f.Raycaster,
  14962. d.prototype.bindEvents = function() {
  14963. this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
  14964. this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
  14965. }
  14966. ,
  14967. d.prototype.build = function() {
  14968. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  14969. this.floor && (this.billboard.build(this.model.sid),
  14970. this.obj3d = this.buildObject3D(),
  14971. this.floor.add(this.obj3d)),
  14972. this
  14973. }
  14974. ,
  14975. d.prototype.buildObject3D = function() {
  14976. var e = new f.Object3D;
  14977. e.position.copy(this.position);
  14978. var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
  14979. t.bg.value = x,
  14980. t.mask.value = T,
  14981. t.color.value.copy(this.color),
  14982. this.materials.disc = new f.RawShaderMaterial({
  14983. transparent: !0,
  14984. vertexShader: A.tagDisc.vertexShader,
  14985. fragmentShader: A.tagDisc.fragmentShader,
  14986. uniforms: t
  14987. }),
  14988. this.disc = new f.Mesh(S,this.materials.disc),
  14989. this.disc.layers.set(a.TAG),
  14990. this.disc.position.copy(this.discPosition),
  14991. this.disc.renderOrder = s.tagDisc;
  14992. var i = (this.disc.tag = this).buildPole();
  14993. return i.layers.set(a.TAG),
  14994. i.renderOrder = s.tagStem,
  14995. e.add(i),
  14996. e.layers.set(a.TAG),
  14997. e.add(this.disc)
  14998. }
  14999. ,
  15000. d.prototype.buildPole = function() {
  15001. var e = new f.BufferGeometry
  15002. , t = new Float32Array(6);
  15003. return t[0] = t[1] = t[2] = 0,
  15004. t[3] = this.discPosition.x,
  15005. t[4] = this.discPosition.y,
  15006. t[5] = this.discPosition.z,
  15007. e.addAttribute("position", new f.BufferAttribute(t,3)),
  15008. this.materials.pole = new f.LineBasicMaterial({
  15009. linewidth: g.tags.pole.width,
  15010. color: g.tags.pole.color,
  15011. opacity: 0,
  15012. visible: this.poleEnabled,
  15013. transparent: !0,
  15014. depthWrite: !1
  15015. }),
  15016. new f.Line(e,this.materials.pole)
  15017. }
  15018. ,
  15019. d.prototype.setFreeState = function(e) {
  15020. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15021. this.materials.disc.uniforms.color.value = this.color
  15022. }
  15023. .bind(this))
  15024. }
  15025. ,
  15026. d.prototype.setHoverState = function(e) {
  15027. this.billboard.open(e),
  15028. this.materials.disc.uniforms.color.value = this.hoverColor
  15029. }
  15030. ,
  15031. d.prototype.hide = function(e, t) {
  15032. var i = $.Deferred();
  15033. if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
  15034. return i.resolve().promise();
  15035. e = e || 0,
  15036. t = t || 0,
  15037. C.cancel(this.visibleTransition);
  15038. var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
  15039. return this.visibleTransition = C.start((n = this,
  15040. r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
  15041. o = I.property(n.materials.pole, "opacity", 0),
  15042. function(e) {
  15043. r(e),
  15044. n.materials.pole && o(e)
  15045. }
  15046. ), s * a, function() {
  15047. i.resolve()
  15048. }, l, E[g.warp.blendEasing]),
  15049. i.promise()
  15050. }
  15051. ,
  15052. d.prototype.show = function(e, t) {
  15053. var i = $.Deferred();
  15054. if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
  15055. return i.resolve().promise();
  15056. e = e || 0,
  15057. t = t || 0,
  15058. C.cancel(this.visibleTransition);
  15059. 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;
  15060. return this.visibleTransition = C.start((n = this,
  15061. r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
  15062. o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
  15063. function(e) {
  15064. r(e),
  15065. n.materials.pole && o(e)
  15066. }
  15067. ), s * a, function() {
  15068. i.resolve()
  15069. }, l, E[g.warp.blendEasing]),
  15070. i.promise()
  15071. }
  15072. ,
  15073. d.prototype.closestPanoTowardTag = function(e, t) {
  15074. var i = []
  15075. , n = []
  15076. , r = this.disc.getWorldPosition();
  15077. if (e === m.PANORAMA) {
  15078. var o = t.position.clone().sub(r).normalize();
  15079. i.push(y.filters.isPanoAligned()),
  15080. i.push(y.filters.inPanoDirection(r, o, .5)),
  15081. i.push(y.filters.isNeighbourPanoTo(t)),
  15082. n.push(y.scoreFunctions.direction(r, o))
  15083. }
  15084. var a = new f.Vector3;
  15085. i.push(function(e) {
  15086. return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
  15087. }, function(e) {
  15088. a.copy(r).sub(e.position);
  15089. var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
  15090. , i = g.tags.navigate.tiltTolerance;
  15091. return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
  15092. }),
  15093. n.push(y.scoreFunctions.distanceSquared(this, -2));
  15094. var s = this.model.panos.sortByScore(i, n);
  15095. if (g.tags.navigate.lineOfSight) {
  15096. for (var l = 0; l < s.length; l++) {
  15097. var c = s[l].pano
  15098. , h = c.position.distanceTo(r);
  15099. if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
  15100. return null;
  15101. d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
  15102. var u = d.raycaster.intersectObjects(this.model.colliders);
  15103. if (0 === u.length || u[0].distance > h)
  15104. return c
  15105. }
  15106. return null
  15107. }
  15108. return 0 < s.length && s[0].pano
  15109. }
  15110. ,
  15111. d.prototype.examine = function(i) {
  15112. var e = i.mode
  15113. , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
  15114. , t = this.disc.getWorldPosition();
  15115. this.billboard.setActiveState();
  15116. var r = function() {
  15117. var e = this.billboard.getDimensions()
  15118. , t = new f.Vector3;
  15119. v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
  15120. t.unproject(i.camera),
  15121. i.flyToPano({
  15122. pano: n,
  15123. lookAtPoint: t
  15124. })
  15125. }
  15126. .bind(this);
  15127. if (e === m.PANORAMA)
  15128. if (n !== i.currentPano) {
  15129. var o = {
  15130. pano: n,
  15131. lookAtPoint: t,
  15132. duration: null,
  15133. maxDistanceOverride: null,
  15134. skipWarpingCheck: !1
  15135. };
  15136. i.flyToPano(o, r)
  15137. } else
  15138. setTimeout(function() {
  15139. this.billboard.open().then(function() {
  15140. r()
  15141. })
  15142. }
  15143. .bind(this), 0);
  15144. else {
  15145. var a = {
  15146. pano: n
  15147. };
  15148. if (t) {
  15149. var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
  15150. a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
  15151. }
  15152. a.callback = r,
  15153. a.duration = 1500,
  15154. a.mode = m.PANORAMA,
  15155. i.flyToNewMode(a)
  15156. }
  15157. }
  15158. ,
  15159. d.prototype.update = (n = new f.Vector3,
  15160. function(e, t) {
  15161. this.discWorldPosition = this.disc.getWorldPosition(),
  15162. this.updateDisc(e, t),
  15163. this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
  15164. n.z < 1 && (n.y *= -1,
  15165. this.billboard.update(n, this.getDiscRadius(n, t))))
  15166. }
  15167. ),
  15168. d.prototype.updateDisc = (l = new f.Vector3,
  15169. c = new f.Vector3,
  15170. h = new f.Vector3,
  15171. u = new f.Vector3,
  15172. p = new f.Vector3,
  15173. function(e, t) {
  15174. var i = g.tags.visibility
  15175. , n = g.tags.disc.scale
  15176. , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15177. 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)),
  15178. this.obj3d.visible) {
  15179. this.disc.quaternion.copy(t.quaternion);
  15180. var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
  15181. l.copy(this.discWorldPosition).project(t),
  15182. c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
  15183. h.set(o / 2, 0, 0).add(c),
  15184. u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
  15185. p.copy(u).unproject(t);
  15186. var a = p.distanceTo(this.discWorldPosition)
  15187. , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
  15188. this.discScale = a * s,
  15189. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15190. }
  15191. }
  15192. ),
  15193. d.prototype.getDiscRadius = (i = new f.Vector3,
  15194. function(e, t) {
  15195. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15196. Math.abs(e.x - i.x) * $("#player").width()
  15197. }
  15198. ),
  15199. d.prototype.tagVisibleOnCurrentFloor = function(e) {
  15200. return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15201. }
  15202. ,
  15203. d.prototype.offScreen = function(e, t) {
  15204. var i = e.getWorldPosition().project(t);
  15205. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15206. }
  15207. ,
  15208. d.viewportScale = function() {
  15209. return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
  15210. d.viewportHeight = $("#player").height(),
  15211. d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
  15212. d.currentViewportScale
  15213. }
  15214. ,
  15215. R.exports = d
  15216. }
  15217. ).call(this, "/js/tag/tag.js")
  15218. }
  15219. , {
  15220. "../enum/Colors": 19,
  15221. "../enum/RenderLayers": 41,
  15222. "../enum/RenderOrder": 42,
  15223. "../enum/Viewmode": 51,
  15224. "../objects/Panorama": 148,
  15225. "../settings": 166,
  15226. "../shaders": 167,
  15227. "../util/common": 185,
  15228. "../util/easing": 186,
  15229. "../util/lerp": 188,
  15230. "../util/logger": 189,
  15231. "../util/math": 190,
  15232. "../util/texture": 194,
  15233. "../util/transitions": 195,
  15234. "./Billboard/Billboard": 119,
  15235. "./Billboard/BillboardEvent": 120,
  15236. events: 202,
  15237. three: 217
  15238. }],
  15239. 124: [function(M, R, e) {
  15240. (function(e) {
  15241. "use strict";
  15242. function t() {
  15243. this.tagState = T.IDLE,
  15244. this.intersectTag = null,
  15245. this.hoveredTag = null,
  15246. this.activeTag = null,
  15247. this.tagDiscs = [],
  15248. this.raycaster = new i.Raycaster,
  15249. this.modelManager = null,
  15250. this.player = null,
  15251. this.totaltags = 0,
  15252. this.navigatingViaTag = !1,
  15253. this.enabled = !1
  15254. }
  15255. 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"),
  15256. M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
  15257. r.extend(t, x),
  15258. t.prototype.init = function(e, t) {
  15259. this.modelManager = e,
  15260. this.player = t,
  15261. this.updateModel(),
  15262. this.bindEvents()
  15263. }
  15264. ,
  15265. t.prototype.update = function(e) {
  15266. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15267. }
  15268. ,
  15269. t.prototype.updateTags = function(e, t, i, n) {
  15270. for (var r in this.model.tags)
  15271. this.model.tags[r].update(e, t, i, n)
  15272. }
  15273. ,
  15274. t.prototype.updateModel = function() {
  15275. this.model = this.modelManager.getActiveModel(),
  15276. this.gettagsFromModel(),
  15277. this.totaltags = Object.keys(this.model.tags).length
  15278. }
  15279. ,
  15280. t.prototype.gettagsFromModel = function() {
  15281. for (var e in this.tagDiscs = [],
  15282. this.model.tags) {
  15283. var t = this.model.tags[e].disc;
  15284. t && this.tagDiscs.push(t)
  15285. }
  15286. }
  15287. ,
  15288. t.prototype.bindEvents = function() {
  15289. function e() {
  15290. Object.keys(this.model.tags).forEach(function(e) {
  15291. var t = this.model.tags[e];
  15292. t.bindEvents(),
  15293. t.billboard.on(y.LINK_CLICK, function(e) {
  15294. e.type === A.NAVIGATION && this.navigateViaLink(e.url)
  15295. }
  15296. .bind(this)),
  15297. t.billboard.on(y.IMAGE_OPENED, function() {
  15298. this.tagState = T.EXAMINE,
  15299. this.emit(y.IMAGE_OPENED)
  15300. }
  15301. .bind(this)),
  15302. t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
  15303. }
  15304. .bind(this))
  15305. }
  15306. this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
  15307. this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
  15308. this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15309. this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
  15310. this.player.on(w.Ready, this.onPlayerReady.bind(this)),
  15311. this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15312. this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
  15313. this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15314. e.call(this)
  15315. }
  15316. ,
  15317. t.prototype.navigateViaLink = function(e) {
  15318. var t = a.deserialize(e);
  15319. if (t)
  15320. if (t.mode === C.PANORAMA) {
  15321. try {
  15322. this.player.model.panos.get(t.panoId)
  15323. } catch (e) {
  15324. return void S.warn("Unable to find panorama location", t.panoId)
  15325. }
  15326. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
  15327. } else {
  15328. var i = {
  15329. cameraMode: t.mode,
  15330. position: t.position,
  15331. quaternion: t.quaternion,
  15332. scanId: t.panoId,
  15333. orthoZoom: t.zoom,
  15334. floorVisibility: t.floorVisibility,
  15335. thumbUrl: null,
  15336. name: null
  15337. };
  15338. this.player.flyToNewMode({
  15339. mode: t.mode,
  15340. duration: m.warp.outsideTime,
  15341. warpDest: new g(i),
  15342. force: !0
  15343. })
  15344. }
  15345. }
  15346. ,
  15347. t.prototype.handleWarpStart = function(e, t, i, n) {
  15348. this.dismissExaminedTag(),
  15349. t === I.BLACK && (null != n || (n = m.warp.teleportTime),
  15350. e && (i = E.END),
  15351. this.hideShowTagsForBlackoutStyle(i, n))
  15352. }
  15353. ,
  15354. t.prototype.handleWarpInterruption = function(e, t, i) {
  15355. null != i || (i = m.warp.teleportTime),
  15356. this.hideShowTagsForBlackoutStyle(t, i)
  15357. }
  15358. ,
  15359. t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15360. var i = 0
  15361. , n = 0
  15362. , r = t / 2;
  15363. switch (null != e || (e = E.MIDDLE),
  15364. e) {
  15365. case E.END:
  15366. this.hideAlltags(r);
  15367. break;
  15368. case E.BEGINNING:
  15369. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15370. break;
  15371. case E.NONE:
  15372. break;
  15373. case E.MIDDLE:
  15374. n = i = r,
  15375. this.hideAlltags(n),
  15376. setTimeout(function() {
  15377. this.showAlltags(i)
  15378. }
  15379. .bind(this), n);
  15380. break;
  15381. case E.FADEIN:
  15382. setTimeout(function() {
  15383. this.showAlltags(r)
  15384. }
  15385. .bind(this), r)
  15386. }
  15387. }
  15388. ,
  15389. t.prototype.onPlayerModeChanging = function(e, t) {
  15390. t !== C.PANORAMA && this.dismissExaminedTag(),
  15391. t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
  15392. var i = t !== C.OUTDOOR;
  15393. i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15394. }
  15395. ,
  15396. t.prototype.onPanoChange = function(e, t) {
  15397. var i = this.navigatingViaTag;
  15398. if (this.navigatingViaTag = !1,
  15399. !i) {
  15400. this.dismissExaminedTag();
  15401. var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
  15402. , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
  15403. n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
  15404. }
  15405. }
  15406. ,
  15407. t.prototype.onPlayerReady = function(e, t, i) {
  15408. this.startAlltags(e, t ? i : null)
  15409. }
  15410. ,
  15411. t.prototype.onPlayerFlyingEnded = function(e, t) {
  15412. this.updateClosestTags(e)
  15413. }
  15414. ,
  15415. t.prototype.dismissExaminedTag = function() {
  15416. this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
  15417. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15418. this.hoveredTag = null)
  15419. }
  15420. ,
  15421. t.prototype.startAlltags = function(e, t) {
  15422. this.model.shouldShowtags = m.tags.enabled,
  15423. this.enabled = !0,
  15424. e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
  15425. t && setTimeout(function() {
  15426. this.activateTag(this.model.getTagBySid(t))
  15427. }
  15428. .bind(this), m.tags.startup.fadeInDuration / 2))
  15429. }
  15430. ,
  15431. t.prototype.showAlltags = function(e, t, i) {
  15432. function n() {
  15433. ++o === this.totaltags && (this.model.tagsShown = !0,
  15434. r.resolve())
  15435. }
  15436. var r = $.Deferred();
  15437. if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15438. return r.resolve().promise();
  15439. var o = 0;
  15440. for (var a in this.model.tags) {
  15441. this.model.tags[a].show(e, t).done(n.bind(this))
  15442. }
  15443. return r.promise()
  15444. }
  15445. ,
  15446. t.prototype.hideAlltags = function(e, t) {
  15447. function i() {
  15448. ++r === this.totaltags && (this.model.tagsShown = !1,
  15449. n.resolve())
  15450. }
  15451. var n = $.Deferred()
  15452. , r = 0;
  15453. for (var o in this.model.tags) {
  15454. var a = this.model.tags[o];
  15455. a.hide(e, t).done(i.bind(this)),
  15456. a === this.activeTag && this.dismissActiveTag()
  15457. }
  15458. return n.promise()
  15459. }
  15460. ,
  15461. t.prototype.enableHovering = function() {
  15462. this.enabled = !0
  15463. }
  15464. ,
  15465. t.prototype.disableHovering = function() {
  15466. this.enabled = !1
  15467. }
  15468. ,
  15469. t.prototype.activateTag = function(e, t) {
  15470. t = t || T.EXAMINE,
  15471. this.activeTag = e,
  15472. this.activeTag.hoveringDisc = !0,
  15473. this.activeTag.setHoverState(t === T.EXAMINE),
  15474. this.tagState = t,
  15475. this.emit(b.TagActivated, e)
  15476. }
  15477. ,
  15478. t.prototype.dismissActiveTag = function() {
  15479. this.activeTag.hoveringDisc = !1,
  15480. this.activeTag.setFreeState(!0);
  15481. var e = this.activeTag;
  15482. this.activeTag = null,
  15483. this.tagState = T.IDLE,
  15484. this.emit(b.TagDismissed, e)
  15485. }
  15486. ,
  15487. t.prototype.clickedOnTag = function(e) {
  15488. var t = function() {
  15489. this.navigatingViaTag = !0,
  15490. this.activeTag.examine(this.player),
  15491. this.emit(b.TagNavigation, this.activeTag)
  15492. }
  15493. .bind(this);
  15494. return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
  15495. this.activeTag = this.intersectTag,
  15496. t(),
  15497. !0) : (this.dismissActiveTag(),
  15498. !1)
  15499. }
  15500. ,
  15501. t.prototype.intersecttag = (s = new i.Vector3,
  15502. l = new i.Vector3,
  15503. c = new i.Vector3,
  15504. function(e, t, i) {
  15505. if (!this.enabled)
  15506. return null;
  15507. var n = null
  15508. , r = this.tagDiscs.filter(function(e) {
  15509. return e.parent.visible
  15510. });
  15511. if (0 < r.length) {
  15512. var o = this.model.floors.reduce(function(e, t) {
  15513. return t.hidden ? e : e.concat(t.collider.children)
  15514. }, r);
  15515. s.set(e.x, e.y, -1).unproject(i),
  15516. l.set(e.x, e.y, 1).unproject(i),
  15517. c.copy(l).sub(s).normalize(),
  15518. this.raycaster.set(s, c);
  15519. var a = this.raycaster.intersectObjects(o);
  15520. 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
  15521. }
  15522. return this.intersectTag = n,
  15523. t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
  15524. n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
  15525. this.hoveredTag = n
  15526. }
  15527. .bind(this)),
  15528. n.billboard.on(v.LEAVE, function() {
  15529. this.hoveredTag = null
  15530. }
  15531. .bind(this))),
  15532. this.activateTag(n, T.BROWSE))),
  15533. n
  15534. }
  15535. ),
  15536. t.prototype.rankedtagInDirection = (h = [],
  15537. u = [],
  15538. d = new i.Vector3,
  15539. p = new i.Vector3,
  15540. f = new i.Vector3,
  15541. function(e, t, i, n) {
  15542. for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
  15543. var a = this.closesttags[o];
  15544. p.copy(a.position),
  15545. p.add(a.discPosition),
  15546. d.copy(t),
  15547. d.sub(p).negate(),
  15548. d.normalize();
  15549. var s = d.dot(n);
  15550. if (0 <= s && (f.copy(p),
  15551. f.project(i),
  15552. this.intersecttag(f, !1, i))) {
  15553. if (r >= h.length)
  15554. for (var l = 0; l < 64; l++)
  15555. h.push({
  15556. tag: a,
  15557. dot: s
  15558. });
  15559. var c = h[r];
  15560. c.tag = a,
  15561. c.dot = s,
  15562. c.position = math.projectPositionToCanvas(p, i),
  15563. u.push(c),
  15564. r++
  15565. }
  15566. }
  15567. return u.sort(function(e, t) {
  15568. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15569. }),
  15570. e < u.length ? u[e].tag : null
  15571. }
  15572. ),
  15573. t.prototype.updateClosestTags = (o = new i.Vector3,
  15574. function(e) {
  15575. this.closesttags || (this.closesttags = []),
  15576. this.closesttags.length = 0;
  15577. var t = this.model.tags;
  15578. if (t)
  15579. for (var i in t)
  15580. if (t.hasOwnProperty(i)) {
  15581. var n = t[i]
  15582. , r = n.position;
  15583. o.copy(e),
  15584. o.sub(r).negate(),
  15585. o.lengthSq() < 30 && this.closesttags.push(n)
  15586. }
  15587. }
  15588. ),
  15589. R.exports = t
  15590. }
  15591. ).call(this, "/js/tag/tagManager.js")
  15592. }
  15593. , {
  15594. "../controls/serializer": 14,
  15595. "../enum/BlackoutStyle": 18,
  15596. "../enum/tagEvents": 32,
  15597. "../enum/ModelManagerEvents": 33,
  15598. "../enum/PlayerEvents": 40,
  15599. "../enum/TagStates": 44,
  15600. "../enum/Viewmode": 51,
  15601. "../enum/WarpStyle": 52,
  15602. "../objects/Snapshot": 153,
  15603. "../settings": 166,
  15604. "../util/common": 185,
  15605. "../util/lerp": 188,
  15606. "../util/logger": 189,
  15607. "./Billboard/BillboardEvent": 120,
  15608. "./Media/LinkType": 130,
  15609. "./Media/MediaEvent": 131,
  15610. events: 202,
  15611. three: 217
  15612. }],
  15613. 125: [function(r, o, e) {
  15614. (function(e) {
  15615. "use strict";
  15616. function t() {
  15617. this.embedWrapper = null,
  15618. this.embedElement = null
  15619. }
  15620. var i = r("../../util/ajax")
  15621. , a = r("./mediaSettings")
  15622. , n = r("../../settings")
  15623. , s = new (r("../../util/logger"))(e);
  15624. t.prototype.createDomElement = function() {
  15625. return this.embedWrapper = document.createElement("div"),
  15626. this.embedWrapper.classList.add("tag-embed"),
  15627. this.embedWrapper.classList.add("hidden"),
  15628. this.embedWrapper
  15629. }
  15630. ,
  15631. t.prototype.load = function(e) {
  15632. var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
  15633. return new Promise(function(r, o) {
  15634. i.get(t).then(function(e) {
  15635. if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
  15636. this.embedWrapper.innerHTML = e.html;
  15637. var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
  15638. if (this.embedWrapper.style.width = t + "px",
  15639. e.height) {
  15640. var i = e.height / e.width;
  15641. this.embedWrapper.style.height = t * i + "px"
  15642. }
  15643. this.embedElement = this.embedWrapper.firstChild;
  15644. var n = [];
  15645. try {
  15646. n = [].slice.call(this.embedElement.querySelectorAll("a"))
  15647. } catch (e) {
  15648. s.debug("Error getting `a` elements for embed; was it an iframe?")
  15649. }
  15650. n.forEach(function(e) {
  15651. e.setAttribute("target", "_blank")
  15652. }),
  15653. this.embedElement.classList.add("hidden"),
  15654. this.embedWrapper.classList.remove("hidden"),
  15655. r()
  15656. } else
  15657. o("Not a valid embed")
  15658. }
  15659. .bind(this), function(e) {
  15660. o(e.response)
  15661. })
  15662. }
  15663. .bind(this))
  15664. }
  15665. ,
  15666. t.prototype.show = function() {
  15667. this.embedElement && this.embedElement.classList.remove("hidden")
  15668. }
  15669. ,
  15670. t.prototype.hide = function() {
  15671. this.embedElement && this.embedElement.classList.add("hidden")
  15672. }
  15673. ,
  15674. o.exports = t
  15675. }
  15676. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  15677. }
  15678. , {
  15679. "../../settings": 166,
  15680. "../../util/ajax": 181,
  15681. "../../util/logger": 189,
  15682. "./mediaSettings": 132
  15683. }],
  15684. 126: [function(a, s, e) {
  15685. (function(e) {
  15686. "use strict";
  15687. function t(e) {
  15688. r.call(this),
  15689. this.options = e,
  15690. this.playerControls = null,
  15691. this.state = o.NOT_READY
  15692. }
  15693. var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
  15694. Object.freeze({
  15695. NOT_READY: "player.not.ready",
  15696. CUED: "player.cued",
  15697. PLAYING: "player.playing",
  15698. PAUSED: "player.paused"
  15699. }));
  15700. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15701. return this.embedWrapper = document.createElement("div"),
  15702. this.embedWrapper.classList.add("tag-video"),
  15703. this.embedWrapper.classList.add("hidden"),
  15704. this.embedWrapper
  15705. }
  15706. ,
  15707. t.prototype.load = function(e) {
  15708. var t = function() {
  15709. function e(e) {
  15710. this.playerState = e
  15711. }
  15712. this.playerControls = new playerjs.Player(this.embedElement),
  15713. this.playerControls.on("ready", function(e) {
  15714. this.playerState = o.CUED,
  15715. this.options.startMuted && this.playerControls.mute()
  15716. }
  15717. .bind(this)),
  15718. this.playerControls.on("play", e.bind(this, o.PLAYING)),
  15719. this.playerControls.on("pause", e.bind(this, o.PAUSED)),
  15720. this.playerControls.on("ended", function(e) {
  15721. this.playerControls.setCurrentTime(0),
  15722. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  15723. }
  15724. .bind(this))
  15725. }
  15726. .bind(this);
  15727. return r.prototype.load.call(this, e).then(t.bind(this))
  15728. }
  15729. ,
  15730. t.prototype.play = (i = n.isMobile(),
  15731. function() {
  15732. this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  15733. }
  15734. ),
  15735. t.prototype.pause = function() {
  15736. this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
  15737. }
  15738. ,
  15739. s.exports = t
  15740. }
  15741. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  15742. }
  15743. , {
  15744. "../../util/browser": 182,
  15745. "../../util/logger": 189,
  15746. "./EmbedlyEmbed": 125
  15747. }],
  15748. 127: [function(t, i, e) {
  15749. (function(e) {
  15750. "use strict";
  15751. var r = t("../../util/ajax")
  15752. , o = new (t("./mediaSettings"),
  15753. t("../../util/logger"))(e)
  15754. , a = Promise.resolve();
  15755. i.exports.enqueue = function(i) {
  15756. function n() {}
  15757. return a = new Promise(function(e, t) {
  15758. a.catch(n).then(function() {
  15759. (o.debug("requesting file from embedly:", i.href),
  15760. r.get(i.href, {
  15761. responseType: i.responseType
  15762. }).then(function(e) {
  15763. return o.debug("requesting file finished:", i.href),
  15764. e
  15765. })).then(e, t)
  15766. })
  15767. }
  15768. )
  15769. }
  15770. }
  15771. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  15772. }
  15773. , {
  15774. "../../util/ajax": 181,
  15775. "../../util/logger": 189,
  15776. "./mediaSettings": 132
  15777. }],
  15778. 128: [function(s, l, e) {
  15779. (function(e) {
  15780. "use strict";
  15781. function t() {
  15782. this.imageWrapper = null,
  15783. this.width = 0,
  15784. this.height = 0,
  15785. this.aspect = 1
  15786. }
  15787. var i = s("./MediaEvent")
  15788. , n = s("./EmbedlyQueue")
  15789. , r = s("events").EventEmitter
  15790. , o = s("../../util/logger")
  15791. , a = s("../../settings");
  15792. new o(e),
  15793. (t.prototype = Object.create(r.prototype)).createDomElement = function() {
  15794. return this.imageWrapper = document.createElement("div"),
  15795. this.imageWrapper.classList.add("tag-image"),
  15796. this.imageWrapper.classList.add("hidden"),
  15797. this.imageWrapper.addEventListener("click", function(e) {
  15798. e.stopPropagation(),
  15799. this.emit(i.IMAGE_OPENING),
  15800. this.imageWrapper.style.pointerEvents = "none"
  15801. }
  15802. .bind(this)),
  15803. this.imageWrapper
  15804. }
  15805. ,
  15806. t.prototype.onClosed = function() {
  15807. this.imageWrapper.style.pointerEvents = "auto"
  15808. }
  15809. ,
  15810. t.prototype.load = function(e) {
  15811. var t = Math.max(window.screen.height, window.screen.width)
  15812. , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  15813. return new Promise(function(o, e) {
  15814. n.enqueue({
  15815. href: i,
  15816. responseType: "arraybuffer"
  15817. }).then(function(e) {
  15818. var t = new Uint8Array(e)
  15819. , i = new Blob([t])
  15820. , n = new window.Image;
  15821. n.addEventListener("load", function(e) {
  15822. var t = e.target;
  15823. this.width = t.naturalWidth,
  15824. this.height = t.naturalHeight,
  15825. this.aspect = this.width / this.height;
  15826. var i = e.target.src;
  15827. this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
  15828. this.imageWrapper.style.width = this.width + "px",
  15829. this.imageWrapper.style.height = this.height + "px",
  15830. this.imageWrapper.classList.remove("hidden"),
  15831. o()
  15832. }
  15833. .bind(this));
  15834. var r = URL.createObjectURL(i);
  15835. n.src = r
  15836. }
  15837. .bind(this), e)
  15838. }
  15839. .bind(this))
  15840. }
  15841. ,
  15842. l.exports = t
  15843. }
  15844. ).call(this, "/js/tag/Media/Image.js")
  15845. }
  15846. , {
  15847. "../../settings": 166,
  15848. "../../util/logger": 189,
  15849. "./EmbedlyQueue": 127,
  15850. "./MediaEvent": 131,
  15851. events: 202
  15852. }],
  15853. 129: [function(e, t, i) {
  15854. "use strict";
  15855. function n(e) {
  15856. this.label = e.label,
  15857. this.href = e.url,
  15858. this.type = this.updateLinkForType(),
  15859. this.domElement = null,
  15860. this.id = c++
  15861. }
  15862. var r = e("./LinkType")
  15863. , o = e("./MediaEvent")
  15864. , a = e("../../util/browser")
  15865. , s = e("../../analytics")
  15866. , l = e("events").EventEmitter
  15867. , c = 0;
  15868. (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
  15869. var e, t = a.valueFromHash("m") || a.valueFromHash("model");
  15870. 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,
  15871. new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
  15872. r.NAVIGATION) : (this.href = this.href + "&play=1",
  15873. r.MODEL) : r.EXT_LINK
  15874. }
  15875. ;
  15876. var h = {};
  15877. n.prototype.createDomElement = function() {
  15878. if (this.domElement = document.createElement("a"),
  15879. this.domElement.classList.add("tag-link"),
  15880. this.domElement.textContent = this.label,
  15881. this.type === r.EXT_LINK) {
  15882. this.domElement.textContent += " ";
  15883. var e = document.createElement("i");
  15884. e.classList.add("icon-ext-link"),
  15885. e.title = "Link to external web site",
  15886. this.domElement.appendChild(e)
  15887. }
  15888. return this.domElement.addEventListener("click", function(e) {
  15889. switch (e.stopPropagation(),
  15890. h[this.id] = !0,
  15891. s.trackAlways("click_tag_link", {
  15892. link_type: this.type,
  15893. link_count: c,
  15894. links_clicked: Object.keys(h).length
  15895. }),
  15896. this.type) {
  15897. case r.MODEL:
  15898. window.location.replace(this.href);
  15899. break;
  15900. case r.EXT_LINK:
  15901. window.open(this.href, "_blank")
  15902. }
  15903. this.emit(o.LINK_CLICK, {
  15904. type: this.type,
  15905. url: this.href
  15906. })
  15907. }
  15908. .bind(this)),
  15909. this.domElement
  15910. }
  15911. ,
  15912. t.exports = n
  15913. }
  15914. , {
  15915. "../../analytics": 4,
  15916. "../../util/browser": 182,
  15917. "./LinkType": 130,
  15918. "./MediaEvent": 131,
  15919. events: 202
  15920. }],
  15921. 130: [function(e, t, i) {
  15922. "use strict";
  15923. t.exports = {
  15924. NAVIGATION: "navigation",
  15925. MODEL: "model",
  15926. EXT_LINK: "ext-link"
  15927. }
  15928. }
  15929. , {}],
  15930. 131: [function(e, t, i) {
  15931. "use strict";
  15932. t.exports = Object.freeze({
  15933. LINK_CLICK: "mtmedia.link",
  15934. IMAGE_LOADED: "mtmedia.image.loaded",
  15935. IMAGE_OPENING: "mtmedia.image.opening",
  15936. IMAGE_OPENED: "mtmedia.image.opened",
  15937. IMAGE_CLOSING: "mtmedia.image.closing",
  15938. IMAGE_CLOSED: "mtmedia.image.closed",
  15939. VIDEO_START: "mtmedia.video.start",
  15940. VIDEO_PAUSE: "mtmedia.video.pause",
  15941. VIDEO_ENDED: "mtmedia.video.end"
  15942. })
  15943. }
  15944. , {}],
  15945. 132: [function(e, t, i) {
  15946. "use strict";
  15947. t.exports = Object.freeze({
  15948. maxEmbedWidth: 350,
  15949. defaultAspectRatio: .75
  15950. })
  15951. }
  15952. , {}],
  15953. 133: [function(e, t, i) {
  15954. "use strict";
  15955. t.exports = Object.freeze({
  15956. TEXT: "text",
  15957. LINK: "link",
  15958. IMAGE: "photo",
  15959. VIDEO: "video",
  15960. RICH: "rich"
  15961. })
  15962. }
  15963. , {}],
  15964. 134: [function(e, t, i) {
  15965. "use strict";
  15966. function n(e) {
  15967. this.capabilities = {
  15968. links: {
  15969. enable: e.supportLinks,
  15970. keepLabels: e.keepLinkLabels
  15971. }
  15972. }
  15973. }
  15974. var r = e("./DescriptionChunkType");
  15975. n.prototype.parse = function(e, i) {
  15976. var n = [];
  15977. return e.split("[").map(function(e, t) {
  15978. return 0 === t ? e : "[" + e
  15979. }).forEach(function(e) {
  15980. var t = this.findMarkdown(e);
  15981. if (t) {
  15982. if (-1 !== t.url.indexOf("javascript:"))
  15983. return;
  15984. this.addLinkChunk(n, t, i),
  15985. this.addTextChunk(n, e.slice(t.markdown.length))
  15986. } else
  15987. this.addTextChunk(n, e)
  15988. }
  15989. .bind(this)),
  15990. n
  15991. }
  15992. ,
  15993. n.prototype.findMarkdown = function(e) {
  15994. var t = e.match(/\[([^\]]*)\]\((.*)\)/);
  15995. if (t) {
  15996. for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
  15997. 0 !== n); )
  15998. r++;
  15999. var o = i.length - r;
  16000. return {
  16001. markdown: t[0].substring(0, t[0].length - o),
  16002. label: t[1],
  16003. url: t[2].substring(0, r)
  16004. }
  16005. }
  16006. }
  16007. ,
  16008. n.prototype.addTextChunk = function(e, t) {
  16009. 0 !== t.length && e.push({
  16010. type: r.TEXT,
  16011. text: t
  16012. })
  16013. }
  16014. ,
  16015. n.prototype.addLinkChunk = function(e, t) {
  16016. if (this.capabilities.links.enable) {
  16017. var i = {
  16018. label: t.label,
  16019. url: t.url
  16020. };
  16021. -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
  16022. e.push({
  16023. type: r.LINK,
  16024. link: i
  16025. })
  16026. } else
  16027. this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
  16028. }
  16029. ,
  16030. t.exports = n
  16031. }
  16032. , {
  16033. "./DescriptionChunkType": 133
  16034. }],
  16035. 135: [function(t, r, e) {
  16036. (function(e) {
  16037. "use strict";
  16038. var i = new (t("../util/logger"))(e)
  16039. , n = {
  16040. parseIdsFromChunkName: function(e, t) {
  16041. t.floorId = n.parseFloor(e),
  16042. t.roomId = n.parseRoom(e)
  16043. },
  16044. parseFloor: function(e) {
  16045. var t = e.match(/_group([0-9]+)/);
  16046. if (!t)
  16047. return 0;
  16048. try {
  16049. return parseInt(t[1], 10)
  16050. } catch (e) {
  16051. return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16052. 0
  16053. }
  16054. },
  16055. parseRoom: function(e) {
  16056. var t = e.match(/_sub([0-9]+)/);
  16057. if (!t)
  16058. return -1;
  16059. try {
  16060. return parseInt(t[1], 10)
  16061. } catch (e) {
  16062. return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16063. 0
  16064. }
  16065. }
  16066. };
  16067. r.exports = n
  16068. }
  16069. ).call(this, "/js/model/Chunks.js")
  16070. }
  16071. , {
  16072. "../util/logger": 189
  16073. }],
  16074. 136: [function(a, c, e) {
  16075. (function(e) {
  16076. "use strict";
  16077. function t(e) {
  16078. r.call(this),
  16079. this.model = e,
  16080. this.exploded = !1
  16081. }
  16082. var i = a("../objects/Floor")
  16083. , n = (a("../settings"),
  16084. a("../util/logger"))
  16085. , s = a("../util/transitions")
  16086. , r = a("../util/IndexedCollection")
  16087. , o = a("../util/common")
  16088. , l = a("../util/easing");
  16089. new n(e),
  16090. o.inherit(t, r),
  16091. t.prototype.add = function(e) {
  16092. r.prototype.add.call(this, e),
  16093. this.model.add(e)
  16094. }
  16095. ,
  16096. t.prototype.getIndex = function(e) {
  16097. return e.floorIndex
  16098. }
  16099. ,
  16100. t.prototype.build = function() {
  16101. this.list.forEach(function(e) {
  16102. e.build()
  16103. })
  16104. }
  16105. ,
  16106. t.prototype.size = function() {
  16107. return this.length
  16108. }
  16109. ,
  16110. t.prototype.sort = function() {
  16111. r.prototype.sort.call(this, function(e, t) {
  16112. return e.floorIndex - t.floorIndex
  16113. })
  16114. }
  16115. ,
  16116. t.prototype.nextFloor = function(e, t) {
  16117. return this.index[e.floorIndex + t] || null
  16118. }
  16119. ,
  16120. t.prototype.getFloorAtPoint = function(e) {
  16121. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16122. var r = this.list[n]
  16123. , o = r.distanceToPoint(e);
  16124. (!t || o < i) && (i = o,
  16125. t = r)
  16126. }
  16127. return t
  16128. }
  16129. ,
  16130. t.prototype.getOrMakeFloor = function(e) {
  16131. var t = this.index[e];
  16132. return t || (t = new i(this.model,e),
  16133. this.add(t)),
  16134. t
  16135. }
  16136. ,
  16137. t.prototype.hide = function() {
  16138. this.list.forEach(function(e) {
  16139. e.hide()
  16140. })
  16141. }
  16142. ,
  16143. t.prototype.show = function() {
  16144. this.list.forEach(function(e) {
  16145. e.show()
  16146. })
  16147. }
  16148. ,
  16149. t.prototype.names = function() {
  16150. return this.list.reduce(function(e, t) {
  16151. return e.concat(t.name)
  16152. }, [])
  16153. }
  16154. ,
  16155. t.prototype.toggleExplodeHorizontal = function() {
  16156. function i(e, t) {
  16157. a.copy(e.position),
  16158. e.position.x = r[e.floorIndex] * t,
  16159. e.position.y = 1 * e.floorIndex * t,
  16160. a.sub(e.position).multiplyScalar(-1),
  16161. e.panos.forEach(function(e) {
  16162. e.translate(a)
  16163. })
  16164. }
  16165. var n, r = [], o = 0;
  16166. this.list.forEach(function(e, t, i) {
  16167. n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16168. o += n,
  16169. r[t] = o
  16170. }),
  16171. r = r.map(function(e) {
  16172. return e - o / 2
  16173. });
  16174. var a = this.list[0].position.clone();
  16175. this.exploded ? this.list.forEach(function(t) {
  16176. s.start(function(e) {
  16177. i(t, 1 - e)
  16178. }, 1500, null, 0, l.easeOutExpo)
  16179. }) : this.list.forEach(function(t) {
  16180. s.start(function(e) {
  16181. i(t, e)
  16182. }, 1500, null, 0, l.easeOutExpo)
  16183. }),
  16184. this.exploded = !this.exploded
  16185. }
  16186. ,
  16187. t.prototype.toggleExplodeVertical = function() {
  16188. function i(e, t) {
  16189. var i = i.copy(e.position);
  16190. e.position.y = (5 * e.floorIndex - n.y / 2) * t,
  16191. i.sub(e.position).multiplyScalar(-1),
  16192. e.panos.forEach(function(e) {
  16193. e.translate(i)
  16194. })
  16195. }
  16196. var n = this.model.size;
  16197. this.list[0].position.clone(),
  16198. this.exploded ? this.list.forEach(function(t) {
  16199. s.start(function(e) {
  16200. i(t, 1 - e)
  16201. }, 1500, null, 0, l.easeOutExpo)
  16202. }) : this.list.forEach(function(t) {
  16203. s.start(function(e) {
  16204. i(t, e)
  16205. }, 1500, null, 0, l.easeOutExpo)
  16206. }),
  16207. this.exploded = !this.exploded
  16208. }
  16209. ,
  16210. c.exports = t
  16211. }
  16212. ).call(this, "/js/model/FloorCollection.js")
  16213. }
  16214. , {
  16215. "../objects/Floor": 146,
  16216. "../settings": 166,
  16217. "../util/IndexedCollection": 175,
  16218. "../util/common": 185,
  16219. "../util/easing": 186,
  16220. "../util/logger": 189,
  16221. "../util/transitions": 195
  16222. }],
  16223. 137: [function(r, o, e) {
  16224. (function(e) {
  16225. "use strict";
  16226. function h() {
  16227. n.call(this)
  16228. }
  16229. var u = r("../settings")
  16230. , t = r("../util/logger")
  16231. , d = r("../enum/Viewmode")
  16232. , p = r("../objects/Snapshot")
  16233. , i = (r("../util/math"),
  16234. r("../util/common"))
  16235. , n = r("../util/IndexedCollection")
  16236. , l = new t(e);
  16237. i.inherit(h, n),
  16238. h.prototype.getImage = function(e) {
  16239. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16240. }
  16241. ,
  16242. h.prototype.filterByModesAndReel = function(e, t) {
  16243. for (var i = [], n = 0; n < t.length; n += 1) {
  16244. var r = t[n]
  16245. , o = this.index[r.sid];
  16246. o && i.push(o)
  16247. }
  16248. var a = e[d.DOLLHOUSE]
  16249. , s = e[d.FLOORPLAN];
  16250. (i = i.filter(function(e) {
  16251. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16252. return !0;
  16253. var t;
  16254. try {
  16255. t = d.convertWorkshopModeInt(e.metadata.camera_mode)
  16256. } catch (e) {
  16257. return l.debug(e.message),
  16258. !1
  16259. }
  16260. return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
  16261. })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16262. this.list = i,
  16263. this.reIndex()
  16264. }
  16265. ,
  16266. h.prototype.getHeroLocations = function(e) {
  16267. if (0 === this.list.length)
  16268. return [];
  16269. for (var t = [], i = 0; i < this.list.length; ++i) {
  16270. var n = this.list[i]
  16271. , r = n.thumbnail_signed_src
  16272. , o = n.name || "";
  16273. if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
  16274. if (!u.show360Views.enabled && n.metadata.scan_id) {
  16275. var a = e.get(n.metadata.scan_id);
  16276. if (a && !a.isAligned())
  16277. continue
  16278. }
  16279. var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
  16280. if (s === d.MESH)
  16281. continue;
  16282. var l = {
  16283. cameraMode: s,
  16284. position: n.metadata.camera_position,
  16285. quaternion: n.metadata.camera_quaternion,
  16286. zoom: n.metadata.zoom,
  16287. panoId: n.metadata.scan_id,
  16288. orthoZoom: n.metadata.ortho_zoom,
  16289. floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
  16290. thumbUrl: "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : "//" + r + "?" + randomTime().getTime(),
  16291. name: h.filterImageName(o),
  16292. sid: n.sid
  16293. }
  16294. , c = new p(l);
  16295. t.push(c)
  16296. }
  16297. }
  16298. return t
  16299. }
  16300. ,
  16301. h.prototype.getIndex = function(e) {
  16302. return e.sid
  16303. }
  16304. ,
  16305. h.filterImageName = function(e) {
  16306. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16307. }
  16308. ,
  16309. o.exports = h
  16310. }
  16311. ).call(this, "/js/model/ImageCollection.js")
  16312. }
  16313. , {
  16314. "../enum/Viewmode": 51,
  16315. "../objects/Snapshot": 153,
  16316. "../settings": 166,
  16317. "../util/IndexedCollection": 175,
  16318. "../util/common": 185,
  16319. "../util/logger": 189,
  16320. "../util/math": 190
  16321. }],
  16322. 138: [function(h, u, e) {
  16323. (function(e) {
  16324. "use strict";
  16325. function n() {
  16326. c.call(this)
  16327. }
  16328. var r = h("../label/Label")
  16329. , i = h("../settings")
  16330. , t = h("../util/logger")
  16331. , o = h("../util/math")
  16332. , a = h("../util/ajax")
  16333. , s = h("./RoomCollection")
  16334. , l = h("../util/common")
  16335. , c = h("../util/IndexedCollection");
  16336. new t(e),
  16337. l.inherit(n, c),
  16338. n.prototype.getIndex = function(e) {
  16339. return e.labelId
  16340. }
  16341. ,
  16342. n.prototype.associateWithRooms = function(e) {
  16343. this.forEach(function(t) {
  16344. e.forEach(function(e) {
  16345. e.roomId === t.roomId && (t.room = e)
  16346. })
  16347. })
  16348. }
  16349. ,
  16350. n.prototype.createFromLabelData = function(e) {
  16351. e.forEach(function(e) {
  16352. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16353. t = s.generateRoomId(e.floorId, t);
  16354. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16355. i.position = o.convertWorkshopVector(i.position),
  16356. this.add(i),
  16357. i.build()
  16358. }
  16359. .bind(this))
  16360. }
  16361. ,
  16362. n.prototype.load = function(e, t) {
  16363. return a.get(e, {
  16364. responseType: "json",
  16365. auth: t ? i.authorizationHeader : null
  16366. }).done(function(e) {
  16367. var t = [];
  16368. for (var i in e) {
  16369. var n = e[i];
  16370. t.push(n)
  16371. }
  16372. this.createFromLabelData(t)
  16373. }
  16374. .bind(this))
  16375. }
  16376. ,
  16377. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16378. var t = -1;
  16379. if (e) {
  16380. var i = e.split("_");
  16381. t = parseInt(i[0])
  16382. }
  16383. return t
  16384. }
  16385. ,
  16386. u.exports = n
  16387. }
  16388. ).call(this, "/js/model/LabelCollection.js")
  16389. }
  16390. , {
  16391. "../label/Label": 90,
  16392. "../settings": 166,
  16393. "../util/IndexedCollection": 175,
  16394. "../util/ajax": 181,
  16395. "../util/common": 185,
  16396. "../util/logger": 189,
  16397. "../util/math": 190,
  16398. "./RoomCollection": 141
  16399. }],
  16400. 139: [function(P, O, e) {
  16401. (function(e) {
  16402. "use strict";
  16403. function t(e, t) {
  16404. o.Object3D.call(this),
  16405. this.sid = t.sid,
  16406. this.data = t,
  16407. this.options = e,
  16408. this.urls = new i(e.urlFiles),
  16409. this.isPublic = void 0 !== t.is_public && t.is_public,
  16410. this.images = new E(this),
  16411. this.images.extend(t.images),
  16412. this.heroImage = this.images.getImage(t.icon),
  16413. this.heroLocations = [],
  16414. this.outdoorPanoLocations = [],
  16415. this.floors = new c(this),
  16416. this.floorsEnabled = void 0 === e.floors || e.floors,
  16417. this.changingFloor = !1,
  16418. this.chunks = [],
  16419. this.panos = new g,
  16420. this.colliders = [],
  16421. this.loadPanosPromise = null,
  16422. this.loadMeshTexturesPromise = null,
  16423. this.auxDataPromise = null,
  16424. this.meshTexturesLoaded = !1,
  16425. this.meshTextures = [],
  16426. this.tags = {},
  16427. this.tagsShown = !1,
  16428. this.shouldShowtags = !1,
  16429. this.has360Views = !1,
  16430. this.showingLabels = u.labels.enabled && t.player_options.labels,
  16431. this.supportedModes = {},
  16432. this.supportedModes[s.PANORAMA] = !0,
  16433. this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
  16434. this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
  16435. this.supportedModes[s.TRANSITIONING] = !0,
  16436. this.supportsTiles = this.configureTiling(),
  16437. this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || !0,
  16438. this.mode = s.DOLLHOUSE,
  16439. this.size = null,
  16440. this.center = null,
  16441. this.boundingBox = new o.Box3,
  16442. this.currentFloor = null,
  16443. this.allFloorsVisible = !0,
  16444. this.projectedPano0 = null,
  16445. this.projectedPano1 = null,
  16446. this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
  16447. this.addFloor(new r(this,t,e.trim()))
  16448. }
  16449. .bind(this)),
  16450. this.waitQueue = [],
  16451. this.on("load", function(e) {
  16452. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16453. return !e.isLoadedCallback()
  16454. }),
  16455. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16456. }
  16457. .bind(this)),
  16458. this.setupCustomProperties(),
  16459. this.hots = {}
  16460. }
  16461. var o = P("three")
  16462. , a = P("../util/ajax")
  16463. , i = P("../util/ModelUrls")
  16464. , n = P("../objects/BoundingTextureSkybox")
  16465. , s = P("../enum/Viewmode")
  16466. , l = P("../enum/RenderOrder")
  16467. , r = (P("../enum/AlignmentType"),
  16468. P("../objects/Floor"))
  16469. , c = P("./FloorCollection")
  16470. , h = P("../objects/Chunk")
  16471. , u = (P("../objects/Room"),
  16472. P("../objects/Snapshot"),
  16473. P("../label/Label"),
  16474. P("../util/math"),
  16475. P("../settings"))
  16476. , d = P("../shaders")
  16477. , p = P("../util/logger")
  16478. , f = (P("../tag/tag"),
  16479. P("../tag/tagManager"),
  16480. P("../objects/Panorama"))
  16481. , g = P("../util/PanoramaCollection")
  16482. , m = P("../loaders/ModelLoader")
  16483. , v = P("../loaders/ModelTextureLoader")
  16484. , y = P("../loaders/SweepDataLoader")
  16485. , A = P("../util/transitions")
  16486. , C = (P("../util/easing"),
  16487. P("../util/lerp"),
  16488. P("../util/common"))
  16489. , I = (P("../util/texture"),
  16490. P("./../util/browser"))
  16491. , E = P("./ImageCollection")
  16492. , _ = P("./RoomCollection")
  16493. , b = P("./LabelCollection")
  16494. , w = P("./Chunks")
  16495. , T = P("./../util/showcase")
  16496. , x = P("../exception/BasicException")
  16497. , S = (P("../constants"),
  16498. P("events").EventEmitter)
  16499. , M = P("hot")
  16500. , R = new p(e);
  16501. t.prototype = Object.create(o.Object3D.prototype),
  16502. C.extend(t, S),
  16503. t.prototype.setupCustomProperties = function() {
  16504. var t = u.modelAlpha;
  16505. Object.defineProperty(this, "alpha", {
  16506. get: function() {
  16507. return t
  16508. },
  16509. set: function(e) {
  16510. t = e,
  16511. this.chunks.forEach(function(e) {
  16512. e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
  16513. })
  16514. }
  16515. })
  16516. }
  16517. ,
  16518. t.prototype.configureTiling = function() {
  16519. var e = function() {
  16520. try {
  16521. var e = document.createElement("canvas")
  16522. , t = e.getContext("webgl");
  16523. return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  16524. } catch (e) {
  16525. return 0
  16526. }
  16527. }();
  16528. if (e < 2048)
  16529. return !1;
  16530. R.warn("Max cube texture size: " + e);
  16531. for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
  16532. var i = u.tiling.tilingFlagNames[t];
  16533. if ("1" === I.valueFromHash(i, null))
  16534. return !0;
  16535. if ("0" === I.valueFromHash(i, null))
  16536. return !1
  16537. }
  16538. return !!T.modelDataPromisesTiles(this.data)
  16539. }
  16540. ,
  16541. t.prototype.toggleAlpha = function() {
  16542. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16543. }
  16544. ,
  16545. t.prototype.load = function(e) {
  16546. var t = this.urls.init().then(function() {
  16547. return $.when(this.loadPanos(), this.loadMesh())
  16548. }
  16549. .bind(this));
  16550. return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
  16551. this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
  16552. $.when(t, this.auxDataPromise).done(this.build.bind(this))
  16553. }
  16554. ,
  16555. t.prototype.loadMesh = function() {
  16556. var n = $.Deferred()
  16557. , r = this;
  16558. return m.load(r.data.job.uuid, r.urls, function(e, t) {
  16559. if (0 === e.length) {
  16560. R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  16561. r.supportedModes[s.DOLLHOUSE] = !1,
  16562. r.supportedModes[s.FLOORPLAN] = !1;
  16563. var i = new h({
  16564. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  16565. });
  16566. i.material.visible = !1,
  16567. i.rotateX(-Math.PI / 2),
  16568. i.geometry.computeBoundingBox(),
  16569. e = [i]
  16570. }
  16571. e.forEach(function(e) {
  16572. var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
  16573. r.addChunk(t, e)
  16574. }),
  16575. r.floors.sort(),
  16576. n.resolve(r)
  16577. }, function(e, t) {
  16578. n.notify(e, t)
  16579. }, function(e) {
  16580. R.error(e),
  16581. n.reject("loading-failed")
  16582. }),
  16583. n.promise()
  16584. }
  16585. ,
  16586. t.prototype.loadMeshTextures = function() {
  16587. return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
  16588. this.meshTexturesLoaded = !0
  16589. }
  16590. .bind(this))),
  16591. this.loadTexturesPromise
  16592. }
  16593. ,
  16594. t.prototype.shineHots = function() {
  16595. A.trigger({
  16596. func: function(e) {
  16597. var opa = e <= .5 ? 2 * e : -2 * e + 2
  16598. for(var i in this.hots){
  16599. this.hots[i].mesh.material.uniforms.opac.value = opa;
  16600. }
  16601. }
  16602. .bind(this),
  16603. cycling: !0,
  16604. duration: 3e3,
  16605. name: "hotShine"
  16606. })
  16607. }
  16608. ,
  16609. t.prototype.createHotItem = function(e, t) {
  16610. for (var i = document.createDocumentFragment(), n = Object.keys(e), r = 0; r < n.length; r++) {
  16611. var o = document.createElement("li")
  16612. , a = document.createElement("span");
  16613. a.innerHTML = e[n[r]].title || "热点",
  16614. o.hot = t[n[r]],
  16615. o.appendChild(a),
  16616. i.appendChild(o)
  16617. }
  16618. document.querySelector("#hotListContent ul").appendChild(i),
  16619. console.log(i)
  16620. }
  16621. ,
  16622. t.prototype.loadOverlays = function(overlays){
  16623. var overlays = window.data2.overlays /* ||
  16624. [
  16625. { depth: 0.02,
  16626. file: "https://super.4dage.com/data/TEST/overlay/b6fe7cb6bd2b6.mp4",
  16627. hasBox: 0,
  16628. height: 0.8165,
  16629. media: ["video"],
  16630. pos: [-4.3132, 0.6788, -13.5162],
  16631. qua: [0, 0.9396, 0, 0.3421],
  16632. sid: "1591079418827",
  16633. width: 0.6124
  16634. }] */
  16635. overlays && overlays.forEach((info)=>{
  16636. new Overlay(info)
  16637. })
  16638. }
  16639. ,
  16640. t.prototype.loadhots = function() {
  16641. var r = $.Deferred()
  16642. , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
  16643. return a.get(e, {
  16644. responseType: "json",
  16645. auth: this.isPublic ? null : u.authorizationHeader
  16646. }).done(function(e) {
  16647. window.data2 = e;
  16648. for (var t in g_data2 = hotMatcher(e),
  16649. this.hotsCount = 0,
  16650. e.hots)
  16651. this.hotsCount++,
  16652. this.hots[t] = new M(t,e.hots[t],this);
  16653. g_index = I.valueFromHash("m"),
  16654. e.tourAudio && (g_tourAudio = new Audio,
  16655. g_tourAudio.loop = !1,
  16656. g_tourAudio.addEventListener("ended", function() {
  16657. var e = document.createEvent("MouseEvent");
  16658. e.initEvent("tourAudioEnded", !0, !0),
  16659. window.dispatchEvent(e)
  16660. }));
  16661. var i = $.Deferred()
  16662. , n = g_Prefix + "data/" + this.sid + "/hot/js/data.js?" + randomTime().getTime();
  16663. a.get(n, {
  16664. responseType: "json",
  16665. auth: this.isPublic ? null : u.authorizationHeader
  16666. }).done(function(e) {
  16667. window.hotData = e,
  16668. this.createHotItem(e, this.hots),
  16669. i.resolve()
  16670. }
  16671. .bind(this)).fail(function() {
  16672. console.log("Data.js is empty"),
  16673. i.resolve()
  16674. }),
  16675. e.weixinDesc && (g_weixinObj.desc = e.weixinDesc),
  16676. window.wx && manage.weixinShare(),
  16677. r.resolve()
  16678. }
  16679. .bind(this)).fail(function() {
  16680. console.log("没有热点"),
  16681. window.wx && manage.weixinShare(),
  16682. r.resolve()
  16683. }),
  16684. r
  16685. }
  16686. ,
  16687. t.prototype.loadPanos = function() {
  16688. if (this.loadPanosPromise)
  16689. return this.loadPanosPromise;
  16690. var e = new y(this);
  16691. return this.loadPanosPromise = e.load().then(function(e) {
  16692. return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
  16693. return this.data.sweeps[e.uuid].enabled
  16694. }
  16695. .bind(this))),
  16696. this.panos.extend(e.map(function(e) {
  16697. return new f(this,e.uuid,e,this.supportsTiles)
  16698. }
  16699. .bind(this))),
  16700. this.panos.forEach(function(i) {
  16701. i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
  16702. var t = this.panos.get(e);
  16703. t && this.panos.setNeighbour(i, t, !0)
  16704. }
  16705. .bind(this)),
  16706. i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
  16707. }
  16708. .bind(this)),
  16709. 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
  16710. this.supportedModes[s.PANORAMA] = !1),
  16711. $.when(this)
  16712. }
  16713. .bind(this)),
  16714. this.loadPanosPromise
  16715. }
  16716. ,
  16717. t.prototype.loadHighlightReel = function() {
  16718. var t = $.Deferred()
  16719. , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  16720. return a.get(e, {
  16721. responseType: "json",
  16722. auth: this.isPublic ? null : u.authorizationHeader
  16723. }).done(function(e) {
  16724. e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
  16725. this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
  16726. t.resolve()
  16727. }
  16728. .bind(this)).fail(function() {
  16729. R.warn("Getting highlight reel failed, no highlights available"),
  16730. t.resolve()
  16731. }),
  16732. t
  16733. }
  16734. ,
  16735. t.prototype.waitForLoad = function(e, t) {
  16736. t() || (this.waitQueue.push({
  16737. object: e,
  16738. isLoadedCallback: t
  16739. }),
  16740. 1 === this.waitQueue.length && this.emit("waiting"))
  16741. }
  16742. ,
  16743. t.prototype.hide = function() {
  16744. this.floors.hide()
  16745. }
  16746. ,
  16747. t.prototype.show = function() {
  16748. this.floors.show()
  16749. }
  16750. ,
  16751. t.prototype.floorNames = function() {
  16752. return this.floors.names()
  16753. }
  16754. ,
  16755. t.prototype.warpDestFloors = function(e, t) {
  16756. if (e && this.floors.length === e.length) {
  16757. var i = e.findIndex(function(e) {
  16758. return e
  16759. }
  16760. .bind(this));
  16761. -1 !== i && this.setFloor(this.floors.list[i], null, t)
  16762. } else
  16763. this.toggleAllFloors(!0)
  16764. }
  16765. ,
  16766. t.prototype.setFloor = function(e, t, i) {
  16767. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  16768. this.allFloorsVisible = !1,
  16769. this._setFloor(e, t, i)
  16770. }
  16771. ,
  16772. t.prototype.toggleAllFloors = function(e) {
  16773. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  16774. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  16775. this._setFloor(this.currentFloor)
  16776. }
  16777. ,
  16778. t.prototype._setFloor = function(e, t, i) {
  16779. var n;
  16780. if (t = t || this.mode,
  16781. this.emit("floor.changed", e, t, this.currentFloor),
  16782. this.currentFloor = e,
  16783. t === s.PANORAMA) {
  16784. if (this.show(),
  16785. this.shouldShowtags && this.tagsShown)
  16786. for (n in this.tags)
  16787. this.tags[n].show(u.showFloorDuration)
  16788. } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  16789. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  16790. }
  16791. .bind(this)),
  16792. this.shouldShowtags && this.tagsShown))
  16793. for (n in this.tags) {
  16794. var r = this.tags[n];
  16795. this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
  16796. }
  16797. var o = this
  16798. , a = e;
  16799. A.start(function() {}, u.showFloorDelay, function() {
  16800. o.floors.forEach(function(t) {
  16801. t.chunks.forEach(function(e) {
  16802. e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
  16803. })
  16804. })
  16805. }
  16806. .bind(this))
  16807. }
  16808. ,
  16809. t.prototype.toggleExplode = function() {
  16810. this.floors.toggleExplodeHorizontal()
  16811. }
  16812. ,
  16813. t.prototype.toggleExplodeUp = function() {
  16814. this.floors.toggleExplodeVertical()
  16815. }
  16816. ,
  16817. t.prototype.nextFloor = function(e) {
  16818. return this.floors.nextFloor(this.currentFloor, e)
  16819. }
  16820. ,
  16821. t.prototype.addFloor = function(e) {
  16822. this.floors.add(e)
  16823. }
  16824. ,
  16825. t.prototype.getFloorAtPoint = function(e) {
  16826. return this.floors.getFloorAtPoint(e)
  16827. }
  16828. ,
  16829. t.prototype.getTagBySid = function(e) {
  16830. return this.tags[e]
  16831. }
  16832. ,
  16833. t.prototype.addChunk = function(e, t) {
  16834. this.floors.getOrMakeFloor(e).addChunk(t),
  16835. this.chunks.push(t)
  16836. }
  16837. ,
  16838. t.prototype.setMode = function(t) {
  16839. if (!this.supportedModes[t])
  16840. throw new x("Mode not supported for this model: " + t);
  16841. this.mode = t,
  16842. this.chunks.forEach(function(e) {
  16843. e.setMode(t)
  16844. })
  16845. }
  16846. ,
  16847. t.prototype.build = function() {
  16848. this.heroLocations = this.images.getHeroLocations(this.panos);
  16849. var e = function() {
  16850. 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()
  16851. }
  16852. .bind(this)();
  16853. for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
  16854. return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  16855. }
  16856. .bind(this)) || e,
  16857. null === this.heroImage && R.warn("No hero image defined."),
  16858. this.currentFloor = this.floors.last(),
  16859. this.floors.build(),
  16860. this.colliders = this.floors.reduce(function(e, t) {
  16861. return e.concat(t.collider.children)
  16862. }, []),
  16863. this.panos.forEach(function(e) {
  16864. e.build1(),
  16865. e.on("enter", function() {
  16866. e.floor !== this.currentFloor && this.setFloor(e.floor)
  16867. }
  16868. .bind(this))
  16869. }
  16870. .bind(this)),
  16871. this.panos.forEach(function(e) {
  16872. e.build2()
  16873. }),
  16874. this.floors.forEach(function(e) {
  16875. this.boundingBox.union(e.boundingBox)
  16876. }
  16877. .bind(this)),
  16878. this.size = this.boundingBox.size(),
  16879. this.center = this.boundingBox.center(),
  16880. this.floors.forEach(function(e) {
  16881. R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  16882. }
  16883. .bind(this)),
  16884. this.panos.populate_path_graph(),
  16885. this.skybox = new n(this.boundingBox),
  16886. this.skybox.matrixWorldNeedsUpdate = !0,
  16887. this.add(this.skybox),
  16888. setTimeout(function() {
  16889. this.hotsCount && this.shineHots()
  16890. }
  16891. .bind(this), 1300),
  16892. this.tags)
  16893. this.tags[t].build();
  16894. return R.debug("Done building model"),
  16895. 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
  16896. R.warn("raycasts skipped: " + f.raycastsSkipped)),
  16897. this.buildRooms(),
  16898. this.labels.associateWithRooms(this.rooms),
  16899. $.when(this)
  16900. }
  16901. ,
  16902. t.prototype.loadLabels = function() {
  16903. this.labels = new b(this);
  16904. var e = $.Deferred();
  16905. if (window.MP_PREFETCHED_MODELDATA.model.player_options.labels && (this.showingLabels = !0),
  16906. !this.showingLabels)
  16907. return e.resolve();
  16908. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  16909. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  16910. R.warn("Getting labels failed, not displaying labels."),
  16911. e.resolve()
  16912. }),
  16913. e
  16914. }
  16915. ,
  16916. t.prototype.buildRooms = function() {
  16917. this.rooms = new _(this),
  16918. this.rooms.createFromChunks(this.chunks),
  16919. this.rooms.calcRoomBoundaries()
  16920. }
  16921. ,
  16922. t.prototype.updateProjectedPanos = function() {
  16923. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  16924. }
  16925. ,
  16926. t.prototype.setProjectedPanos = function(t, i, n) {
  16927. null != n || (n = !0),
  16928. n = !!n,
  16929. this.projectedPano0 = t,
  16930. this.projectedPano1 = i,
  16931. this.skybox.material.setProjectedPanos(t, i, n),
  16932. this.chunks.forEach(function(e) {
  16933. e.materialInside.setProjectedPanos(t, i, n)
  16934. })
  16935. }
  16936. ,
  16937. t.prototype.setSide = function(t) {
  16938. this.floors.forEach(function(e) {
  16939. e.collider.material.side = t
  16940. })
  16941. }
  16942. ,
  16943. t.prototype.heroCount = function() {
  16944. return this.heroLocations ? this.heroLocations.length : 0
  16945. }
  16946. ,
  16947. t.prototype.getHeroDescriptorByIndex = function(e) {
  16948. if (e < 0)
  16949. return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  16950. null;
  16951. if (this.heroCount() < 1)
  16952. return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  16953. null;
  16954. var t = this.heroLocations[e];
  16955. return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  16956. null) : t
  16957. }
  16958. ,
  16959. t.prototype.findPanoramicHero = function() {
  16960. for (var e in this.heroLocations)
  16961. if (this.heroLocations[e].cameraMode === s.PANORAMA)
  16962. return this.heroLocations[e];
  16963. return null
  16964. }
  16965. ,
  16966. t.prototype.listImagePanos = function() {
  16967. var i = []
  16968. , n = this;
  16969. return this.images.forEach(function(e) {
  16970. if (e.metadata && e.metadata.scan_id) {
  16971. var t = n.panos.get(e.metadata.scan_id);
  16972. t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
  16973. }
  16974. }),
  16975. i
  16976. }
  16977. ,
  16978. t.prototype.fadePanoMarkers = function(e, t) {
  16979. this.panos.fadeMarkerOpacity(e, t)
  16980. }
  16981. ,
  16982. t.prototype.setSweepVisibility = function(t) {
  16983. this.panos.forEach(function(e) {
  16984. e.marker && (e.marker.visible = t)
  16985. })
  16986. }
  16987. ,
  16988. t.prototype.outsideAllowed = function() {
  16989. return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
  16990. }
  16991. ,
  16992. O.exports = t
  16993. }
  16994. ).call(this, "/js/model/Model.js")
  16995. }
  16996. , {
  16997. "../constants": 8,
  16998. "../enum/AlignmentType": 17,
  16999. "../enum/RenderOrder": 42,
  17000. "../enum/Viewmode": 51,
  17001. "../exception/BasicException": 55,
  17002. "../label/Label": 90,
  17003. "../loaders/ModelLoader": 105,
  17004. "../loaders/ModelTextureLoader": 106,
  17005. "../loaders/SweepDataLoader": 107,
  17006. "../tag/tag": 123,
  17007. "../tag/tagManager": 124,
  17008. "../objects/BoundingTextureSkybox": 143,
  17009. "../objects/Chunk": 144,
  17010. "../objects/Floor": 146,
  17011. "../objects/Panorama": 148,
  17012. "../objects/Room": 150,
  17013. "../objects/Snapshot": 153,
  17014. "../settings": 166,
  17015. "../shaders": 167,
  17016. "../util/ModelUrls": 177,
  17017. "../util/PanoramaCollection": 178,
  17018. "../util/ajax": 181,
  17019. "../util/common": 185,
  17020. "../util/easing": 186,
  17021. "../util/lerp": 188,
  17022. "../util/logger": 189,
  17023. "../util/math": 190,
  17024. "../util/texture": 194,
  17025. "../util/transitions": 195,
  17026. "./../util/browser": 182,
  17027. "./../util/showcase": 193,
  17028. "./Chunks": 135,
  17029. "./FloorCollection": 136,
  17030. "./ImageCollection": 137,
  17031. "./LabelCollection": 138,
  17032. "./RoomCollection": 141,
  17033. events: 202,
  17034. three: 217,
  17035. hot: "hot"
  17036. }],
  17037. 140: [function(e, t, i) {
  17038. "use strict";
  17039. function n() {
  17040. this.modelMap = {},
  17041. this.activeModel = null,
  17042. this.modelCount = 0,
  17043. this.tileDownloader = null,
  17044. this.panoRenderer = null
  17045. }
  17046. var r = (e("three"),
  17047. e("../util/common"))
  17048. , o = e("../exception/BasicException")
  17049. , a = e("../enum/ModelManagerEvents")
  17050. , s = e("../enum/PanoRendererEvents")
  17051. , l = e("events").EventEmitter;
  17052. n.prototype.init = function(e, t, i) {
  17053. this.tileDownloader = e,
  17054. this.panoRenderer = t,
  17055. this.qualityManager = i,
  17056. this.bindEvents()
  17057. }
  17058. ,
  17059. n.prototype.bindEvents = function() {
  17060. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17061. }
  17062. ,
  17063. n.prototype.onTileRendered = function(e, t, i, n) {}
  17064. ,
  17065. n.prototype.addModel = function(e) {
  17066. this.modelMap[e.sid] = e,
  17067. 0 === this.modelCount && this.activateModel(e.sid),
  17068. this.modelCount++,
  17069. this.emit(a.ModelAdded)
  17070. }
  17071. ,
  17072. n.prototype.getModel = function(e) {
  17073. return this.modelMap[e]
  17074. }
  17075. ,
  17076. n.prototype.activateModel = function(e) {
  17077. var t = this.modelMap[e];
  17078. if (!t)
  17079. throw new o("Tried to activate invalid model!");
  17080. var i = this.activeModel;
  17081. this.activeModel = t,
  17082. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17083. this.tileDownloader.setUrls(t.urls),
  17084. t.panos.forEach(function(e) {
  17085. e.attachToPanoRenderer(this.panoRenderer),
  17086. e.tileDownloader = this.tileDownloader,
  17087. e.qualityManager = this.qualityManager
  17088. }
  17089. .bind(this)),
  17090. this.emit(a.ActiveModelChanged, {
  17091. oldModel: i,
  17092. model: t
  17093. })
  17094. }
  17095. ,
  17096. n.prototype.getActiveModel = function() {
  17097. return this.activeModel
  17098. }
  17099. ,
  17100. r.extend(n, l),
  17101. t.exports = n
  17102. }
  17103. , {
  17104. "../enum/ModelManagerEvents": 33,
  17105. "../enum/PanoRendererEvents": 35,
  17106. "../exception/BasicException": 55,
  17107. "../util/common": 185,
  17108. events: 202,
  17109. three: 217
  17110. }],
  17111. 141: [function(r, l, e) {
  17112. (function(e) {
  17113. "use strict";
  17114. function o() {
  17115. n.call(this)
  17116. }
  17117. var a = r("../objects/Room")
  17118. , t = (r("../settings"),
  17119. r("../util/logger"))
  17120. , i = (r("../util/transitions"),
  17121. r("../util/easing"),
  17122. r("../util/common"))
  17123. , n = r("../util/IndexedCollection")
  17124. , s = r("./Chunks");
  17125. new t(e),
  17126. i.inherit(o, n),
  17127. o.prototype.getIndex = function(e) {
  17128. return e.roomId
  17129. }
  17130. ,
  17131. o.prototype.calcRoomBoundaries = function() {
  17132. this.forEach(function(e) {
  17133. e.calcBoundaries()
  17134. })
  17135. }
  17136. ,
  17137. o.prototype.createFromChunks = function(e) {
  17138. var n = {
  17139. floorId: -1,
  17140. roomId: -1
  17141. }
  17142. , r = {};
  17143. e.forEach(function(e) {
  17144. s.parseIdsFromChunkName(e.name, n);
  17145. var t = r[n.roomId];
  17146. if (!t) {
  17147. var i = o.generateRoomId(n.floorId, n.roomId);
  17148. t = new a(n.floorId,i),
  17149. this.add(t),
  17150. r[n.roomId] = t
  17151. }
  17152. t.addChunk(e)
  17153. }
  17154. .bind(this)),
  17155. this.calcRoomBoundaries()
  17156. }
  17157. ,
  17158. o.generateRoomId = function(e, t) {
  17159. return e + "_" + t
  17160. }
  17161. ,
  17162. l.exports = o
  17163. }
  17164. ).call(this, "/js/model/RoomCollection.js")
  17165. }
  17166. , {
  17167. "../objects/Room": 150,
  17168. "../settings": 166,
  17169. "../util/IndexedCollection": 175,
  17170. "../util/common": 185,
  17171. "../util/easing": 186,
  17172. "../util/logger": 189,
  17173. "../util/transitions": 195,
  17174. "./Chunks": 135
  17175. }],
  17176. 142: [function(e, t, i) {
  17177. "use strict";
  17178. function n(e, t, i) {
  17179. var n = (e = e.clone()).size()
  17180. , r = new o.BoxGeometry(n.x,n.y,n.z);
  17181. r.boundingBox = e,
  17182. o.Mesh.call(this, r, t),
  17183. this.position.copy(e.center()),
  17184. this.frustumCulled = !1,
  17185. i && this.add(new o.WireframeHelper(this))
  17186. }
  17187. var o = e("three");
  17188. (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
  17189. t.exports = n
  17190. }
  17191. , {
  17192. three: 217
  17193. }],
  17194. 143: [function(l, c, e) {
  17195. (function(e) {
  17196. "use strict";
  17197. function t(e) {
  17198. s.time("Computing a nice bounding cubemap");
  17199. var t = new r({
  17200. side: i.BackSide,
  17201. transparent: !0
  17202. });
  17203. t.uniforms.modelAlpha.value = 0,
  17204. t.uniforms.opacity.value = 1 - o.modelAlpha,
  17205. this.renderOrder = a.boundingSkybox,
  17206. n.call(this, e, t),
  17207. s.timeEnd("Computing a nice bounding cubemap")
  17208. }
  17209. var i = l("three")
  17210. , n = (l("../enum/Viewmode"),
  17211. l("../shaders"),
  17212. l("./BoundingMesh"))
  17213. , r = l("../materials/ModelTextureMaterial")
  17214. , o = l("../settings")
  17215. , a = l("../enum/RenderOrder")
  17216. , s = new (l("../util/logger"))(e);
  17217. (t.prototype = Object.create(n.prototype)).constructor = t,
  17218. c.exports = t
  17219. }
  17220. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17221. }
  17222. , {
  17223. "../enum/RenderOrder": 42,
  17224. "../enum/Viewmode": 51,
  17225. "../materials/ModelTextureMaterial": 118,
  17226. "../settings": 166,
  17227. "../shaders": 167,
  17228. "../util/logger": 189,
  17229. "./BoundingMesh": 142,
  17230. three: 217
  17231. }],
  17232. 144: [function(e, t, i) {
  17233. "use strict";
  17234. function n(e) {
  17235. this.materialInside = new s({
  17236. side: r.DoubleSide
  17237. });
  17238. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17239. this.materialOutside = new r.RawShaderMaterial({
  17240. fragmentShader: o.modelOutside.fragmentShader,
  17241. vertexShader: o.modelOutside.vertexShader,
  17242. uniforms: t,
  17243. side: r.FrontSide,
  17244. name: "chunkOut"
  17245. }),
  17246. r.Mesh.call(this, e.geometry, this.materialInside),
  17247. this.name = e.name || "",
  17248. this.textureName = e.textureName,
  17249. this.meshUrl = e.meshUrl
  17250. }
  17251. var r = e("three")
  17252. , o = e("../shaders")
  17253. , a = e("../enum/Viewmode")
  17254. , s = e("../materials/ModelTextureMaterial");
  17255. (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
  17256. this.materialInside.uniforms.map.value = e,
  17257. this.materialOutside.uniforms.map.value = e
  17258. }
  17259. ,
  17260. n.prototype.setMode = function(e) {
  17261. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17262. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17263. t.transparent = this.material.transparent,
  17264. t.uniforms.opacity.value = this.material.uniforms.opacity.value;
  17265. this.material = t
  17266. }
  17267. ,
  17268. t.exports = n
  17269. }
  17270. , {
  17271. "../enum/Viewmode": 51,
  17272. "../materials/ModelTextureMaterial": 118,
  17273. "../shaders": 167,
  17274. three: 217
  17275. }],
  17276. 145: [function(e, t, i) {
  17277. "use strict";
  17278. function n(e) {
  17279. this.chunksize = e || 10,
  17280. this.chunks = {},
  17281. this.boundingBoxes = {},
  17282. this.children = [],
  17283. this.offset = new m.Vector3(0,.5,0),
  17284. this.material = new m.MeshBasicMaterial({
  17285. color: 16777215 * Math.random(),
  17286. side: m.DoubleSide
  17287. })
  17288. }
  17289. var m = e("three");
  17290. e("../enum/Viewmode"),
  17291. n.prototype.add = function(e) {
  17292. var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
  17293. u ? (t = u.position.array,
  17294. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17295. e.faces);
  17296. var d = new m.Vector3;
  17297. if (i)
  17298. for (n = 0,
  17299. r = i.length; n < r; n += 3) {
  17300. var p = 3 * i[n]
  17301. , f = 3 * i[n + 1]
  17302. , g = 3 * i[n + 2];
  17303. o = (t[p] + t[f] + t[g]) / 3,
  17304. a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
  17305. s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
  17306. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17307. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17308. this.boundingBoxes[l] = new m.Box3),
  17309. 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]),
  17310. c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
  17311. c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
  17312. c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
  17313. }
  17314. else
  17315. for (n = 0,
  17316. r = t.length; n < r; n += 9)
  17317. o = (t[n] + t[n + 3] + t[n + 6]) / 3,
  17318. a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
  17319. s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
  17320. c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
  17321. this.boundingBoxes[l]) : (h = this.chunks[l] = [],
  17322. this.boundingBoxes[l] = new m.Box3),
  17323. 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]),
  17324. c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
  17325. c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
  17326. c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
  17327. }
  17328. ,
  17329. n.prototype.build = function() {
  17330. var e = new m.Object3D;
  17331. for (var t in e.material = this.material,
  17332. this.chunks) {
  17333. var i = this.chunks[t]
  17334. , n = new m.BufferGeometry;
  17335. n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
  17336. n.boundingBox = this.boundingBoxes[t];
  17337. var r = new m.Mesh(n,this.material);
  17338. r.material.visible = !1,
  17339. e.add(r),
  17340. this.chunks[t] = []
  17341. }
  17342. return e
  17343. }
  17344. ,
  17345. t.exports = n
  17346. }
  17347. , {
  17348. "../enum/Viewmode": 51,
  17349. three: 217
  17350. }],
  17351. 146: [function(e, t, i) {
  17352. "use strict";
  17353. var n = e("three")
  17354. , r = e("../settings")
  17355. , o = e("../util/common")
  17356. , a = e("../util/lerp")
  17357. , s = e("./ChunkedCollider")
  17358. , l = e("../util/transitions")
  17359. , c = e("../util/easing")
  17360. , h = (e("../objects/Panorama"),
  17361. e("../enum/RenderOrder"));
  17362. e("../localization/localize");
  17363. function u(e, t, i) {
  17364. n.Object3D.call(this),
  17365. this.model = e,
  17366. this.floorIndex = t,
  17367. this.lang = r.languageTag,
  17368. this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
  17369. this.panos = [],
  17370. this.chunks = [],
  17371. this.colliderBuilder = new s(3),
  17372. this.collider = null,
  17373. this.center = null,
  17374. this.boundingBox = new n.Box3,
  17375. this.size = null,
  17376. this.hidden = !1,
  17377. this.conservativeBoundingBox = new n.Box3,
  17378. this.debugColor = 16777215 * Math.random(),
  17379. this.transition = null
  17380. }
  17381. (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
  17382. this.model.setFloor(this, e)
  17383. }
  17384. ,
  17385. u.prototype.hide = function(e) {
  17386. if (!this.hidden || this.transition) {
  17387. this.chunks.forEach(function(e) {
  17388. e.material.transparent = !0
  17389. }),
  17390. l.cancel(this.transition);
  17391. var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
  17392. , i = e ? 0 : r.hideFloorDelay / t;
  17393. this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
  17394. this.hidden = !0
  17395. }
  17396. .bind(this), i, c.easeInOutQuad)
  17397. }
  17398. }
  17399. ,
  17400. u.prototype.show = function(e) {
  17401. if (this.hidden || this.transition) {
  17402. this.hidden = !1,
  17403. l.cancel(this.transition);
  17404. var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
  17405. , i = e ? 0 : r.showFloorDelay / t;
  17406. this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
  17407. this.hidden || this.chunks.forEach(function(e) {
  17408. e.material.transparent = !1
  17409. })
  17410. }
  17411. .bind(this), i, c.easeInOutQuad)
  17412. }
  17413. }
  17414. ,
  17415. u.prototype.toggle = function(e, t) {
  17416. (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
  17417. }
  17418. ,
  17419. u.prototype.containsPoint = function(t) {
  17420. return this.collider.children.some(function(e) {
  17421. return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
  17422. e.geometry.boundingBox.containsPoint(t)
  17423. })
  17424. }
  17425. ,
  17426. u.prototype.distanceToPoint = function(i) {
  17427. var n = null
  17428. , r = 1 / 0;
  17429. return this.collider.children.forEach(function(e) {
  17430. e.geometry.boundingBox || e.geometry.computeBoundingBox();
  17431. var t = e.geometry.boundingBox.distanceToPoint(i);
  17432. (!n || t < r) && (r = t,
  17433. n = e)
  17434. }),
  17435. r
  17436. }
  17437. ,
  17438. u.prototype.addChunk = function(e) {
  17439. e.renderOrder = h.ghostFloor,
  17440. this.add(e),
  17441. this.chunks.push(e),
  17442. this.boundingBox.union(e.geometry.boundingBox),
  17443. this.size = this.boundingBox.size(),
  17444. this.colliderBuilder.add(e.geometry)
  17445. }
  17446. ,
  17447. u.prototype.addPano = function(e) {
  17448. this.panos.push(e),
  17449. this.add(e.skyboxMesh),
  17450. e.marker && this.add(e.marker);
  17451. var t = new n.Vector3(1,1,1)
  17452. , i = (new n.Box3).setFromCenterAndSize(e.position, t);
  17453. this.boundingBox.union(i)
  17454. }
  17455. ,
  17456. u.prototype.build = function() {
  17457. this.collider = this.colliderBuilder.build(!0),
  17458. this.add(this.collider),
  17459. this.center = this.boundingBox.center(),
  17460. this.conservativeBoundingBox.copy(this.boundingBox),
  17461. this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
  17462. return e.geometry.boundingBox.min.y
  17463. }), 5),
  17464. this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
  17465. return e.geometry.boundingBox.max.y
  17466. }), 5),
  17467. this.colliderBuilder = null
  17468. }
  17469. ,
  17470. u.prototype.toShortString = function() {
  17471. return o.nth(this.floorIndex + 1)
  17472. }
  17473. ,
  17474. u.prototype.toString = function() {
  17475. return this.name
  17476. }
  17477. ,
  17478. t.exports = u
  17479. }
  17480. , {
  17481. "../enum/RenderOrder": 42,
  17482. "../localization/localize": 108,
  17483. "./strings-cn-CN": 109,
  17484. "../objects/Panorama": 148,
  17485. "../settings": 166,
  17486. "../util/common": 185,
  17487. "../util/easing": 186,
  17488. "../util/lerp": 188,
  17489. "../util/transitions": 195,
  17490. "./ChunkedCollider": 145,
  17491. three: 217
  17492. }],
  17493. 147: [function(e, t, i) {
  17494. "use strict";
  17495. function n(e) {
  17496. this.player = e,
  17497. this.obj3d = null,
  17498. this.UP = new u.Vector3(0,1,0)
  17499. }
  17500. var u = e("three")
  17501. , d = e("../settings");
  17502. n.prototype.prefs = {
  17503. linewidth: 3,
  17504. height: .07,
  17505. opacity: .45,
  17506. endScale: .05
  17507. },
  17508. n.prototype.discard = function() {
  17509. if (this.obj3d) {
  17510. var e = this.obj3d.parent;
  17511. e && e.remove(this.obj3d)
  17512. }
  17513. this.obj3d = null
  17514. }
  17515. ,
  17516. n.prototype.draw = function() {
  17517. if (this.discard(),
  17518. d.showNeighbors) {
  17519. var e = this.player.currentPano.floor;
  17520. this.obj3d = new u.Object3D;
  17521. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17522. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17523. i.y += this.prefs.height;
  17524. var n = .1525
  17525. , r = new u.Matrix4;
  17526. for (var o in t)
  17527. if (t[o]) {
  17528. var a = this.player.model.panos.get(o)
  17529. , s = (a.position.clone().sub(this.player.model.position),
  17530. a.position.clone().sub(a.floorPosition))
  17531. , l = a.floorPosition.clone().sub(this.player.model.position);
  17532. l.y += this.prefs.height;
  17533. var c = new u.Geometry;
  17534. 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)),
  17535. 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)),
  17536. r.identity().setPosition(s),
  17537. c.applyMatrix(r),
  17538. c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
  17539. 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)),
  17540. r.lookAt(l, i, this.UP).setPosition(l),
  17541. c.applyMatrix(r),
  17542. c.vertices.push(l, i);
  17543. var h = new u.Line(c,new u.LineBasicMaterial({
  17544. color: a.debugColor.getHex(),
  17545. transparent: !0,
  17546. opacity: this.prefs.opacity,
  17547. depthWrite: !1,
  17548. name: "sLine" + o,
  17549. linewidth: this.prefs.linewidth
  17550. }));
  17551. this.obj3d.add(h)
  17552. }
  17553. e.add(this.obj3d)
  17554. }
  17555. }
  17556. ,
  17557. n.prototype.update = function() {
  17558. d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  17559. }
  17560. ,
  17561. t.exports = n
  17562. }
  17563. , {
  17564. "../settings": 166,
  17565. three: 217
  17566. }],
  17567. 148: [function(S, M, e) {
  17568. (function(e) {
  17569. "use strict";
  17570. function r(e, t, i, n) {
  17571. this.model = e,
  17572. this.id = t,
  17573. this.alignmentType = i.alignmentType || c.ALIGNED,
  17574. this.neighbourUUIDs = i.neighbours || null,
  17575. this.neighbourPanos = null,
  17576. this.floor = null,
  17577. this.floorIndex = i.floor,
  17578. this.failedLoadingAt = 0,
  17579. this.maxLoadRetries = 4,
  17580. this.origin = i.position.clone(),
  17581. this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
  17582. this.quaternion = i.quaternion.clone(),
  17583. this.skyboxMesh = new s.Mesh(E),
  17584. this.skyboxMesh.position.copy(this.position),
  17585. this.skyboxMesh.quaternion.copy(this.quaternion),
  17586. this.skyboxMesh.name = "skybox",
  17587. this.skyboxMesh.visible = !1,
  17588. this.skyboxMesh.updateMatrix(),
  17589. this.skyboxMesh.updateMatrixWorld(),
  17590. this.marker = null,
  17591. this.showFloorMarker = this.showFloorMarker = void 0 === window.MP_PREFETCHED_MODELDATA.hideFloorMarker || "false" === window.MP_PREFETCHED_MODELDATA.hideFloorMarker,
  17592. this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
  17593. map: b,
  17594. side: s.DoubleSide,
  17595. opacity: 0,
  17596. transparent: !0,
  17597. depthWrite: !1,
  17598. visible: this.showFloorMarker
  17599. })),
  17600. this.marker.renderOrder = l.panoMarker,
  17601. this.marker.name = "marker",
  17602. (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
  17603. this.marker.updateMatrixWorld(),
  17604. a.colorMarkerOnLoad && this.on("load", function() {
  17605. this.marker.material.color.set(65280)
  17606. })),
  17607. this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  17608. this.floorPosition = i.puck ? i.puck.clone() : null,
  17609. this.tiled = n,
  17610. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
  17611. this.solidSkybox.flipY = !1,
  17612. a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
  17613. this.solidSkybox.magFilter = s.LinearFilter,
  17614. this.solidSkybox.generateMipmaps = !1)),
  17615. this.zoomed = !1,
  17616. this.panoRenderer = null,
  17617. this.qualityManager = null,
  17618. this.tileDownloader = null,
  17619. this.tiledPanoRenderTarget = null,
  17620. this.minimumTiledPanoLoaded = !1,
  17621. this.highestPartialTileRenderOpCompleted = 0,
  17622. this.highestFullTileRenderOpCompleted = 0,
  17623. this.shouldRedrawOnBaseLoaded = !1,
  17624. this.lockUntilRenderingComplete = !1,
  17625. a.colorMarkerOnLoad && this.on("load", function() {
  17626. this.marker.material.color.set(65280)
  17627. }),
  17628. (e = new s.TextureLoader).setCrossOrigin(!0);
  17629. var r = e.load("images/texture.jpg");
  17630. if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
  17631. color: 16777215,
  17632. transparent: !0,
  17633. opacity: .75,
  17634. map: r
  17635. })),
  17636. this.vrMarker.boluoType = "vr",
  17637. this.vrMarker.position.z = 1,
  17638. this.vrMarker.enabled = !0,
  17639. this.vrMarker.visible = !1,
  17640. window.vrMarkers = window.vrMarkers || [],
  17641. window.vrMarkers.push(this.vrMarker),
  17642. this.marker && this.marker.add(this.vrMarker),
  17643. a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
  17644. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
  17645. this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
  17646. this.adjustAngleEnable) {
  17647. (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
  17648. this.skyboxMesh.quaternion.multiply(i);
  17649. var o = new s.Quaternion;
  17650. o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
  17651. this.skyboxMesh.quaternion.multiply(o),
  17652. (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
  17653. this.skyboxMesh.quaternion.multiply(n),
  17654. this.skyboxMesh.updateMatrix(),
  17655. this.skyboxMesh.updateMatrixWorld(),
  17656. this.model.updateProjectedPanos()
  17657. }
  17658. }
  17659. var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
  17660. S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
  17661. S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
  17662. S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
  17663. S("../enum/GLCubeFaces"),
  17664. S("../exception/BasicException")), A = S("../tile/TileUtils"), C = S("events").EventEmitter, I = new n(e), E = new s.SphereBufferGeometry(.1), _ = new s.PlaneBufferGeometry(.4,.4,1,1), b = d.load("images/marker-256x256.png");
  17665. (r.prototype = Object.create(C.prototype)).enter = (t = null,
  17666. function() {
  17667. this.setZoomed(!1),
  17668. this.emit("enter", {
  17669. oldPano: t,
  17670. newPano: this
  17671. }),
  17672. t = this
  17673. }
  17674. ),
  17675. r.prototype.exit = function() {
  17676. this.tiled ? (this.clearWaitDeferreds(),
  17677. this.minimumTiledPanoLoaded = !1,
  17678. this.tiledPanoRenderTarget = null,
  17679. this.setZoomed(!1),
  17680. this.panoRenderer.deactivateTiledPano(this),
  17681. this.highestPartialTileRenderOpCompleted = 0,
  17682. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  17683. this.solidSkybox.loaded = !1,
  17684. this.solidSkybox.version = 0),
  17685. this.emit("exit")
  17686. }
  17687. ,
  17688. r.prototype.hoverOn = function(e) {
  17689. this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  17690. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  17691. }
  17692. ,
  17693. r.prototype.hoverOff = function(e) {
  17694. this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  17695. }
  17696. ,
  17697. r.prototype.build1 = function() {
  17698. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  17699. this.floor.addPano(this),
  17700. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  17701. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  17702. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  17703. }
  17704. ,
  17705. r.prototype.build2 = function() {
  17706. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  17707. this.height = this.position.distanceTo(this.floorPosition),
  17708. this.placeMarker()
  17709. }
  17710. ,
  17711. r.prototype.interpolateFloorPosition = function() {
  17712. var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
  17713. return !!e.floorPosition
  17714. }).sort(function(e, t) {
  17715. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  17716. }
  17717. .bind(this))
  17718. , t = this.position.clone();
  17719. return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  17720. t
  17721. }
  17722. ,
  17723. r.prototype.raycastFloorPosition = function() {
  17724. I.warn("Performance warning: Raycasting to find floor position");
  17725. var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
  17726. return e.length ? e[0].point : null
  17727. }
  17728. ,
  17729. 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)],
  17730. function() {
  17731. I.warn("Performance warning: Raycasting to find floor index");
  17732. for (var e = 0; e < i.length; e++) {
  17733. var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
  17734. if (t.length)
  17735. return t[0].object.parent.parent
  17736. }
  17737. return null
  17738. }
  17739. ),
  17740. r.prototype.placeMarker = function() {
  17741. this.marker && (this.marker.position.copy(this.floorPosition),
  17742. this.marker.position.y += .05,
  17743. this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
  17744. }
  17745. ,
  17746. r.prototype.translate = function(e) {
  17747. this.position.add(e),
  17748. this.floorPosition.add(e)
  17749. }
  17750. ,
  17751. r.prototype.findClosestMidtpointPanoTo = function(e) {
  17752. return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
  17753. this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
  17754. }
  17755. ,
  17756. r.prototype.attachToPanoRenderer = function(e) {
  17757. this.panoRenderer = e,
  17758. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  17759. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  17760. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  17761. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  17762. }
  17763. ;
  17764. var w, T, x = {};
  17765. r.prototype.getWaitDeferred = function(e) {
  17766. var t = x[this.id];
  17767. t || (t = {},
  17768. x[this.id] = t);
  17769. var i = t[e];
  17770. return i || (i = {
  17771. deferred: $.Deferred(),
  17772. active: !1
  17773. },
  17774. t[e] = i),
  17775. i
  17776. }
  17777. ,
  17778. r.prototype.resetWaitDeferred = function(e) {
  17779. var t = this.getWaitDeferred(e);
  17780. t.active = !1,
  17781. t.deferred = $.Deferred()
  17782. }
  17783. ,
  17784. r.prototype.clearWaitDeferreds = function() {
  17785. var e = x[this.id];
  17786. for (var t in e || (e = {},
  17787. x[this.id] = e),
  17788. e)
  17789. if (e.hasOwnProperty(t)) {
  17790. var i = e[t];
  17791. i.active = !1,
  17792. i.deferred = $.Deferred()
  17793. }
  17794. }
  17795. ,
  17796. r.prototype.loadTiledPano = (new s.Vector3,
  17797. w = [],
  17798. T = [],
  17799. function(e, t, i, n, r, o) {
  17800. null != n || (n = !0),
  17801. null != r || (r = !0);
  17802. var a = this.getWaitDeferred(e)
  17803. , s = a.deferred
  17804. , l = null
  17805. , c = null;
  17806. if (i && ("number" == typeof i ? l = i : (l = i.hFov,
  17807. c = i.vFov)),
  17808. !this.isLoaded(e)) {
  17809. if (!a.active) {
  17810. if (a.active = !0,
  17811. i) {
  17812. var h = A.matchingTilesInDirection(this, e, t, l, c);
  17813. w[this.id + ":" + e] = {
  17814. tileCount: 0,
  17815. targetTileCount: h
  17816. },
  17817. I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
  17818. }
  17819. T[this.id] || (T[this.id] = !0,
  17820. this.on(f.LoadComplete, function(e, t) {
  17821. var i = this.getWaitDeferred(e).deferred;
  17822. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  17823. this.resetWaitDeferred(e))
  17824. }
  17825. .bind(this)),
  17826. this.on(f.LoadFailed, function(e) {
  17827. var t = this.getWaitDeferred(e).deferred;
  17828. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  17829. this.resetWaitDeferred(e))
  17830. }
  17831. .bind(this)),
  17832. this.on(f.TileLoaded, function(e, t, i) {
  17833. var n = this.getWaitDeferred(e).deferred;
  17834. if (n && "pending" === n.state()) {
  17835. n.notify(e, t, i);
  17836. var r = w[this.id + ":" + e];
  17837. r && (r.tileCount++,
  17838. r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
  17839. n.resolve(e, i),
  17840. this.resetWaitDeferred(e)))
  17841. }
  17842. }
  17843. .bind(this)))
  17844. }
  17845. this.tileDownloader.clearForceQueue(),
  17846. this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
  17847. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
  17848. this.panoRenderer.renderPanoTiles(this.id, t, r)
  17849. }
  17850. return s.promise()
  17851. }
  17852. ),
  17853. r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  17854. e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  17855. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  17856. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  17857. }
  17858. ,
  17859. r.prototype.onTileRendered = function(e, t, i, n) {
  17860. e === this.id && this.emit(f.TileLoaded, t, i, n)
  17861. }
  17862. ,
  17863. r.prototype.onPanoRendered = function(e, t, i, n) {
  17864. e === this.id && (this.minimumTiledPanoLoaded = !0,
  17865. this.updateSkyboxForZoomLevel(),
  17866. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  17867. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  17868. this.emit("load", t),
  17869. this.model.emit("load", this),
  17870. this.emit(f.LoadComplete, t, i))
  17871. }
  17872. ,
  17873. r.prototype.setZoomed = function(e) {
  17874. this.zoomed = e,
  17875. this.updateSkyboxForZoomLevel()
  17876. }
  17877. ,
  17878. r.prototype.ensureSkyboxReadyForRender = function() {
  17879. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  17880. this.solidSkybox.loaded = !0)
  17881. }
  17882. ,
  17883. r.prototype.updateSkyboxForZoomLevel = function() {
  17884. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  17885. }
  17886. ,
  17887. r.prototype.getSkyboxTexture = function() {
  17888. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  17889. }
  17890. ,
  17891. r.prototype.onTileRenderFail = function(e, t, i) {
  17892. e === this.id && this.emit(f.LoadFailed, t)
  17893. }
  17894. ,
  17895. r.prototype.isLoaded = function(e) {
  17896. if (this.tiled) {
  17897. if (e && "string" == typeof e)
  17898. throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  17899. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  17900. }
  17901. if (e && "number" == typeof e)
  17902. throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  17903. return !!this.solidSkybox.high || e in this.solidSkybox
  17904. }
  17905. ,
  17906. r.prototype.loadCube = function(a) {
  17907. if (this.isLoaded(a))
  17908. return I.info("Skipping load of pano, already loaded"),
  17909. $.when();
  17910. this.emit("loading", a),
  17911. this.model.emit("loading", this);
  17912. var n = p.getCubemapUrls(this.model.urls, this.id, a)
  17913. , e = n.filter(function(e) {
  17914. return !e
  17915. });
  17916. "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  17917. a = "high",
  17918. n = p.getCubemapUrls(this.model.urls, this.id, a));
  17919. var t = 0
  17920. , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
  17921. return u.getImage(n[t])
  17922. }
  17923. .bind(this));
  17924. return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
  17925. return this.solidSkybox[a] = [e, t, i, n, r, o],
  17926. "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
  17927. this.solidSkybox.low = null),
  17928. this.solidSkybox.needsUpdate = !0,
  17929. this.emit("load", a),
  17930. this.model.emit("load", this),
  17931. this
  17932. }
  17933. .bind(this), function() {
  17934. I.error("Downloading cubemap for pano", this.id, "failed"),
  17935. this.failedLoadingAt = Date.now()
  17936. }
  17937. .bind(this), function() {
  17938. return $.when(++t, 6)
  17939. })
  17940. }
  17941. ,
  17942. r.raycastsSkipped = 0,
  17943. r.raycastsDone = 0,
  17944. r.prototype.findNeighourPanos = function() {
  17945. return this.model.panos.setNeighbour(this.id, this.id, !1),
  17946. this.model.panos.forEach(function(e) {
  17947. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  17948. var t = this.position.distanceTo(e.position);
  17949. if (t > a.panoramaNeighbourMaxDistance)
  17950. return this.model.panos.setNeighbour(this, e, !1),
  17951. void r.raycastsSkipped++;
  17952. var i = e.position.clone().sub(this.position).normalize()
  17953. , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
  17954. r.raycastsDone++,
  17955. this.model.panos.setNeighbour(this, e, 0 === n.length),
  17956. 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)))
  17957. }
  17958. }
  17959. .bind(this)),
  17960. this.model.panos.neighbourMap[this.id]
  17961. }
  17962. ,
  17963. r.prototype.worldPosition = function() {
  17964. return this.position
  17965. }
  17966. ,
  17967. r.prototype.addTextSprite = function(e, t) {
  17968. this.removeTextSprite();
  17969. var i = document.createElement("canvas")
  17970. , n = i.getContext("2d");
  17971. i.width = 256,
  17972. i.height = 256;
  17973. n.font = "bold 60px Arial",
  17974. n.fillStyle = "white";
  17975. var r = n.measureText(e).width;
  17976. n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
  17977. var o = new s.Texture(i);
  17978. o.needsUpdate = !0;
  17979. var a = new s.SpriteMaterial({
  17980. map: o,
  17981. color: t || 16428055
  17982. });
  17983. this.text3d = new s.Sprite(a),
  17984. this.text3d.position.copy(this.skyboxMesh.position),
  17985. this.floor.add(this.text3d)
  17986. }
  17987. ,
  17988. r.prototype.removeTextSprite = function() {
  17989. this.text3d && (this.floor.remove(this.text3d),
  17990. this.text3d = null)
  17991. }
  17992. ,
  17993. r.prototype.isAligned = function() {
  17994. return this.alignmentType === c.ALIGNED
  17995. }
  17996. ,
  17997. r.filters = {
  17998. inDirection: function(t, i, n) {
  17999. return function(e) {
  18000. return e.position.clone().sub(t).normalize().dot(i) > n
  18001. }
  18002. },
  18003. inFloorDirection: function(t, i, n) {
  18004. return function(e) {
  18005. return e.floorPosition.clone().sub(t).normalize().dot(i) > n
  18006. }
  18007. },
  18008. inPanoDirection: function(n, r, o) {
  18009. return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
  18010. function(e) {
  18011. var t = e.floorPosition.clone().sub(n).normalize()
  18012. , i = e.position.clone().sub(n).normalize();
  18013. return t.dot(r) > o || i.dot(r) > o
  18014. }
  18015. },
  18016. atFloor: function(t) {
  18017. return function(e) {
  18018. return !t || e.floor === t
  18019. }
  18020. },
  18021. not: function(t) {
  18022. return function(e) {
  18023. return e !== t
  18024. }
  18025. },
  18026. notIn: function(t) {
  18027. return function(e) {
  18028. return -1 === t.indexOf(e)
  18029. }
  18030. },
  18031. isLoaded: function() {
  18032. return function(e) {
  18033. return e.isLoaded()
  18034. }
  18035. },
  18036. isNotLoaded: function() {
  18037. return function(e) {
  18038. return !e.isLoaded()
  18039. }
  18040. },
  18041. isCloseEnoughTo: function(t, i) {
  18042. return function(e) {
  18043. return t.distanceTo(e.floorPosition) < i
  18044. }
  18045. },
  18046. hasMinimumHeightDifferenceTo: function(t, i) {
  18047. return function(e) {
  18048. return Math.abs(e.position.y - t.y) > i
  18049. }
  18050. },
  18051. isNotBehindNormal: function(t, i) {
  18052. var n = new s.Vector3;
  18053. return i = i.clone(),
  18054. function(e) {
  18055. return 0 < n.copy(e.position).sub(t).normalize().dot(i)
  18056. }
  18057. },
  18058. isNeighbourPanoTo: function(t) {
  18059. return function(e) {
  18060. return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
  18061. }
  18062. },
  18063. isNeighbourOfNeighbourTo: function(n) {
  18064. return function(i) {
  18065. return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
  18066. var t = n.model.panos.get(e);
  18067. return !!t && t.neighbourPanos[i.id]
  18068. })
  18069. }
  18070. },
  18071. isNotRecentlyFailed: function(t) {
  18072. return function(e) {
  18073. return Date.now() - e.failedLoadingAt > t
  18074. }
  18075. },
  18076. isOnVisibleFloor: function() {
  18077. return function(e) {
  18078. return !e.floor.hidden
  18079. }
  18080. },
  18081. isPanoAligned: function() {
  18082. return function(e) {
  18083. return e.isAligned()
  18084. }
  18085. }
  18086. },
  18087. r.sortFunctions = {
  18088. distanceToPoint: function(i) {
  18089. return function(e, t) {
  18090. return e.position.distanceTo(i) - t.position.distanceTo(i)
  18091. }
  18092. },
  18093. floorDistanceToPoint: function(i) {
  18094. return function(e, t) {
  18095. return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
  18096. }
  18097. },
  18098. choose: function(i) {
  18099. return function(e, t) {
  18100. return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
  18101. }
  18102. }
  18103. },
  18104. r.scoreFunctions = {
  18105. distance: function(t, i) {
  18106. return i = i || a.navigation.distanceFactor,
  18107. function(e) {
  18108. return t ? t.position.distanceTo(e.position) * i : 0
  18109. }
  18110. },
  18111. distanceSquared: function(t, i) {
  18112. return i = i || a.navigation.distanceFactor,
  18113. function(e) {
  18114. return t ? t.position.distanceToSquared(e.position) * i : 0
  18115. }
  18116. },
  18117. direction: function(t, i) {
  18118. return function(e) {
  18119. return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
  18120. }
  18121. },
  18122. angle: function(t, i) {
  18123. return function(e) {
  18124. return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
  18125. }
  18126. },
  18127. inFieldOfView: function(t, i) {
  18128. return function(e) {
  18129. return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
  18130. }
  18131. },
  18132. optionality: function(t) {
  18133. return function(e) {
  18134. return e.neighbourUUIDs.filter(function(e) {
  18135. return !(e in t.neighbourUUIDs) && e !== t.id
  18136. }).length * a.navigation.optionalityFactor
  18137. }
  18138. },
  18139. penalizeHeightDifferenceUnder: function(t, i) {
  18140. return function(e) {
  18141. return t.y - e.position.y < i ? -20 : 0
  18142. }
  18143. }
  18144. },
  18145. M.exports = r
  18146. }
  18147. ).call(this, "/js/objects/Panorama.js")
  18148. }
  18149. , {
  18150. "../enum/AlignmentType": 17,
  18151. "../enum/GLCubeFaces": 25,
  18152. "../enum/PanoRendererEvents": 35,
  18153. "../enum/PanoSizeClass": 36,
  18154. "../enum/PanoramaEvents": 37,
  18155. "../enum/RenderLayers": 41,
  18156. "../enum/RenderOrder": 42,
  18157. "../enum/TileDownloaderEvents": 45,
  18158. "../enum/Viewmode": 51,
  18159. "../exception/BasicException": 55,
  18160. "../scene/SceneRenderer": 158,
  18161. "../settings": 166,
  18162. "../tile/TileUtils": 174,
  18163. "../util/ajax": 181,
  18164. "../util/common": 185,
  18165. "../util/lerp": 188,
  18166. "../util/logger": 189,
  18167. "../util/panorama": 191,
  18168. "../util/texture": 194,
  18169. "../util/transitions": 195,
  18170. events: 202,
  18171. three: 217
  18172. }],
  18173. 149: [function(e, t, i) {
  18174. "use strict";
  18175. function n(e) {
  18176. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18177. t.map.value = d,
  18178. t.opacity.value = 0,
  18179. t.color.value.set(o.reticuleColor),
  18180. t.showMouseMarker = void 0 === window.MP_PREFETCHED_MODELDATA.hideMouseMarker || "false" === window.MP_PREFETCHED_MODELDATA.hideMouseMarker,
  18181. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18182. side: r.DoubleSide,
  18183. depthWrite: !1,
  18184. depthTest: !1,
  18185. transparent: !0,
  18186. vertexShader: c.waypoint.vertexShader,
  18187. fragmentShader: c.waypoint.fragmentShader,
  18188. uniforms: t,
  18189. name: "waypoint",
  18190. opacity: 0,
  18191. visible: t.showMouseMarker
  18192. })),
  18193. this.layers.set(h.RETICULE),
  18194. this.renderOrder = u.reticule,
  18195. this.player = e,
  18196. this.direction = new r.Vector3,
  18197. this.hidden = !0,
  18198. this.mouseLastMoveTime = Date.now()
  18199. }
  18200. var r = e("three")
  18201. , o = e("../settings")
  18202. , a = e("../util/transitions")
  18203. , s = e("../util/texture")
  18204. , l = e("../util/lerp")
  18205. , c = e("../shaders")
  18206. , h = e("../enum/RenderLayers")
  18207. , u = e("../enum/RenderOrder")
  18208. , d = s.load("images/reticule-256x256.png");
  18209. (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
  18210. this.hidden = i,
  18211. this.mouseLastMoveTime = Date.now()
  18212. }
  18213. ,
  18214. n.prototype.hide = function() {
  18215. this.hidden || (this.hidden = !0,
  18216. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18217. }
  18218. ,
  18219. n.prototype.show = function() {
  18220. this.hidden = !1,
  18221. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18222. }
  18223. ,
  18224. n.prototype.update = function() {
  18225. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18226. }
  18227. ,
  18228. n.prototype.updatePosition = function(e, t) {
  18229. if (!this.hidden) {
  18230. if (!t)
  18231. return this.hide();
  18232. var i = t.point
  18233. , n = e.distanceTo(i)
  18234. , r = 1 + .01 * n;
  18235. n < 1 && (r -= 1 - n),
  18236. this.show(),
  18237. this.scale.set(r, r, r),
  18238. this.direction = this.direction.multiplyScalar(.8),
  18239. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18240. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18241. this.lookAt(this.position.clone().add(this.direction))
  18242. }
  18243. }
  18244. ,
  18245. n.prototype.writeAstag = function() {
  18246. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18247. , t = new Date;
  18248. this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
  18249. var i = {
  18250. enabled: !0,
  18251. version: "0",
  18252. created: t.toISOString(),
  18253. created_by: "APITest",
  18254. position: this.position.clone(),
  18255. stem: {
  18256. enabled: o.tags.pole.enabled,
  18257. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18258. },
  18259. label: "tag " + this.tagCount,
  18260. description: "Description " + e,
  18261. floor: function(e) {
  18262. if (e.currentFloor) {
  18263. var t = e.floors.indexOf(e.currentFloor);
  18264. return -1 < t ? t : void 0
  18265. }
  18266. }(this.player.model),
  18267. type: "info",
  18268. metadata: {
  18269. preferred_camera: {
  18270. mode: this.player.mode
  18271. }
  18272. }
  18273. };
  18274. console.log("--------------------------"),
  18275. console.log(JSON.stringify(i));
  18276. var n = this.player.model.addtag(e, i).build();
  18277. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18278. n.visible || n.show(o.tags.startup.fadeInDuration))
  18279. }
  18280. ,
  18281. t.exports = n
  18282. }
  18283. , {
  18284. "../enum/RenderLayers": 41,
  18285. "../enum/RenderOrder": 42,
  18286. "../settings": 166,
  18287. "../shaders": 167,
  18288. "../util/lerp": 188,
  18289. "../util/texture": 194,
  18290. "../util/transitions": 195,
  18291. three: 217
  18292. }],
  18293. 150: [function(e, t, i) {
  18294. "use strict";
  18295. function n(e, t) {
  18296. this.chunks = [],
  18297. this.floorId = e,
  18298. this.roomId = t,
  18299. this.position = new l.Vector3
  18300. }
  18301. var l = e("three");
  18302. n.prototype.addChunk = function(e) {
  18303. this.chunks.push(e)
  18304. }
  18305. ,
  18306. n.prototype.calcBoundaries = function() {
  18307. 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++) {
  18308. var a = this.chunks[o].geometry.attributes.position;
  18309. if (a)
  18310. for (var s = 0; s < a.array.length; s += 3)
  18311. e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
  18312. t.add(e),
  18313. 0 === s ? (i.copy(e),
  18314. n.copy(e)) : (i.max(e),
  18315. n.min(e)),
  18316. r++
  18317. }
  18318. 0 < r ? (t.multiplyScalar(1 / r),
  18319. this.average = t) : this.average = null,
  18320. this.boundsMax = i,
  18321. this.boundsMin = n,
  18322. this.center = new l.Vector3,
  18323. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18324. }
  18325. ,
  18326. t.exports = n
  18327. }
  18328. , {
  18329. three: 217
  18330. }],
  18331. 151: [function(o, v, e) {
  18332. (function(e) {
  18333. "use strict";
  18334. function t(e, t, i) {
  18335. this.obj3d = null,
  18336. this.nodes = [],
  18337. this.colorHull = [],
  18338. this.shortPaths = {},
  18339. this.floorHull = null,
  18340. this.cameraHull = null,
  18341. this.floorPathDistance = 0,
  18342. this.floorCurvePoints = null,
  18343. this.floorCurveColors = null,
  18344. this.camCurvePoints = null,
  18345. this.warpDestHeroLoc = null,
  18346. this.warpDestPano = null,
  18347. this.warpPathPoints = null,
  18348. this.warpPathLengths = [0],
  18349. this.warpLength = 0,
  18350. this.closeWarpDistance = 4,
  18351. this.UP = U.UP.clone(),
  18352. this.longestStep = 0,
  18353. this.upcomingTransType = null,
  18354. this.burnsDir = 1,
  18355. this.prevNextDist = 0,
  18356. this.nextI = 0,
  18357. this.activeTransType = null,
  18358. this.lastTransType = null,
  18359. this.bunnyObj = null,
  18360. this.director = e,
  18361. this.player = t,
  18362. this.playerControls = i,
  18363. this.modelManager = t.modelManager,
  18364. this.updateModel(),
  18365. this.updateDefaultsFromModelData(),
  18366. this.bindEvents(),
  18367. this.warping = !1,
  18368. this.waitingToWarp = !1,
  18369. this.warpInterrupted = !1,
  18370. this.warpInterruptionBlackoutStyle = null,
  18371. this.warpInterruptionTravelTime = null
  18372. }
  18373. 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"),
  18374. o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
  18375. new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
  18376. 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"),
  18377. pathEnd: n.load("images/End.png"),
  18378. 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==")
  18379. };
  18380. t.prototype.setScene = function(e) {
  18381. this.createCpm(e),
  18382. this.createBunnyObj(e)
  18383. }
  18384. ,
  18385. t.prototype.updateModel = function() {
  18386. this.model = this.modelManager.getActiveModel()
  18387. }
  18388. ,
  18389. t.prototype.bindEvents = function() {
  18390. this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
  18391. }
  18392. ,
  18393. t.prototype.updateDefaultsFromModelData = function() {
  18394. this.model.data
  18395. }
  18396. ,
  18397. t.prototype.pointPathDistance = function(e) {
  18398. for (var t = 0, i = 1; i < e.length; i += 1)
  18399. t += e[i - 1].distanceTo(e[i]);
  18400. return t
  18401. }
  18402. ,
  18403. t.prototype.pointPathLengths = function(e) {
  18404. for (var t = [0], i = 1; i < e.length; i += 1)
  18405. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18406. return t
  18407. }
  18408. ,
  18409. t.prototype.interpAlongPath = function(e, t, i) {
  18410. var n, r = new P.Vector3, o = t[t.length - 1];
  18411. if (i < 1) {
  18412. n = i * o;
  18413. for (var a = 1; a < t.length; a += 1)
  18414. if (t[a] > n) {
  18415. var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
  18416. return r.copy(e[a]),
  18417. r.sub(e[a - 1]),
  18418. r.multiplyScalar(s),
  18419. r.add(e[a - 1]),
  18420. r
  18421. }
  18422. } else
  18423. r.copy(e[e.length - 1]);
  18424. return r
  18425. }
  18426. ,
  18427. t.prototype.pathHeight = function() {
  18428. return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
  18429. }
  18430. ,
  18431. t.prototype.createBunnyObj = function(e) {
  18432. this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
  18433. this.bunnyObj.visible = D.warp.showBunny),
  18434. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18435. e.add(this.bunnyObj)
  18436. }
  18437. ,
  18438. t.prototype.createCpm = function(e) {
  18439. if (!this.currentPanoMarker) {
  18440. var t = this.makeWaypointObj(I.pathEnd, "Current");
  18441. t.material.uniforms.opacity.value = 0,
  18442. this.currentPanoMarker = {
  18443. mesh: t,
  18444. placed: !1
  18445. }
  18446. }
  18447. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18448. this.placeCpm(),
  18449. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18450. }
  18451. ,
  18452. t.prototype.placeCpm = function() {
  18453. if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18454. var e = this.player.currentPano.floor;
  18455. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18456. e.add(this.currentPanoMarker.mesh)),
  18457. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18458. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18459. this.currentPanoMarker.placed = !0
  18460. } else
  18461. this.popOutCpm()
  18462. }
  18463. ,
  18464. t.prototype.fadeInCpm = function(e) {
  18465. 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)
  18466. }
  18467. ,
  18468. t.prototype.fadeOutCpm = function(e) {
  18469. V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18470. }
  18471. ,
  18472. t.prototype.popInCpm = function() {
  18473. D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18474. }
  18475. ,
  18476. t.prototype.popOutCpm = function() {
  18477. this.fadeOutCpm(2)
  18478. }
  18479. ,
  18480. t.prototype.brushPrefs = {
  18481. linewidth: 7,
  18482. strokeWidth: 15,
  18483. cvSegments: 48,
  18484. paveStep: .1,
  18485. paveWidth: .2,
  18486. lookBlendDist: 3,
  18487. maxTurn: P.Math.degToRad(2)
  18488. },
  18489. t.prototype.panoPathDistance = function(e) {
  18490. var t = this.model.panos;
  18491. if (!e || e.length < 2)
  18492. return 0;
  18493. for (var i = [], n = 0; n < e.length; n += 1)
  18494. i.push(t.get(e[n]).floorPosition);
  18495. return this.pointPathDistance(i)
  18496. }
  18497. ,
  18498. t.prototype.loadTileTexture = function(t) {
  18499. var e = n.load(t, function(e) {
  18500. e.wrapS = P.RepeatWrapping,
  18501. e.wrapT = P.RepeatWrapping,
  18502. e.needsUpdate = !0,
  18503. H.debug('path texture "' + t + '" is ready')
  18504. }, function() {
  18505. H.error('path texture "' + t + '" failed')
  18506. });
  18507. return e.mapping = P.UVMapping,
  18508. e
  18509. }
  18510. ,
  18511. t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  18512. return new l({
  18513. cameraMode: n,
  18514. position: e,
  18515. quaternion: t,
  18516. panoId: i,
  18517. orthoZoom: o,
  18518. floorVisibility: r,
  18519. thumbUrl: null,
  18520. name: null
  18521. })
  18522. }
  18523. ,
  18524. t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  18525. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  18526. }
  18527. ,
  18528. t.prototype.setWarpDestination = function(e) {
  18529. this.warpDestHeroLoc = e
  18530. }
  18531. ,
  18532. t.prototype.setWarpDestinationByHeroIndex = function(e) {
  18533. var t = this.getHeroDescriptorByHeroIndex(e);
  18534. return null !== t && (this.setWarpDestination(t),
  18535. !0)
  18536. }
  18537. ,
  18538. t.prototype.setWarpDestinationByPano = function(e, t) {
  18539. return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
  18540. }
  18541. ,
  18542. t.prototype.setWarpDestinationByPanoId = function(e, t) {
  18543. var i = this.model.panos.get(e);
  18544. if (i) {
  18545. t = t || new P.Quaternion;
  18546. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  18547. return this.setWarpDestination(n),
  18548. !0
  18549. }
  18550. return !1
  18551. }
  18552. ,
  18553. t.prototype.getHeroDescriptorByHeroIndex = function(e) {
  18554. var t = this.model.heroCount();
  18555. if (null !== this.warpDestHeroLoc && t < 2)
  18556. return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  18557. this.model.getHeroDescriptorByIndex(0);
  18558. var i = this.model.getHeroDescriptorByIndex(e);
  18559. if (i) {
  18560. var n = i.isPano() ? i.panoId : i.cameraMode;
  18561. H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  18562. }
  18563. return i
  18564. }
  18565. ,
  18566. t.prototype.getHeroDescriptorByPano = function(e) {
  18567. return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
  18568. }
  18569. ,
  18570. t.prototype.getHeroDescriptorByPanoId = function(e) {
  18571. var t = this.getHeroIndexFromPanoId(e);
  18572. return this.getHeroDescriptorByHeroIndex(t)
  18573. }
  18574. ,
  18575. t.prototype.getHeroIndexFromPanoId = function(e) {
  18576. for (var t = 0; t < this.model.heroLocations.length; t++) {
  18577. var i = this.model.heroLocations[t]
  18578. , n = this.getHeroId(i);
  18579. if (n && n === e)
  18580. return t
  18581. }
  18582. return -1
  18583. }
  18584. ,
  18585. t.prototype.getHeroPano = function(e) {
  18586. if (null === e)
  18587. return H.warn("getHeroPano(): no destination"),
  18588. null;
  18589. var t = this.getHeroId(e)
  18590. , i = this.model.panos.get(t);
  18591. return void 0 === i && (i = null,
  18592. "" !== t && H.debug('unable to find pano "' + t + '"')),
  18593. i
  18594. }
  18595. ,
  18596. t.prototype.getHeroId = function(e) {
  18597. return e.panoId
  18598. }
  18599. ,
  18600. t.prototype.setWarpDestPano = function() {
  18601. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  18602. this.warpDestPano
  18603. }
  18604. ,
  18605. t.prototype.brushToWarpPano = function(e, t) {
  18606. if (this.discardPathObject(),
  18607. !this.setWarpDestPano())
  18608. return !1;
  18609. if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
  18610. !this.warpDestPano)
  18611. return H.info("No brush"),
  18612. !1;
  18613. if (!this.player.currentPano)
  18614. return H.debug("No current pano, visibility undefined"),
  18615. !1;
  18616. if (!this.warpDestPano)
  18617. return H.info("No wPano, visibility undefined"),
  18618. !1;
  18619. if (!this.warpDestPano.isAligned())
  18620. return H.debug("Cannot brush to unaligned pano"),
  18621. !1;
  18622. var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
  18623. , n = !0;
  18624. if (this.player.currentPano.id === this.warpDestPano.id)
  18625. H.debug("Already at destination pano");
  18626. else {
  18627. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18628. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  18629. this.obj3d = new P.Object3D,
  18630. H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  18631. n ? (H.info('No "walkable" route, using fall-back warp style transition'),
  18632. e = t) : (this.setPathHulls(this.nodes),
  18633. this.setFloorCurves(),
  18634. 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)))),
  18635. this.player.currentPano.floor.add(this.obj3d);
  18636. var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
  18637. , o = e === L.STD;
  18638. if (!n && (i || o)) {
  18639. if (r) {
  18640. var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  18641. this.obj3d.add(a)
  18642. }
  18643. var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  18644. this.obj3d.add(s)
  18645. }
  18646. this.appearSlow()
  18647. }
  18648. return this.upcomingTransType = e,
  18649. !n
  18650. }
  18651. ,
  18652. t.prototype.findShortestPath = function(e, t) {
  18653. if (!e || !t)
  18654. return null;
  18655. var i = D.warp.walkExtraPanosDistance
  18656. , n = e.id + ":" + t.id + ":" + i;
  18657. if (this.shortPaths.hasOwnProperty(n))
  18658. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  18659. var r = t.id + ":" + e.id + ":" + i;
  18660. if (this.shortPaths.hasOwnProperty(r))
  18661. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  18662. var o = this.model.panos.aStarSearch(e, t);
  18663. return this.model.panos.includeNodesNearPath(o, i),
  18664. this.shortPaths[n] = o ? o.slice() : null,
  18665. o
  18666. }
  18667. ,
  18668. t.prototype.makePathHulls = function(e) {
  18669. var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
  18670. r = (t = h.get(e[0])).floor.floorIndex;
  18671. for (var u = 0; u < e.length; u += 1)
  18672. (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
  18673. s.push(i),
  18674. l.push(t.position.clone()),
  18675. n = t.floor.floorIndex,
  18676. c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
  18677. 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
  18678. return a > this.longestStep && (this.longestStep = a,
  18679. H.debug("path contains " + a + " meter segment")),
  18680. {
  18681. floor: s,
  18682. camera: l,
  18683. color: c
  18684. }
  18685. }
  18686. ,
  18687. t.prototype.makeFloorCurves = function(e, t, i) {
  18688. var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18689. , r = this.pointPathDistance(e) - 2 * n
  18690. , o = e.slice(0)
  18691. , a = o[1].clone().sub(o[0]);
  18692. a.y = 0,
  18693. a.normalize().multiplyScalar(n),
  18694. o[0] = (new P.Vector3).copy(o[0]).add(a),
  18695. (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
  18696. a.normalize().multiplyScalar(n),
  18697. o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
  18698. var s = new P.CatmullRomCurve3(o)
  18699. , l = Math.floor(r / i);
  18700. l = 4 * Math.floor(l / 4),
  18701. l = Math.max(4, l);
  18702. for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
  18703. h = 0,
  18704. c = u[f].distanceTo(e[0]);
  18705. for (var g = 1; g < e.length; g += 1)
  18706. p.copy(u[f]).sub(e[g]),
  18707. p.y *= 4,
  18708. p.length() < c && (h = g);
  18709. d.push(t[h])
  18710. }
  18711. return {
  18712. distance: r,
  18713. points: u,
  18714. colors: d
  18715. }
  18716. }
  18717. ,
  18718. t.prototype.makeCameraCurvePoints = function(e, t) {
  18719. var i = this.pointPathDistance(e);
  18720. return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
  18721. }
  18722. ,
  18723. t.prototype.makeCameraCurveTangents = function(e, t) {
  18724. var i = this.pointPathDistance(e)
  18725. , n = new P.CatmullRomCurve3(e)
  18726. , r = Math.max(2, Math.floor(i / t));
  18727. r = r || 5;
  18728. for (var o = [], a = 0; a <= r; a++)
  18729. o.push(n.getTangentAt(a / r));
  18730. return o
  18731. }
  18732. ,
  18733. t.prototype.setPathHulls = function(e) {
  18734. var t = this.makePathHulls(e);
  18735. this.floorHull = t.floor,
  18736. this.cameraHull = t.camera,
  18737. this.colorHull = t.color
  18738. }
  18739. ,
  18740. t.prototype.setFloorCurves = function() {
  18741. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  18742. this.floorPathDistance = e.distance,
  18743. this.floorCurvePoints = e.points,
  18744. this.floorCurveColors = e.colors
  18745. }
  18746. ,
  18747. t.prototype.setCameraCurvePoints = function() {
  18748. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
  18749. }
  18750. ,
  18751. t.prototype.chooseWarpPath = function(e) {
  18752. var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
  18753. if (this.player.currentPano === this.warpDestPano || !e)
  18754. return this.warpPathPoints = null,
  18755. this.warpLength = 0,
  18756. !1;
  18757. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  18758. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
  18759. i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
  18760. t.multiplyScalar(.15).add(r.position),
  18761. i.multiplyScalar(.15).add(this.warpDestPano.position),
  18762. t.y = r.position.y,
  18763. i.y = this.warpDestPano.position.y,
  18764. n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
  18765. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  18766. this.setCameraCurvePoints(),
  18767. this.warpPathPoints = this.camCurvePoints.slice(0)),
  18768. this.warpLength = 0,
  18769. this.warpPathLengths = [0];
  18770. 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) {
  18771. o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
  18772. var h = o.length();
  18773. o.y *= D.warp.climbEffort;
  18774. var u = o.length() / h;
  18775. if (1 < c) {
  18776. o.setY(0).normalize(),
  18777. a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
  18778. var d = Math.min(1, o.dot(a))
  18779. , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
  18780. u = Math.max(p, u)
  18781. }
  18782. this.warpLength += h * u,
  18783. this.warpPathLengths[c] = this.warpLength
  18784. }
  18785. return !0
  18786. }
  18787. ,
  18788. t.prototype.drawPathRibbon = function(e, t) {
  18789. this.bunnyObj.visible = D.warp.showBunny;
  18790. 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) {
  18791. a.copy(e[s]),
  18792. 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
  18793. a.normalize(),
  18794. n.crossVectors(a, U.UP),
  18795. n.multiplyScalar(i);
  18796. var l = (new P.Vector3).copy(e[s]).add(r);
  18797. l.sub(n),
  18798. o.vertices.push(l),
  18799. (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
  18800. o.vertices.push(l)
  18801. }
  18802. var c, h, u, d = 0;
  18803. for (s = 0; s < e.length - 1; s += 1) {
  18804. var p = 2 * s
  18805. , f = d
  18806. , g = d += e[s + 1].distanceTo(e[s])
  18807. , m = t[s]
  18808. , v = t[s + 1];
  18809. (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
  18810. o.faces.push(c),
  18811. o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
  18812. (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
  18813. o.faces.push(c),
  18814. o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
  18815. }
  18816. o.computeFaceNormals(),
  18817. o.computeVertexNormals(),
  18818. h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
  18819. u.opacity.value = 0,
  18820. u.color.value.set(D.path.color),
  18821. new P.RawShaderMaterial({
  18822. side: P.DoubleSide,
  18823. depthWrite: !1,
  18824. transparent: !0,
  18825. vertexShader: C.ribbon.vertexShader,
  18826. fragmentShader: C.ribbon.fragmentShader,
  18827. uniforms: u,
  18828. name: "ribbonT",
  18829. opacity: 0
  18830. })) : new P.MeshBasicMaterial({
  18831. color: 16777215,
  18832. side: P.DoubleSide,
  18833. name: "ribbonOut",
  18834. vertexColors: P.VertexColors
  18835. });
  18836. var y = new P.Mesh(o,h);
  18837. return y.name = "ribbon",
  18838. this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
  18839. y
  18840. }
  18841. ,
  18842. t.prototype.drawPathPavement = function(e) {
  18843. for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
  18844. r.copy(e[o]),
  18845. 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
  18846. r.normalize(),
  18847. i.crossVectors(r, U.UP),
  18848. i.multiplyScalar(this.brushPrefs.paveWidth),
  18849. (t = (new P.Vector3).copy(e[o])).sub(i),
  18850. n.vertices.push(t),
  18851. n.vertices.push((new P.Vector3).copy(e[o])),
  18852. (t = (new P.Vector3).copy(e[o])).add(i),
  18853. n.vertices.push(t);
  18854. var a, s, l;
  18855. for (o = 0; o < e.length - 1; o += 1)
  18856. a = 3 * o + 1,
  18857. l = .25 + (s = .25 * o),
  18858. n.faces.push(new P.Face3(a - 1,a,3 + a)),
  18859. n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
  18860. n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
  18861. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
  18862. n.faces.push(new P.Face3(3 + a,a,1 + a)),
  18863. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
  18864. n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
  18865. n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
  18866. var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
  18867. color: D.path.color,
  18868. side: P.DoubleSide,
  18869. transparent: !0,
  18870. depthWrite: !1,
  18871. opacity: 0,
  18872. name: "paveT",
  18873. map: I.path
  18874. }) : new P.MeshBasicMaterial({
  18875. color: D.path.color,
  18876. side: P.DoubleSide,
  18877. transparent: !0,
  18878. depthWrite: !1,
  18879. opacity: 1,
  18880. name: "paveO",
  18881. map: I.path
  18882. });
  18883. return new P.Mesh(n,c)
  18884. }
  18885. ,
  18886. t.prototype.hintPrefs = {
  18887. rad: .18,
  18888. width: .0125,
  18889. depth: .0625,
  18890. setBack: -.04,
  18891. markRad: .25,
  18892. markInnerRad: .16
  18893. },
  18894. t.prototype.makeWaypointObj = function(e, t) {
  18895. var i = new P.Geometry
  18896. , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
  18897. , r = this.pathHeight();
  18898. 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)),
  18899. i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
  18900. i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
  18901. i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
  18902. var o = P.UniformsUtils.clone(C.waypoint.uniforms);
  18903. o.map.value = e,
  18904. o.opacity.value = 0,
  18905. o.color.value.set(D.path.color);
  18906. var a = {
  18907. side: P.DoubleSide,
  18908. depthWrite: !1,
  18909. transparent: !0,
  18910. vertexShader: C.waypoint.vertexShader,
  18911. fragmentShader: C.waypoint.fragmentShader,
  18912. uniforms: o,
  18913. name: "waypoint",
  18914. opacity: 0
  18915. };
  18916. this.player.mode !== O.PANORAMA && (a.depthTest = !1,
  18917. a.name = "wayPtOut");
  18918. var s = new P.RawShaderMaterial(a)
  18919. , l = new P.Mesh(i,s);
  18920. return l.name = t,
  18921. l
  18922. }
  18923. ,
  18924. t.prototype.makeStartMarker = function(e, t) {
  18925. var i = (new P.Vector3).copy(t[1]).sub(t[0]);
  18926. i.y = 0,
  18927. i.normalize();
  18928. var n = Math.acos(i.x)
  18929. , r = this.makeWaypointObj(I.pathStart, "Start");
  18930. return r.rotateOnAxis(new P.Vector3(0,1,0), n),
  18931. r.position.copy(e),
  18932. r
  18933. }
  18934. ,
  18935. t.prototype.makeEndMarker = function(e) {
  18936. var t = this.makeWaypointObj(I.pathEnd, "End")
  18937. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  18938. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  18939. return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
  18940. t.position.copy(e),
  18941. t
  18942. }
  18943. ,
  18944. t.prototype.pathClean = function(e) {
  18945. if (e) {
  18946. for (var t in e.children)
  18947. this.pathClean(e.children[t]);
  18948. e.geometry && e.geometry.dispose(),
  18949. e.material && e.material.dispose()
  18950. }
  18951. }
  18952. ,
  18953. t.prototype.discardPathObject = function() {
  18954. if (this.obj3d) {
  18955. var e = this.obj3d.parent;
  18956. e && e.remove(this.obj3d),
  18957. this.pathClean(this.obj3d)
  18958. }
  18959. this.obj3d = null,
  18960. this.popInCpm()
  18961. }
  18962. ,
  18963. t.prototype.discardSlow = function() {
  18964. if (this.obj3d) {
  18965. if (this.player.mode !== O.PANORAMA)
  18966. return void this.discardPathObject();
  18967. for (var e, t = 0, i = function() {
  18968. this.discardPathObject()
  18969. }
  18970. .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
  18971. 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]),
  18972. t += 1,
  18973. i = null);
  18974. 0 === t && this.discardPathObject(),
  18975. this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
  18976. }
  18977. }
  18978. ,
  18979. t.prototype.appearSlow = function() {
  18980. var e;
  18981. this.fadeOutCpm(D.path.fadeInTime);
  18982. for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
  18983. 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]))
  18984. }
  18985. ,
  18986. t.prototype.update = function() {
  18987. this.obj3d && this.obj3d.updateMatrixWorld()
  18988. }
  18989. ,
  18990. t.prototype.calcBurnsAmount = function(e) {
  18991. var n = P.Math.degToRad(D.warp.burnsAngle);
  18992. if (this.player.mode !== O.PANORAMA)
  18993. return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
  18994. var t = this.burnsDir * n;
  18995. if (this.upcomingTransType === L.BLACK)
  18996. return t;
  18997. var i = e;
  18998. if (null === i)
  18999. return H.warn("Transition request for non-highlight"),
  19000. t;
  19001. var r = this.getHeroDescriptorByHeroIndex(i);
  19002. if (null === r)
  19003. return t;
  19004. if (!r.isPano())
  19005. return t;
  19006. function o(e) {
  19007. var t = Math.acos(Math.min(1, e.dot(l)))
  19008. , i = (new P.Vector3).crossVectors(l, e);
  19009. return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
  19010. }
  19011. var a = this.getHeroPano(r)
  19012. , s = this.playerControls.cameras[O.PANORAMA]
  19013. , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
  19014. , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
  19015. if (a === this.player.currentPano)
  19016. return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
  19017. var h = this.findShortestPath(this.player.currentPano, a);
  19018. if (null == h || h.length < 1)
  19019. return H.debug("Empty path ahead..."),
  19020. t;
  19021. var u = this.makePathHulls(h)
  19022. , d = new P.CatmullRomCurve3(u.camera)
  19023. , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
  19024. return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
  19025. }
  19026. ,
  19027. t.prototype.waitNextStep = function(e, t, i) {
  19028. var o = null == i ? D.warp.tourStepDelay : i;
  19029. o = o || (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
  19030. var a = new P.Euler
  19031. , s = new P.Vector3;
  19032. H.debug("Starting wait: " + (void 0 !== t));
  19033. var l = this.calcBurnsAmount(e)
  19034. , c = function() {
  19035. this.endWarpState(),
  19036. this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19037. t && t()
  19038. }
  19039. .bind(this)
  19040. , n = function(e, t) {
  19041. if (this.warpInterrupted)
  19042. return c(),
  19043. !0;
  19044. var i = t || 1e3 / 60;
  19045. if (D.warp.doBurns)
  19046. if (this.player.mode === O.PANORAMA) {
  19047. var n = this.playerControls.cameras[O.PANORAMA];
  19048. a.setFromQuaternion(n.quaternion, D.warp.eOrder);
  19049. var r = i * l / o;
  19050. a.y += r,
  19051. s.set(0, 0, -1),
  19052. s.applyEuler(a),
  19053. s.add(n.position),
  19054. n.controls.lookAt(s),
  19055. n.controls.lookVector.copy(s),
  19056. n.lookAt(s)
  19057. } else
  19058. this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
  19059. }
  19060. .bind(this);
  19061. this.startWarpState(),
  19062. V.start(n, o, c, 0, B.easeInOutQuad, "wait");
  19063. var r = player.model.heroLocations[app.director.currentItem];
  19064. this.player.zoomEnabled = !0;
  19065. var h = function(e, t) {
  19066. //console.log(e),
  19067. this.player.zoomTo(e * r.zoom.toFixed(2), !0)
  19068. }
  19069. .bind(this);
  19070. V.start(h, 2e3, null, 0, B.easeOutQuad, "zoom")
  19071. }
  19072. ,
  19073. t.prototype.warpToNonPano = function(e) {
  19074. if (this.discardPathObject(),
  19075. this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
  19076. var t = function() {
  19077. e && e()
  19078. }
  19079. .bind(this);
  19080. this.player.flyToNewMode({
  19081. mode: this.warpDestHeroLoc.cameraMode,
  19082. duration: D.warp.outsideTime,
  19083. warpDest: this.warpDestHeroLoc,
  19084. callback: t,
  19085. force: !0
  19086. })
  19087. } else
  19088. H.warn("no warp destination!!!"),
  19089. e && e()
  19090. }
  19091. ,
  19092. t.prototype._resetWarpShaderParams = function(e) {
  19093. this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19094. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19095. }
  19096. ,
  19097. t.prototype._clearWarpShading = function() {
  19098. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19099. this._resetWarpShaderParams(e[t]),
  19100. e[t].visible = !0;
  19101. this._resetWarpShaderParams(this.model.skybox)
  19102. }
  19103. ,
  19104. t.prototype._warpStopFlying = function() {
  19105. this.activeTransType = null,
  19106. this.placeCpm()
  19107. }
  19108. ,
  19109. t.prototype._wrapupTravelOnlyBits = function() {
  19110. this._warpStopFlying(),
  19111. this.warpPathPoints && (this.player.currentPano.exit(),
  19112. this.warpDestPano.enter(),
  19113. this.player.currentPano = this.warpDestPano),
  19114. this.player.spider.draw(),
  19115. this.placeCpm()
  19116. }
  19117. ,
  19118. t.prototype._wrapupTravel = function(e) {
  19119. this._wrapupTravelOnlyBits(),
  19120. this.warpCameraAim(e)
  19121. }
  19122. ,
  19123. t.prototype._wrapupWarpShading = function(e) {
  19124. this._clearWarpShading(),
  19125. this._wrapupTravel(e)
  19126. }
  19127. ,
  19128. t.prototype.wrapupWarpShadingOnly = function(e, t) {
  19129. t !== z.END && this._clearWarpShading(),
  19130. this._wrapupTravelOnlyBits(),
  19131. this.upcomingTransType = null,
  19132. e && e()
  19133. }
  19134. ,
  19135. t.prototype._warpCameraAim = function(e, t) {
  19136. var i = this.warpDestHeroLoc.quaternion
  19137. , n = this.playerControls.cameras[O.PANORAMA]
  19138. , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
  19139. , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
  19140. , a = P.Math.radToDeg(Math.acos(o))
  19141. , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
  19142. , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19143. , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
  19144. c.y = N.constrainedTurn(c.y),
  19145. this.burnsDir = Math.sign(c.y);
  19146. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19147. , u = new P.Vector3
  19148. , d = function(e, t) {
  19149. return !!this.warpInterrupted || (h.x = l.x + e * c.x,
  19150. h.y = l.y + e * c.y,
  19151. h.z = l.z + e * c.z,
  19152. u.set(0, 0, -1),
  19153. u.applyEuler(h),
  19154. u.add(n.position),
  19155. n.controls.lookAt(u),
  19156. n.controls.lookVector.copy(u),
  19157. void n.lookAt(u))
  19158. }
  19159. .bind(this);
  19160. return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing]) : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19161. void (t && t()))
  19162. }
  19163. ,
  19164. t.prototype._warpBendAim = function(e, t, i, n) {
  19165. var r = n || 0
  19166. , o = this.playerControls.cameras[O.PANORAMA]
  19167. , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19168. , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
  19169. , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
  19170. l.y = N.constrainedTurn(l.y);
  19171. var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
  19172. l.x = c * Math.sign(l.x),
  19173. c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
  19174. this.burnsDir = Math.sign(l.y),
  19175. c *= Math.sign(l.y),
  19176. l.y = c;
  19177. var h = new P.Euler(0,0,0,D.warp.eOrder)
  19178. , u = new P.Vector3
  19179. , d = function(e, t) {
  19180. if (e < .5)
  19181. h.x = s.x + e * l.x,
  19182. h.y = s.y + e * l.y,
  19183. h.z = s.z + e * l.z;
  19184. else {
  19185. var i = (1 - e) * D.warp.softBendEnd;
  19186. h.x = a.x - i * l.x,
  19187. h.y = a.y - i * l.y,
  19188. h.z = a.z - i * l.z
  19189. }
  19190. u.set(0, 0, -1),
  19191. u.applyEuler(h),
  19192. u.add(o.position),
  19193. o.controls.lookAt(u),
  19194. o.controls.lookVector.copy(u),
  19195. o.lookAt(u)
  19196. }
  19197. .bind(this);
  19198. return V.start(d, t, i, r, B[D.warp.movementEasing])
  19199. }
  19200. ,
  19201. t.prototype._warpStepCameraAim = function(e, t, i) {
  19202. var n = this.playerControls.cameras[O.PANORAMA]
  19203. , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19204. , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
  19205. , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
  19206. a.y = N.constrainedTurn(a.y),
  19207. this.burnsDir = Math.sign(a.y);
  19208. var s = new P.Euler(0,0,0,D.warp.eOrder)
  19209. , l = new P.Vector3
  19210. , c = function(e, t) {
  19211. e < .5 ? s.copy(o) : s.copy(r),
  19212. l.set(0, 0, -1),
  19213. l.applyEuler(s),
  19214. l.add(n.position),
  19215. n.controls.lookAt(l),
  19216. n.controls.lookVector.copy(l),
  19217. n.lookAt(l)
  19218. }
  19219. .bind(this);
  19220. return V.start(c, t, i, 0, B[D.warp.movementEasing])
  19221. }
  19222. ,
  19223. t.prototype.setBurnsDir = function() {
  19224. var e = this.playerControls.cameras[O.PANORAMA]
  19225. , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19226. , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
  19227. , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
  19228. n.y = N.constrainedTurn(n.y),
  19229. this.burnsDir = Math.sign(n.y)
  19230. }
  19231. ,
  19232. t.prototype.stepWarpPath = function(e, t) {
  19233. var i = this.playerControls.cameras[O.PANORAMA];
  19234. if (!this.warpPathPoints)
  19235. return i.position.copy(this.warpDestPano.position),
  19236. !0;
  19237. var n = this.warpPathPoints[0]
  19238. , r = this.warpDestPano.position;
  19239. if (null !== this.nodes && 1 < this.cameraHull.length) {
  19240. var o = new P.Vector3;
  19241. 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),
  19242. i.position.copy(o)
  19243. } else
  19244. e < .5 ? i.position.copy(n) : i.position.copy(r)
  19245. }
  19246. ,
  19247. t.prototype.interruptAndFastForward = function(e, t) {
  19248. this.warping && (this.warpInterrupted = !0,
  19249. this.warpInterruptionBlackoutStyle = e,
  19250. this.warpInterruptionTravelTime = t,
  19251. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
  19252. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
  19253. }
  19254. ,
  19255. t.prototype.warpCameraAim = function(e) {
  19256. var t = D.warp.minWarpTime;
  19257. if (this.upcomingTransType === L.BLACK)
  19258. t = D.warp.teleportTime;
  19259. else {
  19260. var i = this.playerControls.cameras[O.PANORAMA]
  19261. , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
  19262. , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
  19263. , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
  19264. o.y = N.constrainedTurn(o.y);
  19265. var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
  19266. t = Math.max(t, a)
  19267. }
  19268. var s = function() {
  19269. this._warpStopFlying(),
  19270. this.discardSlow(),
  19271. e && e()
  19272. }
  19273. .bind(this);
  19274. this._warpCameraAim(t, s)
  19275. }
  19276. ,
  19277. t.prototype.warpCommonParameters = function(e, t, i, n) {
  19278. this.model.skybox.material.uniforms.blackout.value = n;
  19279. var r = F.uniform(this.model.skybox, "progress", 1)
  19280. , o = F.allUniforms(this.model.chunks, "progress", 1)
  19281. , a = !1
  19282. , s = function() {
  19283. if (this.warpInterrupted)
  19284. return a = !0
  19285. }
  19286. .bind(this)
  19287. , l = function(e, t) {
  19288. return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
  19289. }
  19290. .bind(this)
  19291. , c = function(e, t) {
  19292. return i && a ? (o(0),
  19293. !0) : void o(e, t)
  19294. }
  19295. .bind(this);
  19296. V.start(s, e, null, t, null, "safeHaltWatch"),
  19297. V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
  19298. V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
  19299. }
  19300. ,
  19301. t.prototype.warpTravel_STD = function(e) {
  19302. 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),
  19303. 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;
  19304. t += this.warpLength * D.warp.timePerMeter,
  19305. .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
  19306. function n(e) {
  19307. var t = i;
  19308. return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
  19309. }
  19310. var y = !1
  19311. , r = this.warpDestHeroLoc.quaternion
  19312. , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
  19313. , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19314. , a = A.dot(o)
  19315. , C = P.Math.radToDeg(Math.acos(a))
  19316. , s = function() {
  19317. return m.lookAt(g, l, U.UP),
  19318. u.setFromRotationMatrix(m, D.warp.eOrder),
  19319. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19320. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19321. N.constrainedTurn(v.y)
  19322. }
  19323. .bind(this)
  19324. , I = function(e, t) {
  19325. if (this.warpInterrupted)
  19326. return y = !0
  19327. }
  19328. .bind(this)
  19329. , E = function(e, t) {
  19330. return y || !this.warpPathPoints ? (k.blur(0),
  19331. !0) : void k.blur(e)
  19332. }
  19333. .bind(this)
  19334. , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
  19335. , b = function(e, t) {
  19336. return y || !this.warpPathPoints ? (_(0),
  19337. !0) : void _(e, t)
  19338. }
  19339. .bind(this)
  19340. , w = function(e, t) {
  19341. if (!this.warpPathPoints)
  19342. return h.position.copy(this.warpDestPano.position),
  19343. !0;
  19344. if (y)
  19345. return !0;
  19346. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19347. h.position.copy(i),
  19348. g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19349. }
  19350. .bind(this)
  19351. , T = function(e, t) {
  19352. return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
  19353. !0)
  19354. }
  19355. .bind(this)
  19356. , x = function(e, t) {
  19357. if (y)
  19358. return H.debug(">>>> Walkthrough interupted at t=" + e),
  19359. !0;
  19360. if (!this.warpPathPoints)
  19361. return !0;
  19362. var i = this.warpLength * e
  19363. , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
  19364. , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19365. D.warp.matchCam && (n *= 1 - r),
  19366. m.lookAt(g, l, U.UP),
  19367. u.setFromRotationMatrix(m, D.warp.eOrder),
  19368. p.setFromQuaternion(h.quaternion, D.warp.eOrder),
  19369. v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
  19370. v.y = N.constrainedTurn(v.y),
  19371. u.x = p.x + n * v.x,
  19372. u.y = p.y + n * v.y,
  19373. u.z = p.z + n * v.z,
  19374. v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
  19375. v.y = N.constrainedTurn(v.y);
  19376. var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
  19377. v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
  19378. f.x = f.x + v.x * D.warp.turnFriction,
  19379. f.y = f.y + v.y * D.warp.turnFriction,
  19380. f.z = f.z + v.z * D.warp.turnFriction,
  19381. f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
  19382. var a = l.clone().sub(g).normalize();
  19383. if (C < D.warp.maxAimRotation && 0 < r) {
  19384. var s = 1 - r;
  19385. a.x = a.x * s + r * A.x,
  19386. a.y = a.y * s + r * A.y,
  19387. a.z = a.z * s + r * A.z,
  19388. a.normalize()
  19389. }
  19390. this.bunnyObj.position.copy(h.position).add(a),
  19391. d.set(0, 0, -1).applyEuler(f).normalize(),
  19392. d.multiplyScalar(8),
  19393. d.add(h.position),
  19394. 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
  19395. h.controls.lookVector.copy(d),
  19396. h.lookAt(d))
  19397. }
  19398. .bind(this)
  19399. , S = function() {
  19400. y ? (this.discardSlow(),
  19401. this.upcomingTransType = L.BLACK,
  19402. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
  19403. }
  19404. .bind(this);
  19405. T(0);
  19406. var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
  19407. , R = M / (t += M);
  19408. this.warpCommonParameters(t, R, !0, z.NONE),
  19409. V.start(I, t, null, 0, null, "_haltWatcher"),
  19410. 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
  19411. V.start(E, t, null, R, n, "blurring")),
  19412. V.start(b, t, null, R, n, "modelAlpha"),
  19413. V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
  19414. V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
  19415. V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
  19416. }
  19417. ,
  19418. t.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19419. var r = e || 0;
  19420. null != t || (t = D.warp.teleportTime),
  19421. this.warpCommonParameters(t, r, !1, i),
  19422. this.model.chunks.forEach(function(e) {
  19423. e.material.uniforms.blackout.value = i
  19424. }),
  19425. this._warpBendAim(null, t, null, r);
  19426. var o = function() {
  19427. this.wrapupWarpShadingOnly(n, i)
  19428. }
  19429. .bind(this);
  19430. V.start(this.stepWarpPath.bind(this), t, o, r, B[D.warp.blendEasing], "stepMotion")
  19431. }
  19432. ,
  19433. t.prototype.flightStepWalk = (a = new P.Vector3,
  19434. s = new P.Vector3,
  19435. function(e, t, i) {
  19436. if (this.warpInterrupted)
  19437. i && i();
  19438. else if (this.activeTransType !== L.WALK)
  19439. this._clearWarpShading(),
  19440. this._warpStopFlying(),
  19441. this.player.spider.draw(),
  19442. this.placeCpm(),
  19443. i && i();
  19444. else if (this.player.currentPano !== e) {
  19445. var n = {
  19446. pano: e,
  19447. lookAtPoint: t,
  19448. duration: null,
  19449. maxDistanceOverride: D.warp.walkMaxDist,
  19450. skipWarpingCheck: !1,
  19451. constantMoveSpeed: !0
  19452. };
  19453. n.duration = function(e, t) {
  19454. var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
  19455. s.copy(U.FORWARD),
  19456. this.player.getDirection(s),
  19457. a.copy(t).sub(e.position).normalize();
  19458. var n = a.dot(s)
  19459. , r = Math.acos(n)
  19460. , o = r / i;
  19461. return .001 < o && (i *= o / .001,
  19462. r < 1 && (i *= 1.2)),
  19463. i
  19464. }
  19465. .call(this, e, t),
  19466. this.player.nonInterruptingFlyToPano(n, i)
  19467. } else
  19468. i && i()
  19469. }
  19470. ),
  19471. t.prototype.makeWalkFlightFunc = function(e, t, i) {
  19472. return this.flightStepWalk.bind(this, e, t, i)
  19473. }
  19474. ,
  19475. t.prototype.warpTravel_WALK = (f = [],
  19476. function(e) {
  19477. for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
  19478. var o = this.nodes[r]
  19479. , a = t.get(o);
  19480. this.nodes.length,
  19481. n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
  19482. i && n || (f.push(o),
  19483. i = a)
  19484. }
  19485. n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
  19486. var s = f.length
  19487. , l = t.get(f[s - 1])
  19488. , c = new Array(s + 1);
  19489. c[c.length - 1] = function() {
  19490. e && e()
  19491. }
  19492. .bind(this);
  19493. for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
  19494. var d = f[h];
  19495. l = t.get(d);
  19496. var p = new P.Vector3;
  19497. this.getLookAtForWalkingTourNode(f, h, p),
  19498. c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
  19499. h--
  19500. }
  19501. c[0]()
  19502. }
  19503. ),
  19504. t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
  19505. h = new P.Vector3,
  19506. u = new P.Vector3,
  19507. d = new P.Vector3,
  19508. p = new P.Vector3,
  19509. function(e, t, i) {
  19510. var n = e.length;
  19511. if (n <= t)
  19512. return !1;
  19513. var r = 1
  19514. , o = 1;
  19515. h.set(0, 0, 0),
  19516. p.set(0, 0, 0);
  19517. for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
  19518. if (a = this.player.model.panos.get(e[s]),
  19519. this.getOrientationForWalkingTourNode(e, s, u),
  19520. s === t && c.copy(u),
  19521. d.copy(u),
  19522. t < s) {
  19523. var l = d.dot(c) < .65;
  19524. r *= l ? .2 : .75,
  19525. o *= l ? .2 : .4
  19526. }
  19527. u.multiplyScalar(r),
  19528. h.add(u),
  19529. p.lerp(a.position, o)
  19530. }
  19531. return h.normalize(),
  19532. i.copy(p),
  19533. i.add(h),
  19534. !0
  19535. }
  19536. ),
  19537. t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  19538. var n = e.length;
  19539. if (n <= t)
  19540. return !1;
  19541. if (t === n - 1)
  19542. i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  19543. else {
  19544. var r = this.player.model.panos.get(e[t])
  19545. , o = this.player.model.panos.get(e[t + 1]);
  19546. i.copy(o.position).sub(r.position)
  19547. }
  19548. return i.normalize(),
  19549. !0
  19550. }
  19551. ,
  19552. t.prototype.warpCameraTravel = function(e, t, i, n) {
  19553. if (this.activeTransType = this.upcomingTransType,
  19554. this.lastTransType = this.activeTransType,
  19555. this.upcomingTransType = null,
  19556. e)
  19557. this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
  19558. this._clearWarpShading(),
  19559. this._warpStopFlying(),
  19560. this.player.spider.draw(),
  19561. this.placeCpm(),
  19562. n && n()
  19563. }
  19564. .bind(this)) : this.warpTravel_STD(n);
  19565. else {
  19566. var r = function() {
  19567. this._wrapupTravel(n)
  19568. }
  19569. .bind(this)
  19570. , o = {
  19571. pano: this.warpDestPano,
  19572. lookAtPoint: null,
  19573. duration: null,
  19574. maxDistanceOverride: null,
  19575. skipWarpingCheck: !1
  19576. };
  19577. this.player.flyToPano(o, r)
  19578. }
  19579. }
  19580. ,
  19581. t.prototype.startWarpState = function() {
  19582. this.warping = !0,
  19583. this.warpInterrupted = !1,
  19584. this.warpInterruptionBlackoutStyle = null,
  19585. this.warpInterruptionTravelTime = null
  19586. }
  19587. ,
  19588. t.prototype.endWarpState = function() {
  19589. this.warping = !1
  19590. }
  19591. ,
  19592. t.prototype.warpToPano = function(e, t, i, n) {
  19593. if (this.warping)
  19594. H.warn("Cannot warp when already warping");
  19595. else {
  19596. if (this.upcomingTransType = e,
  19597. this.activeTransType = null,
  19598. !this.setWarpDestPano())
  19599. return this.upcomingTransType = null,
  19600. void this.warpToNonPano(n);
  19601. if (this.player.mode !== O.PANORAMA)
  19602. return this.upcomingTransType = null,
  19603. this.discardSlow(),
  19604. void this.player.flyToNewMode({
  19605. mode: O.PANORAMA,
  19606. pano: this.warpDestPano,
  19607. duration: D.warp.outsideTime,
  19608. warpDest: this.warpDestHeroLoc,
  19609. callback: n,
  19610. force: !0
  19611. });
  19612. if (!this.warpDestPano)
  19613. return H.warn("no warp destination, callback dropped"),
  19614. void (this.upcomingTransType = null);
  19615. 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)
  19616. , o = this.chooseWarpPath(r);
  19617. if (o && this.upcomingTransType !== L.WALK) {
  19618. var a = function() {
  19619. this.waitingToWarp = !1,
  19620. this.warpToPano(e, t, i, n)
  19621. }
  19622. .bind(this);
  19623. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
  19624. return void (this.waitingToWarp = !0)
  19625. }
  19626. this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
  19627. this.player.currentPano = this.warpDestPano,
  19628. this.placeCpm(),
  19629. this.fadeOutCpm(D.path.fadeOutTime),
  19630. this.player.spider.draw()),
  19631. H.debug("Warping to pano ", this.warpDestPano.position),
  19632. this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
  19633. this.startWarpState();
  19634. var s = function() {
  19635. this.endWarpState(),
  19636. n && n()
  19637. }
  19638. .bind(this);
  19639. o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
  19640. }
  19641. }
  19642. ,
  19643. v.exports = t
  19644. }
  19645. ).call(this, "/js/objects/ShowPath.js")
  19646. }
  19647. , {
  19648. "../constants": 8,
  19649. "../effects": 16,
  19650. "../enum/BlackoutStyle": 18,
  19651. "../enum/ModelManagerEvents": 33,
  19652. "../enum/PlayerEvents": 40,
  19653. "../enum/RenderOrder": 42,
  19654. "../enum/Vectors": 50,
  19655. "../enum/Viewmode": 51,
  19656. "../enum/WarpStyle": 52,
  19657. "../gui/gui": 65,
  19658. "../model/ModelManager": 140,
  19659. "../objects/Snapshot": 153,
  19660. "../settings": 166,
  19661. "../shaders": 167,
  19662. "../util/easing": 186,
  19663. "../util/lerp": 188,
  19664. "../util/logger": 189,
  19665. "../util/math": 190,
  19666. "../util/texture": 194,
  19667. "../util/transitions": 195,
  19668. three: 217
  19669. }],
  19670. 152: [function(e, t, i) {
  19671. "use strict";
  19672. function n() {
  19673. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  19674. , t = new r.RawShaderMaterial({
  19675. fragmentShader: o.skysphere.fragmentShader,
  19676. vertexShader: o.skysphere.vertexShader,
  19677. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  19678. side: r.BackSide,
  19679. name: "skysphere"
  19680. });
  19681. t.uniforms.radius.value = e.parameters.radius,
  19682. r.Mesh.call(this, e, t)
  19683. }
  19684. var r = e("three")
  19685. , o = e("../shaders")
  19686. , a = e("../settings");
  19687. (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
  19688. t.exports = n
  19689. }
  19690. , {
  19691. "../settings": 166,
  19692. "../shaders": 167,
  19693. three: 217
  19694. }],
  19695. 153: [function(r, o, e) {
  19696. (function(e) {
  19697. "use strict";
  19698. function t(e) {
  19699. n.call(this, e),
  19700. this.sid = e.sid,
  19701. this.panoId = e.panoId,
  19702. this.orthoZoom = e.orthoZoom,
  19703. this.floorVisibility = e.floorVisibility,
  19704. this.thumbUrl = e.thumbUrl,
  19705. this.name = e.name,
  19706. this.zoom = e.zoom
  19707. }
  19708. var i = (r("three"),
  19709. r("../util/logger"))
  19710. , n = (r("../settings"),
  19711. r("../enum/Viewmode"),
  19712. r("../util/common"),
  19713. r("../util/transitions"),
  19714. r("../util/lerp"),
  19715. r("../util/ajax"),
  19716. r("../util/texture"),
  19717. r("./View"));
  19718. r("events").EventEmitter,
  19719. new i(e),
  19720. (t.prototype = Object.create(n.prototype)).isPano = function() {
  19721. return this.panoId && "" !== this.panoId
  19722. }
  19723. ,
  19724. o.exports = t
  19725. }
  19726. ).call(this, "/js/objects/Snapshot.js")
  19727. }
  19728. , {
  19729. "../enum/Viewmode": 51,
  19730. "../settings": 166,
  19731. "../util/ajax": 181,
  19732. "../util/common": 185,
  19733. "../util/lerp": 188,
  19734. "../util/logger": 189,
  19735. "../util/texture": 194,
  19736. "../util/transitions": 195,
  19737. "./View": 154,
  19738. events: 202,
  19739. three: 217
  19740. }],
  19741. 154: [function(o, a, e) {
  19742. (function(e) {
  19743. "use strict";
  19744. function t(e) {
  19745. e = e || {},
  19746. this.position = new i.Vector3,
  19747. this.quaternion = new i.Quaternion,
  19748. this.update(e)
  19749. }
  19750. var i = o("three")
  19751. , n = o("../util/logger")
  19752. , r = (o("../settings"),
  19753. o("../enum/Viewmode"),
  19754. o("../util/common"),
  19755. o("../util/transitions"),
  19756. o("../util/lerp"),
  19757. o("../util/ajax"),
  19758. o("../util/texture"),
  19759. o("events").EventEmitter);
  19760. new n(e),
  19761. (t.prototype = Object.create(r.prototype)).isValid = function() {
  19762. return !!this.cameraMode
  19763. }
  19764. ,
  19765. t.prototype.update = function(e) {
  19766. return this.cameraMode = e.cameraMode || this.cameraMode,
  19767. this.pano = e.pano || this.pano,
  19768. e.position && this.position.copy(e.position),
  19769. e.quaternion && this.quaternion.copy(e.quaternion),
  19770. this
  19771. }
  19772. ,
  19773. a.exports = t
  19774. }
  19775. ).call(this, "/js/objects/View.js")
  19776. }
  19777. , {
  19778. "../enum/Viewmode": 51,
  19779. "../settings": 166,
  19780. "../util/ajax": 181,
  19781. "../util/common": 185,
  19782. "../util/lerp": 188,
  19783. "../util/logger": 189,
  19784. "../util/texture": 194,
  19785. "../util/transitions": 195,
  19786. events: 202,
  19787. three: 217
  19788. }],
  19789. 155: [function(J, ee, e) {
  19790. (function(e) {
  19791. "use strict";
  19792. function t(e) {
  19793. this.currentPano = null,
  19794. this.nextPano = null,
  19795. this.camera = null,
  19796. this.paused = !1,
  19797. this.flying = !1,
  19798. this.sceneIntersectionPlane = null,
  19799. this.target = new B.Vector3,
  19800. this.mouse = new B.Vector3(1.1,1.1,.5),
  19801. this.mouseAtMouseDown = new B.Vector2,
  19802. this.mouseCouldBeClickToMove = !1,
  19803. this.mouseLastMoveTime = Date.now(),
  19804. this.mouseDown = !1,
  19805. this.mouseDownTimer = null,
  19806. this.couldBeLongTap = !1,
  19807. this.containsMouse = !0,
  19808. this.isTouchEvent = !1,
  19809. this.isPanoHover = !1,
  19810. this.reticule = new n(this),
  19811. this.panoMarkers = [],
  19812. this.spider = new s(this),
  19813. this.quaternion = new B.Quaternion,
  19814. this.position = new B.Vector3(15,10,15),
  19815. this.previousState = null,
  19816. this.lastInsideView = new o,
  19817. this.last360View = new o,
  19818. this.raycaster = new B.Raycaster,
  19819. this.intersect = null,
  19820. this.lastChangeTime = Date.now(),
  19821. this.history = new h,
  19822. this.cameraControls = null,
  19823. this.path = null,
  19824. this.model = null,
  19825. this.domElement = null,
  19826. this.cachedPanoCandidates = null,
  19827. this.basePanoSize = 0,
  19828. this.standardPanoSize = 0,
  19829. this.highPanoSize = 0,
  19830. this.ultraHighPanoSize = 0,
  19831. this.zoomLevel = 1,
  19832. this.zooming = 0,
  19833. this.zoomSpeed = .5,
  19834. this.scrollZoomSpeed = .06,
  19835. this.zoomSpeedAdjust = .05,
  19836. this.defaultZoomIncrement = .2,
  19837. this.baseFov = k.insideFOV,
  19838. this.zoomFov = this.baseFov,
  19839. this.zoomEnabled = !0,
  19840. this.preRenderingEnabled = !1,
  19841. this.setupCustomProperties(e),
  19842. this.zoomStats = new v,
  19843. this.modeTran = ''
  19844. this.currentCursor = '';
  19845. }
  19846. var B = J("three")
  19847. , i = J("./util/logger")
  19848. , n = J("./objects/Reticule")
  19849. , a = J("./objects/Panorama")
  19850. , r = J("./objects/ShowPath")
  19851. , o = J("./objects/View")
  19852. , s = (J("./objects/Snapshot"),
  19853. J("./objects/NSpider"))
  19854. , V = J("./enum/Viewmode")
  19855. , T = (J("./enum/TagStates"),
  19856. J("./enum/Vectors"))
  19857. , l = J("./enum/Keys")
  19858. , k = (J("./enum/AlignmentType"),
  19859. J("./settings"))
  19860. , x = J("./util/common")
  19861. , U = (J("./util/browser"),
  19862. J("./util/math"))
  19863. , H = J("./util/lerp")
  19864. , z = J("./util/easing")
  19865. , G = J("./util/transitions")
  19866. , c = J("events").EventEmitter
  19867. , h = (J("./shaders"),
  19868. J("./util/history"))
  19869. , S = (J("./util/camera"),
  19870. J("./model/ModelManager"),
  19871. J("./enum/PathDiscardMode"))
  19872. , M = J("./enum/PathDisplayMode")
  19873. , W = J("./enum/PlayerEvents")
  19874. , u = J("./enum/ControlEvents")
  19875. , d = J("./enum/ModelManagerEvents")
  19876. , R = J("./enum/WarpStyle")
  19877. , P = J("./enum/BlackoutStyle")
  19878. , p = J("./exception/BasicException")
  19879. , f = J("./enum/PanoSizeClass")
  19880. , g = (J("./tile/TileDownloader"),
  19881. J("./tile/TilePrioritizer"))
  19882. , m = (J("./enum/PanoramaEvents"),
  19883. J("./enum/ZoomEvents"))
  19884. , v = J("./util/ZoomStats")
  19885. , y = J("./constants")
  19886. , j = J("./util/common")
  19887. , A = J("./util/cameraLight")
  19888. , C = J("hot")
  19889. , Y = new i(e)
  19890. , q = Object.freeze({
  19891. FlyToPano: G.getUniqueId(),
  19892. FlyToNewMode: G.getUniqueId(),
  19893. FlyToSameMode: G.getUniqueId(),
  19894. FlyToViewFloor: G.getUniqueId(),
  19895. LookTransition: G.getUniqueId(),
  19896. ZoomTransition: G.getUniqueId()
  19897. });
  19898. function I(e) {
  19899. for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
  19900. o[r] = n.charCodeAt(r);
  19901. return new Blob([o],{
  19902. type: i
  19903. })
  19904. }
  19905. (t.prototype = Object.create(c.prototype)).init = function(e) {
  19906. (window.player = this).modelManager = e.modelManager,
  19907. this.tileDownloader = e.tileDownloader,
  19908. this.panoRenderer = e.panoRenderer,
  19909. this.qualityManager = e.qualityManager,
  19910. this.domElement = e.container,
  19911. this.camera = e.camera,
  19912. this.tagManager = e.tagManager,
  19913. this.cameraControls = e.controls,
  19914. this.path = new r(e.director,this,e.controls),
  19915. this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
  19916. this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
  19917. this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
  19918. this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
  19919. this.tileDownloader.processPriorityQueue = !1,
  19920. this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  19921. this.bindEvents(e.container),
  19922. this.updateModel()
  19923. }
  19924. ,
  19925. t.prototype.screenShot = function(i) {
  19926. if (!this.flying && !this.flyingToTag) {
  19927. var n = this.sceneRenderer;
  19928. for (var e in n.updateScreenSize(i),
  19929. this.model.panos.index)
  19930. this.model.panos.index[e].marker && (this.model.panos.index[e].marker.forceHide = this.model.panos.index[e].marker.visible,
  19931. this.model.panos.index[e].marker.visible = !1);
  19932. for (var e in this.model.hots)
  19933. this.model.hots[e].mesh.visible = !1;
  19934. this.reticule.visible = !1,
  19935. this.reticule.forceUnvisible = !0,
  19936. this.path.currentPanoMarker.mesh.visible = !1,
  19937. setTimeout(function() {
  19938. n.renderer.clear(!0, !0, !0),
  19939. n.renderer.render(n.scene, n.camera);
  19940. var e = n.renderer.domElement.toDataURL(i.type, .9);
  19941. for (var t in i.f && i.f(e),
  19942. n.updateScreenSize({
  19943. resize: !0
  19944. }),
  19945. this.reticule.visible = !0,
  19946. this.model.hots)
  19947. this.model.hots[t].mesh.visible = !0;
  19948. for (var t in this.model.panos.index)
  19949. this.model.panos.index[t].marker.visible = this.model.panos.index[t].marker.forceHide;
  19950. this.path.currentPanoMarker.mesh.visible = !0,
  19951. n.renderer.render(n.scene, n.camera)
  19952. }
  19953. .bind(this), 30)
  19954. }
  19955. }
  19956. ;
  19957. var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
  19958. t.prototype.getWrapShot = function() {
  19959. var i = this.getSnapAngleInfo()
  19960. , n = ",{\r\t" + i
  19961. , r = arguments[0];
  19962. this.screenShot({
  19963. width: 4 * g_snapShotWidth,
  19964. height: 4 * g_snapShotHeight,
  19965. type: "image/jpeg",
  19966. f: function(e) {
  19967. if (r && r.__callback)
  19968. return r.__callback(e, i);
  19969. var t = new Image;
  19970. t.src = e,
  19971. t.onload = function() {
  19972. var e = function(r, i) {
  19973. function n(e, t) {
  19974. var i = o || r
  19975. , n = document.createElement("canvas");
  19976. n.width = i.width,
  19977. n.height = i.height,
  19978. n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
  19979. o = Q(e, n, t)
  19980. }
  19981. function e() {
  19982. var e = o || r
  19983. , t = I(e.src);
  19984. i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
  19985. t = I(e.src)),
  19986. (o = o || new Image).base64Src = e.src,
  19987. o.src = window.URL.createObjectURL(t)
  19988. }
  19989. var o, t = Math.max(r.width, r.height);
  19990. return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
  19991. e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
  19992. e())),
  19993. o || r
  19994. }(this, {
  19995. maxSize: g_snapShotWidth,
  19996. oldType: "jpeg"
  19997. });
  19998. e.src.replace(function(e) {
  19999. return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
  20000. }("image/jpeg"), "image/octet-stream");
  20001. var t = "snap" + (new Date).getTime();
  20002. !function(e, t) {
  20003. var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
  20004. i.href = e,
  20005. i.download = t;
  20006. var n = document.createEvent("MouseEvents");
  20007. n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
  20008. i.dispatchEvent(n)
  20009. }(e.src, t + ".jpg"),
  20010. n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
  20011. n += '\r\t"sid":"' + t + '",',
  20012. n += '\r\t"name":"' + t + '"\r}',
  20013. logData(n)
  20014. }
  20015. }
  20016. })
  20017. }
  20018. ,
  20019. t.prototype.getSnapAngleInfo = function() {
  20020. var e = {}
  20021. , t = '"metadata":{'
  20022. , i = this.camera.quaternion.clone();
  20023. switch (this.mode) {
  20024. case "panorama":
  20025. e.scan_id = this.currentPano.id,
  20026. t += '"scan_id":"' + this.currentPano.id + '",';
  20027. break;
  20028. case "floorplan":
  20029. e.camera_mode = 1,
  20030. (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
  20031. t += '"camera_mode":1,',
  20032. t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
  20033. break;
  20034. case "dollhouse":
  20035. e.camera_mode = 2,
  20036. t += '"camera_mode":2,'
  20037. }
  20038. var n = new B.Quaternion(i.x,i.y,i.z,i.w);
  20039. return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
  20040. n.x *= -1,
  20041. n.w *= -1,
  20042. e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
  20043. e.camera_quaternion = U.toPrecision(n.toArray(), 4),
  20044. e.zoom = this.zoomLevel,
  20045. t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
  20046. }
  20047. ,
  20048. t.prototype.closePopup = function() {
  20049. if (g_currentHot) {
  20050. g_currentHot = null,
  20051. document.getElementById("popup").style.display = "none",
  20052. document.querySelector(".popup-content").removeChild(document.getElementById("id1")),
  20053. $("#popup iframe:last").remove();
  20054. document.getElementById("bgaudio");
  20055. return g_bgAudio && g_bgAudio.paused && 0 != g_bgAudio.readyState && 1 === g_play && g_bgAudio.play(),
  20056. !1
  20057. }
  20058. }
  20059. ,
  20060. t.prototype.setupCustomProperties = function(e) {
  20061. var i = e || V.PANORAMA;
  20062. Object.defineProperty(this, "mode", {
  20063. get: function() {
  20064. return i
  20065. },
  20066. set: function(e) {
  20067. var t = i;
  20068. i = e,
  20069. this.onModeUpdated(t, i)
  20070. }
  20071. })
  20072. }
  20073. ,
  20074. t.prototype.isInMode = function() {
  20075. for (var e = 0; e < arguments.length; e++)
  20076. if (this.mode === arguments[e])
  20077. return !0;
  20078. return !1
  20079. }
  20080. ,
  20081. t.prototype.isOutsideMode = function(e) {
  20082. return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
  20083. }
  20084. ,
  20085. t.prototype.is360View = function(e, t) {
  20086. return e === V.PANORAMA && t && !t.isAligned()
  20087. }
  20088. ,
  20089. t.prototype.setScene = function(e) {
  20090. this.sceneIntersectionPlane = e.plane,
  20091. this.path.setScene(e),
  20092. this.moveReticuleToScene(e)
  20093. }
  20094. ,
  20095. t.prototype.moveReticuleToScene = function(e) {
  20096. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20097. e.add(this.reticule)
  20098. }
  20099. ,
  20100. t.prototype.updateModel = function() {
  20101. function n(e) {
  20102. var t = this.cameraControls.cameras[V.DOLLHOUSE]
  20103. , i = this.cameraControls.controls[V.DOLLHOUSE]
  20104. , n = t.position.y + (e - i.target.y)
  20105. , r = k.showFloorDuration + k.showFloorDelay;
  20106. G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
  20107. G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
  20108. }
  20109. this.model = this.modelManager.getActiveModel(),
  20110. this.model.on("floor.changed", function(e, t, i) {
  20111. this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
  20112. }
  20113. .bind(this)),
  20114. this.model.on("allfloors.toggled", function(e, t) {
  20115. if (this.mode === V.DOLLHOUSE) {
  20116. var i = e ? this.model.center.y : i = t.center.y;
  20117. n.call(this, i)
  20118. }
  20119. }
  20120. .bind(this)),
  20121. this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  20122. var t = this;
  20123. this.model.panos.list.forEach(function(e) {
  20124. e.vrMarker.addEventListener("click", function() {
  20125. t.flyToPano({
  20126. pano: e
  20127. })
  20128. })
  20129. })
  20130. }
  20131. ,
  20132. t.prototype.updateModelDependentData = function() {
  20133. this.cameraControls.setModelForControls(this.model),
  20134. this.getPanoMarkersFromModel(this.model)
  20135. }
  20136. ,
  20137. t.prototype.onModelChanged = function() {
  20138. this.updateModel(),
  20139. this.updateModelDependentData()
  20140. }
  20141. ,
  20142. t.prototype.getPanoMarkersFromModel = function(e) {
  20143. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20144. return t.marker ? e.concat(t.marker) : e
  20145. }, [])
  20146. }
  20147. ,
  20148. t.prototype.handleControlMove = function(e) {
  20149. this.emit(W.Move, e)
  20150. }
  20151. ,
  20152. t.prototype.handleControlInputStart = function(e) {
  20153. this.emit(W.InputStart, e)
  20154. }
  20155. ,
  20156. t.prototype.onModeUpdated = function(e, t) {
  20157. this.cameraControls.activateControls(t),
  20158. this.emit(W.ModeChanged, e, t)
  20159. }
  20160. ,
  20161. t.prototype.isWarping = function() {
  20162. return this.path.warping
  20163. }
  20164. ,
  20165. t.prototype.isWaitingToWarp = function() {
  20166. return this.path.waitingToWarp
  20167. }
  20168. ,
  20169. t.prototype.getLabelScaleFactor = function() {
  20170. if (this.isOutsideMode()) {
  20171. return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
  20172. }
  20173. return .5
  20174. }
  20175. ,
  20176. t.prototype.changeMusic = function() {
  20177. !this.director.tourIsPlaying && g_play && g_bgAudio ? (g_playAudio = g_bgAudio,
  20178. g_bgAudio.play()) : g_play ? g_playAudio = null : g_playAudio = g_bgAudio
  20179. }
  20180. ,
  20181. t.prototype.bindEvents = function(e) {
  20182. e !== document && e.setAttribute("tabindex", -1),
  20183. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20184. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20185. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20186. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20187. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20188. this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
  20189. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20190. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20191. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20192. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20193. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20194. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20195. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20196. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20197. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20198. this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
  20199. this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
  20200. this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
  20201. this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
  20202. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
  20203. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
  20204. window.getSeft && getSeft(this),
  20205. /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? $("#closepop").on("touchstart", this.closePopup.bind(this)) : $("#closepop").on("click", this.closePopup.bind(this))
  20206. }
  20207. ,
  20208. t.prototype.onMouseDown = function(e) {
  20209. e.currentTarget !== document && e.currentTarget.focus(),
  20210. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20211. this.updateIntersect())
  20212. }
  20213. ,
  20214. t.prototype.onMouseMove = function(e) {
  20215. this.isTouchEvent = !1,
  20216. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20217. }
  20218. ,
  20219. t.prototype.onMouseOver = function(e) {
  20220. this.containsMouse = !0,
  20221. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20222. }
  20223. ,
  20224. t.prototype.onMouseOut = function(e) {
  20225. this.containsMouse = !1
  20226. }
  20227. ,
  20228. t.prototype.onMouseUp = function(e) {
  20229. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  20230. }
  20231. ,
  20232. t.prototype.onTouchStart = function(e) {
  20233. if (e.currentTarget !== document && e.currentTarget.focus(),
  20234. !this.mouseDown) {
  20235. this.couldBeLongTap = !0;
  20236. var t = x.average(e.changedTouches, "clientX")
  20237. , i = x.average(e.changedTouches, "clientY");
  20238. this.handleInputStart.call(this, t, i, !0),
  20239. this.mouseDownTimer = setTimeout(function() {
  20240. this.updateIntersect(),
  20241. this.handleInputEnd.call(this, t, i, !0)
  20242. }
  20243. .bind(this), k.input.longTapThreshold)
  20244. }
  20245. }
  20246. ,
  20247. t.prototype.onTouchMove = function(e) {
  20248. var t = x.average(e.changedTouches, "clientX")
  20249. , i = x.average(e.changedTouches, "clientY");
  20250. this.handleInputMove.call(this, t, i, !0)
  20251. }
  20252. ,
  20253. t.prototype.onTouchEnd = function(e) {
  20254. if (clearTimeout(this.mouseDownTimer),
  20255. this.mouseDown) {
  20256. this.couldBeLongTap = !1,
  20257. this.updateIntersect();
  20258. var t = x.average(e.changedTouches, "clientX")
  20259. , i = x.average(e.changedTouches, "clientY");
  20260. this.handleInputEnd.call(this, t, i, !0)
  20261. }
  20262. }
  20263. ,
  20264. t.prototype.onPointerDown = function(e) {
  20265. return e.currentTarget !== document && e.currentTarget.focus(),
  20266. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20267. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20268. void (this.mouseDownTimer = setTimeout(function() {
  20269. this.updateIntersect(),
  20270. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20271. }
  20272. .bind(this), k.input.longTapThreshold)))
  20273. }
  20274. ,
  20275. t.prototype.onPointerMove = function(e) {
  20276. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20277. }
  20278. ,
  20279. t.prototype.onPointerUp = function(e) {
  20280. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20281. this.couldBeLongTap = !1,
  20282. this.updateIntersect(),
  20283. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20284. }
  20285. ,
  20286. t.prototype.onPointerOut = function(e) {
  20287. this.mouseDown = !1
  20288. }
  20289. ,
  20290. t.prototype.onPointerCancel = function(e) {
  20291. this.mouseDown = !1
  20292. }
  20293. ,
  20294. t.prototype.onKeyDown = function(e) {
  20295. var t = function() {
  20296. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
  20297. }
  20298. .bind(this)
  20299. , i = e.which;
  20300. switch (i) {
  20301. case l.F:
  20302. t(),
  20303. this.changeFloor(-1);
  20304. break;
  20305. case l.R:
  20306. t(),
  20307. this.changeFloor(1)
  20308. }
  20309. if (this.mode === V.PANORAMA)
  20310. switch (i) {
  20311. case l.UPARROW:
  20312. case l.W:
  20313. this.flyLocalDirection(T.FORWARD.clone());
  20314. break;
  20315. case l.DOWNARROW:
  20316. case l.S:
  20317. this.flyLocalDirection(T.BACK.clone());
  20318. break;
  20319. case l.A:
  20320. this.flyLocalDirection(T.LEFT.clone());
  20321. break;
  20322. case l.D:
  20323. this.flyLocalDirection(T.RIGHT.clone())
  20324. }
  20325. }
  20326. ,
  20327. t.prototype.handleScrollPinchZoom = function(e) {
  20328. var t = e
  20329. , i = this.zoomLevel;
  20330. this.zoomBy(t),
  20331. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20332. }
  20333. ,
  20334. t.prototype.handleControlPinch = function(e) {
  20335. k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
  20336. }
  20337. ,
  20338. t.prototype.handleControlScroll = function(e) {
  20339. k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20340. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
  20341. }
  20342. ,
  20343. t.prototype.handleInputStart = function(e, t, i) {
  20344. var n = this.handelPadding(e, t);
  20345. e = n.x,
  20346. t = n.y,
  20347. this.isTouchEvent = i,
  20348. U.convertScreenPositionToNDC(e, t, this.mouse),
  20349. U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20350. this.mouseCouldBeClickToMove = !0,
  20351. this.mouseDown = !0,
  20352. this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
  20353. window.EditOverlay && EditOverlay.transformControls.onPointerDown()
  20354. if(!this.overlayInitedPlay /* && !settings.isEdit */ && this.overlayGroup.children.length){
  20355. this.overlayGroup.children.forEach((overlay)=>{overlay.plane.material.map.image.play()})
  20356. this.overlayInitedPlay = true
  20357. }
  20358. }
  20359. ,
  20360. t.prototype.handelPadding = function(e, t) {
  20361. return this.pad || (this.pad = {
  20362. x: dom.getOffset("left", $("#player")[0]),
  20363. y: dom.getOffset("top", $("#player")[0])
  20364. }),
  20365. {
  20366. x: e - this.pad.x,
  20367. y: t - this.pad.y
  20368. }
  20369. }
  20370. ,
  20371. t.prototype.handleInputMove = function(e, t, i) {
  20372. var n = this.handelPadding(e, t);
  20373. e = n.x,
  20374. t = n.y,
  20375. this.isTouchEvent = i,
  20376. U.convertScreenPositionToNDC(e, t, this.mouse);
  20377. var moveToleranceNDC = (window.EditOverlay && EditOverlay.transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
  20378. this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20379. this.couldBeLongTap = !1,
  20380. clearTimeout(this.mouseDownTimer)),
  20381. this.mouseLastMoveTime = Date.now(),
  20382. this.reticule.move(e, t, i)
  20383. window.EditOverlay && EditOverlay.transformControls.onPointerMove()
  20384. }
  20385. ,
  20386. t.prototype.handleInputEnd = function(e, t, i) {
  20387. if (this.isTouchEvent = i,
  20388. this.mouseDown = !1,
  20389. this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
  20390. !i && this.couldBeLongTap)
  20391. return !0;
  20392. if (this.handleLongTap())
  20393. return !0;
  20394. window.EditOverlay && EditOverlay.transformControls.onPointerUp()
  20395. if (this.mouseCouldBeClickToMove) {
  20396. if (this.flying)
  20397. return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20398. !0;
  20399. //add----
  20400. if(this.hoveringPlane){
  20401. this.clickOverlay(this.hoveringPlane)
  20402. return;
  20403. }
  20404. if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
  20405. return EditOverlay.addPlane({intersect:this.intersect});
  20406. }
  20407. /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
  20408. if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
  20409. else if(objects.mainDesign.editType == "addOverlay")return !0;
  20410. } */
  20411. //----------
  20412. if (this.checkHotClick())
  20413. return !0;
  20414. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
  20415. this.history.invalidate(),
  20416. this.intersect)
  20417. return this.flyToPanoClosestToMouse();
  20418. if (this.mode === V.PANORAMA) {
  20419. var n = this.closestPanoInDirection(this.getMouseDirection());
  20420. return n ? this.flyToPano({
  20421. pano: n
  20422. }) : this.bump(this.getMouseDirection())
  20423. }
  20424. }
  20425. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20426. }
  20427. ,
  20428. t.prototype.handleLongTap = function() {
  20429. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
  20430. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
  20431. !0
  20432. }
  20433. ,
  20434. t.prototype.checktagClick = function() {
  20435. if (this.tagManager.intersectTag) {
  20436. var e = this.isTouchEvent
  20437. , t = this.tagManager.clickedOnTag(e, this);
  20438. return e || t || G.cancelById(q.LookTransition),
  20439. !0
  20440. }
  20441. if (this.tagManager.activeTag)
  20442. return this.tagManager.dismissActiveTag(),
  20443. !1
  20444. }
  20445. ,
  20446. t.prototype.rankedtagInDirection = function(e, t) {
  20447. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20448. }
  20449. ,
  20450. t.prototype.start = function(e) {
  20451. $(".toolLeft").removeClass("unable");
  20452. $(".toolTop").removeClass("unable");
  20453. //-------------------
  20454. window.initOverlay(B)
  20455. this.model.loadOverlays()
  20456. window.EditOverlay && window.EditOverlay.init(B);
  20457. //-------------------
  20458. var t = e.mode
  20459. , i = e.pano
  20460. , n = e.position
  20461. , r = e.quaternion
  20462. , o = e.tag
  20463. , a = e.quickstart
  20464. , s = $.Deferred();
  20465. this.updateModelDependentData(),
  20466. this.updateFromControls(),
  20467. this.findDefaultViews();
  20468. var l = this.is360View(t, i);
  20469. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20470. s.done(function(e) {
  20471. this.emit(W.Ready, l, e, o)
  20472. }
  20473. .bind(this)),
  20474. s.promise()
  20475. }
  20476. ,
  20477. t.prototype.startOutside = function(e, t) {
  20478. var i = e.mode
  20479. , n = e.pano
  20480. , r = e.position
  20481. , o = e.quaternion
  20482. , a = e.zoom
  20483. , s = e.floorVisibility
  20484. , l = e.tag;
  20485. this.emit(W.StartOutside, k[i].transitionTime),
  20486. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20487. G.cancelById(q.FlyToViewFloor),
  20488. i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20489. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20490. }
  20491. ,
  20492. t.prototype.startInside = function(e, t, i, n, r) {
  20493. r = r || $.Deferred();
  20494. var o = (this.currentPano = e) && !e.isAligned();
  20495. if (t = o ? e.position : t || e.position,
  20496. i = i || e.quaternion,
  20497. e) {
  20498. var a = this.startInside.bind(this, e, t, i, n, r);
  20499. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20500. return
  20501. }
  20502. return this.mode = V.PANORAMA,
  20503. e.floor.enter(this.mode),
  20504. this.emit(W.PanoChosen, this.currentPano, this.currentPano),
  20505. this.switchCameraMode(this.mode, i),
  20506. this.emit(W.StartInside, o),
  20507. r.resolve(!0),
  20508. r
  20509. }
  20510. ,
  20511. t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
  20512. if (r = r || $.Deferred(),
  20513. this.dollhouseMode(),
  20514. !i)
  20515. return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20516. r.resolve(!1),
  20517. r;
  20518. e = e || i.position;
  20519. var o = n || this.cameraControls.activeControl.camera.quaternion
  20520. , a = i.position;
  20521. return this.fitDollhouse(a, e, o),
  20522. setTimeout(function(e) {
  20523. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
  20524. var t = {
  20525. mode: V.PANORAMA,
  20526. pano: i,
  20527. quaternion: n,
  20528. callback: function() {
  20529. this.emit(W.FlyinFinished),
  20530. r.resolve(!0)
  20531. }
  20532. .bind(this)
  20533. };
  20534. this.flyToNewMode(t)
  20535. }
  20536. .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
  20537. r
  20538. }
  20539. ,
  20540. t.prototype.checkAndWaitForPanoLoad = (Z = {},
  20541. K = {},
  20542. function(t, e, i, n, r, o, a, s, l, c) {
  20543. if (function() {
  20544. for (var e in Z)
  20545. if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
  20546. return !0;
  20547. return !1
  20548. }())
  20549. return !0;
  20550. var h = function(e, t, i) {
  20551. j.delayOneFrame(function() {
  20552. Z[e] = !1,
  20553. r && r(t, i)
  20554. }
  20555. .bind(this))
  20556. }
  20557. .bind(this, t.id)
  20558. , u = function(e, t) {
  20559. j.delayOneFrame(function() {
  20560. Z[e] = !1,
  20561. o && o(t)
  20562. }
  20563. .bind(this))
  20564. }
  20565. .bind(this, t.id);
  20566. try {
  20567. return null != s || (s = !0),
  20568. 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),
  20569. Z[t.id] && (K[t.id] = performance.now()),
  20570. Z[t.id]
  20571. } catch (e) {
  20572. throw Z[t.id] = !1,
  20573. K[t.id] = performance.now() - 5e3,
  20574. e
  20575. }
  20576. }
  20577. ),
  20578. t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  20579. if (!e)
  20580. throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  20581. return r && this.model.waitForLoad(e, function() {
  20582. return e.isLoaded(i)
  20583. }),
  20584. !e.isLoaded(t) && (e.loadCube(t).done(n),
  20585. !0)
  20586. }
  20587. ,
  20588. t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
  20589. function(e, t, i, n, r, o, a, s) {
  20590. if (!e)
  20591. throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  20592. return X.copy(T.FORWARD),
  20593. this.getDirection(X),
  20594. !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
  20595. return e.isLoaded(t)
  20596. }),
  20597. e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
  20598. i && i(e, t)
  20599. }
  20600. .bind(this)).fail(function(e) {
  20601. n && n(e)
  20602. }
  20603. .bind(this)).progress(function(e, t, i) {
  20604. r && r(e, t, i)
  20605. }
  20606. .bind(this)),
  20607. !0)
  20608. }
  20609. ),
  20610. t.prototype.switchCameraMode = function(e, t) {
  20611. var i = this.cameraControls.controls[e]
  20612. , n = i.camera;
  20613. switch (e) {
  20614. case V.PANORAMA:
  20615. n.position.copy(this.currentPano.position);
  20616. var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  20617. i.lookAt(r.add(n.position));
  20618. break;
  20619. case V.DOLLHOUSE:
  20620. var o = this.position.clone();
  20621. 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),
  20622. n.position.copy(o),
  20623. i.target.copy(this.target.clone().setY(this.model.center.y));
  20624. break;
  20625. case V.FLOORPLAN:
  20626. n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
  20627. i.target.copy(this.model.center).setY(0),
  20628. i.zoomToContain(this.model.size),
  20629. i.rotateToView(this.model.size, this.getDirection())
  20630. }
  20631. i.update(0)
  20632. }
  20633. ,
  20634. t.prototype.update = (new B.Vector3,
  20635. N = {},
  20636. F = [],
  20637. function(e) {
  20638. this.updatePersistentZooming(e),
  20639. this.updateFromControls(e),
  20640. this.getCurrentNodePanos(F),
  20641. this.hasChanged(N) && (this.lastChangeTime = Date.now(),
  20642. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  20643. this.emit(W.ViewChanged)),
  20644. this.model.supportsTiles && (this.updateTileDownloader(F),
  20645. this.updatePanoRenderer(F)),
  20646. this.updatePreRendering(F),
  20647. this.reticule.update(),
  20648. this.path.update(),
  20649. this.spider.update(),
  20650. this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  20651. this.updateControlLocks(),
  20652. this.model.supportsTiles && this.updateZoomPano()
  20653. }
  20654. ),
  20655. t.prototype.updatePersistentZooming = function(e) {
  20656. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
  20657. }
  20658. ,
  20659. t.prototype.updateControlLocks = function() {
  20660. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  20661. }
  20662. ,
  20663. t.prototype.updatePanoRenderer = (D = new B.Vector3,
  20664. function(e) {
  20665. var t = this.nextPano || this.currentPano;
  20666. this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
  20667. this.getDirection(D),
  20668. this.panoRenderer.updateDirection(D))
  20669. }
  20670. ),
  20671. t.prototype.cleanupInactivePanos = (O = [],
  20672. L = [],
  20673. function() {
  20674. O.length = 0,
  20675. O.push(this.currentPano),
  20676. this.nextPano && O.push(this.nextPano);
  20677. for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
  20678. L.push(this.panoRenderer.activePanos[e]);
  20679. for (var t = 0; t < L.length; t++) {
  20680. for (var i = L[t], n = !0, r = 0; r < O.length; r++)
  20681. i.id === O[r].id && (n = !1);
  20682. n && i.exit()
  20683. }
  20684. }
  20685. ),
  20686. t.prototype.updatePreRendering = (w = {},
  20687. function(e) {
  20688. if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  20689. var t = this.nextPano || this.currentPano;
  20690. if (t && e && 1 < e.length) {
  20691. var i = e.findIndex(function(e) {
  20692. if (e.id === t.id)
  20693. return !0
  20694. });
  20695. if (0 <= i && i + 1 < e.length) {
  20696. var n = e[i + 1];
  20697. n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
  20698. this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  20699. window.setTimeout(function(e) {
  20700. w[e.id] = !1
  20701. }
  20702. .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
  20703. }
  20704. .bind(this, n), k.tiling.panoPreRenderDelay),
  20705. w[n.id] = !0)
  20706. }
  20707. }
  20708. }
  20709. }
  20710. ),
  20711. t.prototype.enablePreRendering = function() {
  20712. this.preRenderingEnabled = !0
  20713. }
  20714. ,
  20715. t.prototype.disablePreRendering = function() {
  20716. this.preRenderingEnabled = !1,
  20717. this.cleanupInactivePanos()
  20718. }
  20719. ,
  20720. t.prototype.updateTileDownloader = (b = new B.Vector3,
  20721. function(e) {
  20722. var t = this.nextPano || this.currentPano;
  20723. t && (b.copy(T.FORWARD),
  20724. this.getDirection(b),
  20725. this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
  20726. this.tileDownloader.processPriorityQueue = !0)
  20727. }
  20728. ),
  20729. t.prototype.updateFromControls = function(e) {
  20730. null != e || (e = 0),
  20731. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  20732. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  20733. this.position.copy(this.cameraControls.activeControl.camera.position),
  20734. this.target.copy(this.cameraControls.activeControl.target),
  20735. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  20736. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  20737. this.camera.position.copy(this.position),
  20738. this.camera.quaternion.copy(this.quaternion),
  20739. this.camera.updateMatrix(),
  20740. this.camera.updateMatrixWorld()
  20741. }
  20742. ,
  20743. t.prototype.hasChanged = function(e) {
  20744. if (!this.previousState)
  20745. return this.previousState = {
  20746. allFloorsVisible: this.model.allFloorsVisible,
  20747. position: this.position.clone(),
  20748. quaternion: this.quaternion.clone(),
  20749. mouse: this.mouse.clone(),
  20750. labelScaleFactor: this.getLabelScaleFactor(),
  20751. currentFloor: this.model.currentFloor,
  20752. projectionMatrix: this.camera.projectionMatrix.clone(),
  20753. worldMatrix: this.camera.matrixWorld.clone(),
  20754. mode: this.mode,
  20755. modelPosition: this.model.position.clone(),
  20756. modelCenter: this.model.center.clone(),
  20757. zoomLevel: this.zoomLevel
  20758. },
  20759. !0;
  20760. 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;
  20761. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  20762. e.moved = !this.position.equals(this.previousState.position),
  20763. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  20764. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  20765. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  20766. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  20767. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  20768. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  20769. e.modeChanged = this.mode !== this.previousState.mode,
  20770. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  20771. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  20772. e.nextPanoActive = null !== this.nextPano,
  20773. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  20774. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  20775. this.previousState.position.copy(this.position),
  20776. this.previousState.quaternion.copy(this.quaternion),
  20777. this.previousState.mouse.copy(this.mouse),
  20778. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  20779. this.previousState.currentFloor = this.model.currentFloor,
  20780. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  20781. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  20782. this.previousState.mode = this.mode,
  20783. this.previousState.modelPosition.copy(this.model.position),
  20784. this.previousState.modelCenter.copy(this.model.center),
  20785. this.previousState.zoomLevel = this.zoomLevel,
  20786. !t
  20787. }
  20788. ,
  20789. t.prototype.updateIntersect = function() {
  20790. var e = this.flying || this.isWarping()
  20791. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  20792. , i = G.getById(q.LookTransition);
  20793. e || t || this.isTouchEvent || i.length && i[0].running;
  20794. this.intersect = this.getMouseIntersect(),
  20795. this.intersect && this.updateClosestPano(this.intersect),
  20796. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  20797. k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  20798. }
  20799. ,
  20800. t.prototype.checkHotClick = function() {
  20801. if (this.intersectHot)
  20802. return this.intersectHot.examine(this),
  20803. !0
  20804. }
  20805. ,
  20806. t.prototype.getMouseDirection = function(e) {
  20807. e = e || this.mouse;
  20808. var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  20809. return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
  20810. }
  20811. ,
  20812. t.prototype.hoverOverlay = function(mesh){
  20813. if(!mesh){
  20814. this.hoveringPlane = null;
  20815. $("#player").css("cursor",this.currentCursor || "" );
  20816. }else{
  20817. var overlay = mesh.parent;
  20818. $("#player").css("cursor","pointer");
  20819. this.hoveringPlane = overlay;
  20820. return true;
  20821. }
  20822. },
  20823. t.prototype.clickOverlay = function(overlay){
  20824. if(this.openOverlay && !overlay)return;
  20825. var plane = overlay.plane;
  20826. if(overlay.overlayType == "video"){
  20827. if(plane.material.map.image.paused)plane.material.map.image.play()
  20828. else plane.material.map.image.pause();
  20829. }
  20830. if(window.EditOverlay &&EditOverlay.editing){
  20831. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  20832. $('#overlayProp').removeClass('atRight').removeClass('hide')
  20833. EditOverlay.endAddPlane();
  20834. EditOverlay.updateOverlayPanel(overlay)
  20835. EditOverlay.controlSelectOverlay(overlay)
  20836. return;
  20837. }
  20838. },
  20839. t.prototype.getMouseIntersect = function(e, t) {
  20840. for (var i in e = e || this.mouse.clone(),
  20841. t = t || this.model.floors.reduce(function(e, t) {
  20842. return t.hidden ? e : e.concat(t.collider.children)
  20843. }, this.mode === V.PANORAMA ? this.panoMarkers : []),
  20844. this.model.hots)
  20845. t.push(this.model.hots[i].mesh);
  20846. this.overlayGroup && (t = t.concat(this.overlayGroup.children));
  20847. i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
  20848. this.raycaster.set(i, this.getMouseDirection(e));
  20849. var n = this.raycaster.intersectObjects(t, true);
  20850. if ("add" == g_HotStatus) {
  20851. var r = this.raycaster.intersectObjects(window.player.model.chunks);
  20852. console.log(r[0]),
  20853. 1 <= r.length ? ($("#player").css("cursor", "cell"),
  20854. window.hotPointPos = r[0].point) : ($("#player").css("cursor", "not-allowed"),
  20855. window.hotPointsPos = !1)
  20856. }
  20857. if (0 === n.length)
  20858. return this.intersectHot = null,
  20859. "add" != g_HotStatus && $("#player").css("cursor", ""),
  20860. null;
  20861. var o = n[0];
  20862. if ("hotSprite" == o.object.type){
  20863. return this.intersectHot = o.object.belongHot, $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active"),
  20864. void $("#player").css("cursor", "pointer");
  20865. }
  20866. $(".toolRight .spotList ul li").removeClass("active")
  20867. this.intersectHot = null;
  20868. /* if(window.EditOverlay && n && n.length){
  20869. if(n[0].object.parent.parent == this.overlayGroup){
  20870. this.hoverOverlay(n[0].object);
  20871. }else()
  20872. } */
  20873. var intersect = this.hoverOverlay(window.EditOverlay && o && o.object.parent.parent == this.overlayGroup && o.object)
  20874. intersect || "add" != g_HotStatus && $("#player").css("cursor", this.currentCursor),
  20875. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  20876. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  20877. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  20878. o.horizontal = .8 < o.normal.y);
  20879. return o
  20880. }
  20881. ,
  20882. t.prototype.updateClosestPano = function(e) {
  20883. var t = [a.filters.isPanoAligned()];
  20884. if (this.mode === V.PANORAMA) {
  20885. if (!this.currentPano)
  20886. return;
  20887. t.push(a.filters.not(this.currentPano)),
  20888. t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  20889. t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
  20890. t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
  20891. t.push(a.filters.isNotBehindNormal(e.point, e.normal))
  20892. } else
  20893. t.push(a.filters.isOnVisibleFloor()),
  20894. this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
  20895. var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
  20896. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  20897. this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
  20898. this.closestPano = i) : this.isPanoHover = !1
  20899. }
  20900. ,
  20901. t.prototype.dollhouseMode = function(e, t) {
  20902. this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
  20903. this.mode = V.DOLLHOUSE,
  20904. this.cameraControls.controls[V.DOLLHOUSE].reset();
  20905. var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
  20906. , n = new B.Vector3(15,10,15);
  20907. if (e && t) {
  20908. var r = T.FORWARD.clone().applyQuaternion(t)
  20909. , o = this.model.center.clone().sub(e).dot(r);
  20910. 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
  20911. n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  20912. }
  20913. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
  20914. this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
  20915. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
  20916. this.updateFromControls(),
  20917. this.model.alpha = 1,
  20918. this.model.skybox.material.uniforms.opacity.value = 0
  20919. }
  20920. ,
  20921. t.prototype.insideMode = function(e, t) {
  20922. var i = $.Deferred()
  20923. , n = t || null;
  20924. if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
  20925. var r = [a.filters.isPanoAligned()];
  20926. this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
  20927. e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  20928. this.flyToNewMode({
  20929. mode: V.PANORAMA,
  20930. pano: e,
  20931. callback: n
  20932. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  20933. } else {
  20934. var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  20935. i.reject(o)
  20936. }
  20937. return i.promise()
  20938. }
  20939. ,
  20940. t.prototype.fitDollhouse = function(e, t, i) {
  20941. var n = T.FORWARD.clone().applyQuaternion(i);
  20942. i = n.clone().add(e);
  20943. this.cameraControls.activeControl.target.copy(i),
  20944. this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(e).add(n.multiplyScalar(-10))
  20945. }
  20946. ,
  20947. t.prototype.floorplanMode = function(e, t, i) {
  20948. this.mode = V.FLOORPLAN;
  20949. var n = this.cameraControls.controls[V.FLOORPLAN];
  20950. n.reset();
  20951. var r = e || this.model.center;
  20952. if (n.target.copy(r).setY(0),
  20953. n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
  20954. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  20955. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  20956. t) {
  20957. var o = T.LEFT.clone().applyQuaternion(t);
  20958. n.rotateLeft(-Math.atan2(o.x, o.z))
  20959. } else
  20960. n.rotateToView(this.model.size, this.getDirection());
  20961. n.update(0)
  20962. }
  20963. ,
  20964. t.prototype.nonInterruptingFlyToPano = function(e, t) {
  20965. return e.skipWarpingCheck = !0,
  20966. this.flyToPano(e, t)
  20967. }
  20968. ,
  20969. t.prototype.flyToPano = function(e, t) {
  20970. var i, n = e.pano, r = e.lookAtPoint, o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride, l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null;
  20971. if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
  20972. this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
  20973. return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
  20974. t && t(),
  20975. !1;
  20976. if (this.updateLastView(),
  20977. this.mode !== V.PANORAMA)
  20978. return r && (i = (new B.Quaternion).setFromUnitVectors(T.FORWARD, r.sub(n.position).normalize())),
  20979. void this.flyToNewMode({
  20980. mode: V.PANORAMA,
  20981. pano: n,
  20982. duration: o,
  20983. quaternion: i,
  20984. callback: t
  20985. });
  20986. if (!n || (h = x.deepExtend(e),
  20987. u = function() {
  20988. j.delayOneFrame(function() {
  20989. this.flyToPano(h, t)
  20990. }
  20991. .bind(this))
  20992. }
  20993. .bind(this),
  20994. !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
  20995. var d = function(e) {
  20996. t && t(e)
  20997. }
  20998. .bind(this);
  20999. this.currentPano || (this.currentPano = n,
  21000. this.path.placeCpm(),
  21001. this.path.fadeOutCpm(k.path.fadeOutTime),
  21002. this.spider.draw());
  21003. var p = o;
  21004. if ("number" != typeof o) {
  21005. var f = s || k.transition.flytimeMaxDistanceThreshold;
  21006. p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
  21007. }
  21008. if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
  21009. 1 !== this.zoomLevel)
  21010. switch (k.zoom.transitionStyle) {
  21011. case 1:
  21012. this.smoothZoomToDefault(p / 2);
  21013. break;
  21014. case 2:
  21015. return h = x.deepExtend(e),
  21016. u = this.flyToPano.bind(this, h, t),
  21017. void this.smoothZoomToDefault(k.zoom.restoreTime * (this.zoomLevel - 1), u)
  21018. }
  21019. if (r) {
  21020. G.cancelById(q.LookTransition),
  21021. p *= k.transition.aimSlowFactor;
  21022. var g = this.cameraControls.activeControl.camera.quaternion.clone()
  21023. , m = (new B.Matrix4).lookAt(n.position, r, T.UP)
  21024. , v = (new B.Quaternion).setFromRotationMatrix(m)
  21025. , y = g.clone()
  21026. , A = new B.Vector3;
  21027. if (n === this.currentPano) {
  21028. var C = T.FORWARD.clone().applyQuaternion(g)
  21029. , I = T.FORWARD.clone().applyQuaternion(v)
  21030. , E = C.angleTo(I);
  21031. return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
  21032. void G.start(function(e) {
  21033. y.copy(g),
  21034. H.quaternion(y, v)(e),
  21035. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21036. this.cameraControls.activeControl.lookAt(A)
  21037. }
  21038. .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
  21039. }
  21040. }
  21041. if (n === this.currentPano || this.flying)
  21042. return void d();
  21043. this.flying = !0;
  21044. var _ = this.position.clone()
  21045. , b = this.currentPano;
  21046. Y.debug("Flying to pano ", n.position),
  21047. this.emit(W.PanoChosen, this.currentPano, n),
  21048. this.emit(W.FlyingStarted, n.position, _, n, b),
  21049. r && G.start(function(e) {
  21050. y.copy(g),
  21051. H.quaternion(y, v)(e),
  21052. A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
  21053. this.cameraControls.activeControl.lookAt(A)
  21054. }
  21055. .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
  21056. var w = c ? null : z[k.transition.movementEasing];
  21057. this.nextPano = n,
  21058. G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
  21059. G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
  21060. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
  21061. this.flying = !1,
  21062. this.currentPano !== n && this.currentPano.exit(),
  21063. n.enter(),
  21064. this.currentPano = n,
  21065. this.nextPano = null,
  21066. this.path.placeCpm(),
  21067. this.path.fadeOutCpm(k.path.fadeOutTime),
  21068. this.spider.draw(),
  21069. this.emit(W.FlyingEnded, n.position, _, n, b),
  21070. d(e)
  21071. }
  21072. .bind(this), 0, w, "camFly", q.FlyToPano)
  21073. }
  21074. }
  21075. ,
  21076. t.prototype.fastForwardActivePanoFlight = function(e) {
  21077. e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
  21078. G.adjustSpeed(q.FlyToPano, e),
  21079. G.adjustSpeed(q.LookTransition, e)
  21080. }
  21081. ,
  21082. t.prototype.flyToPanoClosestToMouse = function() {
  21083. if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
  21084. this.intersect && this.updateClosestPano(this.intersect)),
  21085. this.closestPano)
  21086. return this.flyToPano({
  21087. pano: this.closestPano
  21088. });
  21089. var e = this.getMouseDirection();
  21090. this.flyDirection(e) || this.flyToPano({
  21091. pano: this.currentPano
  21092. })
  21093. }
  21094. ,
  21095. t.prototype.flyLocalDirection = function(e) {
  21096. var t = this.getDirection(e)
  21097. , i = 1 === e.z ? .4 : .75
  21098. , n = 1 === Math.abs(e.x);
  21099. return this.flyDirection(t, i, n)
  21100. }
  21101. ,
  21102. t.prototype.flyDirection = function(e, t, i) {
  21103. this.closePopup();
  21104. var n = $.Deferred();
  21105. this.history.invalidate();
  21106. var r = this.closestPanoInDirection(e, t, i);
  21107. return r ? this.flyToPano({
  21108. pano: r
  21109. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21110. n.resolve(!1)),
  21111. n.promise()
  21112. }
  21113. ,
  21114. t.prototype.closestPanoInDirection = function(e, t, i) {
  21115. return this.rankedPanoInDirection(0, e, t, i)
  21116. }
  21117. ,
  21118. t.prototype.rankedPanoInDirection = (_ = {
  21119. pano: null,
  21120. candidates: []
  21121. },
  21122. function(e, t, i, n) {
  21123. e = e || 0,
  21124. i = void 0 !== i ? i : .75;
  21125. var r = n ? "angle" : "direction";
  21126. return this.model.panos.findRankedByScore(e, [a.filters.isPanoAligned(), a.filters.inPanoDirection(this.position, t, i), a.filters.isNeighbourPanoTo(this.currentPano), a.filters.not(this.currentPano)], [a.scoreFunctions.distanceSquared(this.currentPano), a.scoreFunctions[r](this.position, t)], _),
  21127. this.cachedPanoCandidates = _.candidates,
  21128. _.pano
  21129. }
  21130. ),
  21131. t.prototype.bump = function(e) {
  21132. if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
  21133. var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
  21134. if (.5 < Math.abs(a))
  21135. t = function() {
  21136. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
  21137. }
  21138. .bind(this),
  21139. i = function() {
  21140. G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
  21141. }
  21142. .bind(this);
  21143. else {
  21144. var s = this.camera.position.clone()
  21145. , l = e.clone();
  21146. this.raycaster.set(s, l);
  21147. var c = this.model.floors.reduce(function(e, t) {
  21148. return e.concat(t.collider.children)
  21149. }, [])
  21150. , h = this.raycaster.intersectObjects(c)
  21151. , u = 0 < h.length ? h[0].distance / 25 : .04
  21152. , d = s.clone().add(l.multiplyScalar(u));
  21153. t = function() {
  21154. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
  21155. }
  21156. .bind(this),
  21157. i = function() {
  21158. G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
  21159. }
  21160. .bind(this)
  21161. }
  21162. n = function() {
  21163. this.flying = !1
  21164. }
  21165. .bind(this),
  21166. this.flying = !0,
  21167. t()
  21168. }
  21169. }
  21170. ,
  21171. t.prototype.changeFloor = function(e) {
  21172. if (!this.is360View(this.mode, this.currentPano))
  21173. if (this.mode === V.PANORAMA) {
  21174. var t = this.history.reversePano(e);
  21175. t && t.isAligned() ? this.flyToPano({
  21176. pano: t
  21177. }) : this.changeFloorByScore(e)
  21178. } else
  21179. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21180. }
  21181. ,
  21182. t.prototype.changeFloorByScore = (E = {
  21183. pano: null,
  21184. candidates: []
  21185. },
  21186. function(e) {
  21187. var t = this.model.nextFloor(e);
  21188. 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),
  21189. void (E.pano ? (this.cachedPanoCandidates = E.candidates,
  21190. this.history.push(e, this.currentPano),
  21191. this.flyToPano({
  21192. pano: E.pano
  21193. })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
  21194. }
  21195. ),
  21196. t.prototype.gotoFloor = function(e) {
  21197. var t = e - this.model.currentFloor.floorIndex;
  21198. this.changeFloor(t)
  21199. }
  21200. ,
  21201. t.prototype.getDirection = function(e) {
  21202. return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
  21203. }
  21204. ,
  21205. t.prototype.flyToSameMode = function(e, t, i, n, r) {
  21206. if (r = r || $.Deferred(),
  21207. this.mode === V.TRANSITIONING)
  21208. return Y.warn("should not be transitioning here"),
  21209. n && n(!1),
  21210. r.reject().promise();
  21211. var o = i || !1
  21212. , a = i ? i.position : this.position
  21213. , s = this.position.clone()
  21214. , l = this.currentPano;
  21215. if (Y.debug("New pose in mode " + this.mode),
  21216. !e || (retryCallback = function() {
  21217. j.delayOneFrame(function() {
  21218. this.flyToSameMode(e, t, i, n, r)
  21219. }
  21220. .bind(this))
  21221. }
  21222. .bind(this),
  21223. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21224. var c = function() {
  21225. this.emit(W.FlyingEnded, a, s, e, l),
  21226. n && n(!0)
  21227. }
  21228. .bind(this)
  21229. , h = k[this.mode]
  21230. , u = void 0 !== t ? t : h.transitionTime
  21231. , d = new B.Vector3
  21232. , p = new B.Vector3;
  21233. if (this.emit(W.FlyingStarted, a, s, e, l),
  21234. this.mode === V.PANORAMA)
  21235. Y.warn("we should not be here for panorama views");
  21236. else if (this.mode === V.DOLLHOUSE)
  21237. if (o) {
  21238. var f = new B.Vector3(0,1,0);
  21239. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21240. this.model.warpDestFloors(i.floorVisibility),
  21241. p.copy(i.position);
  21242. var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21243. , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
  21244. , v = 3;
  21245. m.length ? (d.copy(m[0].point),
  21246. v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
  21247. Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21248. var y = (new B.Matrix4).lookAt(p, d, f)
  21249. , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
  21250. , C = d.distanceTo(p)
  21251. , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
  21252. , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
  21253. , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
  21254. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
  21255. var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
  21256. b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
  21257. this.path.burnsDir = Math.sign(b.y);
  21258. var w = new B.Euler(0,0,0,k.warp.eOrder)
  21259. , T = new B.Vector3;
  21260. G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21261. G.start(function(e, t) {
  21262. w.x = E.x + e * b.x,
  21263. w.y = E.y + e * b.y,
  21264. w.z = E.z + e * b.z;
  21265. var i = _ + e * (C - _);
  21266. T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
  21267. this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
  21268. }
  21269. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
  21270. G.start(function(e, t) {
  21271. this.cameraControls.controls[V.DOLLHOUSE].update(),
  21272. this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
  21273. this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
  21274. }
  21275. .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21276. } else
  21277. Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21278. else if (this.path.placeCpm(),
  21279. this.path.fadeInCpm(k.path.fadeInTime),
  21280. i) {
  21281. this.model.warpDestFloors(i.floorVisibility);
  21282. var x = this.cameraControls.cameras[V.FLOORPLAN]
  21283. , S = this.cameraControls.controls[V.FLOORPLAN]
  21284. , M = S.target.clone()
  21285. , R = i.position.clone().sub(M)
  21286. , P = x.position.clone().sub(S.target).length()
  21287. , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21288. , L = Math.atan2(S.offset.x, S.offset.z)
  21289. , D = Math.atan2(O.x, O.z)
  21290. , N = S.absoluteScale
  21291. , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
  21292. G.start(function(e, t) {
  21293. S.target.copy(R).multiplyScalar(e).add(M);
  21294. var i = L + (D - L) * e;
  21295. S.offset.x = P * Math.sin(i),
  21296. S.offset.z = P * Math.cos(i),
  21297. x.position.copy(S.target).add(S.offset),
  21298. S.absoluteScale = N + e * (F - N),
  21299. S.update(),
  21300. this.quaternion.copy(x.quaternion),
  21301. this.position.copy(x.position),
  21302. this.target.copy(S.target),
  21303. this.camera.projectionMatrix.copy(x.projectionMatrix)
  21304. }
  21305. .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
  21306. } else
  21307. Y.info("flyToSameMode() funny floorplan view? skipping");
  21308. return G.setTimeout(function(e) {
  21309. this.mode = e,
  21310. c(),
  21311. r.resolve(!0)
  21312. }
  21313. .bind(this, this.mode), u, q.FlyToSameMode),
  21314. this.mode = V.TRANSITIONING,
  21315. r.promise()
  21316. }
  21317. }
  21318. ,
  21319. t.prototype.flyToNewMode = function(e, t) {
  21320. var i = (e = e || {}).mode
  21321. , n = e.pano
  21322. , r = e.duration
  21323. , o = e.warpDest
  21324. , a = e.callback
  21325. , s = e.force
  21326. , l = e.quaternion;
  21327. if (t = t || $.Deferred(),
  21328. this.isWarping())
  21329. return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21330. a && a(!1),
  21331. t.reject("Cannot change mode during tour transition").promise();
  21332. if (this.mode === V.TRANSITIONING)
  21333. return a && a(!1),
  21334. t.reject("Cannot change mode during mode transition").promise();
  21335. if (i === this.mode)
  21336. return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21337. t.promise()) : (a && a(!1),
  21338. t.reject("Already in " + i + " mode").promise());
  21339. var c = o || !1;
  21340. Y.debug("Switching mode to " + i);
  21341. var h = function() {
  21342. j.delayOneFrame(function() {
  21343. this.flyToNewMode(e, t)
  21344. }
  21345. .bind(this))
  21346. }
  21347. .bind(this);
  21348. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
  21349. return t.promise();
  21350. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  21351. return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21352. this.model.waitForLoad(this.model, function() {
  21353. return this.model.meshTexturesLoaded
  21354. }
  21355. .bind(this)),
  21356. this.model.loadMeshTextures().done(h),
  21357. t.promise();
  21358. this.history.invalidate(),
  21359. this.updateLastView();
  21360. var u = this.mode
  21361. , d = this.cameraControls.cameras[i];
  21362. e = x.deepExtend({}, k[i], k[u + "-" + i]);
  21363. var p = void 0 !== r ? r : e.transitionTime;
  21364. this.emit(W.ModeChanging, u, i, n),
  21365. n && (this.currentPano = n),
  21366. this.switchCameraMode(i, l),
  21367. G.cancelById(q.LookTransition);
  21368. var f = (new B.Vector3).copy(this.position);
  21369. this.modeTran = this.mode + "-" + i;
  21370. if (i === V.PANORAMA)
  21371. this.emit(W.PanoChosen, n, n),
  21372. setTimeout(function() {
  21373. n.floor.enter(i)
  21374. }
  21375. .bind(this), p / 2),
  21376. this.path.fadeOutCpm(k.path.fadeOutTime);
  21377. else if (i === V.DOLLHOUSE) {
  21378. if (c && (this.model.stayPut = !0),
  21379. o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
  21380. this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
  21381. this.path.placeCpm(),
  21382. this.path.fadeInCpm(k.path.fadeInTime),
  21383. c) {
  21384. var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
  21385. f.set(15, 10, 15);
  21386. var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
  21387. , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
  21388. v.length ? (g.copy(v[0].point),
  21389. f.copy(o.position),
  21390. 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),
  21391. this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
  21392. this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
  21393. f.add(this.model.position),
  21394. d.position.copy(f),
  21395. this.cameraControls.controls[V.DOLLHOUSE].update()
  21396. }
  21397. } else if (this.path.placeCpm(),
  21398. this.path.fadeInCpm(k.path.fadeInTime),
  21399. o) {
  21400. this.model.warpDestFloors(o.floorVisibility);
  21401. var y = this.cameraControls.cameras[V.FLOORPLAN]
  21402. , A = this.cameraControls.controls[V.FLOORPLAN]
  21403. , C = y.position.clone().sub(A.target)
  21404. , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
  21405. , E = Math.atan2(I.x, I.z);
  21406. A.target.copy(o.position);
  21407. var _ = C.length();
  21408. A.offset.x = _ * Math.sin(E),
  21409. A.offset.y = 0,
  21410. A.offset.z = _ * Math.cos(E),
  21411. y.position.copy(A.target).add(A.offset),
  21412. A.target.clone().sub(d.position),
  21413. d.quaternion.copy(o.quaternion),
  21414. A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
  21415. A.absoluteScale = A.currentScale,
  21416. A.update()
  21417. } else
  21418. this.model.currentFloor.enter(i);
  21419. var b = this.currentPano
  21420. , w = this.position.clone();
  21421. return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
  21422. this.flying = !0,
  21423. this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
  21424. d.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21425. d.controls.update()),
  21426. e.blackoutStyle = P.FADEIN,
  21427. p = k.show360Views.transitionTime,
  21428. this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
  21429. this.mode = i,
  21430. this.path && this.path.popOutCpm(),
  21431. e.blackoutStyle = P.END,
  21432. p = k.show360Views.transitionTime,
  21433. this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
  21434. G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
  21435. G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
  21436. G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
  21437. G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
  21438. G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
  21439. G.setTimeout(function() {
  21440. this.flying = !1,
  21441. u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
  21442. this.currentPano.enter(),
  21443. this.path.placeCpm(),
  21444. this.path.fadeOutCpm(k.path.fadeOutTime),
  21445. this.spider.draw()),
  21446. u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
  21447. this.mode = i,
  21448. this.emit(W.FlyingEnded, f, w, this.currentPano, b),
  21449. c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
  21450. t.resolve())
  21451. }
  21452. .bind(this), p, q.FlyToNewMode),
  21453. this.mode = V.TRANSITIONING,
  21454. t.promise()
  21455. }
  21456. ,
  21457. t.prototype.fade360View = function(e, t, i) {
  21458. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  21459. $(this.domElement).fadeOut(.5 * e, function() {
  21460. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  21461. this.model.alpha = i.modelAlpha,
  21462. this.position.copy(t.position),
  21463. this.quaternion.copy(t.quaternion),
  21464. this.camera.projectionMatrix.copy(t.projectionMatrix),
  21465. $(this.domElement).fadeIn(.5 * e)
  21466. }
  21467. .bind(this))
  21468. }
  21469. ,
  21470. t.prototype.findDefaultViews = function() {
  21471. this.findDefaultView(this.lastInsideView, !0),
  21472. this.findDefaultView(this.last360View, !1)
  21473. }
  21474. ,
  21475. t.prototype.findDefaultView = function(e, i) {
  21476. var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  21477. if (e.cameraMode !== V.PANORAMA)
  21478. return !1;
  21479. var t = r.get(e.panoId);
  21480. return t && t.isAligned() === i
  21481. });
  21482. 0 <= o ? (t = r.get(n[o].panoId),
  21483. e.update({
  21484. cameraMode: V.PANORAMA,
  21485. pano: t,
  21486. position: n[o].position,
  21487. quaternion: n[o].quaternion
  21488. })) : 0 <= (o = r.list.findIndex(function(e) {
  21489. return e.isAligned() === i
  21490. })) ? (t = r.list[o],
  21491. e.update({
  21492. cameraMode: V.PANORAMA,
  21493. pano: t,
  21494. position: t.position
  21495. })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
  21496. }
  21497. ,
  21498. t.prototype.updateLastView = function() {
  21499. this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
  21500. pano: this.currentPano,
  21501. position: this.position,
  21502. quaternion: this.quaternion
  21503. })
  21504. }
  21505. ,
  21506. t.prototype.goToLastView = function(e, t) {
  21507. var i = $.Deferred()
  21508. , n = i.resolve.bind(i)
  21509. , r = i.reject.bind(i)
  21510. , o = e ? this.lastInsideView : this.last360View;
  21511. return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  21512. this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
  21513. this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  21514. mode: o.cameraMode,
  21515. pano: o.pano,
  21516. quaternion: o.quaternion,
  21517. callback: t
  21518. }).done(n).fail(r),
  21519. i.promise()
  21520. }
  21521. ,
  21522. t.prototype.fadeToView = function(e, t, i, n) {
  21523. var r = $.Deferred()
  21524. , o = r.resolve.bind(r)
  21525. , a = r.reject.bind(r);
  21526. if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
  21527. return Y.warn("Tried to fade to an illegal view", t.cameraMode),
  21528. a("Cannot go to illegal view"),
  21529. r.promise();
  21530. var s = (k[t.cameraMode],
  21531. function() {
  21532. $(this.domElement).fadeIn(.5 * i),
  21533. n && n(),
  21534. o()
  21535. }
  21536. .bind(this))
  21537. , l = e ? P.FADEIN : P.END;
  21538. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  21539. $(this.domElement).fadeOut(.5 * i, function() {
  21540. this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
  21541. t.cameraMode === V.PANORAMA ? this.flyToPano({
  21542. pano: t.pano,
  21543. lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  21544. duration: 0
  21545. }, s) : this.flyToNewMode({
  21546. mode: t.cameraMode,
  21547. quaternion: t.quaternion,
  21548. duration: 0,
  21549. callback: s
  21550. })
  21551. }
  21552. .bind(this)),
  21553. r.promise()
  21554. }
  21555. ,
  21556. t.prototype.startWarp = function(e, t, i, n, r, o) {
  21557. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  21558. this.flying)
  21559. return Y.warn("Player.startWarp() -> Cannot warp when flying"),
  21560. o && o(),
  21561. !1;
  21562. null != e || (e = M.Show),
  21563. this.history.invalidate(),
  21564. e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
  21565. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  21566. return this.emit(W.WarpStarted, a, i, n, r),
  21567. n = n || P.MIDDLE,
  21568. this.path.warpToPano(i, n, r, function() {
  21569. t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
  21570. this.emit(W.WarpEnded, i),
  21571. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  21572. o && o()
  21573. }
  21574. .bind(this)),
  21575. e === M.Hide && this.path.discardPathObject(),
  21576. !0
  21577. }
  21578. ,
  21579. t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  21580. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  21581. s && s(),
  21582. !1)
  21583. }
  21584. ,
  21585. t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  21586. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  21587. a && a(),
  21588. !1)
  21589. }
  21590. ,
  21591. t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  21592. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  21593. }
  21594. ,
  21595. t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  21596. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  21597. !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  21598. t && t(),
  21599. !1)
  21600. }
  21601. ,
  21602. t.prototype.aimTourCamera = function(e, t, i, n) {
  21603. return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  21604. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  21605. }
  21606. ,
  21607. t.prototype.showPathToHeroLocation = function(e) {
  21608. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
  21609. }
  21610. ,
  21611. t.prototype.tourInterlude = function(e, t) {
  21612. this.history.invalidate(),
  21613. this.path.discardSlow();
  21614. var i = g_data2.tourAudio && g_data2.tourAudio[this.model.heroLocations[this.director.currentItem].sid]
  21615. , n = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  21616. , r = i && i.music ? i.time - n : 2e3;
  21617. this.path.waitNextStep(e, function() {
  21618. t && t()
  21619. }
  21620. .bind(this), r)
  21621. }
  21622. ,
  21623. t.prototype.stopInterlude = function() {
  21624. this.interruptAndFastForward(null, 0)
  21625. }
  21626. ,
  21627. t.prototype.interruptAndFastForward = function(e, t) {
  21628. this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
  21629. this.flying && this.emit(W.FlyingInterrupted),
  21630. this.path.interruptAndFastForward(e, t)
  21631. }
  21632. ,
  21633. t.prototype.setSize = function(e, t) {
  21634. var i = e / t;
  21635. this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
  21636. var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
  21637. for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
  21638. this.cameraControls.cameras) {
  21639. var o = this.cameraControls.cameras[r];
  21640. o.fov = this.baseFov * (1 / this.zoomLevel),
  21641. o.updateAspect(i)
  21642. }
  21643. }
  21644. ,
  21645. t.prototype.toJSON = function() {
  21646. var e = {};
  21647. return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
  21648. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  21649. return e.hidden ? 0 : 1
  21650. }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
  21651. e
  21652. }
  21653. ,
  21654. t.prototype.getCurrentNodePanos = function(e) {
  21655. if (this.model.panos.map,
  21656. e.length = 0,
  21657. this.path.nodes)
  21658. for (var t = 0; t < this.path.nodes.length; t++) {
  21659. var i = this.path.nodes[t];
  21660. e.push(this.model.panos.get(i))
  21661. }
  21662. }
  21663. ,
  21664. t.prototype.zoomIncrementally = function(e) {
  21665. var t = this.zoomLevel;
  21666. this.zoomTo(this.zoomLevel + e),
  21667. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  21668. }
  21669. ,
  21670. t.prototype.zoomInIncrementally = function(e) {
  21671. e = e || this.defaultZoomIncrement,
  21672. this.zoomIncrementally(e)
  21673. }
  21674. ,
  21675. t.prototype.zoomOutIncrementally = function(e) {
  21676. e = e || -this.defaultZoomIncrement,
  21677. this.zoomIncrementally(e)
  21678. }
  21679. ,
  21680. t.prototype.zoomBy = function(e) {
  21681. this.zoomTo(this.zoomLevel * e)
  21682. }
  21683. ,
  21684. t.prototype.zoomIn = function() {
  21685. this.zoomBy(1 + this.zoomSpeed)
  21686. }
  21687. ,
  21688. t.prototype.zoomOut = function() {
  21689. this.zoomBy(1 - this.zoomSpeed)
  21690. }
  21691. ,
  21692. t.prototype.zoomTo = function(e, t) {
  21693. if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
  21694. e > k.zoom.max && (e = k.zoom.max),
  21695. e > this.zoomLevel ? (this.emit(m.ZoomIn),
  21696. e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
  21697. e === k.zoom.min && this.emit(m.ZoomMin)),
  21698. this.cameraControls.activeControl)) {
  21699. var i = this.cameraControls.activeControl.camera;
  21700. this.zoomLevel = e,
  21701. i.fov = this.baseFov * (1 / this.zoomLevel),
  21702. i.updateProjectionMatrix(),
  21703. this.zoomFov = i.fov
  21704. }
  21705. }
  21706. ,
  21707. t.prototype.increaseZoomSpeed = function() {
  21708. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  21709. }
  21710. ,
  21711. t.prototype.decreaseZoomSpeed = function() {
  21712. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  21713. }
  21714. ,
  21715. t.prototype.clampZoomSpeed = function(e) {
  21716. return e < 0 ? 0 : e
  21717. }
  21718. ,
  21719. t.prototype.activatePersistentZooming = function(e) {
  21720. this.zooming = e ? 1 : -1
  21721. }
  21722. ,
  21723. t.prototype.deactivatePersistentZooming = function() {
  21724. this.zooming = 0
  21725. }
  21726. ,
  21727. t.prototype.zoomDefault = function() {
  21728. this.zoomTo(1, !0)
  21729. }
  21730. ,
  21731. t.prototype.smoothZoomToDefault = function(e, t) {
  21732. var i, n = this.zoomLevel, r = function(e) {
  21733. 1 < e && (e = 1),
  21734. i = n * (1 - e) + e,
  21735. this.zoomTo(i, !0)
  21736. }
  21737. .bind(this), o = function() {
  21738. this.zoomDefault(),
  21739. t && window.setTimeout(t, 50)
  21740. }
  21741. .bind(this);
  21742. G.start(r, e, o, null, 0, z[k.transition.blendEasing])
  21743. }
  21744. ,
  21745. t.prototype.updateZoomPano = function() {
  21746. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
  21747. var e = this.currentPano;
  21748. if (e) {
  21749. var t = this.zoomLevel > k.zoom.activationThreshold
  21750. , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
  21751. t);
  21752. this.tileDownloader.tilePrioritizer.setZoomingActive(i),
  21753. this.panoRenderer.setZoomingActive(i, e, !0);
  21754. var n = function(e, t) {
  21755. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  21756. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  21757. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  21758. e.setZoomed(t)
  21759. }
  21760. .bind(this);
  21761. i && !e.zoomed ? (n(e, !0),
  21762. this.panoRenderer.enableUltraHighQualityMode(function() {
  21763. this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
  21764. i && n(e, !0)
  21765. }
  21766. .bind(this))) : !t && e.zoomed && n(e, !1)
  21767. }
  21768. }
  21769. }
  21770. ,
  21771. ee.exports = t
  21772. }
  21773. ).call(this, "/js/player.js")
  21774. }
  21775. , {
  21776. "./constants": 8,
  21777. "./enum/AlignmentType": 17,
  21778. "./enum/BlackoutStyle": 18,
  21779. "./enum/ControlEvents": 21,
  21780. "./enum/Keys": 30,
  21781. "./enum/ModelManagerEvents": 33,
  21782. "./enum/PanoSizeClass": 36,
  21783. "./enum/PanoramaEvents": 37,
  21784. "./enum/PathDiscardMode": 38,
  21785. "./enum/PathDisplayMode": 39,
  21786. "./enum/PlayerEvents": 40,
  21787. "./enum/TagStates": 44,
  21788. "./enum/Vectors": 50,
  21789. "./enum/Viewmode": 51,
  21790. "./enum/WarpStyle": 52,
  21791. "./enum/ZoomEvents": 53,
  21792. "./exception/BasicException": 55,
  21793. "./model/ModelManager": 140,
  21794. "./objects/NSpider": 147,
  21795. "./objects/Panorama": 148,
  21796. "./objects/Reticule": 149,
  21797. "./objects/ShowPath": 151,
  21798. "./objects/Snapshot": 153,
  21799. "./objects/View": 154,
  21800. "./settings": 166,
  21801. "./shaders": 167,
  21802. "./tile/TileDownloader": 171,
  21803. "./tile/TilePrioritizer": 172,
  21804. "./util/ZoomStats": 179,
  21805. "./util/browser": 182,
  21806. "./util/camera": 183,
  21807. "./util/cameraLight": 184,
  21808. "./util/common": 185,
  21809. "./util/easing": 186,
  21810. "./util/history": 187,
  21811. "./util/lerp": 188,
  21812. "./util/logger": 189,
  21813. "./util/math": 190,
  21814. "./util/transitions": 195,
  21815. hot: "hot",
  21816. scaleImg: "scaleImg",
  21817. events: 202,
  21818. three: 217
  21819. }],
  21820. scaleImg: [function(e, t) {
  21821. var i = t;
  21822. (function() {
  21823. function e(e, t, i, n) {
  21824. function r() {
  21825. (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
  21826. U.height = p,
  21827. H = U.getContext("2d")
  21828. }
  21829. function o(e) {
  21830. if (e) {
  21831. var t, i = H.getImageData(0, 0, d, p), n = i.data;
  21832. for (t = 0; t < ie; t += 4)
  21833. n[t] = e[t] * ne | 0,
  21834. n[t + 1] = e[t + 1] * ne | 0,
  21835. n[t + 2] = e[t + 2] * ne | 0,
  21836. n[t + 3] = e[t + 3] * ne | 0;
  21837. return delete e,
  21838. i
  21839. }
  21840. return H.getImageData(0, 0, d, p)
  21841. }
  21842. function a(e, t, i, n, r) {
  21843. return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
  21844. }
  21845. var s, l;
  21846. if (t || (t = e.input,
  21847. i = e.output,
  21848. n = e.inputRemovable,
  21849. e.scale && (e = e.scale)),
  21850. t.src)
  21851. if (s = document.createElement("canvas"),
  21852. null != t.naturalWidth)
  21853. s.width = t.naturalWidth,
  21854. s.height = t.naturalHeight;
  21855. else if (null != t.runtimeStyle) {
  21856. var c = t.runtimeStyle
  21857. , h = c.width
  21858. , u = c.height;
  21859. c.width = "auto",
  21860. c.height = "auto",
  21861. s.width = t.width,
  21862. s.height = t.height,
  21863. c.width = h,
  21864. c.height = u
  21865. } else {
  21866. h = t.width,
  21867. u = t.height;
  21868. t.removeAttribute && (t.removeAttribute("width"),
  21869. t.removeAttribute("height")),
  21870. s.width = t.width,
  21871. s.height = t.height,
  21872. t.width = h,
  21873. t.height = u
  21874. }
  21875. else
  21876. s = t;
  21877. l = s.getContext("2d"),
  21878. t.src && l.drawImage(t, 0, 0);
  21879. var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
  21880. if (!f || !g)
  21881. return !1;
  21882. (t.src || n) && s.clearRect(0, 0, f, g),
  21883. p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
  21884. e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
  21885. g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
  21886. e * g + .5 | 0);
  21887. 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;
  21888. if (1 < re || 1 < oe)
  21889. for (r(),
  21890. G = (z = o()).data,
  21891. C = 0; C < p; C++)
  21892. for (V = (y = C / oe) - (w = 0 | y),
  21893. j = w * $,
  21894. W = w < 1 ? j : j - $,
  21895. w < g - 2 ? (Y = j + $,
  21896. q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
  21897. A = 0; A < d; A++,
  21898. te += 4)
  21899. Z = (b = 0 | (v = A / re)) << 2,
  21900. b < f - 2 ? (K = Z + 4,
  21901. Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
  21902. 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,
  21903. ++Z,
  21904. ++K,
  21905. ++Q,
  21906. 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,
  21907. ++Z,
  21908. ++K,
  21909. ++Q,
  21910. 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,
  21911. ++Z,
  21912. ++K,
  21913. ++Q,
  21914. 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,
  21915. G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
  21916. G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
  21917. G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
  21918. G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
  21919. else {
  21920. if (le.Float32Array)
  21921. L = new Float32Array(ie);
  21922. else
  21923. for (L = [],
  21924. te = 0; te < ie; ++te)
  21925. L[te] = 0;
  21926. for (y = 0; y < g; y++)
  21927. for (I = (_ = 0 | (C = y * oe)) * J,
  21928. (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
  21929. R = C + oe - _ - 1),
  21930. v = 0; v < f; v++,
  21931. ee += 4)
  21932. switch (A = v * re,
  21933. E = 0 | A,
  21934. te = I + (E << 2),
  21935. P = !!((E - (A + re | 0)) * (f - 1 - v)),
  21936. P && (x = 1 + E - A,
  21937. S = A + re - E - 1),
  21938. D = m[ee],
  21939. F = m[ee + 1],
  21940. B = m[ee + 2],
  21941. N = m[ee + 3],
  21942. P + O) {
  21943. case 0:
  21944. L[te] += D * ae,
  21945. L[te + 1] += F * ae,
  21946. L[te + 2] += B * ae,
  21947. L[te + 3] += N * ae;
  21948. break;
  21949. case 1:
  21950. T = x * oe,
  21951. L[te] += D * T,
  21952. L[te + 1] += F * T,
  21953. L[te + 2] += B * T,
  21954. L[te + 3] += N * T,
  21955. T = S * oe,
  21956. L[te + 4] += D * T,
  21957. L[te + 5] += F * T,
  21958. L[te + 6] += B * T,
  21959. L[te + 7] += N * T;
  21960. break;
  21961. case 2:
  21962. T = re * M,
  21963. L[te] += D * T,
  21964. L[te + 1] += F * T,
  21965. L[te + 2] += B * T,
  21966. L[te + 3] += N * T,
  21967. T = re * R,
  21968. L[te += J] += D * T,
  21969. L[te + 1] += F * T,
  21970. L[te + 2] += B * T,
  21971. L[te + 3] += N * T;
  21972. break;
  21973. default:
  21974. T = x * M,
  21975. L[te] += D * T,
  21976. L[te + 1] += F * T,
  21977. L[te + 2] += B * T,
  21978. L[te + 3] += N * T,
  21979. T = S * M,
  21980. L[te + 4] += D * T,
  21981. L[te + 5] += F * T,
  21982. L[te + 6] += B * T,
  21983. L[te + 7] += N * T,
  21984. T = x * R,
  21985. L[te += J] += D * T,
  21986. L[te + 1] += F * T,
  21987. L[te + 2] += B * T,
  21988. L[te + 3] += N * T,
  21989. T = S * R,
  21990. L[te + 4] += D * T,
  21991. L[te + 5] += F * T,
  21992. L[te + 6] += B * T,
  21993. L[te + 7] += N * T
  21994. }
  21995. delete m,
  21996. r(),
  21997. z = o(L)
  21998. }
  21999. if (H.putImageData(z, 0, 0),
  22000. "string" == typeof i) {
  22001. var se;
  22002. if ("png" === i || "jpeg" === i)
  22003. return (se = n && t.src ? t : new Image).width = d,
  22004. se.height = p,
  22005. se.src = U.toDataURL("image/" + i, .85),
  22006. se;
  22007. if ("png-src" === i || "jpeg-src" === i)
  22008. return U.toDataURL("image/" + i.split("-")[0], .85)
  22009. }
  22010. return U
  22011. }
  22012. var le = this;
  22013. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
  22014. exports.scale = e) : c = e
  22015. }
  22016. ).call(this),
  22017. i.exports = c
  22018. }
  22019. , {}],
  22020. 156: [function(i, n, e) {
  22021. (function(e) {
  22022. "use strict";
  22023. function t(e, t) {
  22024. this.model = e,
  22025. this.panos = e.panos,
  22026. this.player = t,
  22027. this.imagePanos = this.listImagePanos(),
  22028. this.retryMinimumTime = 1e4
  22029. }
  22030. var r = (i("three"),
  22031. i("./enum/Viewmode"))
  22032. , o = (i("./settings"),
  22033. i("./objects/Panorama"))
  22034. , a = new (i("./util/logger"))(e);
  22035. t.prototype.start = function() {
  22036. this.loadNextPano(function(e) {
  22037. e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
  22038. setTimeout(function() {
  22039. this.start()
  22040. }
  22041. .bind(this), 1e3))
  22042. }
  22043. .bind(this))
  22044. }
  22045. ,
  22046. t.prototype.validLoadTarget = function(e) {
  22047. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22048. }
  22049. ,
  22050. t.prototype.listImagePanos = function() {
  22051. var i = []
  22052. , n = this;
  22053. return this.model.images.forEach(function(e) {
  22054. if (e.metadata && e.metadata.scan_id) {
  22055. var t = n.model.panos.get(e.metadata.scan_id);
  22056. t && !t.isLoaded("high") && i.push(t)
  22057. }
  22058. }),
  22059. i
  22060. }
  22061. ,
  22062. t.prototype.nextNotLoadedImage = function() {
  22063. for (; 0 < this.imagePanos.length; ) {
  22064. var e = this.imagePanos[0];
  22065. if (!e.isLoaded("high"))
  22066. return e;
  22067. this.imagePanos.shift()
  22068. }
  22069. return null
  22070. }
  22071. ,
  22072. t.prototype.loadNextPano = function(e) {
  22073. var t, i, n = this.model.waitQueue.filter(function(e) {
  22074. return e.object instanceof o
  22075. });
  22076. 0 < n.length ? (t = n[0].object,
  22077. a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22078. a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22079. a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22080. t = this.imagePanos[0],
  22081. 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),
  22082. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22083. a.debug("Preloading " + i + "-res pano " + t.id),
  22084. t.loadCube(i).done(e).fail(function() {
  22085. a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22086. e()
  22087. })) : e && e(null)
  22088. }
  22089. ,
  22090. n.exports = t
  22091. }
  22092. ).call(this, "/js/preloaders.js")
  22093. }
  22094. , {
  22095. "./enum/Viewmode": 51,
  22096. "./objects/Panorama": 148,
  22097. "./settings": 166,
  22098. "./util/logger": 189,
  22099. three: 217
  22100. }],
  22101. 157: [function(a, s, e) {
  22102. (function(e) {
  22103. "use strict";
  22104. function t(e, t, i, n, r) {
  22105. this.qualityManager = e,
  22106. this.scene = t,
  22107. this.camera = i,
  22108. this.container = r,
  22109. this.controls = n,
  22110. this.controls.enabled = !0,
  22111. this.controls.locked = !0,
  22112. this.quickstartCamera = n.camera,
  22113. this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
  22114. this.skybox = null
  22115. }
  22116. var i = a("three")
  22117. , n = a("../util/logger")
  22118. , o = a("../constants")
  22119. , h = (a("../util/transitions"),
  22120. a("../util/lerp"),
  22121. a("../util/easing"),
  22122. a("../enum/Vectors"))
  22123. , u = a("../enum/PanoSizeClass")
  22124. , r = (a("../materials/ModelTextureMaterial"),
  22125. a("../materials/CubemapMaterial"))
  22126. , d = (a("../cameras/PanoramaCamera"),
  22127. a("../controls/PanoramaControls"),
  22128. a("../tile/TileUtils"),
  22129. a("../util/camera"),
  22130. a("../util/cameraLight"))
  22131. , p = (a("../util/browser"),
  22132. a("../settings"),
  22133. a("../gui/helpManager"),
  22134. new n(e));
  22135. t.prototype.load = function(e) {
  22136. e.pano.shouldRedrawOnBaseLoaded = !0;
  22137. var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22138. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22139. var a = this.qualityManager.getPanoSize(u.BASE)
  22140. , s = this.qualityManager.getPanoSize(u.STANDARD);
  22141. if (e.pano.tiled) {
  22142. p.warn("Loading startPano, TILED", e.pano.id);
  22143. var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22144. , c = this.quickstartCamera.fov;
  22145. p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
  22146. t = e.pano.loadTiledPano(s, r, {
  22147. hFov: l,
  22148. vFov: c
  22149. }, !1, !1, !0),
  22150. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22151. } else
  22152. p.warn("Loading startPano", e.pano.id),
  22153. t = e.pano.loadCube("high");
  22154. return $.when(t).then(function() {
  22155. n.init(e.pano, e.quaternion),
  22156. e.pano.tiled ? i.done(function() {
  22157. e.pano.lockUntilRenderingComplete = !1,
  22158. this.controls.locked = !1
  22159. }
  22160. .bind(this)) : this.controls.locked = !1
  22161. }
  22162. .bind(this))
  22163. }
  22164. ,
  22165. t.prototype.init = function(e, t) {
  22166. p.info("Quickstart done loading, adding scene objects"),
  22167. e.lockUntilRenderingComplete = !0,
  22168. this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
  22169. side: i.BackSide
  22170. })),
  22171. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22172. this.skybox.quaternion.copy(e.quaternion),
  22173. this.scene.add(this.skybox),
  22174. $(this.container).show()
  22175. }
  22176. ,
  22177. t.prototype.update = function(e) {
  22178. this.controls.update(e),
  22179. this.camera.copy(this.quickstartCamera)
  22180. }
  22181. ,
  22182. t.prototype.setSize = function(e, t) {
  22183. this.quickstartCamera.updateAspect(e / t)
  22184. }
  22185. ,
  22186. t.prototype.destroy = function() {
  22187. this.scene.remove(this.skybox)
  22188. }
  22189. ,
  22190. s.exports = t
  22191. }
  22192. ).call(this, "/js/scene/QuickstartManager.js")
  22193. }
  22194. , {
  22195. "../cameras/PanoramaCamera": 7,
  22196. "../constants": 8,
  22197. "../controls/PanoramaControls": 13,
  22198. "../enum/PanoSizeClass": 36,
  22199. "../enum/Vectors": 50,
  22200. "../gui/helpManager": 68,
  22201. "../materials/CubemapMaterial": 117,
  22202. "../materials/ModelTextureMaterial": 118,
  22203. "../settings": 166,
  22204. "../tile/TileUtils": 174,
  22205. "../util/browser": 182,
  22206. "../util/camera": 183,
  22207. "../util/cameraLight": 184,
  22208. "../util/easing": 186,
  22209. "../util/lerp": 188,
  22210. "../util/logger": 189,
  22211. "../util/transitions": 195,
  22212. three: 217
  22213. }],
  22214. 158: [function(e, t, i) {
  22215. "use strict";
  22216. function h(e, t, i) {
  22217. this.scene = e,
  22218. this.camera = t,
  22219. this.renderer = null,
  22220. this.effects = i,
  22221. this.animateCallback = null,
  22222. this.composer = null,
  22223. this.qualityManager = null,
  22224. e.renderWidth = 0,
  22225. e.renderHeight = 0,
  22226. this.updateClock = new M.Clock,
  22227. this.components = [],
  22228. this.updateListeners = [],
  22229. this.resizeListeners = [],
  22230. this.forceUpdateSize = !1,
  22231. this.started = !1,
  22232. this.textures = {},
  22233. this.suspendedObjects = []
  22234. }
  22235. 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;
  22236. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22237. (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
  22238. this.components.push(e),
  22239. e.update && this.updateListeners.push(e),
  22240. e.setSize && (this.resizeListeners.push(e),
  22241. this.forceUpdateSize = !0)
  22242. }
  22243. ,
  22244. h.prototype.removeComponent = function(t) {
  22245. function e(e) {
  22246. return e !== t
  22247. }
  22248. this.components = this.components.filter(e),
  22249. this.updateListeners = this.updateListeners.filter(e),
  22250. this.resizeListeners = this.resizeListeners.filter(e)
  22251. }
  22252. ,
  22253. h.prototype.start = function(e) {
  22254. if (this.started)
  22255. throw new l("Can't start SceneRenderer, already started");
  22256. this.createContext(e),
  22257. this.boluoVrInit(),
  22258. this.initComposer(),
  22259. this.started = !0,
  22260. (b = b.bind(this))()
  22261. }
  22262. ,
  22263. h.prototype.createContext = function(e) {
  22264. try {
  22265. this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
  22266. this.renderer.autoClear = !0,
  22267. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22268. this.renderer.setSize($("#player").width(), $("#player").height(), !1),
  22269. this.emit(r.ContextCreated)
  22270. } catch (e) {
  22271. throw new c("Unable to create a WebGL rendering context")
  22272. }
  22273. d.profiling.enabled && this.overrideTextures(),
  22274. e.appendChild(this.renderer.domElement)
  22275. }
  22276. ,
  22277. h.prototype.overrideTextures = function() {
  22278. var d = this.renderer.context
  22279. , t = 0
  22280. , i = d.createTexture;
  22281. d.createTexture = function() {
  22282. var e = i.call(d);
  22283. return e.id = t++,
  22284. this.textures[e.id] = e
  22285. }
  22286. .bind(this);
  22287. var p = d.texImage2D;
  22288. d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
  22289. var c, h = this.getTextureTypeFromTarget(d, e);
  22290. c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
  22291. void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
  22292. s = r,
  22293. n = (l = o).naturalWidth,
  22294. r = l.naturalHeight,
  22295. p.call(d, e, t, i, a, s, l));
  22296. var u = this.textures[c.id];
  22297. u.width = h === f.TextureCube ? 6 * n : n,
  22298. u.height = r
  22299. }
  22300. .bind(this);
  22301. var n = d.deleteTexture;
  22302. d.deleteTexture = function(e) {
  22303. delete this.textures[e.id],
  22304. n.call(d, e)
  22305. }
  22306. .bind(this)
  22307. }
  22308. ,
  22309. h.prototype.updateTextureMemory = (n = null,
  22310. function() {
  22311. var e = 0;
  22312. for (var t in this.textures) {
  22313. var i = this.textures[t];
  22314. i.width && i.height && (e += i.width * i.height * 4)
  22315. }
  22316. e !== n && this.emit(r.MemoryUsageUpdated, e),
  22317. n = e
  22318. }
  22319. ),
  22320. h.prototype.getTextureTypeFromTarget = function(e, t) {
  22321. switch (t) {
  22322. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22323. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22324. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22325. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22326. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22327. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22328. return f.TextureCube;
  22329. case e.TEXTURE_2D:
  22330. return f.Texture2D;
  22331. default:
  22332. return null
  22333. }
  22334. }
  22335. ,
  22336. h.prototype.initComposer = function() {
  22337. this.composer = new M.EffectComposer(this.renderer),
  22338. this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
  22339. this.composer.addPass(this.effects.hblurPass),
  22340. this.composer.addPass(this.effects.vblurPass)
  22341. }
  22342. ,
  22343. h.prototype.setSize = function(e, t, i) {
  22344. this.renderWidth = e,
  22345. this.renderHeight = t,
  22346. this.effects.aspect = e / t,
  22347. this.renderer.setSize(e, t, !1, i),
  22348. this.composer.setSize(e, t);
  22349. for (var n = 0; n < this.resizeListeners.length; n++)
  22350. this.resizeListeners[n].setSize(e, t)
  22351. }
  22352. ,
  22353. h.prototype.render = function() {
  22354. 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22355. }
  22356. ,
  22357. h.prototype.boluoVrInit = function() {
  22358. console.log("boluoVrInit"),
  22359. this.isHuawei5X = u.detectHUAWEI5X(),
  22360. this.oldRenderer = this.renderer,
  22361. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
  22362. window.panoCamera = this.camera;
  22363. var i = this;
  22364. window._vrEnabled = !1,
  22365. Object.defineProperty(window, "vrEnabled", {
  22366. get: function() {
  22367. return window._vrEnabled
  22368. },
  22369. set: function(e) {
  22370. (e = !!e) ? (i.renderer = i.newRenderer,
  22371. window.vrMarkers.forEach(function(e) {
  22372. e.visible = !0
  22373. })) : (i.renderer = i.oldRenderer,
  22374. window.vrMarkers.forEach(function(e) {
  22375. e.visible = !1
  22376. })),
  22377. i.cursor.visible = e,
  22378. i.setSize(window.innerWidth, window.innerHeight),
  22379. window._vrEnabled = e,
  22380. setTimeout(function() {
  22381. console.log(player.cameraControls.activeControl.camera.fov)
  22382. }, 500)
  22383. }
  22384. }),
  22385. this.createCursor(.5, !1, 1, 16777215, 0);
  22386. var e = {
  22387. setSize: function(e, t) {
  22388. i.camera.aspect = e / t
  22389. }
  22390. };
  22391. this.resizeListeners.push(e),
  22392. this.vrLoadingInit()
  22393. }
  22394. ,
  22395. h.prototype.vrLoadingInit = function() {
  22396. var e = new (e = function() {
  22397. var t = this
  22398. , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  22399. , i = new M.MeshBasicMaterial({
  22400. color: 4967932,
  22401. side: M.DoubleSide
  22402. })
  22403. , n = new M.Mesh(e,i);
  22404. (this.mesh = n).position.z = -2,
  22405. n.scale.set(.08, .08, .08),
  22406. n.visible = !1,
  22407. window.player.camera.add(n),
  22408. t.enabled = !1,
  22409. this.update = function(e) {
  22410. 1 == t.enabled && (n.rotation.z += 15 * e)
  22411. }
  22412. }
  22413. )(this.camera);
  22414. window.Loading = e,
  22415. this.updateListeners.push(e)
  22416. }
  22417. ,
  22418. h.prototype.createCursor = function(e, t, i, n, r) {
  22419. var o, a = new M.SpriteMaterial({
  22420. opacity: i,
  22421. color: n,
  22422. transparent: t,
  22423. map: this.boluoGetTexture("images/cursor.png"),
  22424. needsUpdate: !0,
  22425. side: M.DoubleSide
  22426. });
  22427. a.map.offset = new M.Vector2(1 / 17 * r,0),
  22428. a.map.repeat = new M.Vector2(1 / 17,1),
  22429. a.depthTest = !1,
  22430. a.blending = M.AdditiveBlending,
  22431. (o = new M.Sprite(a)).scale.set(.3, .3, .3),
  22432. o.position.z = -2,
  22433. o.visible = !1,
  22434. o.name = "cursor",
  22435. this.camera.add(o),
  22436. this.scene.add(this.camera),
  22437. this.cursor = o;
  22438. var s = new this.CursorAnimation(this.scene,o,this.camera);
  22439. this.cursor.triggerTargetEvent = s.triggerTargetEvent,
  22440. this.updateListeners.push(s)
  22441. }
  22442. ,
  22443. h.prototype.CursorAnimation = function(e, t, o) {
  22444. this.cursor = t,
  22445. this.raycaster = new M.Raycaster,
  22446. this.targetEventObj = {},
  22447. this.type = 1,
  22448. this.tweenFlag = !0;
  22449. var s = this;
  22450. this.target = o,
  22451. console.log(o.uuid),
  22452. this.euler = new M.Euler,
  22453. this.q0 = new M.Quaternion,
  22454. this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  22455. this.zee = new M.Vector3(0,0,1),
  22456. this.alpha = -1e3,
  22457. this.beta = -1e3,
  22458. this.gamma = -1e3,
  22459. this.orient = M.Math.degToRad(window.orientation || 0),
  22460. window.addEventListener("orientationchange", function() {
  22461. s.orient = M.Math.degToRad(window.orientation || 0)
  22462. }),
  22463. window.addEventListener("deviceorientation", function(e) {
  22464. var t = M.Math.degToRad(e.alpha)
  22465. , i = M.Math.degToRad(e.beta)
  22466. , n = M.Math.degToRad(e.gamma);
  22467. if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
  22468. -1e3 === s.beta && (s.beta = i),
  22469. -1e3 === s.gamma && (s.gamma = n),
  22470. .06 < Math.abs(t - s.alpha) && (s.alpha = t),
  22471. .006 < Math.abs(i - s.beta) && (s.beta = i),
  22472. .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
  22473. s.beta = i,
  22474. s.gamma = n),
  22475. h.vrDebug) {
  22476. $("#info-device-orientation").css("display", "block");
  22477. var r = "";
  22478. r += "alpha=(" + s.alpha + ")<BR/>",
  22479. r += "beta=(" + s.beta + ")<BR/>",
  22480. r += "gamma=" + s.gamma + "<BR/>",
  22481. document.getElementById("info-device-orientation").innerHTML = r
  22482. }
  22483. }),
  22484. this.setObjectQuaternion = function(e, t, i, n, r) {
  22485. s.euler.set(i, t, -n, "YXZ"),
  22486. e.setFromEuler(s.euler),
  22487. e.multiply(s.q1),
  22488. e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
  22489. o.updateMatrixWorld()
  22490. }
  22491. ,
  22492. parent !== window && window.addEventListener("message", function(e) {
  22493. var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  22494. o && o.alpha && o.beta && o.gamma && (t = a,
  22495. i = M.Math.degToRad(o.alpha),
  22496. n = M.Math.degToRad(o.beta),
  22497. r = M.Math.degToRad(o.gamma),
  22498. t ? (-1e3 === s.alpha && (s.alpha = i),
  22499. -1e3 === s.beta && (s.beta = n),
  22500. -1e3 === s.gamma && (s.gamma = r),
  22501. .06 < Math.abs(i - s.alpha) && (s.alpha = i),
  22502. .006 < Math.abs(n - s.beta) && (s.beta = n),
  22503. .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
  22504. s.beta = n,
  22505. s.gamma = r))
  22506. }),
  22507. this.update = function(e) {
  22508. TWEEN.update(),
  22509. window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
  22510. this.triggerTargetEvent())
  22511. }
  22512. ,
  22513. this.triggerTargetEvent = function() {
  22514. var e = this.choseObj()
  22515. , t = e ? e.object : void 0;
  22516. (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
  22517. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  22518. t && t.enabled && this.startAnimate(function() {
  22519. this.clickCallback(t)
  22520. }
  22521. .bind(this))) : this.type,
  22522. this.targetEventObj.lastObj = t)
  22523. }
  22524. ,
  22525. this.choseObj = function() {
  22526. this.raycaster.setFromCamera({
  22527. x: 0,
  22528. y: 0
  22529. }, o);
  22530. var e = (this.raycaster.ray,
  22531. window.vrMarkers)
  22532. , t = this.raycaster.intersectObjects(e);
  22533. if (0 < t.length)
  22534. return t[0]
  22535. }
  22536. ,
  22537. this.clickCallback = function(e) {
  22538. this.runTHREEAction(e, "onclick")
  22539. }
  22540. ,
  22541. this.runTHREEAction = function(e, t) {
  22542. switch (t) {
  22543. case "onclick":
  22544. e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
  22545. e()
  22546. });
  22547. break;
  22548. case "onhover":
  22549. e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
  22550. e()
  22551. });
  22552. break;
  22553. case "onout":
  22554. e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
  22555. e()
  22556. })
  22557. }
  22558. }
  22559. ,
  22560. this.startAnimate = function(e) {
  22561. this.tweenFlag && this.initAnimation(e)
  22562. }
  22563. ,
  22564. this.initAnimation = function(e) {
  22565. var t = this
  22566. , i = this.cursor.material.map.offset;
  22567. t.tweenFlag = !1,
  22568. this.cursorAnimate = new TWEEN.Tween(i).to({
  22569. x: 1
  22570. }, 1e3).onStart(function() {
  22571. t.tweenFlag = !1
  22572. }).onStop(function() {
  22573. t.tweenFlag = !0,
  22574. this.x = 0,
  22575. i.x = 0
  22576. }).onUpdate(function() {}).onComplete(function() {
  22577. e(),
  22578. i.x = 0,
  22579. setTimeout(function() {
  22580. t.tweenFlag = !0
  22581. }, 1500)
  22582. }),
  22583. this.cursorAnimate.easing(function(e) {
  22584. return Math.floor(17 * e) / 17
  22585. }),
  22586. this.cursorAnimate.start()
  22587. }
  22588. ,
  22589. this.autoCursorPosition = function(e) {
  22590. this.cursor.scale.set(.3, .3, .3)
  22591. }
  22592. }
  22593. ,
  22594. h.prototype.vrRenderer = function(a, i, e) {
  22595. var s = new i.vrCamera(e);
  22596. s.bananaAspect = .8,
  22597. this.width,
  22598. this.height;
  22599. i = this;
  22600. this.setSize = function(e, t) {
  22601. a.setSize.call(this, e, t),
  22602. i.width = e,
  22603. i.height = t
  22604. }
  22605. ,
  22606. this.render = function(e, t, i, n) {
  22607. var r, o;
  22608. if (window.cameraQua = t.quaternion.clone(),
  22609. t.__RESS__SKIP__STEREO__)
  22610. return a.render(e, t, i, n);
  22611. if ("PerspectiveCamera" === t.type)
  22612. r = s.cameraL,
  22613. o = s.cameraR,
  22614. e.updateMatrixWorld(),
  22615. null === t.parent && t.updateMatrixWorld(),
  22616. s.vrCameraUpdate(t);
  22617. else {
  22618. if ("OrthographicCamera" !== t.type)
  22619. return DEBUG && console.error("Unsupported renderer: ", t.type);
  22620. r = o = t
  22621. }
  22622. a.setScissorTest(!0),
  22623. a.setScissor(0, 0, this.width / 2, this.height),
  22624. a.setViewport(0, 0, this.width / 2, this.height),
  22625. a.render.call(this, e, r, i, n),
  22626. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  22627. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  22628. a.render.call(this, e, o, i, n),
  22629. a.setScissorTest(!1)
  22630. }
  22631. ,
  22632. this.__proto__ = {
  22633. __proto__: a
  22634. }
  22635. }
  22636. ,
  22637. h.prototype.vrCamera = function(e) {
  22638. this.type = "StereoCamera",
  22639. this._aspect = 1,
  22640. this._overlap = .064,
  22641. this.cameraL = new M.PerspectiveCamera,
  22642. this.cameraL.layers.enable(1),
  22643. this.cameraL.matrixAutoUpdate = !1,
  22644. this.cameraR = new M.PerspectiveCamera,
  22645. this.cameraR.layers.enable(2),
  22646. this.cameraR.matrixAutoUpdate = !1,
  22647. this.eyeRight = new M.Matrix4,
  22648. this.eyeLeft = new M.Matrix4,
  22649. this.vrCameraNeedsUpdate = !0,
  22650. window.vrCameraL = this.cameraL,
  22651. Object.defineProperty(this, "bananaAspect", {
  22652. get: function() {
  22653. return this._aspect
  22654. },
  22655. set: function(e) {
  22656. this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
  22657. this._aspect = e
  22658. }
  22659. }),
  22660. Object.defineProperty(this, "overlap", {
  22661. get: function() {
  22662. return this._overlap
  22663. },
  22664. set: function(e) {
  22665. this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
  22666. this._overlap = e
  22667. }
  22668. }),
  22669. this.vrCameraUpdate = function(e) {
  22670. if (this.vrCameraNeedsUpdate = !0,
  22671. this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
  22672. this.vrCameraNeedsUpdate) {
  22673. this.vrCameraNeedsUpdate = !1,
  22674. console.debug("vrCameraUpdate"),
  22675. this.bananaFocus = e.focus,
  22676. this.bananaFov = e.fov,
  22677. this.bananaReal_aspect = e.aspect * this.bananaAspect,
  22678. this.bananaNear = e.near,
  22679. this.bananaFar = e.far,
  22680. console.debug(e.aspect),
  22681. this.bananaFocus = 10;
  22682. 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);
  22683. this.eyeLeft.elements[12] = -r,
  22684. this.eyeRight.elements[12] = r,
  22685. t = -a * this.bananaReal_aspect + o,
  22686. i = a * this.bananaReal_aspect + o,
  22687. n.elements[0] = 2 * this.bananaNear / (i - t),
  22688. n.elements[8] = (i + t) / (i - t),
  22689. this.cameraL.projectionMatrix.copy(n),
  22690. t = -a * this.bananaReal_aspect - o,
  22691. i = a * this.bananaReal_aspect - o,
  22692. n.elements[0] = 2 * this.bananaNear / (i - t),
  22693. n.elements[8] = (i + t) / (i - t),
  22694. this.cameraR.projectionMatrix.copy(n)
  22695. }
  22696. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
  22697. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
  22698. }
  22699. }
  22700. ,
  22701. h.prototype.boluoGetTexture = function(e) {
  22702. var t = new M.TextureLoader;
  22703. return t.crossOrigin = "anonymous",
  22704. t.load(e)
  22705. }
  22706. ,
  22707. h.prototype.updateScreenSize = function(e) {
  22708. var t, i, n, r = !1;
  22709. e && !e.resize && null != e.width && null != e.height ? (i = e.width,
  22710. n = e.height,
  22711. r = !0,
  22712. t = 1) : (i = $("#player").width(),
  22713. n = $("#player").height(),
  22714. e && e.resize && (o = this.renderWidth,
  22715. a = this.renderHeight),
  22716. i === o && n === a && !this.forceUpdateSize || (o = i,
  22717. a = n,
  22718. r = !0,
  22719. t = window.devicePixelRatio)),
  22720. r && (this.setSize(i, n, t),
  22721. this.forceUpdateSize = !1)
  22722. }
  22723. ,
  22724. h.prototype.updateComponents = function() {
  22725. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  22726. this.updateListeners[t].update(e)
  22727. }
  22728. ,
  22729. h.prototype.suspend = function() {
  22730. this.started = !1,
  22731. this.suspendedObjects = this.scene.children.map(function(e) {
  22732. return this.scene.remove(e),
  22733. e
  22734. }
  22735. .bind(this)),
  22736. this.render()
  22737. }
  22738. ,
  22739. h.prototype.resume = function() {
  22740. this.suspendedObjects.forEach(function(e) {
  22741. this.scene.add(e)
  22742. }
  22743. .bind(this)),
  22744. this.suspendedObjects = [],
  22745. this.started = !0,
  22746. b()
  22747. }
  22748. ;
  22749. var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
  22750. this.started && (window.requestAnimationFrame(b),
  22751. this.updateScreenSize(),
  22752. this.updateComponents(),
  22753. this.updateTextureMemory(),
  22754. this.render(),
  22755. this.emit(r.AfterRender))
  22756. };
  22757. h.prototype.getImageData = (E = document.createElement("canvas"),
  22758. _ = E.getContext("2d"),
  22759. function(e, t, i) {
  22760. return E.width === t && E.height === i || (E.width = t,
  22761. E.height = i),
  22762. _.drawImage(e, 0, 0, t, i),
  22763. _.getImageData(0, 0, t, i)
  22764. }
  22765. ),
  22766. h.prototype.initSizedTexture2D = function(e, t, i) {
  22767. var n = this.renderer
  22768. , r = n.context
  22769. , o = n.state
  22770. , a = new M.Texture(null);
  22771. !(a.flipY = !1) !== i && (i = !1),
  22772. a.generateMipmaps = i;
  22773. var s = n.paramThreeToGL(a.format)
  22774. , l = n.paramThreeToGL(a.type)
  22775. , c = n.properties.get(a)
  22776. , h = r.createTexture();
  22777. o.bindTexture(r.TEXTURE_2D, h),
  22778. r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
  22779. r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
  22780. a.wrapS = t,
  22781. a.wrapT = t;
  22782. var u = n.paramThreeToGL(t);
  22783. return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
  22784. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
  22785. i ? (a.magFilter = M.LinearFilter,
  22786. a.minFilter = M.LinearMipMapLinearFilter,
  22787. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  22788. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
  22789. r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
  22790. a.minFilter = M.LinearFilter,
  22791. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
  22792. r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
  22793. o.bindTexture(r.TEXTURE_2D, null),
  22794. c.__webglTexture = h,
  22795. a
  22796. }
  22797. ,
  22798. h.prototype.initSizedCubeMap = function(e, t) {
  22799. var i = this.renderer
  22800. , n = i.context
  22801. , r = i.state
  22802. , o = new M.CubeTexture([null, null, null, null, null, null]);
  22803. o.flipY = !1,
  22804. o.generateMipmaps = t;
  22805. var a = i.paramThreeToGL(o.format)
  22806. , s = i.paramThreeToGL(o.type)
  22807. , l = i.properties.get(o)
  22808. , c = n.createTexture();
  22809. r.bindTexture(n.TEXTURE_CUBE_MAP, c),
  22810. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
  22811. for (var h = 0; h < 6; h++)
  22812. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
  22813. return t ? (o.magFilter = M.LinearFilter,
  22814. o.minFilter = M.LinearMipMapLinearFilter,
  22815. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  22816. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  22817. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  22818. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
  22819. o.minFilter = M.LinearFilter,
  22820. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  22821. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  22822. r.bindTexture(n.TEXTURE_CUBE_MAP, null),
  22823. l.__image__webglTextureCube = c,
  22824. o
  22825. }
  22826. ,
  22827. h.prototype.deallocateCubeTexture = function(e) {
  22828. var t = this.renderer
  22829. , i = t.context
  22830. , n = t.properties.get(e);
  22831. i.deleteTexture(n.__image__webglTextureCube)
  22832. }
  22833. ,
  22834. h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  22835. var a = this.renderer
  22836. , s = a.context
  22837. , l = a.state
  22838. , c = a.properties.get(t);
  22839. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  22840. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  22841. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  22842. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  22843. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  22844. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  22845. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  22846. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  22847. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  22848. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  22849. l.bindTexture(s.TEXTURE_2D, null)
  22850. }
  22851. ,
  22852. h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  22853. var s = this.renderer
  22854. , l = s.context
  22855. , c = s.state
  22856. , h = s.properties.get(t);
  22857. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  22858. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  22859. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  22860. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  22861. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  22862. }
  22863. ,
  22864. h.prototype.rebuildMipMaps2D = function(e) {
  22865. var t = this.renderer
  22866. , i = t.context
  22867. , n = t.state;
  22868. t.properties.get(e),
  22869. i.generateMipmap(i.TEXTURE_2D),
  22870. n.bindTexture(i.TEXTURE_2D, null)
  22871. }
  22872. ,
  22873. h.prototype.rebuildMipMaps3D = function(e) {
  22874. var t = this.renderer
  22875. , i = t.context
  22876. , n = t.state
  22877. , r = t.properties.get(e);
  22878. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  22879. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  22880. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  22881. }
  22882. ,
  22883. h.prototype.renderToCubeMap = (P = !1,
  22884. F = N = D = L = O = null,
  22885. function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  22886. this.renderer.context,
  22887. P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
  22888. (O = new M.Scene).add(L),
  22889. D = new M.ShaderMaterial({
  22890. uniforms: {
  22891. tDiffuse: {
  22892. type: "t",
  22893. value: null
  22894. },
  22895. alpha: {
  22896. type: "f",
  22897. value: 1
  22898. }
  22899. },
  22900. vertexShader: R.basicTextured.vertexShader,
  22901. fragmentShader: R.basicTextured.fragmentShader,
  22902. depthWrite: !1,
  22903. depthTest: !1,
  22904. side: M.DoubleSide
  22905. }),
  22906. N = new M.PlaneBufferGeometry(1,1),
  22907. (F = new M.Mesh(N,D)).position.z = 0,
  22908. O.add(F),
  22909. P = !0);
  22910. var m = N.getAttribute("uv");
  22911. m.setDynamic(!0),
  22912. m.needsUpdate = !0;
  22913. var v = m.array
  22914. , y = r / i
  22915. , A = o / n
  22916. , C = a / i
  22917. , I = s / n;
  22918. v[0] = y,
  22919. v[1] = A + I,
  22920. v[2] = y + C,
  22921. v[3] = A + I,
  22922. v[4] = y,
  22923. v[5] = A,
  22924. v[6] = y + C,
  22925. v[7] = A;
  22926. var E = N.getAttribute("position");
  22927. E.setDynamic(!0),
  22928. E.needsUpdate = !0;
  22929. var _ = E.array
  22930. , b = l / t.width - .5
  22931. , w = c / t.height - .5
  22932. , T = h / t.width
  22933. , x = u / t.height;
  22934. _[0] = b,
  22935. _[1] = w + x,
  22936. _[3] = b + T,
  22937. _[4] = w + x,
  22938. _[6] = b,
  22939. _[7] = w,
  22940. _[9] = b + T,
  22941. _[10] = w,
  22942. this.renderer.properties.get(e),
  22943. D.uniforms.tDiffuse.value = e,
  22944. D.blending = p || M.NoBlending,
  22945. D.transparent = !!f,
  22946. null != g || (g = 1),
  22947. D.uniforms.alpha.value = g,
  22948. D.needUpdate = !0,
  22949. t.activeCubeFace = d,
  22950. t.viewport.set(0, 0, t.width, t.height);
  22951. var S = this.renderer.autoClear;
  22952. this.renderer.autoClear = !1,
  22953. this.renderer.render(O, L, t, !1),
  22954. this.renderer.autoClear = S
  22955. }
  22956. ),
  22957. h.prototype.copyCubeMap = (g = !1,
  22958. C = A = y = v = m = null,
  22959. I = new M.Euler,
  22960. new M.Vector3,
  22961. function(e, t, i, n, r, o, a, s, l) {
  22962. this.renderer,
  22963. g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
  22964. (m = new M.Scene).add(v),
  22965. y = new M.ShaderMaterial({
  22966. uniforms: {
  22967. tDiffuse: {
  22968. type: "t",
  22969. value: null
  22970. },
  22971. alpha: {
  22972. type: "f",
  22973. value: 1
  22974. }
  22975. },
  22976. vertexShader: R.copyCubeMap.vertexShader,
  22977. fragmentShader: R.copyCubeMap.fragmentShader,
  22978. depthWrite: !1,
  22979. depthTest: !1,
  22980. side: M.DoubleSide
  22981. }),
  22982. A = new M.BoxGeometry(2,2,2),
  22983. C = new M.Mesh(A,y),
  22984. m.add(C),
  22985. g = !0);
  22986. for (var c = 0; c < 6; c++)
  22987. h.getCubeOrientationForCubeFace(c, I),
  22988. C.rotation.copy(I),
  22989. C.matrixWorldNeedsUpdate = !0,
  22990. C.updateMatrixWorld(),
  22991. y.uniforms.tDiffuse.value = e,
  22992. y.blending = a || M.NoBlending,
  22993. y.transparent = !!s,
  22994. null != l || (l = 1),
  22995. y.uniforms.alpha.value = l,
  22996. y.needUpdate = !0,
  22997. t.activeCubeFace = c,
  22998. t.viewport.set(0, 0, r, o),
  22999. this.renderer.render(m, v, t, !1)
  23000. }
  23001. ),
  23002. h.getLookAtForCubeFace = function(e, t) {
  23003. switch (e) {
  23004. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23005. t.set(1, 0, 0);
  23006. break;
  23007. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23008. t.set(-1, 0, 0);
  23009. break;
  23010. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23011. t.set(0, 1, 0);
  23012. break;
  23013. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23014. t.set(0, -1, 0);
  23015. break;
  23016. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23017. t.set(0, 0, 1);
  23018. break;
  23019. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23020. t.set(0, 0, -1)
  23021. }
  23022. }
  23023. ,
  23024. h.getCubeOrientationForCubeFace = function(e, t) {
  23025. switch (e) {
  23026. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  23027. t.set(0, -Math.PI / 2, 0);
  23028. break;
  23029. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  23030. t.set(0, Math.PI / 2, 0);
  23031. break;
  23032. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  23033. t.set(Math.PI / 2, Math.PI, 0);
  23034. break;
  23035. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  23036. t.set(-Math.PI / 2, Math.PI, 0);
  23037. break;
  23038. case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  23039. t.set(0, -Math.PI, 0);
  23040. break;
  23041. case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  23042. t.set(0, 0, 0)
  23043. }
  23044. }
  23045. ,
  23046. t.exports = h
  23047. }
  23048. , {
  23049. "../enum/GLCubeFaces": 25,
  23050. "../enum/GLTextureType": 26,
  23051. "../enum/SceneRendererEvents": 43,
  23052. "../exception/BasicException": 55,
  23053. "../exception/RendererCreationException": 57,
  23054. "../settings": 166,
  23055. "../shaders": 167,
  23056. "../util/browser": 182,
  23057. events: 202,
  23058. three: 217
  23059. }],
  23060. 159: [function(e, t, i) {
  23061. "use strict";
  23062. function n(e) {
  23063. this.messenger = new a(e),
  23064. this.clientKey = null
  23065. }
  23066. var o = e("../util/ajax")
  23067. , r = e("./PostMessageType")
  23068. , a = e("./postmessage")
  23069. , s = e("./VersionInfo")
  23070. , l = e("events").EventEmitter
  23071. , c = window.location.origin + "/api/v1/user/";
  23072. (n.prototype = Object.create(l.prototype)).bindEvents = function() {
  23073. this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
  23074. }
  23075. ,
  23076. n.prototype.waitForConnection = function() {
  23077. return new Promise(function(t, i) {
  23078. this.messenger.on(r.CONNECT, function(e) {
  23079. this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
  23080. }
  23081. .bind(this))
  23082. }
  23083. .bind(this))
  23084. }
  23085. ,
  23086. n.prototype.onConnectionReceived = function(i) {
  23087. return this.messenger.setTarget(i.source, i.origin),
  23088. this.verifyConnection(i).then(function(e, t) {
  23089. this.messenger.send({
  23090. type: r.ACCEPT,
  23091. toId: i.fromId,
  23092. warning: t
  23093. }),
  23094. this.clientKey = e,
  23095. this.messenger.removeAllListeners(r.CONNECT),
  23096. this.bindEvents()
  23097. }
  23098. .bind(this), function(e) {
  23099. this.messenger.send({
  23100. type: r.REJECT,
  23101. toId: i.fromId,
  23102. reason: e
  23103. }),
  23104. this.messenger.setTarget()
  23105. }
  23106. .bind(this))
  23107. }
  23108. ,
  23109. n.prototype.verifyConnection = function(r) {
  23110. return new Promise(function(e, t) {
  23111. var i;
  23112. if (s.isDeprecated(r.sdkVersion))
  23113. i = "这个版本正在被弃用";
  23114. else if (!s.isSupported(r.sdkVersion))
  23115. return t("不支持此版本的SDK");
  23116. var n = {
  23117. cache: !1,
  23118. headers: {
  23119. "X-port-Application-Key": r.applicationKey,
  23120. "X-port-Referrer": r.origin
  23121. }
  23122. };
  23123. o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
  23124. }
  23125. )
  23126. }
  23127. ,
  23128. n.prototype.onMessageReceived = function(t) {
  23129. if (this.validateClientApplicationKey(t.applicationKey)) {
  23130. var i = this;
  23131. t.onDone = function(e) {
  23132. e.toId = t.fromId,
  23133. e.uid = t.uid,
  23134. e.type = r.RESPONSE,
  23135. i.messenger.send(e)
  23136. }
  23137. ,
  23138. this.emit(r.ACTION, t)
  23139. }
  23140. }
  23141. ,
  23142. n.prototype.validateClientApplicationKey = function(e) {
  23143. return this.clientKey === e
  23144. }
  23145. ,
  23146. n.prototype.sendEvent = function(e, t) {
  23147. this.messenger.send({
  23148. type: r.EVENT,
  23149. eventType: e,
  23150. eventData: t
  23151. })
  23152. }
  23153. ,
  23154. t.exports = n
  23155. }
  23156. , {
  23157. "../util/ajax": 181,
  23158. "./PostMessageType": 160,
  23159. "./VersionInfo": 163,
  23160. "./postmessage": 165,
  23161. events: 202
  23162. }],
  23163. 160: [function(e, t, i) {
  23164. "use strict";
  23165. t.exports = Object.freeze({
  23166. CONNECT: "postmessage.connect",
  23167. ACCEPT: "postmessage.accept",
  23168. REJECT: "postmessage.reject",
  23169. ACTION: "postmessage.action",
  23170. RESPONSE: "postmessage.response",
  23171. EVENT: "postmessage.event"
  23172. })
  23173. }
  23174. , {}],
  23175. 161: [function(e, t, i) {
  23176. "use strict";
  23177. t.exports = Object.freeze({
  23178. MOVE: "sdk.move",
  23179. ENTER_PANO: "sdk.enterpano",
  23180. MODEL_LOADED: "sdk.modelloaded"
  23181. })
  23182. }
  23183. , {}],
  23184. 162: [function(e, t, i) {
  23185. "use strict";
  23186. t.exports = Object.freeze({
  23187. FLY: "transition.fly",
  23188. FADEOUT: "transition.fade",
  23189. INSTANT: "transition.instant"
  23190. })
  23191. }
  23192. , {}],
  23193. 163: [function(e, t, i) {
  23194. "use strict";
  23195. t.exports = {
  23196. current: "1.0",
  23197. supported: ["1.0"],
  23198. deprecated: [],
  23199. isSupported: function(e) {
  23200. return -1 !== this.supported.indexOf(e)
  23201. },
  23202. isDeprecated: function(e) {
  23203. return -1 !== this.deprecated.indexOf(e)
  23204. },
  23205. isValid: function(e) {
  23206. return this.isSupported(e) || this.isDeprecated(e)
  23207. }
  23208. }
  23209. }
  23210. , {}],
  23211. 164: [function(q, X, e) {
  23212. (function(e) {
  23213. "use strict";
  23214. function r(e, t, i) {
  23215. e = e && e.toLowerCase().trim();
  23216. var n = new C.UP.clone
  23217. , r = Math.PI / 3
  23218. , o = Math.PI / 2;
  23219. switch (e) {
  23220. case "left":
  23221. i.copy(t),
  23222. i.applyAxisAngle(n, o);
  23223. break;
  23224. case "right":
  23225. i.copy(t),
  23226. i.applyAxisAngle(n, -o);
  23227. break;
  23228. case "forwardleft":
  23229. i.copy(t),
  23230. i.applyAxisAngle(n, r);
  23231. break;
  23232. case "forwardright":
  23233. i.copy(t),
  23234. i.applyAxisAngle(n, -r);
  23235. break;
  23236. case "forward":
  23237. default:
  23238. i.copy(t)
  23239. }
  23240. return i
  23241. }
  23242. function o(e, t) {
  23243. if (e) {
  23244. var i = {
  23245. pano: e,
  23246. lookAtPoint: null,
  23247. duration: null,
  23248. maxDistanceOverride: null,
  23249. skipWarpingCheck: !1
  23250. };
  23251. this.player.flyToPano(i, function() {
  23252. t && t({
  23253. success: !0,
  23254. message: "Transition complete."
  23255. })
  23256. })
  23257. } else
  23258. M.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23259. t && t({
  23260. success: !1,
  23261. error: "Unable to find pano."
  23262. })
  23263. }
  23264. function a(e, t) {
  23265. t.copy(C.FORWARD),
  23266. e.getDirection(t)
  23267. }
  23268. function c(i) {
  23269. return {
  23270. panos: i.panos.list.map(function(e) {
  23271. var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23272. return {
  23273. uuid: e.id,
  23274. aligned: e.alignmentType === g.ALIGNED,
  23275. neighbourUUIDs: e.neighbourUUIDs.slice(),
  23276. position: function(e) {
  23277. return e.alignmentType !== g.ALIGNED ? null : {
  23278. x: e.position.x,
  23279. y: e.position.y,
  23280. z: e.position.z
  23281. }
  23282. }(e),
  23283. rotation: function(e) {
  23284. var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23285. return {
  23286. x: h.Math.radToDeg(t._x),
  23287. y: h.Math.radToDeg(t._y),
  23288. z: h.Math.radToDeg(t._z)
  23289. }
  23290. }(e),
  23291. thumbnail: t
  23292. }
  23293. })
  23294. }
  23295. }
  23296. 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"),
  23297. q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
  23298. q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
  23299. q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
  23300. N.angle = 0,
  23301. N.angleTravelled = 0,
  23302. N.playerDirection = new h.Vector3,
  23303. N.lastFacingDirection = new h.Vector3,
  23304. N.onDone = null,
  23305. N.player = null,
  23306. N.start = function(e, t, i, n) {
  23307. N.active = !0,
  23308. e && t && (t = 0),
  23309. N.angle = e || t,
  23310. N.xAngle = e,
  23311. N.yAngle = t,
  23312. N.angleTravelled = 0,
  23313. N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23314. i.getDirection(N.playerDirection),
  23315. N.lastFacingDirection.copy(N.playerDirection),
  23316. N.projectVectors(),
  23317. N.onDone = n,
  23318. N.player = i,
  23319. N()
  23320. }
  23321. ,
  23322. N.projectVectors = function() {
  23323. N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
  23324. N.lastFacingDirection.projectOnPlane(C.UP))
  23325. }
  23326. ,
  23327. N), P = (i = new h.Vector3,
  23328. function(e) {
  23329. e ? (i.copy(e.position),
  23330. i.add(e.discPosition),
  23331. s.projectPositionToCanvas(i, this.player.camera, i),
  23332. this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
  23333. }
  23334. ), O = (l = new h.Vector3,
  23335. function(e) {
  23336. var t = this.player.getDirection();
  23337. l.copy(t);
  23338. var i = l.y;
  23339. l.y = 0,
  23340. l.normalize();
  23341. var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
  23342. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
  23343. return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23344. 0;
  23345. this.player.mode === I.DOLLHOUSE && (n = -n);
  23346. var r = function() {
  23347. return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
  23348. }
  23349. .call(this) - .1
  23350. , o = function() {
  23351. return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
  23352. }
  23353. .call(this) + .1
  23354. , a = n + e;
  23355. r < a ? a = r : a < o && (a = o);
  23356. var s = a - n;
  23357. return 0 < e && s < .01 && (s = 0),
  23358. e < 0 && -.01 < s && (s = 0),
  23359. s
  23360. }
  23361. ), L = (t = new h.Euler,
  23362. function(e) {
  23363. return t.setFromQuaternion(e.quaternion, "YXZ"),
  23364. {
  23365. position: {
  23366. x: e.position.x,
  23367. y: e.position.y,
  23368. z: e.position.z
  23369. },
  23370. rotation: {
  23371. x: h.Math.radToDeg(t.x),
  23372. y: h.Math.radToDeg(t.y),
  23373. z: 0
  23374. },
  23375. pano: e.currentPano ? e.currentPano.id : null,
  23376. mode: e.mode
  23377. }
  23378. }
  23379. ), D = null;
  23380. function N() {
  23381. N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23382. N.player.getDirection(N.playerDirection),
  23383. N.projectVectors();
  23384. var e = N.playerDirection.angleTo(N.lastFacingDirection);
  23385. (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
  23386. N.onDone && (0,
  23387. N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
  23388. window.setTimeout(N, 4))
  23389. }
  23390. X.exports = {
  23391. init: function(e, t, i, n, r) {
  23392. Y.init(e, t, i, r),
  23393. D = new Promise(function(e, t) {
  23394. i.on(_.Ready, function() {
  23395. e()
  23396. })
  23397. }
  23398. .bind(this));
  23399. var o = new u(window)
  23400. , a = o.waitForConnection();
  23401. a.then(function(e) {
  23402. o.on(f.ACTION, Y.onMessageReceive.bind(Y))
  23403. });
  23404. var s, l = (s = Date.now(),
  23405. function() {
  23406. if (!(Date.now() - s < 100)) {
  23407. var e = L(i);
  23408. o.sendEvent(b.MOVE, {
  23409. state: e
  23410. }),
  23411. s = Date.now()
  23412. }
  23413. }
  23414. );
  23415. i.on(_.Move, l),
  23416. i.on(_.ViewChanged, l),
  23417. n.on(p.ActiveModelChanged, function(e) {
  23418. function t(e) {
  23419. var t, i = e.newPano.id;
  23420. e.oldPano && (t = e.oldPano.id),
  23421. i !== t && o.sendEvent(b.ENTER_PANO, {
  23422. oldPano: t,
  23423. newPano: i
  23424. })
  23425. }
  23426. var i = e.model
  23427. , n = e.oldModel;
  23428. Y.model = i,
  23429. a.then(function() {
  23430. o.sendEvent(b.MODEL_LOADED, {
  23431. metadata: c(i)
  23432. })
  23433. }),
  23434. n && n.panos.forEach(function(e) {
  23435. e.removeEventListener("enter", t)
  23436. }),
  23437. i.panos.forEach(function(e) {
  23438. e.on("enter", t)
  23439. })
  23440. })
  23441. }
  23442. };
  23443. var F, B, V, k, U, H, z, G, W, j, Y = {
  23444. director: null,
  23445. player: null,
  23446. controls: null,
  23447. sceneRenderer: null,
  23448. model: null,
  23449. init: function(e, t, i, n) {
  23450. this.director = e,
  23451. this.player = i,
  23452. this.controls = t,
  23453. this.sceneRenderer = n
  23454. },
  23455. handleToObject: {},
  23456. objectToHandle: {},
  23457. handleCount: 0,
  23458. onMessageReceive: function(e) {
  23459. if (e) {
  23460. var t = e.targetFunction
  23461. , i = e.params
  23462. , n = e.onDone;
  23463. t && this[t] && this[t](i, n)
  23464. }
  23465. },
  23466. waitForInit: function(e, t) {
  23467. D.then(t.bind({
  23468. success: !0,
  23469. message: "Init complete."
  23470. }))
  23471. },
  23472. moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
  23473. j = new h.Quaternion,
  23474. function(e, t) {
  23475. var i = e.pano
  23476. , n = e.rotation
  23477. , r = e.transition;
  23478. if (!this.model)
  23479. return t({
  23480. success: !1,
  23481. error: "The model has not been loaded yet"
  23482. });
  23483. var o = this.model.panos.get(i);
  23484. if (!o)
  23485. return t({
  23486. success: !1,
  23487. error: i + " does not exist in this model"
  23488. });
  23489. if (!n)
  23490. return t({
  23491. sucess: !1,
  23492. erorr: n + " is not a valid rotation"
  23493. });
  23494. W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
  23495. console.log(n.z);
  23496. var a = {
  23497. success: !0,
  23498. message: i
  23499. };
  23500. if (r === v.FADEOUT)
  23501. j.setFromEuler(W),
  23502. this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
  23503. else {
  23504. var s, l;
  23505. r === v.INSTANT && (l = s = 0);
  23506. var c = C.FORWARD.clone().applyEuler(W).add(o.position);
  23507. this.player.flyToPano({
  23508. pano: o,
  23509. lookAtPoint: c,
  23510. duration: s,
  23511. aimDuration: l
  23512. }, t.bind(this, a))
  23513. }
  23514. }
  23515. ),
  23516. moveInDirection: function(e, t) {
  23517. var i = e.direction;
  23518. return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  23519. void (t && t({
  23520. success: !1,
  23521. error: "Invalid direction."
  23522. }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
  23523. t(e ? {
  23524. success: !0,
  23525. message: "moved " + i
  23526. } : {
  23527. success: !1,
  23528. error: "Cannot move in direction: " + i
  23529. })
  23530. })
  23531. },
  23532. getPose: function(e, t) {
  23533. return this.player.camera.position,
  23534. (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
  23535. t({
  23536. success: !0,
  23537. message: L(this.player)
  23538. })
  23539. },
  23540. takeScreenShot: (z = new h.PerspectiveCamera,
  23541. G = new h.WebGLRenderTarget,
  23542. function(e, t) {
  23543. if (!e.resolution)
  23544. return t({
  23545. success: !1,
  23546. error: "An invalid resolution was specified"
  23547. });
  23548. if (-1 === e.resolution.width || -1 === e.resolution.height) {
  23549. var i = this.sceneRenderer.renderer.getSize();
  23550. e.resolution.width = i.width,
  23551. e.resolution.height = i.height
  23552. }
  23553. z.layers.set(T.DEFAULT),
  23554. e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
  23555. e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
  23556. e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
  23557. var n = e.resolution.width
  23558. , r = e.resolution.height
  23559. , o = n / r;
  23560. z.position.copy(this.sceneRenderer.camera.position),
  23561. z.quaternion.copy(this.sceneRenderer.camera.quaternion),
  23562. z.projectionMatrix.copy(this.player.camera.projectionMatrix),
  23563. z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
  23564. G.setSize(n, r),
  23565. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
  23566. var a = new Uint8Array(n * r * 4);
  23567. this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
  23568. var s = S.encode({
  23569. data: a,
  23570. width: n,
  23571. height: r,
  23572. heading: 180,
  23573. pitch: 0
  23574. }, {
  23575. quality: 75,
  23576. flipY: !0
  23577. });
  23578. t({
  23579. success: !0,
  23580. message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
  23581. })
  23582. }
  23583. ),
  23584. findRankedPano: (U = new h.Vector3,
  23585. H = new h.Vector3,
  23586. function(e, t) {
  23587. a(this.player, H),
  23588. r(t, H, U);
  23589. var i = this.player.rankedPanoInDirection(e, U);
  23590. if (i) {
  23591. var n = this.objectToHandle[i.id];
  23592. return n || (this.objectToHandle[i.id] = n = this.handleCount++,
  23593. this.handleToObject[n] = i),
  23594. n
  23595. }
  23596. return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  23597. -1
  23598. }
  23599. ),
  23600. findRankedtag: (V = new h.Vector3,
  23601. k = new h.Vector3,
  23602. function(e, t) {
  23603. a(this.player, k),
  23604. r(t, k, V);
  23605. var i = this.player.rankedtagInDirection(e, V);
  23606. if (i) {
  23607. var n = this.objectToHandle[i.sid];
  23608. return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
  23609. this.handleToObject[n] = i),
  23610. n
  23611. }
  23612. return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  23613. -1
  23614. }
  23615. ),
  23616. clickNearesttag: function(e) {
  23617. this.clickRankedtag(0, e)
  23618. },
  23619. clickRankedtag: function(e, t) {
  23620. var i = function(e, t) {
  23621. var i = this.findRankedtag(e, t);
  23622. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  23623. null)
  23624. }
  23625. .call(this, e, t);
  23626. i && P.call(this, i)
  23627. },
  23628. clickNearestPano: function(e, t) {
  23629. this.clickRankedPano(0, e, t)
  23630. },
  23631. clickRankedPano: function(e, t, i) {
  23632. var n = function(e, t) {
  23633. var i = this.findRankedPano(e, t);
  23634. return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  23635. null)
  23636. }
  23637. .call(this, e, t);
  23638. n ? o.call(this, n, i) : i(null)
  23639. },
  23640. clickPano: function(e, t) {
  23641. var i = this.handleTable[e];
  23642. i ? o.call(this, i, t) : t(null)
  23643. },
  23644. rotateDirection: function(e, t) {
  23645. var i = e.direction
  23646. , n = e.angle;
  23647. if (!R.active) {
  23648. var r = 0
  23649. , o = 0
  23650. , a = 0
  23651. , s = 0;
  23652. if (!n || isNaN(n))
  23653. return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  23654. void (t && t({
  23655. success: !1,
  23656. error: "Invalid rotation angle."
  23657. }));
  23658. if (this.player.mode === I.TRANSITIONING)
  23659. return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  23660. void (t && t({
  23661. success: !1,
  23662. error: "Cannot rotate while transitioning"
  23663. }));
  23664. if (i === m.RIGHT || i === m.LEFT)
  23665. i === m.RIGHT && (n = -n),
  23666. r = 0 < n ? -1 : 1,
  23667. a = n;
  23668. else {
  23669. if (i !== m.UP && i !== m.DOWN)
  23670. return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  23671. void (t && t({
  23672. success: !1,
  23673. error: "Invalid direction for rotation."
  23674. }));
  23675. if (this.player.mode === I.FLOORPLAN)
  23676. return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  23677. void (t && t({
  23678. success: !1,
  23679. error: "Cannot rotate " + i + " in floorplan mode"
  23680. }));
  23681. if (i === m.DOWN && (n = -n),
  23682. 0 === (n = O.call(this, n)))
  23683. return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  23684. void (t && t({
  23685. success: !1,
  23686. error: "Already at maximum rotation in direction: " + i
  23687. }));
  23688. o = 0 < n ? 1 : -1,
  23689. s = n
  23690. }
  23691. var l = n;
  23692. n = h.Math.degToRad(n),
  23693. a = h.Math.degToRad(a),
  23694. s = h.Math.degToRad(s);
  23695. var c = this.controls.activeControl;
  23696. c.startRotating(r, o),
  23697. R.start(a, s, this.player, function() {
  23698. c.stopRotating(!0),
  23699. t && t({
  23700. success: !0,
  23701. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  23702. })
  23703. })
  23704. }
  23705. },
  23706. rotate: (F = new h.Vector3,
  23707. B = new h.Vector3,
  23708. function(e, t) {
  23709. var i = e.xAngle
  23710. , n = e.yAngle;
  23711. if (!R.active) {
  23712. if (i = i || 0,
  23713. n = n || 0,
  23714. isNaN(i) || isNaN(n))
  23715. return M.warn("Showcase -> rotate: Invalid rotation angle."),
  23716. void (t && t({
  23717. success: !1,
  23718. error: "Invalid rotation angle."
  23719. }));
  23720. if (this.player.mode === I.TRANSITIONING)
  23721. return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
  23722. void (t && t({
  23723. success: !1,
  23724. error: "Cannot rotate while transitioning"
  23725. }));
  23726. Math.abs(i) < .01 && (i = 0),
  23727. Math.abs(n) < .01 && (n = 0);
  23728. var r = n;
  23729. n = O.call(this, n);
  23730. var o = 0 < r ? "UP" : "DOWN";
  23731. if (!(i = -i) && r && !n)
  23732. return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
  23733. void (t && t({
  23734. success: !1,
  23735. error: "Already at maximum rotation in direction: " + o
  23736. }));
  23737. n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
  23738. var a = n;
  23739. n = h.Math.degToRad(n),
  23740. i = h.Math.degToRad(i),
  23741. F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
  23742. this.player.getDirection(F),
  23743. B.copy(F).applyAxisAngle(C.UP, i),
  23744. B.applyAxisAngle(C.RIGHT, n);
  23745. var s = (F.angleTo(B),
  23746. 0 < i ? -1 : i < 0 ? 1 : 0)
  23747. , l = 0 < n ? 1 : n < 0 ? -1 : 0;
  23748. Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
  23749. var c = this.controls.activeControl;
  23750. c.startRotating(s, l),
  23751. R.start(i, n, this.player, function() {
  23752. c.stopRotating(!0),
  23753. t && t({
  23754. success: !0,
  23755. message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
  23756. })
  23757. })
  23758. }
  23759. }
  23760. ),
  23761. panCamera: function(e, i) {
  23762. function t(e) {
  23763. switch (r.removeAllListeners(w.AutoPanComplete),
  23764. r.removeAllListeners(w.AutoPanInterrupt),
  23765. r.removeAllListeners(w.AutoPanClamped),
  23766. e) {
  23767. case w.AutoPanInterrupt:
  23768. i({
  23769. success: !0,
  23770. message: "Camera panning interrupted."
  23771. });
  23772. break;
  23773. case w.AutoPanClamped:
  23774. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  23775. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  23776. return void i({
  23777. success: !1,
  23778. error: "Already at edge of current model bounds."
  23779. });
  23780. var t = "The view point is outside the bounds for the current model. ";
  23781. t += "The view point was clamped to " + o(r.target.x, r.target.z),
  23782. console.warn(t)
  23783. }
  23784. case w.AutoPanComplete:
  23785. i({
  23786. success: !0,
  23787. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  23788. })
  23789. }
  23790. }
  23791. if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
  23792. return i({
  23793. success: !1,
  23794. error: "Camera panning is not available in the current mode: " + this.player.mode
  23795. });
  23796. var n = e.position
  23797. , r = this.player.control;
  23798. r.setAutoPanPosition(n.x, n.z),
  23799. r.autoPan = !0;
  23800. var o = function(e, t) {
  23801. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  23802. };
  23803. r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
  23804. r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
  23805. r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
  23806. },
  23807. click: function(e, t) {
  23808. var i = e.x
  23809. , n = e.y;
  23810. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  23811. n = n / 100 * $("#player").height()),
  23812. this.player.handleInputStart(i, n),
  23813. this.player.updateIntersect(),
  23814. this.player.handleInputEnd(i, n)
  23815. },
  23816. mouseOver: function(e, t) {
  23817. var i = e.x
  23818. , n = e.y;
  23819. !0 === e.percentage && (i = i / 100 * $("#player").width(),
  23820. n = n / 100 * $("#player").height()),
  23821. this.player.handleInputMove(i, n),
  23822. this.player.updateIntersect()
  23823. },
  23824. moveToMode: function(e, t) {
  23825. function i(e) {
  23826. t(e ? {
  23827. success: !1,
  23828. error: "Failed to load new mode: " + e
  23829. } : {
  23830. success: !0,
  23831. message: "Moved to new mode: " + n
  23832. })
  23833. }
  23834. var n = e.mode;
  23835. n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
  23836. i()
  23837. }, function(e) {
  23838. i(e)
  23839. }) : t({
  23840. success: !1,
  23841. error: "Invalid mode selection"
  23842. })
  23843. }
  23844. }
  23845. }
  23846. ).call(this, "/js/sdk/automation.js")
  23847. }
  23848. , {
  23849. "../constants": 8,
  23850. "../enum/AlignmentType": 17,
  23851. "../enum/ControlEvents": 21,
  23852. "../enum/Direction": 22,
  23853. "../enum/GLCubeFaces": 25,
  23854. "../enum/Keys": 30,
  23855. "../enum/ModelManagerEvents": 33,
  23856. "../enum/PlayerEvents": 40,
  23857. "../enum/RenderLayers": 41,
  23858. "../enum/Vectors": 50,
  23859. "../enum/Viewmode": 51,
  23860. "../enum/WarpStyle": 52,
  23861. "../lib/jpeg_encoder": 94,
  23862. "../sdk/SdkEvents": 161,
  23863. "../settings": 166,
  23864. "../util/common": 185,
  23865. "../util/logger": 189,
  23866. "../util/math": 190,
  23867. "../util/panorama": 191,
  23868. "./ApiHost": 159,
  23869. "./PostMessageType": 160,
  23870. "./TransitionStyles": 162,
  23871. three: 217
  23872. }],
  23873. 165: [function(e, t, i) {
  23874. "use strict";
  23875. function n(e) {
  23876. this.sourceWindow = e,
  23877. this.targetWindow = null,
  23878. this.targetOrigin = null,
  23879. this.id = Math.floor(1e5 * Math.random()),
  23880. this.bindEvents()
  23881. }
  23882. var r = e("./PostMessageType")
  23883. , o = e("events").EventEmitter;
  23884. (n.prototype = Object.create(o.prototype)).bindEvents = function() {
  23885. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  23886. }
  23887. ,
  23888. n.prototype.setTarget = function(e, t) {
  23889. this.targetWindow = e,
  23890. this.targetOrigin = t
  23891. }
  23892. ,
  23893. n.prototype.onPostmessageReceived = function(e) {
  23894. var t = e.origin || e.originalEvent.origin
  23895. , i = e.source;
  23896. switch (e.data.type) {
  23897. case r.CONNECT:
  23898. break;
  23899. case r.RESPONSE:
  23900. if (this.id !== e.data.toId)
  23901. return;
  23902. default:
  23903. if (!this.validateMessageOrigin(t))
  23904. return
  23905. }
  23906. var n = e.data;
  23907. n.source = i,
  23908. n.origin = t,
  23909. n.timestamp = Date.now(),
  23910. this.emit(e.data.type, n)
  23911. }
  23912. ,
  23913. n.prototype.validateMessageOrigin = function(e) {
  23914. return "*" === this.targetOrigin || e === this.targetOrigin
  23915. }
  23916. ,
  23917. n.prototype.send = function(e) {
  23918. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  23919. this.targetWindow.postMessage(e, this.targetOrigin))
  23920. }
  23921. ,
  23922. t.exports = n
  23923. }
  23924. , {
  23925. "./PostMessageType": 160,
  23926. events: 202
  23927. }],
  23928. 166: [function(e, t, i) {
  23929. "use strict";
  23930. var n = e("three")
  23931. , r = e("./util/browser")
  23932. , o = e("./enum/Viewmode")
  23933. , a = e("./enum/VROption")
  23934. , s = e("./enum/Colors")
  23935. , l = e("./enum/WarpStyle")
  23936. , c = e("./util/easing")
  23937. , h = e("./util/common")
  23938. , u = e("./util/showcase")
  23939. , d = e("./constants")
  23940. , p = {
  23941. debug: !1,
  23942. version: "2.25.6-0-gd87e5b1",
  23943. languageTag: r.valueFromHash("lang", null),
  23944. pageTitle: "四维虚拟漫游",
  23945. authorizationHeader: u.getAuthorizationHeader(),
  23946. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  23947. logLevel: r.valueFromHash("log", 2),
  23948. skyboxRadius: 2500,
  23949. modelBoundsPadding: 5,
  23950. showNeighbors: !1,
  23951. brand: r.valueFromHash("brand", !0),
  23952. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  23953. startHighlights: r.valueFromHash("hl", -1),
  23954. specialEdition: r.valueFromHash("bn", 0),
  23955. useWheel: r.valueFromHash("wh", !0),
  23956. crossOrigin: "anonymous",
  23957. fancierTransition: !1,
  23958. wireframe: !1,
  23959. skyboxWireframe: !1,
  23960. modelAlpha: 1,
  23961. highlightPanoSelection: !1,
  23962. showSweeps: !0,
  23963. showSkyboxes: !1,
  23964. showMesh: !0,
  23965. showFloors: !1,
  23966. showFloorDuration: 300,
  23967. showFloorDelay: 300,
  23968. hideFloorDuration: 300,
  23969. hideFloorDelay: 0,
  23970. reticuleOpacityTransitionTime: 250,
  23971. reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue,
  23972. markerOpacityTransitionTime: 500,
  23973. guiAnimationSpeed: 250,
  23974. highlightAnimationDuration: 500,
  23975. modelComponentLoadSpinnerDelay: 150,
  23976. captureErrors: !1,
  23977. maxMobileTextures: 6,
  23978. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  23979. startupFlyinDelay: 3e3,
  23980. dollhouseDefault: {
  23981. minDistance: 15,
  23982. maxDistance: 50,
  23983. minPolarAngle: n.Math.degToRad(10),
  23984. maxPolarAngle: n.Math.degToRad(90)
  23985. },
  23986. hideReticuleTimeout: 1e3,
  23987. analytics: {
  23988. inactivityThreshold: 30,
  23989. sessionTrackingRate: .15,
  23990. maxTrackedErrors: 20,
  23991. sessionDurationPingFrequency: 10,
  23992. sessionDurationTimeout: 15
  23993. },
  23994. flydown: {
  23995. movementEasing: "easeInOutQuad",
  23996. movementDelay: .001,
  23997. rotationEasing: "easeInOutQuad",
  23998. rotationDelay: .5,
  23999. modelTextureDelay: .75,
  24000. skyboxDelay: .75
  24001. },
  24002. transition: {
  24003. flySpeed: .001,
  24004. flyTime: 750,
  24005. flytimeMaxDistanceThreshold: 5,
  24006. flytimeDistanceMultiplier: 150,
  24007. aimTime: 1500,
  24008. aimSlowFactor: 1.5,
  24009. blur: .8,
  24010. movementEasing: "easeInOutQuad",
  24011. blendEasing: "easeInOutQuad",
  24012. fastForwardFactor: 3
  24013. },
  24014. show360Views: {
  24015. enabled: !0,
  24016. transitionTime: 1e3
  24017. },
  24018. quickstart: {
  24019. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24020. animation: 1400,
  24021. showTextDelay: 500,
  24022. fadeOutDelay: 3e3,
  24023. fovChange: 10
  24024. },
  24025. appConfig: {
  24026. webvr_version: null,
  24027. segment_key: null,
  24028. embedly_key: null,
  24029. branch_key: null,
  24030. keen_write_key: null,
  24031. keen_project_id: null
  24032. },
  24033. vr: {
  24034. enabled: !0,
  24035. allowWebVR: !1,
  24036. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24037. },
  24038. share: {
  24039. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24040. },
  24041. input: {
  24042. longTapThreshold: 200,
  24043. moveToleranceNDC: .08,
  24044. touchMoveThreshold: 25
  24045. },
  24046. help: {
  24047. modalStayDuration: 600
  24048. },
  24049. immersive: {
  24050. timeToShowAgain: 1250,
  24051. uiStayDuration: 600
  24052. },
  24053. tourInteraction: {
  24054. disabled: "0" === r.valueFromHash("tourcta", null),
  24055. showPauseButton: 1e3,
  24056. showModal: 1500,
  24057. allowNextClick: 200,
  24058. largeModal: "1" === r.valueFromHash("tourcta", null),
  24059. smallModal: "2" === r.valueFromHash("tourcta", null)
  24060. },
  24061. labels: {
  24062. enabled: !1,
  24063. hideUntilStart: !0,
  24064. fadeInDuration: 250,
  24065. fadeInDelay: 250,
  24066. fadeOutDuration: 250,
  24067. fadeOutDelay: 0,
  24068. zoomHideThreshhold: {
  24069. mobile: r.isSmallScreen() ? .45 : .6,
  24070. desktop: 2
  24071. },
  24072. zoomTruncateThreshhold: {
  24073. mobile: r.isSmallScreen() ? .35 : .45,
  24074. desktop: .85
  24075. },
  24076. minLengthForTruncate: 16,
  24077. truncateLength: 12,
  24078. truncateSuffix: "..."
  24079. },
  24080. tags: {
  24081. enabled: r.valueFromHash("mt", 1),
  24082. startup: {
  24083. hideUntilStart: !0,
  24084. fadeInDuration: 500,
  24085. fadeInDelay: 100
  24086. },
  24087. visibility: {
  24088. anyDistance: !0,
  24089. visibleDistance: 8,
  24090. cameraClearance: .1,
  24091. alphaTestLevel: .05,
  24092. hideViaFloor: !0,
  24093. hideOffScreenDisc: !1,
  24094. hideOffScreenObject: !1
  24095. },
  24096. disc: {
  24097. opacity: 1,
  24098. disabledOpacity: .5,
  24099. scale: {
  24100. nearBound: 1.5,
  24101. farBound: 4.8,
  24102. linkFarBound: !1,
  24103. linkPercent: 40,
  24104. maxSize: 80,
  24105. minSize: 40,
  24106. baseViewportSize: 800,
  24107. responsiveness: 100
  24108. }
  24109. },
  24110. pole: {
  24111. enabled: !0,
  24112. height: .5,
  24113. width: 2,
  24114. opacity: .5,
  24115. color: "white"
  24116. },
  24117. navigate: {
  24118. nearestPano: !0,
  24119. lineOfSight: !0,
  24120. reactivate: !0,
  24121. aimAt: "disc",
  24122. tiltTolerance: 25,
  24123. rotateSpeedFactor: .6
  24124. }
  24125. },
  24126. path: {
  24127. color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue,
  24128. colorUp: s._desat(s.newBlue, .5),
  24129. colorDown: s._darken(s.newBlue, .35),
  24130. opacity: .5,
  24131. style: "ribbon",
  24132. height: .025,
  24133. ribbonWidth: .24,
  24134. outsideHeight: .5,
  24135. waypointRadius: .5,
  24136. waypointIndoorRadius: .24,
  24137. waypointPulse: 1e3,
  24138. typ: l.BLACK,
  24139. meshFree: r.valueFromHash("mf", 1),
  24140. mapGuides: r.valueFromHash("guides", !0),
  24141. fadeInTime: 400,
  24142. fadeOutTime: 300
  24143. },
  24144. warp: {
  24145. nearPanoDist: .1,
  24146. matchCam: !1,
  24147. blur: .33,
  24148. fastTime: 1500,
  24149. teleportTime: 1500,
  24150. outsideTime: 2e3,
  24151. lookAheadMax: .3,
  24152. lookAheadDist: 2.5,
  24153. softPushDist: .37,
  24154. softPushEnd: .3,
  24155. softBendAngle: 8,
  24156. softBendTilt: 4,
  24157. softBendEnd: .3,
  24158. doBurns: !0,
  24159. burnsAngle: 8,
  24160. minBurnsAngle: 35,
  24161. minDownAngle: -35,
  24162. maxTurnPerSec: 280,
  24163. maxAimPerSec: 35,
  24164. minRotation: 12,
  24165. maxAimRotation: 33.2,
  24166. turnFriction: .2,
  24167. flySpeed: .01,
  24168. minWarpTime: 1200,
  24169. warpInterruptionRedirectTime: 500,
  24170. tourStepDelay: r.valueFromHash("st", 0),
  24171. walkDelay: 0,
  24172. walkMaxDist: 50,
  24173. walkMinDist: .8,
  24174. walkSlideShowThreshhold: 3e3,
  24175. walkExtraPanosDistance: .4,
  24176. timePerMeter: 1200,
  24177. motionLeadTime: 5e3,
  24178. movementEasing: "easeInOutQuad",
  24179. blendEasing: "easeInOutQuad",
  24180. showBunny: !1,
  24181. loop: r.valueFromHash("lp", !1),
  24182. auto: r.valueFromHash("ts", -1),
  24183. eOrder: "YXZ",
  24184. stepFactor: .25,
  24185. brakeStrength: 2,
  24186. minBrakeAngle: .1,
  24187. maxBrakeAngle: 1.8,
  24188. climbEffort: 4
  24189. },
  24190. rotationFriction: .05,
  24191. rotationAccelerationInside: 4.5,
  24192. rotationAccelerationOutside: .15,
  24193. rotationAfterMoveMultiplier: 40,
  24194. rotationAfterMoveHistoryCount: 5,
  24195. panFriction: .09,
  24196. panAccelerationOutside: 60,
  24197. onload: r.valueFromHash("onload", o.PANORAMA),
  24198. zoomNearLimit: .1,
  24199. zoomFarLimit: 10,
  24200. navigation: {
  24201. panoScores: !1,
  24202. mouseDirection: !0,
  24203. filterStrictness: .75,
  24204. angleFactor: -30,
  24205. directionFactor: 10,
  24206. distanceFactor: -1,
  24207. optionalityFactor: 3
  24208. },
  24209. sdkInit: !1,
  24210. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24211. console: r.valueFromHash("console", !1),
  24212. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24213. panoramaNeighbourMaxDistance: 5,
  24214. panoFloorClickRadius: .35,
  24215. showScreenshotLocations: !1,
  24216. showAxis: !1,
  24217. showNeighbourRaycasts: !1,
  24218. colorMarkerOnLoad: !1,
  24219. colorMarkerByFloor: !1,
  24220. tiling: {
  24221. panoPreRenderRepeatDelay: 2500,
  24222. panoPreRenderDelay: 500,
  24223. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24224. tilingFlagNames: ["usetiles", "tiles"],
  24225. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24226. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24227. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24228. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24229. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24230. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24231. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24232. customCompression: r.valueFromHash("tilecustcomp", 0),
  24233. mobileHighQualityOverride: 1,
  24234. allowUltraHighResolution: !0
  24235. },
  24236. zoom: {
  24237. enabled: !0,
  24238. forceOff: r.valueFromHash("nozoom", 0),
  24239. overridemax: r.valueFromHash("maxzoom", null),
  24240. overridemin: r.valueFromHash("minzoom", null),
  24241. max: d.highQualityMaxZoom,
  24242. min: 1,
  24243. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24244. activationThreshold: 1.1,
  24245. restoreTime: 500
  24246. },
  24247. profiling: {
  24248. enabled: r.valueFromHash("mem", !1)
  24249. }
  24250. };
  24251. (p = h.deepExtend(p, d, {
  24252. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24253. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24254. panorama: {
  24255. transitionTime: 1e3,
  24256. modelAlpha: 0,
  24257. modelAlphaDelay: p.flydown.modelTextureDelay,
  24258. modelAlphaLength: 1,
  24259. skyboxOpacity: 1,
  24260. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24261. skyboxOpacityLength: .9,
  24262. fovLength: 1,
  24263. fovDelay: 0,
  24264. cameraMatrixDuration: .8,
  24265. cameraMatrixDelay: 0,
  24266. cameraMatrixEase: c.easeInCubic,
  24267. reticuleOpacity: 1,
  24268. markerOpacity: .3,
  24269. markerOpacityOnHover: 1
  24270. },
  24271. dollhouse: {
  24272. transitionTime: 1e3,
  24273. modelAlpha: 1,
  24274. modelAlphaDelay: 0,
  24275. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24276. skyboxOpacity: 0,
  24277. skyboxOpacityDelay: 0,
  24278. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24279. fovLength: 1,
  24280. fovDelay: 0,
  24281. cameraMatrixDuration: .8,
  24282. cameraMatrixDelay: .3,
  24283. cameraMatrixEase: c.easeInCubic,
  24284. reticuleOpacity: 1,
  24285. markerOpacity: 0,
  24286. markerOpacityOnHover: 0
  24287. },
  24288. floorplan: {
  24289. transitionTime: 1e3,
  24290. modelAlpha: 1,
  24291. modelAlphaDelay: 0,
  24292. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24293. skyboxOpacity: 0,
  24294. skyboxOpacityDelay: 0,
  24295. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24296. fovLength: 1,
  24297. fovDelay: 0,
  24298. cameraMatrixDuration: .5,
  24299. cameraMatrixDelay: 0,
  24300. cameraMatrixEase: c.easeOutCubic,
  24301. reticuleOpacity: 1,
  24302. markerOpacity: 0,
  24303. markerOpacityOnHover: 0,
  24304. cameraHeight: 50
  24305. },
  24306. transitioning: {
  24307. reticuleOpacity: 0,
  24308. markerOpacity: .3,
  24309. markerOpacityOnHover: 1
  24310. },
  24311. "floorplan-dollhouse": {
  24312. rotationDelay: 0,
  24313. rotationDuration: 1
  24314. },
  24315. "floorplan-panorama": {
  24316. rotationDelay: .5,
  24317. rotationDuration: 1
  24318. },
  24319. "dollhouse-panorama": {
  24320. rotationDelay: .5,
  24321. rotationDuration: 1
  24322. },
  24323. "dollhouse-floorplan": {
  24324. rotationDelay: 0,
  24325. rotationDuration: 1,
  24326. cameraMatrixDuration: 1.05,
  24327. cameraMatrixDelay: .5
  24328. },
  24329. "panorama-dollhouse": {
  24330. rotationDelay: 0,
  24331. rotationDuration: .5
  24332. },
  24333. "panorama-floorplan": {
  24334. transitionTime: 1500,
  24335. rotationDelay: 0,
  24336. rotationDuration: .5
  24337. }
  24338. })).path.meshFree && (p.path.typ = l.WALK),
  24339. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24340. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24341. t.exports = p
  24342. }
  24343. , {
  24344. "./constants": 8,
  24345. "./enum/Colors": 19,
  24346. "./enum/VROption": 47,
  24347. "./enum/Viewmode": 51,
  24348. "./enum/WarpStyle": 52,
  24349. "./util/browser": 182,
  24350. "./util/common": 185,
  24351. "./util/easing": 186,
  24352. "./util/showcase": 193,
  24353. three: 217
  24354. }],
  24355. 167: [function(e, t, i) {
  24356. "use strict";
  24357. var n = e("three")
  24358. , r = e("./settings")
  24359. , 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"
  24360. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24361. t.exports = {
  24362. basicTextured: {
  24363. uniforms: {
  24364. tDiffuse: {
  24365. type: "t",
  24366. value: null
  24367. },
  24368. alpha: {
  24369. type: "f",
  24370. value: 1
  24371. }
  24372. },
  24373. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24374. 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}"
  24375. },
  24376. copyCubeMap: {
  24377. uniforms: {
  24378. tDiffuse: {
  24379. type: "t",
  24380. value: null
  24381. },
  24382. alpha: {
  24383. type: "f",
  24384. value: 1
  24385. }
  24386. },
  24387. 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}",
  24388. 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}"
  24389. },
  24390. cube: {
  24391. uniforms: {
  24392. map: {
  24393. type: "t",
  24394. value: null
  24395. },
  24396. opacity: {
  24397. type: "f",
  24398. value: 1
  24399. }
  24400. },
  24401. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  24402. 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"
  24403. },
  24404. model: {
  24405. uniforms: {
  24406. map: {
  24407. type: "t",
  24408. value: null
  24409. },
  24410. modelAlpha: {
  24411. type: "f",
  24412. value: r.modelAlpha
  24413. },
  24414. opacity: {
  24415. type: "f",
  24416. value: 1
  24417. },
  24418. progress: {
  24419. type: "f",
  24420. value: 0
  24421. },
  24422. blackout: {
  24423. type: "i",
  24424. value: 0
  24425. },
  24426. pano0Map: {
  24427. type: "t",
  24428. value: null
  24429. },
  24430. pano0Position: {
  24431. type: "v3",
  24432. value: new n.Vector3
  24433. },
  24434. pano0Matrix: {
  24435. type: "m4",
  24436. value: new n.Matrix4
  24437. },
  24438. pano1Map: {
  24439. type: "t",
  24440. value: null
  24441. },
  24442. pano1Position: {
  24443. type: "v3",
  24444. value: new n.Vector3
  24445. },
  24446. pano1Matrix: {
  24447. type: "m4",
  24448. value: new n.Matrix4
  24449. }
  24450. },
  24451. 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",
  24452. 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"
  24453. },
  24454. hot: {
  24455. uniforms: {
  24456. color: {
  24457. type: "c",
  24458. value: new n.Color(16720384)
  24459. },
  24460. opac: {
  24461. type: "f",
  24462. value: 0
  24463. },
  24464. texture1: {
  24465. type: "t",
  24466. value: null
  24467. },
  24468. texture2: {
  24469. type: "t",
  24470. value: null
  24471. }
  24472. },
  24473. vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24474. 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"
  24475. },
  24476. modelOutside: {
  24477. uniforms: {
  24478. map: {
  24479. type: "t",
  24480. value: null
  24481. },
  24482. opacity: {
  24483. type: "f",
  24484. value: 1
  24485. }
  24486. },
  24487. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24488. 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"
  24489. },
  24490. ribbon: {
  24491. uniforms: {
  24492. map: {
  24493. type: "t",
  24494. value: null
  24495. },
  24496. opacity: {
  24497. type: "f",
  24498. value: 1
  24499. },
  24500. color: {
  24501. type: "c",
  24502. value: new n.Color(r.path.color)
  24503. }
  24504. },
  24505. 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",
  24506. 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"
  24507. },
  24508. waypoint: {
  24509. uniforms: {
  24510. map: {
  24511. type: "t",
  24512. value: null
  24513. },
  24514. opacity: {
  24515. type: "f",
  24516. value: 1
  24517. },
  24518. pulse: {
  24519. type: "f",
  24520. value: 1
  24521. },
  24522. nearFade: {
  24523. type: "v2",
  24524. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  24525. },
  24526. color: {
  24527. type: "c",
  24528. value: new n.Color(r.reticuleColor)
  24529. }
  24530. },
  24531. 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",
  24532. 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"
  24533. },
  24534. modelDebug: {
  24535. uniforms: {
  24536. map: {
  24537. type: "t",
  24538. value: null
  24539. },
  24540. modelAlpha: {
  24541. type: "f",
  24542. value: r.modelAlpha
  24543. },
  24544. depthmapRatio: {
  24545. type: "f",
  24546. value: 0
  24547. },
  24548. opacity: {
  24549. type: "f",
  24550. value: 1
  24551. },
  24552. progress: {
  24553. type: "f",
  24554. value: 0
  24555. },
  24556. considerOcclusion: {
  24557. type: "i",
  24558. value: r.fancierTransition
  24559. },
  24560. highlightPanoSelection: {
  24561. type: "i",
  24562. value: 0
  24563. },
  24564. useThirdPano: {
  24565. type: "i",
  24566. value: r.useThirdPano
  24567. },
  24568. pano0Map: {
  24569. type: "t",
  24570. value: null
  24571. },
  24572. pano0Depth: {
  24573. type: "t",
  24574. value: null
  24575. },
  24576. pano0Position: {
  24577. type: "v3",
  24578. value: new n.Vector3
  24579. },
  24580. pano0Matrix: {
  24581. type: "m4",
  24582. value: new n.Matrix4
  24583. },
  24584. pano0Weight: {
  24585. type: "f",
  24586. value: r.transition.pano0Weight
  24587. },
  24588. pano1Map: {
  24589. type: "t",
  24590. value: null
  24591. },
  24592. pano1Depth: {
  24593. type: "t",
  24594. value: null
  24595. },
  24596. pano1Position: {
  24597. type: "v3",
  24598. value: new n.Vector3
  24599. },
  24600. pano1Matrix: {
  24601. type: "m4",
  24602. value: new n.Matrix4
  24603. },
  24604. pano1Weight: {
  24605. type: "f",
  24606. value: r.transition.pano1Weight
  24607. },
  24608. pano2Map: {
  24609. type: "t",
  24610. value: null
  24611. },
  24612. pano2Depth: {
  24613. type: "t",
  24614. value: null
  24615. },
  24616. pano2Position: {
  24617. type: "v3",
  24618. value: new n.Vector3
  24619. },
  24620. pano2Matrix: {
  24621. type: "m4",
  24622. value: new n.Matrix4
  24623. },
  24624. pano2Weight: {
  24625. type: "f",
  24626. value: r.transition.pano2Weight
  24627. }
  24628. },
  24629. 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",
  24630. 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"
  24631. },
  24632. customDepth: {
  24633. uniforms: {
  24634. panoPosition: {
  24635. type: "v3",
  24636. value: new n.Vector3
  24637. }
  24638. },
  24639. 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",
  24640. 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"
  24641. },
  24642. skysphere: {
  24643. uniforms: {
  24644. radius: {
  24645. type: "f",
  24646. value: 0
  24647. }
  24648. },
  24649. 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",
  24650. 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"
  24651. },
  24652. tagDisc: {
  24653. uniforms: {
  24654. opacity: {
  24655. type: "f",
  24656. value: 0
  24657. },
  24658. color: {
  24659. type: "c",
  24660. value: new n.Color
  24661. },
  24662. bg: {
  24663. type: "t",
  24664. value: null
  24665. },
  24666. mask: {
  24667. type: "t",
  24668. value: null
  24669. }
  24670. },
  24671. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24672. 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"
  24673. }
  24674. }
  24675. }
  24676. , {
  24677. "./settings": 166,
  24678. three: 217
  24679. }],
  24680. 168: [function(E, _, e) {
  24681. (function(e) {
  24682. "use strict";
  24683. var t = E("three")
  24684. , i = (E("url"),
  24685. E("./util/ajax"))
  24686. , n = E("./settings")
  24687. , r = E("./util/logger")
  24688. , o = E("./util/math")
  24689. , a = E("./util/showcase")
  24690. , s = E("./objects/Panorama")
  24691. , l = new r(e)
  24692. , c = E("./model/Model")
  24693. , h = E("./shaders")
  24694. , u = E("./util/transitions")
  24695. , d = E("./objects/Chunk")
  24696. , p = E("./objects/Reticule")
  24697. , f = E("./objects/Skybox")
  24698. , g = E("./objects/Floor")
  24699. , m = E("./cameras/DollhouseCamera")
  24700. , v = E("./cameras/FloorplanCamera")
  24701. , y = E("./cameras/PanoramaCamera")
  24702. , A = E("./controls/DollhouseControls")
  24703. , C = E("./controls/FloorplanControls")
  24704. , I = E("./controls/PanoramaControls");
  24705. t.ImageUtils.crossOrigin = n.crossOrigin,
  24706. _.exports = {
  24707. shaders: h,
  24708. transitions: u,
  24709. Model: c,
  24710. Chunk: d,
  24711. Floor: g,
  24712. Skybox: f,
  24713. Reticule: p,
  24714. Panorama: s,
  24715. DollhouseCamera: m,
  24716. FloorplanCamera: v,
  24717. PanoramaCamera: y,
  24718. DollhouseControls: A,
  24719. FloorplanControls: C,
  24720. PanoramaControls: I,
  24721. getModel: function(e) {
  24722. if (!e.url)
  24723. throw 'getModel(): missing parameter "url"';
  24724. e.autoload = void 0 === e.autoload || e.autoload;
  24725. var t = a.parseSidUrl(e.url);
  24726. e.urlBase = t.urlBase,
  24727. e.urlModel = t.urlModel,
  24728. e.urlFiles = t.urlFiles;
  24729. var i = this._getPlatformError();
  24730. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  24731. this._loadModel().then(this._buildModel.bind(this)))
  24732. },
  24733. _getPlatformError: function() {
  24734. 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"
  24735. },
  24736. _loadModel: function() {
  24737. return i.get(this.options.urlModel, {
  24738. responseType: "json",
  24739. prefetchFrom: "model",
  24740. auth: a.getAuthorizationHeader()
  24741. }).then(null, function() {
  24742. return l.warn("Model loading failed at initial metadata load"),
  24743. "loading-failed"
  24744. })
  24745. },
  24746. _buildModel: function(e) {
  24747. e = a.normalizeModeldata(e, o);
  24748. var t = new c(this.options,e);
  24749. return this.options.autoload ? t.load(!0) : $.when(t)
  24750. }
  24751. }
  24752. }
  24753. ).call(this, "/js/showcase.js")
  24754. }
  24755. , {
  24756. "./cameras/DollhouseCamera": 5,
  24757. "./cameras/FloorplanCamera": 6,
  24758. "./cameras/PanoramaCamera": 7,
  24759. "./controls/DollhouseControls": 10,
  24760. "./controls/FloorplanControls": 11,
  24761. "./controls/PanoramaControls": 13,
  24762. "./model/Model": 139,
  24763. "./objects/Chunk": 144,
  24764. "./objects/Floor": 146,
  24765. "./objects/Panorama": 148,
  24766. "./objects/Reticule": 149,
  24767. "./objects/Skybox": 152,
  24768. "./settings": 166,
  24769. "./shaders": 167,
  24770. "./util/ajax": 181,
  24771. "./util/logger": 189,
  24772. "./util/math": 190,
  24773. "./util/showcase": 193,
  24774. "./util/transitions": 195,
  24775. three: 217,
  24776. url: 208
  24777. }],
  24778. 169: [function(e, t, i) {
  24779. "use strict";
  24780. function l(e) {
  24781. var t = {
  24782. renderTarget: null,
  24783. inUse: !1,
  24784. size: -1,
  24785. pano: null
  24786. };
  24787. return t.inUse = !0,
  24788. t.size = e,
  24789. function(e) {
  24790. O.push(e)
  24791. }(t),
  24792. t
  24793. }
  24794. function c(e) {
  24795. for (var t = 0; t < O.length; t++) {
  24796. var i = O[t];
  24797. if (i.renderTarget === e)
  24798. return !(i.inUse = !1)
  24799. }
  24800. return !1
  24801. }
  24802. function n() {
  24803. this.tileDirectory = {},
  24804. this.activeRenderTargetDescriptors = {},
  24805. this.activePanos = [],
  24806. this.panoLODDescriptors = {},
  24807. this.panoDescriptors = {},
  24808. this.tileTrees = {},
  24809. this.sceneRenderer = null,
  24810. this.tileDownloader = null,
  24811. this.forceQueue = [],
  24812. this.uploadQueues = {},
  24813. this.uploadInterval = null,
  24814. this.uploadIntervalCancelled = !1,
  24815. this.usingTileOverlay = !1,
  24816. this.overlayTilesLoaded = !1,
  24817. this.overlayTileBase = null,
  24818. this.overlayTilesBasic = {},
  24819. this.overlayTilesEnhanced = {},
  24820. this.zoomRenderTarget = null,
  24821. this.zoomPano = null,
  24822. this.zoomingActive = !1,
  24823. this.zoomPanoId = null,
  24824. this.zoomPanoRenderingDisabled = !1,
  24825. this.direction = new _.Vector3,
  24826. this.initTime = -1,
  24827. this.maxBaseUploadsPerFrame = R,
  24828. this.maxNonBaseUploadsPerFrame = M
  24829. }
  24830. 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"),
  24831. e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
  24832. e("../objects/Panorama"),
  24833. e("./TileTree")), y = (e("./TileDownloader"),
  24834. e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
  24835. e("../util/browser"),
  24836. 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 = {
  24837. Base: 0,
  24838. Remaining: 1
  24839. }, O = [];
  24840. function L(e) {
  24841. var t = e.shift();
  24842. return t.uploadQueued = !1,
  24843. t
  24844. }
  24845. (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
  24846. this.sceneRenderer = e,
  24847. this.tileDownloader = t,
  24848. this.qualityManager = i,
  24849. this.bindEvents(),
  24850. this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
  24851. this.initTime = performance.now()
  24852. }
  24853. ,
  24854. n.prototype.getActivePanoTextures = function(e) {
  24855. e = e || [];
  24856. for (var t = 0; t < O.length; t++) {
  24857. var i = O[t];
  24858. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  24859. }
  24860. }
  24861. ,
  24862. n.prototype.hasQueuedTiles = function() {
  24863. var e = this.peekNextFromUploadQueue();
  24864. return null != e
  24865. }
  24866. ,
  24867. n.prototype.getActiveRenderTargetDescriptor = function(e) {
  24868. return this.activeRenderTargetDescriptors[e]
  24869. }
  24870. ,
  24871. n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  24872. this.activeRenderTargetDescriptors[e] = t
  24873. }
  24874. ,
  24875. n.prototype.loadOverlayTiles = function() {
  24876. if (0 !== d.tiling.overlayStyle) {
  24877. var n = 0
  24878. , e = function(e, t, i) {
  24879. e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
  24880. this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
  24881. ++n === r.length && (this.overlayTilesLoaded = !0)
  24882. }
  24883. .bind(this)
  24884. , 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)]];
  24885. r.forEach(function(e) {
  24886. this.tileDownloader.loadImage(e[0], 0, e[1])
  24887. }
  24888. .bind(this)),
  24889. this.usingTileOverlay = !0
  24890. } else
  24891. this.usingTileOverlay = !1
  24892. }
  24893. ,
  24894. n.prototype.bindEvents = function() {
  24895. this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  24896. }
  24897. ,
  24898. n.prototype.setupZoomRenderTarget = function() {
  24899. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  24900. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  24901. return;
  24902. var e = this.zoomRenderTarget;
  24903. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  24904. e) {
  24905. var t = e.width
  24906. , i = this.zoomRenderTarget.width;
  24907. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  24908. e.texture.dispose(),
  24909. e.texture.loaded = !1,
  24910. e.texture.version = 0,
  24911. this.sceneRenderer.deallocateCubeTexture(e.texture),
  24912. e.texture = null
  24913. }
  24914. this.zoomPanoRenderingDisabled = !1
  24915. } else
  24916. this.zoomPanoRenderingDisabled = !0
  24917. }
  24918. ,
  24919. n.prototype.enableUltraHighQualityMode = function(t) {
  24920. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  24921. var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  24922. this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
  24923. e && (this.qualityManager.enableUltraHighQualityMode(),
  24924. this.setupZoomRenderTarget(),
  24925. t())
  24926. }
  24927. .bind(this))
  24928. }
  24929. }
  24930. ,
  24931. n.prototype.activateTiledPano = function(e, t, i) {
  24932. i && this.clearAllQueuedUploads();
  24933. for (var n = 0; n < A.FACES_PER_PANO; n++)
  24934. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  24935. this.linkAllTilesAndNodes(e);
  24936. var r = this.getActiveRenderTargetDescriptor(e.id)
  24937. , o = t;
  24938. if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
  24939. !r || o !== r.size) {
  24940. if (r && c(r.renderTarget),
  24941. !(r = function(e) {
  24942. for (var t = 0; t < O.length; t++) {
  24943. var i = O[t];
  24944. if (!i.inUse && i.size === e)
  24945. return i.inUse = !0,
  24946. i
  24947. }
  24948. return null
  24949. }(o))) {
  24950. var a = this.initTiledPano(o, !1);
  24951. (r = l(a.width)).renderTarget = a
  24952. }
  24953. r.pano = e,
  24954. this.resetPanoDescriptor(e.id),
  24955. this.resetPanoLODDescriptors(e.id),
  24956. this.resetRenderStatus(e.id, !0, !0)
  24957. }
  24958. this.setActiveRenderTargetDescriptor(e.id, r);
  24959. var s = i ? 0 : 1;
  24960. return this.updateActivePanos(e, s),
  24961. r.renderTarget
  24962. }
  24963. ,
  24964. n.prototype.deactivateTiledPano = function(e) {
  24965. var t = this.getActiveRenderTargetDescriptor(e.id);
  24966. this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
  24967. this.setActiveRenderTargetDescriptor(e.id, null);
  24968. var i = this.getUploadQueueForPano(e.id);
  24969. this.clearUploadQueue(i),
  24970. this.updateActivePanos()
  24971. }
  24972. ,
  24973. n.prototype.updateActivePanos = (s = [],
  24974. function(e, t) {
  24975. for (var i = s.length = 0; i < this.activePanos.length; i++) {
  24976. e && s.length === t && s.push(e);
  24977. var n = this.activePanos[i]
  24978. , r = this.getActiveRenderTargetDescriptor(n.id);
  24979. e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
  24980. }
  24981. e && t >= s.length && s.push(e),
  24982. this.activePanos.length = 0,
  24983. this.activePanos.push.apply(this.activePanos, s)
  24984. }
  24985. ),
  24986. n.prototype.getActivePanoCount = function() {
  24987. return this.activePanos.length
  24988. }
  24989. ,
  24990. n.prototype.resetRenderStatus = function(e, r, o, t) {
  24991. var i = null;
  24992. t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
  24993. for (var n = function(e, t, i, n) {
  24994. o && (t.tile.zoomUploaded = !1),
  24995. r && (t.tile.uploaded = !1)
  24996. }, a = 0; a < A.FACES_PER_PANO; a++) {
  24997. this.getTileTree(e, a).breadthFirst({
  24998. callback: n.bind(this, a),
  24999. minLevel: i
  25000. })
  25001. }
  25002. }
  25003. ,
  25004. n.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25005. for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25006. t.tile.zoomUploaded = t.tile.uploaded,
  25007. t.zoomCovered = t.covered
  25008. }, n = 0; n < A.FACES_PER_PANO; n++) {
  25009. this.getTileTree(e, n).breadthFirst({
  25010. callback: i.bind(this, n),
  25011. maxLevel: t
  25012. })
  25013. }
  25014. }
  25015. ,
  25016. n.prototype.renderPanoTiles = (h = [],
  25017. function(e, t, i, n) {
  25018. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25019. t = t || this.direction || m.FORWARD;
  25020. var r = this.getActiveRenderTargetDescriptor(e);
  25021. if (!this.isRenderTargetDescriptorValid(r))
  25022. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25023. for (var o = 0; o < A.FACES_PER_PANO; o++) {
  25024. var a = this.getTileTree(e, o);
  25025. h.length = 0,
  25026. a.breadthFirst({
  25027. saveVisited: h
  25028. });
  25029. for (var s = 0; s < h.length; s++) {
  25030. var l = h[s];
  25031. this.queueTileUpload(l.tile, !1, n || 0 === s && i)
  25032. }
  25033. }
  25034. this.updateDirection(t)
  25035. }
  25036. ),
  25037. n.prototype.isRenderTargetDescriptorValid = function(e) {
  25038. return e && e.renderTarget
  25039. }
  25040. ,
  25041. n.prototype.isPanoActive = function(e) {
  25042. var t = this.getActiveRenderTargetDescriptor(e);
  25043. return this.isRenderTargetDescriptorValid(t)
  25044. }
  25045. ,
  25046. n.prototype.isPanoZoomed = function(e) {
  25047. return this.zoomingActive && this.zoomPanoId === e
  25048. }
  25049. ,
  25050. n.prototype.initTileTree = function(e, t, i) {
  25051. var n = this.tileTrees[e];
  25052. n || (n = [],
  25053. this.tileTrees[e] = n);
  25054. var r = n[t];
  25055. if (!r) {
  25056. var o = v.getLevelCountForSize(A.TILE_SIZE, i);
  25057. r = new v(A.TILE_SIZE,o),
  25058. n[t] = r
  25059. }
  25060. }
  25061. ,
  25062. n.prototype.getTileTree = function(e, t) {
  25063. var i = this.tileTrees[e];
  25064. if (!i)
  25065. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25066. var n = i[t];
  25067. if (!n)
  25068. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25069. return n
  25070. }
  25071. ,
  25072. n.prototype.initTiledPano = function(e, t) {
  25073. var i = this.sceneRenderer.renderer
  25074. , n = (i.context,
  25075. new _.WebGLRenderTargetCube(e,e,{
  25076. stencilBuffer: !1
  25077. }))
  25078. , r = new _.CubeTexture([]);
  25079. (n.texture = r).image = [null, null, null, null, null, null],
  25080. r.flipY = !0,
  25081. t ? (r.generateMipmaps = !0,
  25082. r.magFilter = _.LinearFilter,
  25083. r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25084. r.magFilter = _.LinearFilter,
  25085. r.minFilter = _.LinearFilter),
  25086. r.format = _.RGBAFormat,
  25087. i.setRenderTarget(n),
  25088. i.setRenderTarget(null);
  25089. var o = i.properties.get(r);
  25090. return o.__image__webglTextureCube = o.__webglTexture,
  25091. n
  25092. }
  25093. ,
  25094. n.prototype.getUploadQueueForPano = function(e) {
  25095. var t = this.uploadQueues[e];
  25096. return t || (t = [],
  25097. this.uploadQueues[e] = t),
  25098. t
  25099. }
  25100. ,
  25101. n.prototype.isTileUploaded = function(e) {
  25102. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25103. }
  25104. ,
  25105. n.prototype.setUploaded = function(e, t) {
  25106. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25107. }
  25108. ,
  25109. n.prototype.queueTileUpload = function(e, t, i) {
  25110. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25111. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25112. var r = this.getUploadQueueForPano(e.panoId);
  25113. 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),
  25114. e.uploadQueued = !0,
  25115. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25116. }
  25117. }
  25118. ,
  25119. n.prototype.shoulPushToFrontOfQueue = function(e) {
  25120. return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25121. }
  25122. ,
  25123. n.prototype.getTopUploadQueue = function() {
  25124. for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
  25125. for (var n = 0; n < this.activePanos.length; n++)
  25126. if (e = this.activePanos[n],
  25127. 0 < (t = this.getUploadQueueForPano(e.id)).length)
  25128. switch (i) {
  25129. case P.Base:
  25130. if (0 === t[0].level)
  25131. return t;
  25132. break;
  25133. case P.Remaining:
  25134. return t
  25135. }
  25136. return null
  25137. }
  25138. ,
  25139. n.prototype.getNextFromUploadQueue = function() {
  25140. if (0 < this.forceQueue.length)
  25141. return L(this.forceQueue);
  25142. var e = this.getTopUploadQueue();
  25143. return e && 0 < e.length ? L(e) : null
  25144. }
  25145. ,
  25146. n.prototype.peekNextFromUploadQueue = function() {
  25147. if (0 < this.forceQueue.length)
  25148. return this.forceQueue[0];
  25149. var e = this.getTopUploadQueue();
  25150. return e && 0 < e.length ? e[0] : null
  25151. }
  25152. ,
  25153. n.prototype.clearAllQueuedUploads = function() {
  25154. this.clearAllUploadQueues(null, 0)
  25155. }
  25156. ,
  25157. n.prototype.clearAllQueuedUploadsForPano = function(e) {
  25158. this.clearAllUploadQueues(e, 0)
  25159. }
  25160. ,
  25161. n.prototype.clearAllUploadQueues = function(e, t) {
  25162. if (e)
  25163. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25164. this.clearUploadQueue(this.forceQueue, t, e);
  25165. else {
  25166. for (var i = 0; i < this.activePanos.length; i++) {
  25167. var n = this.activePanos[i];
  25168. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25169. }
  25170. this.clearUploadQueue(this.forceQueue, t)
  25171. }
  25172. }
  25173. ,
  25174. n.prototype.clearUploadQueue = function(e, t, i) {
  25175. null != t || (t = 0);
  25176. for (var n = 0; n < e.length; ) {
  25177. var r = e[n];
  25178. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25179. e.splice(n, 1)) : n++
  25180. }
  25181. }
  25182. ,
  25183. n.prototype.refreshUploadInterval = (a = null,
  25184. function(e) {
  25185. this.uploadIntervalCancelled || (a = a || function() {
  25186. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
  25187. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25188. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  25189. }
  25190. .bind(this),
  25191. null != e || (e = x),
  25192. T || (e = S),
  25193. this.uploadInterval = window.setTimeout(a, e),
  25194. this.uploadIntervalDelay = e)
  25195. }
  25196. ),
  25197. n.prototype.update = (r = performance.now(),
  25198. o = 0,
  25199. function() {
  25200. this.uploadIntervalCancelled = !0,
  25201. window.clearTimeout(this.uploadInterval),
  25202. this.uploadInterval = null;
  25203. var e = performance.now() - r;
  25204. !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25205. r = performance.now()),
  25206. o++
  25207. }
  25208. ),
  25209. n.prototype.updateUploadQueue = function(e, t) {
  25210. e = e || 1;
  25211. for (var i = 0, n = 0; !(t <= n || e <= i); ) {
  25212. var r = this.getNextFromUploadQueue();
  25213. if (!r)
  25214. break;
  25215. if (0 !== r.level ? i++ : n++,
  25216. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25217. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25218. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25219. }
  25220. }
  25221. }
  25222. ,
  25223. n.prototype.updateDirection = function(e) {
  25224. if (e = e || this.direction) {
  25225. this.direction = e;
  25226. for (var t = 0; t < this.activePanos.length; t++) {
  25227. var i = this.activePanos[t]
  25228. , n = this.getUploadQueueForPano(i.id);
  25229. y.sortPanoTiles(n, i, this.direction)
  25230. }
  25231. }
  25232. }
  25233. ,
  25234. n.prototype.uploadTile = (I = {},
  25235. new _.Vector4,
  25236. E = d.tiling.overlayStyle,
  25237. function(e, t) {
  25238. var i = e.panoId
  25239. , n = e.image
  25240. , r = e.tileSize
  25241. , o = e.panoSize
  25242. , a = e.tileIndex
  25243. , s = (e.faceTileIndex,
  25244. e.totalTiles)
  25245. , l = (e.face,
  25246. e.tileX)
  25247. , c = e.tileY
  25248. , h = !0
  25249. , u = !1
  25250. , d = (this.getPanoDescriptor(i),
  25251. this.getPanoLODDescriptor(i, o))
  25252. , p = this.getActiveRenderTargetDescriptor(i)
  25253. , f = p.renderTarget
  25254. , g = p.size;
  25255. if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
  25256. g = this.qualityManager.getMaxZoomPanoSize()),
  25257. this.isRenderTargetDescriptorValid(p) || (u = h = !1),
  25258. t || (this.anyUploaded(e.node) && (u = !(h = !1)),
  25259. this.isTileUploaded(e) && (u = h = !1)),
  25260. h) {
  25261. var m = r / o * g
  25262. , v = l * r / o * g
  25263. , y = c * r / o * g;
  25264. I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
  25265. var A = I[r];
  25266. if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
  25267. 1 === E || 2 === E) {
  25268. var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25269. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
  25270. this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
  25271. } else
  25272. this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
  25273. d.uploadCount++,
  25274. this.emit(b.TileRenderSuccess, i, o, a, s),
  25275. d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
  25276. this.setUploaded(e, !0),
  25277. this.addCoverageForNode(e.node)
  25278. } else
  25279. this.setUploaded(e, !1);
  25280. return e.uploadAttempted || (d.uploadAttempts++,
  25281. this.emit(b.TileUploadAttempted, i, o, a, s)),
  25282. e.uploadAttempted = !0,
  25283. d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
  25284. u
  25285. }
  25286. ),
  25287. n.prototype.linkTileAndNode = function(e, t) {
  25288. (t.tile = e).node = t
  25289. }
  25290. ,
  25291. n.prototype.linkAllTilesAndNodes = function(a) {
  25292. for (var e = function(e, t, i, n, r) {
  25293. var o = this.getTileDirectoryEntry(a.id, t, n, r);
  25294. this.linkTileAndNode(o, i)
  25295. }, t = 0; t < A.FACES_PER_PANO; t++) {
  25296. var i = this.getTileTree(a.id, t);
  25297. i.breadthFirst({
  25298. callback: e.bind(this, i, t)
  25299. })
  25300. }
  25301. }
  25302. ,
  25303. n.prototype.anyUploaded = function(e) {
  25304. if (!e)
  25305. return !1;
  25306. if (e.tile && this.isTileUploaded(e.tile))
  25307. return !0;
  25308. if (e.children)
  25309. for (var t = 0; t < e.children.length; t++) {
  25310. var i = e.children[t];
  25311. if (this.anyUploaded(i))
  25312. return !0
  25313. }
  25314. return !1
  25315. }
  25316. ,
  25317. n.prototype.setNodeCovered = function(e, t) {
  25318. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25319. }
  25320. ,
  25321. n.prototype.isNodeCovered = function(e) {
  25322. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25323. }
  25324. ,
  25325. n.prototype.addCoverageForNode = function(e) {
  25326. if (this.setNodeCovered(e, !0),
  25327. e.parent && e.covered) {
  25328. var t = e.parent;
  25329. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25330. }
  25331. }
  25332. ,
  25333. n.prototype.calcFullCoverage = function(e) {
  25334. var t = !1;
  25335. if (e.children)
  25336. for (var i = 0; i < e.children.length; i++) {
  25337. var n = e.children[i];
  25338. t = t || this.calcFullCoverage(n)
  25339. }
  25340. e.covered = e.tile.uploaded || t
  25341. }
  25342. ,
  25343. n.prototype.nodeSubcovered = function(e) {
  25344. if (!e.children)
  25345. return !1;
  25346. for (var t = 0; t < e.children.length; t++)
  25347. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25348. return !1;
  25349. return !0
  25350. }
  25351. ,
  25352. n.prototype.resetPanoDescriptor = function(e) {
  25353. this.getPanoDescriptor(e)
  25354. }
  25355. ,
  25356. n.prototype.getPanoDescriptor = function(e) {
  25357. var t = this.panoDescriptors[e];
  25358. return t || (t = {},
  25359. this.panoDescriptors[e] = t),
  25360. t
  25361. }
  25362. ,
  25363. n.prototype.resetPanoLODDescriptors = function(e) {
  25364. var t = this.getPanoLODDescriptors(e);
  25365. for (var i in t)
  25366. if (t.hasOwnProperty(i)) {
  25367. var n = t[i];
  25368. n.uploadCount = 0,
  25369. n.uploadAttempts = 0
  25370. }
  25371. }
  25372. ,
  25373. n.prototype.getPanoLODDescriptor = function(e, t) {
  25374. var i = this.getPanoLODDescriptors(e)
  25375. , n = i[t];
  25376. return n || (n = {
  25377. uploadCount: 0,
  25378. uploadAttempts: 0
  25379. },
  25380. i[t] = n),
  25381. n
  25382. }
  25383. ,
  25384. n.prototype.getPanoLODDescriptors = function(e) {
  25385. var t = this.panoLODDescriptors[e];
  25386. return t || (t = {},
  25387. this.panoLODDescriptors[e] = t),
  25388. t
  25389. }
  25390. ,
  25391. n.prototype.onTileDownloaded = function(e) {
  25392. var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
  25393. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  25394. if (i.downloaded = !0,
  25395. i.image = e.image,
  25396. i.panoSize = e.panoSize,
  25397. i.tileX = e.tileX,
  25398. i.tileY = e.tileY,
  25399. i.totalTiles = e.totalTiles,
  25400. i.tileIndex = e.tileIndex,
  25401. i.faceTileIndex = e.faceTileIndex,
  25402. i.face = e.face,
  25403. i.cubeFace = C.mapFaceToCubemapFace(e.face),
  25404. i.panoId = e.panoId,
  25405. i.tileSize = e.tileSize,
  25406. i.direction = (new _.Vector3).copy(e.direction),
  25407. i.node = null,
  25408. i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
  25409. this.isPanoActive(i.panoId)) {
  25410. var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
  25411. this.linkTileAndNode(i, n),
  25412. this.queueTileUpload(i, !0)
  25413. }
  25414. }
  25415. ,
  25416. n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  25417. var r = this.tileDirectory[e];
  25418. r || (r = {},
  25419. this.tileDirectory[e] = r);
  25420. var o = 16384 * t + 1024 * i + n
  25421. , a = r[o];
  25422. return a || (a = {
  25423. downloaded: !1,
  25424. uploaded: !1,
  25425. zoomUploaded: !1
  25426. },
  25427. r[o] = a),
  25428. a._key = e + ":" + t + ":" + i + ":" + n,
  25429. a._tileKey = o,
  25430. a
  25431. }
  25432. ,
  25433. n.prototype.setZoomingActive = function(e, t, i) {
  25434. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  25435. this.zoomPanoId = t.id,
  25436. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  25437. }
  25438. ,
  25439. n.prototype.updateZoomedPanoFromBase = function(e) {
  25440. if (!this.zoomPanoRenderingDisabled) {
  25441. var t = this.getActiveRenderTargetDescriptor(e.id);
  25442. if (t && t.renderTarget) {
  25443. var i = this.qualityManager.getMaxZoomPanoSize()
  25444. , n = t.renderTarget
  25445. , r = t.size;
  25446. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  25447. this.copyBaseRenderStatusToZoomed(e.id)
  25448. }
  25449. }
  25450. }
  25451. ,
  25452. t.exports = n
  25453. }
  25454. , {
  25455. "../enum/GLCubeFaces": 25,
  25456. "../enum/PanoRendererEvents": 35,
  25457. "../enum/PanoSizeClass": 36,
  25458. "../enum/SceneRendererEvents": 43,
  25459. "../enum/TileDownloaderEvents": 45,
  25460. "../enum/Vectors": 50,
  25461. "../exception/BasicException": 55,
  25462. "../objects/Panorama": 148,
  25463. "../settings": 166,
  25464. "../util/browser": 182,
  25465. "../util/panorama": 191,
  25466. "./TileDownloader": 171,
  25467. "./TilePrioritizer": 172,
  25468. "./TileTree": 173,
  25469. "./TileUtils": 174,
  25470. events: 202,
  25471. three: 217
  25472. }],
  25473. 170: [function(e, t, i) {
  25474. "use strict";
  25475. function n(e, t, i) {
  25476. this.maxNavPanoSize = -1,
  25477. this.maxZoomPanoSize = -1,
  25478. this.devicePixelDensity = e,
  25479. this.deviceScreenSize = t,
  25480. this.clientBandwidth = i,
  25481. this.panoSizeClassMap = {},
  25482. this.useHighResolutionPanos = !0,
  25483. this.useUltraHighResolutionPanos = !1,
  25484. this.modelHasUltraHighPanos = !1
  25485. }
  25486. var r = e("../enum/PanoSizeClass")
  25487. , o = e("../settings")
  25488. , a = e("../util/browser")
  25489. , s = e("../constants")
  25490. , l = e("../util/showcase")
  25491. , c = e("../enum/ModelManagerEvents");
  25492. n.prototype.init = function(e) {
  25493. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  25494. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  25495. this.highSize = this.getPanoSize(r.HIGH),
  25496. this.standardSize = this.getPanoSize(r.STANDARD),
  25497. this.baseSize = this.getPanoSize(r.BASE),
  25498. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  25499. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  25500. this.updateMaximums(),
  25501. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  25502. }
  25503. ,
  25504. n.prototype.updateFromModel = function(e) {
  25505. this.updateHighResolutionSettings(e),
  25506. this.updateUltraHighResolutionSettings(e)
  25507. }
  25508. ,
  25509. n.prototype.updateHighResolutionSettings = function(e) {
  25510. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  25511. this.updateMaximums()
  25512. }
  25513. ,
  25514. n.prototype.updateUltraHighResolutionSettings = function(e) {
  25515. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  25516. this.updateMaximums()
  25517. }
  25518. ,
  25519. n.prototype.enableUltraHighQualityMode = function() {
  25520. this.modelHasUltraHighPanos = !0,
  25521. this.updateUltraHighResolutionSettings(null)
  25522. }
  25523. ,
  25524. n.prototype.ultraHighQualityModeEnabled = function() {
  25525. return this.modelHasUltraHighPanos
  25526. }
  25527. ,
  25528. n.prototype.onModelChanged = function(e) {
  25529. this.updateFromModel(e.model),
  25530. this.updateMaximums()
  25531. }
  25532. ,
  25533. n.prototype.updateMaximums = function() {
  25534. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  25535. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  25536. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  25537. }
  25538. ,
  25539. n.prototype.buildPanoSizeClassMap = function() {
  25540. this.panoSizeClassMap[r.BASE] = 512,
  25541. this.panoSizeClassMap[r.STANDARD] = 1024,
  25542. this.panoSizeClassMap[r.HIGH] = 2048,
  25543. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  25544. }
  25545. ,
  25546. n.prototype.getPanoSize = function(e) {
  25547. return this.panoSizeClassMap[e]
  25548. }
  25549. ,
  25550. n.prototype.getMaxPossiblePanoSize = function() {
  25551. return this.getPanoSize(r.ULTRAHIGH)
  25552. }
  25553. ,
  25554. n.prototype.getMaxPanoSize = function() {
  25555. return this.maxZoomPanoSize
  25556. }
  25557. ,
  25558. n.prototype.getMaxNavPanoSize = function() {
  25559. return this.maxNavPanoSize
  25560. }
  25561. ,
  25562. n.prototype.getMaxZoomPanoSize = function() {
  25563. return this.maxZoomPanoSize
  25564. }
  25565. ,
  25566. n.prototype.detectMaxNavPanoSizeClass = function() {
  25567. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  25568. }
  25569. ,
  25570. n.prototype.detectMaxNavPanoSize = function() {
  25571. var e = this.detectMaxNavPanoSizeClass();
  25572. return this.getPanoSize(e)
  25573. }
  25574. ,
  25575. n.prototype.detectMaxZoomPanoSize = function() {
  25576. 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)
  25577. }
  25578. ,
  25579. t.exports = n
  25580. }
  25581. , {
  25582. "../constants": 8,
  25583. "../enum/ModelManagerEvents": 33,
  25584. "../enum/PanoSizeClass": 36,
  25585. "../settings": 166,
  25586. "../util/browser": 182,
  25587. "../util/showcase": 193
  25588. }],
  25589. 171: [function(A, C, e) {
  25590. (function(e) {
  25591. "use strict";
  25592. function i(e) {
  25593. this.panos = null,
  25594. this.retryMinimumTime = 1e4,
  25595. this.urls = null,
  25596. this.panoLoadCallbacks = {},
  25597. this.downloadDescriptors = {},
  25598. this.priorityQueue = [],
  25599. this.forceQueue = [],
  25600. this.activeDownloads = [],
  25601. this.qualityManager = null,
  25602. this.tilePrioritizer = null,
  25603. this.refreshInterval = null,
  25604. this.processPriorityQueue = !1,
  25605. this.concurrentDownloads = e.concurrentDownloads || 1,
  25606. this.downloadTestResults = {}
  25607. }
  25608. var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
  25609. A("../settings")), r = (A("../objects/Panorama"),
  25610. A("../util/logger")), o = (A("../enum/Vectors"),
  25611. A("../enum/PanoSizeClass"),
  25612. A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
  25613. A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
  25614. Object.freeze({
  25615. Testing: 1,
  25616. Success: 2,
  25617. Fail: 3
  25618. }));
  25619. i.prototype = Object.create(l.prototype),
  25620. i.IDLE_REFRESH_DELAY = 500,
  25621. i.ACTIVE_REFRESH_DELAY = 16,
  25622. i.DOWNLOAD_RETRIES = 4,
  25623. i.prototype.init = function(e) {
  25624. this.qualityManager = e
  25625. }
  25626. ,
  25627. i.prototype.setUrls = function(e) {
  25628. this.urls = e
  25629. }
  25630. ,
  25631. i.prototype.setPanoData = function(e, t, i) {
  25632. this.panos = e,
  25633. this.imagePanos = t,
  25634. this.panoGroupId = i
  25635. }
  25636. ,
  25637. i.prototype.start = function() {
  25638. this.refreshUpdateInterval(0)
  25639. }
  25640. ,
  25641. i.prototype.stop = function() {
  25642. window.cancel(this.refreshInterval)
  25643. }
  25644. ,
  25645. i.prototype.refreshUpdateInterval = function(e) {
  25646. e = e || 0,
  25647. this.refreshInterval = window.setTimeout(function() {
  25648. this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
  25649. }
  25650. .bind(this), e)
  25651. }
  25652. ,
  25653. i.prototype.update = function() {
  25654. var e = 0 < this.forceQueue.length;
  25655. return this.processQueueForDownloading(this.forceQueue),
  25656. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  25657. 0 < this.priorityQueue.length && (e = !0),
  25658. this.processQueueForDownloading(this.priorityQueue)),
  25659. e
  25660. }
  25661. ,
  25662. i.prototype.forceQueueTilesForPano = (p = [],
  25663. f = [],
  25664. function(e, t, i, n, r, o) {
  25665. p.length = 0;
  25666. for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
  25667. var l = a[s];
  25668. l.status !== v.None && l.status !== v.Queued || p.push(l)
  25669. }
  25670. if (i && 0 < p.length) {
  25671. g.sortPanoTiles(p, e, i),
  25672. f.length = 0,
  25673. m.matchingTilesInDirection(e, t, i, n, r, f);
  25674. for (var c = 0, h = function(e) {
  25675. return e.face === u.face && e.faceTileIndex === u.faceTileIndex
  25676. }; c < p.length; ) {
  25677. var u = p[c];
  25678. f.findIndex(h) < 0 ? p.splice(c, 1) : c++
  25679. }
  25680. }
  25681. for (var d = 0; d < p.length; d++)
  25682. this.forceQueue.push(p[d]);
  25683. this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
  25684. this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
  25685. o && this.processQueueForDownloading(this.forceQueue, !0)
  25686. }
  25687. ),
  25688. i.prototype.clearForceQueue = function() {
  25689. this.clearQueue(this.forceQueue)
  25690. }
  25691. ,
  25692. i.prototype.queuePrioritizedTilesForPanos = function(e) {
  25693. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  25694. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  25695. this.clearFromQueue(this.priorityQueue, v.None, !0),
  25696. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
  25697. }
  25698. ,
  25699. i.prototype.clearQueue = function(e) {
  25700. this.setStatusForAllDescriptors(e, v.None),
  25701. e.length = 0
  25702. }
  25703. ,
  25704. i.prototype.clearFromQueue = function(e, t, i) {
  25705. for (var n = 0; n < e.length; n++) {
  25706. var r = e[n];
  25707. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  25708. }
  25709. }
  25710. ,
  25711. i.prototype.setStatusForAllDescriptors = function(e, t) {
  25712. for (var i = 0; i < e.length; i++) {
  25713. var n = e[i];
  25714. n && (n.status = t)
  25715. }
  25716. }
  25717. ,
  25718. i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  25719. for (var i = 0; i < e.length; i++) {
  25720. var n = e[i];
  25721. n && (n.status !== t ? n.status = t : e[i] = null)
  25722. }
  25723. }
  25724. ,
  25725. i.prototype.getTileDownloadDescriptors = function(e, t) {
  25726. var i = this.getAllTileDownloadDescriptorsForPano(e)
  25727. , n = i[t];
  25728. return n || (n = this.buildDownloadDescriptorArray(t),
  25729. i[t] = n,
  25730. this.initTileDownloadDescriptors(n, e, t)),
  25731. n
  25732. }
  25733. ,
  25734. i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  25735. var t = this.downloadDescriptors[e.id];
  25736. return t || (t = {},
  25737. this.downloadDescriptors[e.id] = t),
  25738. t
  25739. }
  25740. ,
  25741. i.prototype.processQueueForDownloading = function(e, t) {
  25742. if (this.cleanupActiveDownloads(),
  25743. this.activeDownloads.length < this.concurrentDownloads || t)
  25744. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
  25745. var r = e.shift();
  25746. r && (this.startDownload(r),
  25747. n++)
  25748. }
  25749. }
  25750. ,
  25751. i.prototype.testDownload = function(t, e, i) {
  25752. var n = this.downloadTestResults[t];
  25753. if (n)
  25754. n === y.Success ? i(!0) : n === y.Fail && i(!1);
  25755. else {
  25756. this.downloadTestResults[t] = y.Testing;
  25757. var r = this.panos.list[0]
  25758. , o = this.getTileUrl(r.id, t, e, 0)
  25759. , a = function(e) {
  25760. this.downloadTestResults[t] = y.Success,
  25761. i(!0)
  25762. }
  25763. .bind(this)
  25764. , s = function() {
  25765. this.downloadTestResults[t] = y.Fail,
  25766. i(!1)
  25767. }
  25768. .bind(this);
  25769. this.loadImage(o, 0, a, s)
  25770. }
  25771. }
  25772. ,
  25773. i.prototype.startDownload = function(e) {
  25774. e.status = v.Downloading;
  25775. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  25776. this.activeDownloads.push(e),
  25777. this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  25778. }
  25779. ,
  25780. i.prototype.downloadFailed = function(e, t) {}
  25781. ,
  25782. i.prototype.downloadComplete = function(e, t) {
  25783. if (e.panoGroupId === this.panoGroupId) {
  25784. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  25785. e.status = v.Downloaded,
  25786. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  25787. var n = {
  25788. panoId: e.pano.id,
  25789. image: t,
  25790. tileSize: e.tileSize,
  25791. panoSize: e.panoSize,
  25792. tileIndex: e.tileIndex,
  25793. faceTileIndex: e.faceTileIndex,
  25794. totalTiles: e.totalTiles,
  25795. face: e.face,
  25796. tileX: e.tileX,
  25797. tileY: e.tileY,
  25798. direction: e.direction
  25799. };
  25800. e.image = t,
  25801. this.emit(o.TileDownloadSuccess, n),
  25802. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  25803. panoId: e.pano.id,
  25804. tileSize: e.tileSize,
  25805. panoSize: e.panoSize
  25806. },
  25807. this.emit(o.PanoDownloadComplete, n),
  25808. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  25809. }
  25810. }
  25811. ,
  25812. i.prototype.cleanupActiveDownloads = (n = [],
  25813. function() {
  25814. for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
  25815. var t = this.activeDownloads[e];
  25816. t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
  25817. }
  25818. this.activeDownloads.length = 0,
  25819. this.activeDownloads.push.apply(this.activeDownloads, n)
  25820. }
  25821. ),
  25822. i.prototype.isPanoDownloaded = function(e, t) {
  25823. var i = this.getTileDownloadDescriptors(e, t);
  25824. if (i.length <= 0)
  25825. return !1;
  25826. for (var n = 0; n < i.length; n++) {
  25827. if (i[n].status !== v.Downloaded)
  25828. return !1
  25829. }
  25830. return !0
  25831. }
  25832. ,
  25833. i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  25834. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  25835. this.panoLoadCallbacks[o] = {
  25836. onLoad: i,
  25837. onFail: n,
  25838. onProgress: r
  25839. }
  25840. }
  25841. ,
  25842. i.prototype.getPanoLoadCallbacks = function(e, t) {
  25843. var i = e.id + ":" + t;
  25844. return this.panoLoadCallbacks[i]
  25845. }
  25846. ,
  25847. i.prototype.buildDownloadDescriptorArray = function(e) {
  25848. for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  25849. var r = this.buildDownloadDescriptor();
  25850. i.push(r)
  25851. }
  25852. return i
  25853. }
  25854. ,
  25855. i.prototype.buildDownloadDescriptor = function() {
  25856. return {
  25857. panoGroupId: null,
  25858. pano: null,
  25859. panoSize: -1,
  25860. tileSize: -1,
  25861. tileIndex: -1,
  25862. totalTiles: -1,
  25863. faceTileIndex: -1,
  25864. status: v.None,
  25865. url: null,
  25866. image: null,
  25867. direction: new t.Vector3,
  25868. face: -1,
  25869. cubeFace: -1,
  25870. tileX: -1,
  25871. tileY: -1
  25872. }
  25873. }
  25874. ,
  25875. i.prototype.initTileDownloadDescriptors = function(e, t, i) {
  25876. for (var n = 0; n < e.length; n++) {
  25877. var r = e[n];
  25878. this.initTileDownloadDescriptor(r, t, i, n)
  25879. }
  25880. }
  25881. ,
  25882. i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  25883. var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
  25884. e.face = m.getFaceForTile(i, n),
  25885. e.cubeFace = a.mapFaceToCubemapFace(e.face),
  25886. e.panoGroupId = this.panoGroupId,
  25887. e.pano = t,
  25888. e.panoSize = i,
  25889. e.tileSize = r,
  25890. e.tileIndex = n,
  25891. e.totalTiles = m.getTileCountForSize(i),
  25892. e.status = v.None,
  25893. e.image = null,
  25894. m.getTileLocation(e.panoSize, e.tileIndex, e),
  25895. m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
  25896. }
  25897. ,
  25898. i.prototype.getTileUrl = (c = {
  25899. 256: "256",
  25900. 512: "512",
  25901. 1024: "1k",
  25902. 2048: "2k",
  25903. 4096: "4k"
  25904. },
  25905. h = {
  25906. face: -1,
  25907. faceTileIndex: -1,
  25908. tileX: -1,
  25909. tileY: -1
  25910. },
  25911. function(e, t, i, n) {
  25912. m.getTileLocation(t, n, h);
  25913. var r = Math.floor(t / i)
  25914. , o = r * r
  25915. , a = Math.floor(n / o)
  25916. , s = "";
  25917. 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
  25918. var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
  25919. return d.changeIfTileGenerating(l)
  25920. }
  25921. ),
  25922. i.prototype.loadImage = function(e, t, i, n) {
  25923. s.getImage(e, t).then(function(e) {
  25924. i(e)
  25925. }).fail(n)
  25926. }
  25927. ,
  25928. C.exports = i
  25929. }
  25930. ).call(this, "/js/tile/TileDownloader.js")
  25931. }
  25932. , {
  25933. "../ab": 3,
  25934. "../enum/DownloadStatus": 24,
  25935. "../enum/GLCubeFaces": 25,
  25936. "../enum/PanoSizeClass": 36,
  25937. "../enum/TileDownloaderEvents": 45,
  25938. "../enum/Vectors": 50,
  25939. "../enum/Viewmode": 51,
  25940. "../objects/Panorama": 148,
  25941. "../settings": 166,
  25942. "../util/ajax": 181,
  25943. "../util/logger": 189,
  25944. "../util/panorama": 191,
  25945. "./TilePrioritizer": 172,
  25946. "./TileUtils": 174,
  25947. events: 202,
  25948. three: 217
  25949. }],
  25950. 172: [function(n, C, e) {
  25951. (function(e) {
  25952. "use strict";
  25953. function h(e, t, i, n, r) {
  25954. this.qualityManager = e,
  25955. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  25956. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  25957. this.baseSize = t,
  25958. this.standardSize = i,
  25959. this.highSize = n,
  25960. this.ultraHighSize = r,
  25961. this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
  25962. }
  25963. var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
  25964. n("../settings"),
  25965. n("../settings"),
  25966. n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
  25967. n("../enum/PanoSizeClass"),
  25968. n("../enum/ModelManagerEvents"),
  25969. n("../enum/GLCubeFaces"),
  25970. n("../enum/DownloadStatus")), m = (n("../util/browser"),
  25971. n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
  25972. new t(e),
  25973. Object.freeze({
  25974. None: 0,
  25975. DirectionalFOV: 1
  25976. }));
  25977. h.PriorityCriteria = function(e, t, i, n, r) {
  25978. this.pano = e,
  25979. this.cameraPosition = (new o.Vector3).copy(t),
  25980. this.cameraDir = (new o.Vector3).copy(i),
  25981. this.panoSpaceDir = (new o.Vector3).copy(n),
  25982. this.upcomingPanos = r,
  25983. this.copy = function(e) {
  25984. this.pano = e.pano,
  25985. this.cameraPosition.copy(e.cameraPosition),
  25986. this.cameraDir.copy(e.cameraDir),
  25987. this.panoSpaceDir.copy(e.panoSpaceDir),
  25988. this.upcomingPanos = r
  25989. }
  25990. ,
  25991. this.zoomingActive = !1
  25992. }
  25993. ,
  25994. h.DIRECTIONAL_FOV = 180,
  25995. h.DIRECTIONAL_FOV_NARROW = 120,
  25996. h.MAX_SCORED_PANOS_TOCONSIDER = 6,
  25997. h.MAX_SCORED_PANOS_TOADD = 2,
  25998. h.MAX_UPCOMING_PANOS_TOADD = 3,
  25999. h.DIRECTION_SCORE_STRICTNESS = .75,
  26000. h.appendQueue = function(e, t) {
  26001. if (e && t)
  26002. for (var i = 0; i < t.length; i++)
  26003. e.push(t[i])
  26004. }
  26005. ,
  26006. h.prototype.updateCriteria = function(e, t, i, n) {
  26007. this.priorityCriteria.pano = e,
  26008. this.priorityCriteria.cameraPosition.copy(t),
  26009. this.priorityCriteria.cameraDir.copy(i),
  26010. this.priorityCriteria.upcomingPanos = n,
  26011. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26012. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26013. }
  26014. ,
  26015. h.prototype.filterAndPrioritize = (u = [],
  26016. p = [],
  26017. f = [],
  26018. function(e, t, i) {
  26019. this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
  26020. this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
  26021. var n = this.baseSize
  26022. , r = this.standardSize
  26023. , o = this.highSize
  26024. , a = this.ultraHighSize;
  26025. this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
  26026. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
  26027. f.length = 0,
  26028. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26029. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26030. h.appendQueue(e, f),
  26031. this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
  26032. f.length = 0,
  26033. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26034. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
  26035. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26036. h.appendQueue(e, f),
  26037. f.length = 0,
  26038. this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26039. this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26040. this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
  26041. h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26042. h.appendQueue(e, f),
  26043. this.queueTilesForPanos(e, u, i, n)
  26044. }
  26045. ),
  26046. h.prototype.canDownloadSize = function(e) {
  26047. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26048. }
  26049. ,
  26050. h.prototype.populateNeighborPanos = function(e, t, i) {
  26051. (i = i || []).length = 0;
  26052. var n = t.getNeighbours(e);
  26053. for (var r in n)
  26054. if (n.hasOwnProperty(r)) {
  26055. var o = t.get(r);
  26056. i.push(o)
  26057. }
  26058. return i
  26059. }
  26060. ,
  26061. h.prototype.populateScoredPanos = function(e, t, i, n, r) {
  26062. (i = i || []).length = 0;
  26063. var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
  26064. , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
  26065. , s = t.sortByScore(o, a);
  26066. if (s)
  26067. for (var l = 0; l < s.length && l < r; l++) {
  26068. var c = s[l].pano;
  26069. i.push(c)
  26070. }
  26071. return i
  26072. }
  26073. ,
  26074. h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26075. for (var o = 0, a = 0; a < t.length; a++) {
  26076. var s = t[a];
  26077. if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
  26078. r && r <= o)
  26079. break
  26080. }
  26081. return o
  26082. }
  26083. ,
  26084. h.prototype.queueTilesForPano = (r = {
  26085. filter: a.None
  26086. },
  26087. function(e, t, i, n) {
  26088. return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
  26089. }
  26090. ),
  26091. h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
  26092. function(e, t, i, n, r, o, a, s) {
  26093. for (var l = 0, c = 0; c < i.length; c++) {
  26094. var h = i[c];
  26095. d.copy(h.position),
  26096. d.sub(r),
  26097. d.normalize();
  26098. var u = Math.max(Math.min(o.dot(d), 1), -1);
  26099. if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
  26100. s && s <= l))
  26101. break
  26102. }
  26103. return l
  26104. }
  26105. ),
  26106. h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26107. for (var l = 0, c = 0; c < i.length; c++) {
  26108. var h = i[c];
  26109. if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
  26110. s && s <= l)
  26111. break
  26112. }
  26113. return l
  26114. }
  26115. ,
  26116. h.prototype.queueTilesInDirectionForPano = (s = {
  26117. filter: a.DirectionalFOV,
  26118. direction: new o.Vector3,
  26119. fov: 60
  26120. },
  26121. l = new o.Vector3,
  26122. function(e, t, i, n, r, o, a) {
  26123. return l.copy(o),
  26124. m.getRelativeDirection(i.quaternion, l),
  26125. s.direction.copy(l),
  26126. s.fov = a,
  26127. this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
  26128. }
  26129. ),
  26130. h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
  26131. function(e, t, i, n, r) {
  26132. var o = t.getTileDownloadDescriptors(i, n);
  26133. c.length = 0,
  26134. this.filterTileDownloadDescriptors(i, o, c, r);
  26135. for (var a = 0, s = 0; s < c.length; s++) {
  26136. var l = c[s];
  26137. l && (e.push(l),
  26138. a++)
  26139. }
  26140. return a
  26141. }
  26142. ),
  26143. h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
  26144. function(e, t, i, n) {
  26145. var r, o;
  26146. switch (n.filter) {
  26147. case a.DirectionalFOV:
  26148. for (r = 0; r < t.length; r++)
  26149. o = t[r],
  26150. m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26151. break;
  26152. default:
  26153. for (r = 0; r < t.length; r++)
  26154. o = t[r],
  26155. i.push(o)
  26156. }
  26157. for (r = 0; r < i.length; r++)
  26158. o = i[r],
  26159. this.canIncludeDescriptor(o) || (i[r] = null)
  26160. }
  26161. ),
  26162. h.prototype.canIncludeDescriptor = function(e) {
  26163. return e.status !== i.Downloading && e.status !== i.Downloaded
  26164. }
  26165. ,
  26166. h.prototype.canIncludePano = function(e, t) {
  26167. return !e.isLoaded(t)
  26168. }
  26169. ,
  26170. h.getFOVDotThreshold = function(e) {
  26171. return Math.cos(o.Math.degToRad(e / 2))
  26172. }
  26173. ;
  26174. var y = (A._panoSpaceDir = new o.Vector3,
  26175. A._fovThreshold = -1,
  26176. A._fovThresholdNarrow = -1,
  26177. A);
  26178. function A(e, t) {
  26179. var i = A._panoSpaceDir
  26180. , n = A._fovThreshold
  26181. , r = A._fovThresholdNarrow
  26182. , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
  26183. , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
  26184. return e._dot = o,
  26185. t._dot = a,
  26186. 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)
  26187. }
  26188. h.sortPanoTiles = function(e, t, i) {
  26189. y._panoSpaceDir.copy(i),
  26190. m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
  26191. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26192. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
  26193. e.sort(y)
  26194. }
  26195. ,
  26196. h.insertSortedPanoTile = function(e, t, i, n) {
  26197. y._panoSpaceDir.copy(n),
  26198. m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
  26199. y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
  26200. y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
  26201. for (var r = -1, o = 0; o < e.length; o++) {
  26202. if (y(t, e[o]) <= 0) {
  26203. r = o;
  26204. break
  26205. }
  26206. }
  26207. if (-1 === r)
  26208. e[e.length] = t;
  26209. else {
  26210. for (var a = e.length; r < a; a--)
  26211. e[a] = e[a - 1];
  26212. e[r] = t
  26213. }
  26214. }
  26215. ,
  26216. h.prototype.setZoomingActive = function(e) {
  26217. e !== this.zoomingActive && (this.zoomingActive = e)
  26218. }
  26219. ,
  26220. C.exports = h
  26221. }
  26222. ).call(this, "/js/tile/TilePrioritizer.js")
  26223. }
  26224. , {
  26225. "../enum/DownloadStatus": 24,
  26226. "../enum/GLCubeFaces": 25,
  26227. "../enum/ModelManagerEvents": 33,
  26228. "../enum/PanoSizeClass": 36,
  26229. "../enum/Vectors": 50,
  26230. "../enum/Viewmode": 51,
  26231. "../objects/Panorama": 148,
  26232. "../settings": 166,
  26233. "../util/browser": 182,
  26234. "../util/logger": 189,
  26235. "../util/math": 190,
  26236. "./TileUtils": 174,
  26237. events: 202,
  26238. three: 217
  26239. }],
  26240. 173: [function(e, t, i) {
  26241. "use strict";
  26242. function f(e, t) {
  26243. this.levels = t,
  26244. this.tileSize = e,
  26245. this.root = null,
  26246. this.allNodes = [],
  26247. function(e) {
  26248. e.root = function e(t, i, n) {
  26249. if (n > t.levels)
  26250. return null;
  26251. var r = new a(t,i);
  26252. t.allNodes.push(r);
  26253. for (var o = 0; o < s; o++)
  26254. r.children[o] = e(t, r, n + 1);
  26255. return r
  26256. }(e, null, 0)
  26257. }(this)
  26258. }
  26259. function a(e, t) {
  26260. this.tree = e,
  26261. this.parent = t,
  26262. this.children = [],
  26263. this.id = ++n
  26264. }
  26265. var g = (e("three"),
  26266. e("./TileUtils"),
  26267. e("../objects/Panorama"),
  26268. e("../util/panorama"),
  26269. e("events").EventEmitter,
  26270. 2)
  26271. , s = g * g;
  26272. f.TraversalType = Object.freeze({
  26273. PreOrder: 0,
  26274. PostOrder: 1
  26275. });
  26276. var n = 0;
  26277. f.getLevelCountForSize = function(e, t) {
  26278. var i = 0;
  26279. for (t < e && (t = e); !((t /= g) < e); )
  26280. i++;
  26281. return i
  26282. }
  26283. ,
  26284. f.getSizeForLevel = function(e, t) {
  26285. return Math.pow(g, t) * e
  26286. }
  26287. ,
  26288. f.prototype.getSubNode = function(e, t, i) {
  26289. (!t || e < this.tileSize) && (t = 0),
  26290. (!i || e < this.tileSize) && (i = 0),
  26291. e < this.tileSize && (e = this.tileSize);
  26292. var n = f.getLevelCountForSize(this.tileSize, e);
  26293. return function e(t, i, n, r, o) {
  26294. if (!t)
  26295. return null;
  26296. if (0 === n)
  26297. return t;
  26298. if (!t.children || 0 === t.children.length)
  26299. return null;
  26300. var a = Math.pow(g, n) / g
  26301. , s = r % a
  26302. , l = o % a
  26303. , c = Math.floor(o / a)
  26304. , h = Math.floor(r / a)
  26305. , u = c * g + h;
  26306. return e(t.children[u], i + 1, n - 1, s, l)
  26307. }(this.root, 0, n, t, i)
  26308. }
  26309. ,
  26310. f.prototype.breadthFirst = function(e) {
  26311. var t = !!(e = e || {}).nullLevelEnd
  26312. , i = e.maxLevel
  26313. , n = e.minLevel
  26314. , r = e.callback
  26315. , o = e.saveVisited
  26316. , a = []
  26317. , s = {}
  26318. , l = 0;
  26319. for (a.push(this.root),
  26320. a.push(s); 0 < a.length && !(i && i < l); ) {
  26321. var c = a.shift();
  26322. if (c === s)
  26323. (!n || n <= l) && (r && t && r(null),
  26324. o && t && o.push(null)),
  26325. 0 < a.length && a.push(s),
  26326. l++,
  26327. 0;
  26328. else {
  26329. if (c.children)
  26330. for (var h = 0; h < c.children.length; h++) {
  26331. c.children[h] && a.push(c.children[h])
  26332. }
  26333. var u = this.getFaceIndexFromNode(c);
  26334. (!n || n <= l) && (r && r(c, l, u),
  26335. o && o.push(c)),
  26336. 0
  26337. }
  26338. }
  26339. }
  26340. ,
  26341. f.prototype.getFaceIndexFromNode = function(e) {
  26342. if (!e)
  26343. return -1;
  26344. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26345. var o = i.parent;
  26346. if (!o)
  26347. break;
  26348. for (var a = -1, s = 0; s < o.children.length; s++)
  26349. o.children[s] === i && (a = s);
  26350. n = a % g * t + n,
  26351. r = Math.floor(a / g) * t + r,
  26352. t *= g,
  26353. i = o
  26354. }
  26355. return r * t + n
  26356. }
  26357. ,
  26358. f.prototype.depthFirst = function(e, t, i) {
  26359. !function e(t, i, n, r, o, a, s, l) {
  26360. if (t) {
  26361. s = s || f.TraversalType.PreOrder;
  26362. var c = r * g + n;
  26363. if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
  26364. a && a.push(t)),
  26365. t.children && 0 !== t.children.length) {
  26366. for (var h = r * g, u = n * g, d = 0; d < g; d++)
  26367. for (var p = 0; p < g; p++)
  26368. e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
  26369. s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
  26370. a && a.push(t))
  26371. }
  26372. }
  26373. }(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26374. }
  26375. ,
  26376. t.exports = f
  26377. }
  26378. , {
  26379. "../objects/Panorama": 148,
  26380. "../util/panorama": 191,
  26381. "./TileUtils": 174,
  26382. events: 202,
  26383. three: 217
  26384. }],
  26385. 174: [function(e, t, i) {
  26386. "use strict";
  26387. var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
  26388. b.TILE_SIZE = 512,
  26389. b.FACES_PER_PANO = 6,
  26390. b.LocationOnTile = {
  26391. Center: 0,
  26392. UpperLeft: 1,
  26393. UpperRight: 2,
  26394. LowerRight: 3,
  26395. LowerLeft: 4
  26396. },
  26397. b.getTileVector = function(e, t, i, n, r, o, a, s) {
  26398. var l = e / t
  26399. , c = t / e * 2
  26400. , h = c / 2
  26401. , u = n / l * 2 - 1 + h
  26402. , d = (r = l - 1 - r) / l * 2 - 1 + h;
  26403. switch (o = o || b.LocationOnTile.Center) {
  26404. case b.LocationOnTile.UpperLeft:
  26405. u -= h,
  26406. d += h,
  26407. u += a * c;
  26408. break;
  26409. case b.LocationOnTile.UpperRight:
  26410. u += h,
  26411. d += h,
  26412. d -= a * c;
  26413. break;
  26414. case b.LocationOnTile.LowerRight:
  26415. u += h,
  26416. d -= h,
  26417. u -= a * c;
  26418. break;
  26419. case b.LocationOnTile.LowerLeft:
  26420. u -= h,
  26421. d -= h,
  26422. d += a * c;
  26423. break;
  26424. case b.LocationOnTile.Center:
  26425. }
  26426. switch (i) {
  26427. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26428. _.setVector(s, -1, d, -u);
  26429. break;
  26430. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26431. _.setVector(s, 1, d, u);
  26432. break;
  26433. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26434. _.setVector(s, -u, 1, -d);
  26435. break;
  26436. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26437. _.setVector(s, -u, -1, d);
  26438. break;
  26439. case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26440. _.setVector(s, -u, d, 1);
  26441. break;
  26442. case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26443. _.setVector(s, u, d, -1)
  26444. }
  26445. _.normalize(s)
  26446. }
  26447. ,
  26448. b.getFaceForTile = function(e, t) {
  26449. var i = b.TILE_SIZE;
  26450. e < b.TILE_SIZE && (i = e);
  26451. var n = Math.floor(e / i)
  26452. , r = n * n;
  26453. return Math.floor(t / r)
  26454. }
  26455. ,
  26456. b.getTileLocation = function(e, t, i) {
  26457. var n = b.TILE_SIZE;
  26458. e < b.TILE_SIZE && (n = e);
  26459. var r = b.getFaceForTile(e, t)
  26460. , o = Math.floor(e / n)
  26461. , a = t - r * (o * o);
  26462. i.tileX = a % o,
  26463. i.tileY = Math.floor(a / o),
  26464. i.face = r,
  26465. i.faceTileIndex = a
  26466. }
  26467. ,
  26468. b.getTileCountForSize = function(e) {
  26469. if (e <= b.TILE_SIZE)
  26470. return b.FACES_PER_PANO;
  26471. var t = Math.floor(e / b.TILE_SIZE);
  26472. return t * t * b.FACES_PER_PANO
  26473. }
  26474. ,
  26475. b.getRelativeDirection = (r = new _.Matrix4,
  26476. o = new _.Quaternion,
  26477. function(e, t) {
  26478. o.copy(e),
  26479. o.inverse(),
  26480. r.makeRotationFromQuaternion(o),
  26481. r.applyToVector3(t),
  26482. _.normalize(t)
  26483. }
  26484. ),
  26485. b.matchingTilesInDirection = (c = new _.Vector3,
  26486. h = new _.Vector3(0,0,-1),
  26487. u = new _.Quaternion,
  26488. l = {
  26489. face: -1,
  26490. faceTileIndex: -1,
  26491. tileX: -1,
  26492. tileY: -1
  26493. },
  26494. d = function(e, t, i) {
  26495. for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
  26496. b.getTileLocation(e, o, l),
  26497. t && !t(l) || (r++,
  26498. i && (a = l,
  26499. i.push({
  26500. face: a.face,
  26501. faceTileIndex: a.faceTileIndex,
  26502. tileX: a.tileX,
  26503. tileY: a.tileY
  26504. })));
  26505. var a;
  26506. return r
  26507. }
  26508. ,
  26509. function(e, t, i, n, r, o) {
  26510. var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
  26511. if (b.getTileCountForSize(t),
  26512. !n && !r)
  26513. return d(t, null, o);
  26514. var s = !!r;
  26515. return r = r || n,
  26516. r = Math.max(0, Math.min(r, 360)),
  26517. n = Math.max(0, Math.min(n, 360)),
  26518. _.copyVector(i, c),
  26519. b.getRelativeDirection(e.quaternion, c),
  26520. s ? (u.setFromUnitVectors(c, h),
  26521. d(t, function(e) {
  26522. return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
  26523. }, o)) : d(t, function(e) {
  26524. return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
  26525. }, o)
  26526. }
  26527. ),
  26528. b.isTileWithinFrustum = (E = new _.Vector3,
  26529. function(e, t, i, n, r, o, a, s) {
  26530. 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++)
  26531. if (b.getTileVector(e, t, d, n, r, y, 0, E),
  26532. _.applyQuaternionToVector(o, E),
  26533. -1e-5 <= E.z)
  26534. ;
  26535. else {
  26536. var A = -1 / E.z
  26537. , C = E.x * A
  26538. , I = E.y * A;
  26539. l < I ? p++ : I < c && f++,
  26540. h < C ? g++ : C < u && m++,
  26541. v++
  26542. }
  26543. return f !== v && p !== v && g !== v && m !== v
  26544. }
  26545. ),
  26546. b.isTileWithinFOV = (p = new _.Vector3,
  26547. f = new _.Vector3(0,1,0),
  26548. g = new _.Vector3(1,0,0),
  26549. function(e, t, i, n, r, o, a) {
  26550. var s = b.mapFaceToCubemapFace(i);
  26551. if (_.cross(o, f, g),
  26552. b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
  26553. b.isWithinFOV(p, o, a, null))
  26554. return !0;
  26555. for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
  26556. for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
  26557. if (b.getTileVector(e, t, s, n, r, d, h, p),
  26558. b.isWithinFOV(p, o, a, null))
  26559. return !0;
  26560. h += l
  26561. }
  26562. return !1
  26563. }
  26564. ),
  26565. b.isWithinFOV = (a = new _.Vector3,
  26566. s = new _.Vector3,
  26567. function(e, t, i, n) {
  26568. if (_.copyVector(e, s),
  26569. n) {
  26570. _.copyVector(n, a),
  26571. _.normalize(a);
  26572. var r = _.dot(a, e);
  26573. a.x *= r,
  26574. a.y *= r,
  26575. a.z *= r,
  26576. _.subVector(s, a)
  26577. }
  26578. var o = i / 2 * _.RADIANS_PER_DEGREE;
  26579. return Math.cos(o) <= _.dot(s, t)
  26580. }
  26581. ),
  26582. b.mapFaceToCubemapFace = (n = {
  26583. 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  26584. 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  26585. 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  26586. 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  26587. 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  26588. 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  26589. },
  26590. function(e) {
  26591. return n[e]
  26592. }
  26593. ),
  26594. t.exports = b
  26595. }
  26596. , {
  26597. "../enum/GLCubeFaces": 25,
  26598. "../util/MathLight": 176
  26599. }],
  26600. 175: [function(i, n, e) {
  26601. (function(e) {
  26602. "use strict";
  26603. function t() {
  26604. this.list = [],
  26605. this.index = {},
  26606. Object.defineProperty(this, "length", {
  26607. get: function() {
  26608. return this.list.length
  26609. }
  26610. })
  26611. }
  26612. new (i("./common"),
  26613. i("./logger"))(e),
  26614. t.prototype.forEach = function(e) {
  26615. this.list.forEach(e)
  26616. }
  26617. ,
  26618. t.prototype.add = function(e) {
  26619. this.list.push(e),
  26620. this.index[this.getIndex(e)] = e
  26621. }
  26622. ,
  26623. t.prototype.getIndex = function(e) {
  26624. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  26625. }
  26626. ,
  26627. t.prototype.extend = function(e) {
  26628. for (var t = 0; t < e.length; t++)
  26629. this.add(e[t])
  26630. }
  26631. ,
  26632. t.prototype.get = function(e) {
  26633. return this.index[e]
  26634. }
  26635. ,
  26636. t.prototype.first = function() {
  26637. return this.list[0]
  26638. }
  26639. ,
  26640. t.prototype.last = function() {
  26641. return this.list[this.list.length - 1]
  26642. }
  26643. ,
  26644. t.prototype.reIndex = function() {
  26645. this.index = {};
  26646. var t = this;
  26647. this.forEach(function(e) {
  26648. t.index[t.getIndex(e)] = e
  26649. })
  26650. }
  26651. ,
  26652. t.prototype.filter = function(e) {
  26653. var t = this.list.filter(e);
  26654. return this.reIndex(),
  26655. t
  26656. }
  26657. ,
  26658. t.prototype.reduce = function(e, t) {
  26659. return this.list.reduce(e, t)
  26660. }
  26661. ,
  26662. t.prototype.sort = function(e) {
  26663. return this.list.sort(e)
  26664. }
  26665. ,
  26666. t.prototype.indexOf = function(e) {
  26667. for (var t = 0; t < this.list.length; ++t)
  26668. if (this.list[t] === e)
  26669. return t;
  26670. return -1
  26671. }
  26672. ,
  26673. n.exports = t
  26674. }
  26675. ).call(this, "/js/util/IndexedCollection.js")
  26676. }
  26677. , {
  26678. "./common": 185,
  26679. "./logger": 189
  26680. }],
  26681. 176: [function(e, t, i) {
  26682. "use strict";
  26683. e("../constants");
  26684. var n, r, o = {};
  26685. o.RADIANS_PER_DEGREE = Math.PI / 180,
  26686. o.DEGREES_PER_RADIAN = 180 / Math.PI,
  26687. o.Vector3 = function(e, t, i) {
  26688. this.x = e || 0,
  26689. this.y = t || 0,
  26690. this.z = i || 0
  26691. }
  26692. ,
  26693. o.Matrix4 = function() {
  26694. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  26695. 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  26696. }
  26697. ,
  26698. o.Matrix4.prototype = {
  26699. identity: function() {
  26700. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  26701. this
  26702. },
  26703. copy: function(e) {
  26704. return this.elements.set(e.elements),
  26705. this
  26706. },
  26707. applyToVector3: function(e) {
  26708. var t = e.x
  26709. , i = e.y
  26710. , n = e.z
  26711. , r = this.elements;
  26712. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  26713. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  26714. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  26715. this
  26716. },
  26717. getInverse: function(e, t) {
  26718. var i = this.elements
  26719. , n = e.elements
  26720. , r = n[0]
  26721. , o = n[1]
  26722. , a = n[2]
  26723. , s = n[3]
  26724. , l = n[4]
  26725. , c = n[5]
  26726. , h = n[6]
  26727. , u = n[7]
  26728. , d = n[8]
  26729. , p = n[9]
  26730. , f = n[10]
  26731. , g = n[11]
  26732. , m = n[12]
  26733. , v = n[13]
  26734. , y = n[14]
  26735. , A = n[15]
  26736. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  26737. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  26738. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  26739. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  26740. , b = r * C + o * I + a * E + s * _;
  26741. if (0 == b) {
  26742. var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  26743. if (t)
  26744. throw new Error(w);
  26745. return console.warn(w),
  26746. this.identity()
  26747. }
  26748. var T = 1 / b;
  26749. return i[0] = C * T,
  26750. i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
  26751. i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
  26752. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  26753. i[4] = I * T,
  26754. i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
  26755. i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
  26756. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  26757. i[8] = E * T,
  26758. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
  26759. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
  26760. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  26761. i[12] = _ * T,
  26762. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
  26763. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
  26764. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  26765. this
  26766. },
  26767. makeRotationFromQuaternion: function(e) {
  26768. var t = this.elements
  26769. , i = e.x
  26770. , n = e.y
  26771. , r = e.z
  26772. , o = e.w
  26773. , a = i + i
  26774. , s = n + n
  26775. , l = r + r
  26776. , c = i * a
  26777. , h = i * s
  26778. , u = i * l
  26779. , d = n * s
  26780. , p = n * l
  26781. , f = r * l
  26782. , g = o * a
  26783. , m = o * s
  26784. , v = o * l;
  26785. return t[0] = 1 - (d + f),
  26786. t[4] = h - v,
  26787. t[8] = u + m,
  26788. t[1] = h + v,
  26789. t[5] = 1 - (c + f),
  26790. t[9] = p - g,
  26791. t[2] = u - m,
  26792. t[6] = p + g,
  26793. t[10] = 1 - (c + d),
  26794. t[3] = 0,
  26795. t[7] = 0,
  26796. t[11] = 0,
  26797. t[12] = 0,
  26798. t[13] = 0,
  26799. t[14] = 0,
  26800. t[15] = 1,
  26801. this
  26802. }
  26803. },
  26804. o.Quaternion = function(e, t, i, n) {
  26805. this._x = e || 0,
  26806. this._y = t || 0,
  26807. this._z = i || 0,
  26808. this._w = void 0 !== n ? n : 1
  26809. }
  26810. ,
  26811. o.Quaternion.prototype = {
  26812. get x() {
  26813. return this._x
  26814. },
  26815. set x(e) {
  26816. this._x = e
  26817. },
  26818. get y() {
  26819. return this._y
  26820. },
  26821. set y(e) {
  26822. this._y = e
  26823. },
  26824. get z() {
  26825. return this._z
  26826. },
  26827. set z(e) {
  26828. this._z = e
  26829. },
  26830. get w() {
  26831. return this._w
  26832. },
  26833. set w(e) {
  26834. this._w = e
  26835. },
  26836. copy: function(e) {
  26837. this._x = e.x,
  26838. this._y = e.y,
  26839. this._z = e.z,
  26840. this._w = e.w
  26841. },
  26842. inverse: function() {
  26843. return this.conjugate().normalize()
  26844. },
  26845. conjugate: function() {
  26846. return this._x *= -1,
  26847. this._y *= -1,
  26848. this._z *= -1,
  26849. this
  26850. },
  26851. length: function() {
  26852. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  26853. },
  26854. normalize: function() {
  26855. var e = this.length();
  26856. return 0 === e ? (this._x = 0,
  26857. this._y = 0,
  26858. this._z = 0,
  26859. this._w = 1) : (e = 1 / e,
  26860. this._x = this._x * e,
  26861. this._y = this._y * e,
  26862. this._z = this._z * e,
  26863. this._w = this._w * e),
  26864. this
  26865. },
  26866. setFromAxisAngle: function(e, t) {
  26867. var i = t / 2
  26868. , n = Math.sin(i);
  26869. return this._x = e.x * n,
  26870. this._y = e.y * n,
  26871. this._z = e.z * n,
  26872. this._w = Math.cos(i),
  26873. this
  26874. },
  26875. setFromUnitVectors: function(e, t) {
  26876. return void 0 === n && (n = new o.Vector3),
  26877. (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
  26878. 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),
  26879. this._x = n.x,
  26880. this._y = n.y,
  26881. this._z = n.z,
  26882. this._w = r,
  26883. this.normalize()
  26884. },
  26885. multiply: function(e) {
  26886. return this.multiplyQuaternions(this, e)
  26887. },
  26888. premultiply: function(e) {
  26889. return this.multiplyQuaternions(e, this)
  26890. },
  26891. multiplyQuaternions: function(e, t) {
  26892. var i = e._x
  26893. , n = e._y
  26894. , r = e._z
  26895. , o = e._w
  26896. , a = t._x
  26897. , s = t._y
  26898. , l = t._z
  26899. , c = t._w;
  26900. return this._x = i * c + o * a + n * l - r * s,
  26901. this._y = n * c + o * s + r * a - i * l,
  26902. this._z = r * c + o * l + i * s - n * a,
  26903. this._w = o * c - i * a - n * s - r * l,
  26904. this
  26905. }
  26906. },
  26907. o.convertWorkshopVector = function(e) {
  26908. return new o.Vector3(-e.x,e.y,e.z)
  26909. }
  26910. ,
  26911. o.convertWorkshopQuaternion = function(e) {
  26912. 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))
  26913. }
  26914. ,
  26915. o.convertWorkshopOrthoZoom = function(e) {
  26916. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  26917. }
  26918. ,
  26919. o.convertWorkshopPanoramaQuaternion = function(e) {
  26920. 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))
  26921. }
  26922. ,
  26923. o.normalize = function(e) {
  26924. var t = e.x * e.x + e.y * e.y + e.z * e.z
  26925. , i = Math.sqrt(t);
  26926. e.x /= i,
  26927. e.y /= i,
  26928. e.z /= i
  26929. }
  26930. ,
  26931. o.dot = function(e, t) {
  26932. return e.x * t.x + e.y * t.y + e.z * t.z
  26933. }
  26934. ,
  26935. o.cross = function(e, t, i) {
  26936. var n = e.x
  26937. , r = e.y
  26938. , o = e.z;
  26939. i.x = r * t.z - o * t.y,
  26940. i.y = o * t.x - n * t.z,
  26941. i.z = n * t.y - r * t.x
  26942. }
  26943. ,
  26944. o.setVector = function(e, t, i, n) {
  26945. e.x = t,
  26946. e.y = i,
  26947. e.z = n
  26948. }
  26949. ,
  26950. o.copyVector = function(e, t) {
  26951. t.x = e.x,
  26952. t.y = e.y,
  26953. t.z = e.z
  26954. }
  26955. ,
  26956. o.addVector = function(e, t) {
  26957. e.x += t.x,
  26958. e.y += t.y,
  26959. e.z += t.z
  26960. }
  26961. ,
  26962. o.subVector = function(e, t) {
  26963. e.x -= t.x,
  26964. e.y -= t.y,
  26965. e.z -= t.z
  26966. }
  26967. ,
  26968. o.applyQuaternionToVector = function(e, t) {
  26969. var i = t.x
  26970. , n = t.y
  26971. , r = t.z
  26972. , o = e.x
  26973. , a = e.y
  26974. , s = e.z
  26975. , l = e.w
  26976. , c = l * i + a * r - s * n
  26977. , h = l * n + s * i - o * r
  26978. , u = l * r + o * n - a * i
  26979. , d = -o * i - a * n - s * r;
  26980. t.x = c * l + d * -o + h * -s - u * -a,
  26981. t.y = h * l + d * -a + u * -o - c * -s,
  26982. t.z = u * l + d * -s + c * -a - h * -o
  26983. }
  26984. ,
  26985. o.angleBetweenVectors = function(e, t) {
  26986. return Math.acos(o.dot(e, t))
  26987. }
  26988. ,
  26989. t.exports = o
  26990. }
  26991. , {
  26992. "../constants": 8
  26993. }],
  26994. 177: [function(c, h, e) {
  26995. (function(e) {
  26996. "use strict";
  26997. function t(e) {
  26998. this.cache = null,
  26999. this.expires = 0
  27000. }
  27001. function i() {
  27002. this.baseUrl = null,
  27003. this.cache = null,
  27004. this.expires = 0
  27005. }
  27006. function n() {
  27007. this.baseUrl = null,
  27008. this.expires = 0
  27009. }
  27010. function r(e) {
  27011. this.initialLoadingPromise = null,
  27012. this.endpoint = e + "?type=3",
  27013. this.urlContainer = null,
  27014. this.authorizationHeader = s.getAuthorizationHeader(),
  27015. this.containerClasses = [n, i, t]
  27016. }
  27017. c("./ajax");
  27018. var o = c("./logger")
  27019. , a = c("../constants")
  27020. , s = c("./showcase")
  27021. , l = (c("../ab"),
  27022. new o(e));
  27023. t.prototype = {
  27024. version: 1,
  27025. validate: function(e) {
  27026. return "catalog.json"in e && 0 < Object.keys(e).length
  27027. },
  27028. update: function(e) {
  27029. return this.cache = e,
  27030. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27031. $.when()
  27032. },
  27033. get: function(e) {
  27034. return this.cache[e]
  27035. }
  27036. },
  27037. i.prototype = {
  27038. version: 2,
  27039. validate: function(e) {
  27040. return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
  27041. },
  27042. update: function(e) {
  27043. return this.baseUrl = e["base.url"],
  27044. this.cache = e,
  27045. this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27046. $.when()
  27047. },
  27048. get: function(e) {
  27049. var t = this.cache[e];
  27050. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27051. }
  27052. },
  27053. n.prototype = {
  27054. version: 3,
  27055. validate: function(e) {
  27056. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27057. },
  27058. update: function(e) {
  27059. return this.baseUrl = e.templates[0],
  27060. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
  27061. $.when()
  27062. },
  27063. get: function(e) {
  27064. return this.baseUrl.replace("{{filename}}", e)
  27065. }
  27066. },
  27067. r.prototype = {
  27068. init: function() {
  27069. return this.initialLoadingPromise || (setInterval(function() {
  27070. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27071. Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
  27072. this.refresh().done(function() {
  27073. l.debug("Refreshed")
  27074. }).fail(function() {
  27075. l.error("Failed url refresh, urls might go stale soon")
  27076. }))
  27077. }
  27078. .bind(this), a.signedUrlCheckInterval),
  27079. this.initialLoadingPromise = this.refresh()),
  27080. this.initialLoadingPromise
  27081. },
  27082. refresh: function(e) {
  27083. return {},
  27084. $.Deferred().resolve()
  27085. },
  27086. get: function(e) {
  27087. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  27088. }
  27089. },
  27090. h.exports = r
  27091. }
  27092. ).call(this, "/js/util/ModelUrls.js")
  27093. }
  27094. , {
  27095. "../ab": 3,
  27096. "../constants": 8,
  27097. "./ajax": 181,
  27098. "./logger": 189,
  27099. "./showcase": 193
  27100. }],
  27101. 178: [function(l, c, e) {
  27102. (function(e) {
  27103. "use strict";
  27104. function t() {
  27105. i.call(this),
  27106. this.neighbourMap = {},
  27107. this.map = null
  27108. }
  27109. 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"),
  27110. l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
  27111. n.inherit(t, i),
  27112. t.prototype.getIndex = function(e) {
  27113. return e.id
  27114. }
  27115. ,
  27116. t.prototype.find = function(e, t) {
  27117. var i = n.filterAll(this.list, e);
  27118. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27119. i = n.stableSort(i, e)
  27120. }),
  27121. i[0])
  27122. }
  27123. ,
  27124. t.prototype.sortByScore = function(e, t) {
  27125. var i = n.filterAll(this.list, e);
  27126. return 0 === i.length ? null : i = i.map(function(i) {
  27127. return {
  27128. pano: i,
  27129. score: t.reduce(function(e, t) {
  27130. return e + t(i)
  27131. }, 0)
  27132. }
  27133. }).sort(function(e, t) {
  27134. return t.score - e.score
  27135. })
  27136. }
  27137. ,
  27138. t.prototype.lowestByScore = function(e, t, i) {
  27139. return this.findRankedByScore(0, e, t, i)
  27140. }
  27141. ,
  27142. t.prototype.findRankedByScore = function(e, t, i, n) {
  27143. n && (n.candidates = null,
  27144. n.pano = null),
  27145. e = e || 0;
  27146. var r = this.sortByScore(t, i);
  27147. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27148. n.pano = r[e].pano),
  27149. r[e].pano)
  27150. }
  27151. ,
  27152. t.prototype.showPanoScores = function(e) {
  27153. this.list.forEach(function(e) {
  27154. e.removeTextSprite()
  27155. });
  27156. var t = 6344768;
  27157. e.forEach(function(e) {
  27158. e.pano.addTextSprite(e.score.toFixed(2), t),
  27159. t = 16428055
  27160. })
  27161. }
  27162. ,
  27163. t.prototype.isNeighbour = function(e, t) {
  27164. return this.neighbourMap[e.id][t.id]
  27165. }
  27166. ,
  27167. t.prototype.getNeighbours = function(e) {
  27168. return this.neighbourMap[e.id]
  27169. }
  27170. ,
  27171. t.prototype.setNeighbour = function(e, t, i) {
  27172. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27173. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27174. this.neighbourMap[e.id][e.id] = !0,
  27175. this.neighbourMap[t.id][t.id] = !0,
  27176. this.neighbourMap[e.id][t.id] = i,
  27177. this.neighbourMap[t.id][e.id] = i,
  27178. this.neighbourMap[e.id]
  27179. }
  27180. ,
  27181. t.prototype.findClosest = function(e, t) {
  27182. var i = [r.filters.isPanoAligned()];
  27183. return t && i.push(r.filters.inDirection(e, t, .75)),
  27184. this.find(i, [r.sortFunctions.distanceToPoint(e)])
  27185. }
  27186. ,
  27187. t.prototype.dualNeighbors = function(e, t) {
  27188. var i, n = [];
  27189. for (i in this.neighbourMap[e.id])
  27190. this.neighbourMap[t.id][i] && n.push(i);
  27191. return n
  27192. }
  27193. ,
  27194. t.prototype.populate_path_graph = function() {
  27195. var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
  27196. for (e = 0; e < this.list.length; e += 1) {
  27197. for (t in s = !(a = {}),
  27198. i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
  27199. if (i[t]) {
  27200. o = this.index[t],
  27201. u.copy(r.floorPosition),
  27202. u.sub(o.floorPosition);
  27203. var d = Math.sqrt(u.x * u.x + u.z * u.z)
  27204. , p = (Math.abs(u.y),
  27205. Math.max(d, .01),
  27206. Math.max(0, Math.abs(u.y) - .2));
  27207. n = 0 < p ? (1,
  27208. p = Math.pow(4 * p, 2),
  27209. d = Math.pow(d, 2),
  27210. Math.sqrt(p * p + d * d)) : (1,
  27211. u.length()),
  27212. a[o.id] = n,
  27213. s = !0
  27214. }
  27215. s ? c[r.id] = a : h += 1
  27216. }
  27217. this.map = c,
  27218. T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
  27219. }
  27220. ,
  27221. t.prototype.aStarSearch = function(e, t) {
  27222. var i = Date.now()
  27223. , n = new o({
  27224. start: e,
  27225. isEnd: function(e) {
  27226. return e === t
  27227. },
  27228. neighbor: function(e) {
  27229. var t = e.neighbourPanos || e.findNeighourPanos()
  27230. , i = [];
  27231. for (var n in t)
  27232. i.push(this.index[n]);
  27233. return i
  27234. }
  27235. .bind(this),
  27236. distance: function(e, t) {
  27237. return this.map[e.id][t.id]
  27238. }
  27239. .bind(this),
  27240. heuristic: function(e, t) {
  27241. return 1
  27242. }
  27243. .bind(this),
  27244. hash: function(e) {
  27245. return e.id
  27246. },
  27247. timeout: 5e3
  27248. });
  27249. if (T.debug("A* search in " + (Date.now() - i) + "ms"),
  27250. "success" !== n.status)
  27251. return T.debug("Did not find A* path from " + e + " to " + t),
  27252. null;
  27253. T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27254. var r = [];
  27255. return n.path.forEach(function(e) {
  27256. r.push(e.id)
  27257. }),
  27258. r
  27259. }
  27260. ,
  27261. t.prototype.includeNodesNearPath = (f = new w.Vector3,
  27262. g = new w.Vector3,
  27263. m = new w.Vector3,
  27264. v = new w.Vector3,
  27265. y = new w.Vector3,
  27266. A = new w.Vector3,
  27267. C = new w.Vector3,
  27268. I = new w.Vector3,
  27269. E = [],
  27270. _ = new w.Vector3,
  27271. b = new w.Vector3,
  27272. function(e, t) {
  27273. if (e)
  27274. for (var i = function(e, t, i) {
  27275. return y.copy(t).sub(e),
  27276. y.dot(i)
  27277. }, n = function(e, t) {
  27278. return i(_, e.position, m) - i(_, t.position, m)
  27279. }, r = 0; r < e.length - 1; ) {
  27280. var o = e[r]
  27281. , a = e[r + 1]
  27282. , s = this.index[o]
  27283. , l = this.index[a];
  27284. _.copy(s.position),
  27285. b.copy(l.position),
  27286. E.length = 0,
  27287. f.copy(b).sub(_),
  27288. m.copy(f).normalize();
  27289. for (var c = 0; c < this.list.length; c++) {
  27290. var h = this.list[c];
  27291. y.copy(h.position).sub(_);
  27292. var u = y.dot(m);
  27293. 0 < u && (C.copy(m),
  27294. C.multiplyScalar(u),
  27295. A.copy(y),
  27296. A.sub(C),
  27297. A.length() < t && (g.copy(f).negate(),
  27298. v.copy(g).normalize(),
  27299. I.copy(h.position).sub(b),
  27300. 0 < I.dot(v) && E.push(h)))
  27301. }
  27302. if (0 < E.length) {
  27303. E.sort(n);
  27304. for (var d = e.length + E.length - 1; d >= r + E.length; d--)
  27305. e[d] = e[d - E.length];
  27306. for (var p = 0; p < E.length; p++)
  27307. e[p + r + 1] = E[p].id
  27308. }
  27309. r += E.length + 1
  27310. }
  27311. }
  27312. ),
  27313. t.prototype.fadeMarkerOpacity = function(e, t) {
  27314. var i = void 0 === e ? a.panorama.markerOpacity : e
  27315. , n = this.list.findIndex(function(e) {
  27316. return e.marker
  27317. });
  27318. if (!(n < 0)) {
  27319. var r = this.list[n].marker.material.opacity;
  27320. if (r !== e) {
  27321. var o = i - r;
  27322. s.trigger({
  27323. func: function(e, t) {
  27324. var i = r + e * o;
  27325. this.forEach(function(e) {
  27326. e.marker && (e.marker.material.opacity = i)
  27327. })
  27328. }
  27329. .bind(this),
  27330. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27331. name: "_fpm"
  27332. })
  27333. }
  27334. }
  27335. }
  27336. ,
  27337. c.exports = t
  27338. }
  27339. ).call(this, "/js/util/PanoramaCollection.js")
  27340. }
  27341. , {
  27342. "../objects/Panorama": 148,
  27343. "../settings": 166,
  27344. "./IndexedCollection": 175,
  27345. "./aStar": 180,
  27346. "./common": 185,
  27347. "./logger": 189,
  27348. "./transitions": 195,
  27349. three: 217
  27350. }],
  27351. 179: [function(e, t, i) {
  27352. "use strict";
  27353. function n() {
  27354. this.actionSequence = [],
  27355. this.actionSequenceInProgress = !1
  27356. }
  27357. function r(e, t, i, n) {
  27358. c.trackAlways("zoom_" + e, {
  27359. from: t,
  27360. to: i,
  27361. pano: n
  27362. })
  27363. }
  27364. var o, a, s, l, c = e("../analytics");
  27365. n.prototype.reset = function(e) {
  27366. this.actionSequenceInProgress = !1,
  27367. this.actionSequence.length = 0
  27368. }
  27369. ,
  27370. n.prototype.addZoomAction = (a = o = null,
  27371. s = !1,
  27372. l = function() {
  27373. if (o = null,
  27374. 0 < this.actionSequence.length) {
  27375. var e = this.actionSequence[0].start
  27376. , t = this.actionSequence[this.actionSequence.length - 1].end;
  27377. 1 === e ? function(e, t) {
  27378. r("initial", 1, e, t)
  27379. }(t, a) : function(e, t, i) {
  27380. r("followup", e, t, i)
  27381. }(e, t, a)
  27382. }
  27383. this.reset()
  27384. }
  27385. ,
  27386. function(e, t, i) {
  27387. if (e !== t) {
  27388. s || (l = l.bind(this),
  27389. s = !0),
  27390. o && (window.clearTimeout(o),
  27391. o = null),
  27392. i === a && this.actionSequenceInProgress || (this.reset(),
  27393. a = i),
  27394. this.actionSequenceInProgress = !0;
  27395. var n = {
  27396. start: e,
  27397. end: t
  27398. };
  27399. this.actionSequence.push(n),
  27400. o = window.setTimeout(l, 150)
  27401. }
  27402. }
  27403. ),
  27404. t.exports = n
  27405. }
  27406. , {
  27407. "../analytics": 4
  27408. }],
  27409. 180: [function(e, t, i) {
  27410. "use strict";
  27411. function g(e) {
  27412. if (void 0 === e.parent)
  27413. return [e.data];
  27414. var t = g(e.parent);
  27415. return t.push(e.data),
  27416. t
  27417. }
  27418. function m(e) {
  27419. return e.toString()
  27420. }
  27421. function v(e, t) {
  27422. return e.f - t.f
  27423. }
  27424. var y = e("Set")
  27425. , A = e("heap")
  27426. , C = e("dict");
  27427. t.exports = function(e) {
  27428. void 0 === e.timeout && (e.timeout = 1 / 0);
  27429. var t = e.hash || m
  27430. , i = {
  27431. data: e.start,
  27432. g: 0,
  27433. h: e.heuristic(e.start)
  27434. }
  27435. , n = i;
  27436. i.f = i.h;
  27437. var r = new y
  27438. , o = new A(v)
  27439. , a = C();
  27440. o.push(i),
  27441. a.set(t(i.data), i);
  27442. for (var s = new Date; o.size(); ) {
  27443. if (new Date - s > e.timeout)
  27444. return {
  27445. status: "timeout",
  27446. cost: n.g,
  27447. path: g(n)
  27448. };
  27449. var l = o.pop();
  27450. if (a.delete(t(l.data)),
  27451. e.isEnd(l.data))
  27452. return {
  27453. status: "success",
  27454. cost: l.g,
  27455. path: g(l)
  27456. };
  27457. r.add(t(l.data));
  27458. for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
  27459. var u = c[h];
  27460. if (!r.contains(t(u))) {
  27461. var d = l.g + e.distance(l.data, u)
  27462. , p = a.get(t(u))
  27463. , f = !1;
  27464. if (void 0 === p)
  27465. p = {
  27466. data: u
  27467. },
  27468. a.set(t(u), p);
  27469. else {
  27470. if (p.g < d)
  27471. continue;
  27472. f = !0
  27473. }
  27474. p.parent = l,
  27475. p.g = d,
  27476. p.h = e.heuristic(u),
  27477. p.f = d + p.h,
  27478. p.h < n.h && (n = p),
  27479. f ? o.heapify() : o.push(p)
  27480. }
  27481. }
  27482. }
  27483. return {
  27484. status: "noPath",
  27485. cost: n.g,
  27486. path: g(n)
  27487. }
  27488. }
  27489. }
  27490. , {
  27491. Set: 196,
  27492. dict: 210,
  27493. heap: 211
  27494. }],
  27495. 181: [function(i, n, e) {
  27496. (function(e) {
  27497. "use strict";
  27498. function s(e, t, i) {
  27499. function n() {
  27500. l.warn("Retrying ", t),
  27501. s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
  27502. }
  27503. var r = function(e, t, i) {
  27504. var n = new XMLHttpRequest;
  27505. if (i && "withCredentials"in n)
  27506. n.open(e, t, i);
  27507. else if ("undefined" != typeof XDomainRequest)
  27508. (n = new XDomainRequest).open(e, t);
  27509. else {
  27510. if (i)
  27511. throw "Browser does not support CORS!";
  27512. n.open(e, t)
  27513. }
  27514. return n
  27515. }(e, t, !1);
  27516. if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
  27517. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  27518. i.responseType)
  27519. if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
  27520. r.responseType = i.responseType;
  27521. else {
  27522. if ("image/jpeg" !== i.responseType)
  27523. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  27524. r.responseType = "arraybuffer"
  27525. }
  27526. if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
  27527. i.auth && r.setRequestHeader("Authorization", i.auth),
  27528. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  27529. r.setRequestHeader("Content-Type", "application/json")),
  27530. "object" == typeof i.headers)
  27531. for (var o in i.headers)
  27532. r.setRequestHeader(o, i.headers[o]);
  27533. var a = $.Deferred();
  27534. return r.onreadystatechange = function(e) {
  27535. if (4 === this.readyState)
  27536. if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
  27537. i.retries++,
  27538. setTimeout(n, 1e3);
  27539. else if (200 === this.status) {
  27540. var t = function(e, t) {
  27541. var i = e.response;
  27542. if ("json" === t && "object" != typeof i)
  27543. try {
  27544. i = JSON.parse(e.responseText)
  27545. } catch (e) {
  27546. return void a.reject({
  27547. error: "Failed parsing JSON"
  27548. })
  27549. }
  27550. else if ("image/jpeg" === t) {
  27551. var n = new Uint8Array(e.response)
  27552. , r = new Blob([n],{
  27553. type: "image/jpeg"
  27554. })
  27555. , o = URL.createObjectURL(r);
  27556. (i = new Image).src = o,
  27557. i.crossOrigin = "Anonymous",
  27558. i.onload = function() {
  27559. URL.revokeObjectURL(o)
  27560. }
  27561. }
  27562. return i
  27563. }(this, i.responseType);
  27564. a.resolve(t)
  27565. } else
  27566. a.reject(this)
  27567. }
  27568. ,
  27569. r.onprogress = function(e) {
  27570. a.notify(e)
  27571. }
  27572. ,
  27573. r.send(i.data),
  27574. a.promise()
  27575. }
  27576. function o(e, t) {
  27577. var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
  27578. return t.headers && function(t) {
  27579. return Object.keys(t).sort().map(function(e) {
  27580. return {
  27581. key: e,
  27582. value: t[e]
  27583. }
  27584. })
  27585. }(t.headers).forEach(function(e) {
  27586. i += "__" + e.key + ":" + e.value
  27587. }),
  27588. i
  27589. }
  27590. var t = i("./logger")
  27591. , a = i("../ab")
  27592. , l = new t(e);
  27593. window.URL = window.URL || window.webkitURL,
  27594. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  27595. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {},
  27596. n.exports = {
  27597. get: function(e, t) {
  27598. var i, n = void 0 === (t = t || {}).cache || t.cache;
  27599. if (n) {
  27600. var r = function(e, t) {
  27601. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
  27602. }(e, t);
  27603. if (r)
  27604. return r
  27605. }
  27606. return i = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : s("GET", e, t),
  27607. n && function(e, t, i) {
  27608. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
  27609. }(e, t, i),
  27610. i
  27611. },
  27612. post: function(e, t) {
  27613. return s("POST", e, t)
  27614. },
  27615. patch: function(e, t) {
  27616. return s("PATCH", e, t)
  27617. },
  27618. getImage: function(e, t) {
  27619. function i() {
  27620. l.warn("Retrying ", e),
  27621. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  27622. }
  27623. var n = $.Deferred()
  27624. , r = new Image
  27625. , o = this;
  27626. return e = a.changeIfImageOptimzing(e),
  27627. null != t || (t = 3),
  27628. r.onerror = function() {
  27629. 0 < t ? setTimeout(i, 1e3) : n.reject()
  27630. }
  27631. ,
  27632. r.onload = function() {
  27633. n.resolve(r)
  27634. }
  27635. ,
  27636. r.crossOrigin = "anonymous",
  27637. r.src = e,
  27638. n
  27639. }
  27640. }
  27641. }
  27642. ).call(this, "/js/util/ajax.js")
  27643. }
  27644. , {
  27645. "../ab": 3,
  27646. "./logger": 189
  27647. }],
  27648. 182: [function(e, t, i) {
  27649. "use strict";
  27650. function n(e, t) {
  27651. var i = window.navigator.userAgent.match(e);
  27652. return i = i ? i[1].split(t) : [],
  27653. {
  27654. major: parseInt(i[0]) || 0,
  27655. minor: parseInt(i[1]) || 0,
  27656. patch: parseInt(i[2]) || 0
  27657. }
  27658. }
  27659. var r = e("../exception/DeviceMismatchException");
  27660. t.exports = {
  27661. isFullscreen: function() {
  27662. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  27663. },
  27664. supportsFullscreen: function() {
  27665. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  27666. },
  27667. isPointerLocked: function() {
  27668. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  27669. },
  27670. requestFullscreen: function(e, t) {
  27671. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  27672. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  27673. },
  27674. requestPointerLock: function() {
  27675. var e;
  27676. if (document.fullscreenElement)
  27677. e = document.fullscreenElement();
  27678. else if (document.mozFullscreenElement)
  27679. e = document.mozFullscreenElement();
  27680. else if (document.mozFullScreenElement)
  27681. e = document.mozFullScreenElement();
  27682. else {
  27683. if (!document.webkitFullscreenElement)
  27684. return;
  27685. e = document.webkitFullscreenElement()
  27686. }
  27687. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  27688. e.requestPointerLock(),
  27689. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  27690. },
  27691. exitPointerLock: function() {
  27692. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  27693. document.exitPointerLock()
  27694. },
  27695. exitFullscreen: function() {
  27696. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  27697. },
  27698. details: function() {
  27699. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  27700. return e ? {
  27701. name: e[1],
  27702. version: parseInt(e[2]),
  27703. platform: navigator.platform
  27704. } : {}
  27705. },
  27706. is: function(e) {
  27707. return this.details() && this.details().name === e
  27708. },
  27709. inIframe: function() {
  27710. return window.parent !== window
  27711. },
  27712. aspectRatio: function() {
  27713. var e = $("#player").width() / $("#player").height();
  27714. return isFinite(e) ? e : 0
  27715. },
  27716. userAgent: function() {
  27717. return window.navigator.userAgent
  27718. },
  27719. isMobile: function() {
  27720. var e = navigator.userAgent || navigator.vendor || window.opera;
  27721. return /(android|bb\d+|meego).+mobile|android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0, 4))
  27722. },
  27723. isLandscape: function() {
  27724. return this.isMobile && 1 < this.aspectRatio()
  27725. },
  27726. isSmallScreen: function() {
  27727. return screen.width / window.devicePixelRatio < 240
  27728. },
  27729. detectIE: function() {
  27730. return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  27731. },
  27732. detectSafari: function() {
  27733. return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
  27734. },
  27735. detectFirefox: function() {
  27736. return -1 !== window.navigator.userAgent.indexOf("Firefox")
  27737. },
  27738. detectChrome: function() {
  27739. return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
  27740. },
  27741. detectOpera: function() {
  27742. return -1 !== window.navigator.userAgent.indexOf("OPR")
  27743. },
  27744. detectIOS: function() {
  27745. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  27746. },
  27747. detectIPad: function() {
  27748. var e = window.navigator.userAgent;
  27749. return /iPad/.test(e)
  27750. },
  27751. detectIPod: function() {
  27752. var e = window.navigator.userAgent;
  27753. return /iPod/.test(e)
  27754. },
  27755. detectIPhone: function() {
  27756. var e = window.navigator.userAgent;
  27757. return /iPhone/.test(e)
  27758. },
  27759. detectAndroid: function() {
  27760. return -1 !== window.navigator.userAgent.indexOf("Android")
  27761. },
  27762. detectAndroidMobile: function() {
  27763. var e = window.navigator.userAgent;
  27764. return this.detectAndroid() && -1 !== e.indexOf("Mobile")
  27765. },
  27766. detectSamsungNative: function() {
  27767. var e = window.navigator.userAgent;
  27768. return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
  27769. },
  27770. detectSamsungS6: function() {
  27771. return -1 !== window.navigator.userAgent.indexOf("SM-G92")
  27772. },
  27773. detectHUAWEI5X: function() {
  27774. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  27775. },
  27776. detectWebVR: function() {
  27777. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  27778. },
  27779. getVRDisplay: function() {
  27780. var t = $.Deferred();
  27781. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
  27782. 1 <= e.length && t.resolve(e[0]),
  27783. t.reject(null)
  27784. }),
  27785. t) : t.reject(null)
  27786. },
  27787. iosVersion: function() {
  27788. if (!this.detectIOS())
  27789. throw new r("Did not detect an iDevice");
  27790. return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
  27791. },
  27792. androidVersion: function() {
  27793. if (!this.detectAndroid())
  27794. throw new r("Did not detect an Android based device");
  27795. return n(/Android ((?:\d+\.?){1,3})/, ".")
  27796. },
  27797. valueFromCookie: function(e, t) {
  27798. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  27799. if (!i)
  27800. return t;
  27801. var n = i[1];
  27802. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  27803. },
  27804. valueFromHash: function(e, t) {
  27805. var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
  27806. if (!i)
  27807. return t;
  27808. var n = i[1];
  27809. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
  27810. }
  27811. }
  27812. }
  27813. , {
  27814. "../exception/DeviceMismatchException": 56
  27815. }],
  27816. 183: [function(i, n, e) {
  27817. (function(e) {
  27818. "use strict";
  27819. var o = i("../controls/serializer")
  27820. , a = i("../util/math")
  27821. , s = i("./browser")
  27822. , l = i("../enum/Viewmode")
  27823. , t = i("../util/logger")
  27824. , c = i("three")
  27825. , h = new t(e);
  27826. n.exports = {
  27827. getStartCameraOptions: function(e, t) {
  27828. var i = function(e) {
  27829. var t = s.valueFromHash("start", "")
  27830. , i = {};
  27831. if ("" !== t) {
  27832. h.debug("Start override found in parameters, trying to parse..."),
  27833. i = function(e) {
  27834. return o.deserialize(e)
  27835. }(t) || {};
  27836. var n = s.valueFromHash("tag", null);
  27837. n && (i.tag = n),
  27838. i.panoId && (i.pano = e.get(i.panoId))
  27839. }
  27840. return i
  27841. }(t);
  27842. if (0 < Object.keys(i).length)
  27843. return i;
  27844. if (e.heroImage)
  27845. i = function(e, t) {
  27846. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  27847. return {};
  27848. var i = {}
  27849. , n = e.heroImage.metadata;
  27850. h.debug("Using start position from thumbnail image"),
  27851. i.position = n.camera_position,
  27852. i.quaternion = n.camera_quaternion;
  27853. try {
  27854. i.mode = l.convertWorkshopModeInt(n.camera_mode),
  27855. i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  27856. } catch (e) {
  27857. h.debug(e.message)
  27858. }
  27859. return i
  27860. }(e, t);
  27861. else if (e.data.camera_start) {
  27862. var n = e.data.camera_start;
  27863. try {
  27864. 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
  27865. i.position = n.camera.position,
  27866. i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
  27867. i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
  27868. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  27869. h.debug("Using camera_start"),
  27870. h.debug("Modeldata pano: ", i.pano.quaternion),
  27871. h.debug("Camera start pano: ", n.pano.quaternion)),
  27872. i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  27873. } catch (e) {
  27874. h.warn(e.message)
  27875. }
  27876. }
  27877. if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
  27878. i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
  27879. i.pano = t.findClosest(i.position),
  27880. i.quaternion = i.pano.quaternion),
  27881. 0 === Object.keys(i).length) {
  27882. var r = t.list[0];
  27883. r && (i.mode = l.PANORAMA,
  27884. i.pano = r,
  27885. i.position = r.position,
  27886. i.quaternion = r.quaternion,
  27887. h.info("Starting at 1st pano " + r.id))
  27888. }
  27889. return i.mode = i.mode || l.DOLLHOUSE,
  27890. i
  27891. }
  27892. }
  27893. }
  27894. ).call(this, "/js/util/camera.js")
  27895. }
  27896. , {
  27897. "../controls/serializer": 14,
  27898. "../enum/Viewmode": 51,
  27899. "../util/logger": 189,
  27900. "../util/math": 190,
  27901. "./browser": 182,
  27902. three: 217
  27903. }],
  27904. 184: [function(e, t, i) {
  27905. "use strict";
  27906. function r(e, t, i) {
  27907. var n = t
  27908. , r = i;
  27909. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
  27910. }
  27911. function o(e, t, i) {
  27912. var n = t
  27913. , r = i;
  27914. return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
  27915. }
  27916. var a = e("./MathLight");
  27917. t.exports = {
  27918. clampVFOV: function(e, t, i, n) {
  27919. return t < r(e, i, n) ? o(t, i, n) : e
  27920. },
  27921. getHFOVForCamera: function(e, t, i) {
  27922. return r(e.fov, t, i)
  27923. },
  27924. getHFOVFromVFOV: r,
  27925. getVFOVFromHFOV: o
  27926. }
  27927. }
  27928. , {
  27929. "./MathLight": 176
  27930. }],
  27931. 185: [function(e, t, i) {
  27932. "use strict";
  27933. var a = e("three");
  27934. t.exports = {
  27935. delayOneFrame: function(e) {
  27936. window.setTimeout(e, 1)
  27937. },
  27938. normalizeUrl: function(e) {
  27939. return e.replace("https://", "http://")
  27940. },
  27941. domainFromUrl: function(e) {
  27942. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  27943. return t ? t[3] : e
  27944. },
  27945. average: function(e, t) {
  27946. if (0 === e.length)
  27947. return null;
  27948. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  27949. i += t ? e[r][t] : e[r],
  27950. n++
  27951. }
  27952. return i / n
  27953. },
  27954. countUnique: function(e) {
  27955. for (var t = {}, i = 0; i < e.length; i++)
  27956. t[e[i]] = 1 + (t[e[i]] || 0);
  27957. return Object.keys(t).length
  27958. },
  27959. averageVectors: function(e, t) {
  27960. var i = new a.Vector3;
  27961. if (0 === e.length)
  27962. return i;
  27963. for (var n = 0, r = 0; r < e.length; r++) {
  27964. var o = t ? e[r][t] : e[r];
  27965. i.add(o),
  27966. n++
  27967. }
  27968. return i.divideScalar(n)
  27969. },
  27970. equalLists: function(e, t) {
  27971. if (e.length !== t.length)
  27972. return !1;
  27973. for (var i = 0; i < e.length; i++)
  27974. if (e[i] !== t[i])
  27975. return !1;
  27976. return !0
  27977. },
  27978. lowerMedian: function(e, t) {
  27979. return 0 === e.length ? null : (t = t || 2,
  27980. e.sort(function(e, t) {
  27981. return e - t
  27982. }),
  27983. e[Math.floor(e.length / t)])
  27984. },
  27985. stableSort: function(e, n) {
  27986. return e.map(function(e, t) {
  27987. return {
  27988. value: e,
  27989. index: t
  27990. }
  27991. }).sort(function(e, t) {
  27992. var i = n(e.value, t.value);
  27993. return 0 !== i ? i : e.index - t.index
  27994. }).map(function(e) {
  27995. return e.value
  27996. })
  27997. },
  27998. filterAll: function(e, i) {
  27999. return e.filter(function(t) {
  28000. return i.every(function(e) {
  28001. return e(t)
  28002. })
  28003. })
  28004. },
  28005. formatDate: function(e) {
  28006. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28007. },
  28008. formatDatetime: function(e) {
  28009. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28010. },
  28011. randomString: function(e) {
  28012. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28013. t += i.charAt(Math.floor(Math.random() * i.length));
  28014. return t
  28015. },
  28016. uint8ToBase64: function(e, t) {
  28017. t && "number" == typeof t || (t = 8192);
  28018. for (var i = [], n = 0; n < e.length; n += t)
  28019. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28020. return btoa(i.join(""))
  28021. },
  28022. uuid4: function e(t) {
  28023. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28024. },
  28025. nth: function(e) {
  28026. return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28027. },
  28028. extendObject: function(t, i) {
  28029. return Object.keys(i).forEach(function(e) {
  28030. t[e] = i[e]
  28031. }),
  28032. t
  28033. },
  28034. deepExtend: function e(t) {
  28035. t = t || {};
  28036. for (var i = 1; i < arguments.length; i++) {
  28037. var n = arguments[i];
  28038. if (n)
  28039. for (var r in n)
  28040. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28041. }
  28042. return t
  28043. },
  28044. inherit: function(e, t) {
  28045. e.prototype = Object.create(t.prototype),
  28046. e.prototype.constructor = e
  28047. },
  28048. extend: function(e, t) {
  28049. for (var i in t.prototype)
  28050. e.prototype[i] = t.prototype[i]
  28051. }
  28052. },
  28053. Math.sign = function(e) {
  28054. return e < 0 ? -1 : 1
  28055. }
  28056. }
  28057. , {
  28058. three: 217
  28059. }],
  28060. 186: [function(e, t, i) {
  28061. "use strict";
  28062. var r = {
  28063. linearTween: function(e, t, i, n) {
  28064. return i * e / n + t
  28065. },
  28066. easeInQuad: function(e, t, i, n) {
  28067. return i * (e /= n) * e + t
  28068. },
  28069. easeOutQuad: function(e, t, i, n) {
  28070. return -i * (e /= n) * (e - 2) + t
  28071. },
  28072. easeInOutQuad: function(e, t, i, n) {
  28073. return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
  28074. },
  28075. easeInCubic: function(e, t, i, n) {
  28076. return i * (e /= n) * e * e + t
  28077. },
  28078. easeOutCubic: function(e, t, i, n) {
  28079. return e /= n,
  28080. i * (--e * e * e + 1) + t
  28081. },
  28082. easeInOutCubic: function(e, t, i, n) {
  28083. return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
  28084. },
  28085. easeInQuart: function(e, t, i, n) {
  28086. return i * (e /= n) * e * e * e + t
  28087. },
  28088. easeOutQuart: function(e, t, i, n) {
  28089. return e /= n,
  28090. -i * (--e * e * e * e - 1) + t
  28091. },
  28092. easeInOutQuart: function(e, t, i, n) {
  28093. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
  28094. },
  28095. easeInQuint: function(e, t, i, n) {
  28096. return i * (e /= n) * e * e * e * e + t
  28097. },
  28098. easeOutQuint: function(e, t, i, n) {
  28099. return e /= n,
  28100. i * (--e * e * e * e * e + 1) + t
  28101. },
  28102. easeInOutQuint: function(e, t, i, n) {
  28103. return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
  28104. },
  28105. easeInSine: function(e, t, i, n) {
  28106. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28107. },
  28108. easeOutSine: function(e, t, i, n) {
  28109. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28110. },
  28111. easeInOutSine: function(e, t, i, n) {
  28112. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28113. },
  28114. easeInExpo: function(e, t, i, n) {
  28115. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28116. },
  28117. easeOutExpo: function(e, t, i, n) {
  28118. return i * (1 - Math.pow(2, -10 * e / n)) + t
  28119. },
  28120. easeInOutExpo: function(e, t, i, n) {
  28121. return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28122. i / 2 * (2 - Math.pow(2, -10 * e)) + t)
  28123. },
  28124. easeInCirc: function(e, t, i, n) {
  28125. return e /= n,
  28126. -i * (Math.sqrt(1 - e * e) - 1) + t
  28127. },
  28128. easeOutCirc: function(e, t, i, n) {
  28129. return e /= n,
  28130. e--,
  28131. i * Math.sqrt(1 - e * e) + t
  28132. },
  28133. easeInOutCirc: function(e, t, i, n) {
  28134. return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28135. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28136. },
  28137. easeInElastic: function(e, t, i, n) {
  28138. var r = 1.70158
  28139. , o = 0
  28140. , a = i;
  28141. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28142. r = a < Math.abs(i) ? (a = i,
  28143. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28144. -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
  28145. },
  28146. easeOutElastic: function(e, t, i, n) {
  28147. var r = 1.70158
  28148. , o = 0
  28149. , a = i;
  28150. return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
  28151. r = a < Math.abs(i) ? (a = i,
  28152. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28153. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28154. },
  28155. easeInOutElastic: function(e, t, i, n) {
  28156. var r = 1.70158
  28157. , o = 0
  28158. , a = i;
  28159. return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
  28160. r = a < Math.abs(i) ? (a = i,
  28161. o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
  28162. 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)
  28163. },
  28164. easeInBack: function(e, t, i, n, r) {
  28165. return void 0 === r && (r = 1.70158),
  28166. i * (e /= n) * e * ((r + 1) * e - r) + t
  28167. },
  28168. easeOutBack: function(e, t, i, n, r) {
  28169. return void 0 === r && (r = 1.70158),
  28170. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28171. },
  28172. easeInOutBack: function(e, t, i, n, r) {
  28173. return void 0 === r && (r = 1.70158),
  28174. (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
  28175. },
  28176. easeOutBounce: function(e, t, i, n) {
  28177. 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
  28178. },
  28179. easeInBounce: function(e, t, i, n) {
  28180. return i - r.easeOutBounce(n - e, 0, i, n) + t
  28181. },
  28182. easeInOutBounce: function(e, t, i, n) {
  28183. 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
  28184. }
  28185. };
  28186. t.exports = r
  28187. }
  28188. , {}],
  28189. 187: [function(e, t, i) {
  28190. "use strict";
  28191. function n() {
  28192. this.events = [],
  28193. this.valid = !1
  28194. }
  28195. var r = e("../enum/Joystick");
  28196. n.prototype.push = function(e, t) {
  28197. this.events.push({
  28198. direction: e,
  28199. pano: t
  28200. }),
  28201. this.valid = !0
  28202. }
  28203. ,
  28204. n.prototype.pop = function(e) {
  28205. var t = this.events.pop();
  28206. return this.events.length < 1 && (this.valid = !1),
  28207. t
  28208. }
  28209. ,
  28210. n.prototype.peek = function() {
  28211. return this.events.length ? this.events[this.events.length - 1] : {
  28212. direction: null,
  28213. pano: null
  28214. }
  28215. }
  28216. ,
  28217. n.prototype.invalidate = function() {
  28218. this.events = [],
  28219. this.valid = !1
  28220. }
  28221. ,
  28222. n.prototype.reversePano = function(e) {
  28223. if (!this.valid)
  28224. return null;
  28225. var t = this.peek();
  28226. return r.opposite(e) === t.direction ? (this.pop(),
  28227. t.pano) : null
  28228. }
  28229. ,
  28230. t.exports = n
  28231. }
  28232. , {
  28233. "../enum/Joystick": 29
  28234. }],
  28235. 188: [function(e, t, i) {
  28236. "use strict";
  28237. t.exports = {
  28238. vector: function(t, i) {
  28239. var n = t.clone();
  28240. return i = i.clone(),
  28241. function(e) {
  28242. t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
  28243. }
  28244. },
  28245. quaternion: function(t, i) {
  28246. var n = t.clone();
  28247. return function(e) {
  28248. t.copy(n).slerp(i, e)
  28249. }
  28250. },
  28251. property: function(t, i, n, r) {
  28252. var o = t[i];
  28253. return function(e) {
  28254. t[i] = o * (1 - e) + n * e,
  28255. r && r(t[i])
  28256. }
  28257. },
  28258. uniform: function(t, i, n) {
  28259. var r = t.material.uniforms[i].value;
  28260. return function(e) {
  28261. t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
  28262. }
  28263. },
  28264. matrix4: function(o, a) {
  28265. var s = o.clone();
  28266. return function(e) {
  28267. for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
  28268. t[r] = i[r] * (1 - e) + n[r] * e
  28269. }
  28270. },
  28271. allUniforms: function(e, t, i) {
  28272. var n = e.map(function(e) {
  28273. return this.uniform(e, t, i)
  28274. }
  28275. .bind(this));
  28276. return function(t) {
  28277. n.forEach(function(e) {
  28278. e(t)
  28279. })
  28280. }
  28281. }
  28282. }
  28283. }
  28284. , {}],
  28285. 189: [function(e, t, i) {
  28286. "use strict";
  28287. function h(n) {
  28288. var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
  28289. if (h.consoleEnabled) {
  28290. var l = function(e) {
  28291. $("#debug-console").append("<p>" + e + "</p>"),
  28292. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28293. };
  28294. e = function(e) {
  28295. l(Array.prototype.slice.call(arguments).join(" "))
  28296. }
  28297. ,
  28298. t = function(e) {
  28299. l(Array.prototype.slice.call(arguments).join(" "))
  28300. }
  28301. ,
  28302. i = function(e) {
  28303. l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28304. }
  28305. ,
  28306. r = function(e) {
  28307. l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28308. }
  28309. } else
  28310. console.log ? (e = console.log,
  28311. t = console.info ? console.info : console.log,
  28312. i = console.warn ? console.warn : console.log,
  28313. r = console.error ? console.error : console.log) : e = t = i = r = function() {}
  28314. ;
  28315. function c(e) {
  28316. return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
  28317. }
  28318. return {
  28319. debug: function() {
  28320. h.level >= h.levels.debug && e.apply(console, c(arguments))
  28321. },
  28322. info: function() {
  28323. h.level >= h.levels.info && t.apply(console, c(arguments))
  28324. },
  28325. warn: function() {
  28326. (function(e, t) {
  28327. if (u) {
  28328. var i = Array.prototype.slice.call(e).join(" ");
  28329. u.captureMessage(i, {
  28330. level: t,
  28331. path: n,
  28332. timestamp: h.timestamp()
  28333. })
  28334. }
  28335. }
  28336. )(arguments, "warn"),
  28337. h.level >= h.levels.warn && i.apply(console, c(arguments))
  28338. },
  28339. error: function() {
  28340. (function(e, t) {
  28341. if (u) {
  28342. var i = Array.prototype.slice.call(e).join(" ");
  28343. u.captureException(new Error(i), {
  28344. level: t,
  28345. path: n,
  28346. timestamp: h.timestamp()
  28347. })
  28348. }
  28349. }
  28350. )(arguments, "error"),
  28351. h.level >= h.levels.error && r.apply(console, c(arguments))
  28352. },
  28353. v3str: function(e, t) {
  28354. var i = void 0 === t ? 2 : t;
  28355. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  28356. },
  28357. eulstr: function(e, t) {
  28358. var i = void 0 === t ? 2 : t;
  28359. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  28360. },
  28361. time: function(e) {
  28362. h.level >= h.levels.debug && (s[e] = Date.now())
  28363. },
  28364. timeEnd: function(e) {
  28365. if (h.level >= h.levels.debug) {
  28366. var t = s[e];
  28367. if (!t)
  28368. return;
  28369. var i = (Date.now() - t) / 1e3;
  28370. this.debug(e, i + "s")
  28371. }
  28372. }
  28373. }
  28374. }
  28375. var u = window.Raven;
  28376. h.timestamp = function() {
  28377. return (Date.now() - window.navigationStart) / 1e3 + "s"
  28378. }
  28379. ,
  28380. h.level = (h.levels = {
  28381. debug: 3,
  28382. info: 2,
  28383. warn: 1,
  28384. error: 0
  28385. }).info,
  28386. t.exports = h
  28387. }
  28388. , {}],
  28389. 190: [function(e, t, i) {
  28390. "use strict";
  28391. var o = e("three")
  28392. , r = e("../enum/GLCubeFaces");
  28393. e("../constants");
  28394. t.exports = {
  28395. convertVisionVector: function(e) {
  28396. return new o.Vector3(e.x,e.z,-e.y)
  28397. },
  28398. convertVisionQuaternion: function(e) {
  28399. 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)))
  28400. },
  28401. convertWorkshopVector: function(e) {
  28402. return new o.Vector3(-e.x,e.y,e.z)
  28403. },
  28404. convertWorkshopQuaternion: function(e) {
  28405. 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))
  28406. },
  28407. convertWorkshopPanoramaQuaternion: function(e) {
  28408. 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)))
  28409. },
  28410. convertWorkshopOrthoZoom: function(e) {
  28411. return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
  28412. },
  28413. toPrecision: function(e, t) {
  28414. function i(e, t) {
  28415. var i = Math.pow(10, t);
  28416. return Math.round(e * i) / i
  28417. }
  28418. if (e instanceof Array) {
  28419. for (var n = 0; n < e.length; n++)
  28420. e[n] = i(e[n], t);
  28421. return e
  28422. }
  28423. return i(e, t)
  28424. },
  28425. isEmptyQuaternion: function(e) {
  28426. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  28427. },
  28428. projectPositionToCanvas: function(e, t, i) {
  28429. (i = i || new o.Vector3).copy(e);
  28430. var n = .5 * $("#player").width()
  28431. , r = .5 * $("#player").height();
  28432. return i.project(t),
  28433. i.x = i.x * n + n,
  28434. i.y = -i.y * r + r,
  28435. i
  28436. },
  28437. convertScreenPositionToNDC: function(e, t, i) {
  28438. return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
  28439. i.y = -t / $("#player").height() * 2 + 1,
  28440. i
  28441. },
  28442. constrainedTurn: function(e) {
  28443. var t = e % (2 * Math.PI);
  28444. return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  28445. },
  28446. getFOVDotThreshold: function(e) {
  28447. return Math.cos(o.Math.degToRad(e / 2))
  28448. },
  28449. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  28450. switch (e) {
  28451. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28452. i.set(1, t.y, t.x);
  28453. break;
  28454. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28455. i.set(-1, t.y, -t.x);
  28456. break;
  28457. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28458. i.set(-t.x, 1, -t.y);
  28459. break;
  28460. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28461. i.set(-t.x, -1, t.y);
  28462. break;
  28463. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28464. i.set(-t.x, t.y, 1);
  28465. break;
  28466. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28467. i.set(t.x, t.y, -1)
  28468. }
  28469. n && i.normalize()
  28470. }
  28471. }
  28472. }
  28473. , {
  28474. "../constants": 8,
  28475. "../enum/GLCubeFaces": 25,
  28476. three: 217
  28477. }],
  28478. 191: [function(e, t, i) {
  28479. "use strict";
  28480. function o(e) {
  28481. return r[e]
  28482. }
  28483. var n = e("../enum/GLCubeFaces")
  28484. , a = [0, 1, 2, 3, 4, 5]
  28485. , r = {
  28486. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28487. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28488. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28489. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28490. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28491. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28492. };
  28493. t.exports = {
  28494. mapFaceToCubemapFace: o,
  28495. getCubemapUrls: function(i, n, r) {
  28496. return a.map(function(e, t) {
  28497. return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
  28498. }
  28499. .bind(this))
  28500. }
  28501. }
  28502. }
  28503. , {
  28504. "../enum/GLCubeFaces": 25
  28505. }],
  28506. 192: [function(e, t, i) {
  28507. "use strict";
  28508. t.exports = {
  28509. captureErrors: function(e, t, i) {
  28510. if ("Raven"in window) {
  28511. Raven.config(e, t).install(),
  28512. i && Raven.setTagsContext(i);
  28513. var n = console.warn
  28514. , r = console.error;
  28515. console.warn = function() {
  28516. var e = Array.prototype.slice.call(arguments);
  28517. Raven.captureMessage(e.join(" "), {
  28518. level: "warning"
  28519. }),
  28520. n.apply(console, e)
  28521. }
  28522. ,
  28523. console.error = function() {
  28524. var e = Array.prototype.slice.call(arguments);
  28525. Raven.captureException(new Error(e.join(" ")), {
  28526. level: "error"
  28527. }),
  28528. r.apply(console, e)
  28529. }
  28530. } else
  28531. console.error("Raven not found, not capturing errors.")
  28532. }
  28533. }
  28534. }
  28535. , {}],
  28536. 193: [function(c, h, e) {
  28537. (function(e) {
  28538. "use strict";
  28539. var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
  28540. getAuthorizationHeader: function() {
  28541. var e = n.valueFromHash("auth");
  28542. if (e)
  28543. return e.replace(",", " ");
  28544. var t = n.valueFromCookie("token");
  28545. return t ? "Token " + t : null
  28546. },
  28547. parseSidUrl: function(e) {
  28548. var t, i;
  28549. if (t = g_Prefix,
  28550. (e = e || "").match(/^https?/)) {
  28551. o.parse(e);
  28552. t = g_Prefix,
  28553. i = e
  28554. } else
  28555. i = (t = g_Prefix) + "data/" + e;
  28556. return {
  28557. urlBase: t,
  28558. urlModel: i,
  28559. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  28560. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  28561. }
  28562. },
  28563. getModelIDFromQueryString: function() {
  28564. return n.valueFromHash("model") || n.valueFromHash("m")
  28565. },
  28566. normalizeModeldata: function(e, i) {
  28567. e = JSON.parse(JSON.stringify(e));
  28568. var n = null;
  28569. if (e.images.forEach(function(t) {
  28570. if (t.metadata) {
  28571. if ("string" == typeof t.metadata)
  28572. try {
  28573. t.metadata = JSON.parse(t.metadata)
  28574. } catch (e) {
  28575. s.warn("Unable to parse image metadata"),
  28576. t.metadata = null
  28577. }
  28578. else
  28579. "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
  28580. t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
  28581. 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)),
  28582. t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
  28583. t.metadata.zoom = t.metadata.zoom || 1),
  28584. !n && e.icon && e.icon === t.sid && (n = t.metadata)
  28585. }
  28586. }),
  28587. n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
  28588. var t = {};
  28589. t.pano = {
  28590. quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
  28591. position: i.convertWorkshopVector(n.scan_position),
  28592. uuid: n.scan_id
  28593. },
  28594. t.camera = {
  28595. quaternion: n.camera_quaternion,
  28596. position: n.camera_position
  28597. },
  28598. e.startPano = t
  28599. }
  28600. return e
  28601. },
  28602. visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
  28603. function(e) {
  28604. if (!e)
  28605. throw new Error("Vision version is required");
  28606. var t = i.exec(e);
  28607. if (null === t)
  28608. throw new Error("String is not a vision version: " + e);
  28609. return parseInt(t[1])
  28610. }
  28611. ),
  28612. modelDataPromisesTiles: function(e) {
  28613. var t = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version;
  28614. if (t)
  28615. try {
  28616. return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
  28617. } catch (e) {
  28618. s.warn("Invalid vision version: " + t)
  28619. }
  28620. return !1
  28621. }
  28622. };
  28623. h.exports = l
  28624. }
  28625. ).call(this, "/js/util/showcase.js")
  28626. }
  28627. , {
  28628. "../constants": 8,
  28629. "./browser": 182,
  28630. "./logger": 189,
  28631. three: 217,
  28632. url: 208
  28633. }],
  28634. 194: [function(e, t, i) {
  28635. "use strict";
  28636. var r = e("../util/ajax")
  28637. , o = e("three")
  28638. , a = e("../settings")
  28639. , s = {};
  28640. t.exports = {
  28641. load: function(e, t, i) {
  28642. var n = s[e];
  28643. return n ? t && setTimeout(function() {
  28644. t(n)
  28645. }, 1) : (n = new o.Texture,
  28646. a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
  28647. n.magFilter = o.LinearFilter,
  28648. n.generateMipmaps = !1),
  28649. n.sourceFile = e,
  28650. s[e] = n,
  28651. r.getImage(e).then(function(e) {
  28652. n.image = e,
  28653. n.needsUpdate = !0,
  28654. t && t(n)
  28655. }).fail(i)),
  28656. n
  28657. },
  28658. loadBase64: function(e, t) {
  28659. t = t || "png";
  28660. var i = new o.Texture;
  28661. return i.image = document.createElement("img"),
  28662. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  28663. a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
  28664. i.magFilter = o.LinearFilter,
  28665. i.generateMipmaps = !1),
  28666. i.needsUpdate = !0,
  28667. i
  28668. },
  28669. isLoaded: function(e) {
  28670. return !!s[e]
  28671. }
  28672. }
  28673. }
  28674. , {
  28675. "../settings": 166,
  28676. "../util/ajax": 181,
  28677. three: 217
  28678. }],
  28679. 195: [function(e, t, i) {
  28680. "use strict";
  28681. var l = e("./easing");
  28682. t.exports = {
  28683. globalDone: null,
  28684. funcs: [],
  28685. counter: 0,
  28686. uniqueID: 0,
  28687. start: function(e, t, i, n, r, o, a) {
  28688. return n = n || 0,
  28689. this.funcs.push({
  28690. func: e,
  28691. current: -n * Math.abs(t),
  28692. duration: (1 - Math.max(n, 0)) * Math.abs(t),
  28693. done: i,
  28694. easing: r || l.linearTween,
  28695. cycling: t < 0,
  28696. running: !0,
  28697. debug: n < 0,
  28698. name: o || "T" + this.counter,
  28699. id: void 0 === a ? this.counter : a,
  28700. paused: !1
  28701. }),
  28702. e(0, 16),
  28703. this.counter += 1,
  28704. e
  28705. },
  28706. trigger: function(e) {
  28707. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  28708. , i = e.func || function() {}
  28709. , n = void 0 === e.duration ? 0 : e.duration;
  28710. void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
  28711. var r = e.done || null
  28712. , o = e.easing || l.linearTween
  28713. , a = e.name || "R" + this.counter
  28714. , s = void 0 === e.id ? this.counter : e.id;
  28715. return this.start(i, n, r, t, o, a, s)
  28716. },
  28717. setTimeout: function(e, t, i) {
  28718. var n = void 0 === i ? this.counter : i;
  28719. return this.trigger({
  28720. done: e,
  28721. duration: void 0 === t ? 0 : t,
  28722. name: "O" + this.counter,
  28723. id: n
  28724. })
  28725. },
  28726. pause: function() {
  28727. this.paused = !0
  28728. },
  28729. resume: function() {
  28730. this.paused = !1
  28731. },
  28732. update: function(n) {
  28733. this.funcs.forEach(function(e) {
  28734. if (!(e.paused || (e.current += 1e3 * n,
  28735. e.current < 0)))
  28736. if (e.current >= e.duration && !e.cycling) {
  28737. var t = e.easing(1, 0, 1, 1);
  28738. e.func(t, 1e3 * n),
  28739. e.done && e.done(),
  28740. e.running = !1
  28741. } else {
  28742. var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
  28743. (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
  28744. e.running = !1)
  28745. }
  28746. });
  28747. var e = this.funcs.length;
  28748. this.funcs = this.funcs.filter(function(e) {
  28749. return e.running
  28750. });
  28751. var t = this.funcs.length;
  28752. if (0 < e && 0 === t && this.globalDone) {
  28753. var i = this.globalDone;
  28754. this.globalDone = null,
  28755. i()
  28756. }
  28757. },
  28758. adjustSpeed: function(e, t) {
  28759. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  28760. var r = i[n];
  28761. r.duration /= t,
  28762. r.current /= t
  28763. }
  28764. },
  28765. getById: function(t) {
  28766. return this.funcs.filter(function(e) {
  28767. return t === e.id
  28768. })
  28769. },
  28770. get: function(e) {
  28771. for (var t = 0; t < this.funcs.length; t += 1)
  28772. if (this.funcs[t].func === e)
  28773. return this.funcs[t];
  28774. return null
  28775. },
  28776. isRunning: function(e) {
  28777. var t = this.get(e);
  28778. return null !== t && t.running
  28779. },
  28780. countActive: function() {
  28781. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  28782. e += this.funcs[t].running;
  28783. return e
  28784. },
  28785. listActive: function() {
  28786. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  28787. this.funcs[t].running && e.push(this.funcs[t].name);
  28788. return e
  28789. },
  28790. done: function(e) {
  28791. this.globalDone = e
  28792. },
  28793. cancelById: function(e) {
  28794. var t = void 0 === e ? 0 : e;
  28795. this.funcs = this.funcs.filter(function(e) {
  28796. return e.id !== t
  28797. })
  28798. },
  28799. cancel: function(t) {
  28800. this.funcs = this.funcs.filter(function(e) {
  28801. return e.func !== t
  28802. })
  28803. },
  28804. getUniqueId: function() {
  28805. return this.uniqueID -= 1,
  28806. this.uniqueID
  28807. }
  28808. }
  28809. }
  28810. , {
  28811. "./easing": 186
  28812. }],
  28813. 196: [function(e, t, i) {
  28814. function n(e) {
  28815. if (this.set = {},
  28816. this.infContains = function() {
  28817. return !0
  28818. }
  28819. ,
  28820. "object" == typeof e)
  28821. if (e instanceof Array)
  28822. for (var t = 0; t < e.length; t++)
  28823. this.set[e[t]] = !0;
  28824. else
  28825. this.set = e;
  28826. else if ("function" == typeof e)
  28827. this.infContains = e;
  28828. else if (void 0 !== e)
  28829. throw new Error("set must be either an array or an object.")
  28830. }
  28831. (t.exports = n).prototype.has = n.prototype.contains = function(e) {
  28832. return !!this.set[e]
  28833. }
  28834. ,
  28835. n.prototype.add = function(e) {
  28836. if (1 == arguments.length)
  28837. this.set[e] = !0;
  28838. else
  28839. for (var t = 0; t < arguments.length; t++)
  28840. this.set[arguments[t]] = !0
  28841. }
  28842. ,
  28843. n.prototype.addAll = function(e) {
  28844. if ("object" != typeof e && !(e instanceof Array))
  28845. throw new Error("arr must be an array.");
  28846. for (var t = 0; t < e.length; t++)
  28847. this.add(e[t])
  28848. }
  28849. ,
  28850. n.prototype.delete = n.prototype.remove = function(e) {
  28851. if (1 == arguments.length)
  28852. delete this.set[e];
  28853. else
  28854. for (var t = 0; t < arguments.length; t++)
  28855. delete this.set[arguments[t]]
  28856. }
  28857. ,
  28858. n.prototype.clear = function() {
  28859. this.set = {}
  28860. }
  28861. ,
  28862. n.prototype.size = function() {
  28863. return Object.keys(this.set).length
  28864. }
  28865. ,
  28866. n.prototype.toString = function() {
  28867. return "{" + Object.keys(this.set).toString() + "}"
  28868. }
  28869. ,
  28870. n.prototype["*values"] = n.prototype.toArray = function() {
  28871. return void 0 === this.set ? [] : Object.keys(this.set)
  28872. }
  28873. }
  28874. , {}],
  28875. 197: [function(e, t, i) {}
  28876. , {}],
  28877. 198: [function(N, e, F) {
  28878. (function(e) {
  28879. "use strict";
  28880. function i() {
  28881. return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  28882. }
  28883. function o(e, t) {
  28884. if (i() < t)
  28885. throw new RangeError("Invalid typed array length");
  28886. return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
  28887. e.length = t),
  28888. e
  28889. }
  28890. function u(e, t, i) {
  28891. if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
  28892. return new u(e,t,i);
  28893. if ("number" != typeof e)
  28894. return n(this, e, t, i);
  28895. if ("string" == typeof t)
  28896. throw new Error("If encoding is specified then the first argument must be a string");
  28897. return a(this, e)
  28898. }
  28899. function n(e, t, i, n) {
  28900. if ("number" == typeof t)
  28901. throw new TypeError('"value" argument must not be a number');
  28902. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
  28903. if (t.byteLength,
  28904. i < 0 || t.byteLength < i)
  28905. throw new RangeError("'offset' is out of bounds");
  28906. if (t.byteLength < i + (n || 0))
  28907. throw new RangeError("'length' is out of bounds");
  28908. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  28909. u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
  28910. e
  28911. }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
  28912. if ("string" == typeof i && "" !== i || (i = "utf8"),
  28913. !u.isEncoding(i))
  28914. throw new TypeError('"encoding" must be a valid string encoding');
  28915. var n = 0 | c(t, i)
  28916. , r = (e = o(e, n)).write(t, i);
  28917. return r !== n && (e = e.slice(0, r)),
  28918. e
  28919. }(e, t, i) : function(e, t) {
  28920. if (u.isBuffer(t)) {
  28921. var i = 0 | l(t.length);
  28922. return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
  28923. e
  28924. }
  28925. if (t) {
  28926. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  28927. return "number" != typeof t.length || function(e) {
  28928. return e != e
  28929. }(t.length) ? o(e, 0) : s(e, t);
  28930. if ("Buffer" === t.type && L(t.data))
  28931. return s(e, t.data)
  28932. }
  28933. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  28934. }(e, t)
  28935. }
  28936. function r(e) {
  28937. if ("number" != typeof e)
  28938. throw new TypeError('"size" argument must be a number');
  28939. if (e < 0)
  28940. throw new RangeError('"size" argument must not be negative')
  28941. }
  28942. function a(e, t) {
  28943. if (r(t),
  28944. e = o(e, t < 0 ? 0 : 0 | l(t)),
  28945. !u.TYPED_ARRAY_SUPPORT)
  28946. for (var i = 0; i < t; ++i)
  28947. e[i] = 0;
  28948. return e
  28949. }
  28950. function s(e, t) {
  28951. var i = t.length < 0 ? 0 : 0 | l(t.length);
  28952. e = o(e, i);
  28953. for (var n = 0; n < i; n += 1)
  28954. e[n] = 255 & t[n];
  28955. return e
  28956. }
  28957. function l(e) {
  28958. if (e >= i())
  28959. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
  28960. return 0 | e
  28961. }
  28962. function c(e, t) {
  28963. if (u.isBuffer(e))
  28964. return e.length;
  28965. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  28966. return e.byteLength;
  28967. "string" != typeof e && (e = "" + e);
  28968. var i = e.length;
  28969. if (0 === i)
  28970. return 0;
  28971. for (var n = !1; ; )
  28972. switch (t) {
  28973. case "ascii":
  28974. case "latin1":
  28975. case "binary":
  28976. return i;
  28977. case "utf8":
  28978. case "utf-8":
  28979. case void 0:
  28980. return S(e).length;
  28981. case "ucs2":
  28982. case "ucs-2":
  28983. case "utf16le":
  28984. case "utf-16le":
  28985. return 2 * i;
  28986. case "hex":
  28987. return i >>> 1;
  28988. case "base64":
  28989. return M(e).length;
  28990. default:
  28991. if (n)
  28992. return S(e).length;
  28993. t = ("" + t).toLowerCase(),
  28994. n = !0
  28995. }
  28996. }
  28997. function h(e, t, i) {
  28998. var n = e[t];
  28999. e[t] = e[i],
  29000. e[i] = n
  29001. }
  29002. function d(e, t, i, n, r) {
  29003. if (0 === e.length)
  29004. return -1;
  29005. if ("string" == typeof i ? (n = i,
  29006. i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29007. i = +i,
  29008. isNaN(i) && (i = r ? 0 : e.length - 1),
  29009. i < 0 && (i = e.length + i),
  29010. i >= e.length) {
  29011. if (r)
  29012. return -1;
  29013. i = e.length - 1
  29014. } else if (i < 0) {
  29015. if (!r)
  29016. return -1;
  29017. i = 0
  29018. }
  29019. if ("string" == typeof t && (t = u.from(t, n)),
  29020. u.isBuffer(t))
  29021. return 0 === t.length ? -1 : p(e, t, i, n, r);
  29022. if ("number" == typeof t)
  29023. return t &= 255,
  29024. 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);
  29025. throw new TypeError("val must be string, number or Buffer")
  29026. }
  29027. function p(e, t, i, n, r) {
  29028. function o(e, t) {
  29029. return 1 === s ? e[t] : e.readUInt16BE(t * s)
  29030. }
  29031. var a, s = 1, l = e.length, c = t.length;
  29032. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29033. if (e.length < 2 || t.length < 2)
  29034. return -1;
  29035. l /= s = 2,
  29036. c /= 2,
  29037. i /= 2
  29038. }
  29039. if (r) {
  29040. var h = -1;
  29041. for (a = i; a < l; a++)
  29042. if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
  29043. if (-1 === h && (h = a),
  29044. a - h + 1 === c)
  29045. return h * s
  29046. } else
  29047. -1 !== h && (a -= a - h),
  29048. h = -1
  29049. } else
  29050. for (l < i + c && (i = l - c),
  29051. a = i; 0 <= a; a--) {
  29052. for (var u = !0, d = 0; d < c; d++)
  29053. if (o(e, a + d) !== o(t, d)) {
  29054. u = !1;
  29055. break
  29056. }
  29057. if (u)
  29058. return a
  29059. }
  29060. return -1
  29061. }
  29062. function g(e, t, i, n) {
  29063. i = Number(i) || 0;
  29064. var r = e.length - i;
  29065. n ? r < (n = Number(n)) && (n = r) : n = r;
  29066. var o = t.length;
  29067. if (o % 2 != 0)
  29068. throw new TypeError("Invalid hex string");
  29069. o / 2 < n && (n = o / 2);
  29070. for (var a = 0; a < n; ++a) {
  29071. var s = parseInt(t.substr(2 * a, 2), 16);
  29072. if (isNaN(s))
  29073. return a;
  29074. e[i + a] = s
  29075. }
  29076. return a
  29077. }
  29078. function m(e, t, i, n) {
  29079. return R(function(e) {
  29080. for (var t = [], i = 0; i < e.length; ++i)
  29081. t.push(255 & e.charCodeAt(i));
  29082. return t
  29083. }(t), e, i, n)
  29084. }
  29085. function f(e, t, i) {
  29086. i = Math.min(e.length, i);
  29087. for (var n = [], r = t; r < i; ) {
  29088. var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
  29089. if (r + u <= i)
  29090. switch (u) {
  29091. case 1:
  29092. c < 128 && (h = c);
  29093. break;
  29094. case 2:
  29095. 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
  29096. break;
  29097. case 3:
  29098. o = e[r + 1],
  29099. a = e[r + 2],
  29100. 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
  29101. break;
  29102. case 4:
  29103. o = e[r + 1],
  29104. a = e[r + 2],
  29105. s = e[r + 3],
  29106. 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))
  29107. }
  29108. null === h ? (h = 65533,
  29109. u = 1) : 65535 < h && (h -= 65536,
  29110. n.push(h >>> 10 & 1023 | 55296),
  29111. h = 56320 | 1023 & h),
  29112. n.push(h),
  29113. r += u
  29114. }
  29115. return function(e) {
  29116. var t = e.length;
  29117. if (t <= D)
  29118. return String.fromCharCode.apply(String, e);
  29119. for (var i = "", n = 0; n < t; )
  29120. i += String.fromCharCode.apply(String, e.slice(n, n += D));
  29121. return i
  29122. }(n)
  29123. }
  29124. function v(e, t, i) {
  29125. var n = "";
  29126. i = Math.min(e.length, i);
  29127. for (var r = t; r < i; ++r)
  29128. n += String.fromCharCode(127 & e[r]);
  29129. return n
  29130. }
  29131. function y(e, t, i) {
  29132. var n = "";
  29133. i = Math.min(e.length, i);
  29134. for (var r = t; r < i; ++r)
  29135. n += String.fromCharCode(e[r]);
  29136. return n
  29137. }
  29138. function A(e, t, i) {
  29139. var n, r = e.length;
  29140. (!t || t < 0) && (t = 0),
  29141. (!i || i < 0 || r < i) && (i = r);
  29142. for (var o = "", a = t; a < i; ++a)
  29143. o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
  29144. return o
  29145. }
  29146. function C(e, t, i) {
  29147. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29148. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29149. return r
  29150. }
  29151. function I(e, t, i) {
  29152. if (e % 1 != 0 || e < 0)
  29153. throw new RangeError("offset is not uint");
  29154. if (i < e + t)
  29155. throw new RangeError("Trying to access beyond buffer length")
  29156. }
  29157. function E(e, t, i, n, r, o) {
  29158. if (!u.isBuffer(e))
  29159. throw new TypeError('"buffer" argument must be a Buffer instance');
  29160. if (r < t || t < o)
  29161. throw new RangeError('"value" argument is out of bounds');
  29162. if (i + n > e.length)
  29163. throw new RangeError("Index out of range")
  29164. }
  29165. function _(e, t, i, n) {
  29166. t < 0 && (t = 65535 + t + 1);
  29167. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29168. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29169. }
  29170. function b(e, t, i, n) {
  29171. t < 0 && (t = 4294967295 + t + 1);
  29172. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29173. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29174. }
  29175. function w(e, t, i, n) {
  29176. if (i + n > e.length)
  29177. throw new RangeError("Index out of range");
  29178. if (i < 0)
  29179. throw new RangeError("Index out of range")
  29180. }
  29181. function T(e, t, i, n, r) {
  29182. return r || w(e, 0, i, 4),
  29183. O.write(e, t, i, n, 23, 4),
  29184. i + 4
  29185. }
  29186. function x(e, t, i, n, r) {
  29187. return r || w(e, 0, i, 8),
  29188. O.write(e, t, i, n, 52, 8),
  29189. i + 8
  29190. }
  29191. function S(e, t) {
  29192. t = t || 1 / 0;
  29193. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29194. if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
  29195. if (!r) {
  29196. if (56319 < i) {
  29197. -1 < (t -= 3) && o.push(239, 191, 189);
  29198. continue
  29199. }
  29200. if (a + 1 === n) {
  29201. -1 < (t -= 3) && o.push(239, 191, 189);
  29202. continue
  29203. }
  29204. r = i;
  29205. continue
  29206. }
  29207. if (i < 56320) {
  29208. -1 < (t -= 3) && o.push(239, 191, 189),
  29209. r = i;
  29210. continue
  29211. }
  29212. i = 65536 + (r - 55296 << 10 | i - 56320)
  29213. } else
  29214. r && -1 < (t -= 3) && o.push(239, 191, 189);
  29215. if (r = null,
  29216. i < 128) {
  29217. if ((t -= 1) < 0)
  29218. break;
  29219. o.push(i)
  29220. } else if (i < 2048) {
  29221. if ((t -= 2) < 0)
  29222. break;
  29223. o.push(i >> 6 | 192, 63 & i | 128)
  29224. } else if (i < 65536) {
  29225. if ((t -= 3) < 0)
  29226. break;
  29227. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29228. } else {
  29229. if (!(i < 1114112))
  29230. throw new Error("Invalid code point");
  29231. if ((t -= 4) < 0)
  29232. break;
  29233. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29234. }
  29235. }
  29236. return o
  29237. }
  29238. function M(e) {
  29239. return P.toByteArray(function(e) {
  29240. if ((e = function(e) {
  29241. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29242. }(e).replace(t, "")).length < 2)
  29243. return "";
  29244. for (; e.length % 4 != 0; )
  29245. e += "=";
  29246. return e
  29247. }(e))
  29248. }
  29249. function R(e, t, i, n) {
  29250. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29251. t[r + i] = e[r];
  29252. return r
  29253. }
  29254. var P = N("base64-js")
  29255. , O = N("ieee754")
  29256. , L = N("isarray");
  29257. F.Buffer = u,
  29258. F.SlowBuffer = function(e) {
  29259. return +e != e && (e = 0),
  29260. u.alloc(+e)
  29261. }
  29262. ,
  29263. F.INSPECT_MAX_BYTES = 50,
  29264. u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
  29265. try {
  29266. var e = new Uint8Array(1);
  29267. return e.__proto__ = {
  29268. __proto__: Uint8Array.prototype,
  29269. foo: function() {
  29270. return 42
  29271. }
  29272. },
  29273. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  29274. } catch (e) {
  29275. return !1
  29276. }
  29277. }(),
  29278. F.kMaxLength = i(),
  29279. u.poolSize = 8192,
  29280. u._augment = function(e) {
  29281. return e.__proto__ = u.prototype,
  29282. e
  29283. }
  29284. ,
  29285. u.from = function(e, t, i) {
  29286. return n(null, e, t, i)
  29287. }
  29288. ,
  29289. u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
  29290. u.__proto__ = Uint8Array,
  29291. "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
  29292. value: null,
  29293. configurable: !0
  29294. })),
  29295. u.alloc = function(e, t, i) {
  29296. return function(e, t, i, n) {
  29297. return r(t),
  29298. 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)
  29299. }(null, e, t, i)
  29300. }
  29301. ,
  29302. u.allocUnsafe = function(e) {
  29303. return a(null, e)
  29304. }
  29305. ,
  29306. u.allocUnsafeSlow = function(e) {
  29307. return a(null, e)
  29308. }
  29309. ,
  29310. u.isBuffer = function(e) {
  29311. return !(null == e || !e._isBuffer)
  29312. }
  29313. ,
  29314. u.compare = function(e, t) {
  29315. if (!u.isBuffer(e) || !u.isBuffer(t))
  29316. throw new TypeError("Arguments must be Buffers");
  29317. if (e === t)
  29318. return 0;
  29319. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  29320. if (e[r] !== t[r]) {
  29321. i = e[r],
  29322. n = t[r];
  29323. break
  29324. }
  29325. return i < n ? -1 : n < i ? 1 : 0
  29326. }
  29327. ,
  29328. u.isEncoding = function(e) {
  29329. switch (String(e).toLowerCase()) {
  29330. case "hex":
  29331. case "utf8":
  29332. case "utf-8":
  29333. case "ascii":
  29334. case "latin1":
  29335. case "binary":
  29336. case "base64":
  29337. case "ucs2":
  29338. case "ucs-2":
  29339. case "utf16le":
  29340. case "utf-16le":
  29341. return !0;
  29342. default:
  29343. return !1
  29344. }
  29345. }
  29346. ,
  29347. u.concat = function(e, t) {
  29348. if (!L(e))
  29349. throw new TypeError('"list" argument must be an Array of Buffers');
  29350. if (0 === e.length)
  29351. return u.alloc(0);
  29352. var i;
  29353. if (void 0 === t)
  29354. for (i = t = 0; i < e.length; ++i)
  29355. t += e[i].length;
  29356. var n = u.allocUnsafe(t)
  29357. , r = 0;
  29358. for (i = 0; i < e.length; ++i) {
  29359. var o = e[i];
  29360. if (!u.isBuffer(o))
  29361. throw new TypeError('"list" argument must be an Array of Buffers');
  29362. o.copy(n, r),
  29363. r += o.length
  29364. }
  29365. return n
  29366. }
  29367. ,
  29368. u.byteLength = c,
  29369. u.prototype._isBuffer = !0,
  29370. u.prototype.swap16 = function() {
  29371. var e = this.length;
  29372. if (e % 2 != 0)
  29373. throw new RangeError("Buffer size must be a multiple of 16-bits");
  29374. for (var t = 0; t < e; t += 2)
  29375. h(this, t, t + 1);
  29376. return this
  29377. }
  29378. ,
  29379. u.prototype.swap32 = function() {
  29380. var e = this.length;
  29381. if (e % 4 != 0)
  29382. throw new RangeError("Buffer size must be a multiple of 32-bits");
  29383. for (var t = 0; t < e; t += 4)
  29384. h(this, t, t + 3),
  29385. h(this, t + 1, t + 2);
  29386. return this
  29387. }
  29388. ,
  29389. u.prototype.swap64 = function() {
  29390. var e = this.length;
  29391. if (e % 8 != 0)
  29392. throw new RangeError("Buffer size must be a multiple of 64-bits");
  29393. for (var t = 0; t < e; t += 8)
  29394. h(this, t, t + 7),
  29395. h(this, t + 1, t + 6),
  29396. h(this, t + 2, t + 5),
  29397. h(this, t + 3, t + 4);
  29398. return this
  29399. }
  29400. ,
  29401. u.prototype.toString = function() {
  29402. var e = 0 | this.length;
  29403. return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
  29404. var n, r, o, a = !1;
  29405. if ((void 0 === t || t < 0) && (t = 0),
  29406. t > this.length)
  29407. return "";
  29408. if ((void 0 === i || i > this.length) && (i = this.length),
  29409. i <= 0)
  29410. return "";
  29411. if ((i >>>= 0) <= (t >>>= 0))
  29412. return "";
  29413. for (e = e || "utf8"; ; )
  29414. switch (e) {
  29415. case "hex":
  29416. return A(this, t, i);
  29417. case "utf8":
  29418. case "utf-8":
  29419. return f(this, t, i);
  29420. case "ascii":
  29421. return v(this, t, i);
  29422. case "latin1":
  29423. case "binary":
  29424. return y(this, t, i);
  29425. case "base64":
  29426. return n = this,
  29427. o = i,
  29428. 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
  29429. case "ucs2":
  29430. case "ucs-2":
  29431. case "utf16le":
  29432. case "utf-16le":
  29433. return C(this, t, i);
  29434. default:
  29435. if (a)
  29436. throw new TypeError("Unknown encoding: " + e);
  29437. e = (e + "").toLowerCase(),
  29438. a = !0
  29439. }
  29440. }
  29441. .apply(this, arguments)
  29442. }
  29443. ,
  29444. u.prototype.equals = function(e) {
  29445. if (!u.isBuffer(e))
  29446. throw new TypeError("Argument must be a Buffer");
  29447. return this === e || 0 === u.compare(this, e)
  29448. }
  29449. ,
  29450. u.prototype.inspect = function() {
  29451. var e = ""
  29452. , t = F.INSPECT_MAX_BYTES;
  29453. return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  29454. this.length > t && (e += " ... ")),
  29455. "<Buffer " + e + ">"
  29456. }
  29457. ,
  29458. u.prototype.compare = function(e, t, i, n, r) {
  29459. if (!u.isBuffer(e))
  29460. throw new TypeError("Argument must be a Buffer");
  29461. if (void 0 === t && (t = 0),
  29462. void 0 === i && (i = e ? e.length : 0),
  29463. void 0 === n && (n = 0),
  29464. void 0 === r && (r = this.length),
  29465. t < 0 || i > e.length || n < 0 || r > this.length)
  29466. throw new RangeError("out of range index");
  29467. if (r <= n && i <= t)
  29468. return 0;
  29469. if (r <= n)
  29470. return -1;
  29471. if (i <= t)
  29472. return 1;
  29473. if (this === e)
  29474. return 0;
  29475. 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)
  29476. if (l[h] !== c[h]) {
  29477. o = l[h],
  29478. a = c[h];
  29479. break
  29480. }
  29481. return o < a ? -1 : a < o ? 1 : 0
  29482. }
  29483. ,
  29484. u.prototype.includes = function(e, t, i) {
  29485. return -1 !== this.indexOf(e, t, i)
  29486. }
  29487. ,
  29488. u.prototype.indexOf = function(e, t, i) {
  29489. return d(this, e, t, i, !0)
  29490. }
  29491. ,
  29492. u.prototype.lastIndexOf = function(e, t, i) {
  29493. return d(this, e, t, i, !1)
  29494. }
  29495. ,
  29496. u.prototype.write = function(e, t, i, n) {
  29497. if (void 0 === t)
  29498. n = "utf8",
  29499. i = this.length,
  29500. t = 0;
  29501. else if (void 0 === i && "string" == typeof t)
  29502. n = t,
  29503. i = this.length,
  29504. t = 0;
  29505. else {
  29506. if (!isFinite(t))
  29507. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  29508. t |= 0,
  29509. isFinite(i) ? (i |= 0,
  29510. void 0 === n && (n = "utf8")) : (n = i,
  29511. i = void 0)
  29512. }
  29513. var r, o, a, s, l, c, h, u, d, p = this.length - t;
  29514. if ((void 0 === i || p < i) && (i = p),
  29515. 0 < e.length && (i < 0 || t < 0) || t > this.length)
  29516. throw new RangeError("Attempt to write outside buffer bounds");
  29517. n = n || "utf8";
  29518. for (var f = !1; ; )
  29519. switch (n) {
  29520. case "hex":
  29521. return g(this, e, t, i);
  29522. case "utf8":
  29523. case "utf-8":
  29524. return u = t,
  29525. d = i,
  29526. R(S(e, (h = this).length - u), h, u, d);
  29527. case "ascii":
  29528. return m(this, e, t, i);
  29529. case "latin1":
  29530. case "binary":
  29531. return m(this, e, t, i);
  29532. case "base64":
  29533. return s = this,
  29534. l = t,
  29535. c = i,
  29536. R(M(e), s, l, c);
  29537. case "ucs2":
  29538. case "ucs-2":
  29539. case "utf16le":
  29540. case "utf-16le":
  29541. return o = t,
  29542. a = i,
  29543. R(function(e, t) {
  29544. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  29545. i = e.charCodeAt(a),
  29546. n = i >> 8,
  29547. r = i % 256,
  29548. o.push(r),
  29549. o.push(n);
  29550. return o
  29551. }(e, (r = this).length - o), r, o, a);
  29552. default:
  29553. if (f)
  29554. throw new TypeError("Unknown encoding: " + n);
  29555. n = ("" + n).toLowerCase(),
  29556. f = !0
  29557. }
  29558. }
  29559. ,
  29560. u.prototype.toJSON = function() {
  29561. return {
  29562. type: "Buffer",
  29563. data: Array.prototype.slice.call(this._arr || this, 0)
  29564. }
  29565. }
  29566. ;
  29567. var D = 4096;
  29568. u.prototype.slice = function(e, t) {
  29569. var i, n = this.length;
  29570. if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
  29571. (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
  29572. t < e && (t = e),
  29573. u.TYPED_ARRAY_SUPPORT)
  29574. (i = this.subarray(e, t)).__proto__ = u.prototype;
  29575. else {
  29576. var r = t - e;
  29577. i = new u(r,void 0);
  29578. for (var o = 0; o < r; ++o)
  29579. i[o] = this[o + e]
  29580. }
  29581. return i
  29582. }
  29583. ,
  29584. u.prototype.readUIntLE = function(e, t, i) {
  29585. e |= 0,
  29586. t |= 0,
  29587. i || I(e, t, this.length);
  29588. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  29589. n += this[e + o] * r;
  29590. return n
  29591. }
  29592. ,
  29593. u.prototype.readUIntBE = function(e, t, i) {
  29594. e |= 0,
  29595. t |= 0,
  29596. i || I(e, t, this.length);
  29597. for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
  29598. n += this[e + --t] * r;
  29599. return n
  29600. }
  29601. ,
  29602. u.prototype.readUInt8 = function(e, t) {
  29603. return t || I(e, 1, this.length),
  29604. this[e]
  29605. }
  29606. ,
  29607. u.prototype.readUInt16LE = function(e, t) {
  29608. return t || I(e, 2, this.length),
  29609. this[e] | this[e + 1] << 8
  29610. }
  29611. ,
  29612. u.prototype.readUInt16BE = function(e, t) {
  29613. return t || I(e, 2, this.length),
  29614. this[e] << 8 | this[e + 1]
  29615. }
  29616. ,
  29617. u.prototype.readUInt32LE = function(e, t) {
  29618. return t || I(e, 4, this.length),
  29619. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  29620. }
  29621. ,
  29622. u.prototype.readUInt32BE = function(e, t) {
  29623. return t || I(e, 4, this.length),
  29624. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  29625. }
  29626. ,
  29627. u.prototype.readIntLE = function(e, t, i) {
  29628. e |= 0,
  29629. t |= 0,
  29630. i || I(e, t, this.length);
  29631. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  29632. n += this[e + o] * r;
  29633. return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
  29634. n
  29635. }
  29636. ,
  29637. u.prototype.readIntBE = function(e, t, i) {
  29638. e |= 0,
  29639. t |= 0,
  29640. i || I(e, t, this.length);
  29641. for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
  29642. o += this[e + --n] * r;
  29643. return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
  29644. o
  29645. }
  29646. ,
  29647. u.prototype.readInt8 = function(e, t) {
  29648. return t || I(e, 1, this.length),
  29649. 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
  29650. }
  29651. ,
  29652. u.prototype.readInt16LE = function(e, t) {
  29653. t || I(e, 2, this.length);
  29654. var i = this[e] | this[e + 1] << 8;
  29655. return 32768 & i ? 4294901760 | i : i
  29656. }
  29657. ,
  29658. u.prototype.readInt16BE = function(e, t) {
  29659. t || I(e, 2, this.length);
  29660. var i = this[e + 1] | this[e] << 8;
  29661. return 32768 & i ? 4294901760 | i : i
  29662. }
  29663. ,
  29664. u.prototype.readInt32LE = function(e, t) {
  29665. return t || I(e, 4, this.length),
  29666. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  29667. }
  29668. ,
  29669. u.prototype.readInt32BE = function(e, t) {
  29670. return t || I(e, 4, this.length),
  29671. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  29672. }
  29673. ,
  29674. u.prototype.readFloatLE = function(e, t) {
  29675. return t || I(e, 4, this.length),
  29676. O.read(this, e, !0, 23, 4)
  29677. }
  29678. ,
  29679. u.prototype.readFloatBE = function(e, t) {
  29680. return t || I(e, 4, this.length),
  29681. O.read(this, e, !1, 23, 4)
  29682. }
  29683. ,
  29684. u.prototype.readDoubleLE = function(e, t) {
  29685. return t || I(e, 8, this.length),
  29686. O.read(this, e, !0, 52, 8)
  29687. }
  29688. ,
  29689. u.prototype.readDoubleBE = function(e, t) {
  29690. return t || I(e, 8, this.length),
  29691. O.read(this, e, !1, 52, 8)
  29692. }
  29693. ,
  29694. u.prototype.writeUIntLE = function(e, t, i, n) {
  29695. e = +e,
  29696. t |= 0,
  29697. i |= 0,
  29698. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  29699. var r = 1
  29700. , o = 0;
  29701. for (this[t] = 255 & e; ++o < i && (r *= 256); )
  29702. this[t + o] = e / r & 255;
  29703. return t + i
  29704. }
  29705. ,
  29706. u.prototype.writeUIntBE = function(e, t, i, n) {
  29707. e = +e,
  29708. t |= 0,
  29709. i |= 0,
  29710. n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
  29711. var r = i - 1
  29712. , o = 1;
  29713. for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
  29714. this[t + r] = e / o & 255;
  29715. return t + i
  29716. }
  29717. ,
  29718. u.prototype.writeUInt8 = function(e, t, i) {
  29719. return e = +e,
  29720. t |= 0,
  29721. i || E(this, e, t, 1, 255, 0),
  29722. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  29723. this[t] = 255 & e,
  29724. t + 1
  29725. }
  29726. ,
  29727. u.prototype.writeUInt16LE = function(e, t, i) {
  29728. return e = +e,
  29729. t |= 0,
  29730. i || E(this, e, t, 2, 65535, 0),
  29731. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  29732. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  29733. t + 2
  29734. }
  29735. ,
  29736. u.prototype.writeUInt16BE = function(e, t, i) {
  29737. return e = +e,
  29738. t |= 0,
  29739. i || E(this, e, t, 2, 65535, 0),
  29740. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  29741. this[t + 1] = 255 & e) : _(this, e, t, !1),
  29742. t + 2
  29743. }
  29744. ,
  29745. u.prototype.writeUInt32LE = function(e, t, i) {
  29746. return e = +e,
  29747. t |= 0,
  29748. i || E(this, e, t, 4, 4294967295, 0),
  29749. u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  29750. this[t + 2] = e >>> 16,
  29751. this[t + 1] = e >>> 8,
  29752. this[t] = 255 & e) : b(this, e, t, !0),
  29753. t + 4
  29754. }
  29755. ,
  29756. u.prototype.writeUInt32BE = function(e, t, i) {
  29757. return e = +e,
  29758. t |= 0,
  29759. i || E(this, e, t, 4, 4294967295, 0),
  29760. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  29761. this[t + 1] = e >>> 16,
  29762. this[t + 2] = e >>> 8,
  29763. this[t + 3] = 255 & e) : b(this, e, t, !1),
  29764. t + 4
  29765. }
  29766. ,
  29767. u.prototype.writeIntLE = function(e, t, i, n) {
  29768. if (e = +e,
  29769. t |= 0,
  29770. !n) {
  29771. var r = Math.pow(2, 8 * i - 1);
  29772. E(this, e, t, i, r - 1, -r)
  29773. }
  29774. var o = 0
  29775. , a = 1
  29776. , s = 0;
  29777. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  29778. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  29779. this[t + o] = (e / a >> 0) - s & 255;
  29780. return t + i
  29781. }
  29782. ,
  29783. u.prototype.writeIntBE = function(e, t, i, n) {
  29784. if (e = +e,
  29785. t |= 0,
  29786. !n) {
  29787. var r = Math.pow(2, 8 * i - 1);
  29788. E(this, e, t, i, r - 1, -r)
  29789. }
  29790. var o = i - 1
  29791. , a = 1
  29792. , s = 0;
  29793. for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
  29794. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  29795. this[t + o] = (e / a >> 0) - s & 255;
  29796. return t + i
  29797. }
  29798. ,
  29799. u.prototype.writeInt8 = function(e, t, i) {
  29800. return e = +e,
  29801. t |= 0,
  29802. i || E(this, e, t, 1, 127, -128),
  29803. u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  29804. e < 0 && (e = 255 + e + 1),
  29805. this[t] = 255 & e,
  29806. t + 1
  29807. }
  29808. ,
  29809. u.prototype.writeInt16LE = function(e, t, i) {
  29810. return e = +e,
  29811. t |= 0,
  29812. i || E(this, e, t, 2, 32767, -32768),
  29813. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  29814. this[t + 1] = e >>> 8) : _(this, e, t, !0),
  29815. t + 2
  29816. }
  29817. ,
  29818. u.prototype.writeInt16BE = function(e, t, i) {
  29819. return e = +e,
  29820. t |= 0,
  29821. i || E(this, e, t, 2, 32767, -32768),
  29822. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  29823. this[t + 1] = 255 & e) : _(this, e, t, !1),
  29824. t + 2
  29825. }
  29826. ,
  29827. u.prototype.writeInt32LE = function(e, t, i) {
  29828. return e = +e,
  29829. t |= 0,
  29830. i || E(this, e, t, 4, 2147483647, -2147483648),
  29831. u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  29832. this[t + 1] = e >>> 8,
  29833. this[t + 2] = e >>> 16,
  29834. this[t + 3] = e >>> 24) : b(this, e, t, !0),
  29835. t + 4
  29836. }
  29837. ,
  29838. u.prototype.writeInt32BE = function(e, t, i) {
  29839. return e = +e,
  29840. t |= 0,
  29841. i || E(this, e, t, 4, 2147483647, -2147483648),
  29842. e < 0 && (e = 4294967295 + e + 1),
  29843. u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  29844. this[t + 1] = e >>> 16,
  29845. this[t + 2] = e >>> 8,
  29846. this[t + 3] = 255 & e) : b(this, e, t, !1),
  29847. t + 4
  29848. }
  29849. ,
  29850. u.prototype.writeFloatLE = function(e, t, i) {
  29851. return T(this, e, t, !0, i)
  29852. }
  29853. ,
  29854. u.prototype.writeFloatBE = function(e, t, i) {
  29855. return T(this, e, t, !1, i)
  29856. }
  29857. ,
  29858. u.prototype.writeDoubleLE = function(e, t, i) {
  29859. return x(this, e, t, !0, i)
  29860. }
  29861. ,
  29862. u.prototype.writeDoubleBE = function(e, t, i) {
  29863. return x(this, e, t, !1, i)
  29864. }
  29865. ,
  29866. u.prototype.copy = function(e, t, i, n) {
  29867. if (i = i || 0,
  29868. n || 0 === n || (n = this.length),
  29869. t >= e.length && (t = e.length),
  29870. t = t || 0,
  29871. 0 < n && n < i && (n = i),
  29872. n === i)
  29873. return 0;
  29874. if (0 === e.length || 0 === this.length)
  29875. return 0;
  29876. if (t < 0)
  29877. throw new RangeError("targetStart out of bounds");
  29878. if (i < 0 || i >= this.length)
  29879. throw new RangeError("sourceStart out of bounds");
  29880. if (n < 0)
  29881. throw new RangeError("sourceEnd out of bounds");
  29882. n > this.length && (n = this.length),
  29883. e.length - t < n - i && (n = e.length - t + i);
  29884. var r, o = n - i;
  29885. if (this === e && i < t && t < n)
  29886. for (r = o - 1; 0 <= r; --r)
  29887. e[r + t] = this[r + i];
  29888. else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
  29889. for (r = 0; r < o; ++r)
  29890. e[r + t] = this[r + i];
  29891. else
  29892. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  29893. return o
  29894. }
  29895. ,
  29896. u.prototype.fill = function(e, t, i, n) {
  29897. if ("string" == typeof e) {
  29898. if ("string" == typeof t ? (n = t,
  29899. t = 0,
  29900. i = this.length) : "string" == typeof i && (n = i,
  29901. i = this.length),
  29902. 1 === e.length) {
  29903. var r = e.charCodeAt(0);
  29904. r < 256 && (e = r)
  29905. }
  29906. if (void 0 !== n && "string" != typeof n)
  29907. throw new TypeError("encoding must be a string");
  29908. if ("string" == typeof n && !u.isEncoding(n))
  29909. throw new TypeError("Unknown encoding: " + n)
  29910. } else
  29911. "number" == typeof e && (e &= 255);
  29912. if (t < 0 || this.length < t || this.length < i)
  29913. throw new RangeError("Out of range index");
  29914. if (i <= t)
  29915. return this;
  29916. var o;
  29917. if (t >>>= 0,
  29918. i = void 0 === i ? this.length : i >>> 0,
  29919. "number" == typeof (e = e || 0))
  29920. for (o = t; o < i; ++o)
  29921. this[o] = e;
  29922. else {
  29923. var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
  29924. , s = a.length;
  29925. for (o = 0; o < i - t; ++o)
  29926. this[o + t] = a[o % s]
  29927. }
  29928. return this
  29929. }
  29930. ;
  29931. var t = /[^+\/0-9A-Za-z-_]/g
  29932. }
  29933. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  29934. }
  29935. , {
  29936. "base64-js": 199,
  29937. ieee754: 200,
  29938. isarray: 201
  29939. }],
  29940. 199: [function(e, t, i) {
  29941. "use strict";
  29942. function l(e) {
  29943. var t = e.length;
  29944. if (0 < t % 4)
  29945. throw new Error("Invalid string. Length must be a multiple of 4");
  29946. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  29947. }
  29948. function c(e, t, i) {
  29949. for (var n, r = [], o = t; o < i; o += 3)
  29950. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  29951. r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
  29952. var a;
  29953. return r.join("")
  29954. }
  29955. i.byteLength = function(e) {
  29956. return 3 * e.length / 4 - l(e)
  29957. }
  29958. ,
  29959. i.toByteArray = function(e) {
  29960. var t, i, n, r, o, a = e.length;
  29961. r = l(e),
  29962. o = new d(3 * a / 4 - r),
  29963. i = 0 < r ? a - 4 : a;
  29964. var s = 0;
  29965. for (t = 0; t < i; t += 4,
  29966. 3)
  29967. n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
  29968. o[s++] = n >> 16 & 255,
  29969. o[s++] = n >> 8 & 255,
  29970. o[s++] = 255 & n;
  29971. return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
  29972. o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
  29973. o[s++] = n >> 8 & 255,
  29974. o[s++] = 255 & n),
  29975. o
  29976. }
  29977. ,
  29978. i.fromByteArray = function(e) {
  29979. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
  29980. o.push(c(e, a, s < a + 16383 ? s : a + 16383));
  29981. return 1 == n ? (t = e[i - 1],
  29982. r += h[t >> 2],
  29983. r += h[t << 4 & 63],
  29984. r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
  29985. r += h[t >> 10],
  29986. r += h[t >> 4 & 63],
  29987. r += h[t << 2 & 63],
  29988. r += "="),
  29989. o.push(r),
  29990. o.join("")
  29991. }
  29992. ;
  29993. for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
  29994. h[r] = n[r],
  29995. u[n.charCodeAt(r)] = r;
  29996. u["-".charCodeAt(0)] = 62,
  29997. u["_".charCodeAt(0)] = 63
  29998. }
  29999. , {}],
  30000. 200: [function(e, t, i) {
  30001. i.read = function(e, t, i, n, r) {
  30002. 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];
  30003. for (u += d,
  30004. o = p & (1 << -h) - 1,
  30005. p >>= -h,
  30006. h += s; 0 < h; o = 256 * o + e[t + u],
  30007. u += d,
  30008. h -= 8)
  30009. ;
  30010. for (a = o & (1 << -h) - 1,
  30011. o >>= -h,
  30012. h += n; 0 < h; a = 256 * a + e[t + u],
  30013. u += d,
  30014. h -= 8)
  30015. ;
  30016. if (0 === o)
  30017. o = 1 - c;
  30018. else {
  30019. if (o === l)
  30020. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  30021. a += Math.pow(2, n),
  30022. o -= c
  30023. }
  30024. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30025. }
  30026. ,
  30027. i.write = function(e, t, i, n, r, o) {
  30028. 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;
  30029. for (t = Math.abs(t),
  30030. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30031. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30032. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30033. l *= 2),
  30034. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  30035. l /= 2),
  30036. h <= a + u ? (s = 0,
  30037. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  30038. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30039. a = 0)); 8 <= r; e[i + p] = 255 & s,
  30040. p += f,
  30041. s /= 256,
  30042. r -= 8)
  30043. ;
  30044. for (a = a << r | s,
  30045. c += r; 0 < c; e[i + p] = 255 & a,
  30046. p += f,
  30047. a /= 256,
  30048. c -= 8)
  30049. ;
  30050. e[i + p - f] |= 128 * g
  30051. }
  30052. }
  30053. , {}],
  30054. 201: [function(e, t, i) {
  30055. var n = {}.toString;
  30056. t.exports = Array.isArray || function(e) {
  30057. return "[object Array]" == n.call(e)
  30058. }
  30059. }
  30060. , {}],
  30061. 202: [function(e, t, i) {
  30062. function n() {
  30063. this._events = this._events || {},
  30064. this._maxListeners = this._maxListeners || void 0
  30065. }
  30066. function l(e) {
  30067. return "function" == typeof e
  30068. }
  30069. function c(e) {
  30070. return "object" == typeof e && null !== e
  30071. }
  30072. function h(e) {
  30073. return void 0 === e
  30074. }
  30075. ((t.exports = n).EventEmitter = n).prototype._events = void 0,
  30076. n.prototype._maxListeners = void 0,
  30077. n.defaultMaxListeners = 10,
  30078. n.prototype.setMaxListeners = function(e) {
  30079. if (!function(e) {
  30080. return "number" == typeof e
  30081. }(e) || e < 0 || isNaN(e))
  30082. throw TypeError("n must be a positive number");
  30083. return this._maxListeners = e,
  30084. this
  30085. }
  30086. ,
  30087. n.prototype.emit = function(e) {
  30088. var t, i, n, r, o, a;
  30089. if (this._events || (this._events = {}),
  30090. "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
  30091. if ((t = arguments[1])instanceof Error)
  30092. throw t;
  30093. var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30094. throw s.context = t,
  30095. s
  30096. }
  30097. if (h(i = this._events[e]))
  30098. return !1;
  30099. if (l(i))
  30100. switch (arguments.length) {
  30101. case 1:
  30102. i.call(this);
  30103. break;
  30104. case 2:
  30105. i.call(this, arguments[1]);
  30106. break;
  30107. case 3:
  30108. i.call(this, arguments[1], arguments[2]);
  30109. break;
  30110. default:
  30111. r = Array.prototype.slice.call(arguments, 1),
  30112. i.apply(this, r)
  30113. }
  30114. else if (c(i))
  30115. for (r = Array.prototype.slice.call(arguments, 1),
  30116. n = (a = i.slice()).length,
  30117. o = 0; o < n; o++)
  30118. a[o].apply(this, r);
  30119. return !0
  30120. }
  30121. ,
  30122. n.prototype.on = n.prototype.addListener = function(e, t) {
  30123. var i;
  30124. if (!l(t))
  30125. throw TypeError("listener must be a function");
  30126. return this._events || (this._events = {}),
  30127. this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
  30128. this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30129. 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,
  30130. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30131. "function" == typeof console.trace && console.trace())),
  30132. this
  30133. }
  30134. ,
  30135. n.prototype.once = function(e, t) {
  30136. function i() {
  30137. this.removeListener(e, i),
  30138. n || (n = !0,
  30139. t.apply(this, arguments))
  30140. }
  30141. if (!l(t))
  30142. throw TypeError("listener must be a function");
  30143. var n = !1;
  30144. return i.listener = t,
  30145. this.on(e, i),
  30146. this
  30147. }
  30148. ,
  30149. n.prototype.removeListener = function(e, t) {
  30150. var i, n, r, o;
  30151. if (!l(t))
  30152. throw TypeError("listener must be a function");
  30153. if (!this._events || !this._events[e])
  30154. return this;
  30155. if (r = (i = this._events[e]).length,
  30156. n = -1,
  30157. i === t || l(i.listener) && i.listener === t)
  30158. delete this._events[e],
  30159. this._events.removeListener && this.emit("removeListener", e, t);
  30160. else if (c(i)) {
  30161. for (o = r; 0 < o--; )
  30162. if (i[o] === t || i[o].listener && i[o].listener === t) {
  30163. n = o;
  30164. break
  30165. }
  30166. if (n < 0)
  30167. return this;
  30168. 1 === i.length ? (i.length = 0,
  30169. delete this._events[e]) : i.splice(n, 1),
  30170. this._events.removeListener && this.emit("removeListener", e, t)
  30171. }
  30172. return this
  30173. }
  30174. ,
  30175. n.prototype.removeAllListeners = function(e) {
  30176. var t, i;
  30177. if (!this._events)
  30178. return this;
  30179. if (!this._events.removeListener)
  30180. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30181. this;
  30182. if (0 === arguments.length) {
  30183. for (t in this._events)
  30184. "removeListener" !== t && this.removeAllListeners(t);
  30185. return this.removeAllListeners("removeListener"),
  30186. this._events = {},
  30187. this
  30188. }
  30189. if (l(i = this._events[e]))
  30190. this.removeListener(e, i);
  30191. else if (i)
  30192. for (; i.length; )
  30193. this.removeListener(e, i[i.length - 1]);
  30194. return delete this._events[e],
  30195. this
  30196. }
  30197. ,
  30198. n.prototype.listeners = function(e) {
  30199. return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30200. }
  30201. ,
  30202. n.prototype.listenerCount = function(e) {
  30203. if (this._events) {
  30204. var t = this._events[e];
  30205. if (l(t))
  30206. return 1;
  30207. if (t)
  30208. return t.length
  30209. }
  30210. return 0
  30211. }
  30212. ,
  30213. n.listenerCount = function(e, t) {
  30214. return e.listenerCount(t)
  30215. }
  30216. }
  30217. , {}],
  30218. 203: [function(e, t, i) {
  30219. function n() {
  30220. throw new Error("setTimeout has not been defined")
  30221. }
  30222. function r() {
  30223. throw new Error("clearTimeout has not been defined")
  30224. }
  30225. function o(t) {
  30226. if (h === setTimeout)
  30227. return setTimeout(t, 0);
  30228. if ((h === n || !h) && setTimeout)
  30229. return h = setTimeout,
  30230. setTimeout(t, 0);
  30231. try {
  30232. return h(t, 0)
  30233. } catch (e) {
  30234. try {
  30235. return h.call(null, t, 0)
  30236. } catch (e) {
  30237. return h.call(this, t, 0)
  30238. }
  30239. }
  30240. }
  30241. function a() {
  30242. g && p && (g = !1,
  30243. p.length ? f = p.concat(f) : m = -1,
  30244. f.length && s())
  30245. }
  30246. function s() {
  30247. if (!g) {
  30248. var e = o(a);
  30249. g = !0;
  30250. for (var t = f.length; t; ) {
  30251. for (p = f,
  30252. f = []; ++m < t; )
  30253. p && p[m].run();
  30254. m = -1,
  30255. t = f.length
  30256. }
  30257. p = null,
  30258. g = !1,
  30259. function(t) {
  30260. if (u === clearTimeout)
  30261. return clearTimeout(t);
  30262. if ((u === r || !u) && clearTimeout)
  30263. return u = clearTimeout,
  30264. clearTimeout(t);
  30265. try {
  30266. u(t)
  30267. } catch (e) {
  30268. try {
  30269. return u.call(null, t)
  30270. } catch (e) {
  30271. return u.call(this, t)
  30272. }
  30273. }
  30274. }(e)
  30275. }
  30276. }
  30277. function l(e, t) {
  30278. this.fun = e,
  30279. this.array = t
  30280. }
  30281. function c() {}
  30282. var h, u, d = t.exports = {};
  30283. !function() {
  30284. try {
  30285. h = "function" == typeof setTimeout ? setTimeout : n
  30286. } catch (e) {
  30287. h = n
  30288. }
  30289. try {
  30290. u = "function" == typeof clearTimeout ? clearTimeout : r
  30291. } catch (e) {
  30292. u = r
  30293. }
  30294. }();
  30295. var p, f = [], g = !1, m = -1;
  30296. d.nextTick = function(e) {
  30297. var t = new Array(arguments.length - 1);
  30298. if (1 < arguments.length)
  30299. for (var i = 1; i < arguments.length; i++)
  30300. t[i - 1] = arguments[i];
  30301. f.push(new l(e,t)),
  30302. 1 !== f.length || g || o(s)
  30303. }
  30304. ,
  30305. l.prototype.run = function() {
  30306. this.fun.apply(null, this.array)
  30307. }
  30308. ,
  30309. d.title = "browser",
  30310. d.browser = !0,
  30311. d.env = {},
  30312. d.argv = [],
  30313. d.version = "",
  30314. d.versions = {},
  30315. d.on = c,
  30316. d.addListener = c,
  30317. d.once = c,
  30318. d.off = c,
  30319. d.removeListener = c,
  30320. d.removeAllListeners = c,
  30321. d.emit = c,
  30322. d.binding = function(e) {
  30323. throw new Error("process.binding is not supported")
  30324. }
  30325. ,
  30326. d.cwd = function() {
  30327. return "/"
  30328. }
  30329. ,
  30330. d.chdir = function(e) {
  30331. throw new Error("process.chdir is not supported")
  30332. }
  30333. ,
  30334. d.umask = function() {
  30335. return 0
  30336. }
  30337. }
  30338. , {}],
  30339. 204: [function(e, O, L) {
  30340. (function(P) {
  30341. !function(e) {
  30342. function v(e) {
  30343. throw new RangeError(g[e])
  30344. }
  30345. function r(e, t) {
  30346. for (var i = e.length, n = []; i--; )
  30347. n[i] = t(e[i]);
  30348. return n
  30349. }
  30350. function t(e, t) {
  30351. var i = e.split("@")
  30352. , n = "";
  30353. return 1 < i.length && (n = i[0] + "@",
  30354. e = i[1]),
  30355. n + r((e = e.replace(f, ".")).split("."), t).join(".")
  30356. }
  30357. function y(e) {
  30358. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  30359. 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),
  30360. r--) : n.push(t);
  30361. return n
  30362. }
  30363. function A(e) {
  30364. return r(e, function(e) {
  30365. var t = "";
  30366. return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
  30367. e = 56320 | 1023 & e),
  30368. t + R(e)
  30369. }).join("")
  30370. }
  30371. function C(e, t) {
  30372. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  30373. }
  30374. function I(e, t, i) {
  30375. var n = 0;
  30376. for (e = i ? M(e / u) : e >> 1,
  30377. e += M(e / t); m * w >> 1 < e; n += _)
  30378. e = M(e / m);
  30379. return M(n + (m + 1) * e / (e + h))
  30380. }
  30381. function i(e) {
  30382. var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
  30383. for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
  30384. n = 0; n < i; ++n)
  30385. 128 <= e.charCodeAt(n) && v("not-basic"),
  30386. d.push(e.charCodeAt(n));
  30387. for (r = 0 < i ? i + 1 : 0; r < p; ) {
  30388. for (o = f,
  30389. a = 1,
  30390. s = _; p <= r && v("invalid-input"),
  30391. u = e.charCodeAt(r++),
  30392. (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
  30393. f += l * a,
  30394. !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
  30395. a > M(E / (h = _ - c)) && v("overflow"),
  30396. a *= h;
  30397. m = I(f - o, t = d.length + 1, 0 == o),
  30398. M(f / t) > E - g && v("overflow"),
  30399. g += M(f / t),
  30400. f %= t,
  30401. d.splice(f++, 0, g)
  30402. }
  30403. return A(d)
  30404. }
  30405. function n(e) {
  30406. var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
  30407. for (d = (e = y(e)).length,
  30408. t = x,
  30409. o = T,
  30410. a = i = 0; a < d; ++a)
  30411. (u = e[a]) < 128 && m.push(R(u));
  30412. for (n = r = m.length,
  30413. r && m.push(S); n < d; ) {
  30414. for (s = E,
  30415. a = 0; a < d; ++a)
  30416. t <= (u = e[a]) && u < s && (s = u);
  30417. for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
  30418. i += (s - t) * p,
  30419. t = s,
  30420. a = 0; a < d; ++a)
  30421. if ((u = e[a]) < t && ++i > E && v("overflow"),
  30422. u == t) {
  30423. for (l = i,
  30424. c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
  30425. g = l - h,
  30426. f = _ - h,
  30427. m.push(R(C(h + g % f, 0))),
  30428. l = M(g / f);
  30429. m.push(R(C(l, 0))),
  30430. o = I(i, p, n == r),
  30431. i = 0,
  30432. ++n
  30433. }
  30434. ++i,
  30435. ++t
  30436. }
  30437. return m.join("")
  30438. }
  30439. var o = "object" == typeof L && L && !L.nodeType && L
  30440. , a = "object" == typeof O && O && !O.nodeType && O
  30441. , s = "object" == typeof P && P;
  30442. s.global !== s && s.window !== s && s.self !== s || (e = s);
  30443. 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 = {
  30444. overflow: "Overflow: input needs wider integers to process",
  30445. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  30446. "invalid-input": "Invalid input"
  30447. }, m = _ - b, M = Math.floor, R = String.fromCharCode;
  30448. if (l = {
  30449. version: "1.4.1",
  30450. ucs2: {
  30451. decode: y,
  30452. encode: A
  30453. },
  30454. decode: i,
  30455. encode: n,
  30456. toASCII: function(e) {
  30457. return t(e, function(e) {
  30458. return p.test(e) ? "xn--" + n(e) : e
  30459. })
  30460. },
  30461. toUnicode: function(e) {
  30462. return t(e, function(e) {
  30463. return d.test(e) ? i(e.slice(4).toLowerCase()) : e
  30464. })
  30465. }
  30466. },
  30467. "function" == typeof define && "object" == typeof define.amd && define.amd)
  30468. define("punycode", function() {
  30469. return l
  30470. });
  30471. else if (o && a)
  30472. if (O.exports == o)
  30473. a.exports = l;
  30474. else
  30475. for (c in l)
  30476. l.hasOwnProperty(c) && (o[c] = l[c]);
  30477. else
  30478. e.punycode = l
  30479. }(this)
  30480. }
  30481. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30482. }
  30483. , {}],
  30484. 205: [function(e, t, i) {
  30485. "use strict";
  30486. t.exports = function(e, t, i, n) {
  30487. t = t || "&",
  30488. i = i || "=";
  30489. var r = {};
  30490. if ("string" != typeof e || 0 === e.length)
  30491. return r;
  30492. var o = /\+/g;
  30493. e = e.split(t);
  30494. var a = 1e3;
  30495. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  30496. var s, l, c = e.length;
  30497. 0 < a && a < c && (c = a);
  30498. for (var h = 0; h < c; ++h) {
  30499. var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
  30500. d = 0 <= m ? (u = g.substr(0, m),
  30501. g.substr(m + 1)) : (u = g,
  30502. ""),
  30503. p = decodeURIComponent(u),
  30504. f = decodeURIComponent(d),
  30505. s = r,
  30506. l = p,
  30507. Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
  30508. }
  30509. return r
  30510. }
  30511. ;
  30512. var v = Array.isArray || function(e) {
  30513. return "[object Array]" === Object.prototype.toString.call(e)
  30514. }
  30515. }
  30516. , {}],
  30517. 206: [function(e, t, i) {
  30518. "use strict";
  30519. function o(e, t) {
  30520. if (e.map)
  30521. return e.map(t);
  30522. for (var i = [], n = 0; n < e.length; n++)
  30523. i.push(t(e[n], n));
  30524. return i
  30525. }
  30526. function a(e) {
  30527. switch (typeof e) {
  30528. case "string":
  30529. return e;
  30530. case "boolean":
  30531. return e ? "true" : "false";
  30532. case "number":
  30533. return isFinite(e) ? e : "";
  30534. default:
  30535. return ""
  30536. }
  30537. }
  30538. t.exports = function(i, n, r, e) {
  30539. return n = n || "&",
  30540. r = r || "=",
  30541. null === i && (i = void 0),
  30542. "object" == typeof i ? o(l(i), function(e) {
  30543. var t = encodeURIComponent(a(e)) + r;
  30544. return s(i[e]) ? o(i[e], function(e) {
  30545. return t + encodeURIComponent(a(e))
  30546. }).join(n) : t + encodeURIComponent(a(i[e]))
  30547. }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
  30548. }
  30549. ;
  30550. var s = Array.isArray || function(e) {
  30551. return "[object Array]" === Object.prototype.toString.call(e)
  30552. }
  30553. , l = Object.keys || function(e) {
  30554. var t = [];
  30555. for (var i in e)
  30556. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  30557. return t
  30558. }
  30559. }
  30560. , {}],
  30561. 207: [function(e, t, i) {
  30562. "use strict";
  30563. i.decode = i.parse = e("./decode"),
  30564. i.encode = i.stringify = e("./encode")
  30565. }
  30566. , {
  30567. "./decode": 205,
  30568. "./encode": 206
  30569. }],
  30570. 208: [function(e, t, i) {
  30571. "use strict";
  30572. function x() {
  30573. this.protocol = null,
  30574. this.slashes = null,
  30575. this.auth = null,
  30576. this.host = null,
  30577. this.port = null,
  30578. this.hostname = null,
  30579. this.hash = null,
  30580. this.search = null,
  30581. this.query = null,
  30582. this.pathname = null,
  30583. this.path = null,
  30584. this.href = null
  30585. }
  30586. function n(e, t, i) {
  30587. if (e && D.isObject(e) && e instanceof x)
  30588. return e;
  30589. var n = new x;
  30590. return n.parse(e, t, i),
  30591. n
  30592. }
  30593. var L = e("punycode")
  30594. , D = e("./util");
  30595. i.parse = n,
  30596. i.resolve = function(e, t) {
  30597. return n(e, !1, !0).resolve(t)
  30598. }
  30599. ,
  30600. i.resolveObject = function(e, t) {
  30601. return e ? n(e, !1, !0).resolveObject(t) : t
  30602. }
  30603. ,
  30604. i.format = function(e) {
  30605. return D.isString(e) && (e = n(e)),
  30606. e instanceof x ? e.format() : x.prototype.format.call(e)
  30607. }
  30608. ,
  30609. i.Url = x;
  30610. var N = /^([a-z0-9.+-]+:)/i
  30611. , r = /:[0-9]*$/
  30612. , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  30613. , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
  30614. , B = ["'"].concat(o)
  30615. , V = ["%", "/", "?", ";", "#"].concat(B)
  30616. , k = ["/", "?", "#"]
  30617. , U = /^[+a-z0-9A-Z_-]{0,63}$/
  30618. , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  30619. , z = {
  30620. javascript: !0,
  30621. "javascript:": !0
  30622. }
  30623. , G = {
  30624. javascript: !0,
  30625. "javascript:": !0
  30626. }
  30627. , W = {
  30628. http: !0,
  30629. https: !0,
  30630. ftp: !0,
  30631. gopher: !0,
  30632. file: !0,
  30633. "http:": !0,
  30634. "https:": !0,
  30635. "ftp:": !0,
  30636. "gopher:": !0,
  30637. "file:": !0
  30638. }
  30639. , j = e("querystring");
  30640. x.prototype.parse = function(e, t, i) {
  30641. if (!D.isString(e))
  30642. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  30643. var n = e.indexOf("?")
  30644. , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
  30645. , o = e.split(r);
  30646. o[0] = o[0].replace(/\\/g, "/");
  30647. var a = e = o.join(r);
  30648. if (a = a.trim(),
  30649. !i && 1 === e.split("#").length) {
  30650. var s = F.exec(a);
  30651. if (s)
  30652. return this.path = a,
  30653. this.href = a,
  30654. this.pathname = s[1],
  30655. s[2] ? (this.search = s[2],
  30656. this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
  30657. this.query = {}),
  30658. this
  30659. }
  30660. var l = N.exec(a);
  30661. if (l) {
  30662. var c = (l = l[0]).toLowerCase();
  30663. this.protocol = c,
  30664. a = a.substr(l.length)
  30665. }
  30666. if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  30667. var h = "//" === a.substr(0, 2);
  30668. !h || l && G[l] || (a = a.substr(2),
  30669. this.slashes = !0)
  30670. }
  30671. if (!G[l] && (h || l && !W[l])) {
  30672. for (var u = -1, d = 0; d < k.length; d++) {
  30673. -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
  30674. }
  30675. var p, f;
  30676. -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
  30677. a = a.slice(f + 1),
  30678. this.auth = decodeURIComponent(p)),
  30679. u = -1;
  30680. for (d = 0; d < V.length; d++) {
  30681. var g;
  30682. -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
  30683. }
  30684. -1 === u && (u = a.length),
  30685. this.host = a.slice(0, u),
  30686. a = a.slice(u),
  30687. this.parseHost(),
  30688. this.hostname = this.hostname || "";
  30689. var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  30690. if (!m)
  30691. for (var v = this.hostname.split(/\./), y = (d = 0,
  30692. v.length); d < y; d++) {
  30693. var A = v[d];
  30694. if (A && !A.match(U)) {
  30695. for (var C = "", I = 0, E = A.length; I < E; I++)
  30696. C += 127 < A.charCodeAt(I) ? "x" : A[I];
  30697. if (!C.match(U)) {
  30698. var _ = v.slice(0, d)
  30699. , b = v.slice(d + 1)
  30700. , w = A.match(H);
  30701. w && (_.push(w[1]),
  30702. b.unshift(w[2])),
  30703. b.length && (a = "/" + b.join(".") + a),
  30704. this.hostname = _.join(".");
  30705. break
  30706. }
  30707. }
  30708. }
  30709. 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  30710. m || (this.hostname = L.toASCII(this.hostname));
  30711. var T = this.port ? ":" + this.port : ""
  30712. , x = this.hostname || "";
  30713. this.host = x + T,
  30714. this.href += this.host,
  30715. m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  30716. "/" !== a[0] && (a = "/" + a))
  30717. }
  30718. if (!z[c])
  30719. for (d = 0,
  30720. y = B.length; d < y; d++) {
  30721. var S = B[d];
  30722. if (-1 !== a.indexOf(S)) {
  30723. var M = encodeURIComponent(S);
  30724. M === S && (M = escape(S)),
  30725. a = a.split(S).join(M)
  30726. }
  30727. }
  30728. var R = a.indexOf("#");
  30729. -1 !== R && (this.hash = a.substr(R),
  30730. a = a.slice(0, R));
  30731. var P = a.indexOf("?");
  30732. if (-1 !== P ? (this.search = a.substr(P),
  30733. this.query = a.substr(P + 1),
  30734. t && (this.query = j.parse(this.query)),
  30735. a = a.slice(0, P)) : t && (this.search = "",
  30736. this.query = {}),
  30737. a && (this.pathname = a),
  30738. W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
  30739. this.pathname || this.search) {
  30740. T = this.pathname || "";
  30741. var O = this.search || "";
  30742. this.path = T + O
  30743. }
  30744. return this.href = this.format(),
  30745. this
  30746. }
  30747. ,
  30748. x.prototype.format = function() {
  30749. var e = this.auth || "";
  30750. e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
  30751. e += "@");
  30752. var t = this.protocol || ""
  30753. , i = this.pathname || ""
  30754. , n = this.hash || ""
  30755. , r = !1
  30756. , o = "";
  30757. this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
  30758. this.port && (r += ":" + this.port)),
  30759. this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
  30760. var a = this.search || o && "?" + o || "";
  30761. return t && ":" !== t.substr(-1) && (t += ":"),
  30762. this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
  30763. i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
  30764. n && "#" !== n.charAt(0) && (n = "#" + n),
  30765. a && "?" !== a.charAt(0) && (a = "?" + a),
  30766. t + r + (i = i.replace(/[?#]/g, function(e) {
  30767. return encodeURIComponent(e)
  30768. })) + (a = a.replace("#", "%23")) + n
  30769. }
  30770. ,
  30771. x.prototype.resolve = function(e) {
  30772. return this.resolveObject(n(e, !1, !0)).format()
  30773. }
  30774. ,
  30775. x.prototype.resolveObject = function(e) {
  30776. if (D.isString(e)) {
  30777. var t = new x;
  30778. t.parse(e, !1, !0),
  30779. e = t
  30780. }
  30781. for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
  30782. var o = n[r];
  30783. i[o] = this[o]
  30784. }
  30785. if (i.hash = e.hash,
  30786. "" === e.href)
  30787. return i.href = i.format(),
  30788. i;
  30789. if (e.slashes && !e.protocol) {
  30790. for (var a = Object.keys(e), s = 0; s < a.length; s++) {
  30791. var l = a[s];
  30792. "protocol" !== l && (i[l] = e[l])
  30793. }
  30794. return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  30795. i.href = i.format(),
  30796. i
  30797. }
  30798. if (e.protocol && e.protocol !== i.protocol) {
  30799. if (!W[e.protocol]) {
  30800. for (var c = Object.keys(e), h = 0; h < c.length; h++) {
  30801. var u = c[h];
  30802. i[u] = e[u]
  30803. }
  30804. return i.href = i.format(),
  30805. i
  30806. }
  30807. if (i.protocol = e.protocol,
  30808. e.host || G[e.protocol])
  30809. i.pathname = e.pathname;
  30810. else {
  30811. for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
  30812. ;
  30813. e.host || (e.host = ""),
  30814. e.hostname || (e.hostname = ""),
  30815. "" !== d[0] && d.unshift(""),
  30816. d.length < 2 && d.unshift(""),
  30817. i.pathname = d.join("/")
  30818. }
  30819. if (i.search = e.search,
  30820. i.query = e.query,
  30821. i.host = e.host || "",
  30822. i.auth = e.auth,
  30823. i.hostname = e.hostname || e.host,
  30824. i.port = e.port,
  30825. i.pathname || i.search) {
  30826. var p = i.pathname || ""
  30827. , f = i.search || "";
  30828. i.path = p + f
  30829. }
  30830. return i.slashes = i.slashes || e.slashes,
  30831. i.href = i.format(),
  30832. i
  30833. }
  30834. var g = i.pathname && "/" === i.pathname.charAt(0)
  30835. , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
  30836. , v = m || g || i.host && e.pathname
  30837. , y = v
  30838. , A = i.pathname && i.pathname.split("/") || []
  30839. , C = (d = e.pathname && e.pathname.split("/") || [],
  30840. i.protocol && !W[i.protocol]);
  30841. if (C && (i.hostname = "",
  30842. i.port = null,
  30843. i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
  30844. i.host = "",
  30845. e.protocol && (e.hostname = null,
  30846. e.port = null,
  30847. e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
  30848. e.host = null),
  30849. v = v && ("" === d[0] || "" === A[0])),
  30850. m)
  30851. i.host = e.host || "" === e.host ? e.host : i.host,
  30852. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  30853. i.search = e.search,
  30854. i.query = e.query,
  30855. A = d;
  30856. else if (d.length)
  30857. (A = A || []).pop(),
  30858. A = A.concat(d),
  30859. i.search = e.search,
  30860. i.query = e.query;
  30861. else if (!D.isNullOrUndefined(e.search)) {
  30862. if (C)
  30863. i.hostname = i.host = A.shift(),
  30864. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  30865. i.host = i.hostname = w.shift());
  30866. return i.search = e.search,
  30867. i.query = e.query,
  30868. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  30869. i.href = i.format(),
  30870. i
  30871. }
  30872. if (!A.length)
  30873. return i.pathname = null,
  30874. i.search ? i.path = "/" + i.search : i.path = null,
  30875. i.href = i.format(),
  30876. i;
  30877. 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--)
  30878. "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
  30879. _++) : _ && (A.splice(b, 1),
  30880. _--);
  30881. if (!v && !y)
  30882. for (; _--; )
  30883. A.unshift("..");
  30884. !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
  30885. E && "/" !== A.join("/").substr(-1) && A.push("");
  30886. var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
  30887. C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
  30888. (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
  30889. i.host = i.hostname = w.shift()));
  30890. return (v = v || i.host && A.length) && !T && A.unshift(""),
  30891. A.length ? i.pathname = A.join("/") : (i.pathname = null,
  30892. i.path = null),
  30893. D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  30894. i.auth = e.auth || i.auth,
  30895. i.slashes = i.slashes || e.slashes,
  30896. i.href = i.format(),
  30897. i
  30898. }
  30899. ,
  30900. x.prototype.parseHost = function() {
  30901. var e = this.host
  30902. , t = r.exec(e);
  30903. t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
  30904. e = e.substr(0, e.length - t.length)),
  30905. e && (this.hostname = e)
  30906. }
  30907. }
  30908. , {
  30909. "./util": 209,
  30910. punycode: 204,
  30911. querystring: 207
  30912. }],
  30913. 209: [function(e, t, i) {
  30914. "use strict";
  30915. t.exports = {
  30916. isString: function(e) {
  30917. return "string" == typeof e
  30918. },
  30919. isObject: function(e) {
  30920. return "object" == typeof e && null !== e
  30921. },
  30922. isNull: function(e) {
  30923. return null === e
  30924. },
  30925. isNullOrUndefined: function(e) {
  30926. return null == e
  30927. }
  30928. }
  30929. }
  30930. , {}],
  30931. 210: [function(e, t, i) {
  30932. "use strict";
  30933. function r(e) {
  30934. return c + e
  30935. }
  30936. function s(e) {
  30937. if ("string" != typeof e)
  30938. throw new TypeError("key must be a string.")
  30939. }
  30940. var l = Object.prototype.hasOwnProperty
  30941. , c = "~";
  30942. t.exports = function(t) {
  30943. var o = Object.create(null)
  30944. , n = 0
  30945. , a = {};
  30946. return function(e, t) {
  30947. for (var i in t)
  30948. Object.defineProperty(e, i, {
  30949. value: t[i],
  30950. configurable: !0,
  30951. writable: !0
  30952. })
  30953. }(a, {
  30954. get: function(e, t) {
  30955. s(e);
  30956. var i = r(e);
  30957. return i in o ? o[i] : t
  30958. },
  30959. set: function(e, t) {
  30960. s(e);
  30961. var i = r(e);
  30962. return i in o || ++n,
  30963. o[i] = t
  30964. },
  30965. has: function(e) {
  30966. return s(e),
  30967. r(e)in o
  30968. },
  30969. delete: function(e) {
  30970. s(e);
  30971. var t = r(e);
  30972. return t in o && (--n,
  30973. delete o[t],
  30974. !0)
  30975. },
  30976. clear: function() {
  30977. o = Object.create(null),
  30978. n = 0
  30979. },
  30980. forEach: function(e, t) {
  30981. if ("function" != typeof e)
  30982. throw new TypeError("`callback` must be a function");
  30983. for (var i in o)
  30984. if (l.call(o, i)) {
  30985. var n = i.substring(c.length)
  30986. , r = o[i];
  30987. e.call(t, r, n, a)
  30988. }
  30989. }
  30990. }),
  30991. Object.defineProperty(a, "size", {
  30992. get: function() {
  30993. return n
  30994. },
  30995. configurable: !0
  30996. }),
  30997. "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
  30998. a.set(e, t[e])
  30999. }),
  31000. a
  31001. }
  31002. }
  31003. , {}],
  31004. 211: [function(e, t, i) {
  31005. t.exports = e("./lib/heap")
  31006. }
  31007. , {
  31008. "./lib/heap": 212
  31009. }],
  31010. 212: [function(e, y, A) {
  31011. (function() {
  31012. var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
  31013. function v(e) {
  31014. this.cmp = null != e ? e : d,
  31015. this.nodes = []
  31016. }
  31017. l = Math.floor,
  31018. m = Math.min,
  31019. d = function(e, t) {
  31020. return e < t ? -1 : t < e ? 1 : 0
  31021. }
  31022. ,
  31023. g = function(e, t, i, n, r) {
  31024. var o;
  31025. if (null == i && (i = 0),
  31026. null == r && (r = d),
  31027. i < 0)
  31028. throw new Error("lo must be non-negative");
  31029. for (null == n && (n = e.length); i < n; )
  31030. r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
  31031. return [].splice.apply(e, [i, i - i].concat(t)),
  31032. t
  31033. }
  31034. ,
  31035. t = function(e, t, i) {
  31036. return null == i && (i = d),
  31037. e.push(t),
  31038. h(e, 0, e.length - 1, i)
  31039. }
  31040. ,
  31041. f = function(e, t) {
  31042. var i, n;
  31043. return null == t && (t = d),
  31044. i = e.pop(),
  31045. e.length ? (n = e[0],
  31046. e[0] = i,
  31047. u(e, 0, t)) : n = i,
  31048. n
  31049. }
  31050. ,
  31051. i = function(e, t, i) {
  31052. var n;
  31053. return null == i && (i = d),
  31054. n = e[0],
  31055. e[0] = t,
  31056. u(e, 0, i),
  31057. n
  31058. }
  31059. ,
  31060. c = function(e, t, i) {
  31061. var n;
  31062. return null == i && (i = d),
  31063. e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
  31064. e[0] = n[1],
  31065. u(e, 0, i)),
  31066. t
  31067. }
  31068. ,
  31069. p = function(i, e) {
  31070. var t, n, r, o, a, s;
  31071. for (null == e && (e = d),
  31072. a = [],
  31073. n = 0,
  31074. r = (o = function() {
  31075. s = [];
  31076. for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
  31077. s.push(e);
  31078. return s
  31079. }
  31080. .apply(this).reverse()).length; n < r; n++)
  31081. t = o[n],
  31082. a.push(u(i, t, e));
  31083. return a
  31084. }
  31085. ,
  31086. o = function(e, t, i) {
  31087. var n;
  31088. if (null == i && (i = d),
  31089. -1 !== (n = e.indexOf(t)))
  31090. return h(e, 0, n, i),
  31091. u(e, n, i)
  31092. }
  31093. ,
  31094. n = function(e, t, i) {
  31095. var n, r, o, a, s;
  31096. if (null == i && (i = d),
  31097. !(r = e.slice(0, t)).length)
  31098. return r;
  31099. for (p(r, i),
  31100. o = 0,
  31101. a = (s = e.slice(t)).length; o < a; o++)
  31102. n = s[o],
  31103. c(r, n, i);
  31104. return r.sort(i).reverse()
  31105. }
  31106. ,
  31107. r = function(e, t, i) {
  31108. var n, r, o, a, s, l, c, h, u;
  31109. if (null == i && (i = d),
  31110. 10 * t <= e.length) {
  31111. if (!(o = e.slice(0, t).sort(i)).length)
  31112. return o;
  31113. for (r = o[o.length - 1],
  31114. a = 0,
  31115. l = (c = e.slice(t)).length; a < l; a++)
  31116. i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
  31117. o.pop(),
  31118. r = o[o.length - 1]);
  31119. return o
  31120. }
  31121. for (p(e, i),
  31122. u = [],
  31123. s = 0,
  31124. h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
  31125. u.push(f(e, i));
  31126. return u
  31127. }
  31128. ,
  31129. h = function(e, t, i, n) {
  31130. var r, o, a;
  31131. for (null == n && (n = d),
  31132. r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
  31133. e[i] = o,
  31134. i = a;
  31135. return e[i] = r
  31136. }
  31137. ,
  31138. u = function(e, t, i) {
  31139. var n, r, o, a, s;
  31140. for (null == i && (i = d),
  31141. r = e.length,
  31142. o = e[s = t],
  31143. n = 2 * t + 1; n < r; )
  31144. (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
  31145. e[t] = e[n],
  31146. n = 2 * (t = n) + 1;
  31147. return e[t] = o,
  31148. h(e, s, t, i)
  31149. }
  31150. ,
  31151. v.push = t,
  31152. v.pop = f,
  31153. v.replace = i,
  31154. v.pushpop = c,
  31155. v.heapify = p,
  31156. v.updateItem = o,
  31157. v.nlargest = n,
  31158. v.nsmallest = r,
  31159. v.prototype.push = function(e) {
  31160. return t(this.nodes, e, this.cmp)
  31161. }
  31162. ,
  31163. v.prototype.pop = function() {
  31164. return f(this.nodes, this.cmp)
  31165. }
  31166. ,
  31167. v.prototype.peek = function() {
  31168. return this.nodes[0]
  31169. }
  31170. ,
  31171. v.prototype.contains = function(e) {
  31172. return -1 !== this.nodes.indexOf(e)
  31173. }
  31174. ,
  31175. v.prototype.replace = function(e) {
  31176. return i(this.nodes, e, this.cmp)
  31177. }
  31178. ,
  31179. v.prototype.pushpop = function(e) {
  31180. return c(this.nodes, e, this.cmp)
  31181. }
  31182. ,
  31183. v.prototype.heapify = function() {
  31184. return p(this.nodes, this.cmp)
  31185. }
  31186. ,
  31187. v.prototype.updateItem = function(e) {
  31188. return o(this.nodes, e, this.cmp)
  31189. }
  31190. ,
  31191. v.prototype.clear = function() {
  31192. return this.nodes = []
  31193. }
  31194. ,
  31195. v.prototype.empty = function() {
  31196. return 0 === this.nodes.length
  31197. }
  31198. ,
  31199. v.prototype.size = function() {
  31200. return this.nodes.length
  31201. }
  31202. ,
  31203. v.prototype.clone = function() {
  31204. var e;
  31205. return (e = new v).nodes = this.nodes.slice(0),
  31206. e
  31207. }
  31208. ,
  31209. v.prototype.toArray = function() {
  31210. return this.nodes.slice(0)
  31211. }
  31212. ,
  31213. v.prototype.insert = v.prototype.push,
  31214. v.prototype.top = v.prototype.peek,
  31215. v.prototype.front = v.prototype.peek,
  31216. v.prototype.has = v.prototype.contains,
  31217. v.prototype.copy = v.prototype.clone,
  31218. e = v,
  31219. a = this,
  31220. s = function() {
  31221. return e
  31222. }
  31223. ,
  31224. "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
  31225. }
  31226. ).call(this)
  31227. }
  31228. , {}],
  31229. 213: [function(e, t, i) {
  31230. function n() {}
  31231. function o(e) {
  31232. if ("object" != typeof this)
  31233. throw new TypeError("Promises must be constructed via new");
  31234. if ("function" != typeof e)
  31235. throw new TypeError("not a function");
  31236. this._state = 0,
  31237. this._handled = !1,
  31238. this._value = void 0,
  31239. this._deferreds = [],
  31240. h(e, this)
  31241. }
  31242. function r(i, n) {
  31243. for (; 3 === i._state; )
  31244. i = i._value;
  31245. return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
  31246. void o._immediateFn(function() {
  31247. var e = 1 === i._state ? n.onFulfilled : n.onRejected;
  31248. if (null !== e) {
  31249. var t;
  31250. try {
  31251. t = e(i._value)
  31252. } catch (e) {
  31253. return void s(n.promise, e)
  31254. }
  31255. a(n.promise, t)
  31256. } else
  31257. (1 === i._state ? a : s)(n.promise, i._value)
  31258. }))
  31259. }
  31260. function a(e, t) {
  31261. try {
  31262. if (t === e)
  31263. throw new TypeError("A promise cannot be resolved with itself.");
  31264. if (t && ("object" == typeof t || "function" == typeof t)) {
  31265. var i = t.then;
  31266. if (t instanceof o)
  31267. return e._state = 3,
  31268. e._value = t,
  31269. void l(e);
  31270. if ("function" == typeof i)
  31271. return void h(function(e, t) {
  31272. return function() {
  31273. e.apply(t, arguments)
  31274. }
  31275. }(i, t), e)
  31276. }
  31277. e._state = 1,
  31278. e._value = t,
  31279. l(e)
  31280. } catch (t) {
  31281. s(e, t)
  31282. }
  31283. }
  31284. function s(e, t) {
  31285. e._state = 2,
  31286. e._value = t,
  31287. l(e)
  31288. }
  31289. function l(e) {
  31290. 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
  31291. e._handled || o._unhandledRejectionFn(e._value)
  31292. });
  31293. for (var t = 0, i = e._deferreds.length; t < i; t++)
  31294. r(e, e._deferreds[t]);
  31295. e._deferreds = null
  31296. }
  31297. function c(e, t, i) {
  31298. this.onFulfilled = "function" == typeof e ? e : null,
  31299. this.onRejected = "function" == typeof t ? t : null,
  31300. this.promise = i
  31301. }
  31302. function h(e, t) {
  31303. var i = !1;
  31304. try {
  31305. e(function(e) {
  31306. i || (i = !0,
  31307. a(t, e))
  31308. }, function(e) {
  31309. i || (i = !0,
  31310. s(t, e))
  31311. })
  31312. } catch (e) {
  31313. if (i)
  31314. return;
  31315. i = !0,
  31316. s(t, e)
  31317. }
  31318. }
  31319. var u, d;
  31320. u = this,
  31321. d = setTimeout,
  31322. o.prototype.catch = function(e) {
  31323. return this.then(null, e)
  31324. }
  31325. ,
  31326. o.prototype.then = function(e, t) {
  31327. var i = new this.constructor(n);
  31328. return r(this, new c(e,t,i)),
  31329. i
  31330. }
  31331. ,
  31332. o.all = function(e) {
  31333. var s = Array.prototype.slice.call(e);
  31334. return new o(function(n, r) {
  31335. function o(t, e) {
  31336. try {
  31337. if (e && ("object" == typeof e || "function" == typeof e)) {
  31338. var i = e.then;
  31339. if ("function" == typeof i)
  31340. return void i.call(e, function(e) {
  31341. o(t, e)
  31342. }, r)
  31343. }
  31344. s[t] = e,
  31345. 0 == --a && n(s)
  31346. } catch (e) {
  31347. r(e)
  31348. }
  31349. }
  31350. if (0 === s.length)
  31351. return n([]);
  31352. for (var a = s.length, e = 0; e < s.length; e++)
  31353. o(e, s[e])
  31354. }
  31355. )
  31356. }
  31357. ,
  31358. o.resolve = function(t) {
  31359. return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
  31360. e(t)
  31361. }
  31362. )
  31363. }
  31364. ,
  31365. o.reject = function(i) {
  31366. return new o(function(e, t) {
  31367. t(i)
  31368. }
  31369. )
  31370. }
  31371. ,
  31372. o.race = function(r) {
  31373. return new o(function(e, t) {
  31374. for (var i = 0, n = r.length; i < n; i++)
  31375. r[i].then(e, t)
  31376. }
  31377. )
  31378. }
  31379. ,
  31380. o._immediateFn = "function" == typeof setImmediate && function(e) {
  31381. setImmediate(e)
  31382. }
  31383. || function(e) {
  31384. d(e, 0)
  31385. }
  31386. ,
  31387. o._unhandledRejectionFn = function(e) {
  31388. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  31389. }
  31390. ,
  31391. o._setImmediateFn = function(e) {
  31392. o._immediateFn = e
  31393. }
  31394. ,
  31395. o._setUnhandledRejectionFn = function(e) {
  31396. o._unhandledRejectionFn = e
  31397. }
  31398. ,
  31399. void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
  31400. }
  31401. , {}],
  31402. 214: [function(p, i, e) {
  31403. (function(d) {
  31404. var e, t;
  31405. e = this,
  31406. t = function(I, e) {
  31407. "use strict";
  31408. var a, t, u, i, s, n, r, o = {};
  31409. return o.ByteBuffer = I,
  31410. o.Long = I.Long || null,
  31411. o.VERSION = "5.0.1",
  31412. o.WIRE_TYPES = {},
  31413. o.WIRE_TYPES.VARINT = 0,
  31414. o.WIRE_TYPES.BITS64 = 1,
  31415. o.WIRE_TYPES.LDELIM = 2,
  31416. o.WIRE_TYPES.STARTGROUP = 3,
  31417. o.WIRE_TYPES.ENDGROUP = 4,
  31418. o.WIRE_TYPES.BITS32 = 5,
  31419. o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
  31420. o.TYPES = {
  31421. int32: {
  31422. name: "int32",
  31423. wireType: o.WIRE_TYPES.VARINT,
  31424. defaultValue: 0
  31425. },
  31426. uint32: {
  31427. name: "uint32",
  31428. wireType: o.WIRE_TYPES.VARINT,
  31429. defaultValue: 0
  31430. },
  31431. sint32: {
  31432. name: "sint32",
  31433. wireType: o.WIRE_TYPES.VARINT,
  31434. defaultValue: 0
  31435. },
  31436. int64: {
  31437. name: "int64",
  31438. wireType: o.WIRE_TYPES.VARINT,
  31439. defaultValue: o.Long ? o.Long.ZERO : void 0
  31440. },
  31441. uint64: {
  31442. name: "uint64",
  31443. wireType: o.WIRE_TYPES.VARINT,
  31444. defaultValue: o.Long ? o.Long.UZERO : void 0
  31445. },
  31446. sint64: {
  31447. name: "sint64",
  31448. wireType: o.WIRE_TYPES.VARINT,
  31449. defaultValue: o.Long ? o.Long.ZERO : void 0
  31450. },
  31451. bool: {
  31452. name: "bool",
  31453. wireType: o.WIRE_TYPES.VARINT,
  31454. defaultValue: !1
  31455. },
  31456. double: {
  31457. name: "double",
  31458. wireType: o.WIRE_TYPES.BITS64,
  31459. defaultValue: 0
  31460. },
  31461. string: {
  31462. name: "string",
  31463. wireType: o.WIRE_TYPES.LDELIM,
  31464. defaultValue: ""
  31465. },
  31466. bytes: {
  31467. name: "bytes",
  31468. wireType: o.WIRE_TYPES.LDELIM,
  31469. defaultValue: null
  31470. },
  31471. fixed32: {
  31472. name: "fixed32",
  31473. wireType: o.WIRE_TYPES.BITS32,
  31474. defaultValue: 0
  31475. },
  31476. sfixed32: {
  31477. name: "sfixed32",
  31478. wireType: o.WIRE_TYPES.BITS32,
  31479. defaultValue: 0
  31480. },
  31481. fixed64: {
  31482. name: "fixed64",
  31483. wireType: o.WIRE_TYPES.BITS64,
  31484. defaultValue: o.Long ? o.Long.UZERO : void 0
  31485. },
  31486. sfixed64: {
  31487. name: "sfixed64",
  31488. wireType: o.WIRE_TYPES.BITS64,
  31489. defaultValue: o.Long ? o.Long.ZERO : void 0
  31490. },
  31491. float: {
  31492. name: "float",
  31493. wireType: o.WIRE_TYPES.BITS32,
  31494. defaultValue: 0
  31495. },
  31496. enum: {
  31497. name: "enum",
  31498. wireType: o.WIRE_TYPES.VARINT,
  31499. defaultValue: 0
  31500. },
  31501. message: {
  31502. name: "message",
  31503. wireType: o.WIRE_TYPES.LDELIM,
  31504. defaultValue: null
  31505. },
  31506. group: {
  31507. name: "group",
  31508. wireType: o.WIRE_TYPES.STARTGROUP,
  31509. defaultValue: null
  31510. }
  31511. },
  31512. 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],
  31513. o.ID_MIN = 1,
  31514. o.ID_MAX = 536870911,
  31515. o.convertFieldsToCamelCase = !1,
  31516. o.populateAccessors = !0,
  31517. o.populateDefaults = !0,
  31518. o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
  31519. r.XHR = function() {
  31520. for (var e = [function() {
  31521. return new XMLHttpRequest
  31522. }
  31523. , function() {
  31524. return new ActiveXObject("Msxml2.XMLHTTP")
  31525. }
  31526. , function() {
  31527. return new ActiveXObject("Msxml3.XMLHTTP")
  31528. }
  31529. , function() {
  31530. return new ActiveXObject("Microsoft.XMLHTTP")
  31531. }
  31532. ], t = null, i = 0; i < e.length; i++) {
  31533. try {
  31534. t = e[i]()
  31535. } catch (e) {
  31536. continue
  31537. }
  31538. break
  31539. }
  31540. if (!t)
  31541. throw Error("XMLHttpRequest is not supported");
  31542. return t
  31543. }
  31544. ,
  31545. r.fetch = function(e, i) {
  31546. if (i && "function" != typeof i && (i = null),
  31547. r.IS_NODE) {
  31548. var t = p("fs");
  31549. if (i)
  31550. t.readFile(e, function(e, t) {
  31551. i(e ? null : "" + t)
  31552. });
  31553. else
  31554. try {
  31555. return t.readFileSync(e)
  31556. } catch (e) {
  31557. return null
  31558. }
  31559. } else {
  31560. var n = r.XHR();
  31561. if (n.open("GET", e, !!i),
  31562. n.setRequestHeader("Accept", "text/plain"),
  31563. "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
  31564. !i)
  31565. return n.send(null),
  31566. 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
  31567. if (n.onreadystatechange = function() {
  31568. 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
  31569. }
  31570. ,
  31571. 4 == n.readyState)
  31572. return;
  31573. n.send(null)
  31574. }
  31575. }
  31576. ,
  31577. r.toCamelCase = function(e) {
  31578. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  31579. return t.toUpperCase()
  31580. })
  31581. }
  31582. ,
  31583. r),
  31584. o.Lang = {
  31585. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  31586. RULE: /^(?:required|optional|repeated|map)$/,
  31587. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  31588. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  31589. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  31590. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  31591. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  31592. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  31593. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  31594. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  31595. NUMBER_OCT: /^0[0-7]+$/,
  31596. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  31597. BOOL: /^(?:true|false)$/i,
  31598. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  31599. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  31600. WHITESPACE: /\s/,
  31601. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  31602. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  31603. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  31604. },
  31605. o.DotProto = function(r, a) {
  31606. function s(e, t) {
  31607. var i = -1
  31608. , n = 1;
  31609. if ("-" == e.charAt(0) && (n = -1,
  31610. e = e.substring(1)),
  31611. a.NUMBER_DEC.test(e))
  31612. i = parseInt(e);
  31613. else if (a.NUMBER_HEX.test(e))
  31614. i = parseInt(e.substring(2), 16);
  31615. else {
  31616. if (!a.NUMBER_OCT.test(e))
  31617. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  31618. i = parseInt(e.substring(1), 8)
  31619. }
  31620. if (i = n * i | 0,
  31621. !t && i < 0)
  31622. throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
  31623. return i
  31624. }
  31625. function o(e) {
  31626. var t = 1;
  31627. if ("-" == e.charAt(0) && (t = -1,
  31628. e = e.substring(1)),
  31629. a.NUMBER_DEC.test(e))
  31630. return t * parseInt(e, 10);
  31631. if (a.NUMBER_HEX.test(e))
  31632. return t * parseInt(e.substring(2), 16);
  31633. if (a.NUMBER_OCT.test(e))
  31634. return t * parseInt(e.substring(1), 8);
  31635. if ("inf" === e)
  31636. return t * (1 / 0);
  31637. if ("nan" === e)
  31638. return NaN;
  31639. if (a.NUMBER_FLT.test(e))
  31640. return t * parseFloat(e);
  31641. throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
  31642. }
  31643. function n(e, t, i) {
  31644. void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  31645. e[t].push(i))
  31646. }
  31647. function t(e) {
  31648. this.source = e + "",
  31649. this.index = 0,
  31650. this.line = 1,
  31651. this.stack = [],
  31652. this._stringOpen = null
  31653. }
  31654. var e = {}
  31655. , i = t.prototype;
  31656. i._readString = function() {
  31657. var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
  31658. e.lastIndex = this.index - 1;
  31659. var t = e.exec(this.source);
  31660. if (!t)
  31661. throw Error("unterminated string");
  31662. return this.index = e.lastIndex,
  31663. this.stack.push(this._stringOpen),
  31664. this._stringOpen = null,
  31665. t[1]
  31666. }
  31667. ,
  31668. i.next = function() {
  31669. if (0 < this.stack.length)
  31670. return this.stack.shift();
  31671. if (this.index >= this.source.length)
  31672. return null;
  31673. if (null !== this._stringOpen)
  31674. return this._readString();
  31675. var e, t, i;
  31676. do {
  31677. for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
  31678. if ("\n" === i && ++this.line,
  31679. ++this.index === this.source.length)
  31680. return null;
  31681. if ("/" === this.source.charAt(this.index))
  31682. if (++this.index,
  31683. "/" === this.source.charAt(this.index)) {
  31684. for (; "\n" !== this.source.charAt(++this.index); )
  31685. if (this.index == this.source.length)
  31686. return null;
  31687. ++this.index,
  31688. ++this.line,
  31689. e = !0
  31690. } else {
  31691. if ("*" !== (i = this.source.charAt(this.index)))
  31692. return "/";
  31693. do {
  31694. if ("\n" === i && ++this.line,
  31695. ++this.index === this.source.length)
  31696. return null;
  31697. t = i,
  31698. i = this.source.charAt(this.index)
  31699. } while ("*" !== t || "/" !== i);++this.index,
  31700. e = !0
  31701. }
  31702. } while (e);if (this.index === this.source.length)
  31703. return null;
  31704. var n = this.index;
  31705. if (a.DELIM.lastIndex = 0,
  31706. !a.DELIM.test(this.source.charAt(n++)))
  31707. for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
  31708. ++n;
  31709. var r = this.source.substring(this.index, this.index = n);
  31710. return '"' !== r && "'" !== r || (this._stringOpen = r),
  31711. r
  31712. }
  31713. ,
  31714. i.peek = function() {
  31715. if (0 === this.stack.length) {
  31716. var e = this.next();
  31717. if (null === e)
  31718. return null;
  31719. this.stack.push(e)
  31720. }
  31721. return this.stack[0]
  31722. }
  31723. ,
  31724. i.skip = function(e) {
  31725. var t = this.next();
  31726. if (t !== e)
  31727. throw Error("illegal '" + t + "', '" + e + "' expected")
  31728. }
  31729. ,
  31730. i.omit = function(e) {
  31731. return this.peek() === e && (this.next(),
  31732. !0)
  31733. }
  31734. ,
  31735. i.toString = function() {
  31736. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  31737. }
  31738. ,
  31739. e.Tokenizer = t;
  31740. function l(e) {
  31741. this.tn = new t(e),
  31742. this.proto3 = !1
  31743. }
  31744. var c = l.prototype;
  31745. return c.parse = function() {
  31746. var e, t, i = {
  31747. name: "[ROOT]",
  31748. package: null,
  31749. messages: [],
  31750. enums: [],
  31751. imports: [],
  31752. options: {},
  31753. services: []
  31754. }, n = !0;
  31755. try {
  31756. for (; e = this.tn.next(); )
  31757. switch (e) {
  31758. case "package":
  31759. if (!n || null !== i.package)
  31760. throw Error("unexpected 'package'");
  31761. if (e = this.tn.next(),
  31762. !a.TYPEREF.test(e))
  31763. throw Error("illegal package name: " + e);
  31764. this.tn.skip(";"),
  31765. i.package = e;
  31766. break;
  31767. case "import":
  31768. if (!n)
  31769. throw Error("unexpected 'import'");
  31770. "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
  31771. e = this._readString(),
  31772. this.tn.skip(";"),
  31773. t || i.imports.push(e);
  31774. break;
  31775. case "syntax":
  31776. if (!n)
  31777. throw Error("unexpected 'syntax'");
  31778. this.tn.skip("="),
  31779. "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
  31780. this.tn.skip(";");
  31781. break;
  31782. case "message":
  31783. this._parseMessage(i, null),
  31784. n = !1;
  31785. break;
  31786. case "enum":
  31787. this._parseEnum(i),
  31788. n = !1;
  31789. break;
  31790. case "option":
  31791. this._parseOption(i);
  31792. break;
  31793. case "service":
  31794. this._parseService(i);
  31795. break;
  31796. case "extend":
  31797. this._parseExtend(i);
  31798. break;
  31799. default:
  31800. throw Error("unexpected '" + e + "'")
  31801. }
  31802. } catch (e) {
  31803. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  31804. e
  31805. }
  31806. return delete i.name,
  31807. i
  31808. }
  31809. ,
  31810. l.parse = function(e) {
  31811. return new l(e).parse()
  31812. }
  31813. ,
  31814. c._readString = function() {
  31815. var e, t, i = "";
  31816. do {
  31817. if ("'" !== (t = this.tn.next()) && '"' !== t)
  31818. throw Error("illegal string delimiter: " + t);
  31819. i += this.tn.next(),
  31820. this.tn.skip(t),
  31821. e = this.tn.peek()
  31822. } while ('"' === e || '"' === e);return i
  31823. }
  31824. ,
  31825. c._readValue = function(e) {
  31826. var t = this.tn.peek();
  31827. if ('"' === t || "'" === t)
  31828. return this._readString();
  31829. if (this.tn.next(),
  31830. a.NUMBER.test(t))
  31831. return o(t);
  31832. if (a.BOOL.test(t))
  31833. return "true" === t.toLowerCase();
  31834. if (e && a.TYPEREF.test(t))
  31835. return t;
  31836. throw Error("illegal value: " + t)
  31837. }
  31838. ,
  31839. c._parseOption = function(e, t) {
  31840. var i = this.tn.next()
  31841. , n = !1;
  31842. if ("(" === i && (n = !0,
  31843. i = this.tn.next()),
  31844. !a.TYPEREF.test(i))
  31845. throw Error("illegal option name: " + i);
  31846. var r = i;
  31847. n && (this.tn.skip(")"),
  31848. r = "(" + r + ")",
  31849. i = this.tn.peek(),
  31850. a.FQTYPEREF.test(i) && (r += i,
  31851. this.tn.next())),
  31852. this.tn.skip("="),
  31853. this._parseOptionValue(e, r),
  31854. t || this.tn.skip(";")
  31855. }
  31856. ,
  31857. c._parseOptionValue = function(e, t) {
  31858. var i = this.tn.peek();
  31859. if ("{" !== i)
  31860. n(e.options, t, this._readValue(!0));
  31861. else
  31862. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
  31863. if (!a.NAME.test(i))
  31864. throw Error("illegal option name: " + t + "." + i);
  31865. this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
  31866. }
  31867. }
  31868. ,
  31869. c._parseService = function(e) {
  31870. var t = this.tn.next();
  31871. if (!a.NAME.test(t))
  31872. throw Error("illegal service name at line " + this.tn.line + ": " + t);
  31873. var i = {
  31874. name: t,
  31875. rpc: {},
  31876. options: {}
  31877. };
  31878. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  31879. if ("option" === t)
  31880. this._parseOption(i);
  31881. else {
  31882. if ("rpc" !== t)
  31883. throw Error("illegal service token: " + t);
  31884. this._parseServiceRPC(i)
  31885. }
  31886. this.tn.omit(";"),
  31887. e.services.push(i)
  31888. }
  31889. ,
  31890. c._parseServiceRPC = function(e) {
  31891. var t = this.tn.next();
  31892. if (!a.NAME.test(t))
  31893. throw Error("illegal rpc service method name: " + t);
  31894. var i = t
  31895. , n = {
  31896. request: null,
  31897. response: null,
  31898. request_stream: !1,
  31899. response_stream: !1,
  31900. options: {}
  31901. };
  31902. if (this.tn.skip("("),
  31903. "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
  31904. t = this.tn.next()),
  31905. !a.TYPEREF.test(t))
  31906. throw Error("illegal rpc service request type: " + t);
  31907. if (n.request = t,
  31908. this.tn.skip(")"),
  31909. "returns" !== (t = this.tn.next()).toLowerCase())
  31910. throw Error("illegal rpc service request type delimiter: " + t);
  31911. if (this.tn.skip("("),
  31912. "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
  31913. t = this.tn.next()),
  31914. n.response = t,
  31915. this.tn.skip(")"),
  31916. "{" === (t = this.tn.peek())) {
  31917. for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
  31918. if ("option" !== t)
  31919. throw Error("illegal rpc service token: " + t);
  31920. this._parseOption(n)
  31921. }
  31922. this.tn.omit(";")
  31923. } else
  31924. this.tn.skip(";");
  31925. void 0 === e.rpc && (e.rpc = {}),
  31926. e.rpc[i] = n
  31927. }
  31928. ,
  31929. c._parseMessage = function(e, t) {
  31930. var i = !!t
  31931. , n = this.tn.next()
  31932. , r = {
  31933. name: "",
  31934. fields: [],
  31935. enums: [],
  31936. messages: [],
  31937. options: {},
  31938. services: [],
  31939. oneofs: {}
  31940. };
  31941. if (!a.NAME.test(n))
  31942. throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
  31943. for (r.name = n,
  31944. i && (this.tn.skip("="),
  31945. t.id = s(this.tn.next()),
  31946. r.isGroup = !0),
  31947. "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
  31948. this.tn.skip("{"); "}" !== (n = this.tn.next()); )
  31949. if (a.RULE.test(n))
  31950. this._parseMessageField(r, n);
  31951. else if ("oneof" === n)
  31952. this._parseMessageOneOf(r);
  31953. else if ("enum" === n)
  31954. this._parseEnum(r);
  31955. else if ("message" === n)
  31956. this._parseMessage(r);
  31957. else if ("option" === n)
  31958. this._parseOption(r);
  31959. else if ("service" === n)
  31960. this._parseService(r);
  31961. else if ("extensions" === n)
  31962. r.extensions = this._parseExtensionRanges();
  31963. else if ("reserved" === n)
  31964. this._parseIgnored();
  31965. else if ("extend" === n)
  31966. this._parseExtend(r);
  31967. else {
  31968. if (!a.TYPEREF.test(n))
  31969. throw Error("illegal message token: " + n);
  31970. if (!this.proto3)
  31971. throw Error("illegal field rule: " + n);
  31972. this._parseMessageField(r, "optional", n)
  31973. }
  31974. return this.tn.omit(";"),
  31975. e.messages.push(r),
  31976. r
  31977. }
  31978. ,
  31979. c._parseIgnored = function() {
  31980. for (; ";" !== this.tn.peek(); )
  31981. this.tn.next();
  31982. this.tn.skip(";")
  31983. }
  31984. ,
  31985. c._parseMessageField = function(e, t, i) {
  31986. if (!a.RULE.test(t))
  31987. throw Error("illegal message field rule: " + t);
  31988. var n, r = {
  31989. rule: t,
  31990. type: "",
  31991. name: "",
  31992. options: {},
  31993. id: 0
  31994. };
  31995. if ("map" === t) {
  31996. if (i)
  31997. throw Error("illegal type: " + i);
  31998. if (this.tn.skip("<"),
  31999. n = this.tn.next(),
  32000. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32001. throw Error("illegal message field type: " + n);
  32002. if (r.keytype = n,
  32003. this.tn.skip(","),
  32004. n = this.tn.next(),
  32005. !a.TYPE.test(n) && !a.TYPEREF.test(n))
  32006. throw Error("illegal message field: " + n);
  32007. if (r.type = n,
  32008. this.tn.skip(">"),
  32009. n = this.tn.next(),
  32010. !a.NAME.test(n))
  32011. throw Error("illegal message field name: " + n);
  32012. r.name = n,
  32013. this.tn.skip("="),
  32014. r.id = s(this.tn.next()),
  32015. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32016. this.tn.skip(";")
  32017. } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
  32018. var o = this._parseMessage(e, r);
  32019. if (!/^[A-Z]/.test(o.name))
  32020. throw Error("illegal group name: " + o.name);
  32021. r.type = o.name,
  32022. r.name = o.name.toLowerCase(),
  32023. this.tn.omit(";")
  32024. } else {
  32025. if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
  32026. throw Error("illegal message field type: " + i);
  32027. if (r.type = i,
  32028. n = this.tn.next(),
  32029. !a.NAME.test(n))
  32030. throw Error("illegal message field name: " + n);
  32031. r.name = n,
  32032. this.tn.skip("="),
  32033. r.id = s(this.tn.next()),
  32034. "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
  32035. this.tn.skip(";")
  32036. }
  32037. return e.fields.push(r),
  32038. r
  32039. }
  32040. ,
  32041. c._parseMessageOneOf = function(e) {
  32042. var t = this.tn.next();
  32043. if (!a.NAME.test(t))
  32044. throw Error("illegal oneof name: " + t);
  32045. var i, n = t, r = [];
  32046. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32047. (i = this._parseMessageField(e, "optional", t)).oneof = n,
  32048. r.push(i.id);
  32049. this.tn.omit(";"),
  32050. e.oneofs[n] = r
  32051. }
  32052. ,
  32053. c._parseFieldOptions = function(e) {
  32054. this.tn.skip("[");
  32055. for (var t = !0; "]" !== this.tn.peek(); )
  32056. t || this.tn.skip(","),
  32057. this._parseOption(e, !0),
  32058. t = !1;
  32059. this.tn.next()
  32060. }
  32061. ,
  32062. c._parseEnum = function(e) {
  32063. var t = {
  32064. name: "",
  32065. values: [],
  32066. options: {}
  32067. }
  32068. , i = this.tn.next();
  32069. if (!a.NAME.test(i))
  32070. throw Error("illegal name: " + i);
  32071. for (t.name = i,
  32072. this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32073. if ("option" === i)
  32074. this._parseOption(t);
  32075. else {
  32076. if (!a.NAME.test(i))
  32077. throw Error("illegal name: " + i);
  32078. this.tn.skip("=");
  32079. var n = {
  32080. name: i,
  32081. id: s(this.tn.next(), !0)
  32082. };
  32083. "[" === (i = this.tn.peek()) && this._parseFieldOptions({
  32084. options: {}
  32085. }),
  32086. this.tn.skip(";"),
  32087. t.values.push(n)
  32088. }
  32089. this.tn.omit(";"),
  32090. e.enums.push(t)
  32091. }
  32092. ,
  32093. c._parseExtensionRanges = function() {
  32094. var e, t, i, n = [];
  32095. do {
  32096. for (t = []; ; ) {
  32097. switch (e = this.tn.next()) {
  32098. case "min":
  32099. i = r.ID_MIN;
  32100. break;
  32101. case "max":
  32102. i = r.ID_MAX;
  32103. break;
  32104. default:
  32105. i = o(e)
  32106. }
  32107. if (t.push(i),
  32108. 2 === t.length)
  32109. break;
  32110. if ("to" !== this.tn.peek()) {
  32111. t.push(i);
  32112. break
  32113. }
  32114. this.tn.next()
  32115. }
  32116. n.push(t)
  32117. } while (this.tn.omit(","));return this.tn.skip(";"),
  32118. n
  32119. }
  32120. ,
  32121. c._parseExtend = function(e) {
  32122. var t = this.tn.next();
  32123. if (!a.TYPEREF.test(t))
  32124. throw Error("illegal extend reference: " + t);
  32125. var i = {
  32126. ref: t,
  32127. fields: []
  32128. };
  32129. for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
  32130. if (a.RULE.test(t))
  32131. this._parseMessageField(i, t);
  32132. else {
  32133. if (!a.TYPEREF.test(t))
  32134. throw Error("illegal extend token: " + t);
  32135. if (!this.proto3)
  32136. throw Error("illegal field rule: " + t);
  32137. this._parseMessageField(i, "optional", t)
  32138. }
  32139. return this.tn.omit(";"),
  32140. e.messages.push(i),
  32141. i
  32142. }
  32143. ,
  32144. c.toString = function() {
  32145. return "Parser at line " + this.tn.line
  32146. }
  32147. ,
  32148. e.Parser = l,
  32149. e
  32150. }(o, o.Lang),
  32151. o.Reflect = function(g) {
  32152. function a(e, t) {
  32153. if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
  32154. return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
  32155. if ("string" == typeof e)
  32156. return g.Long.fromString(e, t || !1, 10);
  32157. if ("number" == typeof e)
  32158. return g.Long.fromNumber(e, t || !1);
  32159. throw Error("not convertible to Long")
  32160. }
  32161. function m(e, t) {
  32162. var i = t.readVarint32()
  32163. , n = 7 & i
  32164. , r = i >>> 3;
  32165. switch (n) {
  32166. case g.WIRE_TYPES.VARINT:
  32167. for (; 128 == (128 & (i = t.readUint8())); )
  32168. ;
  32169. break;
  32170. case g.WIRE_TYPES.BITS64:
  32171. t.offset += 8;
  32172. break;
  32173. case g.WIRE_TYPES.LDELIM:
  32174. i = t.readVarint32(),
  32175. t.offset += i;
  32176. break;
  32177. case g.WIRE_TYPES.STARTGROUP:
  32178. m(r, t);
  32179. break;
  32180. case g.WIRE_TYPES.ENDGROUP:
  32181. if (r === e)
  32182. return !1;
  32183. throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
  32184. case g.WIRE_TYPES.BITS32:
  32185. t.offset += 4;
  32186. break;
  32187. default:
  32188. throw Error("Illegal wire type in unknown group " + e + ": " + n)
  32189. }
  32190. return !0
  32191. }
  32192. function h(e, t, i) {
  32193. this.builder = e,
  32194. this.parent = t,
  32195. this.name = i,
  32196. this.className
  32197. }
  32198. var s = {}
  32199. , e = h.prototype;
  32200. e.fqn = function() {
  32201. for (var e = this.name, t = this; null != (t = t.parent); )
  32202. e = t.name + "." + e;
  32203. return e
  32204. }
  32205. ,
  32206. e.toString = function(e) {
  32207. return (e ? this.className + " " : "") + this.fqn()
  32208. }
  32209. ,
  32210. e.build = function() {
  32211. throw Error(this.toString(!0) + " cannot be built directly")
  32212. }
  32213. ,
  32214. s.T = h;
  32215. function l(e, t, i, n, r) {
  32216. h.call(this, e, t, i),
  32217. this.className = "Namespace",
  32218. this.children = [],
  32219. this.options = n || {},
  32220. this.syntax = r || "proto2"
  32221. }
  32222. var t = l.prototype = Object.create(h.prototype);
  32223. t.getChildren = function(e) {
  32224. if (null == (e = e || null))
  32225. return this.children.slice();
  32226. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32227. this.children[i]instanceof e && t.push(this.children[i]);
  32228. return t
  32229. }
  32230. ,
  32231. t.addChild = function(e) {
  32232. var t;
  32233. if (t = this.getChild(e.name))
  32234. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32235. t.name = t.originalName;
  32236. else {
  32237. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32238. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32239. e.name = e.originalName
  32240. }
  32241. this.children.push(e)
  32242. }
  32243. ,
  32244. t.getChild = function(e) {
  32245. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32246. if (this.children[i][t] === e)
  32247. return this.children[i];
  32248. return null
  32249. }
  32250. ,
  32251. t.resolve = function(e, t) {
  32252. var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
  32253. if ("" === n[o]) {
  32254. for (; null !== r.parent; )
  32255. r = r.parent;
  32256. o++
  32257. }
  32258. do {
  32259. do {
  32260. if (!(r instanceof s.Namespace)) {
  32261. r = null;
  32262. break
  32263. }
  32264. if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
  32265. r = null;
  32266. break
  32267. }
  32268. r = i,
  32269. o++
  32270. } while (o < n.length);if (null != r)
  32271. break;
  32272. if (null !== this.parent)
  32273. return this.parent.resolve(e, t)
  32274. } while (null != r);return r
  32275. }
  32276. ,
  32277. t.qn = function(e) {
  32278. for (var t = [], i = e; t.unshift(i.name),
  32279. null !== (i = i.parent); )
  32280. ;
  32281. for (var n = 1; n <= t.length; n++) {
  32282. var r = t.slice(t.length - n);
  32283. if (e === this.resolve(r, e instanceof s.Namespace))
  32284. return r.join(".")
  32285. }
  32286. return e.fqn()
  32287. }
  32288. ,
  32289. t.build = function() {
  32290. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  32291. (e = i[n])instanceof l && (t[e.name] = e.build());
  32292. return Object.defineProperty && Object.defineProperty(t, "$options", {
  32293. value: this.buildOpt()
  32294. }),
  32295. t
  32296. }
  32297. ,
  32298. t.buildOpt = function() {
  32299. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  32300. var r = t[i]
  32301. , o = this.options[t[i]];
  32302. e[r] = o
  32303. }
  32304. return e
  32305. }
  32306. ,
  32307. t.getOption = function(e) {
  32308. return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
  32309. }
  32310. ,
  32311. s.Namespace = l;
  32312. function u(e, t, i, n) {
  32313. if (this.type = e,
  32314. this.resolvedType = t,
  32315. this.isMapKey = i,
  32316. this.syntax = n,
  32317. i && g.MAP_KEY_TYPES.indexOf(e) < 0)
  32318. throw Error("Invalid map key type: " + e.name)
  32319. }
  32320. var i = u.prototype;
  32321. u.defaultFieldValue = function(e) {
  32322. if ("string" == typeof e && (e = g.TYPES[e]),
  32323. void 0 === e.defaultValue)
  32324. throw Error("default value for type " + e.name + " is not supported");
  32325. return e == g.TYPES.bytes ? new I(0) : e.defaultValue
  32326. }
  32327. ,
  32328. i.verifyValue = function(t) {
  32329. function i(e, t) {
  32330. throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
  32331. }
  32332. var n = this;
  32333. switch (this.type) {
  32334. case g.TYPES.int32:
  32335. case g.TYPES.sint32:
  32336. case g.TYPES.sfixed32:
  32337. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32338. 4294967295 < t ? 0 | t : t;
  32339. case g.TYPES.uint32:
  32340. case g.TYPES.fixed32:
  32341. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32342. t < 0 ? t >>> 0 : t;
  32343. case g.TYPES.int64:
  32344. case g.TYPES.sint64:
  32345. case g.TYPES.sfixed64:
  32346. if (g.Long)
  32347. try {
  32348. return a(t, !1)
  32349. } catch (e) {
  32350. i(typeof t, e.message)
  32351. }
  32352. else
  32353. i(typeof t, "requires Long.js");
  32354. case g.TYPES.uint64:
  32355. case g.TYPES.fixed64:
  32356. if (g.Long)
  32357. try {
  32358. return a(t, !0)
  32359. } catch (e) {
  32360. i(typeof t, e.message)
  32361. }
  32362. else
  32363. i(typeof t, "requires Long.js");
  32364. case g.TYPES.bool:
  32365. return "boolean" != typeof t && i(typeof t, "not a boolean"),
  32366. t;
  32367. case g.TYPES.float:
  32368. case g.TYPES.double:
  32369. return "number" != typeof t && i(typeof t, "not a number"),
  32370. t;
  32371. case g.TYPES.string:
  32372. return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
  32373. "" + t;
  32374. case g.TYPES.bytes:
  32375. return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
  32376. case g.TYPES.enum:
  32377. var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
  32378. for (o = 0; o < e.length; o++) {
  32379. if (e[o].name == t)
  32380. return e[o].id;
  32381. if (e[o].id == t)
  32382. return e[o].id
  32383. }
  32384. if ("proto3" === this.syntax)
  32385. return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
  32386. (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
  32387. t;
  32388. i(t, "not a valid enum value");
  32389. case g.TYPES.group:
  32390. case g.TYPES.message:
  32391. if (t && "object" == typeof t || i(typeof t, "object expected"),
  32392. t instanceof this.resolvedType.clazz)
  32393. return t;
  32394. if (t instanceof g.Builder.Message) {
  32395. var r = {};
  32396. for (var o in t)
  32397. t.hasOwnProperty(o) && (r[o] = t[o]);
  32398. t = r
  32399. }
  32400. return new this.resolvedType.clazz(t)
  32401. }
  32402. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
  32403. }
  32404. ,
  32405. i.calculateLength = function(e, t) {
  32406. if (null === t)
  32407. return 0;
  32408. var i;
  32409. switch (this.type) {
  32410. case g.TYPES.int32:
  32411. return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
  32412. case g.TYPES.uint32:
  32413. return I.calculateVarint32(t);
  32414. case g.TYPES.sint32:
  32415. return I.calculateVarint32(I.zigZagEncode32(t));
  32416. case g.TYPES.fixed32:
  32417. case g.TYPES.sfixed32:
  32418. case g.TYPES.float:
  32419. return 4;
  32420. case g.TYPES.int64:
  32421. case g.TYPES.uint64:
  32422. return I.calculateVarint64(t);
  32423. case g.TYPES.sint64:
  32424. return I.calculateVarint64(I.zigZagEncode64(t));
  32425. case g.TYPES.fixed64:
  32426. case g.TYPES.sfixed64:
  32427. return 8;
  32428. case g.TYPES.bool:
  32429. return 1;
  32430. case g.TYPES.enum:
  32431. return I.calculateVarint32(t);
  32432. case g.TYPES.double:
  32433. return 8;
  32434. case g.TYPES.string:
  32435. return i = I.calculateUTF8Bytes(t),
  32436. I.calculateVarint32(i) + i;
  32437. case g.TYPES.bytes:
  32438. if (t.remaining() < 0)
  32439. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  32440. return I.calculateVarint32(t.remaining()) + t.remaining();
  32441. case g.TYPES.message:
  32442. return i = this.resolvedType.calculate(t),
  32443. I.calculateVarint32(i) + i;
  32444. case g.TYPES.group:
  32445. return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
  32446. }
  32447. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  32448. }
  32449. ,
  32450. i.encodeValue = function(e, t, i) {
  32451. if (null === t)
  32452. return i;
  32453. switch (this.type) {
  32454. case g.TYPES.int32:
  32455. t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
  32456. break;
  32457. case g.TYPES.uint32:
  32458. i.writeVarint32(t);
  32459. break;
  32460. case g.TYPES.sint32:
  32461. i.writeVarint32ZigZag(t);
  32462. break;
  32463. case g.TYPES.fixed32:
  32464. i.writeUint32(t);
  32465. break;
  32466. case g.TYPES.sfixed32:
  32467. i.writeInt32(t);
  32468. break;
  32469. case g.TYPES.int64:
  32470. case g.TYPES.uint64:
  32471. i.writeVarint64(t);
  32472. break;
  32473. case g.TYPES.sint64:
  32474. i.writeVarint64ZigZag(t);
  32475. break;
  32476. case g.TYPES.fixed64:
  32477. i.writeUint64(t);
  32478. break;
  32479. case g.TYPES.sfixed64:
  32480. i.writeInt64(t);
  32481. break;
  32482. case g.TYPES.bool:
  32483. "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
  32484. break;
  32485. case g.TYPES.enum:
  32486. i.writeVarint32(t);
  32487. break;
  32488. case g.TYPES.float:
  32489. i.writeFloat32(t);
  32490. break;
  32491. case g.TYPES.double:
  32492. i.writeFloat64(t);
  32493. break;
  32494. case g.TYPES.string:
  32495. i.writeVString(t);
  32496. break;
  32497. case g.TYPES.bytes:
  32498. if (t.remaining() < 0)
  32499. throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
  32500. var n = t.offset;
  32501. i.writeVarint32(t.remaining()),
  32502. i.append(t),
  32503. t.offset = n;
  32504. break;
  32505. case g.TYPES.message:
  32506. var r = (new I).LE();
  32507. this.resolvedType.encode(t, r),
  32508. i.writeVarint32(r.offset),
  32509. i.append(r.flip());
  32510. break;
  32511. case g.TYPES.group:
  32512. this.resolvedType.encode(t, i),
  32513. i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
  32514. break;
  32515. default:
  32516. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
  32517. }
  32518. return i
  32519. }
  32520. ,
  32521. i.decode = function(e, t, i) {
  32522. if (t != this.type.wireType)
  32523. throw Error("Unexpected wire type for element");
  32524. var n, r;
  32525. switch (this.type) {
  32526. case g.TYPES.int32:
  32527. return 0 | e.readVarint32();
  32528. case g.TYPES.uint32:
  32529. return e.readVarint32() >>> 0;
  32530. case g.TYPES.sint32:
  32531. return 0 | e.readVarint32ZigZag();
  32532. case g.TYPES.fixed32:
  32533. return e.readUint32() >>> 0;
  32534. case g.TYPES.sfixed32:
  32535. return 0 | e.readInt32();
  32536. case g.TYPES.int64:
  32537. return e.readVarint64();
  32538. case g.TYPES.uint64:
  32539. return e.readVarint64().toUnsigned();
  32540. case g.TYPES.sint64:
  32541. return e.readVarint64ZigZag();
  32542. case g.TYPES.fixed64:
  32543. return e.readUint64();
  32544. case g.TYPES.sfixed64:
  32545. return e.readInt64();
  32546. case g.TYPES.bool:
  32547. return !!e.readVarint32();
  32548. case g.TYPES.enum:
  32549. return e.readVarint32();
  32550. case g.TYPES.float:
  32551. return e.readFloat();
  32552. case g.TYPES.double:
  32553. return e.readDouble();
  32554. case g.TYPES.string:
  32555. return e.readVString();
  32556. case g.TYPES.bytes:
  32557. if (r = e.readVarint32(),
  32558. e.remaining() < r)
  32559. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
  32560. return (n = e.clone()).limit = n.offset + r,
  32561. e.offset += r,
  32562. n;
  32563. case g.TYPES.message:
  32564. return r = e.readVarint32(),
  32565. this.resolvedType.decode(e, r);
  32566. case g.TYPES.group:
  32567. return this.resolvedType.decode(e, -1, i)
  32568. }
  32569. throw Error("[INTERNAL] Illegal decode type")
  32570. }
  32571. ,
  32572. i.valueFromString = function(e) {
  32573. if (!this.isMapKey)
  32574. throw Error("valueFromString() called on non-map-key element");
  32575. switch (this.type) {
  32576. case g.TYPES.int32:
  32577. case g.TYPES.sint32:
  32578. case g.TYPES.sfixed32:
  32579. case g.TYPES.uint32:
  32580. case g.TYPES.fixed32:
  32581. return this.verifyValue(parseInt(e));
  32582. case g.TYPES.int64:
  32583. case g.TYPES.sint64:
  32584. case g.TYPES.sfixed64:
  32585. case g.TYPES.uint64:
  32586. case g.TYPES.fixed64:
  32587. return this.verifyValue(e);
  32588. case g.TYPES.bool:
  32589. return "true" === e;
  32590. case g.TYPES.string:
  32591. return this.verifyValue(e);
  32592. case g.TYPES.bytes:
  32593. return I.fromBinary(e)
  32594. }
  32595. }
  32596. ,
  32597. i.valueToString = function(e) {
  32598. if (!this.isMapKey)
  32599. throw Error("valueToString() called on non-map-key element");
  32600. return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
  32601. }
  32602. ,
  32603. s.Element = u;
  32604. var d = function(e, t, i, n, r, o) {
  32605. l.call(this, e, t, i, n, o),
  32606. this.className = "Message",
  32607. this.extensions = void 0,
  32608. this.clazz = null,
  32609. this.isGroup = !!r,
  32610. this._fields = null,
  32611. this._fieldsById = null,
  32612. this._fieldsByName = null
  32613. }
  32614. , n = d.prototype = Object.create(l.prototype);
  32615. n.build = function(e) {
  32616. if (this.clazz && !e)
  32617. return this.clazz;
  32618. var t = function(u, a) {
  32619. function d(e, i, n, r) {
  32620. if (null === e || "object" != typeof e) {
  32621. if (r && r instanceof u.Reflect.Enum) {
  32622. var t = u.Reflect.Enum.getName(r.object, e);
  32623. if (null !== t)
  32624. return t
  32625. }
  32626. return e
  32627. }
  32628. if (I.isByteBuffer(e))
  32629. return i ? e.toBase64() : e.toBuffer();
  32630. if (u.Long.isLong(e))
  32631. return n ? e.toString() : u.Long.fromValue(e);
  32632. var o;
  32633. if (Array.isArray(e))
  32634. return o = [],
  32635. e.forEach(function(e, t) {
  32636. o[t] = d(e, i, n, r)
  32637. }),
  32638. o;
  32639. if (o = {},
  32640. e instanceof u.Map) {
  32641. for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
  32642. o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
  32643. return o
  32644. }
  32645. var l = e.$type
  32646. , c = void 0;
  32647. for (var h in e)
  32648. e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
  32649. return o
  32650. }
  32651. var s = a.getChildren(u.Reflect.Message.Field)
  32652. , l = a.getChildren(u.Reflect.Message.OneOf)
  32653. , c = function(e, t) {
  32654. u.Builder.Message.call(this);
  32655. for (var i = 0, n = l.length; i < n; ++i)
  32656. this[l[i].name] = null;
  32657. for (i = 0,
  32658. n = s.length; i < n; ++i) {
  32659. var r = s[i];
  32660. this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
  32661. !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
  32662. }
  32663. var o;
  32664. if (0 < arguments.length)
  32665. 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)
  32666. for (i = 0,
  32667. n = arguments.length; i < n; ++i)
  32668. void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
  32669. else
  32670. this.$set(e)
  32671. }
  32672. , o = c.prototype = Object.create(u.Builder.Message.prototype);
  32673. o.add = function(e, t, i) {
  32674. var n = a._fieldsByName[e];
  32675. if (!i) {
  32676. if (!n)
  32677. throw Error(this + "#" + e + " is undefined");
  32678. if (!(n instanceof u.Reflect.Message.Field))
  32679. throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
  32680. if (!n.repeated)
  32681. throw Error(this + "#" + e + " is not a repeated field");
  32682. t = n.verifyValue(t, !0)
  32683. }
  32684. return null === this[e] && (this[e] = []),
  32685. this[e].push(t),
  32686. this
  32687. }
  32688. ,
  32689. o.$add = o.add,
  32690. o.set = function(e, t, i) {
  32691. if (e && "object" == typeof e) {
  32692. for (var n in i = t,
  32693. e)
  32694. e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
  32695. return this
  32696. }
  32697. var r = a._fieldsByName[e];
  32698. if (i)
  32699. this[e] = t;
  32700. else {
  32701. if (!r)
  32702. throw Error(this + "#" + e + " is not a field: undefined");
  32703. if (!(r instanceof u.Reflect.Message.Field))
  32704. throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
  32705. this[r.name] = t = r.verifyValue(t)
  32706. }
  32707. if (r && r.oneof) {
  32708. var o = this[r.oneof.name];
  32709. null !== t ? (null !== o && o !== r.name && (this[o] = null),
  32710. this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
  32711. }
  32712. return this
  32713. }
  32714. ,
  32715. o.$set = o.set,
  32716. o.get = function(e, t) {
  32717. if (t)
  32718. return this[e];
  32719. var i = a._fieldsByName[e];
  32720. if (!(i && i instanceof u.Reflect.Message.Field))
  32721. throw Error(this + "#" + e + " is not a field: undefined");
  32722. if (!(i instanceof u.Reflect.Message.Field))
  32723. throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
  32724. return this[i.name]
  32725. }
  32726. ,
  32727. o.$get = o.get;
  32728. for (var e = 0; e < s.length; e++) {
  32729. var t = s[e];
  32730. t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
  32731. var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  32732. return e.toUpperCase().replace("_", "")
  32733. });
  32734. e = e.substring(0, 1).toUpperCase() + e.substring(1);
  32735. function t(e, t) {
  32736. return this[i.name] = t ? e : i.verifyValue(e),
  32737. this
  32738. }
  32739. function n() {
  32740. return this[i.name]
  32741. }
  32742. var r = i.originalName.replace(/([A-Z])/g, function(e) {
  32743. return "_" + e
  32744. });
  32745. null === a.getChild("set" + e) && (o["set" + e] = t),
  32746. null === a.getChild("set_" + r) && (o["set_" + r] = t),
  32747. null === a.getChild("get" + e) && (o["get" + e] = n),
  32748. null === a.getChild("get_" + r) && (o["get_" + r] = n)
  32749. }(t)
  32750. }
  32751. return o.encode = function(t, e) {
  32752. "boolean" == typeof t && (e = t,
  32753. t = void 0);
  32754. var i = !1;
  32755. t || (t = new I,
  32756. i = !0);
  32757. var n = t.littleEndian;
  32758. try {
  32759. return a.encode(this, t.LE(), e),
  32760. (i ? t.flip() : t).LE(n)
  32761. } catch (e) {
  32762. throw t.LE(n),
  32763. e
  32764. }
  32765. }
  32766. ,
  32767. c.encode = function(e, t, i) {
  32768. return new c(e).encode(t, i)
  32769. }
  32770. ,
  32771. o.calculate = function() {
  32772. return a.calculate(this)
  32773. }
  32774. ,
  32775. o.encodeDelimited = function(e, t) {
  32776. var i = !1;
  32777. e || (e = new I,
  32778. i = !0);
  32779. var n = (new I).LE();
  32780. return a.encode(this, n, t).flip(),
  32781. e.writeVarint32(n.remaining()),
  32782. e.append(n),
  32783. i ? e.flip() : e
  32784. }
  32785. ,
  32786. o.encodeAB = function() {
  32787. try {
  32788. return this.encode().toArrayBuffer()
  32789. } catch (e) {
  32790. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  32791. e
  32792. }
  32793. }
  32794. ,
  32795. o.toArrayBuffer = o.encodeAB,
  32796. o.encodeNB = function() {
  32797. try {
  32798. return this.encode().toBuffer()
  32799. } catch (e) {
  32800. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  32801. e
  32802. }
  32803. }
  32804. ,
  32805. o.toBuffer = o.encodeNB,
  32806. o.encode64 = function() {
  32807. try {
  32808. return this.encode().toBase64()
  32809. } catch (e) {
  32810. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  32811. e
  32812. }
  32813. }
  32814. ,
  32815. o.toBase64 = o.encode64,
  32816. o.encodeHex = function() {
  32817. try {
  32818. return this.encode().toHex()
  32819. } catch (e) {
  32820. throw e.encoded && (e.encoded = e.encoded.toHex()),
  32821. e
  32822. }
  32823. }
  32824. ,
  32825. o.toHex = o.encodeHex,
  32826. o.toRaw = function(e, t) {
  32827. return d(this, !!e, !!t, this.$type)
  32828. }
  32829. ,
  32830. o.encodeJSON = function() {
  32831. return JSON.stringify(d(this, !0, !0, this.$type))
  32832. }
  32833. ,
  32834. c.decode = function(t, e, i) {
  32835. "string" == typeof e && (i = e,
  32836. e = -1),
  32837. "string" == typeof t && (t = I.wrap(t, i || "base64"));
  32838. var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
  32839. try {
  32840. var r = a.decode(t.LE());
  32841. return t.LE(n),
  32842. r
  32843. } catch (e) {
  32844. throw t.LE(n),
  32845. e
  32846. }
  32847. }
  32848. ,
  32849. c.decodeDelimited = function(t, e) {
  32850. if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
  32851. (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
  32852. return null;
  32853. var i = t.offset
  32854. , n = t.readVarint32();
  32855. if (t.remaining() < n)
  32856. return t.offset = i,
  32857. null;
  32858. try {
  32859. var r = a.decode(t.slice(t.offset, t.offset + n).LE());
  32860. return t.offset += n,
  32861. r
  32862. } catch (e) {
  32863. throw t.offset += n,
  32864. e
  32865. }
  32866. }
  32867. ,
  32868. c.decode64 = function(e) {
  32869. return c.decode(e, "base64")
  32870. }
  32871. ,
  32872. c.decodeHex = function(e) {
  32873. return c.decode(e, "hex")
  32874. }
  32875. ,
  32876. c.decodeJSON = function(e) {
  32877. return new c(JSON.parse(e))
  32878. }
  32879. ,
  32880. o.toString = function() {
  32881. return a.toString()
  32882. }
  32883. ,
  32884. Object.defineProperty && (Object.defineProperty(c, "$options", {
  32885. value: a.buildOpt()
  32886. }),
  32887. Object.defineProperty(o, "$options", {
  32888. value: c.$options
  32889. }),
  32890. Object.defineProperty(c, "$type", {
  32891. value: a
  32892. }),
  32893. Object.defineProperty(o, "$type", {
  32894. value: a
  32895. })),
  32896. c
  32897. }(g, this);
  32898. this._fields = [],
  32899. this._fieldsById = {},
  32900. this._fieldsByName = {};
  32901. for (var i, n = 0, r = this.children.length; n < r; n++)
  32902. if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
  32903. if (t.hasOwnProperty(i.name))
  32904. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
  32905. t[i.name] = i.build()
  32906. } else if (i instanceof d.Field)
  32907. i.build(),
  32908. this._fields.push(i),
  32909. this._fieldsById[i.id] = i,
  32910. this._fieldsByName[i.name] = i;
  32911. else if (!(i instanceof d.OneOf || i instanceof v))
  32912. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
  32913. return this.clazz = t
  32914. }
  32915. ,
  32916. n.encode = function(e, t, i) {
  32917. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  32918. r = e[(n = this._fields[a]).name],
  32919. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  32920. if (null === o)
  32921. return t;
  32922. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  32923. throw l.encoded = t,
  32924. l
  32925. }
  32926. ,
  32927. n.calculate = function(e) {
  32928. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  32929. if (i = e[(t = this._fields[r]).name],
  32930. t.required && null === i)
  32931. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  32932. n += t.calculate(i, e)
  32933. }
  32934. return n
  32935. }
  32936. ,
  32937. n.decode = function(e, t, i) {
  32938. t = "number" == typeof t ? t : -1;
  32939. for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
  32940. if (o = (n = e.readVarint32()) >>> 3,
  32941. (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
  32942. if (o !== i)
  32943. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
  32944. break
  32945. }
  32946. if (a = this._fieldsById[o]) {
  32947. if (a.repeated && !a.options.packed)
  32948. l[a.name].push(a.decode(r, e));
  32949. else if (a.map) {
  32950. var c = a.decode(r, e);
  32951. l[a.name].set(c[0], c[1])
  32952. } else if (l[a.name] = a.decode(r, e),
  32953. a.oneof) {
  32954. var h = l[a.oneof.name];
  32955. null !== h && h !== a.name && (l[h] = null),
  32956. l[a.oneof.name] = a.name
  32957. }
  32958. } else
  32959. switch (r) {
  32960. case g.WIRE_TYPES.VARINT:
  32961. e.readVarint32();
  32962. break;
  32963. case g.WIRE_TYPES.BITS32:
  32964. e.offset += 4;
  32965. break;
  32966. case g.WIRE_TYPES.BITS64:
  32967. e.offset += 8;
  32968. break;
  32969. case g.WIRE_TYPES.LDELIM:
  32970. var u = e.readVarint32();
  32971. e.offset += u;
  32972. break;
  32973. case g.WIRE_TYPES.STARTGROUP:
  32974. for (; m(o, e); )
  32975. ;
  32976. break;
  32977. default:
  32978. throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
  32979. }
  32980. }
  32981. for (var d = 0, p = this._fields.length; d < p; ++d)
  32982. if (null === l[(a = this._fields[d]).name])
  32983. if ("proto3" === this.syntax)
  32984. l[a.name] = a.defaultValue;
  32985. else {
  32986. if (a.required) {
  32987. var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
  32988. throw f.decoded = l,
  32989. f
  32990. }
  32991. g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
  32992. }
  32993. return l
  32994. }
  32995. ,
  32996. s.Message = d;
  32997. function c(e, t, i, n, r, o, a, s, l, c) {
  32998. h.call(this, e, t, o),
  32999. this.className = "Message.Field",
  33000. this.required = "required" === i,
  33001. this.repeated = "repeated" === i,
  33002. this.map = "map" === i,
  33003. this.keyType = n || null,
  33004. this.type = r,
  33005. this.resolvedType = null,
  33006. this.id = a,
  33007. this.options = s || {},
  33008. this.defaultValue = null,
  33009. this.oneof = l || null,
  33010. this.syntax = c || "proto2",
  33011. this.originalName = this.name,
  33012. this.element = null,
  33013. this.keyElement = null,
  33014. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
  33015. }
  33016. var r = c.prototype = Object.create(h.prototype);
  33017. r.build = function() {
  33018. this.element = new u(this.type,this.resolvedType,!1,this.syntax),
  33019. this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
  33020. "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)
  33021. }
  33022. ,
  33023. r.verifyValue = function(e, t) {
  33024. function i(e, t) {
  33025. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33026. }
  33027. t = t || !1;
  33028. var n, r = this;
  33029. if (null === e)
  33030. return this.required && i(typeof e, "required"),
  33031. "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
  33032. null;
  33033. if (!this.repeated || t)
  33034. return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
  33035. new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
  33036. this.element.verifyValue(e));
  33037. Array.isArray(e) || (e = [e]);
  33038. var o = [];
  33039. for (n = 0; n < e.length; n++)
  33040. o.push(this.element.verifyValue(e[n]));
  33041. return o
  33042. }
  33043. ,
  33044. r.hasWirePresence = function(e, t) {
  33045. if ("proto3" !== this.syntax)
  33046. return null !== e;
  33047. if (this.oneof && t[this.oneof.name] === this.name)
  33048. return !0;
  33049. switch (this.type) {
  33050. case g.TYPES.int32:
  33051. case g.TYPES.sint32:
  33052. case g.TYPES.sfixed32:
  33053. case g.TYPES.uint32:
  33054. case g.TYPES.fixed32:
  33055. return 0 !== e;
  33056. case g.TYPES.int64:
  33057. case g.TYPES.sint64:
  33058. case g.TYPES.sfixed64:
  33059. case g.TYPES.uint64:
  33060. case g.TYPES.fixed64:
  33061. return 0 !== e.low || 0 !== e.high;
  33062. case g.TYPES.bool:
  33063. return e;
  33064. case g.TYPES.float:
  33065. case g.TYPES.double:
  33066. return 0 !== e;
  33067. case g.TYPES.string:
  33068. return 0 < e.length;
  33069. case g.TYPES.bytes:
  33070. return 0 < e.remaining();
  33071. case g.TYPES.enum:
  33072. return 0 !== e;
  33073. case g.TYPES.message:
  33074. return null !== e;
  33075. default:
  33076. return !0
  33077. }
  33078. }
  33079. ,
  33080. r.encode = function(t, r, e) {
  33081. if (null === this.type || "object" != typeof this.type)
  33082. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33083. if (null === t || this.repeated && 0 == t.length)
  33084. return r;
  33085. try {
  33086. var i;
  33087. if (this.repeated)
  33088. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33089. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33090. r.ensureCapacity(r.offset += 1);
  33091. var n = r.offset;
  33092. for (i = 0; i < t.length; i++)
  33093. this.element.encodeValue(this.id, t[i], r);
  33094. var o = r.offset - n
  33095. , a = I.calculateVarint32(o);
  33096. if (1 < a) {
  33097. var s = r.slice(n, r.offset);
  33098. n += a - 1,
  33099. r.offset = n,
  33100. r.append(s)
  33101. }
  33102. r.writeVarint32(o, n - a)
  33103. } else
  33104. for (i = 0; i < t.length; i++)
  33105. r.writeVarint32(this.id << 3 | this.type.wireType),
  33106. this.element.encodeValue(this.id, t[i], r);
  33107. else
  33108. this.map ? t.forEach(function(e, t, i) {
  33109. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33110. r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33111. r.writeVarint32(n),
  33112. r.writeVarint32(8 | this.keyType.wireType),
  33113. this.keyElement.encodeValue(1, t, r),
  33114. r.writeVarint32(16 | this.type.wireType),
  33115. this.element.encodeValue(2, e, r)
  33116. }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
  33117. this.element.encodeValue(this.id, t, r))
  33118. } catch (e) {
  33119. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33120. }
  33121. return r
  33122. }
  33123. ,
  33124. r.calculate = function(t, e) {
  33125. if (t = this.verifyValue(t),
  33126. null === this.type || "object" != typeof this.type)
  33127. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33128. if (null === t || this.repeated && 0 == t.length)
  33129. return 0;
  33130. var r = 0;
  33131. try {
  33132. var i, n;
  33133. if (this.repeated)
  33134. if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
  33135. for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33136. i = n = 0; i < t.length; i++)
  33137. n += this.element.calculateLength(this.id, t[i]);
  33138. r += I.calculateVarint32(n),
  33139. r += n
  33140. } else
  33141. for (i = 0; i < t.length; i++)
  33142. r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33143. r += this.element.calculateLength(this.id, t[i]);
  33144. else
  33145. this.map ? t.forEach(function(e, t, i) {
  33146. var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
  33147. r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
  33148. r += I.calculateVarint32(n),
  33149. r += n
  33150. }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
  33151. r += this.element.calculateLength(this.id, t))
  33152. } catch (e) {
  33153. throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
  33154. }
  33155. return r
  33156. }
  33157. ,
  33158. r.decode = function(e, t, i) {
  33159. var n, r;
  33160. 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))
  33161. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
  33162. if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
  33163. r = t.readVarint32(),
  33164. r = t.offset + r;
  33165. for (var o = []; t.offset < r; )
  33166. o.push(this.decode(this.type.wireType, t, !0));
  33167. return o
  33168. }
  33169. if (this.map) {
  33170. var a = u.defaultFieldValue(this.keyType);
  33171. if (n = u.defaultFieldValue(this.type),
  33172. r = t.readVarint32(),
  33173. t.remaining() < r)
  33174. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
  33175. var s = t.clone();
  33176. for (s.limit = s.offset + r,
  33177. t.offset += r; 0 < s.remaining(); ) {
  33178. var l = s.readVarint32();
  33179. e = 7 & l;
  33180. var c = l >>> 3;
  33181. if (1 == c)
  33182. a = this.keyElement.decode(s, e, c);
  33183. else {
  33184. if (2 != c)
  33185. throw Error("Unexpected tag in map field key/value submessage");
  33186. n = this.element.decode(s, e, c)
  33187. }
  33188. }
  33189. return [a, n]
  33190. }
  33191. return this.element.decode(t, e, this.id)
  33192. }
  33193. ,
  33194. s.Message.Field = c;
  33195. function o(e, t, i, n, r, o, a) {
  33196. c.call(this, e, t, i, null, n, r, o, a),
  33197. this.extension
  33198. }
  33199. o.prototype = Object.create(c.prototype),
  33200. s.Message.ExtensionField = o;
  33201. s.Message.OneOf = function(e, t, i) {
  33202. h.call(this, e, t, i),
  33203. this.fields = []
  33204. }
  33205. ;
  33206. var p = function(e, t, i, n, r) {
  33207. l.call(this, e, t, i, n, r),
  33208. this.className = "Enum",
  33209. this.object = null
  33210. };
  33211. p.getName = function(e, t) {
  33212. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33213. if (e[i = n[r]] === t)
  33214. return i;
  33215. return null
  33216. }
  33217. ,
  33218. (p.prototype = Object.create(l.prototype)).build = function(e) {
  33219. if (this.object && !e)
  33220. return this.object;
  33221. for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
  33222. t[i[n].name] = i[n].id;
  33223. return Object.defineProperty && Object.defineProperty(t, "$options", {
  33224. value: this.buildOpt(),
  33225. enumerable: !1
  33226. }),
  33227. this.object = t
  33228. }
  33229. ,
  33230. s.Enum = p;
  33231. function f(e, t, i, n) {
  33232. h.call(this, e, t, i),
  33233. this.className = "Enum.Value",
  33234. this.id = n
  33235. }
  33236. f.prototype = Object.create(h.prototype),
  33237. s.Enum.Value = f;
  33238. var v = function(e, t, i, n) {
  33239. h.call(this, e, t, i),
  33240. this.field = n
  33241. };
  33242. v.prototype = Object.create(h.prototype),
  33243. s.Extension = v;
  33244. var y = function(e, t, i, n) {
  33245. l.call(this, e, t, i, n),
  33246. this.className = "Service",
  33247. this.clazz = null
  33248. };
  33249. (y.prototype = Object.create(l.prototype)).build = function(e) {
  33250. return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
  33251. for (var o = function(e) {
  33252. t.Builder.Service.call(this),
  33253. this.rpcImpl = e || function(e, t, i) {
  33254. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33255. }
  33256. }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
  33257. !function(n) {
  33258. e[n.name] = function(e, i) {
  33259. try {
  33260. try {
  33261. e = n.resolvedRequestType.clazz.decode(I.wrap(e))
  33262. } catch (e) {
  33263. if (!(e instanceof TypeError))
  33264. throw e
  33265. }
  33266. if (null === e || "object" != typeof e)
  33267. throw Error("Illegal arguments");
  33268. e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
  33269. this.rpcImpl(n.fqn(), e, function(e, t) {
  33270. if (!e) {
  33271. null === t && (t = "");
  33272. try {
  33273. t = n.resolvedResponseType.clazz.decode(t)
  33274. } catch (e) {}
  33275. 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))
  33276. }
  33277. i(e)
  33278. })
  33279. } catch (e) {
  33280. setTimeout(i.bind(this, e), 0)
  33281. }
  33282. }
  33283. ,
  33284. o[n.name] = function(e, t, i) {
  33285. new o(e)[n.name](t, i)
  33286. }
  33287. ,
  33288. Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
  33289. value: n.buildOpt()
  33290. }),
  33291. Object.defineProperty(e[n.name], "$options", {
  33292. value: o[n.name].$options
  33293. }))
  33294. }(i[n]);
  33295. return Object.defineProperty && (Object.defineProperty(o, "$options", {
  33296. value: r.buildOpt()
  33297. }),
  33298. Object.defineProperty(e, "$options", {
  33299. value: o.$options
  33300. }),
  33301. Object.defineProperty(o, "$type", {
  33302. value: r
  33303. }),
  33304. Object.defineProperty(e, "$type", {
  33305. value: r
  33306. })),
  33307. o
  33308. }(g, this)
  33309. }
  33310. ,
  33311. s.Service = y;
  33312. function A(e, t, i, n) {
  33313. h.call(this, e, t, i),
  33314. this.className = "Service.Method",
  33315. this.options = n || {}
  33316. }
  33317. (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
  33318. s.Service.Method = A;
  33319. function C(e, t, i, n, r, o, a, s) {
  33320. A.call(this, e, t, i, s),
  33321. this.className = "Service.RPCMethod",
  33322. this.requestName = n,
  33323. this.responseName = r,
  33324. this.requestStream = o,
  33325. this.responseStream = a,
  33326. this.resolvedRequestType = null,
  33327. this.resolvedResponseType = null
  33328. }
  33329. return C.prototype = Object.create(A.prototype),
  33330. s.Service.RPCMethod = C,
  33331. s
  33332. }(o),
  33333. o.Builder = (i = (u = o).Lang,
  33334. s = o.Reflect,
  33335. n = h.prototype,
  33336. h.isMessage = function(e) {
  33337. return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
  33338. }
  33339. ,
  33340. h.isMessageField = function(e) {
  33341. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
  33342. }
  33343. ,
  33344. h.isEnum = function(e) {
  33345. return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
  33346. }
  33347. ,
  33348. h.isService = function(e) {
  33349. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  33350. }
  33351. ,
  33352. h.isExtend = function(e) {
  33353. return "string" == typeof e.ref
  33354. }
  33355. ,
  33356. n.reset = function() {
  33357. return this.ptr = this.ns,
  33358. this
  33359. }
  33360. ,
  33361. n.define = function(e) {
  33362. if ("string" != typeof e || !i.TYPEREF.test(e))
  33363. throw Error("illegal namespace: " + e);
  33364. return e.split(".").forEach(function(e) {
  33365. var t = this.ptr.getChild(e);
  33366. null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
  33367. this.ptr = t
  33368. }, this),
  33369. this
  33370. }
  33371. ,
  33372. n.create = function(e) {
  33373. if (!e)
  33374. return this;
  33375. if (Array.isArray(e)) {
  33376. if (0 === e.length)
  33377. return this;
  33378. e = e.slice()
  33379. } else
  33380. e = [e];
  33381. for (var t = [e]; 0 < t.length; ) {
  33382. if (e = t.pop(),
  33383. !Array.isArray(e))
  33384. throw Error("not a valid namespace: " + JSON.stringify(e));
  33385. for (; 0 < e.length; ) {
  33386. var i = e.shift();
  33387. if (h.isMessage(i)) {
  33388. var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
  33389. , n = {};
  33390. i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
  33391. o.addChild(n[e] = new s.Message.OneOf(this,o,e))
  33392. }, this),
  33393. i.fields && i.fields.forEach(function(e) {
  33394. if (null !== o.getChild(0 | e.id))
  33395. throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
  33396. if (e.options && "object" != typeof e.options)
  33397. throw Error("illegal field options in " + o.name + "#" + e.name);
  33398. var t = null;
  33399. if ("string" == typeof e.oneof && !(t = n[e.oneof]))
  33400. throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
  33401. e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
  33402. t && t.fields.push(e),
  33403. o.addChild(e)
  33404. }, this);
  33405. var r = [];
  33406. if (i.enums && i.enums.forEach(function(e) {
  33407. r.push(e)
  33408. }),
  33409. i.messages && i.messages.forEach(function(e) {
  33410. r.push(e)
  33411. }),
  33412. i.services && i.services.forEach(function(e) {
  33413. r.push(e)
  33414. }),
  33415. i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
  33416. this.ptr.addChild(o),
  33417. 0 < r.length) {
  33418. t.push(e),
  33419. e = r,
  33420. r = null,
  33421. this.ptr = o,
  33422. o = null;
  33423. continue
  33424. }
  33425. r = null
  33426. } else if (h.isEnum(i))
  33427. o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
  33428. i.values.forEach(function(e) {
  33429. o.addChild(new s.Enum.Value(this,o,e.name,e.id))
  33430. }, this),
  33431. this.ptr.addChild(o);
  33432. else if (h.isService(i))
  33433. o = new s.Service(this,this.ptr,i.name,i.options),
  33434. Object.keys(i.rpc).forEach(function(e) {
  33435. var t = i.rpc[e];
  33436. o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  33437. }, this),
  33438. this.ptr.addChild(o);
  33439. else {
  33440. if (!h.isExtend(i))
  33441. throw Error("not a valid definition: " + JSON.stringify(i));
  33442. if (o = this.ptr.resolve(i.ref, !0))
  33443. i.fields.forEach(function(t) {
  33444. if (null !== o.getChild(0 | t.id))
  33445. throw Error("duplicate extended field id in " + o.name + ": " + t.id);
  33446. if (o.extensions) {
  33447. var i = !1;
  33448. if (o.extensions.forEach(function(e) {
  33449. t.id >= e[0] && t.id <= e[1] && (i = !0)
  33450. }),
  33451. !i)
  33452. throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
  33453. }
  33454. var e = t.name;
  33455. this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
  33456. var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
  33457. , r = new s.Extension(this,this.ptr,t.name,n);
  33458. n.extension = r,
  33459. this.ptr.addChild(r),
  33460. o.addChild(n)
  33461. }, this);
  33462. else if (!/\.?google\.protobuf\./.test(i.ref))
  33463. throw Error("extended message " + i.ref + " is not defined")
  33464. }
  33465. o = i = null
  33466. }
  33467. e = null,
  33468. this.ptr = this.ptr.parent
  33469. }
  33470. return this.resolved = !1,
  33471. this.result = null,
  33472. this
  33473. }
  33474. ,
  33475. n.import = function(t, e) {
  33476. var i = "/";
  33477. if ("string" == typeof e) {
  33478. if (u.Util.IS_NODE && (e = p("path").resolve(e)),
  33479. !0 === this.files[e])
  33480. return this.reset();
  33481. this.files[e] = !0
  33482. } else if ("object" == typeof e) {
  33483. var n = e.root;
  33484. u.Util.IS_NODE && (n = p("path").resolve(n)),
  33485. (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
  33486. var r = n + i + e.file;
  33487. if (!0 === this.files[r])
  33488. return this.reset();
  33489. this.files[r] = !0
  33490. }
  33491. if (t.imports && 0 < t.imports.length) {
  33492. var o, a = !1;
  33493. "object" == typeof e ? (this.importRoot = e.root,
  33494. a = !0,
  33495. o = this.importRoot,
  33496. e = e.file,
  33497. (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(/\\[^\\]*$/, ""),
  33498. i = "\\") : o = "." : o = null;
  33499. for (var s = 0; s < t.imports.length; s++)
  33500. if ("string" == typeof t.imports[s]) {
  33501. if (!o)
  33502. throw Error("cannot determine import root");
  33503. var l = t.imports[s];
  33504. if ("google/protobuf/descriptor.proto" === l)
  33505. continue;
  33506. if (l = o + i + l,
  33507. !0 === this.files[l])
  33508. continue;
  33509. /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
  33510. var c = u.Util.fetch(l);
  33511. if (null === c)
  33512. throw Error("failed to import '" + l + "' in '" + e + "': file not found");
  33513. /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
  33514. } else
  33515. e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  33516. return t + "_import" + s + "." + i
  33517. })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
  33518. a && (this.importRoot = null)
  33519. }
  33520. t.package && this.define(t.package),
  33521. t.syntax && function t(i) {
  33522. i.messages && i.messages.forEach(function(e) {
  33523. e.syntax = i.syntax,
  33524. t(e)
  33525. }),
  33526. i.enums && i.enums.forEach(function(e) {
  33527. e.syntax = i.syntax
  33528. })
  33529. }(t);
  33530. var h = this.ptr;
  33531. return t.options && Object.keys(t.options).forEach(function(e) {
  33532. h.options[e] = t.options[e]
  33533. }),
  33534. t.messages && (this.create(t.messages),
  33535. this.ptr = h),
  33536. t.enums && (this.create(t.enums),
  33537. this.ptr = h),
  33538. t.services && (this.create(t.services),
  33539. this.ptr = h),
  33540. t.extends && this.create(t.extends),
  33541. this.reset()
  33542. }
  33543. ,
  33544. n.resolveAll = function() {
  33545. var e;
  33546. if (null == this.ptr || "object" == typeof this.ptr.type)
  33547. return this;
  33548. if (this.ptr instanceof s.Namespace)
  33549. this.ptr.children.forEach(function(e) {
  33550. this.ptr = e,
  33551. this.resolveAll()
  33552. }, this);
  33553. else if (this.ptr instanceof s.Message.Field) {
  33554. if (i.TYPE.test(this.ptr.type))
  33555. this.ptr.type = u.TYPES[this.ptr.type];
  33556. else {
  33557. if (!i.TYPEREF.test(this.ptr.type))
  33558. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  33559. if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
  33560. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  33561. if ((this.ptr.resolvedType = e)instanceof s.Enum) {
  33562. if (this.ptr.type = u.TYPES.enum,
  33563. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  33564. throw Error("proto3 message cannot reference proto2 enum")
  33565. } else {
  33566. if (!(e instanceof s.Message))
  33567. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  33568. this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
  33569. }
  33570. }
  33571. if (this.ptr.map) {
  33572. if (!i.TYPE.test(this.ptr.keyType))
  33573. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  33574. this.ptr.keyType = u.TYPES[this.ptr.keyType]
  33575. }
  33576. } else if (this.ptr instanceof u.Reflect.Service.Method) {
  33577. if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
  33578. throw Error("illegal service type in " + this.ptr.toString(!0));
  33579. if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
  33580. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  33581. if (this.ptr.resolvedRequestType = e,
  33582. !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
  33583. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  33584. this.ptr.resolvedResponseType = e
  33585. } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
  33586. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  33587. return this.reset()
  33588. }
  33589. ,
  33590. n.build = function(e) {
  33591. if (this.reset(),
  33592. this.resolved || (this.resolveAll(),
  33593. this.resolved = !0,
  33594. this.result = null),
  33595. null === this.result && (this.result = this.ns.build()),
  33596. !e)
  33597. return this.result;
  33598. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  33599. if (!i[t[n]]) {
  33600. i = null;
  33601. break
  33602. }
  33603. i = i[t[n]]
  33604. }
  33605. return i
  33606. }
  33607. ,
  33608. n.lookup = function(e, t) {
  33609. return e ? this.ns.resolve(e, t) : this.ns
  33610. }
  33611. ,
  33612. n.toString = function() {
  33613. return "Builder"
  33614. }
  33615. ,
  33616. h.Message = function() {}
  33617. ,
  33618. h.Enum = function() {}
  33619. ,
  33620. h.Service = function() {}
  33621. ,
  33622. h),
  33623. o.Map = (a = o.Reflect,
  33624. (t = c.prototype).clear = function() {
  33625. this.map = {}
  33626. }
  33627. ,
  33628. t.delete = function(e) {
  33629. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  33630. , i = t in this.map;
  33631. return delete this.map[t],
  33632. i
  33633. }
  33634. ,
  33635. t.entries = function() {
  33636. for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
  33637. t.push([(e = this.map[i[n]]).key, e.value]);
  33638. return l(t)
  33639. }
  33640. ,
  33641. t.keys = function() {
  33642. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  33643. e.push(this.map[t[i]].key);
  33644. return l(e)
  33645. }
  33646. ,
  33647. t.values = function() {
  33648. for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
  33649. e.push(this.map[t[i]].value);
  33650. return l(e)
  33651. }
  33652. ,
  33653. t.forEach = function(e, t) {
  33654. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  33655. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  33656. }
  33657. ,
  33658. t.set = function(e, t) {
  33659. var i = this.keyElem.verifyValue(e)
  33660. , n = this.valueElem.verifyValue(t);
  33661. return this.map[this.keyElem.valueToString(i)] = {
  33662. key: i,
  33663. value: n
  33664. },
  33665. this
  33666. }
  33667. ,
  33668. t.get = function(e) {
  33669. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  33670. if (t in this.map)
  33671. return this.map[t].value
  33672. }
  33673. ,
  33674. t.has = function(e) {
  33675. return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
  33676. }
  33677. ,
  33678. c),
  33679. o.loadProto = function(e, t, i) {
  33680. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  33681. t = void 0),
  33682. o.loadJson(o.DotProto.Parser.parse(e), t, i)
  33683. }
  33684. ,
  33685. o.protoFromString = o.loadProto,
  33686. o.loadProtoFile = function(t, i, n) {
  33687. if (i && "object" == typeof i ? (n = i,
  33688. i = null) : i && "function" == typeof i || (i = null),
  33689. i)
  33690. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  33691. if (null !== e)
  33692. try {
  33693. i(null, o.loadProto(e, n, t))
  33694. } catch (e) {
  33695. i(e)
  33696. }
  33697. else
  33698. i(Error("Failed to fetch file"))
  33699. });
  33700. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  33701. return null === e ? null : o.loadProto(e, n, t)
  33702. }
  33703. ,
  33704. o.protoFromFile = o.loadProtoFile,
  33705. o.newBuilder = function(e) {
  33706. return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
  33707. void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
  33708. new o.Builder(e)
  33709. }
  33710. ,
  33711. o.loadJson = function(e, t, i) {
  33712. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  33713. t = null),
  33714. t && "object" == typeof t || (t = o.newBuilder()),
  33715. "string" == typeof e && (e = JSON.parse(e)),
  33716. t.import(e, i),
  33717. t.resolveAll(),
  33718. t
  33719. }
  33720. ,
  33721. o.loadJsonFile = function(t, i, n) {
  33722. if (i && "object" == typeof i ? (n = i,
  33723. i = null) : i && "function" == typeof i || (i = null),
  33724. i)
  33725. return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
  33726. if (null !== e)
  33727. try {
  33728. i(null, o.loadJson(JSON.parse(e), n, t))
  33729. } catch (e) {
  33730. i(e)
  33731. }
  33732. else
  33733. i(Error("Failed to fetch file"))
  33734. });
  33735. var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
  33736. return null === e ? null : o.loadJson(JSON.parse(e), n, t)
  33737. }
  33738. ,
  33739. o;
  33740. function l(e) {
  33741. var t = 0;
  33742. return {
  33743. next: function() {
  33744. return t < e.length ? {
  33745. done: !1,
  33746. value: e[t++]
  33747. } : {
  33748. done: !0
  33749. }
  33750. }
  33751. }
  33752. }
  33753. function c(e, t) {
  33754. if (!e.map)
  33755. throw Error("field is not a map");
  33756. if (this.field = e,
  33757. this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
  33758. this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
  33759. this.map = {},
  33760. Object.defineProperty(this, "size", {
  33761. get: function() {
  33762. return Object.keys(this.map).length
  33763. }
  33764. }),
  33765. t)
  33766. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  33767. var r = this.keyElem.valueFromString(i[n])
  33768. , o = this.valueElem.verifyValue(t[i[n]]);
  33769. this.map[this.keyElem.valueToString(r)] = {
  33770. key: r,
  33771. value: o
  33772. }
  33773. }
  33774. }
  33775. function h(e) {
  33776. this.ns = new s.Namespace(this,null,""),
  33777. this.ptr = this.ns,
  33778. this.resolved = !1,
  33779. this.result = null,
  33780. this.files = {},
  33781. this.importRoot = null,
  33782. this.options = e || {}
  33783. }
  33784. }
  33785. ,
  33786. "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)
  33787. }
  33788. ).call(this, p("_process"))
  33789. }
  33790. , {
  33791. _process: 203,
  33792. bytebuffer: 215,
  33793. fs: 197,
  33794. path: 197
  33795. }],
  33796. 215: [function(t, e, i) {
  33797. var n, r;
  33798. n = this,
  33799. r = function(l) {
  33800. "use strict";
  33801. function s(e) {
  33802. var t = 0;
  33803. return function() {
  33804. return t < e.length ? e.charCodeAt(t++) : null
  33805. }
  33806. }
  33807. function c() {
  33808. var e = []
  33809. , t = [];
  33810. return function() {
  33811. return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
  33812. e.length = 0),
  33813. void Array.prototype.push.apply(e, arguments))
  33814. }
  33815. }
  33816. function n(e, t, i, n, r) {
  33817. 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];
  33818. for (u += d,
  33819. o = p & (1 << -h) - 1,
  33820. p >>= -h,
  33821. h += s; 0 < h; o = 256 * o + e[t + u],
  33822. u += d,
  33823. h -= 8)
  33824. ;
  33825. for (a = o & (1 << -h) - 1,
  33826. o >>= -h,
  33827. h += n; 0 < h; a = 256 * a + e[t + u],
  33828. u += d,
  33829. h -= 8)
  33830. ;
  33831. if (0 === o)
  33832. o = 1 - c;
  33833. else {
  33834. if (o === l)
  33835. return a ? NaN : 1 / 0 * (p ? -1 : 1);
  33836. a += Math.pow(2, n),
  33837. o -= c
  33838. }
  33839. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  33840. }
  33841. function r(e, t, i, n, r, o) {
  33842. 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;
  33843. for (t = Math.abs(t),
  33844. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  33845. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  33846. t * (l = Math.pow(2, -a)) < 1 && (a--,
  33847. l *= 2),
  33848. 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
  33849. l /= 2),
  33850. h <= a + u ? (s = 0,
  33851. a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
  33852. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  33853. a = 0)); 8 <= r; e[i + p] = 255 & s,
  33854. p += f,
  33855. s /= 256,
  33856. r -= 8)
  33857. ;
  33858. for (a = a << r | s,
  33859. c += r; 0 < c; e[i + p] = 255 & a,
  33860. p += f,
  33861. a /= 256,
  33862. c -= 8)
  33863. ;
  33864. e[i + p - f] |= 128 * g
  33865. }
  33866. var f = function(e, t, i) {
  33867. if (void 0 === e && (e = f.DEFAULT_CAPACITY),
  33868. void 0 === t && (t = f.DEFAULT_ENDIAN),
  33869. void 0 === i && (i = f.DEFAULT_NOASSERT),
  33870. !i) {
  33871. if ((e |= 0) < 0)
  33872. throw RangeError("Illegal capacity");
  33873. t = !!t,
  33874. i = !!i
  33875. }
  33876. this.buffer = 0 === e ? o : new ArrayBuffer(e),
  33877. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  33878. this.offset = 0,
  33879. this.markedOffset = -1,
  33880. this.limit = e,
  33881. this.littleEndian = t,
  33882. this.noAssert = i
  33883. };
  33884. f.VERSION = "5.0.1",
  33885. f.LITTLE_ENDIAN = !0,
  33886. f.BIG_ENDIAN = !1,
  33887. f.DEFAULT_CAPACITY = 16,
  33888. f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
  33889. f.DEFAULT_NOASSERT = !1,
  33890. f.Long = l || null;
  33891. var a = f.prototype;
  33892. a.__isByteBuffer__,
  33893. Object.defineProperty(a, "__isByteBuffer__", {
  33894. value: !0,
  33895. enumerable: !1,
  33896. configurable: !1
  33897. });
  33898. var o = new ArrayBuffer(0)
  33899. , i = String.fromCharCode;
  33900. f.accessor = function() {
  33901. return Uint8Array
  33902. }
  33903. ,
  33904. f.allocate = function(e, t, i) {
  33905. return new f(e,t,i)
  33906. }
  33907. ,
  33908. f.concat = function(e, t, i, n) {
  33909. "boolean" != typeof t && "string" == typeof t || (n = i,
  33910. i = t,
  33911. t = void 0);
  33912. for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
  33913. f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
  33914. 0 < (r = e[a].limit - e[a].offset) && (o += r);
  33915. if (0 === o)
  33916. return new f(0,i,n);
  33917. var l, c = new f(o,i,n);
  33918. for (a = 0; a < s; )
  33919. (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
  33920. c.offset += r);
  33921. return c.limit = c.offset,
  33922. c.offset = 0,
  33923. c
  33924. }
  33925. ,
  33926. f.isByteBuffer = function(e) {
  33927. return !0 === (e && e.__isByteBuffer__)
  33928. }
  33929. ,
  33930. f.type = function() {
  33931. return ArrayBuffer
  33932. }
  33933. ,
  33934. f.wrap = function(e, t, i, n) {
  33935. if ("string" != typeof t && (n = i,
  33936. i = t,
  33937. t = void 0),
  33938. "string" == typeof e)
  33939. switch (void 0 === t && (t = "utf8"),
  33940. t) {
  33941. case "base64":
  33942. return f.fromBase64(e, i);
  33943. case "hex":
  33944. return f.fromHex(e, i);
  33945. case "binary":
  33946. return f.fromBinary(e, i);
  33947. case "utf8":
  33948. return f.fromUTF8(e, i);
  33949. case "debug":
  33950. return f.fromDebug(e, i);
  33951. default:
  33952. throw Error("Unsupported encoding: " + t)
  33953. }
  33954. if (null === e || "object" != typeof e)
  33955. throw TypeError("Illegal buffer");
  33956. var r;
  33957. if (f.isByteBuffer(e))
  33958. return (r = a.clone.call(e)).markedOffset = -1,
  33959. r;
  33960. if (e instanceof Uint8Array)
  33961. r = new f(0,i,n),
  33962. 0 < e.length && (r.buffer = e.buffer,
  33963. r.offset = e.byteOffset,
  33964. r.limit = e.byteOffset + e.byteLength,
  33965. r.view = new Uint8Array(e.buffer));
  33966. else if (e instanceof ArrayBuffer)
  33967. r = new f(0,i,n),
  33968. 0 < e.byteLength && (r.buffer = e,
  33969. r.offset = 0,
  33970. r.limit = e.byteLength,
  33971. r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
  33972. else {
  33973. if ("[object Array]" !== Object.prototype.toString.call(e))
  33974. throw TypeError("Illegal buffer");
  33975. (r = new f(e.length,i,n)).limit = e.length;
  33976. for (var o = 0; o < e.length; ++o)
  33977. r.view[o] = e[o]
  33978. }
  33979. return r
  33980. }
  33981. ,
  33982. a.writeBitSet = function(e, t) {
  33983. var i = void 0 === t;
  33984. if (i && (t = this.offset),
  33985. !this.noAssert) {
  33986. if (!(e instanceof Array))
  33987. throw TypeError("Illegal BitSet: Not an array");
  33988. if ("number" != typeof t || t % 1 != 0)
  33989. throw TypeError("Illegal offset: " + t + " (not an integer)");
  33990. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  33991. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  33992. }
  33993. var n, r = t, o = e.length, a = o >> 3, s = 0;
  33994. for (t += this.writeVarint32(o, t); a--; )
  33995. 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,
  33996. this.writeByte(n, t++);
  33997. if (s < o) {
  33998. var l = 0;
  33999. for (n = 0; s < o; )
  34000. n |= (1 & !!e[s++]) << l++;
  34001. this.writeByte(n, t++)
  34002. }
  34003. return i ? (this.offset = t,
  34004. this) : t - r
  34005. }
  34006. ,
  34007. a.readBitSet = function(e) {
  34008. var t = void 0 === e;
  34009. t && (e = this.offset);
  34010. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34011. for (e += n.length; o--; )
  34012. i = this.readByte(e++),
  34013. s[a++] = !!(1 & i),
  34014. s[a++] = !!(2 & i),
  34015. s[a++] = !!(4 & i),
  34016. s[a++] = !!(8 & i),
  34017. s[a++] = !!(16 & i),
  34018. s[a++] = !!(32 & i),
  34019. s[a++] = !!(64 & i),
  34020. s[a++] = !!(128 & i);
  34021. if (a < r) {
  34022. var l = 0;
  34023. for (i = this.readByte(e++); a < r; )
  34024. s[a++] = !!(i >> l++ & 1)
  34025. }
  34026. return t && (this.offset = e),
  34027. s
  34028. }
  34029. ,
  34030. a.readBytes = function(e, t) {
  34031. var i = void 0 === t;
  34032. if (i && (t = this.offset),
  34033. !this.noAssert) {
  34034. if ("number" != typeof t || t % 1 != 0)
  34035. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34036. if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
  34037. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34038. }
  34039. var n = this.slice(t, t + e);
  34040. return i && (this.offset += e),
  34041. n
  34042. }
  34043. ,
  34044. a.writeBytes = a.append,
  34045. a.writeInt8 = function(e, t) {
  34046. var i = void 0 === t;
  34047. if (i && (t = this.offset),
  34048. !this.noAssert) {
  34049. if ("number" != typeof e || e % 1 != 0)
  34050. throw TypeError("Illegal value: " + e + " (not an integer)");
  34051. if (e |= 0,
  34052. "number" != typeof t || t % 1 != 0)
  34053. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34054. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34055. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34056. }
  34057. t += 1;
  34058. var n = this.buffer.byteLength;
  34059. return n < t && this.resize((n *= 2) > t ? n : t),
  34060. t -= 1,
  34061. this.view[t] = e,
  34062. i && (this.offset += 1),
  34063. this
  34064. }
  34065. ,
  34066. a.writeByte = a.writeInt8,
  34067. a.readInt8 = function(e) {
  34068. var t = void 0 === e;
  34069. if (t && (e = this.offset),
  34070. !this.noAssert) {
  34071. if ("number" != typeof e || e % 1 != 0)
  34072. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34073. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34074. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34075. }
  34076. var i = this.view[e];
  34077. return 128 == (128 & i) && (i = -(255 - i + 1)),
  34078. t && (this.offset += 1),
  34079. i
  34080. }
  34081. ,
  34082. a.readByte = a.readInt8,
  34083. a.writeUint8 = function(e, t) {
  34084. var i = void 0 === t;
  34085. if (i && (t = this.offset),
  34086. !this.noAssert) {
  34087. if ("number" != typeof e || e % 1 != 0)
  34088. throw TypeError("Illegal value: " + e + " (not an integer)");
  34089. if (e >>>= 0,
  34090. "number" != typeof t || t % 1 != 0)
  34091. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34092. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34093. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34094. }
  34095. t += 1;
  34096. var n = this.buffer.byteLength;
  34097. return n < t && this.resize((n *= 2) > t ? n : t),
  34098. t -= 1,
  34099. this.view[t] = e,
  34100. i && (this.offset += 1),
  34101. this
  34102. }
  34103. ,
  34104. a.writeUInt8 = a.writeUint8,
  34105. a.readUint8 = function(e) {
  34106. var t = void 0 === e;
  34107. if (t && (e = this.offset),
  34108. !this.noAssert) {
  34109. if ("number" != typeof e || e % 1 != 0)
  34110. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34111. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34112. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34113. }
  34114. var i = this.view[e];
  34115. return t && (this.offset += 1),
  34116. i
  34117. }
  34118. ,
  34119. a.readUInt8 = a.readUint8,
  34120. a.writeInt16 = function(e, t) {
  34121. var i = void 0 === t;
  34122. if (i && (t = this.offset),
  34123. !this.noAssert) {
  34124. if ("number" != typeof e || e % 1 != 0)
  34125. throw TypeError("Illegal value: " + e + " (not an integer)");
  34126. if (e |= 0,
  34127. "number" != typeof t || t % 1 != 0)
  34128. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34129. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34130. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34131. }
  34132. t += 2;
  34133. var n = this.buffer.byteLength;
  34134. return n < t && this.resize((n *= 2) > t ? n : t),
  34135. t -= 2,
  34136. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34137. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34138. this.view[t + 1] = 255 & e),
  34139. i && (this.offset += 2),
  34140. this
  34141. }
  34142. ,
  34143. a.writeShort = a.writeInt16,
  34144. a.readInt16 = function(e) {
  34145. var t = void 0 === e;
  34146. if (t && (e = this.offset),
  34147. !this.noAssert) {
  34148. if ("number" != typeof e || e % 1 != 0)
  34149. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34150. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34151. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34152. }
  34153. var i = 0;
  34154. return this.littleEndian ? (i = this.view[e],
  34155. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34156. i |= this.view[e + 1]),
  34157. 32768 == (32768 & i) && (i = -(65535 - i + 1)),
  34158. t && (this.offset += 2),
  34159. i
  34160. }
  34161. ,
  34162. a.readShort = a.readInt16,
  34163. a.writeUint16 = function(e, t) {
  34164. var i = void 0 === t;
  34165. if (i && (t = this.offset),
  34166. !this.noAssert) {
  34167. if ("number" != typeof e || e % 1 != 0)
  34168. throw TypeError("Illegal value: " + e + " (not an integer)");
  34169. if (e >>>= 0,
  34170. "number" != typeof t || t % 1 != 0)
  34171. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34172. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34173. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34174. }
  34175. t += 2;
  34176. var n = this.buffer.byteLength;
  34177. return n < t && this.resize((n *= 2) > t ? n : t),
  34178. t -= 2,
  34179. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34180. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34181. this.view[t + 1] = 255 & e),
  34182. i && (this.offset += 2),
  34183. this
  34184. }
  34185. ,
  34186. a.writeUInt16 = a.writeUint16,
  34187. a.readUint16 = function(e) {
  34188. var t = void 0 === e;
  34189. if (t && (e = this.offset),
  34190. !this.noAssert) {
  34191. if ("number" != typeof e || e % 1 != 0)
  34192. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34193. if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
  34194. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34195. }
  34196. var i = 0;
  34197. return this.littleEndian ? (i = this.view[e],
  34198. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34199. i |= this.view[e + 1]),
  34200. t && (this.offset += 2),
  34201. i
  34202. }
  34203. ,
  34204. a.readUInt16 = a.readUint16,
  34205. a.writeInt32 = function(e, t) {
  34206. var i = void 0 === t;
  34207. if (i && (t = this.offset),
  34208. !this.noAssert) {
  34209. if ("number" != typeof e || e % 1 != 0)
  34210. throw TypeError("Illegal value: " + e + " (not an integer)");
  34211. if (e |= 0,
  34212. "number" != typeof t || t % 1 != 0)
  34213. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34214. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34215. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34216. }
  34217. t += 4;
  34218. var n = this.buffer.byteLength;
  34219. return n < t && this.resize((n *= 2) > t ? n : t),
  34220. t -= 4,
  34221. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34222. this.view[t + 2] = e >>> 16 & 255,
  34223. this.view[t + 1] = e >>> 8 & 255,
  34224. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34225. this.view[t + 1] = e >>> 16 & 255,
  34226. this.view[t + 2] = e >>> 8 & 255,
  34227. this.view[t + 3] = 255 & e),
  34228. i && (this.offset += 4),
  34229. this
  34230. }
  34231. ,
  34232. a.writeInt = a.writeInt32,
  34233. a.readInt32 = function(e) {
  34234. var t = void 0 === e;
  34235. if (t && (e = this.offset),
  34236. !this.noAssert) {
  34237. if ("number" != typeof e || e % 1 != 0)
  34238. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34239. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34240. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34241. }
  34242. var i = 0;
  34243. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34244. i |= this.view[e + 1] << 8,
  34245. i |= this.view[e],
  34246. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34247. i |= this.view[e + 2] << 8,
  34248. i |= this.view[e + 3],
  34249. i += this.view[e] << 24 >>> 0),
  34250. i |= 0,
  34251. t && (this.offset += 4),
  34252. i
  34253. }
  34254. ,
  34255. a.readInt = a.readInt32,
  34256. a.writeUint32 = function(e, t) {
  34257. var i = void 0 === t;
  34258. if (i && (t = this.offset),
  34259. !this.noAssert) {
  34260. if ("number" != typeof e || e % 1 != 0)
  34261. throw TypeError("Illegal value: " + e + " (not an integer)");
  34262. if (e >>>= 0,
  34263. "number" != typeof t || t % 1 != 0)
  34264. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34265. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34266. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34267. }
  34268. t += 4;
  34269. var n = this.buffer.byteLength;
  34270. return n < t && this.resize((n *= 2) > t ? n : t),
  34271. t -= 4,
  34272. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34273. this.view[t + 2] = e >>> 16 & 255,
  34274. this.view[t + 1] = e >>> 8 & 255,
  34275. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34276. this.view[t + 1] = e >>> 16 & 255,
  34277. this.view[t + 2] = e >>> 8 & 255,
  34278. this.view[t + 3] = 255 & e),
  34279. i && (this.offset += 4),
  34280. this
  34281. }
  34282. ,
  34283. a.writeUInt32 = a.writeUint32,
  34284. a.readUint32 = function(e) {
  34285. var t = void 0 === e;
  34286. if (t && (e = this.offset),
  34287. !this.noAssert) {
  34288. if ("number" != typeof e || e % 1 != 0)
  34289. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34290. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34291. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34292. }
  34293. var i = 0;
  34294. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34295. i |= this.view[e + 1] << 8,
  34296. i |= this.view[e],
  34297. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34298. i |= this.view[e + 2] << 8,
  34299. i |= this.view[e + 3],
  34300. i += this.view[e] << 24 >>> 0),
  34301. t && (this.offset += 4),
  34302. i
  34303. }
  34304. ,
  34305. a.readUInt32 = a.readUint32,
  34306. l && (a.writeInt64 = function(e, t) {
  34307. var i = void 0 === t;
  34308. if (i && (t = this.offset),
  34309. !this.noAssert) {
  34310. if ("number" == typeof e)
  34311. e = l.fromNumber(e);
  34312. else if ("string" == typeof e)
  34313. e = l.fromString(e);
  34314. else if (!(e && e instanceof l))
  34315. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34316. if ("number" != typeof t || t % 1 != 0)
  34317. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34318. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34319. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34320. }
  34321. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34322. t += 8;
  34323. var n = this.buffer.byteLength;
  34324. n < t && this.resize((n *= 2) > t ? n : t),
  34325. t -= 8;
  34326. var r = e.low
  34327. , o = e.high;
  34328. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34329. this.view[t + 2] = r >>> 16 & 255,
  34330. this.view[t + 1] = r >>> 8 & 255,
  34331. this.view[t] = 255 & r,
  34332. t += 4,
  34333. this.view[t + 3] = o >>> 24 & 255,
  34334. this.view[t + 2] = o >>> 16 & 255,
  34335. this.view[t + 1] = o >>> 8 & 255,
  34336. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  34337. this.view[t + 1] = o >>> 16 & 255,
  34338. this.view[t + 2] = o >>> 8 & 255,
  34339. this.view[t + 3] = 255 & o,
  34340. t += 4,
  34341. this.view[t] = r >>> 24 & 255,
  34342. this.view[t + 1] = r >>> 16 & 255,
  34343. this.view[t + 2] = r >>> 8 & 255,
  34344. this.view[t + 3] = 255 & r),
  34345. i && (this.offset += 8),
  34346. this
  34347. }
  34348. ,
  34349. a.writeLong = a.writeInt64,
  34350. a.readInt64 = function(e) {
  34351. var t = void 0 === e;
  34352. if (t && (e = this.offset),
  34353. !this.noAssert) {
  34354. if ("number" != typeof e || e % 1 != 0)
  34355. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34356. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34357. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34358. }
  34359. var i = 0
  34360. , n = 0;
  34361. this.littleEndian ? (i = this.view[e + 2] << 16,
  34362. i |= this.view[e + 1] << 8,
  34363. i |= this.view[e],
  34364. i += this.view[e + 3] << 24 >>> 0,
  34365. e += 4,
  34366. n = this.view[e + 2] << 16,
  34367. n |= this.view[e + 1] << 8,
  34368. n |= this.view[e],
  34369. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  34370. n |= this.view[e + 2] << 8,
  34371. n |= this.view[e + 3],
  34372. n += this.view[e] << 24 >>> 0,
  34373. e += 4,
  34374. i = this.view[e + 1] << 16,
  34375. i |= this.view[e + 2] << 8,
  34376. i |= this.view[e + 3],
  34377. i += this.view[e] << 24 >>> 0);
  34378. var r = new l(i,n,!1);
  34379. return t && (this.offset += 8),
  34380. r
  34381. }
  34382. ,
  34383. a.readLong = a.readInt64,
  34384. a.writeUint64 = function(e, t) {
  34385. var i = void 0 === t;
  34386. if (i && (t = this.offset),
  34387. !this.noAssert) {
  34388. if ("number" == typeof e)
  34389. e = l.fromNumber(e);
  34390. else if ("string" == typeof e)
  34391. e = l.fromString(e);
  34392. else if (!(e && e instanceof l))
  34393. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34394. if ("number" != typeof t || t % 1 != 0)
  34395. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34396. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34397. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34398. }
  34399. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
  34400. t += 8;
  34401. var n = this.buffer.byteLength;
  34402. n < t && this.resize((n *= 2) > t ? n : t),
  34403. t -= 8;
  34404. var r = e.low
  34405. , o = e.high;
  34406. return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
  34407. this.view[t + 2] = r >>> 16 & 255,
  34408. this.view[t + 1] = r >>> 8 & 255,
  34409. this.view[t] = 255 & r,
  34410. t += 4,
  34411. this.view[t + 3] = o >>> 24 & 255,
  34412. this.view[t + 2] = o >>> 16 & 255,
  34413. this.view[t + 1] = o >>> 8 & 255,
  34414. this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
  34415. this.view[t + 1] = o >>> 16 & 255,
  34416. this.view[t + 2] = o >>> 8 & 255,
  34417. this.view[t + 3] = 255 & o,
  34418. t += 4,
  34419. this.view[t] = r >>> 24 & 255,
  34420. this.view[t + 1] = r >>> 16 & 255,
  34421. this.view[t + 2] = r >>> 8 & 255,
  34422. this.view[t + 3] = 255 & r),
  34423. i && (this.offset += 8),
  34424. this
  34425. }
  34426. ,
  34427. a.writeUInt64 = a.writeUint64,
  34428. a.readUint64 = function(e) {
  34429. var t = void 0 === e;
  34430. if (t && (e = this.offset),
  34431. !this.noAssert) {
  34432. if ("number" != typeof e || e % 1 != 0)
  34433. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34434. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34435. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34436. }
  34437. var i = 0
  34438. , n = 0;
  34439. this.littleEndian ? (i = this.view[e + 2] << 16,
  34440. i |= this.view[e + 1] << 8,
  34441. i |= this.view[e],
  34442. i += this.view[e + 3] << 24 >>> 0,
  34443. e += 4,
  34444. n = this.view[e + 2] << 16,
  34445. n |= this.view[e + 1] << 8,
  34446. n |= this.view[e],
  34447. n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
  34448. n |= this.view[e + 2] << 8,
  34449. n |= this.view[e + 3],
  34450. n += this.view[e] << 24 >>> 0,
  34451. e += 4,
  34452. i = this.view[e + 1] << 16,
  34453. i |= this.view[e + 2] << 8,
  34454. i |= this.view[e + 3],
  34455. i += this.view[e] << 24 >>> 0);
  34456. var r = new l(i,n,!0);
  34457. return t && (this.offset += 8),
  34458. r
  34459. }
  34460. ,
  34461. a.readUInt64 = a.readUint64),
  34462. a.writeFloat32 = function(e, t) {
  34463. var i = void 0 === t;
  34464. if (i && (t = this.offset),
  34465. !this.noAssert) {
  34466. if ("number" != typeof e)
  34467. throw TypeError("Illegal value: " + e + " (not a number)");
  34468. if ("number" != typeof t || t % 1 != 0)
  34469. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34470. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34471. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34472. }
  34473. t += 4;
  34474. var n = this.buffer.byteLength;
  34475. return n < t && this.resize((n *= 2) > t ? n : t),
  34476. t -= 4,
  34477. r(this.view, e, t, this.littleEndian, 23, 4),
  34478. i && (this.offset += 4),
  34479. this
  34480. }
  34481. ,
  34482. a.writeFloat = a.writeFloat32,
  34483. a.readFloat32 = function(e) {
  34484. var t = void 0 === e;
  34485. if (t && (e = this.offset),
  34486. !this.noAssert) {
  34487. if ("number" != typeof e || e % 1 != 0)
  34488. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34489. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34490. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34491. }
  34492. var i = n(this.view, e, this.littleEndian, 23, 4);
  34493. return t && (this.offset += 4),
  34494. i
  34495. }
  34496. ,
  34497. a.readFloat = a.readFloat32,
  34498. a.writeFloat64 = function(e, t) {
  34499. var i = void 0 === t;
  34500. if (i && (t = this.offset),
  34501. !this.noAssert) {
  34502. if ("number" != typeof e)
  34503. throw TypeError("Illegal value: " + e + " (not a number)");
  34504. if ("number" != typeof t || t % 1 != 0)
  34505. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34506. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34507. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34508. }
  34509. t += 8;
  34510. var n = this.buffer.byteLength;
  34511. return n < t && this.resize((n *= 2) > t ? n : t),
  34512. t -= 8,
  34513. r(this.view, e, t, this.littleEndian, 52, 8),
  34514. i && (this.offset += 8),
  34515. this
  34516. }
  34517. ,
  34518. a.writeDouble = a.writeFloat64,
  34519. a.readFloat64 = function(e) {
  34520. var t = void 0 === e;
  34521. if (t && (e = this.offset),
  34522. !this.noAssert) {
  34523. if ("number" != typeof e || e % 1 != 0)
  34524. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34525. if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
  34526. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  34527. }
  34528. var i = n(this.view, e, this.littleEndian, 52, 8);
  34529. return t && (this.offset += 8),
  34530. i
  34531. }
  34532. ,
  34533. a.readDouble = a.readFloat64,
  34534. f.MAX_VARINT32_BYTES = 5,
  34535. f.calculateVarint32 = function(e) {
  34536. return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  34537. }
  34538. ,
  34539. f.zigZagEncode32 = function(e) {
  34540. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  34541. }
  34542. ,
  34543. f.zigZagDecode32 = function(e) {
  34544. return e >>> 1 ^ -(1 & e) | 0
  34545. }
  34546. ,
  34547. a.writeVarint32 = function(e, t) {
  34548. var i = void 0 === t;
  34549. if (i && (t = this.offset),
  34550. !this.noAssert) {
  34551. if ("number" != typeof e || e % 1 != 0)
  34552. throw TypeError("Illegal value: " + e + " (not an integer)");
  34553. if (e |= 0,
  34554. "number" != typeof t || t % 1 != 0)
  34555. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34556. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34557. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34558. }
  34559. var n, r = f.calculateVarint32(e);
  34560. t += r;
  34561. var o = this.buffer.byteLength;
  34562. for (o < t && this.resize((o *= 2) > t ? o : t),
  34563. t -= r,
  34564. e >>>= 0; 128 <= e; )
  34565. n = 127 & e | 128,
  34566. this.view[t++] = n,
  34567. e >>>= 7;
  34568. return this.view[t++] = e,
  34569. i ? (this.offset = t,
  34570. this) : r
  34571. }
  34572. ,
  34573. a.writeVarint32ZigZag = function(e, t) {
  34574. return this.writeVarint32(f.zigZagEncode32(e), t)
  34575. }
  34576. ,
  34577. a.readVarint32 = function(e) {
  34578. var t = void 0 === e;
  34579. if (t && (e = this.offset),
  34580. !this.noAssert) {
  34581. if ("number" != typeof e || e % 1 != 0)
  34582. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34583. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34584. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34585. }
  34586. var i, n = 0, r = 0;
  34587. do {
  34588. if (!this.noAssert && e > this.limit) {
  34589. var o = Error("Truncated");
  34590. throw o.truncated = !0,
  34591. o
  34592. }
  34593. i = this.view[e++],
  34594. n < 5 && (r |= (127 & i) << 7 * n),
  34595. ++n
  34596. } while (0 != (128 & i));return r |= 0,
  34597. t ? (this.offset = e,
  34598. r) : {
  34599. value: r,
  34600. length: n
  34601. }
  34602. }
  34603. ,
  34604. a.readVarint32ZigZag = function(e) {
  34605. var t = this.readVarint32(e);
  34606. return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
  34607. t
  34608. }
  34609. ,
  34610. l && (f.MAX_VARINT64_BYTES = 10,
  34611. f.calculateVarint64 = function(e) {
  34612. "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
  34613. var t = e.toInt() >>> 0
  34614. , i = e.shiftRightUnsigned(28).toInt() >>> 0
  34615. , n = e.shiftRightUnsigned(56).toInt() >>> 0;
  34616. 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
  34617. }
  34618. ,
  34619. f.zigZagEncode64 = function(e) {
  34620. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  34621. e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
  34622. }
  34623. ,
  34624. f.zigZagDecode64 = function(e) {
  34625. return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
  34626. e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
  34627. }
  34628. ,
  34629. a.writeVarint64 = function(e, t) {
  34630. var i = void 0 === t;
  34631. if (i && (t = this.offset),
  34632. !this.noAssert) {
  34633. if ("number" == typeof e)
  34634. e = l.fromNumber(e);
  34635. else if ("string" == typeof e)
  34636. e = l.fromString(e);
  34637. else if (!(e && e instanceof l))
  34638. throw TypeError("Illegal value: " + e + " (not an integer or Long)");
  34639. if ("number" != typeof t || t % 1 != 0)
  34640. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34641. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34642. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34643. }
  34644. "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
  34645. var n = f.calculateVarint64(e)
  34646. , r = e.toInt() >>> 0
  34647. , o = e.shiftRightUnsigned(28).toInt() >>> 0
  34648. , a = e.shiftRightUnsigned(56).toInt() >>> 0;
  34649. t += n;
  34650. var s = this.buffer.byteLength;
  34651. switch (s < t && this.resize((s *= 2) > t ? s : t),
  34652. t -= n,
  34653. n) {
  34654. case 10:
  34655. this.view[t + 9] = a >>> 7 & 1;
  34656. case 9:
  34657. this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
  34658. case 8:
  34659. this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
  34660. case 7:
  34661. this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
  34662. case 6:
  34663. this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
  34664. case 5:
  34665. this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
  34666. case 4:
  34667. this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
  34668. case 3:
  34669. this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
  34670. case 2:
  34671. this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
  34672. case 1:
  34673. this.view[t] = 1 !== n ? 128 | r : 127 & r
  34674. }
  34675. return i ? (this.offset += n,
  34676. this) : n
  34677. }
  34678. ,
  34679. a.writeVarint64ZigZag = function(e, t) {
  34680. return this.writeVarint64(f.zigZagEncode64(e), t)
  34681. }
  34682. ,
  34683. a.readVarint64 = function(e) {
  34684. var t = void 0 === e;
  34685. if (t && (e = this.offset),
  34686. !this.noAssert) {
  34687. if ("number" != typeof e || e % 1 != 0)
  34688. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34689. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34690. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34691. }
  34692. var i = e
  34693. , n = 0
  34694. , r = 0
  34695. , o = 0
  34696. , a = 0;
  34697. if (n = 127 & (a = this.view[e++]),
  34698. 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
  34699. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
  34700. (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
  34701. (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
  34702. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
  34703. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
  34704. (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
  34705. (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
  34706. (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
  34707. 128 & a || this.noAssert && void 0 === a))))))))))
  34708. throw Error("Buffer overrun");
  34709. var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
  34710. return t ? (this.offset = e,
  34711. s) : {
  34712. value: s,
  34713. length: e - i
  34714. }
  34715. }
  34716. ,
  34717. a.readVarint64ZigZag = function(e) {
  34718. var t = this.readVarint64(e);
  34719. return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
  34720. t
  34721. }
  34722. ),
  34723. a.writeCString = function(e, t) {
  34724. var i = void 0 === t;
  34725. i && (t = this.offset);
  34726. var n, r = e.length;
  34727. if (!this.noAssert) {
  34728. if ("string" != typeof e)
  34729. throw TypeError("Illegal str: Not a string");
  34730. for (n = 0; n < r; ++n)
  34731. if (0 === e.charCodeAt(n))
  34732. throw RangeError("Illegal str: Contains NULL-characters");
  34733. if ("number" != typeof t || t % 1 != 0)
  34734. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34735. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34736. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34737. }
  34738. r = d.calculateUTF16asUTF8(s(e))[1],
  34739. t += r + 1;
  34740. var o = this.buffer.byteLength;
  34741. return o < t && this.resize((o *= 2) > t ? o : t),
  34742. t -= r + 1,
  34743. d.encodeUTF16toUTF8(s(e), function(e) {
  34744. this.view[t++] = e
  34745. }
  34746. .bind(this)),
  34747. this.view[t++] = 0,
  34748. i ? (this.offset = t,
  34749. this) : r
  34750. }
  34751. ,
  34752. a.readCString = function(e) {
  34753. var t = void 0 === e;
  34754. if (t && (e = this.offset),
  34755. !this.noAssert) {
  34756. if ("number" != typeof e || e % 1 != 0)
  34757. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34758. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34759. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34760. }
  34761. var i, n = e, r = -1;
  34762. return d.decodeUTF8toUTF16(function() {
  34763. if (0 === r)
  34764. return null;
  34765. if (e >= this.limit)
  34766. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  34767. return 0 === (r = this.view[e++]) ? null : r
  34768. }
  34769. .bind(this), i = c(), !0),
  34770. t ? (this.offset = e,
  34771. i()) : {
  34772. string: i(),
  34773. length: e - n
  34774. }
  34775. }
  34776. ,
  34777. a.writeIString = function(e, t) {
  34778. var i = void 0 === t;
  34779. if (i && (t = this.offset),
  34780. !this.noAssert) {
  34781. if ("string" != typeof e)
  34782. throw TypeError("Illegal str: Not a string");
  34783. if ("number" != typeof t || t % 1 != 0)
  34784. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34785. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34786. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34787. }
  34788. var n, r = t;
  34789. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  34790. t += 4 + n;
  34791. var o = this.buffer.byteLength;
  34792. if (o < t && this.resize((o *= 2) > t ? o : t),
  34793. t -= 4 + n,
  34794. this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
  34795. this.view[t + 2] = n >>> 16 & 255,
  34796. this.view[t + 1] = n >>> 8 & 255,
  34797. this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
  34798. this.view[t + 1] = n >>> 16 & 255,
  34799. this.view[t + 2] = n >>> 8 & 255,
  34800. this.view[t + 3] = 255 & n),
  34801. t += 4,
  34802. d.encodeUTF16toUTF8(s(e), function(e) {
  34803. this.view[t++] = e
  34804. }
  34805. .bind(this)),
  34806. t !== r + 4 + n)
  34807. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
  34808. return i ? (this.offset = t,
  34809. this) : t - r
  34810. }
  34811. ,
  34812. a.readIString = function(e) {
  34813. var t = void 0 === e;
  34814. if (t && (e = this.offset),
  34815. !this.noAssert) {
  34816. if ("number" != typeof e || e % 1 != 0)
  34817. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34818. if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
  34819. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34820. }
  34821. var i = e
  34822. , n = this.readUint32(e)
  34823. , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
  34824. return e += r.length,
  34825. t ? (this.offset = e,
  34826. r.string) : {
  34827. string: r.string,
  34828. length: e - i
  34829. }
  34830. }
  34831. ,
  34832. f.METRICS_CHARS = "c",
  34833. f.METRICS_BYTES = "b",
  34834. a.writeUTF8String = function(e, t) {
  34835. var i = void 0 === t;
  34836. if (i && (t = this.offset),
  34837. !this.noAssert) {
  34838. if ("number" != typeof t || t % 1 != 0)
  34839. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34840. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34841. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34842. }
  34843. var n, r = t;
  34844. n = d.calculateUTF16asUTF8(s(e))[1],
  34845. t += n;
  34846. var o = this.buffer.byteLength;
  34847. return o < t && this.resize((o *= 2) > t ? o : t),
  34848. t -= n,
  34849. d.encodeUTF16toUTF8(s(e), function(e) {
  34850. this.view[t++] = e
  34851. }
  34852. .bind(this)),
  34853. i ? (this.offset = t,
  34854. this) : t - r
  34855. }
  34856. ,
  34857. a.writeString = a.writeUTF8String,
  34858. f.calculateUTF8Chars = function(e) {
  34859. return d.calculateUTF16asUTF8(s(e))[0]
  34860. }
  34861. ,
  34862. f.calculateUTF8Bytes = function(e) {
  34863. return d.calculateUTF16asUTF8(s(e))[1]
  34864. }
  34865. ,
  34866. f.calculateString = f.calculateUTF8Bytes,
  34867. a.readUTF8String = function(e, t, i) {
  34868. "number" == typeof t && (i = t,
  34869. t = void 0);
  34870. var n = void 0 === i;
  34871. if (n && (i = this.offset),
  34872. void 0 === t && (t = f.METRICS_CHARS),
  34873. !this.noAssert) {
  34874. if ("number" != typeof e || e % 1 != 0)
  34875. throw TypeError("Illegal length: " + e + " (not an integer)");
  34876. if (e |= 0,
  34877. "number" != typeof i || i % 1 != 0)
  34878. throw TypeError("Illegal offset: " + i + " (not an integer)");
  34879. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  34880. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  34881. }
  34882. var r, o = 0, a = i;
  34883. if (t === f.METRICS_CHARS) {
  34884. if (r = c(),
  34885. d.decodeUTF8(function() {
  34886. return o < e && i < this.limit ? this.view[i++] : null
  34887. }
  34888. .bind(this), function(e) {
  34889. ++o,
  34890. d.UTF8toUTF16(e, r)
  34891. }),
  34892. o !== e)
  34893. throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
  34894. return n ? (this.offset = i,
  34895. r()) : {
  34896. string: r(),
  34897. length: i - a
  34898. }
  34899. }
  34900. if (t !== f.METRICS_BYTES)
  34901. throw TypeError("Unsupported metrics: " + t);
  34902. if (!this.noAssert) {
  34903. if ("number" != typeof i || i % 1 != 0)
  34904. throw TypeError("Illegal offset: " + i + " (not an integer)");
  34905. if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
  34906. throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
  34907. }
  34908. var s = i + e;
  34909. if (d.decodeUTF8toUTF16(function() {
  34910. return i < s ? this.view[i++] : null
  34911. }
  34912. .bind(this), r = c(), this.noAssert),
  34913. i !== s)
  34914. throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
  34915. return n ? (this.offset = i,
  34916. r()) : {
  34917. string: r(),
  34918. length: i - a
  34919. }
  34920. }
  34921. ,
  34922. a.readString = a.readUTF8String,
  34923. a.writeVString = function(e, t) {
  34924. var i = void 0 === t;
  34925. if (i && (t = this.offset),
  34926. !this.noAssert) {
  34927. if ("string" != typeof e)
  34928. throw TypeError("Illegal str: Not a string");
  34929. if ("number" != typeof t || t % 1 != 0)
  34930. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34931. if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
  34932. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34933. }
  34934. var n, r, o = t;
  34935. n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
  34936. r = f.calculateVarint32(n),
  34937. t += r + n;
  34938. var a = this.buffer.byteLength;
  34939. if (a < t && this.resize((a *= 2) > t ? a : t),
  34940. t -= r + n,
  34941. t += this.writeVarint32(n, t),
  34942. d.encodeUTF16toUTF8(s(e), function(e) {
  34943. this.view[t++] = e
  34944. }
  34945. .bind(this)),
  34946. t !== o + n + r)
  34947. throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
  34948. return i ? (this.offset = t,
  34949. this) : t - o
  34950. }
  34951. ,
  34952. a.readVString = function(e) {
  34953. var t = void 0 === e;
  34954. if (t && (e = this.offset),
  34955. !this.noAssert) {
  34956. if ("number" != typeof e || e % 1 != 0)
  34957. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34958. if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
  34959. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34960. }
  34961. var i = e
  34962. , n = this.readVarint32(e)
  34963. , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
  34964. return e += r.length,
  34965. t ? (this.offset = e,
  34966. r.string) : {
  34967. string: r.string,
  34968. length: e - i
  34969. }
  34970. }
  34971. ,
  34972. a.append = function(e, t, i) {
  34973. "number" != typeof t && "string" == typeof t || (i = t,
  34974. t = void 0);
  34975. var n = void 0 === i;
  34976. if (n && (i = this.offset),
  34977. !this.noAssert) {
  34978. if ("number" != typeof i || i % 1 != 0)
  34979. throw TypeError("Illegal offset: " + i + " (not an integer)");
  34980. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  34981. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  34982. }
  34983. e instanceof f || (e = f.wrap(e, t));
  34984. var r = e.limit - e.offset;
  34985. if (r <= 0)
  34986. return this;
  34987. i += r;
  34988. var o = this.buffer.byteLength;
  34989. return o < i && this.resize((o *= 2) > i ? o : i),
  34990. i -= r,
  34991. this.view.set(e.view.subarray(e.offset, e.limit), i),
  34992. e.offset += r,
  34993. n && (this.offset += r),
  34994. this
  34995. }
  34996. ,
  34997. a.appendTo = function(e, t) {
  34998. return e.append(this, t),
  34999. this
  35000. }
  35001. ,
  35002. a.assert = function(e) {
  35003. return this.noAssert = !e,
  35004. this
  35005. }
  35006. ,
  35007. a.capacity = function() {
  35008. return this.buffer.byteLength
  35009. }
  35010. ,
  35011. a.clear = function() {
  35012. return this.offset = 0,
  35013. this.limit = this.buffer.byteLength,
  35014. this.markedOffset = -1,
  35015. this
  35016. }
  35017. ,
  35018. a.clone = function(e) {
  35019. var t = new f(0,this.littleEndian,this.noAssert);
  35020. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35021. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35022. t.view = this.view),
  35023. t.offset = this.offset,
  35024. t.markedOffset = this.markedOffset,
  35025. t.limit = this.limit,
  35026. t
  35027. }
  35028. ,
  35029. a.compact = function(e, t) {
  35030. if (void 0 === e && (e = this.offset),
  35031. void 0 === t && (t = this.limit),
  35032. !this.noAssert) {
  35033. if ("number" != typeof e || e % 1 != 0)
  35034. throw TypeError("Illegal begin: Not an integer");
  35035. if (e >>>= 0,
  35036. "number" != typeof t || t % 1 != 0)
  35037. throw TypeError("Illegal end: Not an integer");
  35038. if (t >>>= 0,
  35039. e < 0 || t < e || t > this.buffer.byteLength)
  35040. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35041. }
  35042. if (0 === e && t === this.buffer.byteLength)
  35043. return this;
  35044. var i = t - e;
  35045. if (0 == i)
  35046. return this.buffer = o,
  35047. this.view = null,
  35048. 0 <= this.markedOffset && (this.markedOffset -= e),
  35049. this.offset = 0,
  35050. this.limit = 0,
  35051. this;
  35052. var n = new ArrayBuffer(i)
  35053. , r = new Uint8Array(n);
  35054. return r.set(this.view.subarray(e, t)),
  35055. this.buffer = n,
  35056. this.view = r,
  35057. 0 <= this.markedOffset && (this.markedOffset -= e),
  35058. this.offset = 0,
  35059. this.limit = i,
  35060. this
  35061. }
  35062. ,
  35063. a.copy = function(e, t) {
  35064. if (void 0 === e && (e = this.offset),
  35065. void 0 === t && (t = this.limit),
  35066. !this.noAssert) {
  35067. if ("number" != typeof e || e % 1 != 0)
  35068. throw TypeError("Illegal begin: Not an integer");
  35069. if (e >>>= 0,
  35070. "number" != typeof t || t % 1 != 0)
  35071. throw TypeError("Illegal end: Not an integer");
  35072. if (t >>>= 0,
  35073. e < 0 || t < e || t > this.buffer.byteLength)
  35074. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35075. }
  35076. if (e === t)
  35077. return new f(0,this.littleEndian,this.noAssert);
  35078. var i = t - e
  35079. , n = new f(i,this.littleEndian,this.noAssert);
  35080. return n.offset = 0,
  35081. n.limit = i,
  35082. 0 <= n.markedOffset && (n.markedOffset -= e),
  35083. this.copyTo(n, 0, e, t),
  35084. n
  35085. }
  35086. ,
  35087. a.copyTo = function(e, t, i, n) {
  35088. var r, o;
  35089. if (!this.noAssert && !f.isByteBuffer(e))
  35090. throw TypeError("Illegal target: Not a ByteBuffer");
  35091. if (t = (o = void 0 === t) ? e.offset : 0 | t,
  35092. i = (r = void 0 === i) ? this.offset : 0 | i,
  35093. n = void 0 === n ? this.limit : 0 | n,
  35094. t < 0 || t > e.buffer.byteLength)
  35095. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35096. if (i < 0 || n > this.buffer.byteLength)
  35097. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35098. var a = n - i;
  35099. return 0 == a ? e : (e.ensureCapacity(t + a),
  35100. e.view.set(this.view.subarray(i, n), t),
  35101. r && (this.offset += a),
  35102. o && (e.offset += a),
  35103. this)
  35104. }
  35105. ,
  35106. a.ensureCapacity = function(e) {
  35107. var t = this.buffer.byteLength;
  35108. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35109. }
  35110. ,
  35111. a.fill = function(e, t, i) {
  35112. var n = void 0 === t;
  35113. if (n && (t = this.offset),
  35114. "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
  35115. void 0 === t && (t = this.offset),
  35116. void 0 === i && (i = this.limit),
  35117. !this.noAssert) {
  35118. if ("number" != typeof e || e % 1 != 0)
  35119. throw TypeError("Illegal value: " + e + " (not an integer)");
  35120. if (e |= 0,
  35121. "number" != typeof t || t % 1 != 0)
  35122. throw TypeError("Illegal begin: Not an integer");
  35123. if (t >>>= 0,
  35124. "number" != typeof i || i % 1 != 0)
  35125. throw TypeError("Illegal end: Not an integer");
  35126. if (i >>>= 0,
  35127. t < 0 || i < t || i > this.buffer.byteLength)
  35128. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35129. }
  35130. if (i <= t)
  35131. return this;
  35132. for (; t < i; )
  35133. this.view[t++] = e;
  35134. return n && (this.offset = t),
  35135. this
  35136. }
  35137. ,
  35138. a.flip = function() {
  35139. return this.limit = this.offset,
  35140. this.offset = 0,
  35141. this
  35142. }
  35143. ,
  35144. a.mark = function(e) {
  35145. if (e = void 0 === e ? this.offset : e,
  35146. !this.noAssert) {
  35147. if ("number" != typeof e || e % 1 != 0)
  35148. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35149. if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
  35150. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35151. }
  35152. return this.markedOffset = e,
  35153. this
  35154. }
  35155. ,
  35156. a.order = function(e) {
  35157. if (!this.noAssert && "boolean" != typeof e)
  35158. throw TypeError("Illegal littleEndian: Not a boolean");
  35159. return this.littleEndian = !!e,
  35160. this
  35161. }
  35162. ,
  35163. a.LE = function(e) {
  35164. return this.littleEndian = void 0 === e || !!e,
  35165. this
  35166. }
  35167. ,
  35168. a.BE = function(e) {
  35169. return this.littleEndian = void 0 !== e && !e,
  35170. this
  35171. }
  35172. ,
  35173. a.prepend = function(e, t, i) {
  35174. "number" != typeof t && "string" == typeof t || (i = t,
  35175. t = void 0);
  35176. var n = void 0 === i;
  35177. if (n && (i = this.offset),
  35178. !this.noAssert) {
  35179. if ("number" != typeof i || i % 1 != 0)
  35180. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35181. if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
  35182. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35183. }
  35184. e instanceof f || (e = f.wrap(e, t));
  35185. var r = e.limit - e.offset;
  35186. if (r <= 0)
  35187. return this;
  35188. var o = r - i;
  35189. if (0 < o) {
  35190. var a = new ArrayBuffer(this.buffer.byteLength + o)
  35191. , s = new Uint8Array(a);
  35192. s.set(this.view.subarray(i, this.buffer.byteLength), r),
  35193. this.buffer = a,
  35194. this.view = s,
  35195. this.offset += o,
  35196. 0 <= this.markedOffset && (this.markedOffset += o),
  35197. this.limit += o,
  35198. i += o
  35199. } else
  35200. new Uint8Array(this.buffer);
  35201. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35202. e.offset = e.limit,
  35203. n && (this.offset -= r),
  35204. this
  35205. }
  35206. ,
  35207. a.prependTo = function(e, t) {
  35208. return e.prepend(this, t),
  35209. this
  35210. }
  35211. ,
  35212. a.printDebug = function(e) {
  35213. "function" != typeof e && (e = console.log.bind(console)),
  35214. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35215. }
  35216. ,
  35217. a.remaining = function() {
  35218. return this.limit - this.offset
  35219. }
  35220. ,
  35221. a.reset = function() {
  35222. return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
  35223. this.markedOffset = -1) : this.offset = 0,
  35224. this
  35225. }
  35226. ,
  35227. a.resize = function(e) {
  35228. if (!this.noAssert) {
  35229. if ("number" != typeof e || e % 1 != 0)
  35230. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  35231. if ((e |= 0) < 0)
  35232. throw RangeError("Illegal capacity: 0 <= " + e)
  35233. }
  35234. if (this.buffer.byteLength < e) {
  35235. var t = new ArrayBuffer(e)
  35236. , i = new Uint8Array(t);
  35237. i.set(this.view),
  35238. this.buffer = t,
  35239. this.view = i
  35240. }
  35241. return this
  35242. }
  35243. ,
  35244. a.reverse = function(e, t) {
  35245. if (void 0 === e && (e = this.offset),
  35246. void 0 === t && (t = this.limit),
  35247. !this.noAssert) {
  35248. if ("number" != typeof e || e % 1 != 0)
  35249. throw TypeError("Illegal begin: Not an integer");
  35250. if (e >>>= 0,
  35251. "number" != typeof t || t % 1 != 0)
  35252. throw TypeError("Illegal end: Not an integer");
  35253. if (t >>>= 0,
  35254. e < 0 || t < e || t > this.buffer.byteLength)
  35255. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35256. }
  35257. return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
  35258. this
  35259. }
  35260. ,
  35261. a.skip = function(e) {
  35262. if (!this.noAssert) {
  35263. if ("number" != typeof e || e % 1 != 0)
  35264. throw TypeError("Illegal length: " + e + " (not an integer)");
  35265. e |= 0
  35266. }
  35267. var t = this.offset + e;
  35268. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  35269. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  35270. return this.offset = t,
  35271. this
  35272. }
  35273. ,
  35274. a.slice = function(e, t) {
  35275. if (void 0 === e && (e = this.offset),
  35276. void 0 === t && (t = this.limit),
  35277. !this.noAssert) {
  35278. if ("number" != typeof e || e % 1 != 0)
  35279. throw TypeError("Illegal begin: Not an integer");
  35280. if (e >>>= 0,
  35281. "number" != typeof t || t % 1 != 0)
  35282. throw TypeError("Illegal end: Not an integer");
  35283. if (t >>>= 0,
  35284. e < 0 || t < e || t > this.buffer.byteLength)
  35285. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35286. }
  35287. var i = this.clone();
  35288. return i.offset = e,
  35289. i.limit = t,
  35290. i
  35291. }
  35292. ,
  35293. a.toBuffer = function(e) {
  35294. var t = this.offset
  35295. , i = this.limit;
  35296. if (!this.noAssert) {
  35297. if ("number" != typeof t || t % 1 != 0)
  35298. throw TypeError("Illegal offset: Not an integer");
  35299. if (t >>>= 0,
  35300. "number" != typeof i || i % 1 != 0)
  35301. throw TypeError("Illegal limit: Not an integer");
  35302. if (i >>>= 0,
  35303. t < 0 || i < t || i > this.buffer.byteLength)
  35304. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35305. }
  35306. if (!e && 0 === t && i === this.buffer.byteLength)
  35307. return this.buffer;
  35308. if (t === i)
  35309. return o;
  35310. var n = new ArrayBuffer(i - t);
  35311. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  35312. n
  35313. }
  35314. ,
  35315. a.toArrayBuffer = a.toBuffer,
  35316. a.toString = function(e, t, i) {
  35317. if (void 0 === e)
  35318. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  35319. switch ("number" == typeof e && (i = t = e = "utf8"),
  35320. e) {
  35321. case "utf8":
  35322. return this.toUTF8(t, i);
  35323. case "base64":
  35324. return this.toBase64(t, i);
  35325. case "hex":
  35326. return this.toHex(t, i);
  35327. case "binary":
  35328. return this.toBinary(t, i);
  35329. case "debug":
  35330. return this.toDebug();
  35331. case "columns":
  35332. return this.toColumns();
  35333. default:
  35334. throw Error("Unsupported encoding: " + e)
  35335. }
  35336. }
  35337. ;
  35338. var h = function() {
  35339. 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)
  35340. a[r[t]] = t;
  35341. return e.encode = function(e, t) {
  35342. for (var i, n; null !== (i = e()); )
  35343. t(r[i >> 2 & 63]),
  35344. n = (3 & i) << 4,
  35345. null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
  35346. n = (15 & i) << 2,
  35347. null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
  35348. t(r[63 & i])) : (t(r[63 & n]),
  35349. t(61))) : (t(r[63 & n]),
  35350. t(61),
  35351. t(61))
  35352. }
  35353. ,
  35354. e.decode = function(e, t) {
  35355. function i(e) {
  35356. throw Error("Illegal character code: " + e)
  35357. }
  35358. for (var n, r, o; null !== (n = e()); )
  35359. if (void 0 === (r = a[n]) && i(n),
  35360. null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
  35361. t(r << 2 >>> 0 | (48 & o) >> 4),
  35362. null !== (n = e()))) {
  35363. if (void 0 === (r = a[n])) {
  35364. if (61 === n)
  35365. break;
  35366. i(n)
  35367. }
  35368. if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
  35369. null !== (n = e())) {
  35370. if (void 0 === (o = a[n])) {
  35371. if (61 === n)
  35372. break;
  35373. i(n)
  35374. }
  35375. t((3 & r) << 6 >>> 0 | o)
  35376. }
  35377. }
  35378. }
  35379. ,
  35380. e.test = function(e) {
  35381. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  35382. }
  35383. ,
  35384. e
  35385. }();
  35386. a.toBase64 = function(e, t) {
  35387. if (void 0 === e && (e = this.offset),
  35388. void 0 === t && (t = this.limit),
  35389. t |= 0,
  35390. (e |= 0) < 0 || t > this.capacity || t < e)
  35391. throw RangeError("begin, end");
  35392. var i;
  35393. return h.encode(function() {
  35394. return e < t ? this.view[e++] : null
  35395. }
  35396. .bind(this), i = c()),
  35397. i()
  35398. }
  35399. ,
  35400. f.fromBase64 = function(e, t) {
  35401. if ("string" != typeof e)
  35402. throw TypeError("str");
  35403. var i = new f(e.length / 4 * 3,t)
  35404. , n = 0;
  35405. return h.decode(s(e), function(e) {
  35406. i.view[n++] = e
  35407. }),
  35408. i.limit = n,
  35409. i
  35410. }
  35411. ,
  35412. f.btoa = function(e) {
  35413. return f.fromBinary(e).toBase64()
  35414. }
  35415. ,
  35416. f.atob = function(e) {
  35417. return f.fromBase64(e).toBinary()
  35418. }
  35419. ,
  35420. a.toBinary = function(e, t) {
  35421. if (void 0 === e && (e = this.offset),
  35422. void 0 === t && (t = this.limit),
  35423. t |= 0,
  35424. (e |= 0) < 0 || t > this.capacity() || t < e)
  35425. throw RangeError("begin, end");
  35426. if (e === t)
  35427. return "";
  35428. for (var i = [], n = []; e < t; )
  35429. i.push(this.view[e++]),
  35430. 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
  35431. i = []);
  35432. return n.join("") + String.fromCharCode.apply(String, i)
  35433. }
  35434. ,
  35435. f.fromBinary = function(e, t) {
  35436. if ("string" != typeof e)
  35437. throw TypeError("str");
  35438. for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
  35439. if (255 < (i = e.charCodeAt(n)))
  35440. throw RangeError("illegal char code: " + i);
  35441. o.view[n++] = i
  35442. }
  35443. return o.limit = r,
  35444. o
  35445. }
  35446. ,
  35447. a.toDebug = function(e) {
  35448. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  35449. if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  35450. e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
  35451. ++i,
  35452. e && 0 < i && i % 16 == 0 && i !== n) {
  35453. for (; r.length < 51; )
  35454. r += " ";
  35455. a += r + o + "\n",
  35456. r = o = ""
  35457. }
  35458. 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 ? " " : ""
  35459. }
  35460. if (e && " " !== r) {
  35461. for (; r.length < 51; )
  35462. r += " ";
  35463. a += r + o + "\n"
  35464. }
  35465. return e ? a : r
  35466. }
  35467. ,
  35468. f.fromDebug = function(e, t, i) {
  35469. 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; ) {
  35470. switch (n = e.charAt(s++)) {
  35471. case "!":
  35472. if (!i) {
  35473. if (h || u || d) {
  35474. p = !0;
  35475. break
  35476. }
  35477. h = u = d = !0
  35478. }
  35479. a.offset = a.markedOffset = a.limit = l,
  35480. c = !1;
  35481. break;
  35482. case "|":
  35483. if (!i) {
  35484. if (h || d) {
  35485. p = !0;
  35486. break
  35487. }
  35488. h = d = !0
  35489. }
  35490. a.offset = a.limit = l,
  35491. c = !1;
  35492. break;
  35493. case "[":
  35494. if (!i) {
  35495. if (h || u) {
  35496. p = !0;
  35497. break
  35498. }
  35499. h = u = !0
  35500. }
  35501. a.offset = a.markedOffset = l,
  35502. c = !1;
  35503. break;
  35504. case "<":
  35505. if (!i) {
  35506. if (h) {
  35507. p = !0;
  35508. break
  35509. }
  35510. h = !0
  35511. }
  35512. a.offset = l,
  35513. c = !1;
  35514. break;
  35515. case "]":
  35516. if (!i) {
  35517. if (d || u) {
  35518. p = !0;
  35519. break
  35520. }
  35521. d = u = !0
  35522. }
  35523. a.limit = a.markedOffset = l,
  35524. c = !1;
  35525. break;
  35526. case ">":
  35527. if (!i) {
  35528. if (d) {
  35529. p = !0;
  35530. break
  35531. }
  35532. d = !0
  35533. }
  35534. a.limit = l,
  35535. c = !1;
  35536. break;
  35537. case "'":
  35538. if (!i) {
  35539. if (u) {
  35540. p = !0;
  35541. break
  35542. }
  35543. u = !0
  35544. }
  35545. a.markedOffset = l,
  35546. c = !1;
  35547. break;
  35548. case " ":
  35549. c = !1;
  35550. break;
  35551. default:
  35552. if (!i && c) {
  35553. p = !0;
  35554. break
  35555. }
  35556. if (r = parseInt(n + e.charAt(s++), 16),
  35557. !i && (isNaN(r) || r < 0 || 255 < r))
  35558. throw TypeError("Illegal str: Not a debug encoded string");
  35559. a.view[l++] = r,
  35560. c = !0
  35561. }
  35562. if (p)
  35563. throw TypeError("Illegal str: Invalid symbol at " + s)
  35564. }
  35565. if (!i) {
  35566. if (!h || !d)
  35567. throw TypeError("Illegal str: Missing offset or limit");
  35568. if (l < a.buffer.byteLength)
  35569. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
  35570. }
  35571. return a
  35572. }
  35573. ,
  35574. a.toHex = function(e, t) {
  35575. if (e = void 0 === e ? this.offset : e,
  35576. t = void 0 === t ? this.limit : t,
  35577. !this.noAssert) {
  35578. if ("number" != typeof e || e % 1 != 0)
  35579. throw TypeError("Illegal begin: Not an integer");
  35580. if (e >>>= 0,
  35581. "number" != typeof t || t % 1 != 0)
  35582. throw TypeError("Illegal end: Not an integer");
  35583. if (t >>>= 0,
  35584. e < 0 || t < e || t > this.buffer.byteLength)
  35585. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35586. }
  35587. for (var i, n = new Array(t - e); e < t; )
  35588. (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  35589. return n.join("")
  35590. }
  35591. ,
  35592. f.fromHex = function(e, t, i) {
  35593. if (!i) {
  35594. if ("string" != typeof e)
  35595. throw TypeError("Illegal str: Not a string");
  35596. if (e.length % 2 != 0)
  35597. throw TypeError("Illegal str: Length not a multiple of 2")
  35598. }
  35599. for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
  35600. if (n = parseInt(e.substring(a, a + 2), 16),
  35601. !i && (!isFinite(n) || n < 0 || 255 < n))
  35602. throw TypeError("Illegal str: Contains non-hex characters");
  35603. o.view[s++] = n
  35604. }
  35605. return o.limit = s,
  35606. o
  35607. }
  35608. ;
  35609. var u, d = u = {
  35610. MAX_CODEPOINT: 1114111,
  35611. encodeUTF8: function(e, t) {
  35612. var i = null;
  35613. for ("number" == typeof e && (i = e,
  35614. e = function() {
  35615. return null
  35616. }
  35617. ); null !== i || null !== (i = e()); )
  35618. i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
  35619. t(i >> 12 & 63 | 128)),
  35620. t(i >> 6 & 63 | 128)),
  35621. t(63 & i | 128)),
  35622. i = null
  35623. },
  35624. decodeUTF8: function(e, t) {
  35625. for (var i, n, r, o, a = function(e) {
  35626. e = e.slice(0, e.indexOf(null));
  35627. var t = Error(e.toString());
  35628. throw t.name = "TruncatedError",
  35629. t.bytes = e,
  35630. t
  35631. }; null !== (i = e()); )
  35632. if (0 == (128 & i))
  35633. t(i);
  35634. else if (192 == (224 & i))
  35635. null === (n = e()) && a([i, n]),
  35636. t((31 & i) << 6 | 63 & n);
  35637. else if (224 == (240 & i))
  35638. null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
  35639. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  35640. else {
  35641. if (240 != (248 & i))
  35642. throw RangeError("Illegal starting byte: " + i);
  35643. null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
  35644. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  35645. }
  35646. },
  35647. UTF16toUTF8: function(e, t) {
  35648. for (var i, n = null; null !== (i = null !== n ? n : e()); )
  35649. 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  35650. n = null) : t(i);
  35651. null !== n && t(n)
  35652. },
  35653. UTF8toUTF16: function(e, t) {
  35654. var i = null;
  35655. for ("number" == typeof e && (i = e,
  35656. e = function() {
  35657. return null
  35658. }
  35659. ); null !== i || null !== (i = e()); )
  35660. i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
  35661. t(i % 1024 + 56320)),
  35662. i = null
  35663. },
  35664. encodeUTF16toUTF8: function(e, t) {
  35665. u.UTF16toUTF8(e, function(e) {
  35666. u.encodeUTF8(e, t)
  35667. })
  35668. },
  35669. decodeUTF8toUTF16: function(e, t) {
  35670. u.decodeUTF8(e, function(e) {
  35671. u.UTF8toUTF16(e, t)
  35672. })
  35673. },
  35674. calculateCodePoint: function(e) {
  35675. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  35676. },
  35677. calculateUTF8: function(e) {
  35678. for (var t, i = 0; null !== (t = e()); )
  35679. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  35680. return i
  35681. },
  35682. calculateUTF16asUTF8: function(e) {
  35683. var t = 0
  35684. , i = 0;
  35685. return u.UTF16toUTF8(e, function(e) {
  35686. ++t,
  35687. i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  35688. }),
  35689. [t, i]
  35690. }
  35691. };
  35692. return a.toUTF8 = function(t, i) {
  35693. if (void 0 === t && (t = this.offset),
  35694. void 0 === i && (i = this.limit),
  35695. !this.noAssert) {
  35696. if ("number" != typeof t || t % 1 != 0)
  35697. throw TypeError("Illegal begin: Not an integer");
  35698. if (t >>>= 0,
  35699. "number" != typeof i || i % 1 != 0)
  35700. throw TypeError("Illegal end: Not an integer");
  35701. if (i >>>= 0,
  35702. t < 0 || i < t || i > this.buffer.byteLength)
  35703. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35704. }
  35705. var e;
  35706. try {
  35707. d.decodeUTF8toUTF16(function() {
  35708. return t < i ? this.view[t++] : null
  35709. }
  35710. .bind(this), e = c())
  35711. } catch (e) {
  35712. if (t !== i)
  35713. throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
  35714. }
  35715. return e()
  35716. }
  35717. ,
  35718. f.fromUTF8 = function(e, t, i) {
  35719. if (!i && "string" != typeof e)
  35720. throw TypeError("Illegal str: Not a string");
  35721. var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
  35722. , r = 0;
  35723. return d.encodeUTF16toUTF8(s(e), function(e) {
  35724. n.view[r++] = e
  35725. }),
  35726. n.limit = r,
  35727. n
  35728. }
  35729. ,
  35730. f
  35731. }
  35732. ,
  35733. "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
  35734. var e;
  35735. try {
  35736. e = t("long")
  35737. } catch (e) {}
  35738. return r(e)
  35739. }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
  35740. }
  35741. , {
  35742. long: 216
  35743. }],
  35744. 216: [function(e, t, i) {
  35745. var n, r;
  35746. n = this,
  35747. r = function() {
  35748. "use strict";
  35749. function n(e, t, i) {
  35750. this.low = 0 | e,
  35751. this.high = 0 | t,
  35752. this.unsigned = !!i
  35753. }
  35754. function p(e) {
  35755. return !0 === (e && e.__isLong__)
  35756. }
  35757. function e(e, t) {
  35758. var i, n, r;
  35759. return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
  35760. r && (a[e] = i),
  35761. i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
  35762. r && (o[e] = i),
  35763. i)
  35764. }
  35765. function f(e, t) {
  35766. if (isNaN(e) || !isFinite(e))
  35767. return t ? l : y;
  35768. if (t) {
  35769. if (e < 0)
  35770. return l;
  35771. if (r <= e)
  35772. return I
  35773. } else {
  35774. if (e <= -s)
  35775. return E;
  35776. if (s <= e + 1)
  35777. return C
  35778. }
  35779. return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
  35780. }
  35781. function g(e, t, i) {
  35782. return new n(e,t,i)
  35783. }
  35784. function h(e, t, i) {
  35785. if (0 === e.length)
  35786. throw Error("empty string");
  35787. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  35788. return y;
  35789. if (t = "number" == typeof t ? (i = t,
  35790. !1) : !!t,
  35791. (i = i || 10) < 2 || 36 < i)
  35792. throw RangeError("radix");
  35793. var n;
  35794. if (0 < (n = e.indexOf("-")))
  35795. throw Error("interior hyphen");
  35796. if (0 === n)
  35797. return h(e.substring(1), t, i).neg();
  35798. for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
  35799. var s = Math.min(8, e.length - a)
  35800. , l = parseInt(e.substring(a, a + s), i);
  35801. if (s < 8) {
  35802. var c = f(u(i, s));
  35803. o = o.mul(c).add(f(l))
  35804. } else
  35805. o = (o = o.mul(r)).add(f(l))
  35806. }
  35807. return o.unsigned = t,
  35808. o
  35809. }
  35810. function m(e) {
  35811. return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
  35812. }
  35813. Object.defineProperty(n.prototype, "__isLong__", {
  35814. value: !0,
  35815. enumerable: !1,
  35816. configurable: !1
  35817. }),
  35818. n.isLong = p;
  35819. var o = {}
  35820. , a = {};
  35821. n.fromInt = e,
  35822. n.fromNumber = f,
  35823. n.fromBits = g;
  35824. var u = Math.pow;
  35825. n.fromString = h,
  35826. n.fromValue = m;
  35827. var i = 4294967296
  35828. , r = 0x10000000000000000
  35829. , s = r / 2
  35830. , v = e(1 << 24)
  35831. , y = e(0);
  35832. n.ZERO = y;
  35833. var l = e(0, !0);
  35834. n.UZERO = l;
  35835. var c = e(1);
  35836. n.ONE = c;
  35837. var d = e(1, !0);
  35838. n.UONE = d;
  35839. var A = e(-1);
  35840. n.NEG_ONE = A;
  35841. var C = g(-1, 2147483647, !1);
  35842. n.MAX_VALUE = C;
  35843. var I = g(-1, -1, !0);
  35844. n.MAX_UNSIGNED_VALUE = I;
  35845. var E = g(0, -2147483648, !1);
  35846. n.MIN_VALUE = E;
  35847. var t = n.prototype;
  35848. return t.toInt = function() {
  35849. return this.unsigned ? this.low >>> 0 : this.low
  35850. }
  35851. ,
  35852. t.toNumber = function() {
  35853. return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
  35854. }
  35855. ,
  35856. t.toString = function(e) {
  35857. if ((e = e || 10) < 2 || 36 < e)
  35858. throw RangeError("radix");
  35859. if (this.isZero())
  35860. return "0";
  35861. if (this.isNegative()) {
  35862. if (this.eq(E)) {
  35863. var t = f(e)
  35864. , i = this.div(t)
  35865. , n = i.mul(t).sub(this);
  35866. return i.toString(e) + n.toInt().toString(e)
  35867. }
  35868. return "-" + this.neg().toString(e)
  35869. }
  35870. for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
  35871. var s = o.div(r)
  35872. , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
  35873. if ((o = s).isZero())
  35874. return l + a;
  35875. for (; l.length < 6; )
  35876. l = "0" + l;
  35877. a = "" + l + a
  35878. }
  35879. }
  35880. ,
  35881. t.getHighBits = function() {
  35882. return this.high
  35883. }
  35884. ,
  35885. t.getHighBitsUnsigned = function() {
  35886. return this.high >>> 0
  35887. }
  35888. ,
  35889. t.getLowBits = function() {
  35890. return this.low
  35891. }
  35892. ,
  35893. t.getLowBitsUnsigned = function() {
  35894. return this.low >>> 0
  35895. }
  35896. ,
  35897. t.getNumBitsAbs = function() {
  35898. if (this.isNegative())
  35899. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  35900. for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
  35901. ;
  35902. return 0 != this.high ? t + 33 : t + 1
  35903. }
  35904. ,
  35905. t.isZero = function() {
  35906. return 0 === this.high && 0 === this.low
  35907. }
  35908. ,
  35909. t.isNegative = function() {
  35910. return !this.unsigned && this.high < 0
  35911. }
  35912. ,
  35913. t.isPositive = function() {
  35914. return this.unsigned || 0 <= this.high
  35915. }
  35916. ,
  35917. t.isOdd = function() {
  35918. return 1 == (1 & this.low)
  35919. }
  35920. ,
  35921. t.isEven = function() {
  35922. return 0 == (1 & this.low)
  35923. }
  35924. ,
  35925. t.equals = function(e) {
  35926. return p(e) || (e = m(e)),
  35927. (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
  35928. }
  35929. ,
  35930. t.eq = t.equals,
  35931. t.notEquals = function(e) {
  35932. return !this.eq(e)
  35933. }
  35934. ,
  35935. t.neq = t.notEquals,
  35936. t.lessThan = function(e) {
  35937. return this.comp(e) < 0
  35938. }
  35939. ,
  35940. t.lt = t.lessThan,
  35941. t.lessThanOrEqual = function(e) {
  35942. return this.comp(e) <= 0
  35943. }
  35944. ,
  35945. t.lte = t.lessThanOrEqual,
  35946. t.greaterThan = function(e) {
  35947. return 0 < this.comp(e)
  35948. }
  35949. ,
  35950. t.gt = t.greaterThan,
  35951. t.greaterThanOrEqual = function(e) {
  35952. return 0 <= this.comp(e)
  35953. }
  35954. ,
  35955. t.gte = t.greaterThanOrEqual,
  35956. t.compare = function(e) {
  35957. if (p(e) || (e = m(e)),
  35958. this.eq(e))
  35959. return 0;
  35960. var t = this.isNegative()
  35961. , i = e.isNegative();
  35962. 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
  35963. }
  35964. ,
  35965. t.comp = t.compare,
  35966. t.negate = function() {
  35967. return !this.unsigned && this.eq(E) ? E : this.not().add(c)
  35968. }
  35969. ,
  35970. t.neg = t.negate,
  35971. t.add = function(e) {
  35972. p(e) || (e = m(e));
  35973. var t = this.high >>> 16
  35974. , i = 65535 & this.high
  35975. , n = this.low >>> 16
  35976. , r = 65535 & this.low
  35977. , o = e.high >>> 16
  35978. , a = 65535 & e.high
  35979. , s = e.low >>> 16
  35980. , l = 0
  35981. , c = 0
  35982. , h = 0
  35983. , u = 0;
  35984. return h += (u += r + (65535 & e.low)) >>> 16,
  35985. c += (h += n + s) >>> 16,
  35986. l += (c += i + a) >>> 16,
  35987. l += t + o,
  35988. g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
  35989. }
  35990. ,
  35991. t.subtract = function(e) {
  35992. return p(e) || (e = m(e)),
  35993. this.add(e.neg())
  35994. }
  35995. ,
  35996. t.sub = t.subtract,
  35997. t.multiply = function(e) {
  35998. if (this.isZero())
  35999. return y;
  36000. if (p(e) || (e = m(e)),
  36001. e.isZero())
  36002. return y;
  36003. if (this.eq(E))
  36004. return e.isOdd() ? E : y;
  36005. if (e.eq(E))
  36006. return this.isOdd() ? E : y;
  36007. if (this.isNegative())
  36008. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36009. if (e.isNegative())
  36010. return this.mul(e.neg()).neg();
  36011. if (this.lt(v) && e.lt(v))
  36012. return f(this.toNumber() * e.toNumber(), this.unsigned);
  36013. var t = this.high >>> 16
  36014. , i = 65535 & this.high
  36015. , n = this.low >>> 16
  36016. , r = 65535 & this.low
  36017. , o = e.high >>> 16
  36018. , a = 65535 & e.high
  36019. , s = e.low >>> 16
  36020. , l = 65535 & e.low
  36021. , c = 0
  36022. , h = 0
  36023. , u = 0
  36024. , d = 0;
  36025. return u += (d += r * l) >>> 16,
  36026. h += (u += n * l) >>> 16,
  36027. u &= 65535,
  36028. h += (u += r * s) >>> 16,
  36029. c += (h += i * l) >>> 16,
  36030. h &= 65535,
  36031. c += (h += n * s) >>> 16,
  36032. h &= 65535,
  36033. c += (h += r * a) >>> 16,
  36034. c += t * l + i * s + n * a + r * o,
  36035. g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
  36036. }
  36037. ,
  36038. t.mul = t.multiply,
  36039. t.divide = function(e) {
  36040. if (p(e) || (e = m(e)),
  36041. e.isZero())
  36042. throw Error("division by zero");
  36043. if (this.isZero())
  36044. return this.unsigned ? l : y;
  36045. var t, i, n;
  36046. if (this.unsigned) {
  36047. if (e.unsigned || (e = e.toUnsigned()),
  36048. e.gt(this))
  36049. return l;
  36050. if (e.gt(this.shru(1)))
  36051. return d;
  36052. n = l
  36053. } else {
  36054. if (this.eq(E))
  36055. 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)),
  36056. n = t.add(i.div(e)));
  36057. if (e.eq(E))
  36058. return this.unsigned ? l : y;
  36059. if (this.isNegative())
  36060. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36061. if (e.isNegative())
  36062. return this.div(e.neg()).neg();
  36063. n = y
  36064. }
  36065. for (i = this; i.gte(e); ) {
  36066. t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
  36067. 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); )
  36068. s = (a = f(t -= o, this.unsigned)).mul(e);
  36069. a.isZero() && (a = c),
  36070. n = n.add(a),
  36071. i = i.sub(s)
  36072. }
  36073. return n
  36074. }
  36075. ,
  36076. t.div = t.divide,
  36077. t.modulo = function(e) {
  36078. return p(e) || (e = m(e)),
  36079. this.sub(this.div(e).mul(e))
  36080. }
  36081. ,
  36082. t.mod = t.modulo,
  36083. t.not = function() {
  36084. return g(~this.low, ~this.high, this.unsigned)
  36085. }
  36086. ,
  36087. t.and = function(e) {
  36088. return p(e) || (e = m(e)),
  36089. g(this.low & e.low, this.high & e.high, this.unsigned)
  36090. }
  36091. ,
  36092. t.or = function(e) {
  36093. return p(e) || (e = m(e)),
  36094. g(this.low | e.low, this.high | e.high, this.unsigned)
  36095. }
  36096. ,
  36097. t.xor = function(e) {
  36098. return p(e) || (e = m(e)),
  36099. g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36100. }
  36101. ,
  36102. t.shiftLeft = function(e) {
  36103. return p(e) && (e = e.toInt()),
  36104. 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)
  36105. }
  36106. ,
  36107. t.shl = t.shiftLeft,
  36108. t.shiftRight = function(e) {
  36109. return p(e) && (e = e.toInt()),
  36110. 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)
  36111. }
  36112. ,
  36113. t.shr = t.shiftRight,
  36114. t.shiftRightUnsigned = function(e) {
  36115. if (p(e) && (e = e.toInt()),
  36116. 0 === (e &= 63))
  36117. return this;
  36118. var t = this.high;
  36119. return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
  36120. }
  36121. ,
  36122. t.shru = t.shiftRightUnsigned,
  36123. t.toSigned = function() {
  36124. return this.unsigned ? g(this.low, this.high, !1) : this
  36125. }
  36126. ,
  36127. t.toUnsigned = function() {
  36128. return this.unsigned ? this : g(this.low, this.high, !0)
  36129. }
  36130. ,
  36131. t.toBytes = function(e) {
  36132. return e ? this.toBytesLE() : this.toBytesBE()
  36133. }
  36134. ,
  36135. t.toBytesLE = function() {
  36136. var e = this.high
  36137. , t = this.low;
  36138. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36139. }
  36140. ,
  36141. t.toBytesBE = function() {
  36142. var e = this.high
  36143. , t = this.low;
  36144. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36145. }
  36146. ,
  36147. n
  36148. }
  36149. ,
  36150. "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()
  36151. }
  36152. , {}],
  36153. 217: [function(e, t, i) {
  36154. 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 = {
  36155. REVISION: "75"
  36156. };
  36157. function Ii(e, t) {
  36158. return e.distance - t.distance
  36159. }
  36160. function Ei(e, t, i, n) {
  36161. if (!1 !== e.visible && (e.raycast(t, i),
  36162. !0 === n))
  36163. for (var r = e.children, o = 0, a = r.length; o < a; o++)
  36164. Ei(r[o], t, i, !0)
  36165. }
  36166. function _i(e, t, i) {
  36167. return i < 0 && (i += 1),
  36168. 1 < i && (i -= 1),
  36169. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  36170. }
  36171. function bi(e, t, i, n, r, o, a) {
  36172. return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
  36173. r.multiplyScalar(Vt.x),
  36174. o.multiplyScalar(Vt.y),
  36175. a.multiplyScalar(Vt.z),
  36176. r.add(o).add(a),
  36177. r.clone()
  36178. }
  36179. function wi(e, t, i, n, r, o, a) {
  36180. var s = e.material;
  36181. if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
  36182. return null;
  36183. Ut.copy(a),
  36184. Ut.applyMatrix4(e.matrixWorld);
  36185. var l = t.ray.origin.distanceTo(Ut);
  36186. return l < t.near || l > t.far ? null : {
  36187. distance: l,
  36188. point: Ut.clone(),
  36189. object: e
  36190. }
  36191. }
  36192. function Ti(e, t, i, n, r, o, a, s) {
  36193. Mt.fromArray(n, 3 * o),
  36194. Rt.fromArray(n, 3 * a),
  36195. Pt.fromArray(n, 3 * s);
  36196. var l = wi(e, t, i, Mt, Rt, Pt, kt);
  36197. return l && (r && (Nt.fromArray(r, 2 * o),
  36198. Ft.fromArray(r, 2 * a),
  36199. Bt.fromArray(r, 2 * s),
  36200. l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
  36201. l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
  36202. l.faceIndex = o),
  36203. l
  36204. }
  36205. function xi() {}
  36206. function Si(e, t, i, n, r, o) {
  36207. var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
  36208. if (s = e[o[t]].x,
  36209. l = e[o[t]].y,
  36210. c = e[o[i]].x,
  36211. h = e[o[i]].y,
  36212. u = e[o[n]].x,
  36213. d = e[o[n]].y,
  36214. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  36215. return !1;
  36216. for (g = u - c,
  36217. m = d - h,
  36218. v = s - u,
  36219. y = l - d,
  36220. A = c - s,
  36221. C = h - l,
  36222. a = 0; a < r; a++)
  36223. if (p = e[o[a]].x,
  36224. f = e[o[a]].y,
  36225. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
  36226. E = v * (f - d) - y * (p - u),
  36227. g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
  36228. return !1;
  36229. return !0
  36230. }
  36231. function Mi(e) {
  36232. switch (e) {
  36233. case Ci.LinearEncoding:
  36234. return ["Linear", "( value )"];
  36235. case Ci.sRGBEncoding:
  36236. return ["sRGB", "( value )"];
  36237. case Ci.RGBEEncoding:
  36238. return ["RGBE", "( value )"];
  36239. case Ci.RGBM7Encoding:
  36240. return ["RGBM", "( value, 7.0 )"];
  36241. case Ci.RGBM16Encoding:
  36242. return ["RGBM", "( value, 16.0 )"];
  36243. case Ci.RGBDEncoding:
  36244. return ["RGBD", "( value, 256.0 )"];
  36245. case Ci.GammaEncoding:
  36246. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  36247. default:
  36248. throw new Error("unsupported encoding: " + e)
  36249. }
  36250. }
  36251. function Ri(e, t) {
  36252. var i = Mi(t);
  36253. return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
  36254. }
  36255. function Pi(e) {
  36256. return "" !== e
  36257. }
  36258. function Oi(e, t) {
  36259. 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)
  36260. }
  36261. function Li(e) {
  36262. return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
  36263. var i = Ci.ShaderChunk[t];
  36264. if (void 0 === i)
  36265. throw new Error("Can not resolve #include <" + t + ">");
  36266. return Li(i)
  36267. })
  36268. }
  36269. function Di(e) {
  36270. return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
  36271. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  36272. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  36273. return r
  36274. })
  36275. }
  36276. function Ni(e, t, i, n) {
  36277. gi.set(t, i, n).unproject(mi);
  36278. var r = fi[e];
  36279. if (void 0 !== r)
  36280. for (var o = 0, a = r.length; o < a; o++)
  36281. pi.vertices[r[o]].copy(gi)
  36282. }
  36283. "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
  36284. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  36285. void 0 === Math.sign && (Math.sign = function(e) {
  36286. return e < 0 ? -1 : 0 < e ? 1 : +e
  36287. }
  36288. ),
  36289. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  36290. get: function() {
  36291. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  36292. }
  36293. }),
  36294. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  36295. writable: !0,
  36296. configurable: !0,
  36297. value: function(e) {
  36298. "use strict";
  36299. if (null == e)
  36300. throw new TypeError("Cannot convert first argument to object");
  36301. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  36302. var r = arguments[i];
  36303. if (null != r) {
  36304. r = Object(r);
  36305. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  36306. var l = o[a]
  36307. , c = Object.getOwnPropertyDescriptor(r, l);
  36308. void 0 !== c && c.enumerable && (t[l] = r[l])
  36309. }
  36310. }
  36311. }
  36312. return t
  36313. }
  36314. }),
  36315. Ci.MOUSE = {
  36316. LEFT: 0,
  36317. MIDDLE: 1,
  36318. RIGHT: 2
  36319. },
  36320. Ci.CullFaceNone = 0,
  36321. Ci.CullFaceBack = 1,
  36322. Ci.CullFaceFront = 2,
  36323. Ci.CullFaceFrontBack = 3,
  36324. Ci.FrontFaceDirectionCW = 0,
  36325. Ci.FrontFaceDirectionCCW = 1,
  36326. Ci.BasicShadowMap = 0,
  36327. Ci.PCFShadowMap = 1,
  36328. Ci.PCFSoftShadowMap = 2,
  36329. Ci.FrontSide = 0,
  36330. Ci.BackSide = 1,
  36331. Ci.DoubleSide = 2,
  36332. Ci.FlatShading = 1,
  36333. Ci.SmoothShading = 2,
  36334. Ci.NoColors = 0,
  36335. Ci.FaceColors = 1,
  36336. Ci.VertexColors = 2,
  36337. Ci.NoBlending = 0,
  36338. Ci.NormalBlending = 1,
  36339. Ci.AdditiveBlending = 2,
  36340. Ci.SubtractiveBlending = 3,
  36341. Ci.MultiplyBlending = 4,
  36342. Ci.CustomBlending = 5,
  36343. Ci.AddEquation = 100,
  36344. Ci.SubtractEquation = 101,
  36345. Ci.ReverseSubtractEquation = 102,
  36346. Ci.MinEquation = 103,
  36347. Ci.MaxEquation = 104,
  36348. Ci.ZeroFactor = 200,
  36349. Ci.OneFactor = 201,
  36350. Ci.SrcColorFactor = 202,
  36351. Ci.OneMinusSrcColorFactor = 203,
  36352. Ci.SrcAlphaFactor = 204,
  36353. Ci.OneMinusSrcAlphaFactor = 205,
  36354. Ci.DstAlphaFactor = 206,
  36355. Ci.OneMinusDstAlphaFactor = 207,
  36356. Ci.DstColorFactor = 208,
  36357. Ci.OneMinusDstColorFactor = 209,
  36358. Ci.SrcAlphaSaturateFactor = 210,
  36359. Ci.NeverDepth = 0,
  36360. Ci.AlwaysDepth = 1,
  36361. Ci.LessDepth = 2,
  36362. Ci.LessEqualDepth = 3,
  36363. Ci.EqualDepth = 4,
  36364. Ci.GreaterEqualDepth = 5,
  36365. Ci.GreaterDepth = 6,
  36366. Ci.NotEqualDepth = 7,
  36367. Ci.MultiplyOperation = 0,
  36368. Ci.MixOperation = 1,
  36369. Ci.AddOperation = 2,
  36370. Ci.NoToneMapping = 0,
  36371. Ci.LinearToneMapping = 1,
  36372. Ci.ReinhardToneMapping = 2,
  36373. Ci.Uncharted2ToneMapping = 3,
  36374. Ci.CineonToneMapping = 4,
  36375. Ci.UVMapping = 300,
  36376. Ci.CubeReflectionMapping = 301,
  36377. Ci.CubeRefractionMapping = 302,
  36378. Ci.EquirectangularReflectionMapping = 303,
  36379. Ci.EquirectangularRefractionMapping = 304,
  36380. Ci.SphericalReflectionMapping = 305,
  36381. Ci.CubeUVReflectionMapping = 306,
  36382. Ci.CubeUVRefractionMapping = 307,
  36383. Ci.RepeatWrapping = 1e3,
  36384. Ci.ClampToEdgeWrapping = 1001,
  36385. Ci.MirroredRepeatWrapping = 1002,
  36386. Ci.NearestFilter = 1003,
  36387. Ci.NearestMipMapNearestFilter = 1004,
  36388. Ci.NearestMipMapLinearFilter = 1005,
  36389. Ci.LinearFilter = 1006,
  36390. Ci.LinearMipMapNearestFilter = 1007,
  36391. Ci.LinearMipMapLinearFilter = 1008,
  36392. Ci.UnsignedByteType = 1009,
  36393. Ci.ByteType = 1010,
  36394. Ci.ShortType = 1011,
  36395. Ci.UnsignedShortType = 1012,
  36396. Ci.IntType = 1013,
  36397. Ci.UnsignedIntType = 1014,
  36398. Ci.FloatType = 1015,
  36399. Ci.HalfFloatType = 1025,
  36400. Ci.UnsignedShort4444Type = 1016,
  36401. Ci.UnsignedShort5551Type = 1017,
  36402. Ci.UnsignedShort565Type = 1018,
  36403. Ci.AlphaFormat = 1019,
  36404. Ci.RGBFormat = 1020,
  36405. Ci.RGBAFormat = 1021,
  36406. Ci.LuminanceFormat = 1022,
  36407. Ci.LuminanceAlphaFormat = 1023,
  36408. Ci.RGBEFormat = Ci.RGBAFormat,
  36409. Ci.RGB_S3TC_DXT1_Format = 2001,
  36410. Ci.RGBA_S3TC_DXT1_Format = 2002,
  36411. Ci.RGBA_S3TC_DXT3_Format = 2003,
  36412. Ci.RGBA_S3TC_DXT5_Format = 2004,
  36413. Ci.RGB_PVRTC_4BPPV1_Format = 2100,
  36414. Ci.RGB_PVRTC_2BPPV1_Format = 2101,
  36415. Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
  36416. Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
  36417. Ci.RGB_ETC1_Format = 2151,
  36418. Ci.LoopOnce = 2200,
  36419. Ci.LoopRepeat = 2201,
  36420. Ci.LoopPingPong = 2202,
  36421. Ci.InterpolateDiscrete = 2300,
  36422. Ci.InterpolateLinear = 2301,
  36423. Ci.InterpolateSmooth = 2302,
  36424. Ci.ZeroCurvatureEnding = 2400,
  36425. Ci.ZeroSlopeEnding = 2401,
  36426. Ci.WrapAroundEnding = 2402,
  36427. Ci.TrianglesDrawMode = 0,
  36428. Ci.TriangleStripDrawMode = 1,
  36429. Ci.TriangleFanDrawMode = 2,
  36430. Ci.LinearEncoding = 3e3,
  36431. Ci.sRGBEncoding = 3001,
  36432. Ci.GammaEncoding = 3007,
  36433. Ci.RGBEEncoding = 3002,
  36434. Ci.LogLuvEncoding = 3003,
  36435. Ci.RGBM7Encoding = 3004,
  36436. Ci.RGBM16Encoding = 3005,
  36437. Ci.RGBDEncoding = 3006,
  36438. Ci.Color = function(e) {
  36439. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  36440. }
  36441. ,
  36442. Ci.Color.prototype = {
  36443. constructor: Ci.Color,
  36444. r: 1,
  36445. g: 1,
  36446. b: 1,
  36447. set: function(e) {
  36448. return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  36449. this
  36450. },
  36451. setScalar: function(e) {
  36452. this.r = e,
  36453. this.g = e,
  36454. this.b = e
  36455. },
  36456. setHex: function(e) {
  36457. return e = Math.floor(e),
  36458. this.r = (e >> 16 & 255) / 255,
  36459. this.g = (e >> 8 & 255) / 255,
  36460. this.b = (255 & e) / 255,
  36461. this
  36462. },
  36463. setRGB: function(e, t, i) {
  36464. return this.r = e,
  36465. this.g = t,
  36466. this.b = i,
  36467. this
  36468. },
  36469. setHSL: function(e, t, i) {
  36470. if (e = Ci.Math.euclideanModulo(e, 1),
  36471. t = Ci.Math.clamp(t, 0, 1),
  36472. i = Ci.Math.clamp(i, 0, 1),
  36473. 0 === t)
  36474. this.r = this.g = this.b = i;
  36475. else {
  36476. var n = i <= .5 ? i * (1 + t) : i + t - i * t
  36477. , r = 2 * i - n;
  36478. this.r = _i(r, n, e + 1 / 3),
  36479. this.g = _i(r, n, e),
  36480. this.b = _i(r, n, e - 1 / 3)
  36481. }
  36482. return this
  36483. },
  36484. setStyle: function(t) {
  36485. function e(e) {
  36486. void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
  36487. }
  36488. var i;
  36489. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
  36490. var n, r = i[1], o = i[2];
  36491. switch (r) {
  36492. case "rgb":
  36493. case "rgba":
  36494. if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  36495. return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
  36496. this.g = Math.min(255, parseInt(n[2], 10)) / 255,
  36497. this.b = Math.min(255, parseInt(n[3], 10)) / 255,
  36498. e(n[5]),
  36499. this;
  36500. if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
  36501. return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
  36502. this.g = Math.min(100, parseInt(n[2], 10)) / 100,
  36503. this.b = Math.min(100, parseInt(n[3], 10)) / 100,
  36504. e(n[5]),
  36505. this;
  36506. break;
  36507. case "hsl":
  36508. case "hsla":
  36509. if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
  36510. var a = parseFloat(n[1]) / 360
  36511. , s = parseInt(n[2], 10) / 100
  36512. , l = parseInt(n[3], 10) / 100;
  36513. return e(n[5]),
  36514. this.setHSL(a, s, l)
  36515. }
  36516. }
  36517. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
  36518. var c, h = (c = i[1]).length;
  36519. if (3 === h)
  36520. return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
  36521. this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
  36522. this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
  36523. this;
  36524. if (6 === h)
  36525. return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
  36526. this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
  36527. this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
  36528. this
  36529. }
  36530. t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
  36531. return this
  36532. },
  36533. clone: function() {
  36534. return new this.constructor(this.r,this.g,this.b)
  36535. },
  36536. copy: function(e) {
  36537. return this.r = e.r,
  36538. this.g = e.g,
  36539. this.b = e.b,
  36540. this
  36541. },
  36542. copyGammaToLinear: function(e, t) {
  36543. return void 0 === t && (t = 2),
  36544. this.r = Math.pow(e.r, t),
  36545. this.g = Math.pow(e.g, t),
  36546. this.b = Math.pow(e.b, t),
  36547. this
  36548. },
  36549. copyLinearToGamma: function(e, t) {
  36550. void 0 === t && (t = 2);
  36551. var i = 0 < t ? 1 / t : 1;
  36552. return this.r = Math.pow(e.r, i),
  36553. this.g = Math.pow(e.g, i),
  36554. this.b = Math.pow(e.b, i),
  36555. this
  36556. },
  36557. convertGammaToLinear: function() {
  36558. var e = this.r
  36559. , t = this.g
  36560. , i = this.b;
  36561. return this.r = e * e,
  36562. this.g = t * t,
  36563. this.b = i * i,
  36564. this
  36565. },
  36566. convertLinearToGamma: function() {
  36567. return this.r = Math.sqrt(this.r),
  36568. this.g = Math.sqrt(this.g),
  36569. this.b = Math.sqrt(this.b),
  36570. this
  36571. },
  36572. getHex: function() {
  36573. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  36574. },
  36575. getHexString: function() {
  36576. return ("000000" + this.getHex().toString(16)).slice(-6)
  36577. },
  36578. getHSL: function(e) {
  36579. var t, i, n = e || {
  36580. h: 0,
  36581. s: 0,
  36582. l: 0
  36583. }, 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;
  36584. if (l === s)
  36585. i = t = 0;
  36586. else {
  36587. var h = s - l;
  36588. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  36589. s) {
  36590. case r:
  36591. t = (o - a) / h + (o < a ? 6 : 0);
  36592. break;
  36593. case o:
  36594. t = (a - r) / h + 2;
  36595. break;
  36596. case a:
  36597. t = (r - o) / h + 4
  36598. }
  36599. t /= 6
  36600. }
  36601. return n.h = t,
  36602. n.s = i,
  36603. n.l = c,
  36604. n
  36605. },
  36606. getStyle: function() {
  36607. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  36608. },
  36609. offsetHSL: function(e, t, i) {
  36610. var n = this.getHSL();
  36611. return n.h += e,
  36612. n.s += t,
  36613. n.l += i,
  36614. this.setHSL(n.h, n.s, n.l),
  36615. this
  36616. },
  36617. add: function(e) {
  36618. return this.r += e.r,
  36619. this.g += e.g,
  36620. this.b += e.b,
  36621. this
  36622. },
  36623. addColors: function(e, t) {
  36624. return this.r = e.r + t.r,
  36625. this.g = e.g + t.g,
  36626. this.b = e.b + t.b,
  36627. this
  36628. },
  36629. addScalar: function(e) {
  36630. return this.r += e,
  36631. this.g += e,
  36632. this.b += e,
  36633. this
  36634. },
  36635. multiply: function(e) {
  36636. return this.r *= e.r,
  36637. this.g *= e.g,
  36638. this.b *= e.b,
  36639. this
  36640. },
  36641. multiplyScalar: function(e) {
  36642. return this.r *= e,
  36643. this.g *= e,
  36644. this.b *= e,
  36645. this
  36646. },
  36647. lerp: function(e, t) {
  36648. return this.r += (e.r - this.r) * t,
  36649. this.g += (e.g - this.g) * t,
  36650. this.b += (e.b - this.b) * t,
  36651. this
  36652. },
  36653. equals: function(e) {
  36654. return e.r === this.r && e.g === this.g && e.b === this.b
  36655. },
  36656. fromArray: function(e, t) {
  36657. return void 0 === t && (t = 0),
  36658. this.r = e[t],
  36659. this.g = e[t + 1],
  36660. this.b = e[t + 2],
  36661. this
  36662. },
  36663. toArray: function(e, t) {
  36664. return void 0 === e && (e = []),
  36665. void 0 === t && (t = 0),
  36666. e[t] = this.r,
  36667. e[t + 1] = this.g,
  36668. e[t + 2] = this.b,
  36669. e
  36670. }
  36671. },
  36672. Ci.ColorKeywords = {
  36673. aliceblue: 15792383,
  36674. antiquewhite: 16444375,
  36675. aqua: 65535,
  36676. aquamarine: 8388564,
  36677. azure: 15794175,
  36678. beige: 16119260,
  36679. bisque: 16770244,
  36680. black: 0,
  36681. blanchedalmond: 16772045,
  36682. blue: 255,
  36683. blueviolet: 9055202,
  36684. brown: 10824234,
  36685. burlywood: 14596231,
  36686. cadetblue: 6266528,
  36687. chartreuse: 8388352,
  36688. chocolate: 13789470,
  36689. coral: 16744272,
  36690. cornflowerblue: 6591981,
  36691. cornsilk: 16775388,
  36692. crimson: 14423100,
  36693. cyan: 65535,
  36694. darkblue: 139,
  36695. darkcyan: 35723,
  36696. darkgoldenrod: 12092939,
  36697. darkgray: 11119017,
  36698. darkgreen: 25600,
  36699. darkgrey: 11119017,
  36700. darkkhaki: 12433259,
  36701. darkmagenta: 9109643,
  36702. darkolivegreen: 5597999,
  36703. darkorange: 16747520,
  36704. darkorchid: 10040012,
  36705. darkred: 9109504,
  36706. darksalmon: 15308410,
  36707. darkseagreen: 9419919,
  36708. darkslateblue: 4734347,
  36709. darkslategray: 3100495,
  36710. darkslategrey: 3100495,
  36711. darkturquoise: 52945,
  36712. darkviolet: 9699539,
  36713. deeppink: 16716947,
  36714. deepskyblue: 49151,
  36715. dimgray: 6908265,
  36716. dimgrey: 6908265,
  36717. dodgerblue: 2003199,
  36718. firebrick: 11674146,
  36719. floralwhite: 16775920,
  36720. forestgreen: 2263842,
  36721. fuchsia: 16711935,
  36722. gainsboro: 14474460,
  36723. ghostwhite: 16316671,
  36724. gold: 16766720,
  36725. goldenrod: 14329120,
  36726. gray: 8421504,
  36727. green: 32768,
  36728. greenyellow: 11403055,
  36729. grey: 8421504,
  36730. honeydew: 15794160,
  36731. hotpink: 16738740,
  36732. indianred: 13458524,
  36733. indigo: 4915330,
  36734. ivory: 16777200,
  36735. khaki: 15787660,
  36736. lavender: 15132410,
  36737. lavenderblush: 16773365,
  36738. lawngreen: 8190976,
  36739. lemonchiffon: 16775885,
  36740. lightblue: 11393254,
  36741. lightcoral: 15761536,
  36742. lightcyan: 14745599,
  36743. lightgoldenrodyellow: 16448210,
  36744. lightgray: 13882323,
  36745. lightgreen: 9498256,
  36746. lightgrey: 13882323,
  36747. lightpink: 16758465,
  36748. lightsalmon: 16752762,
  36749. lightseagreen: 2142890,
  36750. lightskyblue: 8900346,
  36751. lightslategray: 7833753,
  36752. lightslategrey: 7833753,
  36753. lightsteelblue: 11584734,
  36754. lightyellow: 16777184,
  36755. lime: 65280,
  36756. limegreen: 3329330,
  36757. linen: 16445670,
  36758. magenta: 16711935,
  36759. maroon: 8388608,
  36760. mediumaquamarine: 6737322,
  36761. mediumblue: 205,
  36762. mediumorchid: 12211667,
  36763. mediumpurple: 9662683,
  36764. mediumseagreen: 3978097,
  36765. mediumslateblue: 8087790,
  36766. mediumspringgreen: 64154,
  36767. mediumturquoise: 4772300,
  36768. mediumvioletred: 13047173,
  36769. midnightblue: 1644912,
  36770. mintcream: 16121850,
  36771. mistyrose: 16770273,
  36772. moccasin: 16770229,
  36773. navajowhite: 16768685,
  36774. navy: 128,
  36775. oldlace: 16643558,
  36776. olive: 8421376,
  36777. olivedrab: 7048739,
  36778. orange: 16753920,
  36779. orangered: 16729344,
  36780. orchid: 14315734,
  36781. palegoldenrod: 15657130,
  36782. palegreen: 10025880,
  36783. paleturquoise: 11529966,
  36784. palevioletred: 14381203,
  36785. papayawhip: 16773077,
  36786. peachpuff: 16767673,
  36787. peru: 13468991,
  36788. pink: 16761035,
  36789. plum: 14524637,
  36790. powderblue: 11591910,
  36791. purple: 8388736,
  36792. red: 16711680,
  36793. rosybrown: 12357519,
  36794. royalblue: 4286945,
  36795. saddlebrown: 9127187,
  36796. salmon: 16416882,
  36797. sandybrown: 16032864,
  36798. seagreen: 3050327,
  36799. seashell: 16774638,
  36800. sienna: 10506797,
  36801. silver: 12632256,
  36802. skyblue: 8900331,
  36803. slateblue: 6970061,
  36804. slategray: 7372944,
  36805. slategrey: 7372944,
  36806. snow: 16775930,
  36807. springgreen: 65407,
  36808. steelblue: 4620980,
  36809. tan: 13808780,
  36810. teal: 32896,
  36811. thistle: 14204888,
  36812. tomato: 16737095,
  36813. turquoise: 4251856,
  36814. violet: 15631086,
  36815. wheat: 16113331,
  36816. white: 16777215,
  36817. whitesmoke: 16119285,
  36818. yellow: 16776960,
  36819. yellowgreen: 10145074
  36820. },
  36821. Ci.Quaternion = function(e, t, i, n) {
  36822. this._x = e || 0,
  36823. this._y = t || 0,
  36824. this._z = i || 0,
  36825. this._w = void 0 !== n ? n : 1
  36826. }
  36827. ,
  36828. Ci.Quaternion.prototype = {
  36829. constructor: Ci.Quaternion,
  36830. get x() {
  36831. return this._x
  36832. },
  36833. set x(e) {
  36834. this._x = e,
  36835. this.onChangeCallback()
  36836. },
  36837. get y() {
  36838. return this._y
  36839. },
  36840. set y(e) {
  36841. this._y = e,
  36842. this.onChangeCallback()
  36843. },
  36844. get z() {
  36845. return this._z
  36846. },
  36847. set z(e) {
  36848. this._z = e,
  36849. this.onChangeCallback()
  36850. },
  36851. get w() {
  36852. return this._w
  36853. },
  36854. set w(e) {
  36855. this._w = e,
  36856. this.onChangeCallback()
  36857. },
  36858. set: function(e, t, i, n) {
  36859. return this._x = e,
  36860. this._y = t,
  36861. this._z = i,
  36862. this._w = n,
  36863. this.onChangeCallback(),
  36864. this
  36865. },
  36866. clone: function() {
  36867. return new this.constructor(this._x,this._y,this._z,this._w)
  36868. },
  36869. copy: function(e) {
  36870. return this._x = e.x,
  36871. this._y = e.y,
  36872. this._z = e.z,
  36873. this._w = e.w,
  36874. this.onChangeCallback(),
  36875. this
  36876. },
  36877. setFromEuler: function(e, t) {
  36878. if (e instanceof Ci.Euler == 0)
  36879. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  36880. var i = Math.cos(e._x / 2)
  36881. , n = Math.cos(e._y / 2)
  36882. , r = Math.cos(e._z / 2)
  36883. , o = Math.sin(e._x / 2)
  36884. , a = Math.sin(e._y / 2)
  36885. , s = Math.sin(e._z / 2)
  36886. , l = e.order;
  36887. return "XYZ" === l ? (this._x = o * n * r + i * a * s,
  36888. this._y = i * a * r - o * n * s,
  36889. this._z = i * n * s + o * a * r,
  36890. this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
  36891. this._y = i * a * r - o * n * s,
  36892. this._z = i * n * s - o * a * r,
  36893. this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
  36894. this._y = i * a * r + o * n * s,
  36895. this._z = i * n * s + o * a * r,
  36896. this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
  36897. this._y = i * a * r + o * n * s,
  36898. this._z = i * n * s - o * a * r,
  36899. this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
  36900. this._y = i * a * r + o * n * s,
  36901. this._z = i * n * s - o * a * r,
  36902. this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
  36903. this._y = i * a * r - o * n * s,
  36904. this._z = i * n * s + o * a * r,
  36905. this._w = i * n * r + o * a * s),
  36906. !1 !== t && this.onChangeCallback(),
  36907. this
  36908. },
  36909. setFromAxisAngle: function(e, t) {
  36910. var i = t / 2
  36911. , n = Math.sin(i);
  36912. return this._x = e.x * n,
  36913. this._y = e.y * n,
  36914. this._z = e.z * n,
  36915. this._w = Math.cos(i),
  36916. this.onChangeCallback(),
  36917. this
  36918. },
  36919. setFromRotationMatrix: function(e) {
  36920. 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;
  36921. return 0 < d ? (t = .5 / Math.sqrt(d + 1),
  36922. this._w = .25 / t,
  36923. this._x = (h - l) * t,
  36924. this._y = (o - c) * t,
  36925. this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
  36926. this._w = (h - l) / t,
  36927. this._x = .25 * t,
  36928. this._y = (r + a) / t,
  36929. this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
  36930. this._w = (o - c) / t,
  36931. this._x = (r + a) / t,
  36932. this._y = .25 * t,
  36933. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  36934. this._w = (a - r) / t,
  36935. this._x = (o + c) / t,
  36936. this._y = (l + h) / t,
  36937. this._z = .25 * t),
  36938. this.onChangeCallback(),
  36939. this
  36940. },
  36941. setFromUnitVectors: function(e, t) {
  36942. return void 0 === Be && (Be = new Ci.Vector3),
  36943. (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
  36944. 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),
  36945. this._x = Be.x,
  36946. this._y = Be.y,
  36947. this._z = Be.z,
  36948. this._w = Ve,
  36949. this.normalize(),
  36950. this
  36951. },
  36952. inverse: function() {
  36953. return this.conjugate().normalize(),
  36954. this
  36955. },
  36956. conjugate: function() {
  36957. return this._x *= -1,
  36958. this._y *= -1,
  36959. this._z *= -1,
  36960. this.onChangeCallback(),
  36961. this
  36962. },
  36963. dot: function(e) {
  36964. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  36965. },
  36966. lengthSq: function() {
  36967. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  36968. },
  36969. length: function() {
  36970. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  36971. },
  36972. normalize: function() {
  36973. var e = this.length();
  36974. return 0 === e ? (this._x = 0,
  36975. this._y = 0,
  36976. this._z = 0,
  36977. this._w = 1) : (e = 1 / e,
  36978. this._x = this._x * e,
  36979. this._y = this._y * e,
  36980. this._z = this._z * e,
  36981. this._w = this._w * e),
  36982. this.onChangeCallback(),
  36983. this
  36984. },
  36985. multiply: function(e, t) {
  36986. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  36987. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  36988. },
  36989. multiplyQuaternions: function(e, t) {
  36990. var i = e._x
  36991. , n = e._y
  36992. , r = e._z
  36993. , o = e._w
  36994. , a = t._x
  36995. , s = t._y
  36996. , l = t._z
  36997. , c = t._w;
  36998. return this._x = i * c + o * a + n * l - r * s,
  36999. this._y = n * c + o * s + r * a - i * l,
  37000. this._z = r * c + o * l + i * s - n * a,
  37001. this._w = o * c - i * a - n * s - r * l,
  37002. this.onChangeCallback(),
  37003. this
  37004. },
  37005. slerp: function(e, t) {
  37006. if (0 === t)
  37007. return this;
  37008. if (1 === t)
  37009. return this.copy(e);
  37010. var i = this._x
  37011. , n = this._y
  37012. , r = this._z
  37013. , o = this._w
  37014. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37015. if (a < 0 ? (this._w = -e._w,
  37016. this._x = -e._x,
  37017. this._y = -e._y,
  37018. this._z = -e._z,
  37019. a = -a) : this.copy(e),
  37020. 1 <= a)
  37021. return this._w = o,
  37022. this._x = i,
  37023. this._y = n,
  37024. this._z = r,
  37025. this;
  37026. var s = Math.sqrt(1 - a * a);
  37027. if (Math.abs(s) < .001)
  37028. return this._w = .5 * (o + this._w),
  37029. this._x = .5 * (i + this._x),
  37030. this._y = .5 * (n + this._y),
  37031. this._z = .5 * (r + this._z),
  37032. this;
  37033. var l = Math.atan2(s, a)
  37034. , c = Math.sin((1 - t) * l) / s
  37035. , h = Math.sin(t * l) / s;
  37036. return this._w = o * c + this._w * h,
  37037. this._x = i * c + this._x * h,
  37038. this._y = n * c + this._y * h,
  37039. this._z = r * c + this._z * h,
  37040. this.onChangeCallback(),
  37041. this
  37042. },
  37043. equals: function(e) {
  37044. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37045. },
  37046. fromArray: function(e, t) {
  37047. return void 0 === t && (t = 0),
  37048. this._x = e[t],
  37049. this._y = e[t + 1],
  37050. this._z = e[t + 2],
  37051. this._w = e[t + 3],
  37052. this.onChangeCallback(),
  37053. this
  37054. },
  37055. toArray: function(e, t) {
  37056. return void 0 === e && (e = []),
  37057. void 0 === t && (t = 0),
  37058. e[t] = this._x,
  37059. e[t + 1] = this._y,
  37060. e[t + 2] = this._z,
  37061. e[t + 3] = this._w,
  37062. e
  37063. },
  37064. onChange: function(e) {
  37065. return this.onChangeCallback = e,
  37066. this
  37067. },
  37068. onChangeCallback: function() {}
  37069. },
  37070. Object.assign(Ci.Quaternion, {
  37071. slerp: function(e, t, i, n) {
  37072. return i.copy(e).slerp(t, n)
  37073. },
  37074. slerpFlat: function(e, t, i, n, r, o, a) {
  37075. var s = i[n + 0]
  37076. , l = i[n + 1]
  37077. , c = i[n + 2]
  37078. , h = i[n + 3]
  37079. , u = r[o + 0]
  37080. , d = r[o + 1]
  37081. , p = r[o + 2]
  37082. , f = r[o + 3];
  37083. if (h !== f || s !== u || l !== d || c !== p) {
  37084. var g = 1 - a
  37085. , m = s * u + l * d + c * p + h * f
  37086. , v = 0 <= m ? 1 : -1
  37087. , y = 1 - m * m;
  37088. if (y > Number.EPSILON) {
  37089. var A = Math.sqrt(y)
  37090. , C = Math.atan2(A, m * v);
  37091. g = Math.sin(g * C) / A,
  37092. a = Math.sin(a * C) / A
  37093. }
  37094. var I = a * v;
  37095. if (s = s * g + u * I,
  37096. l = l * g + d * I,
  37097. c = c * g + p * I,
  37098. h = h * g + f * I,
  37099. g === 1 - a) {
  37100. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37101. s *= E,
  37102. l *= E,
  37103. c *= E,
  37104. h *= E
  37105. }
  37106. }
  37107. e[t] = s,
  37108. e[t + 1] = l,
  37109. e[t + 2] = c,
  37110. e[t + 3] = h
  37111. }
  37112. }),
  37113. Ci.Vector2 = function(e, t) {
  37114. this.x = e || 0,
  37115. this.y = t || 0
  37116. }
  37117. ,
  37118. Ci.Vector2.prototype = {
  37119. constructor: Ci.Vector2,
  37120. get width() {
  37121. return this.x
  37122. },
  37123. set width(e) {
  37124. this.x = e
  37125. },
  37126. get height() {
  37127. return this.y
  37128. },
  37129. set height(e) {
  37130. this.y = e
  37131. },
  37132. set: function(e, t) {
  37133. return this.x = e,
  37134. this.y = t,
  37135. this
  37136. },
  37137. setScalar: function(e) {
  37138. return this.x = e,
  37139. this.y = e,
  37140. this
  37141. },
  37142. setX: function(e) {
  37143. return this.x = e,
  37144. this
  37145. },
  37146. setY: function(e) {
  37147. return this.y = e,
  37148. this
  37149. },
  37150. setComponent: function(e, t) {
  37151. switch (e) {
  37152. case 0:
  37153. this.x = t;
  37154. break;
  37155. case 1:
  37156. this.y = t;
  37157. break;
  37158. default:
  37159. throw new Error("index is out of range: " + e)
  37160. }
  37161. },
  37162. getComponent: function(e) {
  37163. switch (e) {
  37164. case 0:
  37165. return this.x;
  37166. case 1:
  37167. return this.y;
  37168. default:
  37169. throw new Error("index is out of range: " + e)
  37170. }
  37171. },
  37172. clone: function() {
  37173. return new this.constructor(this.x,this.y)
  37174. },
  37175. copy: function(e) {
  37176. return this.x = e.x,
  37177. this.y = e.y,
  37178. this
  37179. },
  37180. add: function(e, t) {
  37181. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37182. this.addVectors(e, t)) : (this.x += e.x,
  37183. this.y += e.y,
  37184. this)
  37185. },
  37186. addScalar: function(e) {
  37187. return this.x += e,
  37188. this.y += e,
  37189. this
  37190. },
  37191. addVectors: function(e, t) {
  37192. return this.x = e.x + t.x,
  37193. this.y = e.y + t.y,
  37194. this
  37195. },
  37196. addScaledVector: function(e, t) {
  37197. return this.x += e.x * t,
  37198. this.y += e.y * t,
  37199. this
  37200. },
  37201. sub: function(e, t) {
  37202. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37203. this.subVectors(e, t)) : (this.x -= e.x,
  37204. this.y -= e.y,
  37205. this)
  37206. },
  37207. subScalar: function(e) {
  37208. return this.x -= e,
  37209. this.y -= e,
  37210. this
  37211. },
  37212. subVectors: function(e, t) {
  37213. return this.x = e.x - t.x,
  37214. this.y = e.y - t.y,
  37215. this
  37216. },
  37217. multiply: function(e) {
  37218. return this.x *= e.x,
  37219. this.y *= e.y,
  37220. this
  37221. },
  37222. multiplyScalar: function(e) {
  37223. return isFinite(e) ? (this.x *= e,
  37224. this.y *= e) : (this.x = 0,
  37225. this.y = 0),
  37226. this
  37227. },
  37228. divide: function(e) {
  37229. return this.x /= e.x,
  37230. this.y /= e.y,
  37231. this
  37232. },
  37233. divideScalar: function(e) {
  37234. return this.multiplyScalar(1 / e)
  37235. },
  37236. min: function(e) {
  37237. return this.x = Math.min(this.x, e.x),
  37238. this.y = Math.min(this.y, e.y),
  37239. this
  37240. },
  37241. max: function(e) {
  37242. return this.x = Math.max(this.x, e.x),
  37243. this.y = Math.max(this.y, e.y),
  37244. this
  37245. },
  37246. clamp: function(e, t) {
  37247. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37248. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37249. this
  37250. },
  37251. clampScalar: function(e, t) {
  37252. return void 0 === Ne && (Ne = new Ci.Vector2,
  37253. Fe = new Ci.Vector2),
  37254. Ne.set(e, e),
  37255. Fe.set(t, t),
  37256. this.clamp(Ne, Fe)
  37257. },
  37258. clampLength: function(e, t) {
  37259. var i = this.length();
  37260. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37261. this
  37262. },
  37263. floor: function() {
  37264. return this.x = Math.floor(this.x),
  37265. this.y = Math.floor(this.y),
  37266. this
  37267. },
  37268. ceil: function() {
  37269. return this.x = Math.ceil(this.x),
  37270. this.y = Math.ceil(this.y),
  37271. this
  37272. },
  37273. round: function() {
  37274. return this.x = Math.round(this.x),
  37275. this.y = Math.round(this.y),
  37276. this
  37277. },
  37278. roundToZero: function() {
  37279. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37280. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37281. this
  37282. },
  37283. negate: function() {
  37284. return this.x = -this.x,
  37285. this.y = -this.y,
  37286. this
  37287. },
  37288. dot: function(e) {
  37289. return this.x * e.x + this.y * e.y
  37290. },
  37291. lengthSq: function() {
  37292. return this.x * this.x + this.y * this.y
  37293. },
  37294. length: function() {
  37295. return Math.sqrt(this.x * this.x + this.y * this.y)
  37296. },
  37297. lengthManhattan: function() {
  37298. return Math.abs(this.x) + Math.abs(this.y)
  37299. },
  37300. normalize: function() {
  37301. return this.divideScalar(this.length())
  37302. },
  37303. angle: function() {
  37304. var e = Math.atan2(this.y, this.x);
  37305. return e < 0 && (e += 2 * Math.PI),
  37306. e
  37307. },
  37308. distanceTo: function(e) {
  37309. return Math.sqrt(this.distanceToSquared(e))
  37310. },
  37311. distanceToSquared: function(e) {
  37312. var t = this.x - e.x
  37313. , i = this.y - e.y;
  37314. return t * t + i * i
  37315. },
  37316. setLength: function(e) {
  37317. return this.multiplyScalar(e / this.length())
  37318. },
  37319. lerp: function(e, t) {
  37320. return this.x += (e.x - this.x) * t,
  37321. this.y += (e.y - this.y) * t,
  37322. this
  37323. },
  37324. lerpVectors: function(e, t, i) {
  37325. return this.subVectors(t, e).multiplyScalar(i).add(e),
  37326. this
  37327. },
  37328. equals: function(e) {
  37329. return e.x === this.x && e.y === this.y
  37330. },
  37331. fromArray: function(e, t) {
  37332. return void 0 === t && (t = 0),
  37333. this.x = e[t],
  37334. this.y = e[t + 1],
  37335. this
  37336. },
  37337. toArray: function(e, t) {
  37338. return void 0 === e && (e = []),
  37339. void 0 === t && (t = 0),
  37340. e[t] = this.x,
  37341. e[t + 1] = this.y,
  37342. e
  37343. },
  37344. fromAttribute: function(e, t, i) {
  37345. return void 0 === i && (i = 0),
  37346. t = t * e.itemSize + i,
  37347. this.x = e.array[t],
  37348. this.y = e.array[t + 1],
  37349. this
  37350. },
  37351. rotateAround: function(e, t) {
  37352. var i = Math.cos(t)
  37353. , n = Math.sin(t)
  37354. , r = this.x - e.x
  37355. , o = this.y - e.y;
  37356. return this.x = r * i - o * n + e.x,
  37357. this.y = r * n + o * i + e.y,
  37358. this
  37359. }
  37360. },
  37361. Ci.Vector3 = function(e, t, i) {
  37362. this.x = e || 0,
  37363. this.y = t || 0,
  37364. this.z = i || 0
  37365. }
  37366. ,
  37367. Ci.Vector3.prototype = {
  37368. constructor: Ci.Vector3,
  37369. set: function(e, t, i) {
  37370. return this.x = e,
  37371. this.y = t,
  37372. this.z = i,
  37373. this
  37374. },
  37375. setScalar: function(e) {
  37376. return this.x = e,
  37377. this.y = e,
  37378. this.z = e,
  37379. this
  37380. },
  37381. setX: function(e) {
  37382. return this.x = e,
  37383. this
  37384. },
  37385. setY: function(e) {
  37386. return this.y = e,
  37387. this
  37388. },
  37389. setZ: function(e) {
  37390. return this.z = e,
  37391. this
  37392. },
  37393. setComponent: function(e, t) {
  37394. switch (e) {
  37395. case 0:
  37396. this.x = t;
  37397. break;
  37398. case 1:
  37399. this.y = t;
  37400. break;
  37401. case 2:
  37402. this.z = t;
  37403. break;
  37404. default:
  37405. throw new Error("index is out of range: " + e)
  37406. }
  37407. },
  37408. getComponent: function(e) {
  37409. switch (e) {
  37410. case 0:
  37411. return this.x;
  37412. case 1:
  37413. return this.y;
  37414. case 2:
  37415. return this.z;
  37416. default:
  37417. throw new Error("index is out of range: " + e)
  37418. }
  37419. },
  37420. clone: function() {
  37421. return new this.constructor(this.x,this.y,this.z)
  37422. },
  37423. copy: function(e) {
  37424. return this.x = e.x,
  37425. this.y = e.y,
  37426. this.z = e.z,
  37427. this
  37428. },
  37429. add: function(e, t) {
  37430. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37431. this.addVectors(e, t)) : (this.x += e.x,
  37432. this.y += e.y,
  37433. this.z += e.z,
  37434. this)
  37435. },
  37436. addScalar: function(e) {
  37437. return this.x += e,
  37438. this.y += e,
  37439. this.z += e,
  37440. this
  37441. },
  37442. addVectors: function(e, t) {
  37443. return this.x = e.x + t.x,
  37444. this.y = e.y + t.y,
  37445. this.z = e.z + t.z,
  37446. this
  37447. },
  37448. addScaledVector: function(e, t) {
  37449. return this.x += e.x * t,
  37450. this.y += e.y * t,
  37451. this.z += e.z * t,
  37452. this
  37453. },
  37454. sub: function(e, t) {
  37455. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37456. this.subVectors(e, t)) : (this.x -= e.x,
  37457. this.y -= e.y,
  37458. this.z -= e.z,
  37459. this)
  37460. },
  37461. subScalar: function(e) {
  37462. return this.x -= e,
  37463. this.y -= e,
  37464. this.z -= e,
  37465. this
  37466. },
  37467. subVectors: function(e, t) {
  37468. return this.x = e.x - t.x,
  37469. this.y = e.y - t.y,
  37470. this.z = e.z - t.z,
  37471. this
  37472. },
  37473. multiply: function(e, t) {
  37474. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  37475. this.multiplyVectors(e, t)) : (this.x *= e.x,
  37476. this.y *= e.y,
  37477. this.z *= e.z,
  37478. this)
  37479. },
  37480. multiplyScalar: function(e) {
  37481. return isFinite(e) ? (this.x *= e,
  37482. this.y *= e,
  37483. this.z *= e) : (this.x = 0,
  37484. this.y = 0,
  37485. this.z = 0),
  37486. this
  37487. },
  37488. multiplyVectors: function(e, t) {
  37489. return this.x = e.x * t.x,
  37490. this.y = e.y * t.y,
  37491. this.z = e.z * t.z,
  37492. this
  37493. },
  37494. applyEuler: function(e) {
  37495. return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  37496. void 0 === De && (De = new Ci.Quaternion),
  37497. this.applyQuaternion(De.setFromEuler(e)),
  37498. this
  37499. },
  37500. applyAxisAngle: function(e, t) {
  37501. return void 0 === Le && (Le = new Ci.Quaternion),
  37502. this.applyQuaternion(Le.setFromAxisAngle(e, t)),
  37503. this
  37504. },
  37505. applyMatrix3: function(e) {
  37506. var t = this.x
  37507. , i = this.y
  37508. , n = this.z
  37509. , r = e.elements;
  37510. return this.x = r[0] * t + r[3] * i + r[6] * n,
  37511. this.y = r[1] * t + r[4] * i + r[7] * n,
  37512. this.z = r[2] * t + r[5] * i + r[8] * n,
  37513. this
  37514. },
  37515. applyMatrix4: function(e) {
  37516. var t = this.x
  37517. , i = this.y
  37518. , n = this.z
  37519. , r = e.elements;
  37520. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  37521. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  37522. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  37523. this
  37524. },
  37525. applyProjection: function(e) {
  37526. var t = this.x
  37527. , i = this.y
  37528. , n = this.z
  37529. , r = e.elements
  37530. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  37531. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  37532. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  37533. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  37534. this
  37535. },
  37536. applyQuaternion: function(e) {
  37537. var t = this.x
  37538. , i = this.y
  37539. , n = this.z
  37540. , r = e.x
  37541. , o = e.y
  37542. , a = e.z
  37543. , s = e.w
  37544. , l = s * t + o * n - a * i
  37545. , c = s * i + a * t - r * n
  37546. , h = s * n + r * i - o * t
  37547. , u = -r * t - o * i - a * n;
  37548. return this.x = l * s + u * -r + c * -a - h * -o,
  37549. this.y = c * s + u * -o + h * -r - l * -a,
  37550. this.z = h * s + u * -a + l * -o - c * -r,
  37551. this
  37552. },
  37553. project: function(e) {
  37554. return void 0 === Oe && (Oe = new Ci.Matrix4),
  37555. Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
  37556. this.applyProjection(Oe)
  37557. },
  37558. unproject: function(e) {
  37559. return void 0 === Pe && (Pe = new Ci.Matrix4),
  37560. Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
  37561. this.applyProjection(Pe)
  37562. },
  37563. transformDirection: function(e) {
  37564. var t = this.x
  37565. , i = this.y
  37566. , n = this.z
  37567. , r = e.elements;
  37568. return this.x = r[0] * t + r[4] * i + r[8] * n,
  37569. this.y = r[1] * t + r[5] * i + r[9] * n,
  37570. this.z = r[2] * t + r[6] * i + r[10] * n,
  37571. this.normalize(),
  37572. this
  37573. },
  37574. divide: function(e) {
  37575. return this.x /= e.x,
  37576. this.y /= e.y,
  37577. this.z /= e.z,
  37578. this
  37579. },
  37580. divideScalar: function(e) {
  37581. return this.multiplyScalar(1 / e)
  37582. },
  37583. min: function(e) {
  37584. return this.x = Math.min(this.x, e.x),
  37585. this.y = Math.min(this.y, e.y),
  37586. this.z = Math.min(this.z, e.z),
  37587. this
  37588. },
  37589. max: function(e) {
  37590. return this.x = Math.max(this.x, e.x),
  37591. this.y = Math.max(this.y, e.y),
  37592. this.z = Math.max(this.z, e.z),
  37593. this
  37594. },
  37595. clamp: function(e, t) {
  37596. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37597. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37598. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  37599. this
  37600. },
  37601. clampScalar: function(e, t) {
  37602. return void 0 === Me && (Me = new Ci.Vector3,
  37603. Re = new Ci.Vector3),
  37604. Me.set(e, e, e),
  37605. Re.set(t, t, t),
  37606. this.clamp(Me, Re)
  37607. },
  37608. clampLength: function(e, t) {
  37609. var i = this.length();
  37610. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37611. this
  37612. },
  37613. floor: function() {
  37614. return this.x = Math.floor(this.x),
  37615. this.y = Math.floor(this.y),
  37616. this.z = Math.floor(this.z),
  37617. this
  37618. },
  37619. ceil: function() {
  37620. return this.x = Math.ceil(this.x),
  37621. this.y = Math.ceil(this.y),
  37622. this.z = Math.ceil(this.z),
  37623. this
  37624. },
  37625. round: function() {
  37626. return this.x = Math.round(this.x),
  37627. this.y = Math.round(this.y),
  37628. this.z = Math.round(this.z),
  37629. this
  37630. },
  37631. roundToZero: function() {
  37632. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37633. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37634. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  37635. this
  37636. },
  37637. negate: function() {
  37638. return this.x = -this.x,
  37639. this.y = -this.y,
  37640. this.z = -this.z,
  37641. this
  37642. },
  37643. dot: function(e) {
  37644. return this.x * e.x + this.y * e.y + this.z * e.z
  37645. },
  37646. lengthSq: function() {
  37647. return this.x * this.x + this.y * this.y + this.z * this.z
  37648. },
  37649. length: function() {
  37650. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  37651. },
  37652. lengthManhattan: function() {
  37653. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  37654. },
  37655. normalize: function() {
  37656. return this.divideScalar(this.length())
  37657. },
  37658. setLength: function(e) {
  37659. return this.multiplyScalar(e / this.length())
  37660. },
  37661. lerp: function(e, t) {
  37662. return this.x += (e.x - this.x) * t,
  37663. this.y += (e.y - this.y) * t,
  37664. this.z += (e.z - this.z) * t,
  37665. this
  37666. },
  37667. lerpVectors: function(e, t, i) {
  37668. return this.subVectors(t, e).multiplyScalar(i).add(e),
  37669. this
  37670. },
  37671. cross: function(e, t) {
  37672. if (void 0 !== t)
  37673. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  37674. this.crossVectors(e, t);
  37675. var i = this.x
  37676. , n = this.y
  37677. , r = this.z;
  37678. return this.x = n * e.z - r * e.y,
  37679. this.y = r * e.x - i * e.z,
  37680. this.z = i * e.y - n * e.x,
  37681. this
  37682. },
  37683. crossVectors: function(e, t) {
  37684. var i = e.x
  37685. , n = e.y
  37686. , r = e.z
  37687. , o = t.x
  37688. , a = t.y
  37689. , s = t.z;
  37690. return this.x = n * s - r * a,
  37691. this.y = r * o - i * s,
  37692. this.z = i * a - n * o,
  37693. this
  37694. },
  37695. projectOnVector: function(e) {
  37696. return void 0 === xe && (xe = new Ci.Vector3),
  37697. xe.copy(e).normalize(),
  37698. Se = this.dot(xe),
  37699. this.copy(xe).multiplyScalar(Se)
  37700. },
  37701. projectOnPlane: function(e) {
  37702. return void 0 === Te && (Te = new Ci.Vector3),
  37703. Te.copy(this).projectOnVector(e),
  37704. this.sub(Te)
  37705. },
  37706. reflect: function(e) {
  37707. return void 0 === we && (we = new Ci.Vector3),
  37708. this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
  37709. },
  37710. angleTo: function(e) {
  37711. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  37712. return Math.acos(Ci.Math.clamp(t, -1, 1))
  37713. },
  37714. distanceTo: function(e) {
  37715. return Math.sqrt(this.distanceToSquared(e))
  37716. },
  37717. distanceToSquared: function(e) {
  37718. var t = this.x - e.x
  37719. , i = this.y - e.y
  37720. , n = this.z - e.z;
  37721. return t * t + i * i + n * n
  37722. },
  37723. setFromSpherical: function(e) {
  37724. var t = Math.sin(e.phi) * e.radius;
  37725. return this.x = t * Math.sin(e.theta),
  37726. this.y = Math.cos(e.phi) * e.radius,
  37727. this.z = t * Math.cos(e.theta),
  37728. this
  37729. },
  37730. setFromMatrixPosition: function(e) {
  37731. return this.setFromMatrixColumn(e, 3)
  37732. },
  37733. setFromMatrixScale: function(e) {
  37734. var t = this.setFromMatrixColumn(e, 0).length()
  37735. , i = this.setFromMatrixColumn(e, 1).length()
  37736. , n = this.setFromMatrixColumn(e, 2).length();
  37737. return this.x = t,
  37738. this.y = i,
  37739. this.z = n,
  37740. this
  37741. },
  37742. setFromMatrixColumn: function(e, t) {
  37743. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  37744. t = e = t),
  37745. this.fromArray(e.elements, 4 * t)
  37746. },
  37747. equals: function(e) {
  37748. return e.x === this.x && e.y === this.y && e.z === this.z
  37749. },
  37750. fromArray: function(e, t) {
  37751. return void 0 === t && (t = 0),
  37752. this.x = e[t],
  37753. this.y = e[t + 1],
  37754. this.z = e[t + 2],
  37755. this
  37756. },
  37757. toArray: function(e, t) {
  37758. return void 0 === e && (e = []),
  37759. void 0 === t && (t = 0),
  37760. e[t] = this.x,
  37761. e[t + 1] = this.y,
  37762. e[t + 2] = this.z,
  37763. e
  37764. },
  37765. fromAttribute: function(e, t, i) {
  37766. return void 0 === i && (i = 0),
  37767. t = t * e.itemSize + i,
  37768. this.x = e.array[t],
  37769. this.y = e.array[t + 1],
  37770. this.z = e.array[t + 2],
  37771. this
  37772. }
  37773. },
  37774. Ci.Vector4 = function(e, t, i, n) {
  37775. this.x = e || 0,
  37776. this.y = t || 0,
  37777. this.z = i || 0,
  37778. this.w = void 0 !== n ? n : 1
  37779. }
  37780. ,
  37781. Ci.Vector4.prototype = {
  37782. constructor: Ci.Vector4,
  37783. set: function(e, t, i, n) {
  37784. return this.x = e,
  37785. this.y = t,
  37786. this.z = i,
  37787. this.w = n,
  37788. this
  37789. },
  37790. setScalar: function(e) {
  37791. return this.x = e,
  37792. this.y = e,
  37793. this.z = e,
  37794. this.w = e,
  37795. this
  37796. },
  37797. setX: function(e) {
  37798. return this.x = e,
  37799. this
  37800. },
  37801. setY: function(e) {
  37802. return this.y = e,
  37803. this
  37804. },
  37805. setZ: function(e) {
  37806. return this.z = e,
  37807. this
  37808. },
  37809. setW: function(e) {
  37810. return this.w = e,
  37811. this
  37812. },
  37813. setComponent: function(e, t) {
  37814. switch (e) {
  37815. case 0:
  37816. this.x = t;
  37817. break;
  37818. case 1:
  37819. this.y = t;
  37820. break;
  37821. case 2:
  37822. this.z = t;
  37823. break;
  37824. case 3:
  37825. this.w = t;
  37826. break;
  37827. default:
  37828. throw new Error("index is out of range: " + e)
  37829. }
  37830. },
  37831. getComponent: function(e) {
  37832. switch (e) {
  37833. case 0:
  37834. return this.x;
  37835. case 1:
  37836. return this.y;
  37837. case 2:
  37838. return this.z;
  37839. case 3:
  37840. return this.w;
  37841. default:
  37842. throw new Error("index is out of range: " + e)
  37843. }
  37844. },
  37845. clone: function() {
  37846. return new this.constructor(this.x,this.y,this.z,this.w)
  37847. },
  37848. copy: function(e) {
  37849. return this.x = e.x,
  37850. this.y = e.y,
  37851. this.z = e.z,
  37852. this.w = void 0 !== e.w ? e.w : 1,
  37853. this
  37854. },
  37855. add: function(e, t) {
  37856. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37857. this.addVectors(e, t)) : (this.x += e.x,
  37858. this.y += e.y,
  37859. this.z += e.z,
  37860. this.w += e.w,
  37861. this)
  37862. },
  37863. addScalar: function(e) {
  37864. return this.x += e,
  37865. this.y += e,
  37866. this.z += e,
  37867. this.w += e,
  37868. this
  37869. },
  37870. addVectors: function(e, t) {
  37871. return this.x = e.x + t.x,
  37872. this.y = e.y + t.y,
  37873. this.z = e.z + t.z,
  37874. this.w = e.w + t.w,
  37875. this
  37876. },
  37877. addScaledVector: function(e, t) {
  37878. return this.x += e.x * t,
  37879. this.y += e.y * t,
  37880. this.z += e.z * t,
  37881. this.w += e.w * t,
  37882. this
  37883. },
  37884. sub: function(e, t) {
  37885. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37886. this.subVectors(e, t)) : (this.x -= e.x,
  37887. this.y -= e.y,
  37888. this.z -= e.z,
  37889. this.w -= e.w,
  37890. this)
  37891. },
  37892. subScalar: function(e) {
  37893. return this.x -= e,
  37894. this.y -= e,
  37895. this.z -= e,
  37896. this.w -= e,
  37897. this
  37898. },
  37899. subVectors: function(e, t) {
  37900. return this.x = e.x - t.x,
  37901. this.y = e.y - t.y,
  37902. this.z = e.z - t.z,
  37903. this.w = e.w - t.w,
  37904. this
  37905. },
  37906. multiplyScalar: function(e) {
  37907. return isFinite(e) ? (this.x *= e,
  37908. this.y *= e,
  37909. this.z *= e,
  37910. this.w *= e) : (this.x = 0,
  37911. this.y = 0,
  37912. this.z = 0,
  37913. this.w = 0),
  37914. this
  37915. },
  37916. applyMatrix4: function(e) {
  37917. var t = this.x
  37918. , i = this.y
  37919. , n = this.z
  37920. , r = this.w
  37921. , o = e.elements;
  37922. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  37923. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  37924. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  37925. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  37926. this
  37927. },
  37928. divideScalar: function(e) {
  37929. return this.multiplyScalar(1 / e)
  37930. },
  37931. setAxisAngleFromQuaternion: function(e) {
  37932. this.w = 2 * Math.acos(e.w);
  37933. var t = Math.sqrt(1 - e.w * e.w);
  37934. return t < 1e-4 ? (this.x = 1,
  37935. this.y = 0,
  37936. this.z = 0) : (this.x = e.x / t,
  37937. this.y = e.y / t,
  37938. this.z = e.z / t),
  37939. this
  37940. },
  37941. setAxisAngleFromRotationMatrix: function(e) {
  37942. 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];
  37943. if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
  37944. if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
  37945. return this.set(1, 0, 0, 0),
  37946. this;
  37947. t = Math.PI;
  37948. var g = (a + 1) / 2
  37949. , m = (h + 1) / 2
  37950. , v = (f + 1) / 2
  37951. , y = (s + c) / 4
  37952. , A = (l + d) / 4
  37953. , C = (u + p) / 4;
  37954. return m < g && v < g ? r = g < .01 ? (i = 0,
  37955. n = .707106781) : (n = y / (i = Math.sqrt(g)),
  37956. A / i) : v < m ? r = m < .01 ? (n = 0,
  37957. i = .707106781) : (i = y / (n = Math.sqrt(m)),
  37958. C / n) : v < .01 ? (n = i = .707106781,
  37959. r = 0) : (i = A / (r = Math.sqrt(v)),
  37960. n = C / r),
  37961. this.set(i, n, r, t),
  37962. this
  37963. }
  37964. var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
  37965. return Math.abs(I) < .001 && (I = 1),
  37966. this.x = (p - u) / I,
  37967. this.y = (l - d) / I,
  37968. this.z = (c - s) / I,
  37969. this.w = Math.acos((a + h + f - 1) / 2),
  37970. this
  37971. },
  37972. min: function(e) {
  37973. return this.x = Math.min(this.x, e.x),
  37974. this.y = Math.min(this.y, e.y),
  37975. this.z = Math.min(this.z, e.z),
  37976. this.w = Math.min(this.w, e.w),
  37977. this
  37978. },
  37979. max: function(e) {
  37980. return this.x = Math.max(this.x, e.x),
  37981. this.y = Math.max(this.y, e.y),
  37982. this.z = Math.max(this.z, e.z),
  37983. this.w = Math.max(this.w, e.w),
  37984. this
  37985. },
  37986. clamp: function(e, t) {
  37987. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37988. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37989. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  37990. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  37991. this
  37992. },
  37993. clampScalar: function(e, t) {
  37994. return void 0 === _e && (_e = new Ci.Vector4,
  37995. be = new Ci.Vector4),
  37996. _e.set(e, e, e, e),
  37997. be.set(t, t, t, t),
  37998. this.clamp(_e, be)
  37999. },
  38000. floor: function() {
  38001. return this.x = Math.floor(this.x),
  38002. this.y = Math.floor(this.y),
  38003. this.z = Math.floor(this.z),
  38004. this.w = Math.floor(this.w),
  38005. this
  38006. },
  38007. ceil: function() {
  38008. return this.x = Math.ceil(this.x),
  38009. this.y = Math.ceil(this.y),
  38010. this.z = Math.ceil(this.z),
  38011. this.w = Math.ceil(this.w),
  38012. this
  38013. },
  38014. round: function() {
  38015. return this.x = Math.round(this.x),
  38016. this.y = Math.round(this.y),
  38017. this.z = Math.round(this.z),
  38018. this.w = Math.round(this.w),
  38019. this
  38020. },
  38021. roundToZero: function() {
  38022. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38023. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38024. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38025. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38026. this
  38027. },
  38028. negate: function() {
  38029. return this.x = -this.x,
  38030. this.y = -this.y,
  38031. this.z = -this.z,
  38032. this.w = -this.w,
  38033. this
  38034. },
  38035. dot: function(e) {
  38036. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38037. },
  38038. lengthSq: function() {
  38039. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38040. },
  38041. length: function() {
  38042. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38043. },
  38044. lengthManhattan: function() {
  38045. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38046. },
  38047. normalize: function() {
  38048. return this.divideScalar(this.length())
  38049. },
  38050. setLength: function(e) {
  38051. return this.multiplyScalar(e / this.length())
  38052. },
  38053. lerp: function(e, t) {
  38054. return this.x += (e.x - this.x) * t,
  38055. this.y += (e.y - this.y) * t,
  38056. this.z += (e.z - this.z) * t,
  38057. this.w += (e.w - this.w) * t,
  38058. this
  38059. },
  38060. lerpVectors: function(e, t, i) {
  38061. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38062. this
  38063. },
  38064. equals: function(e) {
  38065. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38066. },
  38067. fromArray: function(e, t) {
  38068. return void 0 === t && (t = 0),
  38069. this.x = e[t],
  38070. this.y = e[t + 1],
  38071. this.z = e[t + 2],
  38072. this.w = e[t + 3],
  38073. this
  38074. },
  38075. toArray: function(e, t) {
  38076. return void 0 === e && (e = []),
  38077. void 0 === t && (t = 0),
  38078. e[t] = this.x,
  38079. e[t + 1] = this.y,
  38080. e[t + 2] = this.z,
  38081. e[t + 3] = this.w,
  38082. e
  38083. },
  38084. fromAttribute: function(e, t, i) {
  38085. return void 0 === i && (i = 0),
  38086. t = t * e.itemSize + i,
  38087. this.x = e.array[t],
  38088. this.y = e.array[t + 1],
  38089. this.z = e.array[t + 2],
  38090. this.w = e.array[t + 3],
  38091. this
  38092. }
  38093. },
  38094. Ci.Euler = function(e, t, i, n) {
  38095. this._x = e || 0,
  38096. this._y = t || 0,
  38097. this._z = i || 0,
  38098. this._order = n || Ci.Euler.DefaultOrder
  38099. }
  38100. ,
  38101. Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38102. Ci.Euler.DefaultOrder = "XYZ",
  38103. Ci.Euler.prototype = {
  38104. constructor: Ci.Euler,
  38105. get x() {
  38106. return this._x
  38107. },
  38108. set x(e) {
  38109. this._x = e,
  38110. this.onChangeCallback()
  38111. },
  38112. get y() {
  38113. return this._y
  38114. },
  38115. set y(e) {
  38116. this._y = e,
  38117. this.onChangeCallback()
  38118. },
  38119. get z() {
  38120. return this._z
  38121. },
  38122. set z(e) {
  38123. this._z = e,
  38124. this.onChangeCallback()
  38125. },
  38126. get order() {
  38127. return this._order
  38128. },
  38129. set order(e) {
  38130. this._order = e,
  38131. this.onChangeCallback()
  38132. },
  38133. set: function(e, t, i, n) {
  38134. return this._x = e,
  38135. this._y = t,
  38136. this._z = i,
  38137. this._order = n || this._order,
  38138. this.onChangeCallback(),
  38139. this
  38140. },
  38141. clone: function() {
  38142. return new this.constructor(this._x,this._y,this._z,this._order)
  38143. },
  38144. copy: function(e) {
  38145. return this._x = e._x,
  38146. this._y = e._y,
  38147. this._z = e._z,
  38148. this._order = e._order,
  38149. this.onChangeCallback(),
  38150. this
  38151. },
  38152. setFromRotationMatrix: function(e, t, i) {
  38153. var n = Ci.Math.clamp
  38154. , r = e.elements
  38155. , o = r[0]
  38156. , a = r[4]
  38157. , s = r[8]
  38158. , l = r[1]
  38159. , c = r[5]
  38160. , h = r[9]
  38161. , u = r[2]
  38162. , d = r[6]
  38163. , p = r[10];
  38164. return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
  38165. Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
  38166. this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
  38167. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
  38168. Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
  38169. this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
  38170. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
  38171. Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
  38172. this._z = Math.atan2(-a, c)) : (this._y = 0,
  38173. this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
  38174. Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
  38175. this._z = Math.atan2(l, o)) : (this._x = 0,
  38176. this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
  38177. Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
  38178. this._y = Math.atan2(-u, o)) : (this._x = 0,
  38179. this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
  38180. Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
  38181. this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
  38182. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38183. this._order = t,
  38184. !1 !== i && this.onChangeCallback(),
  38185. this
  38186. },
  38187. setFromQuaternion: function(e, t, i) {
  38188. return void 0 === Ee && (Ee = new Ci.Matrix4),
  38189. Ee.makeRotationFromQuaternion(e),
  38190. this.setFromRotationMatrix(Ee, t, i),
  38191. this
  38192. },
  38193. setFromVector3: function(e, t) {
  38194. return this.set(e.x, e.y, e.z, t || this._order)
  38195. },
  38196. reorder: (Ie = new Ci.Quaternion,
  38197. function(e) {
  38198. Ie.setFromEuler(this),
  38199. this.setFromQuaternion(Ie, e)
  38200. }
  38201. ),
  38202. equals: function(e) {
  38203. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38204. },
  38205. fromArray: function(e) {
  38206. return this._x = e[0],
  38207. this._y = e[1],
  38208. this._z = e[2],
  38209. void 0 !== e[3] && (this._order = e[3]),
  38210. this.onChangeCallback(),
  38211. this
  38212. },
  38213. toArray: function(e, t) {
  38214. return void 0 === e && (e = []),
  38215. void 0 === t && (t = 0),
  38216. e[t] = this._x,
  38217. e[t + 1] = this._y,
  38218. e[t + 2] = this._z,
  38219. e[t + 3] = this._order,
  38220. e
  38221. },
  38222. toVector3: function(e) {
  38223. return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
  38224. },
  38225. onChange: function(e) {
  38226. return this.onChangeCallback = e,
  38227. this
  38228. },
  38229. onChangeCallback: function() {}
  38230. },
  38231. Ci.Line3 = function(e, t) {
  38232. this.start = void 0 !== e ? e : new Ci.Vector3,
  38233. this.end = void 0 !== t ? t : new Ci.Vector3
  38234. }
  38235. ,
  38236. Ci.Line3.prototype = {
  38237. constructor: Ci.Line3,
  38238. set: function(e, t) {
  38239. return this.start.copy(e),
  38240. this.end.copy(t),
  38241. this
  38242. },
  38243. clone: function() {
  38244. return (new this.constructor).copy(this)
  38245. },
  38246. copy: function(e) {
  38247. return this.start.copy(e.start),
  38248. this.end.copy(e.end),
  38249. this
  38250. },
  38251. center: function(e) {
  38252. return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
  38253. },
  38254. delta: function(e) {
  38255. return (e || new Ci.Vector3).subVectors(this.end, this.start)
  38256. },
  38257. distanceSq: function() {
  38258. return this.start.distanceToSquared(this.end)
  38259. },
  38260. distance: function() {
  38261. return this.start.distanceTo(this.end)
  38262. },
  38263. at: function(e, t) {
  38264. var i = t || new Ci.Vector3;
  38265. return this.delta(i).multiplyScalar(e).add(this.start)
  38266. },
  38267. closestPointToPointParameter: (Ae = new Ci.Vector3,
  38268. Ce = new Ci.Vector3,
  38269. function(e, t) {
  38270. Ae.subVectors(e, this.start),
  38271. Ce.subVectors(this.end, this.start);
  38272. var i = Ce.dot(Ce)
  38273. , n = Ce.dot(Ae) / i;
  38274. return t && (n = Ci.Math.clamp(n, 0, 1)),
  38275. n
  38276. }
  38277. ),
  38278. closestPointToPoint: function(e, t, i) {
  38279. var n = this.closestPointToPointParameter(e, t)
  38280. , r = i || new Ci.Vector3;
  38281. return this.delta(r).multiplyScalar(n).add(this.start)
  38282. },
  38283. applyMatrix4: function(e) {
  38284. return this.start.applyMatrix4(e),
  38285. this.end.applyMatrix4(e),
  38286. this
  38287. },
  38288. equals: function(e) {
  38289. return e.start.equals(this.start) && e.end.equals(this.end)
  38290. }
  38291. },
  38292. Ci.Box2 = function(e, t) {
  38293. this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
  38294. this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
  38295. }
  38296. ,
  38297. Ci.Box2.prototype = {
  38298. constructor: Ci.Box2,
  38299. set: function(e, t) {
  38300. return this.min.copy(e),
  38301. this.max.copy(t),
  38302. this
  38303. },
  38304. setFromPoints: function(e) {
  38305. this.makeEmpty();
  38306. for (var t = 0, i = e.length; t < i; t++)
  38307. this.expandByPoint(e[t]);
  38308. return this
  38309. },
  38310. setFromCenterAndSize: (ye = new Ci.Vector2,
  38311. function(e, t) {
  38312. var i = ye.copy(t).multiplyScalar(.5);
  38313. return this.min.copy(e).sub(i),
  38314. this.max.copy(e).add(i),
  38315. this
  38316. }
  38317. ),
  38318. clone: function() {
  38319. return (new this.constructor).copy(this)
  38320. },
  38321. copy: function(e) {
  38322. return this.min.copy(e.min),
  38323. this.max.copy(e.max),
  38324. this
  38325. },
  38326. makeEmpty: function() {
  38327. return this.min.x = this.min.y = 1 / 0,
  38328. this.max.x = this.max.y = -1 / 0,
  38329. this
  38330. },
  38331. isEmpty: function() {
  38332. return this.max.x < this.min.x || this.max.y < this.min.y
  38333. },
  38334. center: function(e) {
  38335. return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
  38336. },
  38337. size: function(e) {
  38338. return (e || new Ci.Vector2).subVectors(this.max, this.min)
  38339. },
  38340. expandByPoint: function(e) {
  38341. return this.min.min(e),
  38342. this.max.max(e),
  38343. this
  38344. },
  38345. expandByVector: function(e) {
  38346. return this.min.sub(e),
  38347. this.max.add(e),
  38348. this
  38349. },
  38350. expandByScalar: function(e) {
  38351. return this.min.addScalar(-e),
  38352. this.max.addScalar(e),
  38353. this
  38354. },
  38355. containsPoint: function(e) {
  38356. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  38357. },
  38358. containsBox: function(e) {
  38359. 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
  38360. },
  38361. getParameter: function(e, t) {
  38362. 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))
  38363. },
  38364. intersectsBox: function(e) {
  38365. 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)
  38366. },
  38367. clampPoint: function(e, t) {
  38368. return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
  38369. },
  38370. distanceToPoint: (ve = new Ci.Vector2,
  38371. function(e) {
  38372. return ve.copy(e).clamp(this.min, this.max).sub(e).length()
  38373. }
  38374. ),
  38375. intersect: function(e) {
  38376. return this.min.max(e.min),
  38377. this.max.min(e.max),
  38378. this
  38379. },
  38380. union: function(e) {
  38381. return this.min.min(e.min),
  38382. this.max.max(e.max),
  38383. this
  38384. },
  38385. translate: function(e) {
  38386. return this.min.add(e),
  38387. this.max.add(e),
  38388. this
  38389. },
  38390. equals: function(e) {
  38391. return e.min.equals(this.min) && e.max.equals(this.max)
  38392. }
  38393. },
  38394. Ci.Box3 = function(e, t) {
  38395. this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
  38396. this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
  38397. }
  38398. ,
  38399. Ci.Box3.prototype = {
  38400. constructor: Ci.Box3,
  38401. set: function(e, t) {
  38402. return this.min.copy(e),
  38403. this.max.copy(t),
  38404. this
  38405. },
  38406. setFromArray: function(e) {
  38407. this.makeEmpty();
  38408. 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) {
  38409. var c = e[s]
  38410. , h = e[s + 1]
  38411. , u = e[s + 2];
  38412. c < t && (t = c),
  38413. h < i && (i = h),
  38414. u < n && (n = u),
  38415. r < c && (r = c),
  38416. o < h && (o = h),
  38417. a < u && (a = u)
  38418. }
  38419. this.min.set(t, i, n),
  38420. this.max.set(r, o, a)
  38421. },
  38422. setFromPoints: function(e) {
  38423. this.makeEmpty();
  38424. for (var t = 0, i = e.length; t < i; t++)
  38425. this.expandByPoint(e[t]);
  38426. return this
  38427. },
  38428. setFromCenterAndSize: (me = new Ci.Vector3,
  38429. function(e, t) {
  38430. var i = me.copy(t).multiplyScalar(.5);
  38431. return this.min.copy(e).sub(i),
  38432. this.max.copy(e).add(i),
  38433. this
  38434. }
  38435. ),
  38436. setFromObject: function(e) {
  38437. void 0 === ge && (ge = new Ci.Box3);
  38438. var i = this;
  38439. return this.makeEmpty(),
  38440. e.updateMatrixWorld(!0),
  38441. e.traverse(function(e) {
  38442. var t = e.geometry;
  38443. void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
  38444. !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
  38445. ge.applyMatrix4(e.matrixWorld),
  38446. i.union(ge)))
  38447. }),
  38448. this
  38449. },
  38450. clone: function() {
  38451. return (new this.constructor).copy(this)
  38452. },
  38453. copy: function(e) {
  38454. return this.min.copy(e.min),
  38455. this.max.copy(e.max),
  38456. this
  38457. },
  38458. makeEmpty: function() {
  38459. return this.min.x = this.min.y = this.min.z = 1 / 0,
  38460. this.max.x = this.max.y = this.max.z = -1 / 0,
  38461. this
  38462. },
  38463. isEmpty: function() {
  38464. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  38465. },
  38466. center: function(e) {
  38467. return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
  38468. },
  38469. size: function(e) {
  38470. return (e || new Ci.Vector3).subVectors(this.max, this.min)
  38471. },
  38472. expandByPoint: function(e) {
  38473. return this.min.min(e),
  38474. this.max.max(e),
  38475. this
  38476. },
  38477. expandByVector: function(e) {
  38478. return this.min.sub(e),
  38479. this.max.add(e),
  38480. this
  38481. },
  38482. expandByScalar: function(e) {
  38483. return this.min.addScalar(-e),
  38484. this.max.addScalar(e),
  38485. this
  38486. },
  38487. containsPoint: function(e) {
  38488. 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)
  38489. },
  38490. containsBox: function(e) {
  38491. 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
  38492. },
  38493. getParameter: function(e, t) {
  38494. 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))
  38495. },
  38496. intersectsBox: function(e) {
  38497. 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)
  38498. },
  38499. intersectsSphere: function(e) {
  38500. return void 0 === fe && (fe = new Ci.Vector3),
  38501. this.clampPoint(e.center, fe),
  38502. fe.distanceToSquared(e.center) <= e.radius * e.radius
  38503. },
  38504. intersectsPlane: function(e) {
  38505. var t, i;
  38506. return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
  38507. e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  38508. e.normal.x * this.min.x),
  38509. 0 < e.normal.y ? (t += e.normal.y * this.min.y,
  38510. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  38511. i += e.normal.y * this.min.y),
  38512. 0 < e.normal.z ? (t += e.normal.z * this.min.z,
  38513. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  38514. i += e.normal.z * this.min.z),
  38515. t <= e.constant && i >= e.constant
  38516. },
  38517. clampPoint: function(e, t) {
  38518. return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
  38519. },
  38520. distanceToPoint: (pe = new Ci.Vector3,
  38521. function(e) {
  38522. return pe.copy(e).clamp(this.min, this.max).sub(e).length()
  38523. }
  38524. ),
  38525. getBoundingSphere: (de = new Ci.Vector3,
  38526. function(e) {
  38527. var t = e || new Ci.Sphere;
  38528. return t.center = this.center(),
  38529. t.radius = .5 * this.size(de).length(),
  38530. t
  38531. }
  38532. ),
  38533. intersect: function(e) {
  38534. return this.min.max(e.min),
  38535. this.max.min(e.max),
  38536. this
  38537. },
  38538. union: function(e) {
  38539. return this.min.min(e.min),
  38540. this.max.max(e.max),
  38541. this
  38542. },
  38543. 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],
  38544. function(e) {
  38545. return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
  38546. ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
  38547. ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
  38548. ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
  38549. ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
  38550. ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
  38551. ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
  38552. ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
  38553. this.makeEmpty(),
  38554. this.setFromPoints(ue),
  38555. this
  38556. }
  38557. ),
  38558. translate: function(e) {
  38559. return this.min.add(e),
  38560. this.max.add(e),
  38561. this
  38562. },
  38563. equals: function(e) {
  38564. return e.min.equals(this.min) && e.max.equals(this.max)
  38565. }
  38566. },
  38567. Ci.Matrix3 = function() {
  38568. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  38569. 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  38570. }
  38571. ,
  38572. Ci.Matrix3.prototype = {
  38573. constructor: Ci.Matrix3,
  38574. set: function(e, t, i, n, r, o, a, s, l) {
  38575. var c = this.elements;
  38576. return c[0] = e,
  38577. c[1] = n,
  38578. c[2] = a,
  38579. c[3] = t,
  38580. c[4] = r,
  38581. c[5] = s,
  38582. c[6] = i,
  38583. c[7] = o,
  38584. c[8] = l,
  38585. this
  38586. },
  38587. identity: function() {
  38588. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  38589. this
  38590. },
  38591. clone: function() {
  38592. return (new this.constructor).fromArray(this.elements)
  38593. },
  38594. copy: function(e) {
  38595. var t = e.elements;
  38596. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  38597. this
  38598. },
  38599. setFromMatrix4: function(e) {
  38600. var t = e.elements;
  38601. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  38602. this
  38603. },
  38604. applyToVector3Array: function(e, t, i) {
  38605. void 0 === he && (he = new Ci.Vector3),
  38606. void 0 === t && (t = 0),
  38607. void 0 === i && (i = e.length);
  38608. for (var n = 0, r = t; n < i; n += 3,
  38609. r += 3)
  38610. he.fromArray(e, r),
  38611. he.applyMatrix3(this),
  38612. he.toArray(e, r);
  38613. return e
  38614. },
  38615. applyToBuffer: function(e, t, i) {
  38616. void 0 === ce && (ce = new Ci.Vector3),
  38617. void 0 === t && (t = 0),
  38618. void 0 === i && (i = e.length / e.itemSize);
  38619. for (var n = 0, r = t; n < i; n++,
  38620. r++)
  38621. ce.x = e.getX(r),
  38622. ce.y = e.getY(r),
  38623. ce.z = e.getZ(r),
  38624. ce.applyMatrix3(this),
  38625. e.setXYZ(ce.x, ce.y, ce.z);
  38626. return e
  38627. },
  38628. multiplyScalar: function(e) {
  38629. var t = this.elements;
  38630. return t[0] *= e,
  38631. t[3] *= e,
  38632. t[6] *= e,
  38633. t[1] *= e,
  38634. t[4] *= e,
  38635. t[7] *= e,
  38636. t[2] *= e,
  38637. t[5] *= e,
  38638. t[8] *= e,
  38639. this
  38640. },
  38641. determinant: function() {
  38642. var e = this.elements
  38643. , t = e[0]
  38644. , i = e[1]
  38645. , n = e[2]
  38646. , r = e[3]
  38647. , o = e[4]
  38648. , a = e[5]
  38649. , s = e[6]
  38650. , l = e[7]
  38651. , c = e[8];
  38652. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  38653. },
  38654. getInverse: function(e, t) {
  38655. e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  38656. var i = e.elements
  38657. , n = this.elements
  38658. , r = i[0]
  38659. , o = i[1]
  38660. , a = i[2]
  38661. , s = i[3]
  38662. , l = i[4]
  38663. , c = i[5]
  38664. , h = i[6]
  38665. , u = i[7]
  38666. , d = i[8]
  38667. , p = d * l - c * u
  38668. , f = c * h - d * s
  38669. , g = u * s - l * h
  38670. , m = r * p + o * f + a * g;
  38671. if (0 != m)
  38672. return n[0] = p,
  38673. n[1] = a * u - d * o,
  38674. n[2] = c * o - a * l,
  38675. n[3] = f,
  38676. n[4] = d * r - a * h,
  38677. n[5] = a * s - c * r,
  38678. n[6] = g,
  38679. n[7] = o * h - u * r,
  38680. n[8] = l * r - o * s,
  38681. this.multiplyScalar(1 / m);
  38682. var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  38683. if (t)
  38684. throw new Error(v);
  38685. return console.warn(v),
  38686. this.identity()
  38687. },
  38688. transpose: function() {
  38689. var e, t = this.elements;
  38690. return e = t[1],
  38691. t[1] = t[3],
  38692. t[3] = e,
  38693. e = t[2],
  38694. t[2] = t[6],
  38695. t[6] = e,
  38696. e = t[5],
  38697. t[5] = t[7],
  38698. t[7] = e,
  38699. this
  38700. },
  38701. flattenToArrayOffset: function(e, t) {
  38702. var i = this.elements;
  38703. return e[t] = i[0],
  38704. e[t + 1] = i[1],
  38705. e[t + 2] = i[2],
  38706. e[t + 3] = i[3],
  38707. e[t + 4] = i[4],
  38708. e[t + 5] = i[5],
  38709. e[t + 6] = i[6],
  38710. e[t + 7] = i[7],
  38711. e[t + 8] = i[8],
  38712. e
  38713. },
  38714. getNormalMatrix: function(e) {
  38715. return this.setFromMatrix4(e).getInverse(this).transpose()
  38716. },
  38717. transposeIntoArray: function(e) {
  38718. var t = this.elements;
  38719. return e[0] = t[0],
  38720. e[1] = t[3],
  38721. e[2] = t[6],
  38722. e[3] = t[1],
  38723. e[4] = t[4],
  38724. e[5] = t[7],
  38725. e[6] = t[2],
  38726. e[7] = t[5],
  38727. e[8] = t[8],
  38728. this
  38729. },
  38730. fromArray: function(e) {
  38731. return this.elements.set(e),
  38732. this
  38733. },
  38734. toArray: function() {
  38735. var e = this.elements;
  38736. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  38737. }
  38738. },
  38739. Ci.Matrix4 = function() {
  38740. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  38741. 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  38742. }
  38743. ,
  38744. Ci.Matrix4.prototype = {
  38745. constructor: Ci.Matrix4,
  38746. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  38747. var m = this.elements;
  38748. return m[0] = e,
  38749. m[4] = t,
  38750. m[8] = i,
  38751. m[12] = n,
  38752. m[1] = r,
  38753. m[5] = o,
  38754. m[9] = a,
  38755. m[13] = s,
  38756. m[2] = l,
  38757. m[6] = c,
  38758. m[10] = h,
  38759. m[14] = u,
  38760. m[3] = d,
  38761. m[7] = p,
  38762. m[11] = f,
  38763. m[15] = g,
  38764. this
  38765. },
  38766. identity: function() {
  38767. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  38768. this
  38769. },
  38770. clone: function() {
  38771. return (new Ci.Matrix4).fromArray(this.elements)
  38772. },
  38773. copy: function(e) {
  38774. return this.elements.set(e.elements),
  38775. this
  38776. },
  38777. copyPosition: function(e) {
  38778. var t = this.elements
  38779. , i = e.elements;
  38780. return t[12] = i[12],
  38781. t[13] = i[13],
  38782. t[14] = i[14],
  38783. this
  38784. },
  38785. extractBasis: function(e, t, i) {
  38786. return e.setFromMatrixColumn(this, 0),
  38787. t.setFromMatrixColumn(this, 1),
  38788. i.setFromMatrixColumn(this, 2),
  38789. this
  38790. },
  38791. makeBasis: function(e, t, i) {
  38792. 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),
  38793. this
  38794. },
  38795. extractRotation: function(e) {
  38796. void 0 === le && (le = new Ci.Vector3);
  38797. var t = this.elements
  38798. , i = e.elements
  38799. , n = 1 / le.setFromMatrixColumn(e, 0).length()
  38800. , r = 1 / le.setFromMatrixColumn(e, 1).length()
  38801. , o = 1 / le.setFromMatrixColumn(e, 2).length();
  38802. return t[0] = i[0] * n,
  38803. t[1] = i[1] * n,
  38804. t[2] = i[2] * n,
  38805. t[4] = i[4] * r,
  38806. t[5] = i[5] * r,
  38807. t[6] = i[6] * r,
  38808. t[8] = i[8] * o,
  38809. t[9] = i[9] * o,
  38810. t[10] = i[10] * o,
  38811. this
  38812. },
  38813. makeRotationFromEuler: function(e) {
  38814. e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  38815. var t = this.elements
  38816. , i = e.x
  38817. , n = e.y
  38818. , r = e.z
  38819. , o = Math.cos(i)
  38820. , a = Math.sin(i)
  38821. , s = Math.cos(n)
  38822. , l = Math.sin(n)
  38823. , c = Math.cos(r)
  38824. , h = Math.sin(r);
  38825. if ("XYZ" === e.order) {
  38826. var u = o * c
  38827. , d = o * h
  38828. , p = a * c
  38829. , f = a * h;
  38830. t[0] = s * c,
  38831. t[4] = -s * h,
  38832. t[8] = l,
  38833. t[1] = d + p * l,
  38834. t[5] = u - f * l,
  38835. t[9] = -a * s,
  38836. t[2] = f - u * l,
  38837. t[6] = p + d * l,
  38838. t[10] = o * s
  38839. } else if ("YXZ" === e.order) {
  38840. var g = s * c
  38841. , m = s * h
  38842. , v = l * c
  38843. , y = l * h;
  38844. t[0] = g + y * a,
  38845. t[4] = v * a - m,
  38846. t[8] = o * l,
  38847. t[1] = o * h,
  38848. t[5] = o * c,
  38849. t[9] = -a,
  38850. t[2] = m * a - v,
  38851. t[6] = y + g * a,
  38852. t[10] = o * s
  38853. } else if ("ZXY" === e.order) {
  38854. g = s * c,
  38855. m = s * h,
  38856. v = l * c,
  38857. y = l * h;
  38858. t[0] = g - y * a,
  38859. t[4] = -o * h,
  38860. t[8] = v + m * a,
  38861. t[1] = m + v * a,
  38862. t[5] = o * c,
  38863. t[9] = y - g * a,
  38864. t[2] = -o * l,
  38865. t[6] = a,
  38866. t[10] = o * s
  38867. } else if ("ZYX" === e.order) {
  38868. u = o * c,
  38869. d = o * h,
  38870. p = a * c,
  38871. f = a * h;
  38872. t[0] = s * c,
  38873. t[4] = p * l - d,
  38874. t[8] = u * l + f,
  38875. t[1] = s * h,
  38876. t[5] = f * l + u,
  38877. t[9] = d * l - p,
  38878. t[2] = -l,
  38879. t[6] = a * s,
  38880. t[10] = o * s
  38881. } else if ("YZX" === e.order) {
  38882. var A = o * s
  38883. , C = o * l
  38884. , I = a * s
  38885. , E = a * l;
  38886. t[0] = s * c,
  38887. t[4] = E - A * h,
  38888. t[8] = I * h + C,
  38889. t[1] = h,
  38890. t[5] = o * c,
  38891. t[9] = -a * c,
  38892. t[2] = -l * c,
  38893. t[6] = C * h + I,
  38894. t[10] = A - E * h
  38895. } else if ("XZY" === e.order) {
  38896. A = o * s,
  38897. C = o * l,
  38898. I = a * s,
  38899. E = a * l;
  38900. t[0] = s * c,
  38901. t[4] = -h,
  38902. t[8] = l * c,
  38903. t[1] = A * h + E,
  38904. t[5] = o * c,
  38905. t[9] = C * h - I,
  38906. t[2] = I * h - C,
  38907. t[6] = a * c,
  38908. t[10] = E * h + A
  38909. }
  38910. return t[3] = 0,
  38911. t[7] = 0,
  38912. t[11] = 0,
  38913. t[12] = 0,
  38914. t[13] = 0,
  38915. t[14] = 0,
  38916. t[15] = 1,
  38917. this
  38918. },
  38919. makeRotationFromQuaternion: function(e) {
  38920. var t = this.elements
  38921. , i = e.x
  38922. , n = e.y
  38923. , r = e.z
  38924. , o = e.w
  38925. , a = i + i
  38926. , s = n + n
  38927. , l = r + r
  38928. , c = i * a
  38929. , h = i * s
  38930. , u = i * l
  38931. , d = n * s
  38932. , p = n * l
  38933. , f = r * l
  38934. , g = o * a
  38935. , m = o * s
  38936. , v = o * l;
  38937. return t[0] = 1 - (d + f),
  38938. t[4] = h - v,
  38939. t[8] = u + m,
  38940. t[1] = h + v,
  38941. t[5] = 1 - (c + f),
  38942. t[9] = p - g,
  38943. t[2] = u - m,
  38944. t[6] = p + g,
  38945. t[10] = 1 - (c + d),
  38946. t[3] = 0,
  38947. t[7] = 0,
  38948. t[11] = 0,
  38949. t[12] = 0,
  38950. t[13] = 0,
  38951. t[14] = 0,
  38952. t[15] = 1,
  38953. this
  38954. },
  38955. lookAt: function(e, t, i) {
  38956. void 0 === oe && (oe = new Ci.Vector3),
  38957. void 0 === ae && (ae = new Ci.Vector3),
  38958. void 0 === se && (se = new Ci.Vector3);
  38959. var n = this.elements;
  38960. return se.subVectors(e, t).normalize(),
  38961. 0 === se.lengthSq() && (se.z = 1),
  38962. oe.crossVectors(i, se).normalize(),
  38963. 0 === oe.lengthSq() && (se.x += 1e-4,
  38964. oe.crossVectors(i, se).normalize()),
  38965. ae.crossVectors(se, oe),
  38966. n[0] = oe.x,
  38967. n[4] = ae.x,
  38968. n[8] = se.x,
  38969. n[1] = oe.y,
  38970. n[5] = ae.y,
  38971. n[9] = se.y,
  38972. n[2] = oe.z,
  38973. n[6] = ae.z,
  38974. n[10] = se.z,
  38975. this
  38976. },
  38977. multiply: function(e, t) {
  38978. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  38979. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  38980. },
  38981. multiplyMatrices: function(e, t) {
  38982. var i = e.elements
  38983. , n = t.elements
  38984. , r = this.elements
  38985. , o = i[0]
  38986. , a = i[4]
  38987. , s = i[8]
  38988. , l = i[12]
  38989. , c = i[1]
  38990. , h = i[5]
  38991. , u = i[9]
  38992. , d = i[13]
  38993. , p = i[2]
  38994. , f = i[6]
  38995. , g = i[10]
  38996. , m = i[14]
  38997. , v = i[3]
  38998. , y = i[7]
  38999. , A = i[11]
  39000. , C = i[15]
  39001. , I = n[0]
  39002. , E = n[4]
  39003. , _ = n[8]
  39004. , b = n[12]
  39005. , w = n[1]
  39006. , T = n[5]
  39007. , x = n[9]
  39008. , S = n[13]
  39009. , M = n[2]
  39010. , R = n[6]
  39011. , P = n[10]
  39012. , O = n[14]
  39013. , L = n[3]
  39014. , D = n[7]
  39015. , N = n[11]
  39016. , F = n[15];
  39017. return r[0] = o * I + a * w + s * M + l * L,
  39018. r[4] = o * E + a * T + s * R + l * D,
  39019. r[8] = o * _ + a * x + s * P + l * N,
  39020. r[12] = o * b + a * S + s * O + l * F,
  39021. r[1] = c * I + h * w + u * M + d * L,
  39022. r[5] = c * E + h * T + u * R + d * D,
  39023. r[9] = c * _ + h * x + u * P + d * N,
  39024. r[13] = c * b + h * S + u * O + d * F,
  39025. r[2] = p * I + f * w + g * M + m * L,
  39026. r[6] = p * E + f * T + g * R + m * D,
  39027. r[10] = p * _ + f * x + g * P + m * N,
  39028. r[14] = p * b + f * S + g * O + m * F,
  39029. r[3] = v * I + y * w + A * M + C * L,
  39030. r[7] = v * E + y * T + A * R + C * D,
  39031. r[11] = v * _ + y * x + A * P + C * N,
  39032. r[15] = v * b + y * S + A * O + C * F,
  39033. this
  39034. },
  39035. multiplyToArray: function(e, t, i) {
  39036. var n = this.elements;
  39037. return this.multiplyMatrices(e, t),
  39038. i[0] = n[0],
  39039. i[1] = n[1],
  39040. i[2] = n[2],
  39041. i[3] = n[3],
  39042. i[4] = n[4],
  39043. i[5] = n[5],
  39044. i[6] = n[6],
  39045. i[7] = n[7],
  39046. i[8] = n[8],
  39047. i[9] = n[9],
  39048. i[10] = n[10],
  39049. i[11] = n[11],
  39050. i[12] = n[12],
  39051. i[13] = n[13],
  39052. i[14] = n[14],
  39053. i[15] = n[15],
  39054. this
  39055. },
  39056. multiplyScalar: function(e) {
  39057. var t = this.elements;
  39058. return t[0] *= e,
  39059. t[4] *= e,
  39060. t[8] *= e,
  39061. t[12] *= e,
  39062. t[1] *= e,
  39063. t[5] *= e,
  39064. t[9] *= e,
  39065. t[13] *= e,
  39066. t[2] *= e,
  39067. t[6] *= e,
  39068. t[10] *= e,
  39069. t[14] *= e,
  39070. t[3] *= e,
  39071. t[7] *= e,
  39072. t[11] *= e,
  39073. t[15] *= e,
  39074. this
  39075. },
  39076. applyToVector3Array: function(e, t, i) {
  39077. void 0 === re && (re = new Ci.Vector3),
  39078. void 0 === t && (t = 0),
  39079. void 0 === i && (i = e.length);
  39080. for (var n = 0, r = t; n < i; n += 3,
  39081. r += 3)
  39082. re.fromArray(e, r),
  39083. re.applyMatrix4(this),
  39084. re.toArray(e, r);
  39085. return e
  39086. },
  39087. applyToBuffer: function(e, t, i) {
  39088. void 0 === ne && (ne = new Ci.Vector3),
  39089. void 0 === t && (t = 0),
  39090. void 0 === i && (i = e.length / e.itemSize);
  39091. for (var n = 0, r = t; n < i; n++,
  39092. r++)
  39093. ne.x = e.getX(r),
  39094. ne.y = e.getY(r),
  39095. ne.z = e.getZ(r),
  39096. ne.applyMatrix4(this),
  39097. e.setXYZ(ne.x, ne.y, ne.z);
  39098. return e
  39099. },
  39100. determinant: function() {
  39101. var e = this.elements
  39102. , t = e[0]
  39103. , i = e[4]
  39104. , n = e[8]
  39105. , r = e[12]
  39106. , o = e[1]
  39107. , a = e[5]
  39108. , s = e[9]
  39109. , l = e[13]
  39110. , c = e[2]
  39111. , h = e[6]
  39112. , u = e[10]
  39113. , d = e[14];
  39114. 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)
  39115. },
  39116. transpose: function() {
  39117. var e, t = this.elements;
  39118. return e = t[1],
  39119. t[1] = t[4],
  39120. t[4] = e,
  39121. e = t[2],
  39122. t[2] = t[8],
  39123. t[8] = e,
  39124. e = t[6],
  39125. t[6] = t[9],
  39126. t[9] = e,
  39127. e = t[3],
  39128. t[3] = t[12],
  39129. t[12] = e,
  39130. e = t[7],
  39131. t[7] = t[13],
  39132. t[13] = e,
  39133. e = t[11],
  39134. t[11] = t[14],
  39135. t[14] = e,
  39136. this
  39137. },
  39138. flattenToArrayOffset: function(e, t) {
  39139. var i = this.elements;
  39140. return e[t] = i[0],
  39141. e[t + 1] = i[1],
  39142. e[t + 2] = i[2],
  39143. e[t + 3] = i[3],
  39144. e[t + 4] = i[4],
  39145. e[t + 5] = i[5],
  39146. e[t + 6] = i[6],
  39147. e[t + 7] = i[7],
  39148. e[t + 8] = i[8],
  39149. e[t + 9] = i[9],
  39150. e[t + 10] = i[10],
  39151. e[t + 11] = i[11],
  39152. e[t + 12] = i[12],
  39153. e[t + 13] = i[13],
  39154. e[t + 14] = i[14],
  39155. e[t + 15] = i[15],
  39156. e
  39157. },
  39158. getPosition: function() {
  39159. return void 0 === ie && (ie = new Ci.Vector3),
  39160. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39161. ie.setFromMatrixColumn(this, 3)
  39162. },
  39163. setPosition: function(e) {
  39164. var t = this.elements;
  39165. return t[12] = e.x,
  39166. t[13] = e.y,
  39167. t[14] = e.z,
  39168. this
  39169. },
  39170. getInverse: function(e, t) {
  39171. var i = this.elements
  39172. , n = e.elements
  39173. , r = n[0]
  39174. , o = n[1]
  39175. , a = n[2]
  39176. , s = n[3]
  39177. , l = n[4]
  39178. , c = n[5]
  39179. , h = n[6]
  39180. , u = n[7]
  39181. , d = n[8]
  39182. , p = n[9]
  39183. , f = n[10]
  39184. , g = n[11]
  39185. , m = n[12]
  39186. , v = n[13]
  39187. , y = n[14]
  39188. , A = n[15]
  39189. , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
  39190. , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
  39191. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
  39192. , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
  39193. , b = r * C + o * I + a * E + s * _;
  39194. if (0 != b)
  39195. return i[0] = C,
  39196. i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
  39197. i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
  39198. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39199. i[4] = I,
  39200. i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
  39201. i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
  39202. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39203. i[8] = E,
  39204. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
  39205. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
  39206. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39207. i[12] = _,
  39208. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
  39209. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
  39210. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  39211. this.multiplyScalar(1 / b);
  39212. var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  39213. if (t)
  39214. throw new Error(w);
  39215. return console.warn(w),
  39216. this.identity()
  39217. },
  39218. scale: function(e) {
  39219. var t = this.elements
  39220. , i = e.x
  39221. , n = e.y
  39222. , r = e.z;
  39223. return t[0] *= i,
  39224. t[4] *= n,
  39225. t[8] *= r,
  39226. t[1] *= i,
  39227. t[5] *= n,
  39228. t[9] *= r,
  39229. t[2] *= i,
  39230. t[6] *= n,
  39231. t[10] *= r,
  39232. t[3] *= i,
  39233. t[7] *= n,
  39234. t[11] *= r,
  39235. this
  39236. },
  39237. getMaxScaleOnAxis: function() {
  39238. var e = this.elements
  39239. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  39240. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  39241. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  39242. return Math.sqrt(Math.max(t, i, n))
  39243. },
  39244. makeTranslation: function(e, t, i) {
  39245. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  39246. this
  39247. },
  39248. makeRotationX: function(e) {
  39249. var t = Math.cos(e)
  39250. , i = Math.sin(e);
  39251. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  39252. this
  39253. },
  39254. makeRotationY: function(e) {
  39255. var t = Math.cos(e)
  39256. , i = Math.sin(e);
  39257. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  39258. this
  39259. },
  39260. makeRotationZ: function(e) {
  39261. var t = Math.cos(e)
  39262. , i = Math.sin(e);
  39263. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39264. this
  39265. },
  39266. makeRotationAxis: function(e, t) {
  39267. var i = Math.cos(t)
  39268. , n = Math.sin(t)
  39269. , r = 1 - i
  39270. , o = e.x
  39271. , a = e.y
  39272. , s = e.z
  39273. , l = r * o
  39274. , c = r * a;
  39275. 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),
  39276. this
  39277. },
  39278. makeScale: function(e, t, i) {
  39279. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  39280. this
  39281. },
  39282. compose: function(e, t, i) {
  39283. return this.makeRotationFromQuaternion(t),
  39284. this.scale(i),
  39285. this.setPosition(e),
  39286. this
  39287. },
  39288. decompose: function(e, t, i) {
  39289. void 0 === ee && (ee = new Ci.Vector3),
  39290. void 0 === te && (te = new Ci.Matrix4);
  39291. var n = this.elements
  39292. , r = ee.set(n[0], n[1], n[2]).length()
  39293. , o = ee.set(n[4], n[5], n[6]).length()
  39294. , a = ee.set(n[8], n[9], n[10]).length();
  39295. this.determinant() < 0 && (r = -r),
  39296. e.x = n[12],
  39297. e.y = n[13],
  39298. e.z = n[14],
  39299. te.elements.set(this.elements);
  39300. var s = 1 / r
  39301. , l = 1 / o
  39302. , c = 1 / a;
  39303. return te.elements[0] *= s,
  39304. te.elements[1] *= s,
  39305. te.elements[2] *= s,
  39306. te.elements[4] *= l,
  39307. te.elements[5] *= l,
  39308. te.elements[6] *= l,
  39309. te.elements[8] *= c,
  39310. te.elements[9] *= c,
  39311. te.elements[10] *= c,
  39312. t.setFromRotationMatrix(te),
  39313. i.x = r,
  39314. i.y = o,
  39315. i.z = a,
  39316. this
  39317. },
  39318. makeFrustum: function(e, t, i, n, r, o) {
  39319. var a = this.elements
  39320. , s = 2 * r / (t - e)
  39321. , l = 2 * r / (n - i)
  39322. , c = (t + e) / (t - e)
  39323. , h = (n + i) / (n - i)
  39324. , u = -(o + r) / (o - r)
  39325. , d = -2 * o * r / (o - r);
  39326. return a[0] = s,
  39327. a[4] = 0,
  39328. a[8] = c,
  39329. a[12] = 0,
  39330. a[1] = 0,
  39331. a[5] = l,
  39332. a[9] = h,
  39333. a[13] = 0,
  39334. a[2] = 0,
  39335. a[6] = 0,
  39336. a[10] = u,
  39337. a[14] = d,
  39338. a[3] = 0,
  39339. a[7] = 0,
  39340. a[11] = -1,
  39341. a[15] = 0,
  39342. this
  39343. },
  39344. makePerspective: function(e, t, i, n) {
  39345. var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
  39346. , o = -r
  39347. , a = o * t
  39348. , s = r * t;
  39349. return this.makeFrustum(a, s, o, r, i, n)
  39350. },
  39351. makeOrthographic: function(e, t, i, n, r, o) {
  39352. var a = this.elements
  39353. , s = 1 / (t - e)
  39354. , l = 1 / (i - n)
  39355. , c = 1 / (o - r)
  39356. , h = (t + e) * s
  39357. , u = (i + n) * l
  39358. , d = (o + r) * c;
  39359. return a[0] = 2 * s,
  39360. a[4] = 0,
  39361. a[8] = 0,
  39362. a[12] = -h,
  39363. a[1] = 0,
  39364. a[5] = 2 * l,
  39365. a[9] = 0,
  39366. a[13] = -u,
  39367. a[2] = 0,
  39368. a[6] = 0,
  39369. a[10] = -2 * c,
  39370. a[14] = -d,
  39371. a[3] = 0,
  39372. a[7] = 0,
  39373. a[11] = 0,
  39374. a[15] = 1,
  39375. this
  39376. },
  39377. equals: function(e) {
  39378. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  39379. if (t[n] !== i[n])
  39380. return !1;
  39381. return !0
  39382. },
  39383. fromArray: function(e) {
  39384. return this.elements.set(e),
  39385. this
  39386. },
  39387. toArray: function() {
  39388. var e = this.elements;
  39389. 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]]
  39390. }
  39391. },
  39392. Ci.Ray = function(e, t) {
  39393. this.origin = void 0 !== e ? e : new Ci.Vector3,
  39394. this.direction = void 0 !== t ? t : new Ci.Vector3
  39395. }
  39396. ,
  39397. Ci.Ray.prototype = {
  39398. constructor: Ci.Ray,
  39399. set: function(e, t) {
  39400. return this.origin.copy(e),
  39401. this.direction.copy(t),
  39402. this
  39403. },
  39404. clone: function() {
  39405. return (new this.constructor).copy(this)
  39406. },
  39407. copy: function(e) {
  39408. return this.origin.copy(e.origin),
  39409. this.direction.copy(e.direction),
  39410. this
  39411. },
  39412. at: function(e, t) {
  39413. return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
  39414. },
  39415. lookAt: function(e) {
  39416. this.direction.copy(e).sub(this.origin).normalize()
  39417. },
  39418. recast: ($ = new Ci.Vector3,
  39419. function(e) {
  39420. return this.origin.copy(this.at(e, $)),
  39421. this
  39422. }
  39423. ),
  39424. closestPointToPoint: function(e, t) {
  39425. var i = t || new Ci.Vector3;
  39426. i.subVectors(e, this.origin);
  39427. var n = i.dot(this.direction);
  39428. return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
  39429. },
  39430. distanceToPoint: function(e) {
  39431. return Math.sqrt(this.distanceSqToPoint(e))
  39432. },
  39433. distanceSqToPoint: (J = new Ci.Vector3,
  39434. function(e) {
  39435. var t = J.subVectors(e, this.origin).dot(this.direction);
  39436. return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
  39437. J.distanceToSquared(e))
  39438. }
  39439. ),
  39440. distanceSqToSegment: (Z = new Ci.Vector3,
  39441. K = new Ci.Vector3,
  39442. Q = new Ci.Vector3,
  39443. function(e, t, i, n) {
  39444. Z.copy(e).add(t).multiplyScalar(.5),
  39445. K.copy(t).sub(e).normalize(),
  39446. Q.copy(this.origin).sub(Z);
  39447. 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);
  39448. if (0 < p)
  39449. if (o = c * h - u,
  39450. s = l * p,
  39451. 0 <= (r = c * u - h))
  39452. if (-s <= o)
  39453. if (o <= s) {
  39454. var f = 1 / p;
  39455. a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
  39456. } else
  39457. o = l,
  39458. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39459. else
  39460. o = -l,
  39461. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39462. else
  39463. 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,
  39464. (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;
  39465. else
  39466. o = 0 < c ? -l : l,
  39467. a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
  39468. return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
  39469. n && n.copy(K).multiplyScalar(o).add(Z),
  39470. a
  39471. }
  39472. ),
  39473. intersectSphere: (X = new Ci.Vector3,
  39474. function(e, t) {
  39475. X.subVectors(e.center, this.origin);
  39476. var i = X.dot(this.direction)
  39477. , n = X.dot(X) - i * i
  39478. , r = e.radius * e.radius;
  39479. if (r < n)
  39480. return null;
  39481. var o = Math.sqrt(r - n)
  39482. , a = i - o
  39483. , s = i + o;
  39484. return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
  39485. }
  39486. ),
  39487. intersectsSphere: function(e) {
  39488. return this.distanceToPoint(e.center) <= e.radius
  39489. },
  39490. distanceToPlane: function(e) {
  39491. var t = e.normal.dot(this.direction);
  39492. if (0 === t)
  39493. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  39494. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  39495. return 0 <= i ? i : null
  39496. },
  39497. intersectPlane: function(e, t) {
  39498. var i = this.distanceToPlane(e);
  39499. return null === i ? null : this.at(i, t)
  39500. },
  39501. intersectsPlane: function(e) {
  39502. var t = e.distanceToPoint(this.origin);
  39503. return 0 === t || e.normal.dot(this.direction) * t < 0
  39504. },
  39505. intersectBox: function(e, t) {
  39506. 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;
  39507. return n = 0 <= l ? (i = (e.min.x - u.x) * l,
  39508. (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  39509. (e.min.x - u.x) * l),
  39510. (o = 0 <= c ? (r = (e.min.y - u.y) * c,
  39511. (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  39512. (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
  39513. (o < n || n != n) && (n = o),
  39514. (s = 0 <= h ? (a = (e.min.z - u.z) * h,
  39515. (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  39516. (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
  39517. (s < n || n != n) && (n = s),
  39518. n < 0 ? null : this.at(0 <= i ? i : n, t)))
  39519. },
  39520. intersectsBox: (q = new Ci.Vector3,
  39521. function(e) {
  39522. return null !== this.intersectBox(e, q)
  39523. }
  39524. ),
  39525. intersectTriangle: (G = new Ci.Vector3,
  39526. W = new Ci.Vector3,
  39527. j = new Ci.Vector3,
  39528. Y = new Ci.Vector3,
  39529. function(e, t, i, n, r) {
  39530. W.subVectors(t, e),
  39531. j.subVectors(i, e),
  39532. Y.crossVectors(W, j);
  39533. var o, a = this.direction.dot(Y);
  39534. if (0 < a) {
  39535. if (n)
  39536. return null;
  39537. o = 1
  39538. } else {
  39539. if (!(a < 0))
  39540. return null;
  39541. o = -1,
  39542. a = -a
  39543. }
  39544. G.subVectors(this.origin, e);
  39545. var s = o * this.direction.dot(j.crossVectors(G, j));
  39546. if (s < 0)
  39547. return null;
  39548. var l = o * this.direction.dot(W.cross(G));
  39549. if (l < 0)
  39550. return null;
  39551. if (a < s + l)
  39552. return null;
  39553. var c = -o * G.dot(Y);
  39554. return c < 0 ? null : this.at(c / a, r)
  39555. }
  39556. ),
  39557. applyMatrix4: function(e) {
  39558. return this.direction.add(this.origin).applyMatrix4(e),
  39559. this.origin.applyMatrix4(e),
  39560. this.direction.sub(this.origin),
  39561. this.direction.normalize(),
  39562. this
  39563. },
  39564. equals: function(e) {
  39565. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  39566. }
  39567. },
  39568. Ci.Sphere = function(e, t) {
  39569. this.center = void 0 !== e ? e : new Ci.Vector3,
  39570. this.radius = void 0 !== t ? t : 0
  39571. }
  39572. ,
  39573. Ci.Sphere.prototype = {
  39574. constructor: Ci.Sphere,
  39575. set: function(e, t) {
  39576. return this.center.copy(e),
  39577. this.radius = t,
  39578. this
  39579. },
  39580. setFromPoints: (z = new Ci.Box3,
  39581. function(e, t) {
  39582. var i = this.center;
  39583. void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
  39584. for (var n = 0, r = 0, o = e.length; r < o; r++)
  39585. n = Math.max(n, i.distanceToSquared(e[r]));
  39586. return this.radius = Math.sqrt(n),
  39587. this
  39588. }
  39589. ),
  39590. clone: function() {
  39591. return (new this.constructor).copy(this)
  39592. },
  39593. copy: function(e) {
  39594. return this.center.copy(e.center),
  39595. this.radius = e.radius,
  39596. this
  39597. },
  39598. empty: function() {
  39599. return this.radius <= 0
  39600. },
  39601. containsPoint: function(e) {
  39602. return e.distanceToSquared(this.center) <= this.radius * this.radius
  39603. },
  39604. distanceToPoint: function(e) {
  39605. return e.distanceTo(this.center) - this.radius
  39606. },
  39607. intersectsSphere: function(e) {
  39608. var t = this.radius + e.radius;
  39609. return e.center.distanceToSquared(this.center) <= t * t
  39610. },
  39611. intersectsBox: function(e) {
  39612. return e.intersectsSphere(this)
  39613. },
  39614. intersectsPlane: function(e) {
  39615. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  39616. },
  39617. clampPoint: function(e, t) {
  39618. var i = this.center.distanceToSquared(e)
  39619. , n = t || new Ci.Vector3;
  39620. return n.copy(e),
  39621. i > this.radius * this.radius && (n.sub(this.center).normalize(),
  39622. n.multiplyScalar(this.radius).add(this.center)),
  39623. n
  39624. },
  39625. getBoundingBox: function(e) {
  39626. var t = e || new Ci.Box3;
  39627. return t.set(this.center, this.center),
  39628. t.expandByScalar(this.radius),
  39629. t
  39630. },
  39631. applyMatrix4: function(e) {
  39632. return this.center.applyMatrix4(e),
  39633. this.radius = this.radius * e.getMaxScaleOnAxis(),
  39634. this
  39635. },
  39636. translate: function(e) {
  39637. return this.center.add(e),
  39638. this
  39639. },
  39640. equals: function(e) {
  39641. return e.center.equals(this.center) && e.radius === this.radius
  39642. }
  39643. },
  39644. Ci.Frustum = function(e, t, i, n, r, o) {
  39645. 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]
  39646. }
  39647. ,
  39648. Ci.Frustum.prototype = {
  39649. constructor: Ci.Frustum,
  39650. set: function(e, t, i, n, r, o) {
  39651. var a = this.planes;
  39652. return a[0].copy(e),
  39653. a[1].copy(t),
  39654. a[2].copy(i),
  39655. a[3].copy(n),
  39656. a[4].copy(r),
  39657. a[5].copy(o),
  39658. this
  39659. },
  39660. clone: function() {
  39661. return (new this.constructor).copy(this)
  39662. },
  39663. copy: function(e) {
  39664. for (var t = this.planes, i = 0; i < 6; i++)
  39665. t[i].copy(e.planes[i]);
  39666. return this
  39667. },
  39668. setFromMatrix: function(e) {
  39669. var t = this.planes
  39670. , i = e.elements
  39671. , n = i[0]
  39672. , r = i[1]
  39673. , o = i[2]
  39674. , a = i[3]
  39675. , s = i[4]
  39676. , l = i[5]
  39677. , c = i[6]
  39678. , h = i[7]
  39679. , u = i[8]
  39680. , d = i[9]
  39681. , p = i[10]
  39682. , f = i[11]
  39683. , g = i[12]
  39684. , m = i[13]
  39685. , v = i[14]
  39686. , y = i[15];
  39687. return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
  39688. t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
  39689. t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
  39690. t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
  39691. t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
  39692. t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
  39693. this
  39694. },
  39695. intersectsObject: (H = new Ci.Sphere,
  39696. function(e) {
  39697. var t = e.geometry;
  39698. return null === t.boundingSphere && t.computeBoundingSphere(),
  39699. H.copy(t.boundingSphere),
  39700. H.applyMatrix4(e.matrixWorld),
  39701. this.intersectsSphere(H)
  39702. }
  39703. ),
  39704. intersectsSphere: function(e) {
  39705. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  39706. if (t[r].distanceToPoint(i) < n)
  39707. return !1
  39708. }
  39709. return !0
  39710. },
  39711. intersectsBox: (k = new Ci.Vector3,
  39712. U = new Ci.Vector3,
  39713. function(e) {
  39714. for (var t = this.planes, i = 0; i < 6; i++) {
  39715. var n = t[i];
  39716. k.x = 0 < n.normal.x ? e.min.x : e.max.x,
  39717. U.x = 0 < n.normal.x ? e.max.x : e.min.x,
  39718. k.y = 0 < n.normal.y ? e.min.y : e.max.y,
  39719. U.y = 0 < n.normal.y ? e.max.y : e.min.y,
  39720. k.z = 0 < n.normal.z ? e.min.z : e.max.z,
  39721. U.z = 0 < n.normal.z ? e.max.z : e.min.z;
  39722. var r = n.distanceToPoint(k)
  39723. , o = n.distanceToPoint(U);
  39724. if (r < 0 && o < 0)
  39725. return !1
  39726. }
  39727. return !0
  39728. }
  39729. ),
  39730. containsPoint: function(e) {
  39731. for (var t = this.planes, i = 0; i < 6; i++)
  39732. if (t[i].distanceToPoint(e) < 0)
  39733. return !1;
  39734. return !0
  39735. }
  39736. },
  39737. Ci.Plane = function(e, t) {
  39738. this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
  39739. this.constant = void 0 !== t ? t : 0
  39740. }
  39741. ,
  39742. Ci.Plane.prototype = {
  39743. constructor: Ci.Plane,
  39744. set: function(e, t) {
  39745. return this.normal.copy(e),
  39746. this.constant = t,
  39747. this
  39748. },
  39749. setComponents: function(e, t, i, n) {
  39750. return this.normal.set(e, t, i),
  39751. this.constant = n,
  39752. this
  39753. },
  39754. setFromNormalAndCoplanarPoint: function(e, t) {
  39755. return this.normal.copy(e),
  39756. this.constant = -t.dot(this.normal),
  39757. this
  39758. },
  39759. setFromCoplanarPoints: (B = new Ci.Vector3,
  39760. V = new Ci.Vector3,
  39761. function(e, t, i) {
  39762. var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
  39763. return this.setFromNormalAndCoplanarPoint(n, e),
  39764. this
  39765. }
  39766. ),
  39767. clone: function() {
  39768. return (new this.constructor).copy(this)
  39769. },
  39770. copy: function(e) {
  39771. return this.normal.copy(e.normal),
  39772. this.constant = e.constant,
  39773. this
  39774. },
  39775. normalize: function() {
  39776. var e = 1 / this.normal.length();
  39777. return this.normal.multiplyScalar(e),
  39778. this.constant *= e,
  39779. this
  39780. },
  39781. negate: function() {
  39782. return this.constant *= -1,
  39783. this.normal.negate(),
  39784. this
  39785. },
  39786. distanceToPoint: function(e) {
  39787. return this.normal.dot(e) + this.constant
  39788. },
  39789. distanceToSphere: function(e) {
  39790. return this.distanceToPoint(e.center) - e.radius
  39791. },
  39792. projectPoint: function(e, t) {
  39793. return this.orthoPoint(e, t).sub(e).negate()
  39794. },
  39795. orthoPoint: function(e, t) {
  39796. var i = this.distanceToPoint(e);
  39797. return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
  39798. },
  39799. intersectLine: (F = new Ci.Vector3,
  39800. function(e, t) {
  39801. var i = t || new Ci.Vector3
  39802. , n = e.delta(F)
  39803. , r = this.normal.dot(n);
  39804. if (0 !== r) {
  39805. var o = -(e.start.dot(this.normal) + this.constant) / r;
  39806. if (!(o < 0 || 1 < o))
  39807. return i.copy(n).multiplyScalar(o).add(e.start)
  39808. } else if (0 === this.distanceToPoint(e.start))
  39809. return i.copy(e.start)
  39810. }
  39811. ),
  39812. intersectsLine: function(e) {
  39813. var t = this.distanceToPoint(e.start)
  39814. , i = this.distanceToPoint(e.end);
  39815. return t < 0 && 0 < i || i < 0 && 0 < t
  39816. },
  39817. intersectsBox: function(e) {
  39818. return e.intersectsPlane(this)
  39819. },
  39820. intersectsSphere: function(e) {
  39821. return e.intersectsPlane(this)
  39822. },
  39823. coplanarPoint: function(e) {
  39824. return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
  39825. },
  39826. applyMatrix4: (L = new Ci.Vector3,
  39827. D = new Ci.Vector3,
  39828. N = new Ci.Matrix3,
  39829. function(e, t) {
  39830. var i = t || N.getNormalMatrix(e)
  39831. , n = L.copy(this.normal).applyMatrix3(i)
  39832. , r = this.coplanarPoint(D);
  39833. return r.applyMatrix4(e),
  39834. this.setFromNormalAndCoplanarPoint(n, r),
  39835. this
  39836. }
  39837. ),
  39838. translate: function(e) {
  39839. return this.constant = this.constant - e.dot(this.normal),
  39840. this
  39841. },
  39842. equals: function(e) {
  39843. return e.normal.equals(this.normal) && e.constant === this.constant
  39844. }
  39845. },
  39846. Ci.Spherical = function(e, t, i) {
  39847. return this.radius = void 0 !== e ? e : 1,
  39848. this.phi = void 0 !== t ? t : 0,
  39849. this.theta = void 0 !== i ? i : 0,
  39850. this
  39851. }
  39852. ,
  39853. Ci.Spherical.prototype = {
  39854. constructor: Ci.Spherical,
  39855. set: function(e, t, i) {
  39856. this.radius = e,
  39857. this.phi = t,
  39858. this.theta = i
  39859. },
  39860. clone: function() {
  39861. return (new this.constructor).copy(this)
  39862. },
  39863. copy: function(e) {
  39864. return this.radius.copy(e.radius),
  39865. this.phi.copy(e.phi),
  39866. this.theta.copy(e.theta),
  39867. this
  39868. },
  39869. makeSafe: function() {
  39870. this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
  39871. },
  39872. setFromVector3: function(e) {
  39873. return this.radius = e.length(),
  39874. 0 === this.radius ? (this.theta = 0,
  39875. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  39876. this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
  39877. this
  39878. }
  39879. },
  39880. Ci.Math = {
  39881. generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
  39882. P = new Array(36),
  39883. O = 0,
  39884. function() {
  39885. for (var e = 0; e < 36; e++)
  39886. 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
  39887. M = 15 & O,
  39888. O >>= 4,
  39889. P[e] = R[19 === e ? 3 & M | 8 : M]);
  39890. return P.join("")
  39891. }
  39892. ),
  39893. clamp: function(e, t, i) {
  39894. return Math.max(t, Math.min(i, e))
  39895. },
  39896. euclideanModulo: function(e, t) {
  39897. return (e % t + t) % t
  39898. },
  39899. mapLinear: function(e, t, i, n, r) {
  39900. return n + (e - t) * (r - n) / (i - t)
  39901. },
  39902. smoothstep: function(e, t, i) {
  39903. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
  39904. },
  39905. smootherstep: function(e, t, i) {
  39906. return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
  39907. },
  39908. random16: function() {
  39909. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  39910. Math.random()
  39911. },
  39912. randInt: function(e, t) {
  39913. return e + Math.floor(Math.random() * (t - e + 1))
  39914. },
  39915. randFloat: function(e, t) {
  39916. return e + Math.random() * (t - e)
  39917. },
  39918. randFloatSpread: function(e) {
  39919. return e * (.5 - Math.random())
  39920. },
  39921. degToRad: (S = Math.PI / 180,
  39922. function(e) {
  39923. return e * S
  39924. }
  39925. ),
  39926. radToDeg: (x = 180 / Math.PI,
  39927. function(e) {
  39928. return e * x
  39929. }
  39930. ),
  39931. isPowerOfTwo: function(e) {
  39932. return 0 == (e & e - 1) && 0 !== e
  39933. },
  39934. nearestPowerOfTwo: function(e) {
  39935. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  39936. },
  39937. nextPowerOfTwo: function(e) {
  39938. return e--,
  39939. e |= e >> 1,
  39940. e |= e >> 2,
  39941. e |= e >> 4,
  39942. e |= e >> 8,
  39943. e |= e >> 16,
  39944. ++e
  39945. }
  39946. },
  39947. Ci.Spline = function(e) {
  39948. function t(e, t, i, n, r, o, a) {
  39949. var s = .5 * (i - e)
  39950. , l = .5 * (n - t);
  39951. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  39952. }
  39953. this.points = e;
  39954. var i, n, r, o, a, s, l, c, h, u = [], d = {
  39955. x: 0,
  39956. y: 0,
  39957. z: 0
  39958. };
  39959. this.initFromArray = function(e) {
  39960. this.points = [];
  39961. for (var t = 0; t < e.length; t++)
  39962. this.points[t] = {
  39963. x: e[t][0],
  39964. y: e[t][1],
  39965. z: e[t][2]
  39966. }
  39967. }
  39968. ,
  39969. this.getPoint = function(e) {
  39970. return i = (this.points.length - 1) * e,
  39971. n = Math.floor(i),
  39972. r = i - n,
  39973. u[0] = 0 === n ? n : n - 1,
  39974. u[1] = n,
  39975. u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
  39976. u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
  39977. s = this.points[u[0]],
  39978. l = this.points[u[1]],
  39979. c = this.points[u[2]],
  39980. h = this.points[u[3]],
  39981. a = r * (o = r * r),
  39982. d.x = t(s.x, l.x, c.x, h.x, r, o, a),
  39983. d.y = t(s.y, l.y, c.y, h.y, r, o, a),
  39984. d.z = t(s.z, l.z, c.z, h.z, r, o, a),
  39985. d
  39986. }
  39987. ,
  39988. this.getControlPointsArray = function() {
  39989. var e, t, i = this.points.length, n = [];
  39990. for (e = 0; e < i; e++)
  39991. t = this.points[e],
  39992. n[e] = [t.x, t.y, t.z];
  39993. return n
  39994. }
  39995. ,
  39996. this.getLength = function(e) {
  39997. var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
  39998. for (h[0] = 0,
  39999. e = e || 100,
  40000. n = this.points.length * e,
  40001. l.copy(this.points[0]),
  40002. t = 1; t < n; t++)
  40003. i = t / n,
  40004. r = this.getPoint(i),
  40005. c.copy(r),
  40006. u += c.distanceTo(l),
  40007. l.copy(r),
  40008. o = (this.points.length - 1) * i,
  40009. (a = Math.floor(o)) !== s && (h[a] = u,
  40010. s = a);
  40011. return h[h.length] = u,
  40012. {
  40013. chunks: h,
  40014. total: u
  40015. }
  40016. }
  40017. ,
  40018. this.reparametrizeByArcLength = function(e) {
  40019. var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
  40020. for (c.push(h.copy(this.points[0]).clone()),
  40021. t = 1; t < this.points.length; t++) {
  40022. for (a = u.chunks[t] - u.chunks[t - 1],
  40023. s = Math.ceil(e * a / u.total),
  40024. r = (t - 1) / (this.points.length - 1),
  40025. o = t / (this.points.length - 1),
  40026. i = 1; i < s - 1; i++)
  40027. n = r + i * (1 / s) * (o - r),
  40028. l = this.getPoint(n),
  40029. c.push(h.copy(l).clone());
  40030. c.push(h.copy(this.points[t]).clone())
  40031. }
  40032. this.points = c
  40033. }
  40034. }
  40035. ,
  40036. Ci.Triangle = function(e, t, i) {
  40037. this.a = void 0 !== e ? e : new Ci.Vector3,
  40038. this.b = void 0 !== t ? t : new Ci.Vector3,
  40039. this.c = void 0 !== i ? i : new Ci.Vector3
  40040. }
  40041. ,
  40042. Ci.Triangle.normal = (T = new Ci.Vector3,
  40043. function(e, t, i, n) {
  40044. var r = n || new Ci.Vector3;
  40045. r.subVectors(i, t),
  40046. T.subVectors(e, t),
  40047. r.cross(T);
  40048. var o = r.lengthSq();
  40049. return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
  40050. }
  40051. ),
  40052. Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
  40053. b = new Ci.Vector3,
  40054. w = new Ci.Vector3,
  40055. function(e, t, i, n, r) {
  40056. _.subVectors(n, t),
  40057. b.subVectors(i, t),
  40058. w.subVectors(e, t);
  40059. var o = _.dot(_)
  40060. , a = _.dot(b)
  40061. , s = _.dot(w)
  40062. , l = b.dot(b)
  40063. , c = b.dot(w)
  40064. , h = o * l - a * a
  40065. , u = r || new Ci.Vector3;
  40066. if (0 == h)
  40067. return u.set(-2, -1, -1);
  40068. var d = 1 / h
  40069. , p = (l * s - a * c) * d
  40070. , f = (o * c - a * s) * d;
  40071. return u.set(1 - p - f, f, p)
  40072. }
  40073. ),
  40074. Ci.Triangle.containsPoint = (E = new Ci.Vector3,
  40075. function(e, t, i, n) {
  40076. var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
  40077. return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
  40078. }
  40079. ),
  40080. Ci.Triangle.prototype = {
  40081. constructor: Ci.Triangle,
  40082. set: function(e, t, i) {
  40083. return this.a.copy(e),
  40084. this.b.copy(t),
  40085. this.c.copy(i),
  40086. this
  40087. },
  40088. setFromPointsAndIndices: function(e, t, i, n) {
  40089. return this.a.copy(e[t]),
  40090. this.b.copy(e[i]),
  40091. this.c.copy(e[n]),
  40092. this
  40093. },
  40094. clone: function() {
  40095. return (new this.constructor).copy(this)
  40096. },
  40097. copy: function(e) {
  40098. return this.a.copy(e.a),
  40099. this.b.copy(e.b),
  40100. this.c.copy(e.c),
  40101. this
  40102. },
  40103. area: (C = new Ci.Vector3,
  40104. I = new Ci.Vector3,
  40105. function() {
  40106. return C.subVectors(this.c, this.b),
  40107. I.subVectors(this.a, this.b),
  40108. .5 * C.cross(I).length()
  40109. }
  40110. ),
  40111. midpoint: function(e) {
  40112. return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40113. },
  40114. normal: function(e) {
  40115. return Ci.Triangle.normal(this.a, this.b, this.c, e)
  40116. },
  40117. plane: function(e) {
  40118. return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
  40119. },
  40120. barycoordFromPoint: function(e, t) {
  40121. return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40122. },
  40123. containsPoint: function(e) {
  40124. return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
  40125. },
  40126. equals: function(e) {
  40127. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40128. }
  40129. },
  40130. Ci.Interpolant = function(e, t, i, n) {
  40131. this.parameterPositions = e,
  40132. this._cachedIndex = 0,
  40133. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40134. this.sampleValues = t,
  40135. this.valueSize = i
  40136. }
  40137. ,
  40138. Ci.Interpolant.prototype = {
  40139. constructor: Ci.Interpolant,
  40140. evaluate: function(e) {
  40141. var t = this.parameterPositions
  40142. , i = this._cachedIndex
  40143. , n = t[i]
  40144. , r = t[i - 1];
  40145. e: {
  40146. t: {
  40147. var o;
  40148. i: {
  40149. n: if (!(e < n)) {
  40150. for (var a = i + 2; ; ) {
  40151. if (void 0 === n) {
  40152. if (e < r)
  40153. break n;
  40154. return i = t.length,
  40155. this._cachedIndex = i,
  40156. this.afterEnd_(i - 1, e, r)
  40157. }
  40158. if (i === a)
  40159. break;
  40160. if (r = n,
  40161. e < (n = t[++i]))
  40162. break t
  40163. }
  40164. o = t.length;
  40165. break i
  40166. }
  40167. if (r <= e)
  40168. break e;
  40169. var s = t[1];
  40170. e < s && (i = 2,
  40171. r = s);
  40172. for (a = i - 2; ; ) {
  40173. if (void 0 === r)
  40174. return this._cachedIndex = 0,
  40175. this.beforeStart_(0, e, n);
  40176. if (i === a)
  40177. break;
  40178. if (n = r,
  40179. (r = t[--i - 1]) <= e)
  40180. break t
  40181. }
  40182. o = i,
  40183. i = 0
  40184. }
  40185. for (; i < o; ) {
  40186. var l = i + o >>> 1;
  40187. e < t[l] ? o = l : i = 1 + l
  40188. }
  40189. if (n = t[i],
  40190. void 0 === (r = t[i - 1]))
  40191. return this._cachedIndex = 0,
  40192. this.beforeStart_(0, e, n);
  40193. if (void 0 === n)
  40194. return i = t.length,
  40195. this._cachedIndex = i,
  40196. this.afterEnd_(i - 1, r, e)
  40197. }
  40198. this._cachedIndex = i,
  40199. this.intervalChanged_(i, r, n)
  40200. }
  40201. return this.interpolate_(i, r, e, n)
  40202. },
  40203. settings: null,
  40204. DefaultSettings_: {},
  40205. getSettings_: function() {
  40206. return this.settings || this.DefaultSettings_
  40207. },
  40208. copySampleValue_: function(e) {
  40209. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  40210. t[o] = i[r + o];
  40211. return t
  40212. },
  40213. interpolate_: function(e, t, i, n) {
  40214. throw new Error("call to abstract method")
  40215. },
  40216. intervalChanged_: function(e, t, i) {}
  40217. },
  40218. Object.assign(Ci.Interpolant.prototype, {
  40219. beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
  40220. afterEnd_: Ci.Interpolant.prototype.copySampleValue_
  40221. }),
  40222. Ci.CubicInterpolant = function(e, t, i, n) {
  40223. Ci.Interpolant.call(this, e, t, i, n),
  40224. this._weightPrev = -0,
  40225. this._offsetPrev = -0,
  40226. this._weightNext = -0,
  40227. this._offsetNext = -0
  40228. }
  40229. ,
  40230. Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40231. constructor: Ci.CubicInterpolant,
  40232. DefaultSettings_: {
  40233. endingStart: Ci.ZeroCurvatureEnding,
  40234. endingEnd: Ci.ZeroCurvatureEnding
  40235. },
  40236. intervalChanged_: function(e, t, i) {
  40237. var n = this.parameterPositions
  40238. , r = e - 2
  40239. , o = e + 1
  40240. , a = n[r]
  40241. , s = n[o];
  40242. if (void 0 === a)
  40243. switch (this.getSettings_().endingStart) {
  40244. case Ci.ZeroSlopeEnding:
  40245. r = e,
  40246. a = 2 * t - i;
  40247. break;
  40248. case Ci.WrapAroundEnding:
  40249. a = t + n[r = n.length - 2] - n[r + 1];
  40250. break;
  40251. default:
  40252. r = e,
  40253. a = i
  40254. }
  40255. if (void 0 === s)
  40256. switch (this.getSettings_().endingEnd) {
  40257. case Ci.ZeroSlopeEnding:
  40258. o = e,
  40259. s = 2 * i - t;
  40260. break;
  40261. case Ci.WrapAroundEnding:
  40262. s = i + n[o = 1] - n[0];
  40263. break;
  40264. default:
  40265. o = e - 1,
  40266. s = t
  40267. }
  40268. var l = .5 * (i - t)
  40269. , c = this.valueSize;
  40270. this._weightPrev = l / (t - a),
  40271. this._weightNext = l / (s - i),
  40272. this._offsetPrev = r * c,
  40273. this._offsetNext = o * c
  40274. },
  40275. interpolate_: function(e, t, i, n) {
  40276. 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)
  40277. r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
  40278. return r
  40279. }
  40280. }),
  40281. Ci.DiscreteInterpolant = function(e, t, i, n) {
  40282. Ci.Interpolant.call(this, e, t, i, n)
  40283. }
  40284. ,
  40285. Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40286. constructor: Ci.DiscreteInterpolant,
  40287. interpolate_: function(e, t, i, n) {
  40288. return this.copySampleValue_(e - 1)
  40289. }
  40290. }),
  40291. Ci.LinearInterpolant = function(e, t, i, n) {
  40292. Ci.Interpolant.call(this, e, t, i, n)
  40293. }
  40294. ,
  40295. Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40296. constructor: Ci.LinearInterpolant,
  40297. interpolate_: function(e, t, i, n) {
  40298. 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)
  40299. r[u] = o[l + u] * h + o[s + u] * c;
  40300. return r
  40301. }
  40302. }),
  40303. Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
  40304. Ci.Interpolant.call(this, e, t, i, n)
  40305. }
  40306. ,
  40307. Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
  40308. constructor: Ci.QuaternionLinearInterpolant,
  40309. interpolate_: function(e, t, i, n) {
  40310. 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)
  40311. Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
  40312. return r
  40313. }
  40314. }),
  40315. Ci.Clock = function(e) {
  40316. this.autoStart = void 0 === e || e,
  40317. this.startTime = 0,
  40318. this.oldTime = 0,
  40319. this.elapsedTime = 0,
  40320. this.running = !1
  40321. }
  40322. ,
  40323. Ci.Clock.prototype = {
  40324. constructor: Ci.Clock,
  40325. start: function() {
  40326. this.startTime = performance.now(),
  40327. this.oldTime = this.startTime,
  40328. this.running = !0
  40329. },
  40330. stop: function() {
  40331. this.getElapsedTime(),
  40332. this.running = !1
  40333. },
  40334. getElapsedTime: function() {
  40335. return this.getDelta(),
  40336. this.elapsedTime
  40337. },
  40338. getDelta: function() {
  40339. var e = 0;
  40340. if (this.autoStart && !this.running && this.start(),
  40341. this.running) {
  40342. var t = performance.now();
  40343. e = .001 * (t - this.oldTime),
  40344. this.oldTime = t,
  40345. this.elapsedTime += e
  40346. }
  40347. return e
  40348. }
  40349. },
  40350. Ci.EventDispatcher = function() {}
  40351. ,
  40352. Ci.EventDispatcher.prototype = {
  40353. constructor: Ci.EventDispatcher,
  40354. apply: function(e) {
  40355. e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
  40356. e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
  40357. e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
  40358. e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
  40359. },
  40360. addEventListener: function(e, t) {
  40361. void 0 === this._listeners && (this._listeners = {});
  40362. var i = this._listeners;
  40363. void 0 === i[e] && (i[e] = []),
  40364. -1 === i[e].indexOf(t) && i[e].push(t)
  40365. },
  40366. hasEventListener: function(e, t) {
  40367. if (void 0 === this._listeners)
  40368. return !1;
  40369. var i = this._listeners;
  40370. return void 0 !== i[e] && -1 !== i[e].indexOf(t)
  40371. },
  40372. removeEventListener: function(e, t) {
  40373. if (void 0 !== this._listeners) {
  40374. var i = this._listeners[e];
  40375. if (void 0 !== i) {
  40376. var n = i.indexOf(t);
  40377. -1 !== n && i.splice(n, 1)
  40378. }
  40379. }
  40380. },
  40381. dispatchEvent: function(e) {
  40382. if (void 0 !== this._listeners) {
  40383. var t = this._listeners[e.type];
  40384. if (void 0 !== t) {
  40385. e.target = this;
  40386. for (var i = [], n = t.length, r = 0; r < n; r++)
  40387. i[r] = t[r];
  40388. for (r = 0; r < n; r++)
  40389. i[r].call(this, e)
  40390. }
  40391. }
  40392. }
  40393. },
  40394. Ci.Layers = function() {
  40395. this.mask = 1
  40396. }
  40397. ,
  40398. Ci.Layers.prototype = {
  40399. constructor: Ci.Layers,
  40400. set: function(e) {
  40401. this.mask = 1 << e
  40402. },
  40403. enable: function(e) {
  40404. this.mask |= 1 << e
  40405. },
  40406. toggle: function(e) {
  40407. this.mask ^= 1 << e
  40408. },
  40409. disable: function(e) {
  40410. this.mask &= ~(1 << e)
  40411. },
  40412. test: function(e) {
  40413. return 0 != (this.mask & e.mask)
  40414. }
  40415. },
  40416. (A = Ci).Raycaster = function(e, t, i, n) {
  40417. this.ray = new A.Ray(e,t),
  40418. this.near = i || 0,
  40419. this.far = n || 1 / 0,
  40420. this.params = {
  40421. Mesh: {},
  40422. Line: {},
  40423. LOD: {},
  40424. Points: {
  40425. threshold: 1
  40426. },
  40427. Sprite: {}
  40428. },
  40429. Object.defineProperties(this.params, {
  40430. PointCloud: {
  40431. get: function() {
  40432. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  40433. this.Points
  40434. }
  40435. }
  40436. })
  40437. }
  40438. ,
  40439. A.Raycaster.prototype = {
  40440. constructor: A.Raycaster,
  40441. linePrecision: 1,
  40442. set: function(e, t) {
  40443. this.ray.set(e, t)
  40444. },
  40445. setFromCamera: function(e, t) {
  40446. t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
  40447. 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),
  40448. this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  40449. },
  40450. intersectObject: function(e, t) {
  40451. var i = [];
  40452. return Ei(e, this, i, t),
  40453. i.sort(Ii),
  40454. i
  40455. },
  40456. intersectObjects: function(e, t) {
  40457. var i = [];
  40458. if (!1 === Array.isArray(e))
  40459. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  40460. i;
  40461. for (var n = 0, r = e.length; n < r; n++)
  40462. Ei(e[n], this, i, t);
  40463. return i.sort(Ii),
  40464. i
  40465. }
  40466. },
  40467. Ci.Object3D = function() {
  40468. Object.defineProperty(this, "id", {
  40469. value: Ci.Object3DIdCount++
  40470. }),
  40471. this.uuid = Ci.Math.generateUUID(),
  40472. this.name = "",
  40473. this.type = "Object3D",
  40474. this.parent = null,
  40475. this.children = [],
  40476. this.up = Ci.Object3D.DefaultUp.clone();
  40477. var e = new Ci.Vector3
  40478. , t = new Ci.Euler
  40479. , i = new Ci.Quaternion
  40480. , n = new Ci.Vector3(1,1,1);
  40481. t.onChange(function() {
  40482. i.setFromEuler(t, !1)
  40483. }),
  40484. i.onChange(function() {
  40485. t.setFromQuaternion(i, void 0, !1)
  40486. }),
  40487. Object.defineProperties(this, {
  40488. position: {
  40489. enumerable: !0,
  40490. value: e
  40491. },
  40492. rotation: {
  40493. enumerable: !0,
  40494. value: t
  40495. },
  40496. quaternion: {
  40497. enumerable: !0,
  40498. value: i
  40499. },
  40500. scale: {
  40501. enumerable: !0,
  40502. value: n
  40503. },
  40504. modelViewMatrix: {
  40505. value: new Ci.Matrix4
  40506. },
  40507. normalMatrix: {
  40508. value: new Ci.Matrix3
  40509. }
  40510. }),
  40511. this.rotationAutoUpdate = !0,
  40512. this.matrix = new Ci.Matrix4,
  40513. this.matrixWorld = new Ci.Matrix4,
  40514. this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
  40515. this.matrixWorldNeedsUpdate = !1,
  40516. this.layers = new Ci.Layers,
  40517. this.visible = !0,
  40518. this.castShadow = !1,
  40519. this.receiveShadow = !1,
  40520. this.frustumCulled = !0,
  40521. this.renderOrder = 0,
  40522. this.userData = {}
  40523. }
  40524. ,
  40525. Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
  40526. Ci.Object3D.DefaultMatrixAutoUpdate = !0,
  40527. Ci.Object3D.prototype = {
  40528. constructor: Ci.Object3D,
  40529. applyMatrix: function(e) {
  40530. this.matrix.multiplyMatrices(e, this.matrix),
  40531. this.matrix.decompose(this.position, this.quaternion, this.scale)
  40532. },
  40533. setRotationFromAxisAngle: function(e, t) {
  40534. this.quaternion.setFromAxisAngle(e, t)
  40535. },
  40536. setRotationFromEuler: function(e) {
  40537. this.quaternion.setFromEuler(e, !0)
  40538. },
  40539. setRotationFromMatrix: function(e) {
  40540. this.quaternion.setFromRotationMatrix(e)
  40541. },
  40542. setRotationFromQuaternion: function(e) {
  40543. this.quaternion.copy(e)
  40544. },
  40545. rotateOnAxis: (y = new Ci.Quaternion,
  40546. function(e, t) {
  40547. return y.setFromAxisAngle(e, t),
  40548. this.quaternion.multiply(y),
  40549. this
  40550. }
  40551. ),
  40552. rotateX: (v = new Ci.Vector3(1,0,0),
  40553. function(e) {
  40554. return this.rotateOnAxis(v, e)
  40555. }
  40556. ),
  40557. rotateY: (m = new Ci.Vector3(0,1,0),
  40558. function(e) {
  40559. return this.rotateOnAxis(m, e)
  40560. }
  40561. ),
  40562. rotateZ: (g = new Ci.Vector3(0,0,1),
  40563. function(e) {
  40564. return this.rotateOnAxis(g, e)
  40565. }
  40566. ),
  40567. translateOnAxis: (f = new Ci.Vector3,
  40568. function(e, t) {
  40569. return f.copy(e).applyQuaternion(this.quaternion),
  40570. this.position.add(f.multiplyScalar(t)),
  40571. this
  40572. }
  40573. ),
  40574. translateX: (p = new Ci.Vector3(1,0,0),
  40575. function(e) {
  40576. return this.translateOnAxis(p, e)
  40577. }
  40578. ),
  40579. translateY: (d = new Ci.Vector3(0,1,0),
  40580. function(e) {
  40581. return this.translateOnAxis(d, e)
  40582. }
  40583. ),
  40584. translateZ: (u = new Ci.Vector3(0,0,1),
  40585. function(e) {
  40586. return this.translateOnAxis(u, e)
  40587. }
  40588. ),
  40589. localToWorld: function(e) {
  40590. return e.applyMatrix4(this.matrixWorld)
  40591. },
  40592. worldToLocal: (h = new Ci.Matrix4,
  40593. function(e) {
  40594. return e.applyMatrix4(h.getInverse(this.matrixWorld))
  40595. }
  40596. ),
  40597. lookAt: (c = new Ci.Matrix4,
  40598. function(e) {
  40599. c.lookAt(e, this.position, this.up),
  40600. this.quaternion.setFromRotationMatrix(c)
  40601. }
  40602. ),
  40603. add: function(e) {
  40604. if (1 < arguments.length) {
  40605. for (var t = 0; t < arguments.length; t++)
  40606. this.add(arguments[t]);
  40607. return this
  40608. }
  40609. 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),
  40610. e.parent = this,
  40611. e.dispatchEvent({
  40612. type: "added"
  40613. }),
  40614. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  40615. this
  40616. },
  40617. remove: function(e) {
  40618. if (1 < arguments.length)
  40619. for (var t = 0; t < arguments.length; t++)
  40620. this.remove(arguments[t]);
  40621. var i = this.children.indexOf(e);
  40622. -1 !== i && (e.parent = null,
  40623. e.dispatchEvent({
  40624. type: "removed"
  40625. }),
  40626. this.children.splice(i, 1))
  40627. },
  40628. getObjectById: function(e) {
  40629. return this.getObjectByProperty("id", e)
  40630. },
  40631. getObjectByName: function(e) {
  40632. return this.getObjectByProperty("name", e)
  40633. },
  40634. getObjectByProperty: function(e, t) {
  40635. if (this[e] === t)
  40636. return this;
  40637. for (var i = 0, n = this.children.length; i < n; i++) {
  40638. var r = this.children[i].getObjectByProperty(e, t);
  40639. if (void 0 !== r)
  40640. return r
  40641. }
  40642. },
  40643. getWorldPosition: function(e) {
  40644. var t = e || new Ci.Vector3;
  40645. return this.updateMatrixWorld(!0),
  40646. t.setFromMatrixPosition(this.matrixWorld)
  40647. },
  40648. getWorldQuaternion: (s = new Ci.Vector3,
  40649. l = new Ci.Vector3,
  40650. function(e) {
  40651. var t = e || new Ci.Quaternion;
  40652. return this.updateMatrixWorld(!0),
  40653. this.matrixWorld.decompose(s, t, l),
  40654. t
  40655. }
  40656. ),
  40657. getWorldRotation: (a = new Ci.Quaternion,
  40658. function(e) {
  40659. var t = e || new Ci.Euler;
  40660. return this.getWorldQuaternion(a),
  40661. t.setFromQuaternion(a, this.rotation.order, !1)
  40662. }
  40663. ),
  40664. getWorldScale: (r = new Ci.Vector3,
  40665. o = new Ci.Quaternion,
  40666. function(e) {
  40667. var t = e || new Ci.Vector3;
  40668. return this.updateMatrixWorld(!0),
  40669. this.matrixWorld.decompose(r, o, t),
  40670. t
  40671. }
  40672. ),
  40673. getWorldDirection: (n = new Ci.Quaternion,
  40674. function(e) {
  40675. var t = e || new Ci.Vector3;
  40676. return this.getWorldQuaternion(n),
  40677. t.set(0, 0, 1).applyQuaternion(n)
  40678. }
  40679. ),
  40680. raycast: function() {},
  40681. traverse: function(e) {
  40682. e(this);
  40683. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  40684. t[i].traverse(e)
  40685. },
  40686. traverseVisible: function(e) {
  40687. if (!1 !== this.visible) {
  40688. e(this);
  40689. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  40690. t[i].traverseVisible(e)
  40691. }
  40692. },
  40693. traverseAncestors: function(e) {
  40694. var t = this.parent;
  40695. null !== t && (e(t),
  40696. t.traverseAncestors(e))
  40697. },
  40698. updateMatrix: function() {
  40699. this.matrix.compose(this.position, this.quaternion, this.scale),
  40700. this.matrixWorldNeedsUpdate = !0
  40701. },
  40702. updateMatrixWorld: function(e) {
  40703. !0 === this.matrixAutoUpdate && this.updateMatrix(),
  40704. !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  40705. e = !(this.matrixWorldNeedsUpdate = !1));
  40706. for (var t = 0, i = this.children.length; t < i; t++)
  40707. this.children[t].updateMatrixWorld(e)
  40708. },
  40709. toJSON: function(e) {
  40710. function t(e) {
  40711. var t = [];
  40712. for (var i in e) {
  40713. var n = e[i];
  40714. delete n.metadata,
  40715. t.push(n)
  40716. }
  40717. return t
  40718. }
  40719. var i = void 0 === e
  40720. , n = {};
  40721. i && (e = {
  40722. geometries: {},
  40723. materials: {},
  40724. textures: {},
  40725. images: {}
  40726. },
  40727. n.metadata = {
  40728. version: 4.4,
  40729. type: "Object",
  40730. generator: "Object3D.toJSON"
  40731. });
  40732. var r = {};
  40733. if (r.uuid = this.uuid,
  40734. r.type = this.type,
  40735. "" !== this.name && (r.name = this.name),
  40736. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  40737. !0 === this.castShadow && (r.castShadow = !0),
  40738. !0 === this.receiveShadow && (r.receiveShadow = !0),
  40739. !1 === this.visible && (r.visible = !1),
  40740. r.matrix = this.matrix.toArray(),
  40741. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  40742. r.geometry = this.geometry.uuid),
  40743. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  40744. r.material = this.material.uuid),
  40745. 0 < this.children.length) {
  40746. r.children = [];
  40747. for (var o = 0; o < this.children.length; o++)
  40748. r.children.push(this.children[o].toJSON(e).object)
  40749. }
  40750. if (i) {
  40751. var a = t(e.geometries)
  40752. , s = t(e.materials)
  40753. , l = t(e.textures)
  40754. , c = t(e.images);
  40755. 0 < a.length && (n.geometries = a),
  40756. 0 < s.length && (n.materials = s),
  40757. 0 < l.length && (n.textures = l),
  40758. 0 < c.length && (n.images = c)
  40759. }
  40760. return n.object = r,
  40761. n
  40762. },
  40763. clone: function(e) {
  40764. return (new this.constructor).copy(this, e)
  40765. },
  40766. copy: function(e, t) {
  40767. if (void 0 === t && (t = !0),
  40768. this.name = e.name,
  40769. this.up.copy(e.up),
  40770. this.position.copy(e.position),
  40771. this.quaternion.copy(e.quaternion),
  40772. this.scale.copy(e.scale),
  40773. this.rotationAutoUpdate = e.rotationAutoUpdate,
  40774. this.matrix.copy(e.matrix),
  40775. this.matrixWorld.copy(e.matrixWorld),
  40776. this.matrixAutoUpdate = e.matrixAutoUpdate,
  40777. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  40778. this.visible = e.visible,
  40779. this.castShadow = e.castShadow,
  40780. this.receiveShadow = e.receiveShadow,
  40781. this.frustumCulled = e.frustumCulled,
  40782. this.renderOrder = e.renderOrder,
  40783. this.userData = JSON.parse(JSON.stringify(e.userData)),
  40784. !0 === t)
  40785. for (var i = 0; i < e.children.length; i++) {
  40786. var n = e.children[i];
  40787. this.add(n.clone())
  40788. }
  40789. return this
  40790. }
  40791. },
  40792. Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
  40793. Ci.Object3DIdCount = 0,
  40794. Ci.Face3 = function(e, t, i, n, r, o) {
  40795. this.a = e,
  40796. this.b = t,
  40797. this.c = i,
  40798. this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
  40799. this.vertexNormals = Array.isArray(n) ? n : [],
  40800. this.color = r instanceof Ci.Color ? r : new Ci.Color,
  40801. this.vertexColors = Array.isArray(r) ? r : [],
  40802. this.materialIndex = void 0 !== o ? o : 0
  40803. }
  40804. ,
  40805. Ci.Face3.prototype = {
  40806. constructor: Ci.Face3,
  40807. clone: function() {
  40808. return (new this.constructor).copy(this)
  40809. },
  40810. copy: function(e) {
  40811. this.a = e.a,
  40812. this.b = e.b,
  40813. this.c = e.c,
  40814. this.normal.copy(e.normal),
  40815. this.color.copy(e.color),
  40816. this.materialIndex = e.materialIndex;
  40817. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  40818. this.vertexNormals[t] = e.vertexNormals[t].clone();
  40819. for (t = 0,
  40820. i = e.vertexColors.length; t < i; t++)
  40821. this.vertexColors[t] = e.vertexColors[t].clone();
  40822. return this
  40823. }
  40824. },
  40825. Ci.BufferAttribute = function(e, t) {
  40826. this.uuid = Ci.Math.generateUUID(),
  40827. this.array = e,
  40828. this.itemSize = t,
  40829. this.dynamic = !1,
  40830. this.updateRange = {
  40831. offset: 0,
  40832. count: -1
  40833. },
  40834. this.version = 0
  40835. }
  40836. ,
  40837. Ci.BufferAttribute.prototype = {
  40838. constructor: Ci.BufferAttribute,
  40839. get count() {
  40840. return this.array.length / this.itemSize
  40841. },
  40842. set needsUpdate(e) {
  40843. !0 === e && this.version++
  40844. },
  40845. setDynamic: function(e) {
  40846. return this.dynamic = e,
  40847. this
  40848. },
  40849. copy: function(e) {
  40850. return this.array = new e.array.constructor(e.array),
  40851. this.itemSize = e.itemSize,
  40852. this.dynamic = e.dynamic,
  40853. this
  40854. },
  40855. copyAt: function(e, t, i) {
  40856. e *= this.itemSize,
  40857. i *= t.itemSize;
  40858. for (var n = 0, r = this.itemSize; n < r; n++)
  40859. this.array[e + n] = t.array[i + n];
  40860. return this
  40861. },
  40862. copyArray: function(e) {
  40863. return this.array.set(e),
  40864. this
  40865. },
  40866. copyColorsArray: function(e) {
  40867. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  40868. var o = e[n];
  40869. void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
  40870. o = new Ci.Color),
  40871. t[i++] = o.r,
  40872. t[i++] = o.g,
  40873. t[i++] = o.b
  40874. }
  40875. return this
  40876. },
  40877. copyIndicesArray: function(e) {
  40878. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  40879. var o = e[n];
  40880. t[i++] = o.a,
  40881. t[i++] = o.b,
  40882. t[i++] = o.c
  40883. }
  40884. return this
  40885. },
  40886. copyVector2sArray: function(e) {
  40887. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  40888. var o = e[n];
  40889. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
  40890. o = new Ci.Vector2),
  40891. t[i++] = o.x,
  40892. t[i++] = o.y
  40893. }
  40894. return this
  40895. },
  40896. copyVector3sArray: function(e) {
  40897. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  40898. var o = e[n];
  40899. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
  40900. o = new Ci.Vector3),
  40901. t[i++] = o.x,
  40902. t[i++] = o.y,
  40903. t[i++] = o.z
  40904. }
  40905. return this
  40906. },
  40907. copyVector4sArray: function(e) {
  40908. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  40909. var o = e[n];
  40910. void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
  40911. o = new Ci.Vector4),
  40912. t[i++] = o.x,
  40913. t[i++] = o.y,
  40914. t[i++] = o.z,
  40915. t[i++] = o.w
  40916. }
  40917. return this
  40918. },
  40919. set: function(e, t) {
  40920. return void 0 === t && (t = 0),
  40921. this.array.set(e, t),
  40922. this
  40923. },
  40924. getX: function(e) {
  40925. return this.array[e * this.itemSize]
  40926. },
  40927. setX: function(e, t) {
  40928. return this.array[e * this.itemSize] = t,
  40929. this
  40930. },
  40931. getY: function(e) {
  40932. return this.array[e * this.itemSize + 1]
  40933. },
  40934. setY: function(e, t) {
  40935. return this.array[e * this.itemSize + 1] = t,
  40936. this
  40937. },
  40938. getZ: function(e) {
  40939. return this.array[e * this.itemSize + 2]
  40940. },
  40941. setZ: function(e, t) {
  40942. return this.array[e * this.itemSize + 2] = t,
  40943. this
  40944. },
  40945. getW: function(e) {
  40946. return this.array[e * this.itemSize + 3]
  40947. },
  40948. setW: function(e, t) {
  40949. return this.array[e * this.itemSize + 3] = t,
  40950. this
  40951. },
  40952. setXY: function(e, t, i) {
  40953. return e *= this.itemSize,
  40954. this.array[e + 0] = t,
  40955. this.array[e + 1] = i,
  40956. this
  40957. },
  40958. setXYZ: function(e, t, i, n) {
  40959. return e *= this.itemSize,
  40960. this.array[e + 0] = t,
  40961. this.array[e + 1] = i,
  40962. this.array[e + 2] = n,
  40963. this
  40964. },
  40965. setXYZW: function(e, t, i, n, r) {
  40966. return e *= this.itemSize,
  40967. this.array[e + 0] = t,
  40968. this.array[e + 1] = i,
  40969. this.array[e + 2] = n,
  40970. this.array[e + 3] = r,
  40971. this
  40972. },
  40973. clone: function() {
  40974. return (new this.constructor).copy(this)
  40975. }
  40976. },
  40977. Ci.Int8Attribute = function(e, t) {
  40978. return new Ci.BufferAttribute(new Int8Array(e),t)
  40979. }
  40980. ,
  40981. Ci.Uint8Attribute = function(e, t) {
  40982. return new Ci.BufferAttribute(new Uint8Array(e),t)
  40983. }
  40984. ,
  40985. Ci.Uint8ClampedAttribute = function(e, t) {
  40986. return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
  40987. }
  40988. ,
  40989. Ci.Int16Attribute = function(e, t) {
  40990. return new Ci.BufferAttribute(new Int16Array(e),t)
  40991. }
  40992. ,
  40993. Ci.Uint16Attribute = function(e, t) {
  40994. return new Ci.BufferAttribute(new Uint16Array(e),t)
  40995. }
  40996. ,
  40997. Ci.Int32Attribute = function(e, t) {
  40998. return new Ci.BufferAttribute(new Int32Array(e),t)
  40999. }
  41000. ,
  41001. Ci.Uint32Attribute = function(e, t) {
  41002. return new Ci.BufferAttribute(new Uint32Array(e),t)
  41003. }
  41004. ,
  41005. Ci.Float32Attribute = function(e, t) {
  41006. return new Ci.BufferAttribute(new Float32Array(e),t)
  41007. }
  41008. ,
  41009. Ci.Float64Attribute = function(e, t) {
  41010. return new Ci.BufferAttribute(new Float64Array(e),t)
  41011. }
  41012. ,
  41013. Ci.DynamicBufferAttribute = function(e, t) {
  41014. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41015. new Ci.BufferAttribute(e,t).setDynamic(!0)
  41016. }
  41017. ,
  41018. Ci.InstancedBufferAttribute = function(e, t, i) {
  41019. Ci.BufferAttribute.call(this, e, t),
  41020. this.meshPerAttribute = i || 1
  41021. }
  41022. ,
  41023. Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
  41024. Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
  41025. Ci.InstancedBufferAttribute.prototype.copy = function(e) {
  41026. return Ci.BufferAttribute.prototype.copy.call(this, e),
  41027. this.meshPerAttribute = e.meshPerAttribute,
  41028. this
  41029. }
  41030. ,
  41031. Ci.InterleavedBuffer = function(e, t) {
  41032. this.uuid = Ci.Math.generateUUID(),
  41033. this.array = e,
  41034. this.stride = t,
  41035. this.dynamic = !1,
  41036. this.updateRange = {
  41037. offset: 0,
  41038. count: -1
  41039. },
  41040. this.version = 0
  41041. }
  41042. ,
  41043. Ci.InterleavedBuffer.prototype = {
  41044. constructor: Ci.InterleavedBuffer,
  41045. get length() {
  41046. return this.array.length
  41047. },
  41048. get count() {
  41049. return this.array.length / this.stride
  41050. },
  41051. set needsUpdate(e) {
  41052. !0 === e && this.version++
  41053. },
  41054. setDynamic: function(e) {
  41055. return this.dynamic = e,
  41056. this
  41057. },
  41058. copy: function(e) {
  41059. return this.array = new e.array.constructor(e.array),
  41060. this.stride = e.stride,
  41061. this.dynamic = e.dynamic,
  41062. this
  41063. },
  41064. copyAt: function(e, t, i) {
  41065. e *= this.stride,
  41066. i *= t.stride;
  41067. for (var n = 0, r = this.stride; n < r; n++)
  41068. this.array[e + n] = t.array[i + n];
  41069. return this
  41070. },
  41071. set: function(e, t) {
  41072. return void 0 === t && (t = 0),
  41073. this.array.set(e, t),
  41074. this
  41075. },
  41076. clone: function() {
  41077. return (new this.constructor).copy(this)
  41078. }
  41079. },
  41080. Ci.InstancedInterleavedBuffer = function(e, t, i) {
  41081. Ci.InterleavedBuffer.call(this, e, t),
  41082. this.meshPerAttribute = i || 1
  41083. }
  41084. ,
  41085. Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
  41086. Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
  41087. Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41088. return Ci.InterleavedBuffer.prototype.copy.call(this, e),
  41089. this.meshPerAttribute = e.meshPerAttribute,
  41090. this
  41091. }
  41092. ,
  41093. Ci.InterleavedBufferAttribute = function(e, t, i) {
  41094. this.uuid = Ci.Math.generateUUID(),
  41095. this.data = e,
  41096. this.itemSize = t,
  41097. this.offset = i
  41098. }
  41099. ,
  41100. Ci.InterleavedBufferAttribute.prototype = {
  41101. constructor: Ci.InterleavedBufferAttribute,
  41102. get length() {
  41103. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41104. this.array.length
  41105. },
  41106. get count() {
  41107. return this.data.count
  41108. },
  41109. setX: function(e, t) {
  41110. return this.data.array[e * this.data.stride + this.offset] = t,
  41111. this
  41112. },
  41113. setY: function(e, t) {
  41114. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41115. this
  41116. },
  41117. setZ: function(e, t) {
  41118. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41119. this
  41120. },
  41121. setW: function(e, t) {
  41122. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41123. this
  41124. },
  41125. getX: function(e) {
  41126. return this.data.array[e * this.data.stride + this.offset]
  41127. },
  41128. getY: function(e) {
  41129. return this.data.array[e * this.data.stride + this.offset + 1]
  41130. },
  41131. getZ: function(e) {
  41132. return this.data.array[e * this.data.stride + this.offset + 2]
  41133. },
  41134. getW: function(e) {
  41135. return this.data.array[e * this.data.stride + this.offset + 3]
  41136. },
  41137. setXY: function(e, t, i) {
  41138. return e = e * this.data.stride + this.offset,
  41139. this.data.array[e + 0] = t,
  41140. this.data.array[e + 1] = i,
  41141. this
  41142. },
  41143. setXYZ: function(e, t, i, n) {
  41144. return e = e * this.data.stride + this.offset,
  41145. this.data.array[e + 0] = t,
  41146. this.data.array[e + 1] = i,
  41147. this.data.array[e + 2] = n,
  41148. this
  41149. },
  41150. setXYZW: function(e, t, i, n, r) {
  41151. return e = e * this.data.stride + this.offset,
  41152. this.data.array[e + 0] = t,
  41153. this.data.array[e + 1] = i,
  41154. this.data.array[e + 2] = n,
  41155. this.data.array[e + 3] = r,
  41156. this
  41157. }
  41158. },
  41159. Ci.Geometry = function() {
  41160. Object.defineProperty(this, "id", {
  41161. value: Ci.GeometryIdCount++
  41162. }),
  41163. this.uuid = Ci.Math.generateUUID(),
  41164. this.name = "",
  41165. this.type = "Geometry",
  41166. this.vertices = [],
  41167. this.colors = [],
  41168. this.faces = [],
  41169. this.faceVertexUvs = [[]],
  41170. this.morphTargets = [],
  41171. this.morphNormals = [],
  41172. this.skinWeights = [],
  41173. this.skinIndices = [],
  41174. this.lineDistances = [],
  41175. this.boundingBox = null,
  41176. this.boundingSphere = null,
  41177. this.verticesNeedUpdate = !1,
  41178. this.elementsNeedUpdate = !1,
  41179. this.uvsNeedUpdate = !1,
  41180. this.normalsNeedUpdate = !1,
  41181. this.colorsNeedUpdate = !1,
  41182. this.lineDistancesNeedUpdate = !1,
  41183. this.groupsNeedUpdate = !1
  41184. }
  41185. ,
  41186. Ci.Geometry.prototype = {
  41187. constructor: Ci.Geometry,
  41188. applyMatrix: function(e) {
  41189. for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
  41190. this.vertices[i].applyMatrix4(e)
  41191. }
  41192. for (i = 0,
  41193. n = this.faces.length; i < n; i++) {
  41194. var r = this.faces[i];
  41195. r.normal.applyMatrix3(t).normalize();
  41196. for (var o = 0, a = r.vertexNormals.length; o < a; o++)
  41197. r.vertexNormals[o].applyMatrix3(t).normalize()
  41198. }
  41199. return null !== this.boundingBox && this.computeBoundingBox(),
  41200. null !== this.boundingSphere && this.computeBoundingSphere(),
  41201. this.verticesNeedUpdate = !0,
  41202. this.normalsNeedUpdate = !0,
  41203. this
  41204. },
  41205. rotateX: function(e) {
  41206. return void 0 === mt && (mt = new Ci.Matrix4),
  41207. mt.makeRotationX(e),
  41208. this.applyMatrix(mt),
  41209. this
  41210. },
  41211. rotateY: function(e) {
  41212. return void 0 === gt && (gt = new Ci.Matrix4),
  41213. gt.makeRotationY(e),
  41214. this.applyMatrix(gt),
  41215. this
  41216. },
  41217. rotateZ: function(e) {
  41218. return void 0 === ft && (ft = new Ci.Matrix4),
  41219. ft.makeRotationZ(e),
  41220. this.applyMatrix(ft),
  41221. this
  41222. },
  41223. translate: function(e, t, i) {
  41224. return void 0 === pt && (pt = new Ci.Matrix4),
  41225. pt.makeTranslation(e, t, i),
  41226. this.applyMatrix(pt),
  41227. this
  41228. },
  41229. scale: function(e, t, i) {
  41230. return void 0 === dt && (dt = new Ci.Matrix4),
  41231. dt.makeScale(e, t, i),
  41232. this.applyMatrix(dt),
  41233. this
  41234. },
  41235. lookAt: function(e) {
  41236. void 0 === ut && (ut = new Ci.Object3D),
  41237. ut.lookAt(e),
  41238. ut.updateMatrix(),
  41239. this.applyMatrix(ut.matrix)
  41240. },
  41241. fromBufferGeometry: function(e) {
  41242. function t(e, t, i, n) {
  41243. var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
  41244. , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
  41245. , a = new Ci.Face3(e,t,i,r,o,n);
  41246. s.faces.push(a),
  41247. void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
  41248. void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
  41249. }
  41250. var s = this
  41251. , i = null !== e.index ? e.index.array : void 0
  41252. , n = e.attributes
  41253. , r = n.position.array
  41254. , l = void 0 !== n.normal ? n.normal.array : void 0
  41255. , c = void 0 !== n.color ? n.color.array : void 0
  41256. , h = void 0 !== n.uv ? n.uv.array : void 0
  41257. , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
  41258. void 0 !== u && (this.faceVertexUvs[1] = []);
  41259. for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
  41260. a += 2)
  41261. s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
  41262. void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
  41263. void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
  41264. void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
  41265. void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
  41266. if (void 0 !== i) {
  41267. var g = e.groups;
  41268. if (0 < g.length)
  41269. for (o = 0; o < g.length; o++)
  41270. for (var m = g[o], v = m.start, y = (a = v,
  41271. v + m.count); a < y; a += 3)
  41272. t(i[a], i[a + 1], i[a + 2], m.materialIndex);
  41273. else
  41274. for (o = 0; o < i.length; o += 3)
  41275. t(i[o], i[o + 1], i[o + 2])
  41276. } else
  41277. for (o = 0; o < r.length / 3; o += 3)
  41278. t(o, o + 1, o + 2);
  41279. return this.computeFaceNormals(),
  41280. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  41281. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  41282. this
  41283. },
  41284. center: function() {
  41285. this.computeBoundingBox();
  41286. var e = this.boundingBox.center().negate();
  41287. return this.translate(e.x, e.y, e.z),
  41288. e
  41289. },
  41290. normalize: function() {
  41291. this.computeBoundingSphere();
  41292. var e = this.boundingSphere.center
  41293. , t = this.boundingSphere.radius
  41294. , i = 0 === t ? 1 : 1 / t
  41295. , n = new Ci.Matrix4;
  41296. 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),
  41297. this.applyMatrix(n),
  41298. this
  41299. },
  41300. computeFaceNormals: function() {
  41301. for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
  41302. var r = this.faces[i]
  41303. , o = this.vertices[r.a]
  41304. , a = this.vertices[r.b]
  41305. , s = this.vertices[r.c];
  41306. e.subVectors(s, a),
  41307. t.subVectors(o, a),
  41308. e.cross(t),
  41309. e.normalize(),
  41310. r.normal.copy(e)
  41311. }
  41312. },
  41313. computeVertexNormals: function(e) {
  41314. var t, i, n, r, o, a;
  41315. for (void 0 === e && (e = !0),
  41316. a = new Array(this.vertices.length),
  41317. t = 0,
  41318. i = this.vertices.length; t < i; t++)
  41319. a[t] = new Ci.Vector3;
  41320. if (e) {
  41321. var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
  41322. for (n = 0,
  41323. r = this.faces.length; n < r; n++)
  41324. o = this.faces[n],
  41325. s = this.vertices[o.a],
  41326. l = this.vertices[o.b],
  41327. c = this.vertices[o.c],
  41328. h.subVectors(c, l),
  41329. u.subVectors(s, l),
  41330. h.cross(u),
  41331. a[o.a].add(h),
  41332. a[o.b].add(h),
  41333. a[o.c].add(h)
  41334. } else
  41335. for (n = 0,
  41336. r = this.faces.length; n < r; n++)
  41337. a[(o = this.faces[n]).a].add(o.normal),
  41338. a[o.b].add(o.normal),
  41339. a[o.c].add(o.normal);
  41340. for (t = 0,
  41341. i = this.vertices.length; t < i; t++)
  41342. a[t].normalize();
  41343. for (n = 0,
  41344. r = this.faces.length; n < r; n++) {
  41345. var d = (o = this.faces[n]).vertexNormals;
  41346. 3 === d.length ? (d[0].copy(a[o.a]),
  41347. d[1].copy(a[o.b]),
  41348. d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
  41349. d[1] = a[o.b].clone(),
  41350. d[2] = a[o.c].clone())
  41351. }
  41352. 0 < this.faces.length && (this.normalsNeedUpdate = !0)
  41353. },
  41354. computeMorphNormals: function() {
  41355. var e, t, i, n, r;
  41356. for (i = 0,
  41357. n = this.faces.length; i < n; i++)
  41358. for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
  41359. r.__originalVertexNormals || (r.__originalVertexNormals = []),
  41360. e = 0,
  41361. t = r.vertexNormals.length; e < t; e++)
  41362. r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
  41363. var o = new Ci.Geometry;
  41364. for (o.faces = this.faces,
  41365. e = 0,
  41366. t = this.morphTargets.length; e < t; e++) {
  41367. if (!this.morphNormals[e]) {
  41368. this.morphNormals[e] = {},
  41369. this.morphNormals[e].faceNormals = [],
  41370. this.morphNormals[e].vertexNormals = [];
  41371. var a = this.morphNormals[e].faceNormals
  41372. , s = this.morphNormals[e].vertexNormals;
  41373. for (i = 0,
  41374. n = this.faces.length; i < n; i++)
  41375. l = new Ci.Vector3,
  41376. c = {
  41377. a: new Ci.Vector3,
  41378. b: new Ci.Vector3,
  41379. c: new Ci.Vector3
  41380. },
  41381. a.push(l),
  41382. s.push(c)
  41383. }
  41384. var l, c, h = this.morphNormals[e];
  41385. for (o.vertices = this.morphTargets[e].vertices,
  41386. o.computeFaceNormals(),
  41387. o.computeVertexNormals(),
  41388. i = 0,
  41389. n = this.faces.length; i < n; i++)
  41390. r = this.faces[i],
  41391. l = h.faceNormals[i],
  41392. c = h.vertexNormals[i],
  41393. l.copy(r.normal),
  41394. c.a.copy(r.vertexNormals[0]),
  41395. c.b.copy(r.vertexNormals[1]),
  41396. c.c.copy(r.vertexNormals[2])
  41397. }
  41398. for (i = 0,
  41399. n = this.faces.length; i < n; i++)
  41400. (r = this.faces[i]).normal = r.__originalFaceNormal,
  41401. r.vertexNormals = r.__originalVertexNormals
  41402. },
  41403. computeTangents: function() {
  41404. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  41405. },
  41406. computeLineDistances: function() {
  41407. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  41408. 0 < i && (e += t[i].distanceTo(t[i - 1])),
  41409. this.lineDistances[i] = e
  41410. },
  41411. computeBoundingBox: function() {
  41412. null === this.boundingBox && (this.boundingBox = new Ci.Box3),
  41413. this.boundingBox.setFromPoints(this.vertices)
  41414. },
  41415. computeBoundingSphere: function() {
  41416. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
  41417. this.boundingSphere.setFromPoints(this.vertices)
  41418. },
  41419. merge: function(e, t, i) {
  41420. if (e instanceof Ci.Geometry != 0) {
  41421. 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];
  41422. void 0 === i && (i = 0),
  41423. void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
  41424. for (var u = 0, d = a.length; u < d; u++) {
  41425. var p = a[u].clone();
  41426. void 0 !== t && p.applyMatrix4(t),
  41427. o.push(p)
  41428. }
  41429. for (u = 0,
  41430. d = l.length; u < d; u++) {
  41431. var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
  41432. (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
  41433. void 0 !== n && f.normal.applyMatrix3(n).normalize();
  41434. for (var C = 0, I = y.length; C < I; C++)
  41435. g = y[C].clone(),
  41436. void 0 !== n && g.applyMatrix3(n).normalize(),
  41437. f.vertexNormals.push(g);
  41438. f.color.copy(v.color);
  41439. for (C = 0,
  41440. I = A.length; C < I; C++)
  41441. m = A[C],
  41442. f.vertexColors.push(m.clone());
  41443. f.materialIndex = v.materialIndex + i,
  41444. s.push(f)
  41445. }
  41446. for (u = 0,
  41447. d = h.length; u < d; u++) {
  41448. var E = h[u]
  41449. , _ = [];
  41450. if (void 0 !== E) {
  41451. for (C = 0,
  41452. I = E.length; C < I; C++)
  41453. _.push(E[C].clone());
  41454. c.push(_)
  41455. }
  41456. }
  41457. } else
  41458. console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
  41459. },
  41460. mergeMesh: function(e) {
  41461. return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  41462. void this.merge(e.geometry, e.matrix))
  41463. },
  41464. mergeVertices: function() {
  41465. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
  41466. for (i = 0,
  41467. n = this.vertices.length; i < n; i++)
  41468. e = this.vertices[i],
  41469. void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
  41470. c.push(this.vertices[i]),
  41471. h[i] = c.length - 1) : h[i] = h[l[t]];
  41472. var d = [];
  41473. for (i = 0,
  41474. n = this.faces.length; i < n; i++) {
  41475. (r = this.faces[i]).a = h[r.a],
  41476. r.b = h[r.b],
  41477. r.c = h[r.c],
  41478. o = [r.a, r.b, r.c];
  41479. for (var p = 0; p < 3; p++)
  41480. if (o[p] === o[(p + 1) % 3]) {
  41481. p,
  41482. d.push(i);
  41483. break
  41484. }
  41485. }
  41486. for (i = d.length - 1; 0 <= i; i--) {
  41487. var f = d[i];
  41488. for (this.faces.splice(f, 1),
  41489. a = 0,
  41490. s = this.faceVertexUvs.length; a < s; a++)
  41491. this.faceVertexUvs[a].splice(f, 1)
  41492. }
  41493. var g = this.vertices.length - c.length;
  41494. return this.vertices = c,
  41495. g
  41496. },
  41497. sortFacesByMaterialIndex: function() {
  41498. for (var e = this.faces, t = e.length, i = 0; i < t; i++)
  41499. e[i]._id = i;
  41500. e.sort(function(e, t) {
  41501. return e.materialIndex - t.materialIndex
  41502. });
  41503. var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
  41504. o && o.length === t && (n = []),
  41505. a && a.length === t && (r = []);
  41506. for (i = 0; i < t; i++) {
  41507. var s = e[i]._id;
  41508. n && n.push(o[s]),
  41509. r && r.push(a[s])
  41510. }
  41511. n && (this.faceVertexUvs[0] = n),
  41512. r && (this.faceVertexUvs[1] = r)
  41513. },
  41514. toJSON: function() {
  41515. function e(e, t, i) {
  41516. return i ? e | 1 << t : e & ~(1 << t)
  41517. }
  41518. function t(e) {
  41519. var t = e.x.toString() + e.y.toString() + e.z.toString();
  41520. return void 0 !== d[t] || (d[t] = u.length / 3,
  41521. u.push(e.x, e.y, e.z)),
  41522. d[t]
  41523. }
  41524. function i(e) {
  41525. var t = e.r.toString() + e.g.toString() + e.b.toString();
  41526. return void 0 !== f[t] || (f[t] = p.length,
  41527. p.push(e.getHex())),
  41528. f[t]
  41529. }
  41530. function n(e) {
  41531. var t = e.x.toString() + e.y.toString();
  41532. return void 0 !== m[t] || (m[t] = g.length / 2,
  41533. g.push(e.x, e.y)),
  41534. m[t]
  41535. }
  41536. var r = {
  41537. metadata: {
  41538. version: 4.4,
  41539. type: "Geometry",
  41540. generator: "Geometry.toJSON"
  41541. }
  41542. };
  41543. if (r.uuid = this.uuid,
  41544. r.type = this.type,
  41545. "" !== this.name && (r.name = this.name),
  41546. void 0 !== this.parameters) {
  41547. var o = this.parameters;
  41548. for (var a in o)
  41549. void 0 !== o[a] && (r[a] = o[a]);
  41550. return r
  41551. }
  41552. for (var s = [], l = 0; l < this.vertices.length; l++) {
  41553. var c = this.vertices[l];
  41554. s.push(c.x, c.y, c.z)
  41555. }
  41556. var h = []
  41557. , u = []
  41558. , d = {}
  41559. , p = []
  41560. , f = {}
  41561. , g = []
  41562. , m = {};
  41563. for (l = 0; l < this.faces.length; l++) {
  41564. var v = this.faces[l]
  41565. , y = void 0 !== this.faceVertexUvs[0][l]
  41566. , A = 0 < v.normal.length()
  41567. , C = 0 < v.vertexNormals.length
  41568. , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  41569. , E = 0 < v.vertexColors.length
  41570. , _ = 0;
  41571. 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),
  41572. h.push(_),
  41573. h.push(v.a, v.b, v.c),
  41574. h.push(v.materialIndex),
  41575. y) {
  41576. var b = this.faceVertexUvs[0][l];
  41577. h.push(n(b[0]), n(b[1]), n(b[2]))
  41578. }
  41579. if (A && h.push(t(v.normal)),
  41580. C) {
  41581. var w = v.vertexNormals;
  41582. h.push(t(w[0]), t(w[1]), t(w[2]))
  41583. }
  41584. if (I && h.push(i(v.color)),
  41585. E) {
  41586. var T = v.vertexColors;
  41587. h.push(i(T[0]), i(T[1]), i(T[2]))
  41588. }
  41589. }
  41590. return r.data = {},
  41591. r.data.vertices = s,
  41592. r.data.normals = u,
  41593. 0 < p.length && (r.data.colors = p),
  41594. 0 < g.length && (r.data.uvs = [g]),
  41595. r.data.faces = h,
  41596. r
  41597. },
  41598. clone: function() {
  41599. return (new Ci.Geometry).copy(this)
  41600. },
  41601. copy: function(e) {
  41602. this.vertices = [],
  41603. this.faces = [],
  41604. this.faceVertexUvs = [[]];
  41605. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  41606. this.vertices.push(t[i].clone());
  41607. var r = e.faces;
  41608. for (i = 0,
  41609. n = r.length; i < n; i++)
  41610. this.faces.push(r[i].clone());
  41611. for (i = 0,
  41612. n = e.faceVertexUvs.length; i < n; i++) {
  41613. var o = e.faceVertexUvs[i];
  41614. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  41615. for (var a = 0, s = o.length; a < s; a++) {
  41616. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  41617. var d = l[h];
  41618. c.push(d.clone())
  41619. }
  41620. this.faceVertexUvs[i].push(c)
  41621. }
  41622. }
  41623. return this
  41624. },
  41625. dispose: function() {
  41626. this.dispatchEvent({
  41627. type: "dispose"
  41628. })
  41629. }
  41630. },
  41631. Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
  41632. Ci.GeometryIdCount = 0,
  41633. Ci.DirectGeometry = function() {
  41634. Object.defineProperty(this, "id", {
  41635. value: Ci.GeometryIdCount++
  41636. }),
  41637. this.uuid = Ci.Math.generateUUID(),
  41638. this.name = "",
  41639. this.type = "DirectGeometry",
  41640. this.indices = [],
  41641. this.vertices = [],
  41642. this.normals = [],
  41643. this.colors = [],
  41644. this.uvs = [],
  41645. this.uvs2 = [],
  41646. this.groups = [],
  41647. this.morphTargets = {},
  41648. this.skinWeights = [],
  41649. this.skinIndices = [],
  41650. this.boundingBox = null,
  41651. this.boundingSphere = null,
  41652. this.verticesNeedUpdate = !1,
  41653. this.normalsNeedUpdate = !1,
  41654. this.colorsNeedUpdate = !1,
  41655. this.uvsNeedUpdate = !1,
  41656. this.groupsNeedUpdate = !1
  41657. }
  41658. ,
  41659. Ci.DirectGeometry.prototype = {
  41660. constructor: Ci.DirectGeometry,
  41661. computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
  41662. computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
  41663. computeFaceNormals: function() {
  41664. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  41665. },
  41666. computeVertexNormals: function() {
  41667. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  41668. },
  41669. computeGroups: function(e) {
  41670. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  41671. var a = r[o];
  41672. a.materialIndex !== i && (i = a.materialIndex,
  41673. void 0 !== t && (t.count = 3 * o - t.start,
  41674. n.push(t)),
  41675. t = {
  41676. start: 3 * o,
  41677. materialIndex: i
  41678. })
  41679. }
  41680. void 0 !== t && (t.count = 3 * o - t.start,
  41681. n.push(t)),
  41682. this.groups = n
  41683. },
  41684. fromGeometry: function(e) {
  41685. 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;
  41686. if (0 < l) {
  41687. t = [];
  41688. for (var c = 0; c < l; c++)
  41689. t[c] = [];
  41690. this.morphTargets.position = t
  41691. }
  41692. var h, u = e.morphNormals, d = u.length;
  41693. if (0 < d) {
  41694. h = [];
  41695. for (c = 0; c < d; c++)
  41696. h[c] = [];
  41697. this.morphTargets.normal = h
  41698. }
  41699. var p = e.skinIndices
  41700. , f = e.skinWeights
  41701. , g = p.length === n.length
  41702. , m = f.length === n.length;
  41703. for (c = 0; c < i.length; c++) {
  41704. var v = i[c];
  41705. this.vertices.push(n[v.a], n[v.b], n[v.c]);
  41706. var y = v.vertexNormals;
  41707. if (3 === y.length)
  41708. this.normals.push(y[0], y[1], y[2]);
  41709. else {
  41710. var A = v.normal;
  41711. this.normals.push(A, A, A)
  41712. }
  41713. var C, I = v.vertexColors;
  41714. if (3 === I.length)
  41715. this.colors.push(I[0], I[1], I[2]);
  41716. else {
  41717. var E = v.color;
  41718. this.colors.push(E, E, E)
  41719. }
  41720. if (!0 === o)
  41721. void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
  41722. this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  41723. if (!0 === a)
  41724. void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
  41725. this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
  41726. for (var _ = 0; _ < l; _++) {
  41727. var b = s[_].vertices;
  41728. t[_].push(b[v.a], b[v.b], b[v.c])
  41729. }
  41730. for (_ = 0; _ < d; _++) {
  41731. var w = u[_].vertexNormals[c];
  41732. h[_].push(w.a, w.b, w.c)
  41733. }
  41734. g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
  41735. m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
  41736. }
  41737. return this.computeGroups(e),
  41738. this.verticesNeedUpdate = e.verticesNeedUpdate,
  41739. this.normalsNeedUpdate = e.normalsNeedUpdate,
  41740. this.colorsNeedUpdate = e.colorsNeedUpdate,
  41741. this.uvsNeedUpdate = e.uvsNeedUpdate,
  41742. this.groupsNeedUpdate = e.groupsNeedUpdate,
  41743. this
  41744. },
  41745. dispose: function() {
  41746. this.dispatchEvent({
  41747. type: "dispose"
  41748. })
  41749. }
  41750. },
  41751. Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
  41752. Ci.BufferGeometry = function() {
  41753. Object.defineProperty(this, "id", {
  41754. value: Ci.GeometryIdCount++
  41755. }),
  41756. this.uuid = Ci.Math.generateUUID(),
  41757. this.name = "",
  41758. this.type = "BufferGeometry",
  41759. this.index = null,
  41760. this.attributes = {},
  41761. this.morphAttributes = {},
  41762. this.groups = [],
  41763. this.boundingBox = null,
  41764. this.boundingSphere = null,
  41765. this.drawRange = {
  41766. start: 0,
  41767. count: 1 / 0
  41768. }
  41769. }
  41770. ,
  41771. Ci.BufferGeometry.prototype = {
  41772. constructor: Ci.BufferGeometry,
  41773. getIndex: function() {
  41774. return this.index
  41775. },
  41776. setIndex: function(e) {
  41777. this.index = e
  41778. },
  41779. addAttribute: function(e, t) {
  41780. return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  41781. void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  41782. void this.setIndex(t)) : (this.attributes[e] = t,
  41783. this)
  41784. },
  41785. getAttribute: function(e) {
  41786. return this.attributes[e]
  41787. },
  41788. removeAttribute: function(e) {
  41789. return delete this.attributes[e],
  41790. this
  41791. },
  41792. addGroup: function(e, t, i) {
  41793. this.groups.push({
  41794. start: e,
  41795. count: t,
  41796. materialIndex: void 0 !== i ? i : 0
  41797. })
  41798. },
  41799. clearGroups: function() {
  41800. this.groups = []
  41801. },
  41802. setDrawRange: function(e, t) {
  41803. this.drawRange.start = e,
  41804. this.drawRange.count = t
  41805. },
  41806. applyMatrix: function(e) {
  41807. var t = this.attributes.position;
  41808. void 0 !== t && (e.applyToVector3Array(t.array),
  41809. t.needsUpdate = !0);
  41810. var i = this.attributes.normal;
  41811. void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
  41812. i.needsUpdate = !0);
  41813. return null !== this.boundingBox && this.computeBoundingBox(),
  41814. null !== this.boundingSphere && this.computeBoundingSphere(),
  41815. this
  41816. },
  41817. rotateX: function(e) {
  41818. return void 0 === ht && (ht = new Ci.Matrix4),
  41819. ht.makeRotationX(e),
  41820. this.applyMatrix(ht),
  41821. this
  41822. },
  41823. rotateY: function(e) {
  41824. return void 0 === ct && (ct = new Ci.Matrix4),
  41825. ct.makeRotationY(e),
  41826. this.applyMatrix(ct),
  41827. this
  41828. },
  41829. rotateZ: function(e) {
  41830. return void 0 === lt && (lt = new Ci.Matrix4),
  41831. lt.makeRotationZ(e),
  41832. this.applyMatrix(lt),
  41833. this
  41834. },
  41835. translate: function(e, t, i) {
  41836. return void 0 === st && (st = new Ci.Matrix4),
  41837. st.makeTranslation(e, t, i),
  41838. this.applyMatrix(st),
  41839. this
  41840. },
  41841. scale: function(e, t, i) {
  41842. return void 0 === at && (at = new Ci.Matrix4),
  41843. at.makeScale(e, t, i),
  41844. this.applyMatrix(at),
  41845. this
  41846. },
  41847. lookAt: function(e) {
  41848. void 0 === ot && (ot = new Ci.Object3D),
  41849. ot.lookAt(e),
  41850. ot.updateMatrix(),
  41851. this.applyMatrix(ot.matrix)
  41852. },
  41853. center: function() {
  41854. this.computeBoundingBox();
  41855. var e = this.boundingBox.center().negate();
  41856. return this.translate(e.x, e.y, e.z),
  41857. e
  41858. },
  41859. setFromObject: function(e) {
  41860. var t = e.geometry;
  41861. if (e instanceof Ci.Points || e instanceof Ci.Line) {
  41862. var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
  41863. , n = new Ci.Float32Attribute(3 * t.colors.length,3);
  41864. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  41865. this.addAttribute("color", n.copyColorsArray(t.colors)),
  41866. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  41867. var r = new Ci.Float32Attribute(t.lineDistances.length,1);
  41868. this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
  41869. }
  41870. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  41871. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  41872. } else
  41873. e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
  41874. return this
  41875. },
  41876. updateFromObject: function(e) {
  41877. var t, i = e.geometry;
  41878. if (e instanceof Ci.Mesh) {
  41879. var n = i.__directGeometry;
  41880. if (void 0 === n)
  41881. return this.fromGeometry(i);
  41882. n.verticesNeedUpdate = i.verticesNeedUpdate,
  41883. n.normalsNeedUpdate = i.normalsNeedUpdate,
  41884. n.colorsNeedUpdate = i.colorsNeedUpdate,
  41885. n.uvsNeedUpdate = i.uvsNeedUpdate,
  41886. n.groupsNeedUpdate = i.groupsNeedUpdate,
  41887. i.verticesNeedUpdate = !1,
  41888. i.normalsNeedUpdate = !1,
  41889. i.colorsNeedUpdate = !1,
  41890. i.uvsNeedUpdate = !1,
  41891. i.groupsNeedUpdate = !1,
  41892. i = n
  41893. }
  41894. !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
  41895. t.needsUpdate = !0),
  41896. i.verticesNeedUpdate = !1);
  41897. !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
  41898. t.needsUpdate = !0),
  41899. i.normalsNeedUpdate = !1);
  41900. !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
  41901. t.needsUpdate = !0),
  41902. i.colorsNeedUpdate = !1);
  41903. i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
  41904. t.needsUpdate = !0),
  41905. i.uvsNeedUpdate = !1);
  41906. i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
  41907. t.needsUpdate = !0),
  41908. i.lineDistancesNeedUpdate = !1);
  41909. return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
  41910. this.groups = i.groups,
  41911. i.groupsNeedUpdate = !1),
  41912. this
  41913. },
  41914. fromGeometry: function(e) {
  41915. return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
  41916. this.fromDirectGeometry(e.__directGeometry)
  41917. },
  41918. fromDirectGeometry: function(e) {
  41919. var t = new Float32Array(3 * e.vertices.length);
  41920. if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  41921. 0 < e.normals.length) {
  41922. var i = new Float32Array(3 * e.normals.length);
  41923. this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
  41924. }
  41925. if (0 < e.colors.length) {
  41926. var n = new Float32Array(3 * e.colors.length);
  41927. this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
  41928. }
  41929. if (0 < e.uvs.length) {
  41930. var r = new Float32Array(2 * e.uvs.length);
  41931. this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
  41932. }
  41933. if (0 < e.uvs2.length) {
  41934. var o = new Float32Array(2 * e.uvs2.length);
  41935. this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
  41936. }
  41937. if (0 < e.indices.length) {
  41938. var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
  41939. this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
  41940. }
  41941. for (var s in this.groups = e.groups,
  41942. e.morphTargets) {
  41943. for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
  41944. var d = c[h]
  41945. , p = new Ci.Float32Attribute(3 * d.length,3);
  41946. l.push(p.copyVector3sArray(d))
  41947. }
  41948. this.morphAttributes[s] = l
  41949. }
  41950. if (0 < e.skinIndices.length) {
  41951. var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
  41952. this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
  41953. }
  41954. if (0 < e.skinWeights.length) {
  41955. var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
  41956. this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
  41957. }
  41958. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  41959. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  41960. this
  41961. },
  41962. computeBoundingBox: (new Ci.Vector3,
  41963. function() {
  41964. null === this.boundingBox && (this.boundingBox = new Ci.Box3);
  41965. var e = this.attributes.position.array;
  41966. e && this.boundingBox.setFromArray(e),
  41967. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  41968. this.boundingBox.max.set(0, 0, 0)),
  41969. (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)
  41970. }
  41971. ),
  41972. computeBoundingSphere: (nt = new Ci.Box3,
  41973. rt = new Ci.Vector3,
  41974. function() {
  41975. null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
  41976. var e = this.attributes.position.array;
  41977. if (e) {
  41978. var t = this.boundingSphere.center;
  41979. nt.setFromArray(e),
  41980. nt.center(t);
  41981. for (var i = 0, n = 0, r = e.length; n < r; n += 3)
  41982. rt.fromArray(e, n),
  41983. i = Math.max(i, t.distanceToSquared(rt));
  41984. this.boundingSphere.radius = Math.sqrt(i),
  41985. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  41986. }
  41987. }
  41988. ),
  41989. computeFaceNormals: function() {},
  41990. computeVertexNormals: function() {
  41991. var e = this.index
  41992. , t = this.attributes
  41993. , i = this.groups;
  41994. if (t.position) {
  41995. var n = t.position.array;
  41996. if (void 0 === t.normal)
  41997. this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
  41998. else
  41999. for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
  42000. r[o] = 0;
  42001. 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;
  42002. if (e) {
  42003. var m = e.array;
  42004. 0 === i.length && this.addGroup(0, m.length);
  42005. for (var v = 0, y = i.length; v < y; ++v) {
  42006. var A = i[v]
  42007. , C = A.start;
  42008. for (o = C,
  42009. a = C + A.count; o < a; o += 3)
  42010. s = 3 * m[o + 0],
  42011. l = 3 * m[o + 1],
  42012. c = 3 * m[o + 2],
  42013. u.fromArray(n, s),
  42014. d.fromArray(n, l),
  42015. p.fromArray(n, c),
  42016. f.subVectors(p, d),
  42017. g.subVectors(u, d),
  42018. f.cross(g),
  42019. h[s] += f.x,
  42020. h[1 + s] += f.y,
  42021. h[2 + s] += f.z,
  42022. h[l] += f.x,
  42023. h[1 + l] += f.y,
  42024. h[2 + l] += f.z,
  42025. h[c] += f.x,
  42026. h[1 + c] += f.y,
  42027. h[2 + c] += f.z
  42028. }
  42029. } else
  42030. for (o = 0,
  42031. a = n.length; o < a; o += 9)
  42032. u.fromArray(n, o),
  42033. d.fromArray(n, o + 3),
  42034. p.fromArray(n, o + 6),
  42035. f.subVectors(p, d),
  42036. g.subVectors(u, d),
  42037. f.cross(g),
  42038. h[o] = f.x,
  42039. h[o + 1] = f.y,
  42040. h[o + 2] = f.z,
  42041. h[o + 3] = f.x,
  42042. h[o + 4] = f.y,
  42043. h[o + 5] = f.z,
  42044. h[o + 6] = f.x,
  42045. h[o + 7] = f.y,
  42046. h[o + 8] = f.z;
  42047. this.normalizeNormals(),
  42048. t.normal.needsUpdate = !0
  42049. }
  42050. },
  42051. merge: function(e, t) {
  42052. if (e instanceof Ci.BufferGeometry != 0) {
  42053. void 0 === t && (t = 0);
  42054. var i = this.attributes;
  42055. for (var n in i)
  42056. if (void 0 !== e.attributes[n])
  42057. for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
  42058. l++)
  42059. r[l] = a[s];
  42060. return this
  42061. }
  42062. console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
  42063. },
  42064. normalizeNormals: function() {
  42065. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42066. e = r[o],
  42067. t = r[o + 1],
  42068. i = r[o + 2],
  42069. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42070. r[o] *= n,
  42071. r[o + 1] *= n,
  42072. r[o + 2] *= n
  42073. },
  42074. toNonIndexed: function() {
  42075. if (null === this.index)
  42076. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42077. this;
  42078. var e = new Ci.BufferGeometry
  42079. , t = this.index.array
  42080. , i = this.attributes;
  42081. for (var n in i) {
  42082. 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++) {
  42083. l = t[h] * a;
  42084. for (var d = 0; d < a; d++)
  42085. s[c++] = o[l++]
  42086. }
  42087. e.addAttribute(n, new Ci.BufferAttribute(s,a))
  42088. }
  42089. return e
  42090. },
  42091. toJSON: function() {
  42092. var e = {
  42093. metadata: {
  42094. version: 4.4,
  42095. type: "BufferGeometry",
  42096. generator: "BufferGeometry.toJSON"
  42097. }
  42098. };
  42099. if (e.uuid = this.uuid,
  42100. e.type = this.type,
  42101. "" !== this.name && (e.name = this.name),
  42102. void 0 !== this.parameters) {
  42103. var t = this.parameters;
  42104. for (var i in t)
  42105. void 0 !== t[i] && (e[i] = t[i]);
  42106. return e
  42107. }
  42108. e.data = {
  42109. attributes: {}
  42110. };
  42111. var n = this.index;
  42112. if (null !== n) {
  42113. var r = Array.prototype.slice.call(n.array);
  42114. e.data.index = {
  42115. type: n.array.constructor.name,
  42116. array: r
  42117. }
  42118. }
  42119. var o = this.attributes;
  42120. for (var i in o) {
  42121. var a = o[i];
  42122. r = Array.prototype.slice.call(a.array);
  42123. e.data.attributes[i] = {
  42124. itemSize: a.itemSize,
  42125. type: a.array.constructor.name,
  42126. array: r
  42127. }
  42128. }
  42129. var s = this.groups;
  42130. 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
  42131. var l = this.boundingSphere;
  42132. return null !== l && (e.data.boundingSphere = {
  42133. center: l.center.toArray(),
  42134. radius: l.radius
  42135. }),
  42136. e
  42137. },
  42138. clone: function() {
  42139. return (new Ci.BufferGeometry).copy(this)
  42140. },
  42141. copy: function(e) {
  42142. var t = e.index;
  42143. null !== t && this.setIndex(t.clone());
  42144. var i = e.attributes;
  42145. for (var n in i) {
  42146. var r = i[n];
  42147. this.addAttribute(n, r.clone())
  42148. }
  42149. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42150. var l = o[a];
  42151. this.addGroup(l.start, l.count)
  42152. }
  42153. return this
  42154. },
  42155. dispose: function() {
  42156. this.dispatchEvent({
  42157. type: "dispose"
  42158. })
  42159. }
  42160. },
  42161. Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
  42162. Ci.BufferGeometry.MaxIndex = 65535,
  42163. Ci.InstancedBufferGeometry = function() {
  42164. Ci.BufferGeometry.call(this),
  42165. this.type = "InstancedBufferGeometry",
  42166. this.maxInstancedCount = void 0
  42167. }
  42168. ,
  42169. Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  42170. Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
  42171. Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  42172. this.groups.push({
  42173. start: e,
  42174. count: t,
  42175. instances: i
  42176. })
  42177. }
  42178. ,
  42179. Ci.InstancedBufferGeometry.prototype.copy = function(e) {
  42180. var t = e.index;
  42181. null !== t && this.setIndex(t.clone());
  42182. var i = e.attributes;
  42183. for (var n in i) {
  42184. var r = i[n];
  42185. this.addAttribute(n, r.clone())
  42186. }
  42187. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42188. var l = o[a];
  42189. this.addGroup(l.start, l.count, l.instances)
  42190. }
  42191. return this
  42192. }
  42193. ,
  42194. Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
  42195. Ci.Uniform = function(e, t) {
  42196. this.type = e,
  42197. this.value = t,
  42198. this.dynamic = !1
  42199. }
  42200. ,
  42201. Ci.Uniform.prototype = {
  42202. constructor: Ci.Uniform,
  42203. onUpdate: function(e) {
  42204. return this.dynamic = !0,
  42205. this.onUpdateCallback = e,
  42206. this
  42207. }
  42208. },
  42209. Ci.AnimationClip = function(e, t, i) {
  42210. this.name = e || Ci.Math.generateUUID(),
  42211. this.tracks = i,
  42212. this.duration = void 0 !== t ? t : -1,
  42213. this.duration < 0 && this.resetDuration(),
  42214. this.trim(),
  42215. this.optimize()
  42216. }
  42217. ,
  42218. Ci.AnimationClip.prototype = {
  42219. constructor: Ci.AnimationClip,
  42220. resetDuration: function() {
  42221. for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
  42222. var n = this.tracks[t];
  42223. e = Math.max(e, n.times[n.times.length - 1])
  42224. }
  42225. this.duration = e
  42226. },
  42227. trim: function() {
  42228. for (var e = 0; e < this.tracks.length; e++)
  42229. this.tracks[e].trim(0, this.duration);
  42230. return this
  42231. },
  42232. optimize: function() {
  42233. for (var e = 0; e < this.tracks.length; e++)
  42234. this.tracks[e].optimize();
  42235. return this
  42236. }
  42237. },
  42238. Object.assign(Ci.AnimationClip, {
  42239. parse: function(e) {
  42240. for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
  42241. t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
  42242. return new Ci.AnimationClip(e.name,e.duration,t)
  42243. },
  42244. toJSON: function(e) {
  42245. for (var t = [], i = e.tracks, n = {
  42246. name: e.name,
  42247. duration: e.duration,
  42248. tracks: t
  42249. }, r = 0, o = i.length; r !== o; ++r)
  42250. t.push(Ci.KeyframeTrack.toJSON(i[r]));
  42251. return n
  42252. },
  42253. CreateFromMorphTargetSequence: function(e, t, i) {
  42254. for (var n = t.length, r = [], o = 0; o < n; o++) {
  42255. var a = []
  42256. , s = [];
  42257. a.push((o + n - 1) % n, o, (o + 1) % n),
  42258. s.push(0, 1, 0);
  42259. var l = Ci.AnimationUtils.getKeyframeOrder(a);
  42260. a = Ci.AnimationUtils.sortedArray(a, 1, l),
  42261. s = Ci.AnimationUtils.sortedArray(s, 1, l),
  42262. 0 === a[0] && (a.push(n),
  42263. s.push(s[0])),
  42264. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
  42265. }
  42266. return new Ci.AnimationClip(e,-1,r)
  42267. },
  42268. findByName: function(e, t) {
  42269. for (var i = 0; i < e.length; i++)
  42270. if (e[i].name === t)
  42271. return e[i];
  42272. return null
  42273. },
  42274. CreateClipsFromMorphTargetSequences: function(e, t) {
  42275. for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
  42276. var a = e[r]
  42277. , s = a.name.match(n);
  42278. if (s && 1 < s.length) {
  42279. var l = i[h = s[1]];
  42280. l || (i[h] = l = []),
  42281. l.push(a)
  42282. }
  42283. }
  42284. var c = [];
  42285. for (var h in i)
  42286. c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
  42287. return c
  42288. },
  42289. parseAnimation: function(e, t, i) {
  42290. if (!e)
  42291. return console.error(" no animation in JSONLoader data"),
  42292. null;
  42293. function n(e, t, i, n, r) {
  42294. if (0 !== i.length) {
  42295. var o = []
  42296. , a = [];
  42297. Ci.AnimationUtils.flattenJSON(i, o, a, n),
  42298. 0 !== o.length && r.push(new e(t,o,a))
  42299. }
  42300. }
  42301. for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
  42302. var h = l[c].keys;
  42303. if (h && 0 != h.length)
  42304. if (h[0].morphTargets) {
  42305. for (var u = {}, d = 0; d < h.length; d++)
  42306. if (h[d].morphTargets)
  42307. for (var p = 0; p < h[d].morphTargets.length; p++)
  42308. u[h[d].morphTargets[p]] = -1;
  42309. for (var f in u) {
  42310. var g = []
  42311. , m = [];
  42312. for (p = 0; p !== h[d].morphTargets.length; ++p) {
  42313. var v = h[d];
  42314. g.push(v.time),
  42315. m.push(v.morphTarget === f ? 1 : 0)
  42316. }
  42317. r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
  42318. }
  42319. a = u.length * (s || 1)
  42320. } else {
  42321. var y = ".bones[" + t[c].name + "]";
  42322. n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
  42323. n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
  42324. n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
  42325. }
  42326. }
  42327. return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
  42328. }
  42329. }),
  42330. Ci.AnimationMixer = function(e) {
  42331. this._root = e,
  42332. this._initMemoryManager(),
  42333. this._accuIndex = 0,
  42334. this.time = 0,
  42335. this.timeScale = 1
  42336. }
  42337. ,
  42338. Ci.AnimationMixer.prototype = {
  42339. constructor: Ci.AnimationMixer,
  42340. clipAction: function(e, t) {
  42341. var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
  42342. if (void 0 !== a) {
  42343. var s = a.actionByRoot[n];
  42344. if (void 0 !== s)
  42345. return s;
  42346. if (o = (i = a.knownActions[0])._clip,
  42347. e !== r && e !== o)
  42348. throw new Error("Different clips with the same name detected!")
  42349. }
  42350. if (null === o)
  42351. return null;
  42352. var l = new Ci.AnimationMixer._Action(this,o,t);
  42353. return this._bindAction(l, i),
  42354. this._addInactiveAction(l, r, n),
  42355. l
  42356. },
  42357. existingAction: function(e, t) {
  42358. var i = (t || this._root).uuid
  42359. , n = "string" == typeof e ? e : e.name
  42360. , r = this._actionsByClip[n];
  42361. return void 0 !== r && r.actionByRoot[i] || null
  42362. },
  42363. stopAllAction: function() {
  42364. var e = this._actions
  42365. , t = this._nActiveActions
  42366. , i = this._bindings
  42367. , n = this._nActiveBindings;
  42368. this._nActiveActions = 0;
  42369. for (var r = this._nActiveBindings = 0; r !== t; ++r)
  42370. e[r].reset();
  42371. for (r = 0; r !== n; ++r)
  42372. i[r].useCount = 0;
  42373. return this
  42374. },
  42375. update: function(e) {
  42376. e *= this.timeScale;
  42377. 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) {
  42378. var s = t[a];
  42379. s.enabled && s._update(n, e, r, o)
  42380. }
  42381. var l = this._bindings
  42382. , c = this._nActiveBindings;
  42383. for (a = 0; a !== c; ++a)
  42384. l[a].apply(o);
  42385. return this
  42386. },
  42387. getRoot: function() {
  42388. return this._root
  42389. },
  42390. uncacheClip: function(e) {
  42391. var t = this._actions
  42392. , i = e.name
  42393. , n = this._actionsByClip
  42394. , r = n[i];
  42395. if (void 0 !== r) {
  42396. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  42397. var l = o[a];
  42398. this._deactivateAction(l);
  42399. var c = l._cacheIndex
  42400. , h = t[t.length - 1];
  42401. l._cacheIndex = null,
  42402. l._byClipCacheIndex = null,
  42403. t[h._cacheIndex = c] = h,
  42404. t.pop(),
  42405. this._removeInactiveBindingsForAction(l)
  42406. }
  42407. delete n[i]
  42408. }
  42409. },
  42410. uncacheRoot: function(e) {
  42411. var t = e.uuid
  42412. , i = this._actionsByClip;
  42413. for (var n in i) {
  42414. var r = i[n].actionByRoot[t];
  42415. void 0 !== r && (this._deactivateAction(r),
  42416. this._removeInactiveAction(r))
  42417. }
  42418. var o = this._bindingsByRootAndName[t];
  42419. if (void 0 !== o)
  42420. for (var a in o) {
  42421. var s = o[a];
  42422. s.restoreOriginalState(),
  42423. this._removeInactiveBinding(s)
  42424. }
  42425. },
  42426. uncacheAction: function(e, t) {
  42427. var i = this.existingAction(e, t);
  42428. null !== i && (this._deactivateAction(i),
  42429. this._removeInactiveAction(i))
  42430. }
  42431. },
  42432. Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
  42433. Ci.AnimationMixer._Action = function(e, t, i) {
  42434. this._mixer = e,
  42435. this._clip = t,
  42436. this._localRoot = i || null;
  42437. for (var n = t.tracks, r = n.length, o = new Array(r), a = {
  42438. endingStart: Ci.ZeroCurvatureEnding,
  42439. endingEnd: Ci.ZeroCurvatureEnding
  42440. }, s = 0; s !== r; ++s) {
  42441. var l = n[s].createInterpolant(null);
  42442. (o[s] = l).settings = a
  42443. }
  42444. this._interpolantSettings = a,
  42445. this._interpolants = o,
  42446. this._propertyBindings = new Array(r),
  42447. this._cacheIndex = null,
  42448. this._byClipCacheIndex = null,
  42449. this._timeScaleInterpolant = null,
  42450. this._weightInterpolant = null,
  42451. this.loop = Ci.LoopRepeat,
  42452. this._loopCount = -1,
  42453. this._startTime = null,
  42454. this.time = 0,
  42455. this.timeScale = 1,
  42456. this._effectiveTimeScale = 1,
  42457. this.weight = 1,
  42458. this._effectiveWeight = 1,
  42459. this.repetitions = 1 / 0,
  42460. this.paused = !1,
  42461. this.enabled = !0,
  42462. this.clampWhenFinished = !1,
  42463. this.zeroSlopeAtStart = !0,
  42464. this.zeroSlopeAtEnd = !0
  42465. }
  42466. ,
  42467. Ci.AnimationMixer._Action.prototype = {
  42468. constructor: Ci.AnimationMixer._Action,
  42469. play: function() {
  42470. return this._mixer._activateAction(this),
  42471. this
  42472. },
  42473. stop: function() {
  42474. return this._mixer._deactivateAction(this),
  42475. this.reset()
  42476. },
  42477. reset: function() {
  42478. return this.paused = !1,
  42479. this.enabled = !0,
  42480. this.time = 0,
  42481. this._loopCount = -1,
  42482. this._startTime = null,
  42483. this.stopFading().stopWarping()
  42484. },
  42485. isRunning: function() {
  42486. return this._startTime,
  42487. this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  42488. },
  42489. isScheduled: function() {
  42490. return this._mixer._isActiveAction(this)
  42491. },
  42492. startAt: function(e) {
  42493. return this._startTime = e,
  42494. this
  42495. },
  42496. setLoop: function(e, t) {
  42497. return this.loop = e,
  42498. this.repetitions = t,
  42499. this
  42500. },
  42501. setEffectiveWeight: function(e) {
  42502. return this.weight = e,
  42503. this._effectiveWeight = this.enabled ? e : 0,
  42504. this.stopFading()
  42505. },
  42506. getEffectiveWeight: function() {
  42507. return this._effectiveWeight
  42508. },
  42509. fadeIn: function(e) {
  42510. return this._scheduleFading(e, 0, 1)
  42511. },
  42512. fadeOut: function(e) {
  42513. return this._scheduleFading(e, 1, 0)
  42514. },
  42515. crossFadeFrom: function(e, t, i) {
  42516. if (this._mixer,
  42517. e.fadeOut(t),
  42518. this.fadeIn(t),
  42519. i) {
  42520. var n = this._clip.duration
  42521. , r = e._clip.duration
  42522. , o = r / n
  42523. , a = n / r;
  42524. e.warp(1, o, t),
  42525. this.warp(a, 1, t)
  42526. }
  42527. return this
  42528. },
  42529. crossFadeTo: function(e, t, i) {
  42530. return e.crossFadeFrom(this, t, i)
  42531. },
  42532. stopFading: function() {
  42533. var e = this._weightInterpolant;
  42534. return null !== e && (this._weightInterpolant = null,
  42535. this._mixer._takeBackControlInterpolant(e)),
  42536. this
  42537. },
  42538. setEffectiveTimeScale: function(e) {
  42539. return this.timeScale = e,
  42540. this._effectiveTimeScale = this.paused ? 0 : e,
  42541. this.stopWarping()
  42542. },
  42543. getEffectiveTimeScale: function() {
  42544. return this._effectiveTimeScale
  42545. },
  42546. setDuration: function(e) {
  42547. return this.timeScale = this._clip.duration / e,
  42548. this.stopWarping()
  42549. },
  42550. syncWith: function(e) {
  42551. return this.time = e.time,
  42552. this.timeScale = e.timeScale,
  42553. this.stopWarping()
  42554. },
  42555. halt: function(e) {
  42556. return this.warp(this._currentTimeScale, 0, e)
  42557. },
  42558. warp: function(e, t, i) {
  42559. var n = this._mixer
  42560. , r = n.time
  42561. , o = this._timeScaleInterpolant
  42562. , a = this.timeScale;
  42563. null === o && (o = n._lendControlInterpolant(),
  42564. this._timeScaleInterpolant = o);
  42565. var s = o.parameterPositions
  42566. , l = o.sampleValues;
  42567. return s[0] = r,
  42568. s[1] = r + i,
  42569. l[0] = e / a,
  42570. l[1] = t / a,
  42571. this
  42572. },
  42573. stopWarping: function() {
  42574. var e = this._timeScaleInterpolant;
  42575. return null !== e && (this._timeScaleInterpolant = null,
  42576. this._mixer._takeBackControlInterpolant(e)),
  42577. this
  42578. },
  42579. getMixer: function() {
  42580. return this._mixer
  42581. },
  42582. getClip: function() {
  42583. return this._clip
  42584. },
  42585. getRoot: function() {
  42586. return this._localRoot || this._mixer._root
  42587. },
  42588. _update: function(e, t, i, n) {
  42589. var r = this._startTime;
  42590. if (null !== r) {
  42591. var o = (e - r) * i;
  42592. if (o < 0 || 0 === i)
  42593. return;
  42594. this._startTime = null,
  42595. t = i * o
  42596. }
  42597. t *= this._updateTimeScale(e);
  42598. var a = this._updateTime(t)
  42599. , s = this._updateWeight(e);
  42600. if (0 < s)
  42601. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  42602. l[h].evaluate(a),
  42603. c[h].accumulate(n, s)
  42604. },
  42605. _updateWeight: function(e) {
  42606. var t = 0;
  42607. if (this.enabled) {
  42608. t = this.weight;
  42609. var i = this._weightInterpolant;
  42610. if (null !== i) {
  42611. var n = i.evaluate(e)[0];
  42612. t *= n,
  42613. e > i.parameterPositions[1] && (this.stopFading(),
  42614. 0 === n && (this.enabled = !1))
  42615. }
  42616. }
  42617. return this._effectiveWeight = t
  42618. },
  42619. _updateTimeScale: function(e) {
  42620. var t = 0;
  42621. if (!this.paused) {
  42622. t = this.timeScale;
  42623. var i = this._timeScaleInterpolant;
  42624. if (null !== i)
  42625. t *= i.evaluate(e)[0],
  42626. e > i.parameterPositions[1] && (this.stopWarping(),
  42627. 0 === t ? this.pause = !0 : this.timeScale = t)
  42628. }
  42629. return this._effectiveTimeScale = t
  42630. },
  42631. _updateTime: function(e) {
  42632. var t = this.time + e;
  42633. if (0 === e)
  42634. return t;
  42635. var i = this._clip.duration
  42636. , n = this.loop
  42637. , r = this._loopCount
  42638. , o = !1;
  42639. switch (n) {
  42640. case Ci.LoopOnce:
  42641. if (-1 === r && (this.loopCount = 0,
  42642. this._setEndings(!0, !0, !1)),
  42643. i <= t)
  42644. t = i;
  42645. else {
  42646. if (!(t < 0))
  42647. break;
  42648. t = 0
  42649. }
  42650. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  42651. this._mixer.dispatchEvent({
  42652. type: "finished",
  42653. action: this,
  42654. direction: e < 0 ? -1 : 1
  42655. });
  42656. break;
  42657. case Ci.LoopPingPong:
  42658. o = !0;
  42659. case Ci.LoopRepeat:
  42660. if (-1 === r && (0 < e ? (r = 0,
  42661. this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
  42662. i <= t || t < 0) {
  42663. var a = Math.floor(t / i);
  42664. t -= i * a,
  42665. r += Math.abs(a);
  42666. var s = this.repetitions - r;
  42667. if (s < 0) {
  42668. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  42669. t = 0 < e ? i : 0,
  42670. this._mixer.dispatchEvent({
  42671. type: "finished",
  42672. action: this,
  42673. direction: 0 < e ? 1 : -1
  42674. });
  42675. break
  42676. }
  42677. if (0 == s) {
  42678. var l = e < 0;
  42679. this._setEndings(l, !l, o)
  42680. } else
  42681. this._setEndings(!1, !1, o);
  42682. this._loopCount = r,
  42683. this._mixer.dispatchEvent({
  42684. type: "loop",
  42685. action: this,
  42686. loopDelta: a
  42687. })
  42688. }
  42689. if (n === Ci.LoopPingPong && 1 == (1 & r))
  42690. return i - (this.time = t)
  42691. }
  42692. return this.time = t
  42693. },
  42694. _setEndings: function(e, t, i) {
  42695. var n = this._interpolantSettings;
  42696. i ? (n.endingStart = Ci.ZeroSlopeEnding,
  42697. n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
  42698. n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
  42699. },
  42700. _scheduleFading: function(e, t, i) {
  42701. var n = this._mixer
  42702. , r = n.time
  42703. , o = this._weightInterpolant;
  42704. null === o && (o = n._lendControlInterpolant(),
  42705. this._weightInterpolant = o);
  42706. var a = o.parameterPositions
  42707. , s = o.sampleValues;
  42708. return a[0] = r,
  42709. s[0] = t,
  42710. a[1] = r + e,
  42711. s[1] = i,
  42712. this
  42713. }
  42714. },
  42715. Object.assign(Ci.AnimationMixer.prototype, {
  42716. _bindAction: function(e, t) {
  42717. var i = e._localRoot || this._root
  42718. , n = e._clip.tracks
  42719. , r = n.length
  42720. , o = e._propertyBindings
  42721. , a = e._interpolants
  42722. , s = i.uuid
  42723. , l = this._bindingsByRootAndName
  42724. , c = l[s];
  42725. void 0 === c && (c = {},
  42726. l[s] = c);
  42727. for (var h = 0; h !== r; ++h) {
  42728. var u = n[h]
  42729. , d = u.name
  42730. , p = c[d];
  42731. if (void 0 !== p)
  42732. o[h] = p;
  42733. else {
  42734. if (void 0 !== (p = o[h])) {
  42735. null === p._cacheIndex && (++p.referenceCount,
  42736. this._addInactiveBinding(p, s, d));
  42737. continue
  42738. }
  42739. var f = t && t._propertyBindings[h].binding.parsedPath;
  42740. ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
  42741. this._addInactiveBinding(p, s, d),
  42742. o[h] = p
  42743. }
  42744. a[h].resultBuffer = p.buffer
  42745. }
  42746. },
  42747. _activateAction: function(e) {
  42748. if (!this._isActiveAction(e)) {
  42749. if (null === e._cacheIndex) {
  42750. var t = (e._localRoot || this._root).uuid
  42751. , i = e._clip.name
  42752. , n = this._actionsByClip[i];
  42753. this._bindAction(e, n && n.knownActions[0]),
  42754. this._addInactiveAction(e, i, t)
  42755. }
  42756. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  42757. var s = r[o];
  42758. 0 == s.useCount++ && (this._lendBinding(s),
  42759. s.saveOriginalState())
  42760. }
  42761. this._lendAction(e)
  42762. }
  42763. },
  42764. _deactivateAction: function(e) {
  42765. if (this._isActiveAction(e)) {
  42766. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  42767. var r = t[i];
  42768. 0 == --r.useCount && (r.restoreOriginalState(),
  42769. this._takeBackBinding(r))
  42770. }
  42771. this._takeBackAction(e)
  42772. }
  42773. },
  42774. _initMemoryManager: function() {
  42775. this._actions = [],
  42776. this._nActiveActions = 0,
  42777. this._actionsByClip = {},
  42778. this._bindings = [],
  42779. this._nActiveBindings = 0,
  42780. this._bindingsByRootAndName = {},
  42781. this._controlInterpolants = [],
  42782. this._nActiveControlInterpolants = 0;
  42783. var e = this;
  42784. this.stats = {
  42785. actions: {
  42786. get total() {
  42787. return e._actions.length
  42788. },
  42789. get inUse() {
  42790. return e._nActiveActions
  42791. }
  42792. },
  42793. bindings: {
  42794. get total() {
  42795. return e._bindings.length
  42796. },
  42797. get inUse() {
  42798. return e._nActiveBindings
  42799. }
  42800. },
  42801. controlInterpolants: {
  42802. get total() {
  42803. return e._controlInterpolants.length
  42804. },
  42805. get inUse() {
  42806. return e._nActiveControlInterpolants
  42807. }
  42808. }
  42809. }
  42810. },
  42811. _isActiveAction: function(e) {
  42812. var t = e._cacheIndex;
  42813. return null !== t && t < this._nActiveActions
  42814. },
  42815. _addInactiveAction: function(e, t, i) {
  42816. var n = this._actions
  42817. , r = this._actionsByClip
  42818. , o = r[t];
  42819. if (void 0 === o)
  42820. o = {
  42821. knownActions: [e],
  42822. actionByRoot: {}
  42823. },
  42824. e._byClipCacheIndex = 0,
  42825. r[t] = o;
  42826. else {
  42827. var a = o.knownActions;
  42828. e._byClipCacheIndex = a.length,
  42829. a.push(e)
  42830. }
  42831. e._cacheIndex = n.length,
  42832. n.push(e),
  42833. o.actionByRoot[i] = e
  42834. },
  42835. _removeInactiveAction: function(e) {
  42836. var t = this._actions
  42837. , i = t[t.length - 1]
  42838. , n = e._cacheIndex;
  42839. t[i._cacheIndex = n] = i,
  42840. t.pop(),
  42841. e._cacheIndex = null;
  42842. var r = e._clip.name
  42843. , o = this._actionsByClip
  42844. , a = o[r]
  42845. , s = a.knownActions
  42846. , l = s[s.length - 1]
  42847. , c = e._byClipCacheIndex;
  42848. s[l._byClipCacheIndex = c] = l,
  42849. s.pop(),
  42850. e._byClipCacheIndex = null,
  42851. delete a.actionByRoot[(t._localRoot || this._root).uuid],
  42852. 0 === s.length && delete o[r],
  42853. this._removeInactiveBindingsForAction(e)
  42854. },
  42855. _removeInactiveBindingsForAction: function(e) {
  42856. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  42857. var r = t[i];
  42858. 0 == --r.referenceCount && this._removeInactiveBinding(r)
  42859. }
  42860. },
  42861. _lendAction: function(e) {
  42862. var t = this._actions
  42863. , i = e._cacheIndex
  42864. , n = this._nActiveActions++
  42865. , r = t[n];
  42866. t[e._cacheIndex = n] = e,
  42867. t[r._cacheIndex = i] = r
  42868. },
  42869. _takeBackAction: function(e) {
  42870. var t = this._actions
  42871. , i = e._cacheIndex
  42872. , n = --this._nActiveActions
  42873. , r = t[n];
  42874. t[e._cacheIndex = n] = e,
  42875. t[r._cacheIndex = i] = r
  42876. },
  42877. _addInactiveBinding: function(e, t, i) {
  42878. var n = this._bindingsByRootAndName
  42879. , r = n[t]
  42880. , o = this._bindings;
  42881. void 0 === r && (r = {},
  42882. n[t] = r),
  42883. (r[i] = e)._cacheIndex = o.length,
  42884. o.push(e)
  42885. },
  42886. _removeInactiveBinding: function(e) {
  42887. var t = this._bindings
  42888. , i = e.binding
  42889. , n = i.rootNode.uuid
  42890. , r = i.path
  42891. , o = this._bindingsByRootAndName
  42892. , a = o[n]
  42893. , s = t[t.length - 1]
  42894. , l = e._cacheIndex;
  42895. t[s._cacheIndex = l] = s,
  42896. t.pop(),
  42897. delete a[r];
  42898. e: {
  42899. for (var c in a)
  42900. break e;
  42901. delete o[n]
  42902. }
  42903. },
  42904. _lendBinding: function(e) {
  42905. var t = this._bindings
  42906. , i = e._cacheIndex
  42907. , n = this._nActiveBindings++
  42908. , r = t[n];
  42909. t[e._cacheIndex = n] = e,
  42910. t[r._cacheIndex = i] = r
  42911. },
  42912. _takeBackBinding: function(e) {
  42913. var t = this._bindings
  42914. , i = e._cacheIndex
  42915. , n = --this._nActiveBindings
  42916. , r = t[n];
  42917. t[e._cacheIndex = n] = e,
  42918. t[r._cacheIndex = i] = r
  42919. },
  42920. _lendControlInterpolant: function() {
  42921. var e = this._controlInterpolants
  42922. , t = this._nActiveControlInterpolants++
  42923. , i = e[t];
  42924. return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
  42925. i
  42926. },
  42927. _takeBackControlInterpolant: function(e) {
  42928. var t = this._controlInterpolants
  42929. , i = e.__cacheIndex
  42930. , n = --this._nActiveControlInterpolants
  42931. , r = t[n];
  42932. t[e.__cacheIndex = n] = e,
  42933. t[r.__cacheIndex = i] = r
  42934. },
  42935. _controlInterpolantsResultBuffer: new Float32Array(1)
  42936. }),
  42937. Ci.AnimationObjectGroup = function(e) {
  42938. this.uuid = Ci.Math.generateUUID(),
  42939. this._objects = Array.prototype.slice.call(arguments),
  42940. this.nCachedObjects_ = 0;
  42941. var t = {};
  42942. this._indicesByUUID = t;
  42943. for (var i = 0, n = arguments.length; i !== n; ++i)
  42944. t[arguments[i].uuid] = i;
  42945. this._paths = [],
  42946. this._parsedPaths = [],
  42947. this._bindings = [],
  42948. this._bindingsIndicesByPath = {};
  42949. var r = this;
  42950. this.stats = {
  42951. objects: {
  42952. get total() {
  42953. return r._objects.length
  42954. },
  42955. get inUse() {
  42956. return this.total - r.nCachedObjects_
  42957. }
  42958. },
  42959. get bindingsPerObject() {
  42960. return r._bindings.length
  42961. }
  42962. }
  42963. }
  42964. ,
  42965. Ci.AnimationObjectGroup.prototype = {
  42966. constructor: Ci.AnimationObjectGroup,
  42967. add: function(e) {
  42968. 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) {
  42969. var u = arguments[c]
  42970. , d = u.uuid
  42971. , p = r[d];
  42972. if (void 0 === p) {
  42973. p = i++,
  42974. r[d] = p,
  42975. t.push(u);
  42976. for (var f = 0, g = l; f !== g; ++f)
  42977. s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
  42978. } else if (p < n) {
  42979. var m = t[p]
  42980. , v = --n
  42981. , y = t[v];
  42982. t[r[y.uuid] = p] = y,
  42983. t[r[d] = v] = u;
  42984. for (f = 0,
  42985. g = l; f !== g; ++f) {
  42986. var A = s[f]
  42987. , C = A[v]
  42988. , I = A[p];
  42989. A[p] = C,
  42990. void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
  42991. A[v] = I
  42992. }
  42993. } else
  42994. t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  42995. }
  42996. this.nCachedObjects_ = n
  42997. },
  42998. remove: function(e) {
  42999. for (var t = this._objects, i = (t.length,
  43000. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43001. var l = arguments[a]
  43002. , c = l.uuid
  43003. , h = n[c];
  43004. if (void 0 !== h && i <= h) {
  43005. var u = i++
  43006. , d = t[u];
  43007. t[n[d.uuid] = h] = d,
  43008. t[n[c] = u] = l;
  43009. for (var p = 0, f = o; p !== f; ++p) {
  43010. var g = r[p]
  43011. , m = g[u]
  43012. , v = g[h];
  43013. g[h] = m,
  43014. g[u] = v
  43015. }
  43016. }
  43017. }
  43018. this.nCachedObjects_ = i
  43019. },
  43020. uncache: function(e) {
  43021. 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) {
  43022. var c = arguments[s].uuid
  43023. , h = r[c];
  43024. if (void 0 !== h)
  43025. if (delete r[c],
  43026. h < n) {
  43027. var u = --n
  43028. , d = t[u]
  43029. , p = t[y = --i];
  43030. t[r[d.uuid] = h] = d,
  43031. t[r[p.uuid] = u] = p,
  43032. t.pop();
  43033. for (var f = 0, g = a; f !== g; ++f) {
  43034. var m = (A = o[f])[u]
  43035. , v = A[y];
  43036. A[h] = m,
  43037. A[u] = v,
  43038. A.pop()
  43039. }
  43040. } else {
  43041. var y;
  43042. t[r[(p = t[y = --i]).uuid] = h] = p,
  43043. t.pop();
  43044. for (f = 0,
  43045. g = a; f !== g; ++f) {
  43046. var A;
  43047. (A = o[f])[h] = A[y],
  43048. A.pop()
  43049. }
  43050. }
  43051. }
  43052. this.nCachedObjects_ = n
  43053. },
  43054. subscribe_: function(e, t) {
  43055. var i = this._bindingsIndicesByPath
  43056. , n = i[e]
  43057. , r = this._bindings;
  43058. if (void 0 !== n)
  43059. return r[n];
  43060. var o = this._paths
  43061. , a = this._parsedPaths
  43062. , s = this._objects
  43063. , l = s.length
  43064. , c = this.nCachedObjects_
  43065. , h = new Array(l);
  43066. n = r.length,
  43067. i[e] = n,
  43068. o.push(e),
  43069. a.push(t),
  43070. r.push(h);
  43071. for (var u = c, d = s.length; u !== d; ++u) {
  43072. var p = s[u];
  43073. h[u] = new Ci.PropertyBinding(p,e,t)
  43074. }
  43075. return h
  43076. },
  43077. unsubscribe_: function(e) {
  43078. var t = this._bindingsIndicesByPath
  43079. , i = t[e];
  43080. if (void 0 !== i) {
  43081. var n = this._paths
  43082. , r = this._parsedPaths
  43083. , o = this._bindings
  43084. , a = o.length - 1
  43085. , s = o[a];
  43086. o[t[e[a]] = i] = s,
  43087. o.pop(),
  43088. r[i] = r[a],
  43089. r.pop(),
  43090. n[i] = n[a],
  43091. n.pop()
  43092. }
  43093. }
  43094. },
  43095. Ci.AnimationUtils = {
  43096. arraySlice: function(e, t, i) {
  43097. return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43098. },
  43099. convertArray: function(e, t, i) {
  43100. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43101. },
  43102. isTypedArray: function(e) {
  43103. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43104. },
  43105. getKeyframeOrder: function(i) {
  43106. for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
  43107. t[n] = n;
  43108. return t.sort(function(e, t) {
  43109. return i[e] - i[t]
  43110. }),
  43111. t
  43112. },
  43113. sortedArray: function(e, t, i) {
  43114. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  43115. for (var s = i[o] * t, l = 0; l !== t; ++l)
  43116. r[a++] = e[s + l];
  43117. return r
  43118. },
  43119. flattenJSON: function(e, t, i, n) {
  43120. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  43121. o = e[r++];
  43122. if (void 0 !== o) {
  43123. var a = o[n];
  43124. if (void 0 !== a)
  43125. if (Array.isArray(a))
  43126. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43127. i.push.apply(i, a)),
  43128. void 0 !== (o = e[r++]); )
  43129. ;
  43130. else if (void 0 !== a.toArray)
  43131. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43132. a.toArray(i, i.length)),
  43133. void 0 !== (o = e[r++]); )
  43134. ;
  43135. else
  43136. for (; void 0 !== (a = o[n]) && (t.push(o.time),
  43137. i.push(a)),
  43138. void 0 !== (o = e[r++]); )
  43139. ;
  43140. }
  43141. }
  43142. },
  43143. Ci.KeyframeTrack = function(e, t, i, n) {
  43144. if (void 0 === e)
  43145. throw new Error("track name is undefined");
  43146. if (void 0 === t || 0 === t.length)
  43147. throw new Error("no keyframes in track named " + e);
  43148. this.name = e,
  43149. this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
  43150. this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
  43151. this.setInterpolation(n || this.DefaultInterpolation),
  43152. this.validate(),
  43153. this.optimize()
  43154. }
  43155. ,
  43156. Ci.KeyframeTrack.prototype = {
  43157. constructor: Ci.KeyframeTrack,
  43158. TimeBufferType: Float32Array,
  43159. ValueBufferType: Float32Array,
  43160. DefaultInterpolation: Ci.InterpolateLinear,
  43161. InterpolantFactoryMethodDiscrete: function(e) {
  43162. return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  43163. },
  43164. InterpolantFactoryMethodLinear: function(e) {
  43165. return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43166. },
  43167. InterpolantFactoryMethodSmooth: function(e) {
  43168. return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  43169. },
  43170. setInterpolation: function(e) {
  43171. var t = void 0;
  43172. switch (e) {
  43173. case Ci.InterpolateDiscrete:
  43174. t = this.InterpolantFactoryMethodDiscrete;
  43175. break;
  43176. case Ci.InterpolateLinear:
  43177. t = this.InterpolantFactoryMethodLinear;
  43178. break;
  43179. case Ci.InterpolateSmooth:
  43180. t = this.InterpolantFactoryMethodSmooth
  43181. }
  43182. if (void 0 !== t)
  43183. this.createInterpolant = t;
  43184. else {
  43185. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  43186. if (void 0 === this.createInterpolant) {
  43187. if (e === this.DefaultInterpolation)
  43188. throw new Error(i);
  43189. this.setInterpolation(this.DefaultInterpolation)
  43190. }
  43191. console.warn(i)
  43192. }
  43193. },
  43194. getInterpolation: function() {
  43195. switch (this.createInterpolant) {
  43196. case this.InterpolantFactoryMethodDiscrete:
  43197. return Ci.InterpolateDiscrete;
  43198. case this.InterpolantFactoryMethodLinear:
  43199. return Ci.InterpolateLinear;
  43200. case this.InterpolantFactoryMethodSmooth:
  43201. return Ci.InterpolateSmooth
  43202. }
  43203. },
  43204. getValueSize: function() {
  43205. return this.values.length / this.times.length
  43206. },
  43207. shift: function(e) {
  43208. if (0 !== e)
  43209. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43210. t[i] += e;
  43211. return this
  43212. },
  43213. scale: function(e) {
  43214. if (1 !== e)
  43215. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  43216. t[i] *= e;
  43217. return this
  43218. },
  43219. trim: function(e, t) {
  43220. for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
  43221. ++r;
  43222. for (; -1 !== o && i[o] > t; )
  43223. --o;
  43224. if (++o,
  43225. 0 !== r || o !== n) {
  43226. o <= r && (r = (o = Math.max(o, 1)) - 1);
  43227. var a = this.getValueSize();
  43228. this.times = Ci.AnimationUtils.arraySlice(i, r, o),
  43229. this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
  43230. }
  43231. return this
  43232. },
  43233. validate: function() {
  43234. var e = !0
  43235. , t = this.getValueSize();
  43236. t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
  43237. e = !1);
  43238. var i = this.times
  43239. , n = this.values
  43240. , r = i.length;
  43241. 0 === r && (console.error("track is empty", this),
  43242. e = !1);
  43243. for (var o = null, a = 0; a !== r; a++) {
  43244. var s = i[a];
  43245. if ("number" == typeof s && isNaN(s)) {
  43246. console.error("time is not a valid number", this, a, s),
  43247. e = !1;
  43248. break
  43249. }
  43250. if (null !== o && s < o) {
  43251. console.error("out of order keys", this, a, s, o),
  43252. e = !1;
  43253. break
  43254. }
  43255. o = s
  43256. }
  43257. if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
  43258. a = 0;
  43259. for (var l = n.length; a !== l; ++a) {
  43260. var c = n[a];
  43261. if (isNaN(c)) {
  43262. console.error("value is not a valid number", this, a, c),
  43263. e = !1;
  43264. break
  43265. }
  43266. }
  43267. }
  43268. return e
  43269. },
  43270. optimize: function() {
  43271. for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
  43272. var a = !1
  43273. , s = e[r];
  43274. if (s !== e[r + 1] && (1 !== r || s !== s[0]))
  43275. for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
  43276. var d = t[l + u];
  43277. if (d !== t[c + u] || d !== t[h + u]) {
  43278. a = !0;
  43279. break
  43280. }
  43281. }
  43282. if (a) {
  43283. if (r !== n) {
  43284. e[n] = e[r];
  43285. var p = r * i
  43286. , f = n * i;
  43287. for (u = 0; u !== i; ++u)
  43288. t[f + u] = t[p + u]
  43289. }
  43290. ++n
  43291. }
  43292. }
  43293. return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
  43294. this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
  43295. this
  43296. }
  43297. },
  43298. Object.assign(Ci.KeyframeTrack, {
  43299. parse: function(e) {
  43300. if (void 0 === e.type)
  43301. throw new Error("track type undefined, can not parse");
  43302. var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  43303. if (void 0 === e.times) {
  43304. console.warn("legacy JSON format detected, converting");
  43305. var i = []
  43306. , n = [];
  43307. Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
  43308. e.times = i,
  43309. e.values = n
  43310. }
  43311. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  43312. },
  43313. toJSON: function(e) {
  43314. var t, i = e.constructor;
  43315. if (void 0 !== i.toJSON)
  43316. t = i.toJSON(e);
  43317. else {
  43318. t = {
  43319. name: e.name,
  43320. times: Ci.AnimationUtils.convertArray(e.times, Array),
  43321. values: Ci.AnimationUtils.convertArray(e.values, Array)
  43322. };
  43323. var n = e.getInterpolation();
  43324. n !== e.DefaultInterpolation && (t.interpolation = n)
  43325. }
  43326. return t.type = e.ValueTypeName,
  43327. t
  43328. },
  43329. _getTrackTypeForValueTypeName: function(e) {
  43330. switch (e.toLowerCase()) {
  43331. case "scalar":
  43332. case "double":
  43333. case "float":
  43334. case "number":
  43335. case "integer":
  43336. return Ci.NumberKeyframeTrack;
  43337. case "vector":
  43338. case "vector2":
  43339. case "vector3":
  43340. case "vector4":
  43341. return Ci.VectorKeyframeTrack;
  43342. case "color":
  43343. return Ci.ColorKeyframeTrack;
  43344. case "quaternion":
  43345. return Ci.QuaternionKeyframeTrack;
  43346. case "bool":
  43347. case "boolean":
  43348. return Ci.BooleanKeyframeTrack;
  43349. case "string":
  43350. return Ci.StringKeyframeTrack
  43351. }
  43352. throw new Error("Unsupported typeName: " + e)
  43353. }
  43354. }),
  43355. Ci.PropertyBinding = function(e, t, i) {
  43356. this.path = t,
  43357. this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
  43358. this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  43359. this.rootNode = e
  43360. }
  43361. ,
  43362. Ci.PropertyBinding.prototype = {
  43363. constructor: Ci.PropertyBinding,
  43364. getValue: function(e, t) {
  43365. this.bind(),
  43366. this.getValue(e, t)
  43367. },
  43368. setValue: function(e, t) {
  43369. this.bind(),
  43370. this.setValue(e, t)
  43371. },
  43372. bind: function() {
  43373. var e = this.node
  43374. , t = this.parsedPath
  43375. , i = t.objectName
  43376. , n = t.propertyName
  43377. , r = t.propertyIndex;
  43378. if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  43379. this.node = e),
  43380. this.getValue = this._getValue_unavailable,
  43381. this.setValue = this._setValue_unavailable,
  43382. e) {
  43383. if (i) {
  43384. var o = t.objectIndex;
  43385. switch (i) {
  43386. case "materials":
  43387. if (!e.material)
  43388. return void console.error(" can not bind to material as node does not have a material", this);
  43389. if (!e.material.materials)
  43390. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  43391. e = e.material.materials;
  43392. break;
  43393. case "bones":
  43394. if (!e.skeleton)
  43395. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  43396. e = e.skeleton.bones;
  43397. for (var a = 0; a < e.length; a++)
  43398. if (e[a].name === o) {
  43399. o = a;
  43400. break
  43401. }
  43402. break;
  43403. default:
  43404. if (void 0 === e[i])
  43405. return void console.error(" can not bind to objectName of node, undefined", this);
  43406. e = e[i]
  43407. }
  43408. if (void 0 !== o) {
  43409. if (void 0 === e[o])
  43410. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  43411. e = e[o]
  43412. }
  43413. }
  43414. var s = e[n];
  43415. if (s) {
  43416. var l = this.Versioning.None;
  43417. void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
  43418. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
  43419. this.targetObject = e);
  43420. var c = this.BindingType.Direct;
  43421. if (void 0 !== r) {
  43422. if ("morphTargetInfluences" === n) {
  43423. if (!e.geometry)
  43424. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  43425. if (!e.geometry.morphTargets)
  43426. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  43427. for (a = 0; a < this.node.geometry.morphTargets.length; a++)
  43428. if (e.geometry.morphTargets[a].name === r) {
  43429. r = a;
  43430. break
  43431. }
  43432. }
  43433. c = this.BindingType.ArrayElement,
  43434. this.resolvedProperty = s,
  43435. this.propertyIndex = r
  43436. } else
  43437. void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
  43438. this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
  43439. this.resolvedProperty = s) : this.propertyName = n;
  43440. this.getValue = this.GetterByBindingType[c],
  43441. this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
  43442. } else {
  43443. var h = t.nodeName;
  43444. console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
  43445. }
  43446. } else
  43447. console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
  43448. },
  43449. unbind: function() {
  43450. this.node = null,
  43451. this.getValue = this._getValue_unbound,
  43452. this.setValue = this._setValue_unbound
  43453. }
  43454. },
  43455. Object.assign(Ci.PropertyBinding.prototype, {
  43456. _getValue_unavailable: function() {},
  43457. _setValue_unavailable: function() {},
  43458. _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
  43459. _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
  43460. BindingType: {
  43461. Direct: 0,
  43462. EntireArray: 1,
  43463. ArrayElement: 2,
  43464. HasFromToArray: 3
  43465. },
  43466. Versioning: {
  43467. None: 0,
  43468. NeedsUpdate: 1,
  43469. MatrixWorldNeedsUpdate: 2
  43470. },
  43471. GetterByBindingType: [function(e, t) {
  43472. e[t] = this.node[this.propertyName]
  43473. }
  43474. , function(e, t) {
  43475. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43476. e[t++] = i[n]
  43477. }
  43478. , function(e, t) {
  43479. e[t] = this.resolvedProperty[this.propertyIndex]
  43480. }
  43481. , function(e, t) {
  43482. this.resolvedProperty.toArray(e, t)
  43483. }
  43484. ],
  43485. SetterByBindingTypeAndVersioning: [[function(e, t) {
  43486. this.node[this.propertyName] = e[t]
  43487. }
  43488. , function(e, t) {
  43489. this.node[this.propertyName] = e[t],
  43490. this.targetObject.needsUpdate = !0
  43491. }
  43492. , function(e, t) {
  43493. this.node[this.propertyName] = e[t],
  43494. this.targetObject.matrixWorldNeedsUpdate = !0
  43495. }
  43496. ], [function(e, t) {
  43497. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43498. i[n] = e[t++]
  43499. }
  43500. , function(e, t) {
  43501. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43502. i[n] = e[t++];
  43503. this.targetObject.needsUpdate = !0
  43504. }
  43505. , function(e, t) {
  43506. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  43507. i[n] = e[t++];
  43508. this.targetObject.matrixWorldNeedsUpdate = !0
  43509. }
  43510. ], [function(e, t) {
  43511. this.resolvedProperty[this.propertyIndex] = e[t]
  43512. }
  43513. , function(e, t) {
  43514. this.resolvedProperty[this.propertyIndex] = e[t],
  43515. this.targetObject.needsUpdate = !0
  43516. }
  43517. , function(e, t) {
  43518. this.resolvedProperty[this.propertyIndex] = e[t],
  43519. this.targetObject.matrixWorldNeedsUpdate = !0
  43520. }
  43521. ], [function(e, t) {
  43522. this.resolvedProperty.fromArray(e, t)
  43523. }
  43524. , function(e, t) {
  43525. this.resolvedProperty.fromArray(e, t),
  43526. this.targetObject.needsUpdate = !0
  43527. }
  43528. , function(e, t) {
  43529. this.resolvedProperty.fromArray(e, t),
  43530. this.targetObject.matrixWorldNeedsUpdate = !0
  43531. }
  43532. ]]
  43533. }),
  43534. Ci.PropertyBinding.Composite = function(e, t, i) {
  43535. var n = i || Ci.PropertyBinding.parseTrackName(t);
  43536. this._targetGroup = e,
  43537. this._bindings = e.subscribe_(t, n)
  43538. }
  43539. ,
  43540. Ci.PropertyBinding.Composite.prototype = {
  43541. constructor: Ci.PropertyBinding.Composite,
  43542. getValue: function(e, t) {
  43543. this.bind();
  43544. var i = this._targetGroup.nCachedObjects_
  43545. , n = this._bindings[i];
  43546. void 0 !== n && n.getValue(e, t)
  43547. },
  43548. setValue: function(e, t) {
  43549. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  43550. i[n].setValue(e, t)
  43551. },
  43552. bind: function() {
  43553. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  43554. e[t].bind()
  43555. },
  43556. unbind: function() {
  43557. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  43558. e[t].unbind()
  43559. }
  43560. },
  43561. Ci.PropertyBinding.create = function(e, t, i) {
  43562. return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
  43563. }
  43564. ,
  43565. Ci.PropertyBinding.parseTrackName = function(e) {
  43566. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  43567. , i = t.exec(e);
  43568. if (!i)
  43569. throw new Error("cannot parse trackName at all: " + e);
  43570. i.index === t.lastIndex && t.lastIndex++;
  43571. var n = {
  43572. nodeName: i[3],
  43573. objectName: i[5],
  43574. objectIndex: i[7],
  43575. propertyName: i[9],
  43576. propertyIndex: i[11]
  43577. };
  43578. if (null === n.propertyName || 0 === n.propertyName.length)
  43579. throw new Error("can not parse propertyName from trackName: " + e);
  43580. return n
  43581. }
  43582. ,
  43583. Ci.PropertyBinding.findNode = function(e, r) {
  43584. if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
  43585. return e;
  43586. if (e.skeleton) {
  43587. var t = function(e) {
  43588. for (var t = 0; t < e.bones.length; t++) {
  43589. var i = e.bones[t];
  43590. if (i.name === r)
  43591. return i
  43592. }
  43593. return null
  43594. }(e.skeleton);
  43595. if (t)
  43596. return t
  43597. }
  43598. if (e.children) {
  43599. var o = function(e) {
  43600. for (var t = 0; t < e.length; t++) {
  43601. var i = e[t];
  43602. if (i.name === r || i.uuid === r)
  43603. return i;
  43604. var n = o(i.children);
  43605. if (n)
  43606. return n
  43607. }
  43608. return null
  43609. }
  43610. , i = o(e.children);
  43611. if (i)
  43612. return i
  43613. }
  43614. return null
  43615. }
  43616. ,
  43617. Ci.PropertyMixer = function(e, t, i) {
  43618. this.binding = e,
  43619. this.valueSize = i;
  43620. var n, r = Float64Array;
  43621. switch (t) {
  43622. case "quaternion":
  43623. n = this._slerp;
  43624. break;
  43625. case "string":
  43626. case "bool":
  43627. r = Array,
  43628. n = this._select;
  43629. break;
  43630. default:
  43631. n = this._lerp
  43632. }
  43633. this.buffer = new r(4 * i),
  43634. this._mixBufferRegion = n,
  43635. this.cumulativeWeight = 0,
  43636. this.useCount = 0,
  43637. this.referenceCount = 0
  43638. }
  43639. ,
  43640. Ci.PropertyMixer.prototype = {
  43641. constructor: Ci.PropertyMixer,
  43642. accumulate: function(e, t) {
  43643. var i = this.buffer
  43644. , n = this.valueSize
  43645. , r = e * n + n
  43646. , o = this.cumulativeWeight;
  43647. if (0 === o) {
  43648. for (var a = 0; a !== n; ++a)
  43649. i[r + a] = i[a];
  43650. o = t
  43651. } else {
  43652. var s = t / (o += t);
  43653. this._mixBufferRegion(i, r, 0, s, n)
  43654. }
  43655. this.cumulativeWeight = o
  43656. },
  43657. apply: function(e) {
  43658. var t = this.valueSize
  43659. , i = this.buffer
  43660. , n = e * t + t
  43661. , r = this.cumulativeWeight
  43662. , o = this.binding;
  43663. if (this.cumulativeWeight = 0,
  43664. r < 1) {
  43665. var a = 3 * t;
  43666. this._mixBufferRegion(i, n, a, 1 - r, t)
  43667. }
  43668. for (var s = t, l = t + t; s !== l; ++s)
  43669. if (i[s] !== i[s + t]) {
  43670. o.setValue(i, n);
  43671. break
  43672. }
  43673. },
  43674. saveOriginalState: function() {
  43675. var e = this.binding
  43676. , t = this.buffer
  43677. , i = this.valueSize
  43678. , n = 3 * i;
  43679. e.getValue(t, n);
  43680. for (var r = i, o = n; r !== o; ++r)
  43681. t[r] = t[n + r % i];
  43682. this.cumulativeWeight = 0
  43683. },
  43684. restoreOriginalState: function() {
  43685. var e = 3 * this.valueSize;
  43686. this.binding.setValue(this.buffer, e)
  43687. },
  43688. _select: function(e, t, i, n, r) {
  43689. if (.5 <= n)
  43690. for (var o = 0; o !== r; ++o)
  43691. e[t + o] = e[i + o]
  43692. },
  43693. _slerp: function(e, t, i, n, r) {
  43694. Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
  43695. },
  43696. _lerp: function(e, t, i, n, r) {
  43697. for (var o = 1 - n, a = 0; a !== r; ++a) {
  43698. var s = t + a;
  43699. e[s] = e[s] * o + e[i + a] * n
  43700. }
  43701. }
  43702. },
  43703. Ci.BooleanKeyframeTrack = function(e, t, i) {
  43704. Ci.KeyframeTrack.call(this, e, t, i)
  43705. }
  43706. ,
  43707. Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  43708. constructor: Ci.BooleanKeyframeTrack,
  43709. ValueTypeName: "bool",
  43710. ValueBufferType: Array,
  43711. DefaultInterpolation: Ci.IntepolateDiscrete,
  43712. InterpolantFactoryMethodLinear: void 0,
  43713. InterpolantFactoryMethodSmooth: void 0
  43714. }),
  43715. Ci.NumberKeyframeTrack = function(e, t, i, n) {
  43716. Ci.KeyframeTrack.call(this, e, t, i, n)
  43717. }
  43718. ,
  43719. Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  43720. constructor: Ci.NumberKeyframeTrack,
  43721. ValueTypeName: "number"
  43722. }),
  43723. Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
  43724. Ci.KeyframeTrack.call(this, e, t, i, n)
  43725. }
  43726. ,
  43727. Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  43728. constructor: Ci.QuaternionKeyframeTrack,
  43729. ValueTypeName: "quaternion",
  43730. DefaultInterpolation: Ci.InterpolateLinear,
  43731. InterpolantFactoryMethodLinear: function(e) {
  43732. return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43733. },
  43734. InterpolantFactoryMethodSmooth: void 0
  43735. }),
  43736. Ci.StringKeyframeTrack = function(e, t, i, n) {
  43737. Ci.KeyframeTrack.call(this, e, t, i, n)
  43738. }
  43739. ,
  43740. Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  43741. constructor: Ci.StringKeyframeTrack,
  43742. ValueTypeName: "string",
  43743. ValueBufferType: Array,
  43744. DefaultInterpolation: Ci.IntepolateDiscrete,
  43745. InterpolantFactoryMethodLinear: void 0,
  43746. InterpolantFactoryMethodSmooth: void 0
  43747. }),
  43748. Ci.VectorKeyframeTrack = function(e, t, i, n) {
  43749. Ci.KeyframeTrack.call(this, e, t, i, n)
  43750. }
  43751. ,
  43752. Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
  43753. constructor: Ci.VectorKeyframeTrack,
  43754. ValueTypeName: "vector"
  43755. }),
  43756. Ci.Audio = function(e) {
  43757. Ci.Object3D.call(this),
  43758. this.type = "Audio",
  43759. this.context = e.context,
  43760. this.source = this.context.createBufferSource(),
  43761. this.source.onended = this.onEnded.bind(this),
  43762. this.gain = this.context.createGain(),
  43763. this.gain.connect(e.getInput()),
  43764. this.autoplay = !1,
  43765. this.startTime = 0,
  43766. this.playbackRate = 1,
  43767. this.isPlaying = !1,
  43768. this.hasPlaybackControl = !0,
  43769. this.sourceType = "empty",
  43770. this.filter = null
  43771. }
  43772. ,
  43773. Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
  43774. Ci.Audio.prototype.constructor = Ci.Audio,
  43775. Ci.Audio.prototype.getOutput = function() {
  43776. return this.gain
  43777. }
  43778. ,
  43779. Ci.Audio.prototype.load = function(e) {
  43780. var t = new Ci.AudioBuffer(this.context);
  43781. return t.load(e),
  43782. this.setBuffer(t),
  43783. this
  43784. }
  43785. ,
  43786. Ci.Audio.prototype.setNodeSource = function(e) {
  43787. return this.hasPlaybackControl = !1,
  43788. this.sourceType = "audioNode",
  43789. this.source = e,
  43790. this.connect(),
  43791. this
  43792. }
  43793. ,
  43794. Ci.Audio.prototype.setBuffer = function(e) {
  43795. var t = this;
  43796. return e.onReady(function(e) {
  43797. t.source.buffer = e,
  43798. t.sourceType = "buffer",
  43799. t.autoplay && t.play()
  43800. }),
  43801. this
  43802. }
  43803. ,
  43804. Ci.Audio.prototype.play = function() {
  43805. if (!0 !== this.isPlaying)
  43806. if (!1 !== this.hasPlaybackControl) {
  43807. var e = this.context.createBufferSource();
  43808. e.buffer = this.source.buffer,
  43809. e.loop = this.source.loop,
  43810. e.onended = this.source.onended,
  43811. e.start(0, this.startTime),
  43812. e.playbackRate.value = this.playbackRate,
  43813. this.isPlaying = !0,
  43814. this.source = e,
  43815. this.connect()
  43816. } else
  43817. console.warn("THREE.Audio: this Audio has no playback control.");
  43818. else
  43819. console.warn("THREE.Audio: Audio is already playing.")
  43820. }
  43821. ,
  43822. Ci.Audio.prototype.pause = function() {
  43823. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  43824. void (this.startTime = this.context.currentTime))
  43825. }
  43826. ,
  43827. Ci.Audio.prototype.stop = function() {
  43828. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  43829. void (this.startTime = 0))
  43830. }
  43831. ,
  43832. Ci.Audio.prototype.connect = function() {
  43833. null !== this.filter ? (this.source.connect(this.filter),
  43834. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  43835. }
  43836. ,
  43837. Ci.Audio.prototype.disconnect = function() {
  43838. null !== this.filter ? (this.source.disconnect(this.filter),
  43839. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  43840. }
  43841. ,
  43842. Ci.Audio.prototype.getFilter = function() {
  43843. return this.filter
  43844. }
  43845. ,
  43846. Ci.Audio.prototype.setFilter = function(e) {
  43847. void 0 === e && (e = null),
  43848. !0 === this.isPlaying ? (this.disconnect(),
  43849. this.filter = e,
  43850. this.connect()) : this.filter = e
  43851. }
  43852. ,
  43853. Ci.Audio.prototype.setPlaybackRate = function(e) {
  43854. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  43855. void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
  43856. }
  43857. ,
  43858. Ci.Audio.prototype.getPlaybackRate = function() {
  43859. return this.playbackRate
  43860. }
  43861. ,
  43862. Ci.Audio.prototype.onEnded = function() {
  43863. this.isPlaying = !1
  43864. }
  43865. ,
  43866. Ci.Audio.prototype.setLoop = function(e) {
  43867. return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  43868. }
  43869. ,
  43870. Ci.Audio.prototype.getLoop = function() {
  43871. return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
  43872. !1) : this.source.loop
  43873. }
  43874. ,
  43875. Ci.Audio.prototype.setVolume = function(e) {
  43876. this.gain.gain.value = e
  43877. }
  43878. ,
  43879. Ci.Audio.prototype.getVolume = function() {
  43880. return this.gain.gain.value
  43881. }
  43882. ,
  43883. Ci.AudioAnalyser = function(e, t) {
  43884. this.analyser = e.context.createAnalyser(),
  43885. this.analyser.fftSize = void 0 !== t ? t : 2048,
  43886. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  43887. e.getOutput().connect(this.analyser)
  43888. }
  43889. ,
  43890. Ci.AudioAnalyser.prototype = {
  43891. constructor: Ci.AudioAnalyser,
  43892. getData: function() {
  43893. return this.analyser.getByteFrequencyData(this.data),
  43894. this.data
  43895. }
  43896. },
  43897. Ci.AudioBuffer = function(e) {
  43898. this.context = e,
  43899. this.ready = !1,
  43900. this.readyCallbacks = []
  43901. }
  43902. ,
  43903. Ci.AudioBuffer.prototype.load = function(e) {
  43904. var i = this
  43905. , t = new XMLHttpRequest;
  43906. return t.open("GET", e, !0),
  43907. t.responseType = "arraybuffer",
  43908. t.onload = function(e) {
  43909. i.context.decodeAudioData(this.response, function(e) {
  43910. i.buffer = e,
  43911. i.ready = !0;
  43912. for (var t = 0; t < i.readyCallbacks.length; t++)
  43913. i.readyCallbacks[t](i.buffer);
  43914. i.readyCallbacks = []
  43915. })
  43916. }
  43917. ,
  43918. t.send(),
  43919. this
  43920. }
  43921. ,
  43922. Ci.AudioBuffer.prototype.onReady = function(e) {
  43923. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  43924. }
  43925. ,
  43926. Ci.PositionalAudio = function(e) {
  43927. Ci.Audio.call(this, e),
  43928. this.panner = this.context.createPanner(),
  43929. this.panner.connect(this.gain)
  43930. }
  43931. ,
  43932. Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
  43933. Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
  43934. Ci.PositionalAudio.prototype.getOutput = function() {
  43935. return this.panner
  43936. }
  43937. ,
  43938. Ci.PositionalAudio.prototype.setRefDistance = function(e) {
  43939. this.panner.refDistance = e
  43940. }
  43941. ,
  43942. Ci.PositionalAudio.prototype.getRefDistance = function() {
  43943. return this.panner.refDistance
  43944. }
  43945. ,
  43946. Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
  43947. this.panner.rolloffFactor = e
  43948. }
  43949. ,
  43950. Ci.PositionalAudio.prototype.getRolloffFactor = function() {
  43951. return this.panner.rolloffFactor
  43952. }
  43953. ,
  43954. Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
  43955. this.panner.distanceModel = e
  43956. }
  43957. ,
  43958. Ci.PositionalAudio.prototype.getDistanceModel = function() {
  43959. return this.panner.distanceModel
  43960. }
  43961. ,
  43962. Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
  43963. this.panner.maxDistance = e
  43964. }
  43965. ,
  43966. Ci.PositionalAudio.prototype.getMaxDistance = function() {
  43967. return this.panner.maxDistance
  43968. }
  43969. ,
  43970. Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
  43971. function(e) {
  43972. Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
  43973. it.setFromMatrixPosition(this.matrixWorld),
  43974. this.panner.setPosition(it.x, it.y, it.z)
  43975. }
  43976. ),
  43977. Ci.AudioListener = function() {
  43978. Ci.Object3D.call(this),
  43979. this.type = "AudioListener",
  43980. this.context = new (window.AudioContext || window.webkitAudioContext),
  43981. this.gain = this.context.createGain(),
  43982. this.gain.connect(this.context.destination),
  43983. this.filter = null
  43984. }
  43985. ,
  43986. Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
  43987. Ci.AudioListener.prototype.constructor = Ci.AudioListener,
  43988. Ci.AudioListener.prototype.getInput = function() {
  43989. return this.gain
  43990. }
  43991. ,
  43992. Ci.AudioListener.prototype.removeFilter = function() {
  43993. null !== this.filter && (this.gain.disconnect(this.filter),
  43994. this.filter.disconnect(this.context.destination),
  43995. this.gain.connect(this.context.destination),
  43996. this.filter = null)
  43997. }
  43998. ,
  43999. Ci.AudioListener.prototype.setFilter = function(e) {
  44000. null !== this.filter ? (this.gain.disconnect(this.filter),
  44001. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44002. this.filter = e,
  44003. this.gain.connect(this.filter),
  44004. this.filter.connect(this.context.destination)
  44005. }
  44006. ,
  44007. Ci.AudioListener.prototype.getFilter = function() {
  44008. return this.filter
  44009. }
  44010. ,
  44011. Ci.AudioListener.prototype.setMasterVolume = function(e) {
  44012. this.gain.gain.value = e
  44013. }
  44014. ,
  44015. Ci.AudioListener.prototype.getMasterVolume = function() {
  44016. return this.gain.gain.value
  44017. }
  44018. ,
  44019. Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
  44020. $e = new Ci.Quaternion,
  44021. et = new Ci.Vector3,
  44022. tt = new Ci.Vector3,
  44023. function(e) {
  44024. Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
  44025. var t = this.context.listener
  44026. , i = this.up;
  44027. this.matrixWorld.decompose(Je, $e, et),
  44028. tt.set(0, 0, -1).applyQuaternion($e),
  44029. t.setPosition(Je.x, Je.y, Je.z),
  44030. t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
  44031. }
  44032. ),
  44033. Ci.Camera = function() {
  44034. Ci.Object3D.call(this),
  44035. this.type = "Camera",
  44036. this.matrixWorldInverse = new Ci.Matrix4,
  44037. this.projectionMatrix = new Ci.Matrix4
  44038. }
  44039. ,
  44040. Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
  44041. Ci.Camera.prototype.constructor = Ci.Camera,
  44042. Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
  44043. function(e) {
  44044. var t = e || new Ci.Vector3;
  44045. return this.getWorldQuaternion(Qe),
  44046. t.set(0, 0, -1).applyQuaternion(Qe)
  44047. }
  44048. ),
  44049. Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
  44050. function(e) {
  44051. Ke.lookAt(this.position, e, this.up),
  44052. this.quaternion.setFromRotationMatrix(Ke)
  44053. }
  44054. ),
  44055. Ci.Camera.prototype.clone = function() {
  44056. return (new this.constructor).copy(this)
  44057. }
  44058. ,
  44059. Ci.Camera.prototype.copy = function(e) {
  44060. return Ci.Object3D.prototype.copy.call(this, e),
  44061. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44062. this.projectionMatrix.copy(e.projectionMatrix),
  44063. this
  44064. }
  44065. ,
  44066. Ci.CubeCamera = function(e, t, i) {
  44067. Ci.Object3D.call(this),
  44068. this.type = "CubeCamera";
  44069. var r = new Ci.PerspectiveCamera(90,1,e,t);
  44070. r.up.set(0, -1, 0),
  44071. r.lookAt(new Ci.Vector3(1,0,0)),
  44072. this.add(r);
  44073. var o = new Ci.PerspectiveCamera(90,1,e,t);
  44074. o.up.set(0, -1, 0),
  44075. o.lookAt(new Ci.Vector3(-1,0,0)),
  44076. this.add(o);
  44077. var a = new Ci.PerspectiveCamera(90,1,e,t);
  44078. a.up.set(0, 0, 1),
  44079. a.lookAt(new Ci.Vector3(0,1,0)),
  44080. this.add(a);
  44081. var s = new Ci.PerspectiveCamera(90,1,e,t);
  44082. s.up.set(0, 0, -1),
  44083. s.lookAt(new Ci.Vector3(0,-1,0)),
  44084. this.add(s);
  44085. var l = new Ci.PerspectiveCamera(90,1,e,t);
  44086. l.up.set(0, -1, 0),
  44087. l.lookAt(new Ci.Vector3(0,0,1)),
  44088. this.add(l);
  44089. var c = new Ci.PerspectiveCamera(90,1,e,t);
  44090. c.up.set(0, -1, 0),
  44091. c.lookAt(new Ci.Vector3(0,0,-1)),
  44092. this.add(c);
  44093. var n = {
  44094. format: Ci.RGBFormat,
  44095. magFilter: Ci.LinearFilter,
  44096. minFilter: Ci.LinearFilter
  44097. };
  44098. this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
  44099. this.updateCubeMap = function(e, t) {
  44100. null === this.parent && this.updateMatrixWorld();
  44101. var i = this.renderTarget
  44102. , n = i.texture.generateMipmaps;
  44103. i.texture.generateMipmaps = !1,
  44104. i.activeCubeFace = 0,
  44105. e.render(t, r, i),
  44106. i.activeCubeFace = 1,
  44107. e.render(t, o, i),
  44108. i.activeCubeFace = 2,
  44109. e.render(t, a, i),
  44110. i.activeCubeFace = 3,
  44111. e.render(t, s, i),
  44112. i.activeCubeFace = 4,
  44113. e.render(t, l, i),
  44114. i.texture.generateMipmaps = n,
  44115. i.activeCubeFace = 5,
  44116. e.render(t, c, i),
  44117. e.setRenderTarget(null)
  44118. }
  44119. }
  44120. ,
  44121. Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
  44122. Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
  44123. Ci.OrthographicCamera = function(e, t, i, n, r, o) {
  44124. Ci.Camera.call(this),
  44125. this.type = "OrthographicCamera",
  44126. this.zoom = 1,
  44127. this.left = e,
  44128. this.right = t,
  44129. this.top = i,
  44130. this.bottom = n,
  44131. this.near = void 0 !== r ? r : .1,
  44132. this.far = void 0 !== o ? o : 2e3,
  44133. this.updateProjectionMatrix()
  44134. }
  44135. ,
  44136. Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
  44137. Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
  44138. Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  44139. var e = (this.right - this.left) / (2 * this.zoom)
  44140. , t = (this.top - this.bottom) / (2 * this.zoom)
  44141. , i = (this.right + this.left) / 2
  44142. , n = (this.top + this.bottom) / 2;
  44143. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44144. }
  44145. ,
  44146. Ci.OrthographicCamera.prototype.copy = function(e) {
  44147. return Ci.Camera.prototype.copy.call(this, e),
  44148. this.left = e.left,
  44149. this.right = e.right,
  44150. this.top = e.top,
  44151. this.bottom = e.bottom,
  44152. this.near = e.near,
  44153. this.far = e.far,
  44154. this.zoom = e.zoom,
  44155. this
  44156. }
  44157. ,
  44158. Ci.OrthographicCamera.prototype.toJSON = function(e) {
  44159. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44160. return t.object.zoom = this.zoom,
  44161. t.object.left = this.left,
  44162. t.object.right = this.right,
  44163. t.object.top = this.top,
  44164. t.object.bottom = this.bottom,
  44165. t.object.near = this.near,
  44166. t.object.far = this.far,
  44167. t
  44168. }
  44169. ,
  44170. Ci.PerspectiveCamera = function(e, t, i, n) {
  44171. Ci.Camera.call(this),
  44172. this.type = "PerspectiveCamera",
  44173. this.focalLength = 10,
  44174. this.zoom = 1,
  44175. this.fov = void 0 !== e ? e : 50,
  44176. this.aspect = void 0 !== t ? t : 1,
  44177. this.near = void 0 !== i ? i : .1,
  44178. this.far = void 0 !== n ? n : 2e3,
  44179. this.updateProjectionMatrix()
  44180. }
  44181. ,
  44182. Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
  44183. Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
  44184. Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
  44185. void 0 === t && (t = 24),
  44186. this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
  44187. this.updateProjectionMatrix()
  44188. }
  44189. ,
  44190. Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  44191. this.fullWidth = e,
  44192. this.fullHeight = t,
  44193. this.x = i,
  44194. this.y = n,
  44195. this.width = r,
  44196. this.height = o,
  44197. this.updateProjectionMatrix()
  44198. }
  44199. ,
  44200. Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  44201. var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
  44202. if (this.fullWidth) {
  44203. var t = this.fullWidth / this.fullHeight
  44204. , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
  44205. , n = -i
  44206. , r = t * n
  44207. , o = t * i
  44208. , a = Math.abs(o - r)
  44209. , s = Math.abs(i - n);
  44210. 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)
  44211. } else
  44212. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  44213. }
  44214. ,
  44215. Ci.PerspectiveCamera.prototype.copy = function(e) {
  44216. return Ci.Camera.prototype.copy.call(this, e),
  44217. this.focalLength = e.focalLength,
  44218. this.zoom = e.zoom,
  44219. this.fov = e.fov,
  44220. this.aspect = e.aspect,
  44221. this.near = e.near,
  44222. this.far = e.far,
  44223. this
  44224. }
  44225. ,
  44226. Ci.PerspectiveCamera.prototype.toJSON = function(e) {
  44227. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44228. return t.object.focalLength = this.focalLength,
  44229. t.object.zoom = this.zoom,
  44230. t.object.fov = this.fov,
  44231. t.object.aspect = this.aspect,
  44232. t.object.near = this.near,
  44233. t.object.far = this.far,
  44234. t
  44235. }
  44236. ,
  44237. Ci.StereoCamera = function() {
  44238. this.type = "StereoCamera",
  44239. this.aspect = 1,
  44240. this.cameraL = new Ci.PerspectiveCamera,
  44241. this.cameraL.layers.enable(1),
  44242. this.cameraL.matrixAutoUpdate = !1,
  44243. this.cameraR = new Ci.PerspectiveCamera,
  44244. this.cameraR.layers.enable(2),
  44245. this.cameraR.matrixAutoUpdate = !1
  44246. }
  44247. ,
  44248. Ci.StereoCamera.prototype = {
  44249. constructor: Ci.StereoCamera,
  44250. update: (Xe = new Ci.Matrix4,
  44251. Ze = new Ci.Matrix4,
  44252. function(e) {
  44253. if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
  44254. Ge = e.focalLength,
  44255. We = e.fov,
  44256. je = e.aspect * this.aspect,
  44257. Ye = e.near,
  44258. qe = e.far;
  44259. var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
  44260. Ze.elements[12] = -.032,
  44261. Xe.elements[12] = .032,
  44262. t = -o * je + r,
  44263. i = o * je + r,
  44264. n.elements[0] = 2 * Ye / (i - t),
  44265. n.elements[8] = (i + t) / (i - t),
  44266. this.cameraL.projectionMatrix.copy(n),
  44267. t = -o * je - r,
  44268. i = o * je - r,
  44269. n.elements[0] = 2 * Ye / (i - t),
  44270. n.elements[8] = (i + t) / (i - t),
  44271. this.cameraR.projectionMatrix.copy(n)
  44272. }
  44273. this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
  44274. this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
  44275. }
  44276. )
  44277. },
  44278. Ci.Light = function(e, t) {
  44279. Ci.Object3D.call(this),
  44280. this.type = "Light",
  44281. this.color = new Ci.Color(e),
  44282. this.intensity = void 0 !== t ? t : 1,
  44283. this.receiveShadow = void 0
  44284. }
  44285. ,
  44286. Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
  44287. Ci.Light.prototype.constructor = Ci.Light,
  44288. Ci.Light.prototype.copy = function(e) {
  44289. return Ci.Object3D.prototype.copy.call(this, e),
  44290. this.color.copy(e.color),
  44291. this.intensity = e.intensity,
  44292. this
  44293. }
  44294. ,
  44295. Ci.Light.prototype.toJSON = function(e) {
  44296. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  44297. return t.object.color = this.color.getHex(),
  44298. t.object.intensity = this.intensity,
  44299. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  44300. void 0 !== this.distance && (t.object.distance = this.distance),
  44301. void 0 !== this.angle && (t.object.angle = this.angle),
  44302. void 0 !== this.decay && (t.object.decay = this.decay),
  44303. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  44304. t
  44305. }
  44306. ,
  44307. Ci.LightShadow = function(e) {
  44308. this.camera = e,
  44309. this.bias = 0,
  44310. this.radius = 1,
  44311. this.mapSize = new Ci.Vector2(512,512),
  44312. this.map = null,
  44313. this.matrix = new Ci.Matrix4
  44314. }
  44315. ,
  44316. Ci.LightShadow.prototype = {
  44317. constructor: Ci.LightShadow,
  44318. copy: function(e) {
  44319. return this.camera = e.camera.clone(),
  44320. this.bias = e.bias,
  44321. this.radius = e.radius,
  44322. this.mapSize.copy(e.mapSize),
  44323. this
  44324. },
  44325. clone: function() {
  44326. return (new this.constructor).copy(this)
  44327. }
  44328. },
  44329. Ci.AmbientLight = function(e, t) {
  44330. Ci.Light.call(this, e, t),
  44331. this.type = "AmbientLight",
  44332. this.castShadow = void 0
  44333. }
  44334. ,
  44335. Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
  44336. Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
  44337. Ci.DirectionalLight = function(e, t) {
  44338. Ci.Light.call(this, e, t),
  44339. this.type = "DirectionalLight",
  44340. this.position.set(0, 1, 0),
  44341. this.updateMatrix(),
  44342. this.target = new Ci.Object3D,
  44343. this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
  44344. }
  44345. ,
  44346. Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
  44347. Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
  44348. Ci.DirectionalLight.prototype.copy = function(e) {
  44349. return Ci.Light.prototype.copy.call(this, e),
  44350. this.target = e.target.clone(),
  44351. this.shadow = e.shadow.clone(),
  44352. this
  44353. }
  44354. ,
  44355. Ci.HemisphereLight = function(e, t, i) {
  44356. Ci.Light.call(this, e, i),
  44357. this.type = "HemisphereLight",
  44358. this.castShadow = void 0,
  44359. this.position.set(0, 1, 0),
  44360. this.updateMatrix(),
  44361. this.groundColor = new Ci.Color(t)
  44362. }
  44363. ,
  44364. Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
  44365. Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
  44366. Ci.HemisphereLight.prototype.copy = function(e) {
  44367. return Ci.Light.prototype.copy.call(this, e),
  44368. this.groundColor.copy(e.groundColor),
  44369. this
  44370. }
  44371. ,
  44372. Ci.PointLight = function(e, t, i, n) {
  44373. Ci.Light.call(this, e, t),
  44374. this.type = "PointLight",
  44375. this.distance = void 0 !== i ? i : 0,
  44376. this.decay = void 0 !== n ? n : 1,
  44377. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
  44378. }
  44379. ,
  44380. Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
  44381. Ci.PointLight.prototype.constructor = Ci.PointLight,
  44382. Object.defineProperty(Ci.PointLight.prototype, "power", {
  44383. get: function() {
  44384. return 4 * this.intensity * Math.PI
  44385. },
  44386. set: function(e) {
  44387. this.intensity = e / (4 * Math.PI)
  44388. }
  44389. }),
  44390. Ci.PointLight.prototype.copy = function(e) {
  44391. return Ci.Light.prototype.copy.call(this, e),
  44392. this.distance = e.distance,
  44393. this.decay = e.decay,
  44394. this.shadow = e.shadow.clone(),
  44395. this
  44396. }
  44397. ,
  44398. Ci.SpotLight = function(e, t, i, n, r, o) {
  44399. Ci.Light.call(this, e, t),
  44400. this.type = "SpotLight",
  44401. this.position.set(0, 1, 0),
  44402. this.updateMatrix(),
  44403. this.target = new Ci.Object3D,
  44404. this.distance = void 0 !== i ? i : 0,
  44405. this.angle = void 0 !== n ? n : Math.PI / 3,
  44406. this.penumbra = void 0 !== r ? r : 0,
  44407. this.decay = void 0 !== o ? o : 1,
  44408. this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
  44409. }
  44410. ,
  44411. Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
  44412. Ci.SpotLight.prototype.constructor = Ci.SpotLight,
  44413. Object.defineProperty(Ci.SpotLight.prototype, "power", {
  44414. get: function() {
  44415. return this.intensity * Math.PI
  44416. },
  44417. set: function(e) {
  44418. this.intensity = e / Math.PI
  44419. }
  44420. }),
  44421. Ci.SpotLight.prototype.copy = function(e) {
  44422. return Ci.Light.prototype.copy.call(this, e),
  44423. this.distance = e.distance,
  44424. this.angle = e.angle,
  44425. this.penumbra = e.penumbra,
  44426. this.decay = e.decay,
  44427. this.target = e.target.clone(),
  44428. this.shadow = e.shadow.clone(),
  44429. this
  44430. }
  44431. ,
  44432. Ci.Cache = {
  44433. enabled: !1,
  44434. files: {},
  44435. add: function(e, t) {
  44436. !1 !== this.enabled && (this.files[e] = t)
  44437. },
  44438. get: function(e) {
  44439. if (!1 !== this.enabled)
  44440. return this.files[e]
  44441. },
  44442. remove: function(e) {
  44443. delete this.files[e]
  44444. },
  44445. clear: function() {
  44446. this.files = {}
  44447. }
  44448. },
  44449. Ci.Loader = function() {
  44450. this.onLoadStart = function() {}
  44451. ,
  44452. this.onLoadProgress = function() {}
  44453. ,
  44454. this.onLoadComplete = function() {}
  44455. }
  44456. ,
  44457. Ci.Loader.prototype = {
  44458. constructor: Ci.Loader,
  44459. crossOrigin: void 0,
  44460. extractUrlBase: function(e) {
  44461. var t = e.split("/");
  44462. return 1 === t.length ? "./" : (t.pop(),
  44463. t.join("/") + "/")
  44464. },
  44465. initMaterials: function(e, t, i) {
  44466. for (var n = [], r = 0; r < e.length; ++r)
  44467. n[r] = this.createMaterial(e[r], t, i);
  44468. return n
  44469. },
  44470. createMaterial: function(e, c, h) {
  44471. function t(e, t, i, n, r) {
  44472. var o, a = c + e, s = Ci.Loader.Handlers.get(a);
  44473. o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
  44474. He.load(a)),
  44475. void 0 !== t && (o.repeat.fromArray(t),
  44476. 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
  44477. 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
  44478. void 0 !== i && o.offset.fromArray(i),
  44479. void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
  44480. "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
  44481. "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
  44482. "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
  44483. void 0 !== r && (o.anisotropy = r);
  44484. var l = Ci.Math.generateUUID();
  44485. return u[l] = o,
  44486. l
  44487. }
  44488. void 0 === Ue && (Ue = new Ci.Color),
  44489. void 0 === He && (He = new Ci.TextureLoader),
  44490. void 0 === ze && (ze = new Ci.MaterialLoader);
  44491. var u = {}
  44492. , i = {
  44493. uuid: Ci.Math.generateUUID(),
  44494. type: "MeshLambertMaterial"
  44495. };
  44496. for (var n in e) {
  44497. var r = e[n];
  44498. switch (n) {
  44499. case "DbgColor":
  44500. case "DbgIndex":
  44501. case "opticalDensity":
  44502. case "illumination":
  44503. break;
  44504. case "DbgName":
  44505. i.name = r;
  44506. break;
  44507. case "blending":
  44508. i.blending = Ci[r];
  44509. break;
  44510. case "colorAmbient":
  44511. case "mapAmbient":
  44512. console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
  44513. break;
  44514. case "colorDiffuse":
  44515. i.color = Ue.fromArray(r).getHex();
  44516. break;
  44517. case "colorSpecular":
  44518. i.specular = Ue.fromArray(r).getHex();
  44519. break;
  44520. case "colorEmissive":
  44521. i.emissive = Ue.fromArray(r).getHex();
  44522. break;
  44523. case "specularCoef":
  44524. i.shininess = r;
  44525. break;
  44526. case "shading":
  44527. "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
  44528. "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
  44529. break;
  44530. case "mapDiffuse":
  44531. i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
  44532. break;
  44533. case "mapDiffuseRepeat":
  44534. case "mapDiffuseOffset":
  44535. case "mapDiffuseWrap":
  44536. case "mapDiffuseAnisotropy":
  44537. break;
  44538. case "mapLight":
  44539. i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
  44540. break;
  44541. case "mapLightRepeat":
  44542. case "mapLightOffset":
  44543. case "mapLightWrap":
  44544. case "mapLightAnisotropy":
  44545. break;
  44546. case "mapAO":
  44547. i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
  44548. break;
  44549. case "mapAORepeat":
  44550. case "mapAOOffset":
  44551. case "mapAOWrap":
  44552. case "mapAOAnisotropy":
  44553. break;
  44554. case "mapBump":
  44555. i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
  44556. break;
  44557. case "mapBumpScale":
  44558. i.bumpScale = r;
  44559. break;
  44560. case "mapBumpRepeat":
  44561. case "mapBumpOffset":
  44562. case "mapBumpWrap":
  44563. case "mapBumpAnisotropy":
  44564. break;
  44565. case "mapNormal":
  44566. i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
  44567. break;
  44568. case "mapNormalFactor":
  44569. i.normalScale = [r, r];
  44570. break;
  44571. case "mapNormalRepeat":
  44572. case "mapNormalOffset":
  44573. case "mapNormalWrap":
  44574. case "mapNormalAnisotropy":
  44575. break;
  44576. case "mapSpecular":
  44577. i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
  44578. break;
  44579. case "mapSpecularRepeat":
  44580. case "mapSpecularOffset":
  44581. case "mapSpecularWrap":
  44582. case "mapSpecularAnisotropy":
  44583. break;
  44584. case "mapAlpha":
  44585. i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
  44586. break;
  44587. case "mapAlphaRepeat":
  44588. case "mapAlphaOffset":
  44589. case "mapAlphaWrap":
  44590. case "mapAlphaAnisotropy":
  44591. break;
  44592. case "flipSided":
  44593. i.side = Ci.BackSide;
  44594. break;
  44595. case "doubleSided":
  44596. i.side = Ci.DoubleSide;
  44597. break;
  44598. case "transparency":
  44599. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  44600. i.opacity = r;
  44601. break;
  44602. case "depthTest":
  44603. case "depthWrite":
  44604. case "colorWrite":
  44605. case "opacity":
  44606. case "reflectivity":
  44607. case "transparent":
  44608. case "visible":
  44609. case "wireframe":
  44610. i[n] = r;
  44611. break;
  44612. case "vertexColors":
  44613. !0 === r && (i.vertexColors = Ci.VertexColors),
  44614. "face" === r && (i.vertexColors = Ci.FaceColors);
  44615. break;
  44616. default:
  44617. console.error("THREE.Loader.createMaterial: Unsupported", n, r)
  44618. }
  44619. }
  44620. return "MeshBasicMaterial" === i.type && delete i.emissive,
  44621. "MeshPhongMaterial" !== i.type && delete i.specular,
  44622. i.opacity < 1 && (i.transparent = !0),
  44623. ze.setTextures(u),
  44624. ze.parse(i)
  44625. }
  44626. },
  44627. Ci.Loader.Handlers = {
  44628. handlers: [],
  44629. add: function(e, t) {
  44630. this.handlers.push(e, t)
  44631. },
  44632. get: function(e) {
  44633. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  44634. var r = t[i]
  44635. , o = t[i + 1];
  44636. if (r.test(e))
  44637. return o
  44638. }
  44639. return null
  44640. }
  44641. },
  44642. Ci.XHRLoader = function(e) {
  44643. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  44644. }
  44645. ,
  44646. Ci.XHRLoader.prototype = {
  44647. constructor: Ci.XHRLoader,
  44648. load: function(i, n, t, r) {
  44649. void 0 !== this.path && (i = this.path + i);
  44650. var o = this
  44651. , e = Ci.Cache.get(i);
  44652. if (void 0 !== e)
  44653. return n && setTimeout(function() {
  44654. n(e)
  44655. }, 0),
  44656. e;
  44657. var a = new XMLHttpRequest;
  44658. return a.overrideMimeType("text/plain"),
  44659. a.open("GET", i, !0),
  44660. a.addEventListener("load", function(e) {
  44661. var t = e.target.response;
  44662. Ci.Cache.add(i, t),
  44663. 200 === this.status ? (n && n(t),
  44664. o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  44665. n && n(t),
  44666. o.manager.itemEnd(i)) : (r && r(e),
  44667. o.manager.itemError(i))
  44668. }, !1),
  44669. void 0 !== t && a.addEventListener("progress", function(e) {
  44670. t(e)
  44671. }, !1),
  44672. a.addEventListener("error", function(e) {
  44673. r && r(e),
  44674. o.manager.itemError(i)
  44675. }, !1),
  44676. void 0 !== this.responseType && (a.responseType = this.responseType),
  44677. void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
  44678. a.send(null),
  44679. o.manager.itemStart(i),
  44680. a
  44681. },
  44682. setPath: function(e) {
  44683. this.path = e
  44684. },
  44685. setResponseType: function(e) {
  44686. this.responseType = e
  44687. },
  44688. setWithCredentials: function(e) {
  44689. this.withCredentials = e
  44690. }
  44691. },
  44692. Ci.FontLoader = function(e) {
  44693. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  44694. }
  44695. ,
  44696. Ci.FontLoader.prototype = {
  44697. constructor: Ci.FontLoader,
  44698. load: function(e, t, i, n) {
  44699. new Ci.XHRLoader(this.manager).load(e, function(e) {
  44700. t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
  44701. }, i, n)
  44702. }
  44703. },
  44704. Ci.ImageLoader = function(e) {
  44705. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  44706. }
  44707. ,
  44708. Ci.ImageLoader.prototype = {
  44709. constructor: Ci.ImageLoader,
  44710. load: function(t, i, n, r) {
  44711. void 0 !== this.path && (t = this.path + t);
  44712. var o = this
  44713. , e = Ci.Cache.get(t);
  44714. if (void 0 !== e)
  44715. return o.manager.itemStart(t),
  44716. i ? setTimeout(function() {
  44717. i(e),
  44718. o.manager.itemEnd(t)
  44719. }, 0) : o.manager.itemEnd(t),
  44720. e;
  44721. var a = document.createElement("img");
  44722. return a.addEventListener("load", function(e) {
  44723. Ci.Cache.add(t, this),
  44724. i && i(this),
  44725. o.manager.itemEnd(t)
  44726. }, !1),
  44727. void 0 !== n && a.addEventListener("progress", function(e) {
  44728. n(e)
  44729. }, !1),
  44730. a.addEventListener("error", function(e) {
  44731. r && r(e),
  44732. o.manager.itemError(t)
  44733. }, !1),
  44734. void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
  44735. o.manager.itemStart(t),
  44736. a.src = t,
  44737. a
  44738. },
  44739. setCrossOrigin: function(e) {
  44740. this.crossOrigin = e
  44741. },
  44742. setPath: function(e) {
  44743. this.path = e
  44744. }
  44745. },
  44746. Ci.JSONLoader = function(e) {
  44747. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  44748. e = void 0),
  44749. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  44750. this.withCredentials = !1
  44751. }
  44752. ,
  44753. Ci.JSONLoader.prototype = {
  44754. constructor: Ci.JSONLoader,
  44755. get statusDomElement() {
  44756. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  44757. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  44758. this._statusDomElement
  44759. },
  44760. load: function(o, a, e, t) {
  44761. var s = this
  44762. , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
  44763. , i = new Ci.XHRLoader(this.manager);
  44764. i.setWithCredentials(this.withCredentials),
  44765. i.load(o, function(e) {
  44766. var t = JSON.parse(e)
  44767. , i = t.metadata;
  44768. if (void 0 !== i) {
  44769. var n = i.type;
  44770. if (void 0 !== n) {
  44771. if ("object" === n.toLowerCase())
  44772. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
  44773. if ("scene" === n.toLowerCase())
  44774. return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
  44775. }
  44776. }
  44777. var r = s.parse(t, l);
  44778. a(r.geometry, r.materials)
  44779. }, e, t)
  44780. },
  44781. setTexturePath: function(e) {
  44782. this.texturePath = e
  44783. },
  44784. parse: function(D, e) {
  44785. var N = new Ci.Geometry
  44786. , t = void 0 !== D.scale ? 1 / D.scale : 1;
  44787. if (function(e) {
  44788. function t(e, t) {
  44789. return e & 1 << t
  44790. }
  44791. 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;
  44792. if (void 0 !== D.uvs) {
  44793. for (i = 0; i < D.uvs.length; i++)
  44794. D.uvs[i].length && L++;
  44795. for (i = 0; i < L; i++)
  44796. N.faceVertexUvs[i] = []
  44797. }
  44798. for (o = 0,
  44799. a = R.length; o < a; )
  44800. (A = new Ci.Vector3).x = R[o++] * e,
  44801. A.y = R[o++] * e,
  44802. A.z = R[o++] * e,
  44803. N.vertices.push(A);
  44804. for (o = 0,
  44805. a = M.length; o < a; )
  44806. if (d = t(u = M[o++], 0),
  44807. p = t(u, 1),
  44808. f = t(u, 3),
  44809. g = t(u, 4),
  44810. m = t(u, 5),
  44811. v = t(u, 6),
  44812. y = t(u, 7),
  44813. d) {
  44814. if ((I = new Ci.Face3).a = M[o],
  44815. I.b = M[o + 1],
  44816. I.c = M[o + 3],
  44817. (E = new Ci.Face3).a = M[o + 1],
  44818. E.b = M[o + 2],
  44819. E.c = M[o + 3],
  44820. o += 4,
  44821. p && (h = M[o++],
  44822. I.materialIndex = h,
  44823. E.materialIndex = h),
  44824. r = N.faces.length,
  44825. f)
  44826. for (i = 0; i < L; i++)
  44827. for (w = D.uvs[i],
  44828. N.faceVertexUvs[i][r] = [],
  44829. N.faceVertexUvs[i][r + 1] = [],
  44830. n = 0; n < 4; n++)
  44831. x = w[2 * (c = M[o++])],
  44832. S = w[2 * c + 1],
  44833. T = new Ci.Vector2(x,S),
  44834. 2 !== n && N.faceVertexUvs[i][r].push(T),
  44835. 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
  44836. if (g && (l = 3 * M[o++],
  44837. I.normal.set(P[l++], P[l++], P[l]),
  44838. E.normal.copy(I.normal)),
  44839. m)
  44840. for (i = 0; i < 4; i++)
  44841. l = 3 * M[o++],
  44842. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  44843. 2 !== i && I.vertexNormals.push(b),
  44844. 0 !== i && E.vertexNormals.push(b);
  44845. if (v && (_ = O[s = M[o++]],
  44846. I.color.setHex(_),
  44847. E.color.setHex(_)),
  44848. y)
  44849. for (i = 0; i < 4; i++)
  44850. _ = O[s = M[o++]],
  44851. 2 !== i && I.vertexColors.push(new Ci.Color(_)),
  44852. 0 !== i && E.vertexColors.push(new Ci.Color(_));
  44853. N.faces.push(I),
  44854. N.faces.push(E)
  44855. } else {
  44856. if ((C = new Ci.Face3).a = M[o++],
  44857. C.b = M[o++],
  44858. C.c = M[o++],
  44859. p && (h = M[o++],
  44860. C.materialIndex = h),
  44861. r = N.faces.length,
  44862. f)
  44863. for (i = 0; i < L; i++)
  44864. for (w = D.uvs[i],
  44865. N.faceVertexUvs[i][r] = [],
  44866. n = 0; n < 3; n++)
  44867. x = w[2 * (c = M[o++])],
  44868. S = w[2 * c + 1],
  44869. T = new Ci.Vector2(x,S),
  44870. N.faceVertexUvs[i][r].push(T);
  44871. if (g && (l = 3 * M[o++],
  44872. C.normal.set(P[l++], P[l++], P[l])),
  44873. m)
  44874. for (i = 0; i < 3; i++)
  44875. l = 3 * M[o++],
  44876. b = new Ci.Vector3(P[l++],P[l++],P[l]),
  44877. C.vertexNormals.push(b);
  44878. if (v && (s = M[o++],
  44879. C.color.setHex(O[s])),
  44880. y)
  44881. for (i = 0; i < 3; i++)
  44882. s = M[o++],
  44883. C.vertexColors.push(new Ci.Color(O[s]));
  44884. N.faces.push(C)
  44885. }
  44886. }(t),
  44887. function() {
  44888. var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
  44889. if (D.skinWeights)
  44890. for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
  44891. var n = D.skinWeights[t]
  44892. , r = 1 < e ? D.skinWeights[t + 1] : 0
  44893. , o = 2 < e ? D.skinWeights[t + 2] : 0
  44894. , a = 3 < e ? D.skinWeights[t + 3] : 0;
  44895. N.skinWeights.push(new Ci.Vector4(n,r,o,a))
  44896. }
  44897. if (D.skinIndices)
  44898. for (t = 0,
  44899. i = D.skinIndices.length; t < i; t += e) {
  44900. var s = D.skinIndices[t]
  44901. , l = 1 < e ? D.skinIndices[t + 1] : 0
  44902. , c = 2 < e ? D.skinIndices[t + 2] : 0
  44903. , h = 3 < e ? D.skinIndices[t + 3] : 0;
  44904. N.skinIndices.push(new Ci.Vector4(s,l,c,h))
  44905. }
  44906. N.bones = D.bones,
  44907. 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.")
  44908. }(),
  44909. function(e) {
  44910. if (void 0 !== D.morphTargets)
  44911. for (var t = 0, i = D.morphTargets.length; t < i; t++) {
  44912. N.morphTargets[t] = {},
  44913. N.morphTargets[t].name = D.morphTargets[t].name,
  44914. N.morphTargets[t].vertices = [];
  44915. for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
  44916. var s = new Ci.Vector3;
  44917. s.x = r[o] * e,
  44918. s.y = r[o + 1] * e,
  44919. s.z = r[o + 2] * e,
  44920. n.push(s)
  44921. }
  44922. }
  44923. if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
  44924. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  44925. var l = N.faces
  44926. , c = D.morphColors[0].colors;
  44927. for (t = 0,
  44928. i = l.length; t < i; t++)
  44929. l[t].color.fromArray(c, 3 * t)
  44930. }
  44931. }(t),
  44932. function() {
  44933. var e = []
  44934. , t = [];
  44935. void 0 !== D.animation && t.push(D.animation),
  44936. void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
  44937. for (var i = 0; i < t.length; i++) {
  44938. var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
  44939. n && e.push(n)
  44940. }
  44941. if (N.morphTargets) {
  44942. var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
  44943. e = e.concat(r)
  44944. }
  44945. 0 < e.length && (N.animations = e)
  44946. }(),
  44947. N.computeFaceNormals(),
  44948. N.computeBoundingSphere(),
  44949. void 0 === D.materials || 0 === D.materials.length)
  44950. return {
  44951. geometry: N
  44952. };
  44953. var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
  44954. return {
  44955. geometry: N,
  44956. materials: i
  44957. }
  44958. }
  44959. },
  44960. Ci.LoadingManager = function(e, t, i) {
  44961. var n = this
  44962. , r = !1
  44963. , o = 0
  44964. , a = 0;
  44965. this.onStart = void 0,
  44966. this.onLoad = e,
  44967. this.onProgress = t,
  44968. this.onError = i,
  44969. this.itemStart = function(e) {
  44970. a++,
  44971. !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
  44972. r = !0
  44973. }
  44974. ,
  44975. this.itemEnd = function(e) {
  44976. o++,
  44977. void 0 !== n.onProgress && n.onProgress(e, o, a),
  44978. o === a && (r = !1,
  44979. void 0 !== n.onLoad && n.onLoad())
  44980. }
  44981. ,
  44982. this.itemError = function(e) {
  44983. void 0 !== n.onError && n.onError(e)
  44984. }
  44985. }
  44986. ,
  44987. Ci.DefaultLoadingManager = new Ci.LoadingManager,
  44988. Ci.BufferGeometryLoader = function(e) {
  44989. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  44990. }
  44991. ,
  44992. Ci.BufferGeometryLoader.prototype = {
  44993. constructor: Ci.BufferGeometryLoader,
  44994. load: function(e, t, i, n) {
  44995. var r = this;
  44996. new Ci.XHRLoader(r.manager).load(e, function(e) {
  44997. t(r.parse(JSON.parse(e)))
  44998. }, i, n)
  44999. },
  45000. parse: function(e) {
  45001. var t = new Ci.BufferGeometry
  45002. , i = e.data.index
  45003. , n = {
  45004. Int8Array: Int8Array,
  45005. Uint8Array: Uint8Array,
  45006. Uint8ClampedArray: Uint8ClampedArray,
  45007. Int16Array: Int16Array,
  45008. Uint16Array: Uint16Array,
  45009. Int32Array: Int32Array,
  45010. Uint32Array: Uint32Array,
  45011. Float32Array: Float32Array,
  45012. Float64Array: Float64Array
  45013. };
  45014. if (void 0 !== i) {
  45015. var r = new n[i.type](i.array);
  45016. t.setIndex(new Ci.BufferAttribute(r,1))
  45017. }
  45018. var o = e.data.attributes;
  45019. for (var a in o) {
  45020. var s = o[a];
  45021. r = new n[s.type](s.array);
  45022. t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
  45023. }
  45024. var l = e.data.groups || e.data.drawcalls || e.data.offsets;
  45025. if (void 0 !== l)
  45026. for (var c = 0, h = l.length; c !== h; ++c) {
  45027. var u = l[c];
  45028. t.addGroup(u.start, u.count, u.materialIndex)
  45029. }
  45030. var d = e.data.boundingSphere;
  45031. if (void 0 !== d) {
  45032. var p = new Ci.Vector3;
  45033. void 0 !== d.center && p.fromArray(d.center),
  45034. t.boundingSphere = new Ci.Sphere(p,d.radius)
  45035. }
  45036. return t
  45037. }
  45038. },
  45039. Ci.MaterialLoader = function(e) {
  45040. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45041. this.textures = {}
  45042. }
  45043. ,
  45044. Ci.MaterialLoader.prototype = {
  45045. constructor: Ci.MaterialLoader,
  45046. load: function(e, t, i, n) {
  45047. var r = this;
  45048. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45049. t(r.parse(JSON.parse(e)))
  45050. }, i, n)
  45051. },
  45052. setTextures: function(e) {
  45053. this.textures = e
  45054. },
  45055. getTexture: function(e) {
  45056. var t = this.textures;
  45057. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45058. t[e]
  45059. },
  45060. parse: function(e) {
  45061. var t = new Ci[e.type];
  45062. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45063. void 0 !== e.name && (t.name = e.name),
  45064. void 0 !== e.color && t.color.setHex(e.color),
  45065. void 0 !== e.roughness && (t.roughness = e.roughness),
  45066. void 0 !== e.metalness && (t.metalness = e.metalness),
  45067. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45068. void 0 !== e.specular && t.specular.setHex(e.specular),
  45069. void 0 !== e.shininess && (t.shininess = e.shininess),
  45070. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45071. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45072. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45073. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45074. void 0 !== e.shading && (t.shading = e.shading),
  45075. void 0 !== e.blending && (t.blending = e.blending),
  45076. void 0 !== e.side && (t.side = e.side),
  45077. void 0 !== e.opacity && (t.opacity = e.opacity),
  45078. void 0 !== e.transparent && (t.transparent = e.transparent),
  45079. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45080. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45081. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45082. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45083. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45084. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45085. void 0 !== e.size && (t.size = e.size),
  45086. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45087. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45088. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  45089. t.transparent = !0),
  45090. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45091. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45092. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45093. void 0 !== e.normalScale) {
  45094. var i = e.normalScale;
  45095. !1 === Array.isArray(i) && (i = [i, i]),
  45096. t.normalScale = (new Ci.Vector2).fromArray(i)
  45097. }
  45098. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45099. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45100. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45101. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45102. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45103. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45104. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45105. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45106. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  45107. t.combine = Ci.MultiplyOperation),
  45108. e.reflectivity && (t.reflectivity = e.reflectivity),
  45109. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45110. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45111. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45112. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45113. void 0 !== e.materials)
  45114. for (var n = 0, r = e.materials.length; n < r; n++)
  45115. t.materials.push(this.parse(e.materials[n]));
  45116. return t
  45117. }
  45118. },
  45119. Ci.ObjectLoader = function(e) {
  45120. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45121. this.texturePath = ""
  45122. }
  45123. ,
  45124. Ci.ObjectLoader.prototype = {
  45125. constructor: Ci.ObjectLoader,
  45126. load: function(e, t, i, n) {
  45127. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  45128. var r = this;
  45129. new Ci.XHRLoader(r.manager).load(e, function(e) {
  45130. r.parse(JSON.parse(e), t)
  45131. }, i, n)
  45132. },
  45133. setTexturePath: function(e) {
  45134. this.texturePath = e
  45135. },
  45136. setCrossOrigin: function(e) {
  45137. this.crossOrigin = e
  45138. },
  45139. parse: function(e, t) {
  45140. var i = this.parseGeometries(e.geometries)
  45141. , n = this.parseImages(e.images, function() {
  45142. void 0 !== t && t(a)
  45143. })
  45144. , r = this.parseTextures(e.textures, n)
  45145. , o = this.parseMaterials(e.materials, r)
  45146. , a = this.parseObject(e.object, i, o);
  45147. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  45148. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  45149. a
  45150. },
  45151. parseGeometries: function(e) {
  45152. var t = {};
  45153. if (void 0 !== e)
  45154. for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
  45155. var a, s = e[r];
  45156. switch (s.type) {
  45157. case "PlaneGeometry":
  45158. case "PlaneBufferGeometry":
  45159. a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
  45160. break;
  45161. case "BoxGeometry":
  45162. case "BoxBufferGeometry":
  45163. case "CubeGeometry":
  45164. a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
  45165. break;
  45166. case "CircleGeometry":
  45167. case "CircleBufferGeometry":
  45168. a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
  45169. break;
  45170. case "CylinderGeometry":
  45171. case "CylinderBufferGeometry":
  45172. a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
  45173. break;
  45174. case "SphereGeometry":
  45175. case "SphereBufferGeometry":
  45176. a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
  45177. break;
  45178. case "DodecahedronGeometry":
  45179. a = new Ci.DodecahedronGeometry(s.radius,s.detail);
  45180. break;
  45181. case "IcosahedronGeometry":
  45182. a = new Ci.IcosahedronGeometry(s.radius,s.detail);
  45183. break;
  45184. case "OctahedronGeometry":
  45185. a = new Ci.OctahedronGeometry(s.radius,s.detail);
  45186. break;
  45187. case "TetrahedronGeometry":
  45188. a = new Ci.TetrahedronGeometry(s.radius,s.detail);
  45189. break;
  45190. case "RingGeometry":
  45191. case "RingBufferGeometry":
  45192. a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
  45193. break;
  45194. case "TorusGeometry":
  45195. case "TorusBufferGeometry":
  45196. a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
  45197. break;
  45198. case "TorusKnotGeometry":
  45199. case "TorusKnotBufferGeometry":
  45200. a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
  45201. break;
  45202. case "LatheGeometry":
  45203. a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
  45204. break;
  45205. case "BufferGeometry":
  45206. a = n.parse(s);
  45207. break;
  45208. case "Geometry":
  45209. a = i.parse(s.data, this.texturePath).geometry;
  45210. break;
  45211. default:
  45212. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
  45213. continue
  45214. }
  45215. a.uuid = s.uuid,
  45216. void 0 !== s.name && (a.name = s.name),
  45217. t[s.uuid] = a
  45218. }
  45219. return t
  45220. },
  45221. parseMaterials: function(e, t) {
  45222. var i = {};
  45223. if (void 0 !== e) {
  45224. var n = new Ci.MaterialLoader;
  45225. n.setTextures(t);
  45226. for (var r = 0, o = e.length; r < o; r++) {
  45227. var a = n.parse(e[r]);
  45228. i[a.uuid] = a
  45229. }
  45230. }
  45231. return i
  45232. },
  45233. parseAnimations: function(e) {
  45234. for (var t = [], i = 0; i < e.length; i++) {
  45235. var n = Ci.AnimationClip.parse(e[i]);
  45236. t.push(n)
  45237. }
  45238. return t
  45239. },
  45240. parseImages: function(e, t) {
  45241. function i(e) {
  45242. return n.manager.itemStart(e),
  45243. a.load(e, function() {
  45244. n.manager.itemEnd(e)
  45245. })
  45246. }
  45247. var n = this
  45248. , r = {};
  45249. if (void 0 !== e && 0 < e.length) {
  45250. var o = new Ci.LoadingManager(t)
  45251. , a = new Ci.ImageLoader(o);
  45252. a.setCrossOrigin(this.crossOrigin);
  45253. for (var s = 0, l = e.length; s < l; s++) {
  45254. var c = e[s]
  45255. , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
  45256. r[c.uuid] = i(h)
  45257. }
  45258. }
  45259. return r
  45260. },
  45261. parseTextures: function(e, t) {
  45262. function i(e) {
  45263. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  45264. Ci[e])
  45265. }
  45266. var n = {};
  45267. if (void 0 !== e)
  45268. for (var r = 0, o = e.length; r < o; r++) {
  45269. var a = e[r];
  45270. void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
  45271. void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
  45272. var s = new Ci.Texture(t[a.image]);
  45273. s.needsUpdate = !0,
  45274. s.uuid = a.uuid,
  45275. void 0 !== a.name && (s.name = a.name),
  45276. void 0 !== a.mapping && (s.mapping = i(a.mapping)),
  45277. void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
  45278. void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
  45279. void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
  45280. void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
  45281. void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
  45282. Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
  45283. s.wrapT = i(a.wrap[1])),
  45284. n[a.uuid] = s
  45285. }
  45286. return n
  45287. },
  45288. parseObject: (ke = new Ci.Matrix4,
  45289. function(e, t, i) {
  45290. function n(e) {
  45291. return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  45292. t[e]
  45293. }
  45294. function r(e) {
  45295. if (void 0 !== e)
  45296. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  45297. i[e]
  45298. }
  45299. var o;
  45300. switch (e.type) {
  45301. case "Scene":
  45302. o = new Ci.Scene;
  45303. break;
  45304. case "PerspectiveCamera":
  45305. o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
  45306. break;
  45307. case "OrthographicCamera":
  45308. o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
  45309. break;
  45310. case "AmbientLight":
  45311. o = new Ci.AmbientLight(e.color,e.intensity);
  45312. break;
  45313. case "DirectionalLight":
  45314. o = new Ci.DirectionalLight(e.color,e.intensity);
  45315. break;
  45316. case "PointLight":
  45317. o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
  45318. break;
  45319. case "SpotLight":
  45320. o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
  45321. break;
  45322. case "HemisphereLight":
  45323. o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
  45324. break;
  45325. case "Mesh":
  45326. var a = n(e.geometry)
  45327. , s = r(e.material);
  45328. o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
  45329. break;
  45330. case "LOD":
  45331. o = new Ci.LOD;
  45332. break;
  45333. case "Line":
  45334. o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
  45335. break;
  45336. case "PointCloud":
  45337. case "Points":
  45338. o = new Ci.Points(n(e.geometry),r(e.material));
  45339. break;
  45340. case "Sprite":
  45341. o = new Ci.Sprite(r(e.material));
  45342. break;
  45343. case "Group":
  45344. o = new Ci.Group;
  45345. break;
  45346. default:
  45347. o = new Ci.Object3D
  45348. }
  45349. if (o.uuid = e.uuid,
  45350. void 0 !== e.name && (o.name = e.name),
  45351. void 0 !== e.matrix ? (ke.fromArray(e.matrix),
  45352. ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
  45353. void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
  45354. void 0 !== e.scale && o.scale.fromArray(e.scale)),
  45355. void 0 !== e.castShadow && (o.castShadow = e.castShadow),
  45356. void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
  45357. void 0 !== e.visible && (o.visible = e.visible),
  45358. void 0 !== e.userData && (o.userData = e.userData),
  45359. void 0 !== e.children)
  45360. for (var l in e.children)
  45361. o.add(this.parseObject(e.children[l], t, i));
  45362. if ("LOD" === e.type)
  45363. for (var c = e.levels, h = 0; h < c.length; h++) {
  45364. var u = c[h];
  45365. void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
  45366. }
  45367. return o
  45368. }
  45369. )
  45370. },
  45371. Ci.TextureLoader = function(e) {
  45372. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45373. }
  45374. ,
  45375. Ci.TextureLoader.prototype = {
  45376. constructor: Ci.TextureLoader,
  45377. load: function(e, t, i, n) {
  45378. var r = new Ci.Texture
  45379. , o = new Ci.ImageLoader(this.manager);
  45380. return o.setCrossOrigin(this.crossOrigin),
  45381. o.setPath(this.path),
  45382. o.load(e, function(e) {
  45383. r.image = e,
  45384. r.needsUpdate = !0,
  45385. void 0 !== t && t(r)
  45386. }, i, n),
  45387. r
  45388. },
  45389. setCrossOrigin: function(e) {
  45390. this.crossOrigin = e
  45391. },
  45392. setPath: function(e) {
  45393. this.path = e
  45394. }
  45395. },
  45396. Ci.CubeTextureLoader = function(e) {
  45397. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
  45398. }
  45399. ,
  45400. Ci.CubeTextureLoader.prototype = {
  45401. constructor: Ci.CubeTextureLoader,
  45402. load: function(e, i, t, n) {
  45403. function r(t) {
  45404. a.load(e[t], function(e) {
  45405. o.images[t] = e,
  45406. 6 === ++s && (o.needsUpdate = !0,
  45407. i && i(o))
  45408. }, void 0, n)
  45409. }
  45410. var o = new Ci.CubeTexture
  45411. , a = new Ci.ImageLoader(this.manager);
  45412. a.setCrossOrigin(this.crossOrigin),
  45413. a.setPath(this.path);
  45414. for (var s = 0, l = 0; l < e.length; ++l)
  45415. r(l);
  45416. return o
  45417. },
  45418. setCrossOrigin: function(e) {
  45419. this.crossOrigin = e
  45420. },
  45421. setPath: function(e) {
  45422. this.path = e
  45423. }
  45424. },
  45425. Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
  45426. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45427. this._parser = null
  45428. }
  45429. ,
  45430. Ci.BinaryTextureLoader.prototype = {
  45431. constructor: Ci.BinaryTextureLoader,
  45432. load: function(e, i, t, n) {
  45433. var r = this
  45434. , o = new Ci.DataTexture
  45435. , a = new Ci.XHRLoader(this.manager);
  45436. return a.setResponseType("arraybuffer"),
  45437. a.load(e, function(e) {
  45438. var t = r._parser(e);
  45439. t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
  45440. o.image.height = t.height,
  45441. o.image.data = t.data),
  45442. o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
  45443. o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
  45444. o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
  45445. o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
  45446. o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
  45447. void 0 !== t.format && (o.format = t.format),
  45448. void 0 !== t.type && (o.type = t.type),
  45449. void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
  45450. 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
  45451. o.needsUpdate = !0,
  45452. i && i(o, t))
  45453. }, t, n),
  45454. o
  45455. }
  45456. },
  45457. Ci.CompressedTextureLoader = function(e) {
  45458. this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
  45459. this._parser = null
  45460. }
  45461. ,
  45462. Ci.CompressedTextureLoader.prototype = {
  45463. constructor: Ci.CompressedTextureLoader,
  45464. load: function(e, o, t, n) {
  45465. function i(i) {
  45466. r.load(e[i], function(e) {
  45467. var t = a._parser(e, !0);
  45468. s[i] = {
  45469. width: t.width,
  45470. height: t.height,
  45471. format: t.format,
  45472. mipmaps: t.mipmaps
  45473. },
  45474. 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  45475. l.format = t.format,
  45476. l.needsUpdate = !0,
  45477. o && o(l))
  45478. }, t, n)
  45479. }
  45480. var a = this
  45481. , s = []
  45482. , l = new Ci.CompressedTexture;
  45483. l.image = s;
  45484. var r = new Ci.XHRLoader(this.manager);
  45485. if (r.setPath(this.path),
  45486. r.setResponseType("arraybuffer"),
  45487. Array.isArray(e))
  45488. for (var c = 0, h = 0, u = e.length; h < u; ++h)
  45489. i(h);
  45490. else
  45491. r.load(e, function(e) {
  45492. var t = a._parser(e, !0);
  45493. if (t.isCubemap)
  45494. for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
  45495. s[n] = {
  45496. mipmaps: []
  45497. };
  45498. for (var r = 0; r < t.mipmapCount; r++)
  45499. s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
  45500. s[n].format = t.format,
  45501. s[n].width = t.width,
  45502. s[n].height = t.height
  45503. }
  45504. else
  45505. l.image.width = t.width,
  45506. l.image.height = t.height,
  45507. l.mipmaps = t.mipmaps;
  45508. 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
  45509. l.format = t.format,
  45510. l.needsUpdate = !0,
  45511. o && o(l)
  45512. }, t, n);
  45513. return l
  45514. },
  45515. setPath: function(e) {
  45516. this.path = e
  45517. }
  45518. },
  45519. Ci.Material = function() {
  45520. Object.defineProperty(this, "id", {
  45521. value: Ci.MaterialIdCount++
  45522. }),
  45523. this.uuid = Ci.Math.generateUUID(),
  45524. this.name = "",
  45525. this.type = "Material",
  45526. this.side = Ci.FrontSide,
  45527. this.opacity = 1,
  45528. this.transparent = !1,
  45529. this.blending = Ci.NormalBlending,
  45530. this.blendSrc = Ci.SrcAlphaFactor,
  45531. this.blendDst = Ci.OneMinusSrcAlphaFactor,
  45532. this.blendEquation = Ci.AddEquation,
  45533. this.blendSrcAlpha = null,
  45534. this.blendDstAlpha = null,
  45535. this.blendEquationAlpha = null,
  45536. this.depthFunc = Ci.LessEqualDepth,
  45537. this.depthTest = !0,
  45538. this.depthWrite = !0,
  45539. this.colorWrite = !0,
  45540. this.precision = null,
  45541. this.polygonOffset = !1,
  45542. this.polygonOffsetFactor = 0,
  45543. this.polygonOffsetUnits = 0,
  45544. this.alphaTest = 0,
  45545. this.premultipliedAlpha = !1,
  45546. this.overdraw = 0,
  45547. this.visible = !0,
  45548. this._needsUpdate = !0
  45549. }
  45550. ,
  45551. Ci.Material.prototype = {
  45552. constructor: Ci.Material,
  45553. get needsUpdate() {
  45554. return this._needsUpdate
  45555. },
  45556. set needsUpdate(e) {
  45557. !0 === e && this.update(),
  45558. this._needsUpdate = e
  45559. },
  45560. setValues: function(e) {
  45561. if (void 0 !== e)
  45562. for (var t in e) {
  45563. var i = e[t];
  45564. if (void 0 !== i) {
  45565. var n = this[t];
  45566. 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.")
  45567. } else
  45568. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  45569. }
  45570. },
  45571. toJSON: function(e) {
  45572. function t(e) {
  45573. var t = [];
  45574. for (var i in e) {
  45575. var n = e[i];
  45576. delete n.metadata,
  45577. t.push(n)
  45578. }
  45579. return t
  45580. }
  45581. var i = void 0 === e;
  45582. i && (e = {
  45583. textures: {},
  45584. images: {}
  45585. });
  45586. var n = {
  45587. metadata: {
  45588. version: 4.4,
  45589. type: "Material",
  45590. generator: "Material.toJSON"
  45591. }
  45592. };
  45593. if (n.uuid = this.uuid,
  45594. n.type = this.type,
  45595. "" !== this.name && (n.name = this.name),
  45596. this.color instanceof Ci.Color && (n.color = this.color.getHex()),
  45597. .5 !== this.roughness && (n.roughness = this.roughness),
  45598. .5 !== this.metalness && (n.metalness = this.metalness),
  45599. this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
  45600. this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
  45601. void 0 !== this.shininess && (n.shininess = this.shininess),
  45602. this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
  45603. this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
  45604. this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
  45605. this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
  45606. n.bumpScale = this.bumpScale),
  45607. this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
  45608. n.normalScale = this.normalScale.toArray()),
  45609. this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
  45610. n.displacementScale = this.displacementScale,
  45611. n.displacementBias = this.displacementBias),
  45612. this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  45613. this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  45614. this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  45615. this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
  45616. this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
  45617. n.reflectivity = this.reflectivity),
  45618. void 0 !== this.size && (n.size = this.size),
  45619. void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
  45620. void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
  45621. void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
  45622. void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
  45623. void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
  45624. this.opacity < 1 && (n.opacity = this.opacity),
  45625. !0 === this.transparent && (n.transparent = this.transparent),
  45626. 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
  45627. !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
  45628. !0 === this.wireframe && (n.wireframe = this.wireframe),
  45629. 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
  45630. i) {
  45631. var r = t(e.textures)
  45632. , o = t(e.images);
  45633. 0 < r.length && (n.textures = r),
  45634. 0 < o.length && (n.images = o)
  45635. }
  45636. return n
  45637. },
  45638. clone: function() {
  45639. return (new this.constructor).copy(this)
  45640. },
  45641. copy: function(e) {
  45642. return this.name = e.name,
  45643. this.side = e.side,
  45644. this.opacity = e.opacity,
  45645. this.transparent = e.transparent,
  45646. this.blending = e.blending,
  45647. this.blendSrc = e.blendSrc,
  45648. this.blendDst = e.blendDst,
  45649. this.blendEquation = e.blendEquation,
  45650. this.blendSrcAlpha = e.blendSrcAlpha,
  45651. this.blendDstAlpha = e.blendDstAlpha,
  45652. this.blendEquationAlpha = e.blendEquationAlpha,
  45653. this.depthFunc = e.depthFunc,
  45654. this.depthTest = e.depthTest,
  45655. this.depthWrite = e.depthWrite,
  45656. this.colorWrite = e.colorWrite,
  45657. this.precision = e.precision,
  45658. this.polygonOffset = e.polygonOffset,
  45659. this.polygonOffsetFactor = e.polygonOffsetFactor,
  45660. this.polygonOffsetUnits = e.polygonOffsetUnits,
  45661. this.alphaTest = e.alphaTest,
  45662. this.premultipliedAlpha = e.premultipliedAlpha,
  45663. this.overdraw = e.overdraw,
  45664. this.visible = e.visible,
  45665. this
  45666. },
  45667. update: function() {
  45668. this.dispatchEvent({
  45669. type: "update"
  45670. })
  45671. },
  45672. dispose: function() {
  45673. this.dispatchEvent({
  45674. type: "dispose"
  45675. })
  45676. }
  45677. },
  45678. Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
  45679. Ci.MaterialIdCount = 0,
  45680. Ci.LineBasicMaterial = function(e) {
  45681. Ci.Material.call(this),
  45682. this.type = "LineBasicMaterial",
  45683. this.color = new Ci.Color(16777215),
  45684. this.linewidth = 1,
  45685. this.linecap = "round",
  45686. this.linejoin = "round",
  45687. this.blending = Ci.NormalBlending,
  45688. this.vertexColors = Ci.NoColors,
  45689. this.fog = !0,
  45690. this.setValues(e)
  45691. }
  45692. ,
  45693. Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  45694. Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
  45695. Ci.LineBasicMaterial.prototype.copy = function(e) {
  45696. return Ci.Material.prototype.copy.call(this, e),
  45697. this.color.copy(e.color),
  45698. this.linewidth = e.linewidth,
  45699. this.linecap = e.linecap,
  45700. this.linejoin = e.linejoin,
  45701. this.vertexColors = e.vertexColors,
  45702. this.fog = e.fog,
  45703. this
  45704. }
  45705. ,
  45706. Ci.LineDashedMaterial = function(e) {
  45707. Ci.Material.call(this),
  45708. this.type = "LineDashedMaterial",
  45709. this.color = new Ci.Color(16777215),
  45710. this.linewidth = 1,
  45711. this.scale = 1,
  45712. this.dashSize = 3,
  45713. this.gapSize = 1,
  45714. this.blending = Ci.NormalBlending,
  45715. this.vertexColors = Ci.NoColors,
  45716. this.fog = !0,
  45717. this.setValues(e)
  45718. }
  45719. ,
  45720. Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
  45721. Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
  45722. Ci.LineDashedMaterial.prototype.copy = function(e) {
  45723. return Ci.Material.prototype.copy.call(this, e),
  45724. this.color.copy(e.color),
  45725. this.linewidth = e.linewidth,
  45726. this.scale = e.scale,
  45727. this.dashSize = e.dashSize,
  45728. this.gapSize = e.gapSize,
  45729. this.vertexColors = e.vertexColors,
  45730. this.fog = e.fog,
  45731. this
  45732. }
  45733. ,
  45734. Ci.MeshBasicMaterial = function(e) {
  45735. Ci.Material.call(this),
  45736. this.type = "MeshBasicMaterial",
  45737. this.color = new Ci.Color(16777215),
  45738. this.map = null,
  45739. this.aoMap = null,
  45740. this.aoMapIntensity = 1,
  45741. this.specularMap = null,
  45742. this.alphaMap = null,
  45743. this.envMap = null,
  45744. this.combine = Ci.MultiplyOperation,
  45745. this.reflectivity = 1,
  45746. this.refractionRatio = .98,
  45747. this.fog = !0,
  45748. this.shading = Ci.SmoothShading,
  45749. this.blending = Ci.NormalBlending,
  45750. this.wireframe = !1,
  45751. this.wireframeLinewidth = 1,
  45752. this.wireframeLinecap = "round",
  45753. this.wireframeLinejoin = "round",
  45754. this.vertexColors = Ci.NoColors,
  45755. this.skinning = !1,
  45756. this.morphTargets = !1,
  45757. this.setValues(e)
  45758. }
  45759. ,
  45760. Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
  45761. Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
  45762. Ci.MeshBasicMaterial.prototype.copy = function(e) {
  45763. return Ci.Material.prototype.copy.call(this, e),
  45764. this.color.copy(e.color),
  45765. this.map = e.map,
  45766. this.aoMap = e.aoMap,
  45767. this.aoMapIntensity = e.aoMapIntensity,
  45768. this.specularMap = e.specularMap,
  45769. this.alphaMap = e.alphaMap,
  45770. this.envMap = e.envMap,
  45771. this.combine = e.combine,
  45772. this.reflectivity = e.reflectivity,
  45773. this.refractionRatio = e.refractionRatio,
  45774. this.fog = e.fog,
  45775. this.shading = e.shading,
  45776. this.wireframe = e.wireframe,
  45777. this.wireframeLinewidth = e.wireframeLinewidth,
  45778. this.wireframeLinecap = e.wireframeLinecap,
  45779. this.wireframeLinejoin = e.wireframeLinejoin,
  45780. this.vertexColors = e.vertexColors,
  45781. this.skinning = e.skinning,
  45782. this.morphTargets = e.morphTargets,
  45783. this
  45784. }
  45785. ,
  45786. Ci.MeshLambertMaterial = function(e) {
  45787. Ci.Material.call(this),
  45788. this.type = "MeshLambertMaterial",
  45789. this.color = new Ci.Color(16777215),
  45790. this.map = null,
  45791. this.lightMap = null,
  45792. this.lightMapIntensity = 1,
  45793. this.aoMap = null,
  45794. this.aoMapIntensity = 1,
  45795. this.emissive = new Ci.Color(0),
  45796. this.emissiveIntensity = 1,
  45797. this.emissiveMap = null,
  45798. this.specularMap = null,
  45799. this.alphaMap = null,
  45800. this.envMap = null,
  45801. this.combine = Ci.MultiplyOperation,
  45802. this.reflectivity = 1,
  45803. this.refractionRatio = .98,
  45804. this.fog = !0,
  45805. this.blending = Ci.NormalBlending,
  45806. this.wireframe = !1,
  45807. this.wireframeLinewidth = 1,
  45808. this.wireframeLinecap = "round",
  45809. this.wireframeLinejoin = "round",
  45810. this.vertexColors = Ci.NoColors,
  45811. this.skinning = !1,
  45812. this.morphTargets = !1,
  45813. this.morphNormals = !1,
  45814. this.setValues(e)
  45815. }
  45816. ,
  45817. Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
  45818. Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
  45819. Ci.MeshLambertMaterial.prototype.copy = function(e) {
  45820. return Ci.Material.prototype.copy.call(this, e),
  45821. this.color.copy(e.color),
  45822. this.map = e.map,
  45823. this.lightMap = e.lightMap,
  45824. this.lightMapIntensity = e.lightMapIntensity,
  45825. this.aoMap = e.aoMap,
  45826. this.aoMapIntensity = e.aoMapIntensity,
  45827. this.emissive.copy(e.emissive),
  45828. this.emissiveMap = e.emissiveMap,
  45829. this.emissiveIntensity = e.emissiveIntensity,
  45830. this.specularMap = e.specularMap,
  45831. this.alphaMap = e.alphaMap,
  45832. this.envMap = e.envMap,
  45833. this.combine = e.combine,
  45834. this.reflectivity = e.reflectivity,
  45835. this.refractionRatio = e.refractionRatio,
  45836. this.fog = e.fog,
  45837. this.wireframe = e.wireframe,
  45838. this.wireframeLinewidth = e.wireframeLinewidth,
  45839. this.wireframeLinecap = e.wireframeLinecap,
  45840. this.wireframeLinejoin = e.wireframeLinejoin,
  45841. this.vertexColors = e.vertexColors,
  45842. this.skinning = e.skinning,
  45843. this.morphTargets = e.morphTargets,
  45844. this.morphNormals = e.morphNormals,
  45845. this
  45846. }
  45847. ,
  45848. Ci.MeshPhongMaterial = function(e) {
  45849. Ci.Material.call(this),
  45850. this.type = "MeshPhongMaterial",
  45851. this.color = new Ci.Color(16777215),
  45852. this.specular = new Ci.Color(1118481),
  45853. this.shininess = 30,
  45854. this.map = null,
  45855. this.lightMap = null,
  45856. this.lightMapIntensity = 1,
  45857. this.aoMap = null,
  45858. this.aoMapIntensity = 1,
  45859. this.emissive = new Ci.Color(0),
  45860. this.emissiveIntensity = 1,
  45861. this.emissiveMap = null,
  45862. this.bumpMap = null,
  45863. this.bumpScale = 1,
  45864. this.normalMap = null,
  45865. this.normalScale = new Ci.Vector2(1,1),
  45866. this.displacementMap = null,
  45867. this.displacementScale = 1,
  45868. this.displacementBias = 0,
  45869. this.specularMap = null,
  45870. this.alphaMap = null,
  45871. this.envMap = null,
  45872. this.combine = Ci.MultiplyOperation,
  45873. this.reflectivity = 1,
  45874. this.refractionRatio = .98,
  45875. this.fog = !0,
  45876. this.shading = Ci.SmoothShading,
  45877. this.blending = Ci.NormalBlending,
  45878. this.wireframe = !1,
  45879. this.wireframeLinewidth = 1,
  45880. this.wireframeLinecap = "round",
  45881. this.wireframeLinejoin = "round",
  45882. this.vertexColors = Ci.NoColors,
  45883. this.skinning = !1,
  45884. this.morphTargets = !1,
  45885. this.morphNormals = !1,
  45886. this.setValues(e)
  45887. }
  45888. ,
  45889. Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
  45890. Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
  45891. Ci.MeshPhongMaterial.prototype.copy = function(e) {
  45892. return Ci.Material.prototype.copy.call(this, e),
  45893. this.color.copy(e.color),
  45894. this.specular.copy(e.specular),
  45895. this.shininess = e.shininess,
  45896. this.map = e.map,
  45897. this.lightMap = e.lightMap,
  45898. this.lightMapIntensity = e.lightMapIntensity,
  45899. this.aoMap = e.aoMap,
  45900. this.aoMapIntensity = e.aoMapIntensity,
  45901. this.emissive.copy(e.emissive),
  45902. this.emissiveMap = e.emissiveMap,
  45903. this.emissiveIntensity = e.emissiveIntensity,
  45904. this.bumpMap = e.bumpMap,
  45905. this.bumpScale = e.bumpScale,
  45906. this.normalMap = e.normalMap,
  45907. this.normalScale.copy(e.normalScale),
  45908. this.displacementMap = e.displacementMap,
  45909. this.displacementScale = e.displacementScale,
  45910. this.displacementBias = e.displacementBias,
  45911. this.specularMap = e.specularMap,
  45912. this.alphaMap = e.alphaMap,
  45913. this.envMap = e.envMap,
  45914. this.combine = e.combine,
  45915. this.reflectivity = e.reflectivity,
  45916. this.refractionRatio = e.refractionRatio,
  45917. this.fog = e.fog,
  45918. this.shading = e.shading,
  45919. this.wireframe = e.wireframe,
  45920. this.wireframeLinewidth = e.wireframeLinewidth,
  45921. this.wireframeLinecap = e.wireframeLinecap,
  45922. this.wireframeLinejoin = e.wireframeLinejoin,
  45923. this.vertexColors = e.vertexColors,
  45924. this.skinning = e.skinning,
  45925. this.morphTargets = e.morphTargets,
  45926. this.morphNormals = e.morphNormals,
  45927. this
  45928. }
  45929. ,
  45930. Ci.MeshStandardMaterial = function(e) {
  45931. Ci.Material.call(this),
  45932. this.type = "MeshStandardMaterial",
  45933. this.color = new Ci.Color(16777215),
  45934. this.roughness = .5,
  45935. this.metalness = .5,
  45936. this.map = null,
  45937. this.lightMap = null,
  45938. this.lightMapIntensity = 1,
  45939. this.aoMap = null,
  45940. this.aoMapIntensity = 1,
  45941. this.emissive = new Ci.Color(0),
  45942. this.emissiveIntensity = 1,
  45943. this.emissiveMap = null,
  45944. this.bumpMap = null,
  45945. this.bumpScale = 1,
  45946. this.normalMap = null,
  45947. this.normalScale = new Ci.Vector2(1,1),
  45948. this.displacementMap = null,
  45949. this.displacementScale = 1,
  45950. this.displacementBias = 0,
  45951. this.roughnessMap = null,
  45952. this.metalnessMap = null,
  45953. this.alphaMap = null,
  45954. this.envMap = null,
  45955. this.envMapIntensity = 1,
  45956. this.refractionRatio = .98,
  45957. this.fog = !0,
  45958. this.shading = Ci.SmoothShading,
  45959. this.blending = Ci.NormalBlending,
  45960. this.wireframe = !1,
  45961. this.wireframeLinewidth = 1,
  45962. this.wireframeLinecap = "round",
  45963. this.wireframeLinejoin = "round",
  45964. this.vertexColors = Ci.NoColors,
  45965. this.skinning = !1,
  45966. this.morphTargets = !1,
  45967. this.morphNormals = !1,
  45968. this.setValues(e)
  45969. }
  45970. ,
  45971. Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
  45972. Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
  45973. Ci.MeshStandardMaterial.prototype.copy = function(e) {
  45974. return Ci.Material.prototype.copy.call(this, e),
  45975. this.color.copy(e.color),
  45976. this.roughness = e.roughness,
  45977. this.metalness = e.metalness,
  45978. this.map = e.map,
  45979. this.lightMap = e.lightMap,
  45980. this.lightMapIntensity = e.lightMapIntensity,
  45981. this.aoMap = e.aoMap,
  45982. this.aoMapIntensity = e.aoMapIntensity,
  45983. this.emissive.copy(e.emissive),
  45984. this.emissiveMap = e.emissiveMap,
  45985. this.emissiveIntensity = e.emissiveIntensity,
  45986. this.bumpMap = e.bumpMap,
  45987. this.bumpScale = e.bumpScale,
  45988. this.normalMap = e.normalMap,
  45989. this.normalScale.copy(e.normalScale),
  45990. this.displacementMap = e.displacementMap,
  45991. this.displacementScale = e.displacementScale,
  45992. this.displacementBias = e.displacementBias,
  45993. this.roughnessMap = e.roughnessMap,
  45994. this.metalnessMap = e.metalnessMap,
  45995. this.alphaMap = e.alphaMap,
  45996. this.envMap = e.envMap,
  45997. this.envMapIntensity = e.envMapIntensity,
  45998. this.refractionRatio = e.refractionRatio,
  45999. this.fog = e.fog,
  46000. this.shading = e.shading,
  46001. this.wireframe = e.wireframe,
  46002. this.wireframeLinewidth = e.wireframeLinewidth,
  46003. this.wireframeLinecap = e.wireframeLinecap,
  46004. this.wireframeLinejoin = e.wireframeLinejoin,
  46005. this.vertexColors = e.vertexColors,
  46006. this.skinning = e.skinning,
  46007. this.morphTargets = e.morphTargets,
  46008. this.morphNormals = e.morphNormals,
  46009. this
  46010. }
  46011. ,
  46012. Ci.MeshDepthMaterial = function(e) {
  46013. Ci.Material.call(this),
  46014. this.type = "MeshDepthMaterial",
  46015. this.morphTargets = !1,
  46016. this.wireframe = !1,
  46017. this.wireframeLinewidth = 1,
  46018. this.setValues(e)
  46019. }
  46020. ,
  46021. Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
  46022. Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
  46023. Ci.MeshDepthMaterial.prototype.copy = function(e) {
  46024. return Ci.Material.prototype.copy.call(this, e),
  46025. this.wireframe = e.wireframe,
  46026. this.wireframeLinewidth = e.wireframeLinewidth,
  46027. this
  46028. }
  46029. ,
  46030. Ci.MeshNormalMaterial = function(e) {
  46031. Ci.Material.call(this, e),
  46032. this.type = "MeshNormalMaterial",
  46033. this.wireframe = !1,
  46034. this.wireframeLinewidth = 1,
  46035. this.morphTargets = !1,
  46036. this.setValues(e)
  46037. }
  46038. ,
  46039. Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
  46040. Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
  46041. Ci.MeshNormalMaterial.prototype.copy = function(e) {
  46042. return Ci.Material.prototype.copy.call(this, e),
  46043. this.wireframe = e.wireframe,
  46044. this.wireframeLinewidth = e.wireframeLinewidth,
  46045. this
  46046. }
  46047. ,
  46048. Ci.MultiMaterial = function(e) {
  46049. this.uuid = Ci.Math.generateUUID(),
  46050. this.type = "MultiMaterial",
  46051. this.materials = e instanceof Array ? e : [],
  46052. this.visible = !0
  46053. }
  46054. ,
  46055. Ci.MultiMaterial.prototype = {
  46056. constructor: Ci.MultiMaterial,
  46057. toJSON: function(e) {
  46058. for (var t = {
  46059. metadata: {
  46060. version: 4.2,
  46061. type: "material",
  46062. generator: "MaterialExporter"
  46063. },
  46064. uuid: this.uuid,
  46065. type: this.type,
  46066. materials: []
  46067. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  46068. var o = i[n].toJSON(e);
  46069. delete o.metadata,
  46070. t.materials.push(o)
  46071. }
  46072. return t.visible = this.visible,
  46073. t
  46074. },
  46075. clone: function() {
  46076. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  46077. e.materials.push(this.materials[t].clone());
  46078. return e.visible = this.visible,
  46079. e
  46080. }
  46081. },
  46082. Ci.PointsMaterial = function(e) {
  46083. Ci.Material.call(this),
  46084. this.type = "PointsMaterial",
  46085. this.color = new Ci.Color(16777215),
  46086. this.map = null,
  46087. this.size = 1,
  46088. this.sizeAttenuation = !0,
  46089. this.blending = Ci.NormalBlending,
  46090. this.vertexColors = Ci.NoColors,
  46091. this.fog = !0,
  46092. this.setValues(e)
  46093. }
  46094. ,
  46095. Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
  46096. Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
  46097. Ci.PointsMaterial.prototype.copy = function(e) {
  46098. return Ci.Material.prototype.copy.call(this, e),
  46099. this.color.copy(e.color),
  46100. this.map = e.map,
  46101. this.size = e.size,
  46102. this.sizeAttenuation = e.sizeAttenuation,
  46103. this.vertexColors = e.vertexColors,
  46104. this.fog = e.fog,
  46105. this
  46106. }
  46107. ,
  46108. Ci.ShaderMaterial = function(e) {
  46109. Ci.Material.call(this),
  46110. this.type = "ShaderMaterial",
  46111. this.defines = {},
  46112. this.uniforms = {},
  46113. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  46114. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  46115. this.shading = Ci.SmoothShading,
  46116. this.linewidth = 1,
  46117. this.wireframe = !1,
  46118. this.wireframeLinewidth = 1,
  46119. this.fog = !1,
  46120. this.lights = !1,
  46121. this.vertexColors = Ci.NoColors,
  46122. this.skinning = !1,
  46123. this.morphTargets = !1,
  46124. this.morphNormals = !1,
  46125. this.extensions = {
  46126. derivatives: !1,
  46127. fragDepth: !1,
  46128. drawBuffers: !1,
  46129. shaderTextureLOD: !1
  46130. },
  46131. this.defaultAttributeValues = {
  46132. color: [1, 1, 1],
  46133. uv: [0, 0],
  46134. uv2: [0, 0]
  46135. },
  46136. (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  46137. this.setValues(e))
  46138. }
  46139. ,
  46140. Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
  46141. Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
  46142. Ci.ShaderMaterial.prototype.copy = function(e) {
  46143. return Ci.Material.prototype.copy.call(this, e),
  46144. this.fragmentShader = e.fragmentShader,
  46145. this.vertexShader = e.vertexShader,
  46146. this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
  46147. this.defines = e.defines,
  46148. this.shading = e.shading,
  46149. this.wireframe = e.wireframe,
  46150. this.wireframeLinewidth = e.wireframeLinewidth,
  46151. this.fog = e.fog,
  46152. this.lights = e.lights,
  46153. this.vertexColors = e.vertexColors,
  46154. this.skinning = e.skinning,
  46155. this.morphTargets = e.morphTargets,
  46156. this.morphNormals = e.morphNormals,
  46157. this.extensions = e.extensions,
  46158. this
  46159. }
  46160. ,
  46161. Ci.ShaderMaterial.prototype.toJSON = function(e) {
  46162. var t = Ci.Material.prototype.toJSON.call(this, e);
  46163. return t.uniforms = this.uniforms,
  46164. t.vertexShader = this.vertexShader,
  46165. t.fragmentShader = this.fragmentShader,
  46166. t
  46167. }
  46168. ,
  46169. Ci.RawShaderMaterial = function(e) {
  46170. Ci.ShaderMaterial.call(this, e),
  46171. this.type = "RawShaderMaterial"
  46172. }
  46173. ,
  46174. Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
  46175. Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
  46176. Ci.SpriteMaterial = function(e) {
  46177. Ci.Material.call(this),
  46178. this.type = "SpriteMaterial",
  46179. this.color = new Ci.Color(16777215),
  46180. this.map = null,
  46181. this.rotation = 0,
  46182. this.fog = !1,
  46183. this.setValues(e)
  46184. }
  46185. ,
  46186. Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
  46187. Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
  46188. Ci.SpriteMaterial.prototype.copy = function(e) {
  46189. return Ci.Material.prototype.copy.call(this, e),
  46190. this.color.copy(e.color),
  46191. this.map = e.map,
  46192. this.rotation = e.rotation,
  46193. this.fog = e.fog,
  46194. this
  46195. }
  46196. ,
  46197. Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
  46198. Object.defineProperty(this, "id", {
  46199. value: Ci.TextureIdCount++
  46200. }),
  46201. this.uuid = Ci.Math.generateUUID(),
  46202. this.name = "",
  46203. this.sourceFile = "",
  46204. this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
  46205. this.mipmaps = [],
  46206. this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
  46207. this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
  46208. this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
  46209. this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
  46210. this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
  46211. this.anisotropy = void 0 !== l ? l : 1,
  46212. this.format = void 0 !== a ? a : Ci.RGBAFormat,
  46213. this.type = void 0 !== s ? s : Ci.UnsignedByteType,
  46214. this.offset = new Ci.Vector2(0,0),
  46215. this.repeat = new Ci.Vector2(1,1),
  46216. this.generateMipmaps = !0,
  46217. this.premultiplyAlpha = !1,
  46218. this.flipY = !0,
  46219. this.unpackAlignment = 4,
  46220. this.encoding = Ci.LinearEncoding,
  46221. this.version = 0,
  46222. this.onUpdate = null
  46223. }
  46224. ,
  46225. Ci.Texture.DEFAULT_IMAGE = void 0,
  46226. Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
  46227. Ci.Texture.prototype = {
  46228. constructor: Ci.Texture,
  46229. set needsUpdate(e) {
  46230. !0 === e && this.version++
  46231. },
  46232. clone: function() {
  46233. return (new this.constructor).copy(this)
  46234. },
  46235. copy: function(e) {
  46236. return this.image = e.image,
  46237. this.mipmaps = e.mipmaps.slice(0),
  46238. this.mapping = e.mapping,
  46239. this.wrapS = e.wrapS,
  46240. this.wrapT = e.wrapT,
  46241. this.magFilter = e.magFilter,
  46242. this.minFilter = e.minFilter,
  46243. this.anisotropy = e.anisotropy,
  46244. this.format = e.format,
  46245. this.type = e.type,
  46246. this.offset.copy(e.offset),
  46247. this.repeat.copy(e.repeat),
  46248. this.generateMipmaps = e.generateMipmaps,
  46249. this.premultiplyAlpha = e.premultiplyAlpha,
  46250. this.flipY = e.flipY,
  46251. this.unpackAlignment = e.unpackAlignment,
  46252. this.encoding = e.encoding,
  46253. this
  46254. },
  46255. toJSON: function(e) {
  46256. if (void 0 !== e.textures[this.uuid])
  46257. return e.textures[this.uuid];
  46258. var t, i, n = {
  46259. metadata: {
  46260. version: 4.4,
  46261. type: "Texture",
  46262. generator: "Texture.toJSON"
  46263. },
  46264. uuid: this.uuid,
  46265. name: this.name,
  46266. mapping: this.mapping,
  46267. repeat: [this.repeat.x, this.repeat.y],
  46268. offset: [this.offset.x, this.offset.y],
  46269. wrap: [this.wrapS, this.wrapT],
  46270. minFilter: this.minFilter,
  46271. magFilter: this.magFilter,
  46272. anisotropy: this.anisotropy
  46273. };
  46274. if (void 0 !== this.image) {
  46275. var r = this.image;
  46276. void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
  46277. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  46278. uuid: r.uuid,
  46279. url: (t = r,
  46280. void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
  46281. i.height = t.height,
  46282. i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
  46283. 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
  46284. }),
  46285. n.image = r.uuid
  46286. }
  46287. return e.textures[this.uuid] = n
  46288. },
  46289. dispose: function() {
  46290. this.dispatchEvent({
  46291. type: "dispose"
  46292. })
  46293. },
  46294. transformUv: function(e) {
  46295. if (this.mapping === Ci.UVMapping) {
  46296. if (e.multiply(this.repeat),
  46297. e.add(this.offset),
  46298. e.x < 0 || 1 < e.x)
  46299. switch (this.wrapS) {
  46300. case Ci.RepeatWrapping:
  46301. e.x = e.x - Math.floor(e.x);
  46302. break;
  46303. case Ci.ClampToEdgeWrapping:
  46304. e.x = e.x < 0 ? 0 : 1;
  46305. break;
  46306. case Ci.MirroredRepeatWrapping:
  46307. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  46308. }
  46309. if (e.y < 0 || 1 < e.y)
  46310. switch (this.wrapT) {
  46311. case Ci.RepeatWrapping:
  46312. e.y = e.y - Math.floor(e.y);
  46313. break;
  46314. case Ci.ClampToEdgeWrapping:
  46315. e.y = e.y < 0 ? 0 : 1;
  46316. break;
  46317. case Ci.MirroredRepeatWrapping:
  46318. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  46319. }
  46320. this.flipY && (e.y = 1 - e.y)
  46321. }
  46322. }
  46323. },
  46324. Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
  46325. Ci.TextureIdCount = 0,
  46326. Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
  46327. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  46328. this.needsUpdate = !0
  46329. }
  46330. ,
  46331. Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
  46332. Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
  46333. Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
  46334. e = void 0 !== e ? e : [],
  46335. t = void 0 !== t ? t : Ci.CubeReflectionMapping,
  46336. Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
  46337. this.flipY = !1
  46338. }
  46339. ,
  46340. Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
  46341. Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
  46342. Object.defineProperty(Ci.CubeTexture.prototype, "images", {
  46343. get: function() {
  46344. return this.image
  46345. },
  46346. set: function(e) {
  46347. this.image = e
  46348. }
  46349. }),
  46350. Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  46351. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  46352. this.image = {
  46353. width: t,
  46354. height: i
  46355. },
  46356. this.mipmaps = e,
  46357. this.flipY = !1,
  46358. this.generateMipmaps = !1
  46359. }
  46360. ,
  46361. Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
  46362. Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
  46363. Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
  46364. Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
  46365. this.image = {
  46366. data: e,
  46367. width: t,
  46368. height: i
  46369. },
  46370. this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
  46371. this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
  46372. this.flipY = !1,
  46373. this.generateMipmaps = !1
  46374. }
  46375. ,
  46376. Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
  46377. Ci.DataTexture.prototype.constructor = Ci.DataTexture,
  46378. Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
  46379. Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
  46380. this.generateMipmaps = !1;
  46381. var c = this;
  46382. !function e() {
  46383. requestAnimationFrame(e),
  46384. t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
  46385. }()
  46386. }
  46387. ,
  46388. Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
  46389. Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
  46390. Ci.Group = function() {
  46391. Ci.Object3D.call(this),
  46392. this.type = "Group"
  46393. }
  46394. ,
  46395. Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
  46396. Ci.Group.prototype.constructor = Ci.Group,
  46397. Ci.Points = function(e, t) {
  46398. Ci.Object3D.call(this),
  46399. this.type = "Points",
  46400. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46401. this.material = void 0 !== t ? t : new Ci.PointsMaterial({
  46402. color: 16777215 * Math.random()
  46403. })
  46404. }
  46405. ,
  46406. Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
  46407. Ci.Points.prototype.constructor = Ci.Points,
  46408. Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
  46409. jt = new Ci.Ray,
  46410. Yt = new Ci.Sphere,
  46411. function(o, a) {
  46412. function e(e, t) {
  46413. var i = jt.distanceSqToPoint(e);
  46414. if (i < c) {
  46415. var n = jt.closestPointToPoint(e);
  46416. n.applyMatrix4(l);
  46417. var r = o.ray.origin.distanceTo(n);
  46418. if (r < o.near || r > o.far)
  46419. return;
  46420. a.push({
  46421. distance: r,
  46422. distanceToRay: Math.sqrt(i),
  46423. point: n.clone(),
  46424. index: t,
  46425. face: null,
  46426. object: s
  46427. })
  46428. }
  46429. }
  46430. var s = this
  46431. , t = this.geometry
  46432. , l = this.matrixWorld
  46433. , i = o.params.Points.threshold;
  46434. if (null === t.boundingSphere && t.computeBoundingSphere(),
  46435. Yt.copy(t.boundingSphere),
  46436. Yt.applyMatrix4(l),
  46437. !1 !== o.ray.intersectsSphere(Yt)) {
  46438. Wt.getInverse(l),
  46439. jt.copy(o.ray).applyMatrix4(Wt);
  46440. var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  46441. , c = n * n
  46442. , r = new Ci.Vector3;
  46443. if (t instanceof Ci.BufferGeometry) {
  46444. var h = t.index
  46445. , u = t.attributes.position.array;
  46446. if (null !== h)
  46447. for (var d = h.array, p = 0, f = d.length; p < f; p++) {
  46448. var g = d[p];
  46449. r.fromArray(u, 3 * g),
  46450. e(r, g)
  46451. }
  46452. else {
  46453. p = 0;
  46454. for (var m = u.length / 3; p < m; p++)
  46455. r.fromArray(u, 3 * p),
  46456. e(r, p)
  46457. }
  46458. } else {
  46459. var v = t.vertices;
  46460. for (p = 0,
  46461. m = v.length; p < m; p++)
  46462. e(v[p], p)
  46463. }
  46464. }
  46465. }
  46466. ),
  46467. Ci.Points.prototype.clone = function() {
  46468. return new this.constructor(this.geometry,this.material).copy(this)
  46469. }
  46470. ,
  46471. Ci.Line = function(e, t, i) {
  46472. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  46473. new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
  46474. this.type = "Line",
  46475. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46476. void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
  46477. color: 16777215 * Math.random()
  46478. })))
  46479. }
  46480. ,
  46481. Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
  46482. Ci.Line.prototype.constructor = Ci.Line,
  46483. Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
  46484. zt = new Ci.Ray,
  46485. Gt = new Ci.Sphere,
  46486. function(e, t) {
  46487. var i = e.linePrecision
  46488. , n = i * i
  46489. , r = this.geometry
  46490. , o = this.matrixWorld;
  46491. if (null === r.boundingSphere && r.computeBoundingSphere(),
  46492. Gt.copy(r.boundingSphere),
  46493. Gt.applyMatrix4(o),
  46494. !1 !== e.ray.intersectsSphere(Gt)) {
  46495. Ht.getInverse(o),
  46496. zt.copy(e.ray).applyMatrix4(Ht);
  46497. var a = new Ci.Vector3
  46498. , s = new Ci.Vector3
  46499. , l = new Ci.Vector3
  46500. , c = new Ci.Vector3
  46501. , h = this instanceof Ci.LineSegments ? 2 : 1;
  46502. if (r instanceof Ci.BufferGeometry) {
  46503. var u = r.index
  46504. , d = r.attributes.position.array;
  46505. if (null !== u)
  46506. for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
  46507. var m = p[f]
  46508. , v = p[f + 1];
  46509. a.fromArray(d, 3 * m),
  46510. s.fromArray(d, 3 * v),
  46511. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  46512. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  46513. distance: C,
  46514. point: l.clone().applyMatrix4(this.matrixWorld),
  46515. index: f,
  46516. face: null,
  46517. faceIndex: null,
  46518. object: this
  46519. }))
  46520. }
  46521. else
  46522. for (f = 0,
  46523. g = d.length / 3 - 1; f < g; f += h)
  46524. a.fromArray(d, 3 * f),
  46525. s.fromArray(d, 3 * f + 3),
  46526. n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
  46527. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  46528. distance: C,
  46529. point: l.clone().applyMatrix4(this.matrixWorld),
  46530. index: f,
  46531. face: null,
  46532. faceIndex: null,
  46533. object: this
  46534. }))
  46535. } else if (r instanceof Ci.Geometry) {
  46536. var y = r.vertices
  46537. , A = y.length;
  46538. for (f = 0; f < A - 1; f += h) {
  46539. var C;
  46540. n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
  46541. (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
  46542. distance: C,
  46543. point: l.clone().applyMatrix4(this.matrixWorld),
  46544. index: f,
  46545. face: null,
  46546. faceIndex: null,
  46547. object: this
  46548. }))
  46549. }
  46550. }
  46551. }
  46552. }
  46553. ),
  46554. Ci.Line.prototype.clone = function() {
  46555. return new this.constructor(this.geometry,this.material).copy(this)
  46556. }
  46557. ,
  46558. Ci.LineStrip = 0,
  46559. Ci.LinePieces = 1,
  46560. Ci.LineSegments = function(e, t) {
  46561. Ci.Line.call(this, e, t),
  46562. this.type = "LineSegments"
  46563. }
  46564. ,
  46565. Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
  46566. Ci.LineSegments.prototype.constructor = Ci.LineSegments,
  46567. Ci.Mesh = function(e, t) {
  46568. Ci.Object3D.call(this),
  46569. this.type = "Mesh",
  46570. this.geometry = void 0 !== e ? e : new Ci.Geometry,
  46571. this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
  46572. color: 16777215 * Math.random()
  46573. }),
  46574. this.drawMode = Ci.TrianglesDrawMode,
  46575. this.updateMorphTargets()
  46576. }
  46577. ,
  46578. Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
  46579. Ci.Mesh.prototype.constructor = Ci.Mesh,
  46580. Ci.Mesh.prototype.setDrawMode = function(e) {
  46581. this.drawMode = e
  46582. }
  46583. ,
  46584. Ci.Mesh.prototype.updateMorphTargets = function() {
  46585. if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
  46586. this.morphTargetBase = -1,
  46587. this.morphTargetInfluences = [],
  46588. this.morphTargetDictionary = {};
  46589. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  46590. this.morphTargetInfluences.push(0),
  46591. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  46592. }
  46593. }
  46594. ,
  46595. Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  46596. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  46597. 0)
  46598. }
  46599. ,
  46600. Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
  46601. xt = new Ci.Ray,
  46602. St = new Ci.Sphere,
  46603. Mt = new Ci.Vector3,
  46604. Rt = new Ci.Vector3,
  46605. Pt = new Ci.Vector3,
  46606. Ot = new Ci.Vector3,
  46607. Lt = new Ci.Vector3,
  46608. Dt = new Ci.Vector3,
  46609. Nt = new Ci.Vector2,
  46610. Ft = new Ci.Vector2,
  46611. Bt = new Ci.Vector2,
  46612. Vt = new Ci.Vector3,
  46613. kt = new Ci.Vector3,
  46614. Ut = new Ci.Vector3,
  46615. function(e, t) {
  46616. var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
  46617. if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
  46618. St.copy(r.boundingSphere),
  46619. St.applyMatrix4(a),
  46620. !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
  46621. xt.copy(e.ray).applyMatrix4(Tt),
  46622. null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
  46623. if (r instanceof Ci.BufferGeometry) {
  46624. var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
  46625. if (void 0 !== u.uv && (i = u.uv.array),
  46626. null !== h)
  46627. for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
  46628. s = p[f],
  46629. l = p[f + 1],
  46630. c = p[f + 2],
  46631. (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
  46632. t.push(n));
  46633. else
  46634. for (f = 0,
  46635. g = d.length; f < g; f += 9)
  46636. (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
  46637. t.push(n))
  46638. } else if (r instanceof Ci.Geometry) {
  46639. var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
  46640. 0 < _.length && (i = _);
  46641. for (var b = 0, w = E.length; b < w; b++) {
  46642. var T = E[b]
  46643. , x = 1 == A ? C[T.materialIndex] : o;
  46644. if (void 0 !== x) {
  46645. if (m = I[T.a],
  46646. v = I[T.b],
  46647. y = I[T.c],
  46648. !0 === x.morphTargets) {
  46649. var S = r.morphTargets
  46650. , M = this.morphTargetInfluences;
  46651. Mt.set(0, 0, 0),
  46652. Rt.set(0, 0, 0),
  46653. Pt.set(0, 0, 0);
  46654. for (var R = 0, P = S.length; R < P; R++) {
  46655. var O = M[R];
  46656. if (0 !== O) {
  46657. var L = S[R].vertices;
  46658. Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
  46659. Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
  46660. Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
  46661. }
  46662. }
  46663. Mt.add(m),
  46664. Rt.add(v),
  46665. Pt.add(y),
  46666. m = Mt,
  46667. v = Rt,
  46668. y = Pt
  46669. }
  46670. if (n = wi(this, e, xt, m, v, y, kt)) {
  46671. if (i) {
  46672. var D = i[b];
  46673. Nt.copy(D[0]),
  46674. Ft.copy(D[1]),
  46675. Bt.copy(D[2]),
  46676. n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
  46677. }
  46678. n.face = T,
  46679. n.faceIndex = b,
  46680. t.push(n)
  46681. }
  46682. }
  46683. }
  46684. }
  46685. }
  46686. ),
  46687. Ci.Mesh.prototype.clone = function() {
  46688. return new this.constructor(this.geometry,this.material).copy(this)
  46689. }
  46690. ,
  46691. Ci.Bone = function(e) {
  46692. Ci.Object3D.call(this),
  46693. this.type = "Bone",
  46694. this.skin = e
  46695. }
  46696. ,
  46697. Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
  46698. Ci.Bone.prototype.constructor = Ci.Bone,
  46699. Ci.Bone.prototype.copy = function(e) {
  46700. return Ci.Object3D.prototype.copy.call(this, e),
  46701. this.skin = e.skin,
  46702. this
  46703. }
  46704. ,
  46705. Ci.Skeleton = function(e, t, i) {
  46706. if (this.useVertexTexture = void 0 === i || i,
  46707. this.identityMatrix = new Ci.Matrix4,
  46708. e = e || [],
  46709. this.bones = e.slice(0),
  46710. this.useVertexTexture) {
  46711. var n = Math.sqrt(4 * this.bones.length);
  46712. n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
  46713. n = Math.max(n, 4),
  46714. this.boneTextureWidth = n,
  46715. this.boneTextureHeight = n,
  46716. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  46717. this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
  46718. } else
  46719. this.boneMatrices = new Float32Array(16 * this.bones.length);
  46720. if (void 0 === t)
  46721. this.calculateInverses();
  46722. else if (this.bones.length === t.length)
  46723. this.boneInverses = t.slice(0);
  46724. else {
  46725. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  46726. this.boneInverses = [];
  46727. for (var r = 0, o = this.bones.length; r < o; r++)
  46728. this.boneInverses.push(new Ci.Matrix4)
  46729. }
  46730. }
  46731. ,
  46732. Ci.Skeleton.prototype.calculateInverses = function() {
  46733. this.boneInverses = [];
  46734. for (var e = 0, t = this.bones.length; e < t; e++) {
  46735. var i = new Ci.Matrix4;
  46736. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  46737. this.boneInverses.push(i)
  46738. }
  46739. }
  46740. ,
  46741. Ci.Skeleton.prototype.pose = function() {
  46742. for (var e, t = 0, i = this.bones.length; t < i; t++)
  46743. (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
  46744. for (t = 0,
  46745. i = this.bones.length; t < i; t++)
  46746. (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  46747. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  46748. e.matrix.decompose(e.position, e.quaternion, e.scale))
  46749. }
  46750. ,
  46751. Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
  46752. function() {
  46753. for (var e = 0, t = this.bones.length; e < t; e++) {
  46754. var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
  46755. wt.multiplyMatrices(i, this.boneInverses[e]),
  46756. wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
  46757. }
  46758. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  46759. }
  46760. ),
  46761. Ci.Skeleton.prototype.clone = function() {
  46762. return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  46763. }
  46764. ,
  46765. Ci.SkinnedMesh = function(e, t, i) {
  46766. Ci.Mesh.call(this, e, t),
  46767. this.type = "SkinnedMesh",
  46768. this.bindMode = "attached",
  46769. this.bindMatrix = new Ci.Matrix4,
  46770. this.bindMatrixInverse = new Ci.Matrix4;
  46771. var n = [];
  46772. if (this.geometry && void 0 !== this.geometry.bones) {
  46773. for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
  46774. o = this.geometry.bones[a],
  46775. r = new Ci.Bone(this),
  46776. n.push(r),
  46777. r.name = o.name,
  46778. r.position.fromArray(o.pos),
  46779. r.quaternion.fromArray(o.rotq),
  46780. void 0 !== o.scl && r.scale.fromArray(o.scl);
  46781. for (a = 0,
  46782. s = this.geometry.bones.length; a < s; ++a)
  46783. -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
  46784. }
  46785. this.normalizeSkinWeights(),
  46786. this.updateMatrixWorld(!0),
  46787. this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
  46788. }
  46789. ,
  46790. Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
  46791. Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
  46792. Ci.SkinnedMesh.prototype.bind = function(e, t) {
  46793. this.skeleton = e,
  46794. void 0 === t && (this.updateMatrixWorld(!0),
  46795. this.skeleton.calculateInverses(),
  46796. t = this.matrixWorld),
  46797. this.bindMatrix.copy(t),
  46798. this.bindMatrixInverse.getInverse(t)
  46799. }
  46800. ,
  46801. Ci.SkinnedMesh.prototype.pose = function() {
  46802. this.skeleton.pose()
  46803. }
  46804. ,
  46805. Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  46806. if (this.geometry instanceof Ci.Geometry)
  46807. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  46808. var t = this.geometry.skinWeights[e];
  46809. (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
  46810. }
  46811. else if (this.geometry instanceof Ci.BufferGeometry) {
  46812. var i = new Ci.Vector4
  46813. , n = this.geometry.attributes.skinWeight;
  46814. for (e = 0; e < n.count; e++) {
  46815. var r;
  46816. i.x = n.getX(e),
  46817. i.y = n.getY(e),
  46818. i.z = n.getZ(e),
  46819. i.w = n.getW(e),
  46820. (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
  46821. n.setXYZW(e, i.x, i.y, i.z, i.w)
  46822. }
  46823. }
  46824. }
  46825. ,
  46826. Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  46827. Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
  46828. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  46829. }
  46830. ,
  46831. Ci.SkinnedMesh.prototype.clone = function() {
  46832. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  46833. }
  46834. ,
  46835. Ci.LOD = function() {
  46836. Ci.Object3D.call(this),
  46837. this.type = "LOD",
  46838. Object.defineProperties(this, {
  46839. levels: {
  46840. enumerable: !0,
  46841. value: []
  46842. },
  46843. objects: {
  46844. get: function() {
  46845. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  46846. this.levels
  46847. }
  46848. }
  46849. })
  46850. }
  46851. ,
  46852. Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
  46853. Ci.LOD.prototype.constructor = Ci.LOD,
  46854. Ci.LOD.prototype.addLevel = function(e, t) {
  46855. void 0 === t && (t = 0),
  46856. t = Math.abs(t);
  46857. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  46858. ;
  46859. i.splice(n, 0, {
  46860. distance: t,
  46861. object: e
  46862. }),
  46863. this.add(e)
  46864. }
  46865. ,
  46866. Ci.LOD.prototype.getObjectForDistance = function(e) {
  46867. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  46868. ;
  46869. return t[i - 1].object
  46870. }
  46871. ,
  46872. Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
  46873. function(e, t) {
  46874. bt.setFromMatrixPosition(this.matrixWorld);
  46875. var i = e.ray.origin.distanceTo(bt);
  46876. this.getObjectForDistance(i).raycast(e, t)
  46877. }
  46878. ),
  46879. Ci.LOD.prototype.update = (Et = new Ci.Vector3,
  46880. _t = new Ci.Vector3,
  46881. function(e) {
  46882. var t = this.levels;
  46883. if (1 < t.length) {
  46884. Et.setFromMatrixPosition(e.matrixWorld),
  46885. _t.setFromMatrixPosition(this.matrixWorld);
  46886. var i = Et.distanceTo(_t);
  46887. t[0].object.visible = !0;
  46888. for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
  46889. t[n - 1].object.visible = !1,
  46890. t[n].object.visible = !0;
  46891. for (; n < r; n++)
  46892. t[n].object.visible = !1
  46893. }
  46894. }
  46895. ),
  46896. Ci.LOD.prototype.copy = function(e) {
  46897. Ci.Object3D.prototype.copy.call(this, e, !1);
  46898. for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
  46899. var r = t[i];
  46900. this.addLevel(r.object.clone(), r.distance)
  46901. }
  46902. return this
  46903. }
  46904. ,
  46905. Ci.LOD.prototype.toJSON = function(e) {
  46906. var t = Ci.Object3D.prototype.toJSON.call(this, e);
  46907. t.object.levels = [];
  46908. for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
  46909. var o = i[n];
  46910. t.object.levels.push({
  46911. object: o.object.uuid,
  46912. distance: o.distance
  46913. })
  46914. }
  46915. return t
  46916. }
  46917. ,
  46918. Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
  46919. At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
  46920. Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  46921. (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
  46922. It.addAttribute("position", new Ci.BufferAttribute(At,3)),
  46923. It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
  46924. function(e) {
  46925. Ci.Object3D.call(this),
  46926. this.type = "Sprite",
  46927. this.geometry = It,
  46928. this.material = void 0 !== e ? e : new Ci.SpriteMaterial
  46929. }
  46930. ),
  46931. Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
  46932. Ci.Sprite.prototype.constructor = Ci.Sprite,
  46933. Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
  46934. function(e, t) {
  46935. vt.setFromMatrixPosition(this.matrixWorld);
  46936. var i = e.ray.distanceSqToPoint(vt);
  46937. this.scale.x * this.scale.y < i || t.push({
  46938. distance: Math.sqrt(i),
  46939. point: this.position,
  46940. face: null,
  46941. object: this
  46942. })
  46943. }
  46944. ),
  46945. Ci.Sprite.prototype.clone = function() {
  46946. return new this.constructor(this.material).copy(this)
  46947. }
  46948. ,
  46949. Ci.Particle = Ci.Sprite,
  46950. Ci.LensFlare = function(e, t, i, n, r) {
  46951. Ci.Object3D.call(this),
  46952. this.lensFlares = [],
  46953. this.positionScreen = new Ci.Vector3,
  46954. (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
  46955. }
  46956. ,
  46957. Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
  46958. Ci.LensFlare.prototype.constructor = Ci.LensFlare,
  46959. Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
  46960. void 0 === t && (t = -1),
  46961. void 0 === i && (i = 0),
  46962. void 0 === o && (o = 1),
  46963. void 0 === r && (r = new Ci.Color(16777215)),
  46964. void 0 === n && (n = Ci.NormalBlending),
  46965. i = Math.min(i, Math.max(0, i)),
  46966. this.lensFlares.push({
  46967. texture: e,
  46968. size: t,
  46969. distance: i,
  46970. x: 0,
  46971. y: 0,
  46972. z: 0,
  46973. scale: 1,
  46974. rotation: 0,
  46975. opacity: o,
  46976. color: r,
  46977. blending: n
  46978. })
  46979. }
  46980. ,
  46981. Ci.LensFlare.prototype.updateLensFlares = function() {
  46982. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  46983. for (e = 0; e < i; e++)
  46984. (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
  46985. t.y = this.positionScreen.y + r * t.distance,
  46986. t.wantedRotation = t.x * Math.PI * .25,
  46987. t.rotation += .25 * (t.wantedRotation - t.rotation)
  46988. }
  46989. ,
  46990. Ci.LensFlare.prototype.copy = function(e) {
  46991. Ci.Object3D.prototype.copy.call(this, e),
  46992. this.positionScreen.copy(e.positionScreen),
  46993. this.customUpdateCallback = e.customUpdateCallback;
  46994. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  46995. this.lensFlares.push(e.lensFlares[t]);
  46996. return this
  46997. }
  46998. ,
  46999. Ci.Scene = function() {
  47000. Ci.Object3D.call(this),
  47001. this.type = "Scene",
  47002. this.fog = null,
  47003. this.overrideMaterial = null,
  47004. this.autoUpdate = !0
  47005. }
  47006. ,
  47007. Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
  47008. Ci.Scene.prototype.constructor = Ci.Scene,
  47009. Ci.Scene.prototype.copy = function(e, t) {
  47010. return Ci.Object3D.prototype.copy.call(this, e, t),
  47011. null !== e.fog && (this.fog = e.fog.clone()),
  47012. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47013. this.autoUpdate = e.autoUpdate,
  47014. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47015. this
  47016. }
  47017. ,
  47018. Ci.Fog = function(e, t, i) {
  47019. this.name = "",
  47020. this.color = new Ci.Color(e),
  47021. this.near = void 0 !== t ? t : 1,
  47022. this.far = void 0 !== i ? i : 1e3
  47023. }
  47024. ,
  47025. Ci.Fog.prototype.clone = function() {
  47026. return new Ci.Fog(this.color.getHex(),this.near,this.far)
  47027. }
  47028. ,
  47029. Ci.FogExp2 = function(e, t) {
  47030. this.name = "",
  47031. this.color = new Ci.Color(e),
  47032. this.density = void 0 !== t ? t : 25e-5
  47033. }
  47034. ,
  47035. Ci.FogExp2.prototype.clone = function() {
  47036. return new Ci.FogExp2(this.color.getHex(),this.density)
  47037. }
  47038. ,
  47039. Ci.ShaderChunk = {},
  47040. Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47041. Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47042. Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47043. 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",
  47044. Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47045. Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47046. Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47047. 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",
  47048. 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",
  47049. Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47050. Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47051. Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47052. Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47053. 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",
  47054. 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",
  47055. Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47056. Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47057. Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47058. 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",
  47059. Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47060. 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",
  47061. Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47062. 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",
  47063. 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",
  47064. 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",
  47065. 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",
  47066. 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",
  47067. 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",
  47068. Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  47069. Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  47070. 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",
  47071. 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",
  47072. Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  47073. 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",
  47074. Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  47075. Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  47076. 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",
  47077. 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",
  47078. 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",
  47079. Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  47080. 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",
  47081. 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",
  47082. 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",
  47083. Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  47084. Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  47085. 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",
  47086. Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  47087. Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  47088. Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  47089. 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",
  47090. 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",
  47091. 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",
  47092. 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",
  47093. 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",
  47094. Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  47095. 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",
  47096. Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  47097. Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  47098. 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",
  47099. 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",
  47100. 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",
  47101. 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",
  47102. 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",
  47103. 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",
  47104. 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",
  47105. 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",
  47106. 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",
  47107. Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  47108. Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  47109. 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",
  47110. Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  47111. Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  47112. Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  47113. 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",
  47114. 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",
  47115. 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",
  47116. 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",
  47117. Ci.UniformsUtils = {
  47118. merge: function(e) {
  47119. for (var t = {}, i = 0; i < e.length; i++) {
  47120. var n = this.clone(e[i]);
  47121. for (var r in n)
  47122. t[r] = n[r]
  47123. }
  47124. return t
  47125. },
  47126. clone: function(e) {
  47127. var t = {};
  47128. for (var i in e)
  47129. for (var n in t[i] = {},
  47130. e[i]) {
  47131. var r = e[i][n];
  47132. 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
  47133. }
  47134. return t
  47135. }
  47136. },
  47137. Ci.UniformsLib = {
  47138. common: {
  47139. diffuse: {
  47140. type: "c",
  47141. value: new Ci.Color(15658734)
  47142. },
  47143. opacity: {
  47144. type: "f",
  47145. value: 1
  47146. },
  47147. map: {
  47148. type: "t",
  47149. value: null
  47150. },
  47151. offsetRepeat: {
  47152. type: "v4",
  47153. value: new Ci.Vector4(0,0,1,1)
  47154. },
  47155. specularMap: {
  47156. type: "t",
  47157. value: null
  47158. },
  47159. alphaMap: {
  47160. type: "t",
  47161. value: null
  47162. },
  47163. envMap: {
  47164. type: "t",
  47165. value: null
  47166. },
  47167. flipEnvMap: {
  47168. type: "f",
  47169. value: -1
  47170. },
  47171. reflectivity: {
  47172. type: "f",
  47173. value: 1
  47174. },
  47175. refractionRatio: {
  47176. type: "f",
  47177. value: .98
  47178. }
  47179. },
  47180. aomap: {
  47181. aoMap: {
  47182. type: "t",
  47183. value: null
  47184. },
  47185. aoMapIntensity: {
  47186. type: "f",
  47187. value: 1
  47188. }
  47189. },
  47190. lightmap: {
  47191. lightMap: {
  47192. type: "t",
  47193. value: null
  47194. },
  47195. lightMapIntensity: {
  47196. type: "f",
  47197. value: 1
  47198. }
  47199. },
  47200. emissivemap: {
  47201. emissiveMap: {
  47202. type: "t",
  47203. value: null
  47204. }
  47205. },
  47206. bumpmap: {
  47207. bumpMap: {
  47208. type: "t",
  47209. value: null
  47210. },
  47211. bumpScale: {
  47212. type: "f",
  47213. value: 1
  47214. }
  47215. },
  47216. normalmap: {
  47217. normalMap: {
  47218. type: "t",
  47219. value: null
  47220. },
  47221. normalScale: {
  47222. type: "v2",
  47223. value: new Ci.Vector2(1,1)
  47224. }
  47225. },
  47226. displacementmap: {
  47227. displacementMap: {
  47228. type: "t",
  47229. value: null
  47230. },
  47231. displacementScale: {
  47232. type: "f",
  47233. value: 1
  47234. },
  47235. displacementBias: {
  47236. type: "f",
  47237. value: 0
  47238. }
  47239. },
  47240. roughnessmap: {
  47241. roughnessMap: {
  47242. type: "t",
  47243. value: null
  47244. }
  47245. },
  47246. metalnessmap: {
  47247. metalnessMap: {
  47248. type: "t",
  47249. value: null
  47250. }
  47251. },
  47252. fog: {
  47253. fogDensity: {
  47254. type: "f",
  47255. value: 25e-5
  47256. },
  47257. fogNear: {
  47258. type: "f",
  47259. value: 1
  47260. },
  47261. fogFar: {
  47262. type: "f",
  47263. value: 2e3
  47264. },
  47265. fogColor: {
  47266. type: "c",
  47267. value: new Ci.Color(16777215)
  47268. }
  47269. },
  47270. lights: {
  47271. ambientLightColor: {
  47272. type: "fv",
  47273. value: []
  47274. },
  47275. directionalLights: {
  47276. type: "sa",
  47277. value: [],
  47278. properties: {
  47279. direction: {
  47280. type: "v3"
  47281. },
  47282. color: {
  47283. type: "c"
  47284. },
  47285. shadow: {
  47286. type: "i"
  47287. },
  47288. shadowBias: {
  47289. type: "f"
  47290. },
  47291. shadowRadius: {
  47292. type: "f"
  47293. },
  47294. shadowMapSize: {
  47295. type: "v2"
  47296. }
  47297. }
  47298. },
  47299. directionalShadowMap: {
  47300. type: "tv",
  47301. value: []
  47302. },
  47303. directionalShadowMatrix: {
  47304. type: "m4v",
  47305. value: []
  47306. },
  47307. spotLights: {
  47308. type: "sa",
  47309. value: [],
  47310. properties: {
  47311. color: {
  47312. type: "c"
  47313. },
  47314. position: {
  47315. type: "v3"
  47316. },
  47317. direction: {
  47318. type: "v3"
  47319. },
  47320. distance: {
  47321. type: "f"
  47322. },
  47323. coneCos: {
  47324. type: "f"
  47325. },
  47326. penumbraCos: {
  47327. type: "f"
  47328. },
  47329. decay: {
  47330. type: "f"
  47331. },
  47332. shadow: {
  47333. type: "i"
  47334. },
  47335. shadowBias: {
  47336. type: "f"
  47337. },
  47338. shadowRadius: {
  47339. type: "f"
  47340. },
  47341. shadowMapSize: {
  47342. type: "v2"
  47343. }
  47344. }
  47345. },
  47346. spotShadowMap: {
  47347. type: "tv",
  47348. value: []
  47349. },
  47350. spotShadowMatrix: {
  47351. type: "m4v",
  47352. value: []
  47353. },
  47354. pointLights: {
  47355. type: "sa",
  47356. value: [],
  47357. properties: {
  47358. color: {
  47359. type: "c"
  47360. },
  47361. position: {
  47362. type: "v3"
  47363. },
  47364. decay: {
  47365. type: "f"
  47366. },
  47367. distance: {
  47368. type: "f"
  47369. },
  47370. shadow: {
  47371. type: "i"
  47372. },
  47373. shadowBias: {
  47374. type: "f"
  47375. },
  47376. shadowRadius: {
  47377. type: "f"
  47378. },
  47379. shadowMapSize: {
  47380. type: "v2"
  47381. }
  47382. }
  47383. },
  47384. pointShadowMap: {
  47385. type: "tv",
  47386. value: []
  47387. },
  47388. pointShadowMatrix: {
  47389. type: "m4v",
  47390. value: []
  47391. },
  47392. hemisphereLights: {
  47393. type: "sa",
  47394. value: [],
  47395. properties: {
  47396. direction: {
  47397. type: "v3"
  47398. },
  47399. skyColor: {
  47400. type: "c"
  47401. },
  47402. groundColor: {
  47403. type: "c"
  47404. }
  47405. }
  47406. }
  47407. },
  47408. points: {
  47409. diffuse: {
  47410. type: "c",
  47411. value: new Ci.Color(15658734)
  47412. },
  47413. opacity: {
  47414. type: "f",
  47415. value: 1
  47416. },
  47417. size: {
  47418. type: "f",
  47419. value: 1
  47420. },
  47421. scale: {
  47422. type: "f",
  47423. value: 1
  47424. },
  47425. map: {
  47426. type: "t",
  47427. value: null
  47428. },
  47429. offsetRepeat: {
  47430. type: "v4",
  47431. value: new Ci.Vector4(0,0,1,1)
  47432. }
  47433. }
  47434. },
  47435. 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",
  47436. 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",
  47437. 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",
  47438. 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",
  47439. 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",
  47440. 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",
  47441. 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",
  47442. 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",
  47443. 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",
  47444. 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",
  47445. 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",
  47446. 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",
  47447. 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",
  47448. 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",
  47449. 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",
  47450. 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",
  47451. 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",
  47452. 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",
  47453. 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",
  47454. 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",
  47455. 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",
  47456. 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",
  47457. 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",
  47458. 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",
  47459. Ci.ShaderLib = {
  47460. basic: {
  47461. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
  47462. vertexShader: Ci.ShaderChunk.meshbasic_vert,
  47463. fragmentShader: Ci.ShaderChunk.meshbasic_frag
  47464. },
  47465. lambert: {
  47466. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
  47467. emissive: {
  47468. type: "c",
  47469. value: new Ci.Color(0)
  47470. }
  47471. }]),
  47472. vertexShader: Ci.ShaderChunk.meshlambert_vert,
  47473. fragmentShader: Ci.ShaderChunk.meshlambert_frag
  47474. },
  47475. phong: {
  47476. 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, {
  47477. emissive: {
  47478. type: "c",
  47479. value: new Ci.Color(0)
  47480. },
  47481. specular: {
  47482. type: "c",
  47483. value: new Ci.Color(1118481)
  47484. },
  47485. shininess: {
  47486. type: "f",
  47487. value: 30
  47488. }
  47489. }]),
  47490. vertexShader: Ci.ShaderChunk.meshphong_vert,
  47491. fragmentShader: Ci.ShaderChunk.meshphong_frag
  47492. },
  47493. standard: {
  47494. 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, {
  47495. emissive: {
  47496. type: "c",
  47497. value: new Ci.Color(0)
  47498. },
  47499. roughness: {
  47500. type: "f",
  47501. value: .5
  47502. },
  47503. metalness: {
  47504. type: "f",
  47505. value: 0
  47506. },
  47507. envMapIntensity: {
  47508. type: "f",
  47509. value: 1
  47510. }
  47511. }]),
  47512. vertexShader: Ci.ShaderChunk.meshstandard_vert,
  47513. fragmentShader: Ci.ShaderChunk.meshstandard_frag
  47514. },
  47515. points: {
  47516. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
  47517. vertexShader: Ci.ShaderChunk.points_vert,
  47518. fragmentShader: Ci.ShaderChunk.points_frag
  47519. },
  47520. dashed: {
  47521. uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
  47522. scale: {
  47523. type: "f",
  47524. value: 1
  47525. },
  47526. dashSize: {
  47527. type: "f",
  47528. value: 1
  47529. },
  47530. totalSize: {
  47531. type: "f",
  47532. value: 2
  47533. }
  47534. }]),
  47535. vertexShader: Ci.ShaderChunk.linedashed_vert,
  47536. fragmentShader: Ci.ShaderChunk.linedashed_frag
  47537. },
  47538. depth: {
  47539. uniforms: {
  47540. mNear: {
  47541. type: "f",
  47542. value: 1
  47543. },
  47544. mFar: {
  47545. type: "f",
  47546. value: 2e3
  47547. },
  47548. opacity: {
  47549. type: "f",
  47550. value: 1
  47551. }
  47552. },
  47553. vertexShader: Ci.ShaderChunk.depth_vert,
  47554. fragmentShader: Ci.ShaderChunk.depth_frag
  47555. },
  47556. normal: {
  47557. uniforms: {
  47558. opacity: {
  47559. type: "f",
  47560. value: 1
  47561. }
  47562. },
  47563. vertexShader: Ci.ShaderChunk.normal_vert,
  47564. fragmentShader: Ci.ShaderChunk.normal_frag
  47565. },
  47566. cube: {
  47567. uniforms: {
  47568. tCube: {
  47569. type: "t",
  47570. value: null
  47571. },
  47572. tFlip: {
  47573. type: "f",
  47574. value: -1
  47575. }
  47576. },
  47577. vertexShader: Ci.ShaderChunk.cube_vert,
  47578. fragmentShader: Ci.ShaderChunk.cube_frag
  47579. },
  47580. equirect: {
  47581. uniforms: {
  47582. tEquirect: {
  47583. type: "t",
  47584. value: null
  47585. },
  47586. tFlip: {
  47587. type: "f",
  47588. value: -1
  47589. }
  47590. },
  47591. vertexShader: Ci.ShaderChunk.equirect_vert,
  47592. fragmentShader: Ci.ShaderChunk.equirect_frag
  47593. },
  47594. depthRGBA: {
  47595. uniforms: {},
  47596. vertexShader: Ci.ShaderChunk.depthRGBA_vert,
  47597. fragmentShader: Ci.ShaderChunk.depthRGBA_frag
  47598. },
  47599. distanceRGBA: {
  47600. uniforms: {
  47601. lightPos: {
  47602. type: "v3",
  47603. value: new Ci.Vector3(0,0,0)
  47604. }
  47605. },
  47606. vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
  47607. fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
  47608. }
  47609. },
  47610. Ci.WebGLRenderer = function(e) {
  47611. function S() {
  47612. return null === Q ? he : 1
  47613. }
  47614. function i(e, t, i, n) {
  47615. !0 === V && (e *= n,
  47616. t *= n,
  47617. i *= n),
  47618. _e.clearColor(e, t, i, n)
  47619. }
  47620. function t() {
  47621. _e.init(),
  47622. _e.scissor(ie.copy(ue).multiplyScalar(he)),
  47623. _e.viewport(re.copy(pe).multiplyScalar(he)),
  47624. i(ae.r, ae.g, ae.b, se)
  47625. }
  47626. function n() {
  47627. te = K = null,
  47628. ee = "",
  47629. $ = -1,
  47630. _e.reset()
  47631. }
  47632. function r(e) {
  47633. e.preventDefault(),
  47634. n(),
  47635. t(),
  47636. be.clear()
  47637. }
  47638. function f(e) {
  47639. var t = e.target;
  47640. t.removeEventListener("dispose", f),
  47641. function(e) {
  47642. var t = be.get(e);
  47643. if (e.image && t.__image__webglTextureCube)
  47644. X.deleteTexture(t.__image__webglTextureCube);
  47645. else {
  47646. if (void 0 === t.__webglInit)
  47647. return;
  47648. X.deleteTexture(t.__webglTexture)
  47649. }
  47650. be.delete(e)
  47651. }(t),
  47652. ye.textures--
  47653. }
  47654. function a(e) {
  47655. var t = e.target;
  47656. t.removeEventListener("dispose", a),
  47657. function(e) {
  47658. var t = be.get(e)
  47659. , i = be.get(e.texture);
  47660. if (e && void 0 !== i.__webglTexture) {
  47661. if (X.deleteTexture(i.__webglTexture),
  47662. e instanceof Ci.WebGLRenderTargetCube)
  47663. for (var n = 0; n < 6; n++)
  47664. X.deleteFramebuffer(t.__webglFramebuffer[n]),
  47665. X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
  47666. else
  47667. X.deleteFramebuffer(t.__webglFramebuffer),
  47668. X.deleteRenderbuffer(t.__webglDepthbuffer);
  47669. be.delete(e.texture),
  47670. be.delete(e)
  47671. }
  47672. }(t),
  47673. ye.textures--
  47674. }
  47675. function v(e) {
  47676. var t = e.target;
  47677. t.removeEventListener("dispose", v),
  47678. function(e) {
  47679. y(e),
  47680. be.delete(e)
  47681. }(t)
  47682. }
  47683. function y(e) {
  47684. var t = be.get(e).program;
  47685. (e.program = void 0) !== t && Te.releaseProgram(t)
  47686. }
  47687. function M(e, t) {
  47688. return Math.abs(t[0]) - Math.abs(e[0])
  47689. }
  47690. function s(e, t) {
  47691. 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
  47692. }
  47693. function l(e, t) {
  47694. 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
  47695. }
  47696. function d(e, t, i, n, r) {
  47697. var o, a;
  47698. a = i.transparent ? (o = G,
  47699. ++W) : (o = H,
  47700. ++z);
  47701. var s = o[a];
  47702. void 0 !== s ? (s.id = e.id,
  47703. s.object = e,
  47704. s.geometry = t,
  47705. s.material = i,
  47706. s.z = me.z,
  47707. s.group = r) : (s = {
  47708. id: e.id,
  47709. object: e,
  47710. geometry: t,
  47711. material: i,
  47712. z: me.z,
  47713. group: r
  47714. },
  47715. o.push(s))
  47716. }
  47717. function c(e, t, i, n) {
  47718. for (var r = 0, o = e.length; r < o; r++) {
  47719. var a = e[r]
  47720. , s = a.object
  47721. , l = a.geometry
  47722. , c = void 0 === n ? a.material : n
  47723. , h = a.group;
  47724. if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
  47725. s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
  47726. s instanceof Ci.ImmediateRenderObject) {
  47727. R(c);
  47728. var u = P(t, i, c, s);
  47729. ee = "",
  47730. s.render(function(e) {
  47731. Z.renderBufferImmediate(e, u, c)
  47732. })
  47733. } else
  47734. Z.renderBufferDirect(t, i, l, c, s, h)
  47735. }
  47736. }
  47737. function R(e) {
  47738. (function(e) {
  47739. e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
  47740. _e.setFlipSided(e.side === Ci.BackSide)
  47741. }
  47742. )(e),
  47743. !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),
  47744. _e.setDepthFunc(e.depthFunc),
  47745. _e.setDepthTest(e.depthTest),
  47746. _e.setDepthWrite(e.depthWrite),
  47747. _e.setColorWrite(e.colorWrite),
  47748. _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  47749. }
  47750. function P(e, t, i, n) {
  47751. oe = 0;
  47752. var r = be.get(i);
  47753. void 0 === r.program && (i.needsUpdate = !0),
  47754. void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
  47755. i.needsUpdate && (function(e, t, i) {
  47756. var n = be.get(e)
  47757. , r = Te.getParameters(e, ve, t, i)
  47758. , o = Te.getProgramCode(e, r)
  47759. , a = n.program
  47760. , s = !0;
  47761. if (void 0 === a)
  47762. e.addEventListener("dispose", v);
  47763. else if (a.code !== o)
  47764. y(e);
  47765. else {
  47766. if (void 0 !== r.shaderID)
  47767. return;
  47768. s = !1
  47769. }
  47770. if (s) {
  47771. if (r.shaderID) {
  47772. var l = Ci.ShaderLib[r.shaderID];
  47773. n.__webglShader = {
  47774. name: e.type,
  47775. uniforms: Ci.UniformsUtils.clone(l.uniforms),
  47776. vertexShader: l.vertexShader,
  47777. fragmentShader: l.fragmentShader
  47778. }
  47779. } else
  47780. n.__webglShader = {
  47781. name: e.type,
  47782. uniforms: e.uniforms,
  47783. vertexShader: e.vertexShader,
  47784. fragmentShader: e.fragmentShader
  47785. };
  47786. e.__webglShader = n.__webglShader,
  47787. a = Te.acquireProgram(e, r, o),
  47788. n.program = a,
  47789. e.program = a
  47790. }
  47791. var c = a.getAttributes();
  47792. if (e.morphTargets)
  47793. for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
  47794. 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
  47795. if (e.morphNormals)
  47796. for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
  47797. 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
  47798. n.uniformsList = [];
  47799. var u = n.__webglShader.uniforms
  47800. , d = n.program.getUniforms();
  47801. for (var p in u) {
  47802. var f = d[p];
  47803. f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
  47804. }
  47805. (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
  47806. u.ambientLightColor.value = ve.ambient,
  47807. u.directionalLights.value = ve.directional,
  47808. u.spotLights.value = ve.spot,
  47809. u.pointLights.value = ve.point,
  47810. u.hemisphereLights.value = ve.hemi,
  47811. u.directionalShadowMap.value = ve.directionalShadowMap,
  47812. u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
  47813. u.spotShadowMap.value = ve.spotShadowMap,
  47814. u.spotShadowMatrix.value = ve.spotShadowMatrix,
  47815. u.pointShadowMap.value = ve.pointShadowMap,
  47816. u.pointShadowMatrix.value = ve.pointShadowMatrix),
  47817. n.hasDynamicUniforms = !1;
  47818. for (var g = 0, m = n.uniformsList.length; g < m; g++) {
  47819. if (!0 === n.uniformsList[g][0].dynamic) {
  47820. n.hasDynamicUniforms = !0;
  47821. break
  47822. }
  47823. }
  47824. }(i, t, n),
  47825. i.needsUpdate = !1);
  47826. var o = !1
  47827. , a = !1
  47828. , s = !1
  47829. , l = r.program
  47830. , c = l.getUniforms()
  47831. , h = r.__webglShader.uniforms;
  47832. if (l.id !== K && (X.useProgram(l.program),
  47833. K = l.id,
  47834. s = a = o = !0),
  47835. i.id !== $ && ($ = i.id,
  47836. a = !0),
  47837. !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
  47838. Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  47839. e !== te && (te = e,
  47840. s = a = !0),
  47841. (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
  47842. X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
  47843. (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),
  47844. void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
  47845. void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
  47846. i.skinning)
  47847. if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
  47848. n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
  47849. Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
  47850. if (void 0 !== c.boneTexture) {
  47851. var u = A();
  47852. X.uniform1i(c.boneTexture, u),
  47853. Z.setTexture(n.skeleton.boneTexture, u)
  47854. }
  47855. void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
  47856. void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
  47857. } else
  47858. n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
  47859. return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
  47860. e.ambientLightColor.needsUpdate = t,
  47861. e.directionalLights.needsUpdate = t,
  47862. e.pointLights.needsUpdate = t,
  47863. e.spotLights.needsUpdate = t,
  47864. e.hemisphereLights.needsUpdate = t
  47865. }(h, s),
  47866. t && i.fog && function(e, t) {
  47867. e.fogColor.value = t.color,
  47868. t instanceof Ci.Fog ? (e.fogNear.value = t.near,
  47869. e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
  47870. }(h, t),
  47871. (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
  47872. var i;
  47873. if (e.opacity.value = t.opacity,
  47874. e.diffuse.value = t.color,
  47875. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  47876. e.map.value = t.map,
  47877. e.specularMap.value = t.specularMap,
  47878. e.alphaMap.value = t.alphaMap,
  47879. t.aoMap && (e.aoMap.value = t.aoMap,
  47880. e.aoMapIntensity.value = t.aoMapIntensity),
  47881. 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),
  47882. void 0 !== i) {
  47883. i instanceof Ci.WebGLRenderTarget && (i = i.texture);
  47884. var n = i.offset
  47885. , r = i.repeat;
  47886. e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
  47887. }
  47888. e.envMap.value = t.envMap,
  47889. e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
  47890. e.reflectivity.value = t.reflectivity,
  47891. e.refractionRatio.value = t.refractionRatio
  47892. }(h, i),
  47893. i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
  47894. function(e, t) {
  47895. e.dashSize.value = t.dashSize,
  47896. e.totalSize.value = t.dashSize + t.gapSize,
  47897. e.scale.value = t.scale
  47898. }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
  47899. if (e.diffuse.value = t.color,
  47900. e.opacity.value = t.opacity,
  47901. e.size.value = t.size * he,
  47902. e.scale.value = O.clientHeight / 2,
  47903. e.map.value = t.map,
  47904. null !== t.map) {
  47905. var i = t.map.offset
  47906. , n = t.map.repeat;
  47907. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  47908. }
  47909. }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
  47910. t.lightMap && (e.lightMap.value = t.lightMap,
  47911. e.lightMapIntensity.value = t.lightMapIntensity),
  47912. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  47913. }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
  47914. e.specular.value = t.specular,
  47915. e.shininess.value = Math.max(t.shininess, 1e-4),
  47916. t.lightMap && (e.lightMap.value = t.lightMap,
  47917. e.lightMapIntensity.value = t.lightMapIntensity),
  47918. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  47919. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  47920. e.bumpScale.value = t.bumpScale),
  47921. t.normalMap && (e.normalMap.value = t.normalMap,
  47922. e.normalScale.value.copy(t.normalScale)),
  47923. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  47924. e.displacementScale.value = t.displacementScale,
  47925. e.displacementBias.value = t.displacementBias)
  47926. }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
  47927. e.roughness.value = t.roughness,
  47928. e.metalness.value = t.metalness,
  47929. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  47930. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  47931. t.lightMap && (e.lightMap.value = t.lightMap,
  47932. e.lightMapIntensity.value = t.lightMapIntensity),
  47933. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  47934. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  47935. e.bumpScale.value = t.bumpScale),
  47936. t.normalMap && (e.normalMap.value = t.normalMap,
  47937. e.normalScale.value.copy(t.normalScale)),
  47938. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  47939. e.displacementScale.value = t.displacementScale,
  47940. e.displacementBias.value = t.displacementBias),
  47941. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  47942. }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
  47943. h.mFar.value = e.far,
  47944. h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
  47945. g(r.uniformsList)),
  47946. function(e, t) {
  47947. X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  47948. e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  47949. }(c, n),
  47950. void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
  47951. !0 === r.hasDynamicUniforms && function(e, t, i) {
  47952. for (var n = [], r = 0, o = e.length; r < o; r++) {
  47953. var a = e[r][0]
  47954. , s = a.onUpdateCallback;
  47955. void 0 !== s && (s.bind(a)(t, i),
  47956. n.push(e[r]))
  47957. }
  47958. g(n)
  47959. }(r.uniformsList, n, e),
  47960. l
  47961. }
  47962. function p(e, t) {
  47963. e.diffuse.value = t.color,
  47964. e.opacity.value = t.opacity
  47965. }
  47966. function A() {
  47967. var e = oe;
  47968. return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
  47969. oe += 1,
  47970. e
  47971. }
  47972. function C(e, t, i, n) {
  47973. var r, o;
  47974. if ("1i" === t)
  47975. X.uniform1i(i, n);
  47976. else if ("1f" === t)
  47977. X.uniform1f(i, n);
  47978. else if ("2f" === t)
  47979. X.uniform2f(i, n[0], n[1]);
  47980. else if ("3f" === t)
  47981. X.uniform3f(i, n[0], n[1], n[2]);
  47982. else if ("4f" === t)
  47983. X.uniform4f(i, n[0], n[1], n[2], n[3]);
  47984. else if ("1iv" === t)
  47985. X.uniform1iv(i, n);
  47986. else if ("3iv" === t)
  47987. X.uniform3iv(i, n);
  47988. else if ("1fv" === t)
  47989. X.uniform1fv(i, n);
  47990. else if ("2fv" === t)
  47991. X.uniform2fv(i, n);
  47992. else if ("3fv" === t)
  47993. X.uniform3fv(i, n);
  47994. else if ("4fv" === t)
  47995. X.uniform4fv(i, n);
  47996. else if ("Matrix2fv" === t)
  47997. X.uniformMatrix2fv(i, !1, n);
  47998. else if ("Matrix3fv" === t)
  47999. X.uniformMatrix3fv(i, !1, n);
  48000. else if ("Matrix4fv" === t)
  48001. X.uniformMatrix4fv(i, !1, n);
  48002. else if ("i" === t)
  48003. X.uniform1i(i, n);
  48004. else if ("f" === t)
  48005. X.uniform1f(i, n);
  48006. else if ("v2" === t)
  48007. X.uniform2f(i, n.x, n.y);
  48008. else if ("v3" === t)
  48009. X.uniform3f(i, n.x, n.y, n.z);
  48010. else if ("v4" === t)
  48011. X.uniform4f(i, n.x, n.y, n.z, n.w);
  48012. else if ("c" === t)
  48013. X.uniform3f(i, n.r, n.g, n.b);
  48014. else if ("s" === t) {
  48015. var a = e.properties;
  48016. for (var s in a) {
  48017. var l = a[s]
  48018. , c = i[s]
  48019. , h = n[s];
  48020. C(l, l.type, c, h)
  48021. }
  48022. } else if ("sa" === t) {
  48023. a = e.properties;
  48024. for (var u = 0, d = n.length; u < d; u++)
  48025. for (var s in a) {
  48026. l = a[s],
  48027. c = i[u][s],
  48028. h = n[u][s];
  48029. C(l, l.type, c, h)
  48030. }
  48031. } else if ("iv1" === t)
  48032. X.uniform1iv(i, n);
  48033. else if ("iv" === t)
  48034. X.uniform3iv(i, n);
  48035. else if ("fv1" === t)
  48036. X.uniform1fv(i, n);
  48037. else if ("fv" === t)
  48038. X.uniform3fv(i, n);
  48039. else if ("v2v" === t) {
  48040. void 0 === e._array && (e._array = new Float32Array(2 * n.length));
  48041. u = 0;
  48042. for (var p = 0, f = n.length; u < f; u++,
  48043. p += 2)
  48044. e._array[p + 0] = n[u].x,
  48045. e._array[p + 1] = n[u].y;
  48046. X.uniform2fv(i, e._array)
  48047. } else if ("v3v" === t) {
  48048. void 0 === e._array && (e._array = new Float32Array(3 * n.length));
  48049. u = 0;
  48050. var g = 0;
  48051. for (f = n.length; u < f; u++,
  48052. g += 3)
  48053. e._array[g + 0] = n[u].x,
  48054. e._array[g + 1] = n[u].y,
  48055. e._array[g + 2] = n[u].z;
  48056. X.uniform3fv(i, e._array)
  48057. } else if ("v4v" === t) {
  48058. void 0 === e._array && (e._array = new Float32Array(4 * n.length));
  48059. u = 0;
  48060. var m = 0;
  48061. for (f = n.length; u < f; u++,
  48062. m += 4)
  48063. e._array[m + 0] = n[u].x,
  48064. e._array[m + 1] = n[u].y,
  48065. e._array[m + 2] = n[u].z,
  48066. e._array[m + 3] = n[u].w;
  48067. X.uniform4fv(i, e._array)
  48068. } else if ("m2" === t)
  48069. X.uniformMatrix2fv(i, !1, n.elements);
  48070. else if ("m3" === t)
  48071. X.uniformMatrix3fv(i, !1, n.elements);
  48072. else if ("m3v" === t) {
  48073. void 0 === e._array && (e._array = new Float32Array(9 * n.length));
  48074. for (u = 0,
  48075. f = n.length; u < f; u++)
  48076. n[u].flattenToArrayOffset(e._array, 9 * u);
  48077. X.uniformMatrix3fv(i, !1, e._array)
  48078. } else if ("m4" === t)
  48079. X.uniformMatrix4fv(i, !1, n.elements);
  48080. else if ("m4v" === t) {
  48081. void 0 === e._array && (e._array = new Float32Array(16 * n.length));
  48082. for (u = 0,
  48083. f = n.length; u < f; u++)
  48084. n[u].flattenToArrayOffset(e._array, 16 * u);
  48085. X.uniformMatrix4fv(i, !1, e._array)
  48086. } else if ("t" === t) {
  48087. if (r = n,
  48088. o = A(),
  48089. X.uniform1i(i, o),
  48090. !r)
  48091. return;
  48092. 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)
  48093. } else if ("tv" === t) {
  48094. void 0 === e._array && (e._array = []);
  48095. for (u = 0,
  48096. f = e.value.length; u < f; u++)
  48097. e._array[u] = A();
  48098. X.uniform1iv(i, e._array);
  48099. for (u = 0,
  48100. f = e.value.length; u < f; u++)
  48101. r = e.value[u],
  48102. o = e._array[u],
  48103. 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))
  48104. } else
  48105. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  48106. }
  48107. function g(e) {
  48108. for (var t = 0, i = e.length; t < i; t++) {
  48109. var n = e[t][0];
  48110. if (!1 !== n.needsUpdate)
  48111. C(n, n.type, e[t][1], n.value)
  48112. }
  48113. }
  48114. function m(e, t, i) {
  48115. var n;
  48116. if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
  48117. X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
  48118. X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
  48119. X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
  48120. X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
  48121. 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),
  48122. X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
  48123. X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
  48124. 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)),
  48125. n = Ie.get("EXT_texture_filter_anisotropic")) {
  48126. if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
  48127. return;
  48128. if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
  48129. return;
  48130. (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
  48131. be.get(t).__currentAnisotropy = t.anisotropy)
  48132. }
  48133. }
  48134. function o(e, t, i) {
  48135. void 0 === e.__webglInit && (e.__webglInit = !0,
  48136. t.addEventListener("dispose", f),
  48137. e.__webglTexture = X.createTexture(),
  48138. ye.textures++),
  48139. _e.activeTexture(X.TEXTURE0 + i),
  48140. _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
  48141. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
  48142. X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  48143. X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
  48144. var n = I(t.image, Ee.maxTextureSize);
  48145. !function(e) {
  48146. return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
  48147. }(t) || !1 !== E(n) || (n = function(e) {
  48148. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  48149. var t = document.createElement("canvas");
  48150. return t.width = Ci.Math.nearestPowerOfTwo(e.width),
  48151. t.height = Ci.Math.nearestPowerOfTwo(e.height),
  48152. t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
  48153. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  48154. t
  48155. }
  48156. return e
  48157. }(n));
  48158. var r = E(n)
  48159. , o = x(t.format)
  48160. , a = x(t.type);
  48161. m(X.TEXTURE_2D, t, r);
  48162. var s, l = t.mipmaps;
  48163. if (t instanceof Ci.DataTexture)
  48164. if (0 < l.length && r) {
  48165. for (var c = 0, h = l.length; c < h; c++)
  48166. s = l[c],
  48167. _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
  48168. t.generateMipmaps = !1
  48169. } else
  48170. _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
  48171. else if (t instanceof Ci.CompressedTexture)
  48172. for (c = 0,
  48173. h = l.length; c < h; c++)
  48174. s = l[c],
  48175. 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);
  48176. else if (0 < l.length && r) {
  48177. for (c = 0,
  48178. h = l.length; c < h; c++)
  48179. s = l[c],
  48180. _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
  48181. t.generateMipmaps = !1
  48182. } else
  48183. _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
  48184. t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48185. e.__version = t.version,
  48186. t.onUpdate && t.onUpdate(t)
  48187. }
  48188. function I(e, t) {
  48189. if (e.width > t || e.height > t) {
  48190. var i = t / Math.max(e.width, e.height)
  48191. , n = document.createElement("canvas");
  48192. return n.width = Math.floor(e.width * i),
  48193. n.height = Math.floor(e.height * i),
  48194. n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  48195. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  48196. n
  48197. }
  48198. return e
  48199. }
  48200. function E(e) {
  48201. return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
  48202. }
  48203. function _(e, t) {
  48204. var i = be.get(e);
  48205. if (6 === e.image.length)
  48206. if (0 < e.version && i.__version !== e.version) {
  48207. i.__image__webglTextureCube || (e.addEventListener("dispose", f),
  48208. i.__image__webglTextureCube = X.createTexture(),
  48209. ye.textures++),
  48210. _e.activeTexture(X.TEXTURE0 + t),
  48211. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  48212. X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
  48213. for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
  48214. !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
  48215. var s = E(o[0])
  48216. , l = x(e.format)
  48217. , c = x(e.type);
  48218. m(X.TEXTURE_CUBE_MAP, e, s);
  48219. for (a = 0; a < 6; a++)
  48220. if (n)
  48221. for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
  48222. h = u[d],
  48223. 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);
  48224. else
  48225. 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]);
  48226. e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48227. i.__version = e.version,
  48228. e.onUpdate && e.onUpdate(e)
  48229. } else
  48230. _e.activeTexture(X.TEXTURE0 + t),
  48231. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  48232. }
  48233. function b(e, t) {
  48234. _e.activeTexture(X.TEXTURE0 + t),
  48235. _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
  48236. }
  48237. function h(e, t, i, n) {
  48238. var r = x(t.texture.format)
  48239. , o = x(t.texture.type);
  48240. _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  48241. X.bindFramebuffer(X.FRAMEBUFFER, e),
  48242. X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
  48243. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48244. }
  48245. function u(e, t) {
  48246. X.bindRenderbuffer(X.RENDERBUFFER, e),
  48247. t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
  48248. 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),
  48249. X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
  48250. X.bindRenderbuffer(X.RENDERBUFFER, null)
  48251. }
  48252. function w(e) {
  48253. var t = be.get(e)
  48254. , i = be.get(e.texture);
  48255. e.addEventListener("dispose", a),
  48256. i.__webglTexture = X.createTexture(),
  48257. ye.textures++;
  48258. var n = e instanceof Ci.WebGLRenderTargetCube
  48259. , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
  48260. if (n) {
  48261. t.__webglFramebuffer = [];
  48262. for (var o = 0; o < 6; o++)
  48263. t.__webglFramebuffer[o] = X.createFramebuffer()
  48264. } else
  48265. t.__webglFramebuffer = X.createFramebuffer();
  48266. if (n) {
  48267. _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
  48268. m(X.TEXTURE_CUBE_MAP, e.texture, r);
  48269. for (o = 0; o < 6; o++)
  48270. h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
  48271. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
  48272. _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
  48273. } else
  48274. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
  48275. m(X.TEXTURE_2D, e.texture, r),
  48276. h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
  48277. e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
  48278. _e.bindTexture(X.TEXTURE_2D, null);
  48279. e.depthBuffer && function(e) {
  48280. var t = be.get(e);
  48281. if (e instanceof Ci.WebGLRenderTargetCube) {
  48282. t.__webglDepthbuffer = [];
  48283. for (var i = 0; i < 6; i++)
  48284. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
  48285. t.__webglDepthbuffer[i] = X.createRenderbuffer(),
  48286. u(t.__webglDepthbuffer[i], e)
  48287. } else
  48288. X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
  48289. t.__webglDepthbuffer = X.createRenderbuffer(),
  48290. u(t.__webglDepthbuffer, e);
  48291. X.bindFramebuffer(X.FRAMEBUFFER, null)
  48292. }(e)
  48293. }
  48294. function T(e) {
  48295. return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
  48296. }
  48297. function x(e) {
  48298. var t;
  48299. if (e === Ci.RepeatWrapping)
  48300. return X.REPEAT;
  48301. if (e === Ci.ClampToEdgeWrapping)
  48302. return X.CLAMP_TO_EDGE;
  48303. if (e === Ci.MirroredRepeatWrapping)
  48304. return X.MIRRORED_REPEAT;
  48305. if (e === Ci.NearestFilter)
  48306. return X.NEAREST;
  48307. if (e === Ci.NearestMipMapNearestFilter)
  48308. return X.NEAREST_MIPMAP_NEAREST;
  48309. if (e === Ci.NearestMipMapLinearFilter)
  48310. return X.NEAREST_MIPMAP_LINEAR;
  48311. if (e === Ci.LinearFilter)
  48312. return X.LINEAR;
  48313. if (e === Ci.LinearMipMapNearestFilter)
  48314. return X.LINEAR_MIPMAP_NEAREST;
  48315. if (e === Ci.LinearMipMapLinearFilter)
  48316. return X.LINEAR_MIPMAP_LINEAR;
  48317. if (e === Ci.UnsignedByteType)
  48318. return X.UNSIGNED_BYTE;
  48319. if (e === Ci.UnsignedShort4444Type)
  48320. return X.UNSIGNED_SHORT_4_4_4_4;
  48321. if (e === Ci.UnsignedShort5551Type)
  48322. return X.UNSIGNED_SHORT_5_5_5_1;
  48323. if (e === Ci.UnsignedShort565Type)
  48324. return X.UNSIGNED_SHORT_5_6_5;
  48325. if (e === Ci.ByteType)
  48326. return X.BYTE;
  48327. if (e === Ci.ShortType)
  48328. return X.SHORT;
  48329. if (e === Ci.UnsignedShortType)
  48330. return X.UNSIGNED_SHORT;
  48331. if (e === Ci.IntType)
  48332. return X.INT;
  48333. if (e === Ci.UnsignedIntType)
  48334. return X.UNSIGNED_INT;
  48335. if (e === Ci.FloatType)
  48336. return X.FLOAT;
  48337. if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
  48338. return t.HALF_FLOAT_OES;
  48339. if (e === Ci.AlphaFormat)
  48340. return X.ALPHA;
  48341. if (e === Ci.RGBFormat)
  48342. return X.RGB;
  48343. if (e === Ci.RGBAFormat)
  48344. return X.RGBA;
  48345. if (e === Ci.LuminanceFormat)
  48346. return X.LUMINANCE;
  48347. if (e === Ci.LuminanceAlphaFormat)
  48348. return X.LUMINANCE_ALPHA;
  48349. if (e === Ci.AddEquation)
  48350. return X.FUNC_ADD;
  48351. if (e === Ci.SubtractEquation)
  48352. return X.FUNC_SUBTRACT;
  48353. if (e === Ci.ReverseSubtractEquation)
  48354. return X.FUNC_REVERSE_SUBTRACT;
  48355. if (e === Ci.ZeroFactor)
  48356. return X.ZERO;
  48357. if (e === Ci.OneFactor)
  48358. return X.ONE;
  48359. if (e === Ci.SrcColorFactor)
  48360. return X.SRC_COLOR;
  48361. if (e === Ci.OneMinusSrcColorFactor)
  48362. return X.ONE_MINUS_SRC_COLOR;
  48363. if (e === Ci.SrcAlphaFactor)
  48364. return X.SRC_ALPHA;
  48365. if (e === Ci.OneMinusSrcAlphaFactor)
  48366. return X.ONE_MINUS_SRC_ALPHA;
  48367. if (e === Ci.DstAlphaFactor)
  48368. return X.DST_ALPHA;
  48369. if (e === Ci.OneMinusDstAlphaFactor)
  48370. return X.ONE_MINUS_DST_ALPHA;
  48371. if (e === Ci.DstColorFactor)
  48372. return X.DST_COLOR;
  48373. if (e === Ci.OneMinusDstColorFactor)
  48374. return X.ONE_MINUS_DST_COLOR;
  48375. if (e === Ci.SrcAlphaSaturateFactor)
  48376. return X.SRC_ALPHA_SATURATE;
  48377. if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
  48378. if (e === Ci.RGB_S3TC_DXT1_Format)
  48379. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  48380. if (e === Ci.RGBA_S3TC_DXT1_Format)
  48381. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  48382. if (e === Ci.RGBA_S3TC_DXT3_Format)
  48383. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  48384. if (e === Ci.RGBA_S3TC_DXT5_Format)
  48385. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  48386. }
  48387. if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
  48388. if (e === Ci.RGB_PVRTC_4BPPV1_Format)
  48389. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  48390. if (e === Ci.RGB_PVRTC_2BPPV1_Format)
  48391. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  48392. if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
  48393. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  48394. if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
  48395. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  48396. }
  48397. if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
  48398. return t.COMPRESSED_RGB_ETC1_WEBGL;
  48399. if (null !== (t = Ie.get("EXT_blend_minmax"))) {
  48400. if (e === Ci.MinEquation)
  48401. return t.MIN_EXT;
  48402. if (e === Ci.MaxEquation)
  48403. return t.MAX_EXT
  48404. }
  48405. return 0
  48406. }
  48407. console.log("THREE.WebGLRenderer", Ci.REVISION);
  48408. var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
  48409. , L = void 0 !== e.context ? e.context : null
  48410. , D = void 0 !== e.alpha && e.alpha
  48411. , N = void 0 === e.depth || e.depth
  48412. , F = void 0 === e.stencil || e.stencil
  48413. , B = void 0 !== e.antialias && e.antialias
  48414. , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  48415. , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  48416. , U = []
  48417. , H = []
  48418. , z = -1
  48419. , G = []
  48420. , W = -1
  48421. , j = new Float32Array(8)
  48422. , Y = []
  48423. , q = [];
  48424. this.domElement = O,
  48425. this.context = null,
  48426. this.autoClear = !0,
  48427. this.autoClearColor = !0,
  48428. this.autoClearDepth = !0,
  48429. this.autoClearStencil = !0,
  48430. this.sortObjects = !0,
  48431. this.gammaFactor = 2,
  48432. this.gammaInput = !1,
  48433. this.gammaOutput = !1,
  48434. this.physicallyCorrectLights = !1,
  48435. this.toneMapping = Ci.LinearToneMapping,
  48436. this.toneMappingExposure = 1,
  48437. this.toneMappingWhitePoint = 1,
  48438. this.maxMorphTargets = 8,
  48439. this.maxMorphNormals = 4,
  48440. this.autoScaleCubemaps = !0;
  48441. 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 = {
  48442. hash: "",
  48443. ambient: [0, 0, 0],
  48444. directional: [],
  48445. directionalShadowMap: [],
  48446. directionalShadowMatrix: [],
  48447. spot: [],
  48448. spotShadowMap: [],
  48449. spotShadowMatrix: [],
  48450. point: [],
  48451. pointShadowMap: [],
  48452. pointShadowMatrix: [],
  48453. hemi: [],
  48454. shadows: [],
  48455. shadowsPointLight: 0
  48456. }, ye = {
  48457. geometries: 0,
  48458. textures: 0
  48459. }, Ae = {
  48460. calls: 0,
  48461. vertices: 0,
  48462. faces: 0,
  48463. points: 0
  48464. };
  48465. this.info = {
  48466. render: Ae,
  48467. memory: ye,
  48468. programs: null
  48469. };
  48470. try {
  48471. var Ce = {
  48472. alpha: D,
  48473. depth: N,
  48474. stencil: F,
  48475. antialias: B,
  48476. premultipliedAlpha: V,
  48477. preserveDrawingBuffer: k
  48478. };
  48479. if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
  48480. throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  48481. void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
  48482. return {
  48483. rangeMin: 1,
  48484. rangeMax: 1,
  48485. precision: 1
  48486. }
  48487. }
  48488. ),
  48489. O.addEventListener("webglcontextlost", r, !1)
  48490. } catch (e) {
  48491. console.error("THREE.WebGLRenderer: " + e)
  48492. }
  48493. var Ie = new Ci.WebGLExtensions(X);
  48494. Ie.get("OES_texture_float"),
  48495. Ie.get("OES_texture_float_linear"),
  48496. Ie.get("OES_texture_half_float"),
  48497. Ie.get("OES_texture_half_float_linear"),
  48498. Ie.get("OES_standard_derivatives"),
  48499. Ie.get("ANGLE_instanced_arrays"),
  48500. Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
  48501. var Ee = new Ci.WebGLCapabilities(X,Ie,e)
  48502. , _e = new Ci.WebGLState(X,Ie,x)
  48503. , be = new Ci.WebGLProperties
  48504. , we = new Ci.WebGLObjects(X,be,this.info)
  48505. , Te = new Ci.WebGLPrograms(this,Ee)
  48506. , xe = new Ci.WebGLLights;
  48507. this.info.programs = Te.programs;
  48508. var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
  48509. , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
  48510. t(),
  48511. this.context = X,
  48512. this.capabilities = Ee,
  48513. this.extensions = Ie,
  48514. this.properties = be,
  48515. this.state = _e;
  48516. var Re = new Ci.WebGLShadowMap(this,ve,we);
  48517. this.shadowMap = Re;
  48518. var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
  48519. this.getContext = function() {
  48520. return X
  48521. }
  48522. ,
  48523. this.getContextAttributes = function() {
  48524. return X.getContextAttributes()
  48525. }
  48526. ,
  48527. this.forceContextLoss = function() {
  48528. Ie.get("WEBGL_lose_context").loseContext()
  48529. }
  48530. ,
  48531. this.getMaxAnisotropy = function() {
  48532. if (void 0 !== Pe)
  48533. return Pe;
  48534. var e = Ie.get("EXT_texture_filter_anisotropic");
  48535. return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  48536. }
  48537. ,
  48538. this.getPrecision = function() {
  48539. return Ee.precision
  48540. }
  48541. ,
  48542. this.getPixelRatio = function() {
  48543. return he
  48544. }
  48545. ,
  48546. this.setPixelRatio = function(e) {
  48547. void 0 !== e && (he = e,
  48548. this.setSize(pe.z, pe.w, !1))
  48549. }
  48550. ,
  48551. this.getSize = function() {
  48552. return {
  48553. width: le,
  48554. height: ce
  48555. }
  48556. }
  48557. ,
  48558. this.setSize = function(e, t, i, n) {
  48559. null != n && (he = n),
  48560. le = e,
  48561. ce = t,
  48562. O.width = e * he,
  48563. O.height = t * he,
  48564. !1 !== i && (O.style.width = e + "px",
  48565. O.style.height = t + "px"),
  48566. this.setViewport(0, 0, e, t)
  48567. }
  48568. ,
  48569. this.setViewport = function(e, t, i, n) {
  48570. _e.viewport(pe.set(e, t, i, n))
  48571. }
  48572. ,
  48573. this.setScissor = function(e, t, i, n) {
  48574. _e.scissor(ue.set(e, t, i, n))
  48575. }
  48576. ,
  48577. this.setScissorTest = function(e) {
  48578. _e.setScissorTest(de = e)
  48579. }
  48580. ,
  48581. this.getClearColor = function() {
  48582. return ae
  48583. }
  48584. ,
  48585. this.setClearColor = function(e, t) {
  48586. ae.set(e),
  48587. se = void 0 !== t ? t : 1,
  48588. i(ae.r, ae.g, ae.b, se)
  48589. }
  48590. ,
  48591. this.getClearAlpha = function() {
  48592. return se
  48593. }
  48594. ,
  48595. this.setClearAlpha = function(e) {
  48596. se = e,
  48597. i(ae.r, ae.g, ae.b, se)
  48598. }
  48599. ,
  48600. this.clear = function(e, t, i) {
  48601. var n = 0;
  48602. void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
  48603. void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
  48604. void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
  48605. X.clear(n)
  48606. }
  48607. ,
  48608. this.clearColor = function() {
  48609. this.clear(!0, !1, !1)
  48610. }
  48611. ,
  48612. this.clearDepth = function() {
  48613. this.clear(!1, !0, !1)
  48614. }
  48615. ,
  48616. this.clearStencil = function() {
  48617. this.clear(!1, !1, !0)
  48618. }
  48619. ,
  48620. this.clearTarget = function(e, t, i, n) {
  48621. this.setRenderTarget(e),
  48622. this.clear(t, i, n)
  48623. }
  48624. ,
  48625. this.resetGLState = n,
  48626. this.dispose = function() {
  48627. O.removeEventListener("webglcontextlost", r, !1)
  48628. }
  48629. ,
  48630. this.renderBufferImmediate = function(e, t, i) {
  48631. _e.initAttributes();
  48632. var n = be.get(e);
  48633. e.hasPositions && !n.position && (n.position = X.createBuffer()),
  48634. e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
  48635. e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
  48636. e.hasColors && !n.color && (n.color = X.createBuffer());
  48637. var r = t.getAttributes();
  48638. if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
  48639. X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
  48640. _e.enableAttribute(r.position),
  48641. X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
  48642. e.hasNormals) {
  48643. if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
  48644. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
  48645. for (var o = 0, a = 3 * e.count; o < a; o += 9) {
  48646. var s = e.normalArray
  48647. , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
  48648. , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
  48649. , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
  48650. s[o + 0] = l,
  48651. s[o + 1] = c,
  48652. s[o + 2] = h,
  48653. s[o + 3] = l,
  48654. s[o + 4] = c,
  48655. s[o + 5] = h,
  48656. s[o + 6] = l,
  48657. s[o + 7] = c,
  48658. s[o + 8] = h
  48659. }
  48660. X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
  48661. _e.enableAttribute(r.normal),
  48662. X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
  48663. }
  48664. e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
  48665. X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
  48666. _e.enableAttribute(r.uv),
  48667. X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
  48668. e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
  48669. X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
  48670. _e.enableAttribute(r.color),
  48671. X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
  48672. _e.disableUnusedAttributes(),
  48673. X.drawArrays(X.TRIANGLES, 0, e.count),
  48674. e.count = 0
  48675. }
  48676. ,
  48677. this.renderBufferDirect = function(e, t, i, n, r, o) {
  48678. R(n);
  48679. var a = P(e, t, n, r)
  48680. , s = !1
  48681. , l = i.id + "_" + a.id + "_" + n.wireframe;
  48682. l !== ee && (ee = l,
  48683. s = !0);
  48684. var c = r.morphTargetInfluences;
  48685. if (void 0 !== c) {
  48686. for (var h = [], u = 0, d = c.length; u < d; u++) {
  48687. var p = c[u];
  48688. h.push([p, u])
  48689. }
  48690. h.sort(M),
  48691. 8 < h.length && (h.length = 8);
  48692. var f = i.morphAttributes;
  48693. for (u = 0,
  48694. d = h.length; u < d; u++) {
  48695. p = h[u];
  48696. if (j[u] = p[0],
  48697. 0 !== p[0]) {
  48698. var g = p[1];
  48699. !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
  48700. !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
  48701. } else
  48702. !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
  48703. !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
  48704. }
  48705. var m = a.getUniforms();
  48706. null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
  48707. s = !0
  48708. }
  48709. g = i.index;
  48710. var v, y = i.attributes.position;
  48711. !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
  48712. null !== g ? (v = Me).setIndex(g) : v = Se,
  48713. s && (function(e, t, i, n) {
  48714. var r;
  48715. if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
  48716. console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  48717. else {
  48718. void 0 === n && (n = 0),
  48719. _e.initAttributes();
  48720. var o = i.attributes
  48721. , a = t.getAttributes()
  48722. , s = e.defaultAttributeValues;
  48723. for (var l in a) {
  48724. var c = a[l];
  48725. if (0 <= c) {
  48726. var h = o[l];
  48727. if (void 0 !== h) {
  48728. var u = h.itemSize
  48729. , d = we.getAttributeBuffer(h);
  48730. if (h instanceof Ci.InterleavedBufferAttribute) {
  48731. var p = h.data
  48732. , f = p.stride
  48733. , g = h.offset;
  48734. p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
  48735. void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
  48736. X.bindBuffer(X.ARRAY_BUFFER, d),
  48737. X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
  48738. } else
  48739. h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
  48740. void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
  48741. X.bindBuffer(X.ARRAY_BUFFER, d),
  48742. X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
  48743. } else if (void 0 !== s) {
  48744. var m = s[l];
  48745. if (void 0 !== m)
  48746. switch (m.length) {
  48747. case 2:
  48748. X.vertexAttrib2fv(c, m);
  48749. break;
  48750. case 3:
  48751. X.vertexAttrib3fv(c, m);
  48752. break;
  48753. case 4:
  48754. X.vertexAttrib4fv(c, m);
  48755. break;
  48756. default:
  48757. X.vertexAttrib1fv(c, m)
  48758. }
  48759. }
  48760. }
  48761. }
  48762. _e.disableUnusedAttributes()
  48763. }
  48764. }(n, a, i),
  48765. null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
  48766. var A = 1 / 0;
  48767. null !== g ? A = g.count : void 0 !== y && (A = y.count);
  48768. var C = i.drawRange.start
  48769. , I = i.drawRange.count
  48770. , E = null !== o ? o.start : 0
  48771. , _ = null !== o ? o.count : 1 / 0
  48772. , b = Math.max(0, C, E)
  48773. , w = Math.min(0 + A, C + I, E + _) - 1
  48774. , T = Math.max(0, w - b + 1);
  48775. if (r instanceof Ci.Mesh)
  48776. if (!0 === n.wireframe)
  48777. _e.setLineWidth(n.wireframeLinewidth * S()),
  48778. v.setMode(X.LINES);
  48779. else
  48780. switch (r.drawMode) {
  48781. case Ci.TrianglesDrawMode:
  48782. v.setMode(X.TRIANGLES);
  48783. break;
  48784. case Ci.TriangleStripDrawMode:
  48785. v.setMode(X.TRIANGLE_STRIP);
  48786. break;
  48787. case Ci.TriangleFanDrawMode:
  48788. v.setMode(X.TRIANGLE_FAN)
  48789. }
  48790. else if (r instanceof Ci.Line) {
  48791. var x = n.linewidth;
  48792. void 0 === x && (x = 1),
  48793. _e.setLineWidth(x * S()),
  48794. r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
  48795. } else
  48796. r instanceof Ci.Points && v.setMode(X.POINTS);
  48797. i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
  48798. }
  48799. ,
  48800. this.render = function(e, t, i, n) {
  48801. if (t instanceof Ci.Camera != 0) {
  48802. var r = e.fog;
  48803. if (ee = "",
  48804. $ = -1,
  48805. !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
  48806. null === t.parent && t.updateMatrixWorld(),
  48807. t.matrixWorldInverse.getInverse(t.matrixWorld),
  48808. ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  48809. fe.setFromMatrix(ge),
  48810. U.length = 0,
  48811. W = z = -1,
  48812. Y.length = 0,
  48813. q.length = 0,
  48814. function e(t, i) {
  48815. if (!1 !== t.visible) {
  48816. if (t.layers.test(i.layers))
  48817. if (t instanceof Ci.Light)
  48818. U.push(t);
  48819. else if (t instanceof Ci.Sprite)
  48820. !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
  48821. else if (t instanceof Ci.LensFlare)
  48822. q.push(t);
  48823. else if (t instanceof Ci.ImmediateRenderObject)
  48824. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  48825. me.applyProjection(ge)),
  48826. d(t, null, t.material, me.z, null);
  48827. else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
  48828. !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
  48829. var n = t.material;
  48830. if (!0 === n.visible) {
  48831. !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
  48832. me.applyProjection(ge));
  48833. var r = we.update(t);
  48834. if (n instanceof Ci.MultiMaterial)
  48835. for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
  48836. var c = o[s]
  48837. , h = a[c.materialIndex];
  48838. !0 === h.visible && d(t, r, h, me.z, c)
  48839. }
  48840. else
  48841. d(t, r, n, me.z, null)
  48842. }
  48843. }
  48844. var u = t.children;
  48845. for (s = 0,
  48846. l = u.length; s < l; s++)
  48847. e(u[s], i)
  48848. }
  48849. }(e, t),
  48850. H.length = z + 1,
  48851. G.length = W + 1,
  48852. !0 === Z.sortObjects && (H.sort(s),
  48853. G.sort(l)),
  48854. function(e, t) {
  48855. 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;
  48856. for (i = ve.shadowsPointLight = 0,
  48857. n = e.length; i < n; i++)
  48858. if (o = (r = e[i]).color,
  48859. a = r.intensity,
  48860. s = r.distance,
  48861. r instanceof Ci.AmbientLight)
  48862. l += o.r * a,
  48863. c += o.g * a,
  48864. h += o.b * a;
  48865. else if (r instanceof Ci.DirectionalLight) {
  48866. (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
  48867. v.direction.setFromMatrixPosition(r.matrixWorld),
  48868. me.setFromMatrixPosition(r.target.matrixWorld),
  48869. v.direction.sub(me),
  48870. v.direction.transformDirection(u),
  48871. v.shadow = r.castShadow,
  48872. r.castShadow && (v.shadowBias = r.shadow.bias,
  48873. v.shadowRadius = r.shadow.radius,
  48874. v.shadowMapSize = r.shadow.mapSize,
  48875. ve.shadows[m++] = r),
  48876. ve.directionalShadowMap[d] = r.shadow.map,
  48877. ve.directionalShadowMatrix[d] = r.shadow.matrix,
  48878. ve.directional[d++] = v
  48879. } else if (r instanceof Ci.SpotLight) {
  48880. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  48881. v.position.applyMatrix4(u),
  48882. v.color.copy(o).multiplyScalar(a),
  48883. v.distance = s,
  48884. v.direction.setFromMatrixPosition(r.matrixWorld),
  48885. me.setFromMatrixPosition(r.target.matrixWorld),
  48886. v.direction.sub(me),
  48887. v.direction.transformDirection(u),
  48888. v.coneCos = Math.cos(r.angle),
  48889. v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
  48890. v.decay = 0 === r.distance ? 0 : r.decay,
  48891. v.shadow = r.castShadow,
  48892. r.castShadow && (v.shadowBias = r.shadow.bias,
  48893. v.shadowRadius = r.shadow.radius,
  48894. v.shadowMapSize = r.shadow.mapSize,
  48895. ve.shadows[m++] = r),
  48896. ve.spotShadowMap[f] = r.shadow.map,
  48897. ve.spotShadowMatrix[f] = r.shadow.matrix,
  48898. ve.spot[f++] = v
  48899. } else if (r instanceof Ci.PointLight) {
  48900. (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
  48901. v.position.applyMatrix4(u),
  48902. v.color.copy(r.color).multiplyScalar(r.intensity),
  48903. v.distance = r.distance,
  48904. v.decay = 0 === r.distance ? 0 : r.decay,
  48905. v.shadow = r.castShadow,
  48906. r.castShadow && (v.shadowBias = r.shadow.bias,
  48907. v.shadowRadius = r.shadow.radius,
  48908. v.shadowMapSize = r.shadow.mapSize,
  48909. ve.shadows[m++] = r),
  48910. ve.pointShadowMap[p] = r.shadow.map,
  48911. void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
  48912. me.setFromMatrixPosition(r.matrixWorld).negate(),
  48913. ve.pointShadowMatrix[p].identity().setPosition(me),
  48914. ve.point[p++] = v
  48915. } else if (r instanceof Ci.HemisphereLight) {
  48916. var v;
  48917. (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
  48918. v.direction.transformDirection(u),
  48919. v.direction.normalize(),
  48920. v.skyColor.copy(r.color).multiplyScalar(a),
  48921. v.groundColor.copy(r.groundColor).multiplyScalar(a),
  48922. ve.hemi[g++] = v
  48923. }
  48924. ve.ambient[0] = l,
  48925. ve.ambient[1] = c,
  48926. ve.ambient[2] = h,
  48927. ve.directional.length = d,
  48928. ve.spot.length = f,
  48929. ve.point.length = p,
  48930. ve.hemi.length = g,
  48931. ve.shadows.length = m,
  48932. ve.hash = d + "," + p + "," + f + "," + g + "," + m
  48933. }(U, t),
  48934. Re.render(e, t),
  48935. Ae.calls = 0,
  48936. Ae.vertices = 0,
  48937. Ae.faces = 0,
  48938. void (Ae.points = 0) === i && (i = null),
  48939. this.setRenderTarget(i),
  48940. (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  48941. e.overrideMaterial) {
  48942. var o = e.overrideMaterial;
  48943. c(H, t, r, o),
  48944. c(G, t, r, o)
  48945. } else
  48946. _e.setBlending(Ci.NoBlending),
  48947. c(H, t, r),
  48948. c(G, t, r);
  48949. if (Oe.render(e, t),
  48950. Le.render(e, t, re),
  48951. i) {
  48952. var a = i.texture;
  48953. a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
  48954. var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
  48955. , i = be.get(e.texture).__webglTexture;
  48956. _e.bindTexture(t, i),
  48957. X.generateMipmap(t),
  48958. _e.bindTexture(t, null)
  48959. }(i)
  48960. }
  48961. _e.setDepthTest(!0),
  48962. _e.setDepthWrite(!0),
  48963. _e.setColorWrite(!0)
  48964. } else
  48965. console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
  48966. }
  48967. ,
  48968. this.setFaceCulling = function(e, t) {
  48969. e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
  48970. e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
  48971. _e.enable(X.CULL_FACE))
  48972. }
  48973. ,
  48974. this.setTexture = function(e, t) {
  48975. var i = be.get(e);
  48976. if (0 < e.version && i.__version !== e.version) {
  48977. var n = e.image;
  48978. 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)
  48979. }
  48980. _e.activeTexture(X.TEXTURE0 + t),
  48981. _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
  48982. }
  48983. ,
  48984. this.getCurrentRenderTarget = function() {
  48985. return Q
  48986. }
  48987. ,
  48988. this.setRenderTarget = function(e) {
  48989. (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
  48990. var t, i = e instanceof Ci.WebGLRenderTargetCube;
  48991. if (e) {
  48992. var n = be.get(e);
  48993. t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
  48994. ie.copy(e.scissor),
  48995. ne = e.scissorTest,
  48996. re.copy(e.viewport)
  48997. } else
  48998. t = null,
  48999. ie.copy(ue).multiplyScalar(he),
  49000. ne = de,
  49001. re.copy(pe).multiplyScalar(he);
  49002. if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
  49003. J = t),
  49004. _e.scissor(ie),
  49005. _e.setScissorTest(ne),
  49006. _e.viewport(re),
  49007. i) {
  49008. var r = be.get(e.texture);
  49009. X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
  49010. }
  49011. }
  49012. ,
  49013. this.readRenderTargetPixels = function(e, t, i, n, r, o) {
  49014. if (e instanceof Ci.WebGLRenderTarget != 0) {
  49015. var a = be.get(e).__webglFramebuffer;
  49016. if (a) {
  49017. var s = !1;
  49018. a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
  49019. s = !0);
  49020. try {
  49021. var l = e.texture;
  49022. if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
  49023. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49024. 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")))
  49025. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49026. 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.")
  49027. } finally {
  49028. s && X.bindFramebuffer(X.FRAMEBUFFER, J)
  49029. }
  49030. }
  49031. } else
  49032. console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
  49033. }
  49034. }
  49035. ,
  49036. Ci.WebGLRenderTarget = function(e, t, i) {
  49037. this.uuid = Ci.Math.generateUUID(),
  49038. this.width = e,
  49039. this.height = t,
  49040. this.scissor = new Ci.Vector4(0,0,e,t),
  49041. this.scissorTest = !1,
  49042. this.viewport = new Ci.Vector4(0,0,e,t),
  49043. void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
  49044. this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  49045. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  49046. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  49047. }
  49048. ,
  49049. Ci.WebGLRenderTarget.prototype = {
  49050. constructor: Ci.WebGLRenderTarget,
  49051. setSize: function(e, t) {
  49052. this.width === e && this.height === t || (this.width = e,
  49053. this.height = t,
  49054. this.dispose()),
  49055. this.viewport.set(0, 0, e, t),
  49056. this.scissor.set(0, 0, e, t)
  49057. },
  49058. clone: function() {
  49059. return (new this.constructor).copy(this)
  49060. },
  49061. copy: function(e) {
  49062. return this.width = e.width,
  49063. this.height = e.height,
  49064. this.viewport.copy(e.viewport),
  49065. this.texture = e.texture.clone(),
  49066. this.depthBuffer = e.depthBuffer,
  49067. this.stencilBuffer = e.stencilBuffer,
  49068. this
  49069. },
  49070. dispose: function() {
  49071. this.dispatchEvent({
  49072. type: "dispose"
  49073. })
  49074. }
  49075. },
  49076. Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
  49077. Ci.WebGLRenderTargetCube = function(e, t, i) {
  49078. Ci.WebGLRenderTarget.call(this, e, t, i),
  49079. this.activeCubeFace = 0,
  49080. this.activeMipMapLevel = 0
  49081. }
  49082. ,
  49083. Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
  49084. Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
  49085. Ci.WebGLBufferRenderer = function(r, o, a) {
  49086. var s;
  49087. this.setMode = function(e) {
  49088. s = e
  49089. }
  49090. ,
  49091. this.render = function(e, t) {
  49092. r.drawArrays(s, e, t),
  49093. a.calls++,
  49094. a.vertices += t,
  49095. s === r.TRIANGLES && (a.faces += t / 3)
  49096. }
  49097. ,
  49098. this.renderInstances = function(e) {
  49099. var t = o.get("ANGLE_instanced_arrays");
  49100. if (null !== t) {
  49101. var i = e.attributes.position
  49102. , n = 0;
  49103. n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
  49104. t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
  49105. a.calls++,
  49106. a.vertices += n * e.maxInstancedCount,
  49107. s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
  49108. } else
  49109. console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
  49110. }
  49111. }
  49112. ,
  49113. Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
  49114. var s, l, c;
  49115. this.setMode = function(e) {
  49116. s = e
  49117. }
  49118. ,
  49119. this.setIndex = function(e) {
  49120. c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
  49121. 4) : (l = r.UNSIGNED_SHORT,
  49122. 2)
  49123. }
  49124. ,
  49125. this.render = function(e, t) {
  49126. r.drawElements(s, t, l, e * c),
  49127. a.calls++,
  49128. a.vertices += t,
  49129. s === r.TRIANGLES && (a.faces += t / 3)
  49130. }
  49131. ,
  49132. this.renderInstances = function(e, t, i) {
  49133. var n = o.get("ANGLE_instanced_arrays");
  49134. 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),
  49135. a.calls++,
  49136. a.vertices += i * e.maxInstancedCount,
  49137. void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
  49138. }
  49139. }
  49140. ,
  49141. Ci.WebGLExtensions = function(i) {
  49142. var n = {};
  49143. this.get = function(e) {
  49144. if (void 0 !== n[e])
  49145. return n[e];
  49146. var t;
  49147. switch (e) {
  49148. case "EXT_texture_filter_anisotropic":
  49149. t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  49150. break;
  49151. case "WEBGL_compressed_texture_s3tc":
  49152. t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  49153. break;
  49154. case "WEBGL_compressed_texture_pvrtc":
  49155. t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  49156. break;
  49157. case "WEBGL_compressed_texture_etc1":
  49158. t = i.getExtension("WEBGL_compressed_texture_etc1");
  49159. break;
  49160. default:
  49161. t = i.getExtension(e)
  49162. }
  49163. return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
  49164. n[e] = t
  49165. }
  49166. }
  49167. ,
  49168. Ci.WebGLCapabilities = function(t, e, i) {
  49169. function n(e) {
  49170. if ("highp" === e) {
  49171. if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
  49172. return "highp";
  49173. e = "mediump"
  49174. }
  49175. 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"
  49176. }
  49177. this.getMaxPrecision = n,
  49178. this.precision = void 0 !== i.precision ? i.precision : "highp",
  49179. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  49180. this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
  49181. this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  49182. this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
  49183. this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
  49184. this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
  49185. this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
  49186. this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
  49187. this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
  49188. this.vertexTextures = 0 < this.maxVertexTextures,
  49189. this.floatFragmentTextures = !!e.get("OES_texture_float"),
  49190. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  49191. var r = n(this.precision);
  49192. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  49193. this.precision = r),
  49194. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
  49195. }
  49196. ,
  49197. Ci.WebGLGeometries = function(i, o, a) {
  49198. function s(e) {
  49199. var t = e.target
  49200. , i = c[t.id];
  49201. null !== i.index && l(i.index),
  49202. function(e) {
  49203. for (var t in e)
  49204. l(e[t])
  49205. }(i.attributes),
  49206. t.removeEventListener("dispose", s),
  49207. delete c[t.id];
  49208. var n = o.get(t);
  49209. n.wireframe && l(n.wireframe),
  49210. o.delete(t);
  49211. var r = o.get(i);
  49212. r.wireframe && l(r.wireframe),
  49213. o.delete(i),
  49214. a.memory.geometries--
  49215. }
  49216. function l(e) {
  49217. var t = function(e) {
  49218. return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
  49219. }(e);
  49220. void 0 !== t && (i.deleteBuffer(t),
  49221. function(e) {
  49222. e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
  49223. }(e))
  49224. }
  49225. var c = {};
  49226. this.get = function(e) {
  49227. var t, i = e.geometry;
  49228. return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
  49229. i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
  49230. t = i._bufferGeometry),
  49231. c[i.id] = t,
  49232. a.memory.geometries++,
  49233. t)
  49234. }
  49235. }
  49236. ,
  49237. Ci.WebGLLights = function() {
  49238. var i = {};
  49239. this.get = function(e) {
  49240. if (void 0 !== i[e.id])
  49241. return i[e.id];
  49242. var t;
  49243. switch (e.type) {
  49244. case "DirectionalLight":
  49245. t = {
  49246. direction: new Ci.Vector3,
  49247. color: new Ci.Color,
  49248. shadow: !1,
  49249. shadowBias: 0,
  49250. shadowRadius: 1,
  49251. shadowMapSize: new Ci.Vector2
  49252. };
  49253. break;
  49254. case "SpotLight":
  49255. t = {
  49256. position: new Ci.Vector3,
  49257. direction: new Ci.Vector3,
  49258. color: new Ci.Color,
  49259. distance: 0,
  49260. coneCos: 0,
  49261. penumbraCos: 0,
  49262. decay: 0,
  49263. shadow: !1,
  49264. shadowBias: 0,
  49265. shadowRadius: 1,
  49266. shadowMapSize: new Ci.Vector2
  49267. };
  49268. break;
  49269. case "PointLight":
  49270. t = {
  49271. position: new Ci.Vector3,
  49272. color: new Ci.Color,
  49273. distance: 0,
  49274. decay: 0,
  49275. shadow: !1,
  49276. shadowBias: 0,
  49277. shadowRadius: 1,
  49278. shadowMapSize: new Ci.Vector2
  49279. };
  49280. break;
  49281. case "HemisphereLight":
  49282. t = {
  49283. direction: new Ci.Vector3,
  49284. skyColor: new Ci.Color,
  49285. groundColor: new Ci.Color
  49286. }
  49287. }
  49288. return i[e.id] = t
  49289. }
  49290. }
  49291. ,
  49292. Ci.WebGLObjects = function(g, m, e) {
  49293. function v(e, t) {
  49294. var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
  49295. , n = m.get(i);
  49296. void 0 === n.__webglBuffer ? function(e, t, i) {
  49297. e.__webglBuffer = g.createBuffer(),
  49298. g.bindBuffer(i, e.__webglBuffer);
  49299. var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
  49300. g.bufferData(i, t.array, n),
  49301. e.version = t.version
  49302. }(n, i, t) : n.version !== i.version && function(e, t, i) {
  49303. g.bindBuffer(i, e.__webglBuffer),
  49304. !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)),
  49305. t.updateRange.count = 0),
  49306. e.version = t.version
  49307. }(n, i, t)
  49308. }
  49309. function y(e, t, i) {
  49310. if (i < t) {
  49311. var n = t;
  49312. t = i,
  49313. i = n
  49314. }
  49315. var r = e[t];
  49316. return void 0 === r ? (e[t] = [i],
  49317. !0) : -1 === r.indexOf(i) && (r.push(i),
  49318. !0)
  49319. }
  49320. var c = new Ci.WebGLGeometries(g,m,e);
  49321. this.getAttributeBuffer = function(e) {
  49322. return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
  49323. }
  49324. ,
  49325. this.getWireframeAttribute = function(e) {
  49326. var t = m.get(e);
  49327. if (void 0 !== t.wireframe)
  49328. return t.wireframe;
  49329. var i, n = [], r = e.index, o = e.attributes, a = o.position;
  49330. if (null !== r)
  49331. for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
  49332. var h = i[l + 0]
  49333. , u = i[l + 1]
  49334. , d = i[l + 2];
  49335. y(s, h, u) && n.push(h, u),
  49336. y(s, u, d) && n.push(u, d),
  49337. y(s, d, h) && n.push(d, h)
  49338. }
  49339. else
  49340. for (l = 0,
  49341. c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
  49342. h = l + 0,
  49343. u = l + 1,
  49344. d = l + 2;
  49345. n.push(h, u, u, d, d, h)
  49346. }
  49347. var p = 65535 < a.count ? Uint32Array : Uint16Array
  49348. , f = new Ci.BufferAttribute(new p(n),1);
  49349. return v(f, g.ELEMENT_ARRAY_BUFFER),
  49350. t.wireframe = f
  49351. }
  49352. ,
  49353. this.update = function(e) {
  49354. var t = c.get(e);
  49355. e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
  49356. var i = t.index
  49357. , n = t.attributes;
  49358. for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
  49359. n)
  49360. v(n[r], g.ARRAY_BUFFER);
  49361. var o = t.morphAttributes;
  49362. for (var r in o)
  49363. for (var a = o[r], s = 0, l = a.length; s < l; s++)
  49364. v(a[s], g.ARRAY_BUFFER);
  49365. return t
  49366. }
  49367. }
  49368. ,
  49369. Ci.WebGLProgram = (Qt = 0,
  49370. Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
  49371. $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  49372. ei = /^([\w\d_]+)\[0\]$/,
  49373. function(e, t, i, n) {
  49374. var r = e.context
  49375. , o = i.extensions
  49376. , a = i.defines
  49377. , s = i.__webglShader.vertexShader
  49378. , l = i.__webglShader.fragmentShader
  49379. , c = "SHADOWMAP_TYPE_BASIC";
  49380. n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
  49381. var h = "ENVMAP_TYPE_CUBE"
  49382. , u = "ENVMAP_MODE_REFLECTION"
  49383. , d = "ENVMAP_BLENDING_MULTIPLY";
  49384. if (n.envMap) {
  49385. switch (i.envMap.mapping) {
  49386. case Ci.CubeReflectionMapping:
  49387. case Ci.CubeRefractionMapping:
  49388. h = "ENVMAP_TYPE_CUBE";
  49389. break;
  49390. case Ci.CubeUVReflectionMapping:
  49391. case Ci.CubeUVRefractionMapping:
  49392. h = "ENVMAP_TYPE_CUBE_UV";
  49393. break;
  49394. case Ci.EquirectangularReflectionMapping:
  49395. case Ci.EquirectangularRefractionMapping:
  49396. h = "ENVMAP_TYPE_EQUIREC";
  49397. break;
  49398. case Ci.SphericalReflectionMapping:
  49399. h = "ENVMAP_TYPE_SPHERE"
  49400. }
  49401. switch (i.envMap.mapping) {
  49402. case Ci.CubeRefractionMapping:
  49403. case Ci.EquirectangularRefractionMapping:
  49404. u = "ENVMAP_MODE_REFRACTION"
  49405. }
  49406. switch (i.combine) {
  49407. case Ci.MultiplyOperation:
  49408. d = "ENVMAP_BLENDING_MULTIPLY";
  49409. break;
  49410. case Ci.MixOperation:
  49411. d = "ENVMAP_BLENDING_MIX";
  49412. break;
  49413. case Ci.AddOperation:
  49414. d = "ENVMAP_BLENDING_ADD"
  49415. }
  49416. }
  49417. var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
  49418. 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")
  49419. }(o, n, e.extensions), v = function(e) {
  49420. var t = [];
  49421. for (var i in e) {
  49422. var n = e[i];
  49423. !1 !== n && t.push("#define " + i + " " + n)
  49424. }
  49425. return t.join("\n")
  49426. }(a), y = r.createProgram();
  49427. 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"),
  49428. [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) {
  49429. var i;
  49430. switch (t) {
  49431. case Ci.LinearToneMapping:
  49432. i = "Linear";
  49433. break;
  49434. case Ci.ReinhardToneMapping:
  49435. i = "Reinhard";
  49436. break;
  49437. case Ci.Uncharted2ToneMapping:
  49438. i = "Uncharted2";
  49439. break;
  49440. case Ci.CineonToneMapping:
  49441. i = "OptimizedCineon";
  49442. break;
  49443. default:
  49444. throw new Error("unsupported toneMapping: " + t)
  49445. }
  49446. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  49447. }("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) {
  49448. var i = Mi(t);
  49449. return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
  49450. }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
  49451. s = Oi(s = Li(s), n),
  49452. l = Oi(l = Li(l), n),
  49453. i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
  49454. l = Di(l));
  49455. var A = p + s
  49456. , C = f + l
  49457. , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
  49458. , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
  49459. r.attachShader(y, I),
  49460. r.attachShader(y, E),
  49461. void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
  49462. r.linkProgram(y);
  49463. var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
  49464. return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
  49465. 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),
  49466. M && (this.diagnostics = {
  49467. runnable: S,
  49468. material: i,
  49469. programLog: w,
  49470. vertexShader: {
  49471. log: T,
  49472. prefix: p
  49473. },
  49474. fragmentShader: {
  49475. log: x,
  49476. prefix: f
  49477. }
  49478. }),
  49479. r.deleteShader(I),
  49480. r.deleteShader(E),
  49481. this.getUniforms = function() {
  49482. return void 0 === _ && (_ = function(e, t) {
  49483. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
  49484. var o = e.getActiveUniform(t, r).name
  49485. , a = e.getUniformLocation(t, o)
  49486. , s = Jt.exec(o);
  49487. if (s) {
  49488. var l = s[1]
  49489. , c = s[2]
  49490. , h = i[l];
  49491. (h = h || (i[l] = {}))[c] = a
  49492. } else if (s = $t.exec(o)) {
  49493. var u = s[1]
  49494. , d = s[2]
  49495. , p = s[3]
  49496. , f = i[u]
  49497. , g = (f = f || (i[u] = []))[d];
  49498. (g = g || (f[d] = {}))[p] = a
  49499. } else
  49500. (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
  49501. }
  49502. return i
  49503. }(r, y)),
  49504. _
  49505. }
  49506. ,
  49507. this.getAttributes = function() {
  49508. return void 0 === b && (b = function(e, t) {
  49509. for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
  49510. var o = e.getActiveAttrib(t, r).name;
  49511. i[o] = e.getAttribLocation(t, o)
  49512. }
  49513. return i
  49514. }(r, y)),
  49515. b
  49516. }
  49517. ,
  49518. this.destroy = function() {
  49519. r.deleteProgram(y),
  49520. this.program = void 0
  49521. }
  49522. ,
  49523. Object.defineProperties(this, {
  49524. uniforms: {
  49525. get: function() {
  49526. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  49527. this.getUniforms()
  49528. }
  49529. },
  49530. attributes: {
  49531. get: function() {
  49532. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  49533. this.getAttributes()
  49534. }
  49535. }
  49536. }),
  49537. this.id = Qt++,
  49538. this.code = t,
  49539. this.usedTimes = 1,
  49540. this.program = y,
  49541. this.vertexShader = I,
  49542. this.fragmentShader = E,
  49543. this
  49544. }
  49545. ),
  49546. Ci.WebGLPrograms = function(s, l) {
  49547. function c(e, t) {
  49548. var i;
  49549. return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
  49550. i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
  49551. i
  49552. }
  49553. var h = []
  49554. , u = {
  49555. MeshDepthMaterial: "depth",
  49556. MeshNormalMaterial: "normal",
  49557. MeshBasicMaterial: "basic",
  49558. MeshLambertMaterial: "lambert",
  49559. MeshPhongMaterial: "phong",
  49560. MeshStandardMaterial: "standard",
  49561. LineBasicMaterial: "basic",
  49562. LineDashedMaterial: "dashed",
  49563. PointsMaterial: "points"
  49564. }
  49565. , 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"];
  49566. this.getParameters = function(e, t, i, n) {
  49567. var r = u[e.type]
  49568. , o = function(e) {
  49569. if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  49570. return 1024;
  49571. var t = l.maxVertexUniforms
  49572. , i = Math.floor((t - 20) / 4);
  49573. 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)")),
  49574. i
  49575. }(n)
  49576. , a = s.getPrecision();
  49577. return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
  49578. {
  49579. shaderID: r,
  49580. precision: a,
  49581. supportsVertexTextures: l.vertexTextures,
  49582. outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
  49583. map: !!e.map,
  49584. mapEncoding: c(e.map, s.gammaInput),
  49585. envMap: !!e.envMap,
  49586. envMapMode: e.envMap && e.envMap.mapping,
  49587. envMapEncoding: c(e.envMap, s.gammaInput),
  49588. envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
  49589. lightMap: !!e.lightMap,
  49590. aoMap: !!e.aoMap,
  49591. emissiveMap: !!e.emissiveMap,
  49592. emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
  49593. bumpMap: !!e.bumpMap,
  49594. normalMap: !!e.normalMap,
  49595. displacementMap: !!e.displacementMap,
  49596. roughnessMap: !!e.roughnessMap,
  49597. metalnessMap: !!e.metalnessMap,
  49598. specularMap: !!e.specularMap,
  49599. alphaMap: !!e.alphaMap,
  49600. combine: e.combine,
  49601. vertexColors: e.vertexColors,
  49602. fog: i,
  49603. useFog: e.fog,
  49604. fogExp: i instanceof Ci.FogExp2,
  49605. flatShading: e.shading === Ci.FlatShading,
  49606. sizeAttenuation: e.sizeAttenuation,
  49607. logarithmicDepthBuffer: l.logarithmicDepthBuffer,
  49608. skinning: e.skinning,
  49609. maxBones: o,
  49610. useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
  49611. morphTargets: e.morphTargets,
  49612. morphNormals: e.morphNormals,
  49613. maxMorphTargets: s.maxMorphTargets,
  49614. maxMorphNormals: s.maxMorphNormals,
  49615. numDirLights: t.directional.length,
  49616. numPointLights: t.point.length,
  49617. numSpotLights: t.spot.length,
  49618. numHemiLights: t.hemi.length,
  49619. pointLightShadows: t.shadowsPointLight,
  49620. shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
  49621. shadowMapType: s.shadowMap.type,
  49622. toneMapping: s.toneMapping,
  49623. physicallyCorrectLights: s.physicallyCorrectLights,
  49624. premultipliedAlpha: e.premultipliedAlpha,
  49625. alphaTest: e.alphaTest,
  49626. doubleSided: e.side === Ci.DoubleSide,
  49627. flipSided: e.side === Ci.BackSide
  49628. }
  49629. }
  49630. ,
  49631. this.getProgramCode = function(e, t) {
  49632. var i = [];
  49633. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  49634. i.push(e.vertexShader)),
  49635. void 0 !== e.defines)
  49636. for (var n in e.defines)
  49637. i.push(n),
  49638. i.push(e.defines[n]);
  49639. for (var r = 0; r < a.length; r++) {
  49640. var o = a[r];
  49641. i.push(o),
  49642. i.push(t[o])
  49643. }
  49644. return i.join()
  49645. }
  49646. ,
  49647. this.acquireProgram = function(e, t, i) {
  49648. for (var n, r = 0, o = h.length; r < o; r++) {
  49649. var a = h[r];
  49650. if (a.code === i) {
  49651. ++(n = a).usedTimes;
  49652. break
  49653. }
  49654. }
  49655. return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
  49656. h.push(n)),
  49657. n
  49658. }
  49659. ,
  49660. this.releaseProgram = function(e) {
  49661. if (0 == --e.usedTimes) {
  49662. var t = h.indexOf(e);
  49663. h[t] = h[h.length - 1],
  49664. h.pop(),
  49665. e.destroy()
  49666. }
  49667. }
  49668. ,
  49669. this.programs = h
  49670. }
  49671. ,
  49672. Ci.WebGLProperties = function() {
  49673. var n = {};
  49674. this.get = function(e) {
  49675. var t = e.uuid
  49676. , i = n[t];
  49677. return void 0 === i && (i = {},
  49678. n[t] = i),
  49679. i
  49680. }
  49681. ,
  49682. this.delete = function(e) {
  49683. delete n[e.uuid]
  49684. }
  49685. ,
  49686. this.clear = function() {
  49687. n = {}
  49688. }
  49689. }
  49690. ,
  49691. Ci.WebGLShader = function(e, t, i) {
  49692. var n = e.createShader(t);
  49693. return e.shaderSource(n, i),
  49694. e.compileShader(n),
  49695. !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
  49696. "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
  49697. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  49698. t[i] = i + 1 + ": " + t[i];
  49699. return t.join("\n")
  49700. }(i)),
  49701. n
  49702. }
  49703. ,
  49704. Ci.WebGLShadowMap = function(P, O, L) {
  49705. function D(e, t, i, n) {
  49706. var r = e.geometry
  49707. , o = null
  49708. , a = p
  49709. , s = e.customDepthMaterial;
  49710. if (i && (a = f,
  49711. s = e.customDistanceMaterial),
  49712. s)
  49713. o = s;
  49714. else {
  49715. var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
  49716. , c = e instanceof Ci.SkinnedMesh && t.skinning
  49717. , h = 0;
  49718. l && (h |= u),
  49719. c && (h |= d),
  49720. o = a[h]
  49721. }
  49722. return o.visible = t.visible,
  49723. o.wireframe = t.wireframe,
  49724. o.wireframeLinewidth = t.wireframeLinewidth,
  49725. i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
  49726. o
  49727. }
  49728. function N(e, t, i) {
  49729. if (!1 !== e.visible) {
  49730. 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)))
  49731. !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  49732. G.push(e));
  49733. for (var n = e.children, r = 0, o = n.length; r < o; r++)
  49734. N(n[r], t, i)
  49735. }
  49736. }
  49737. 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) {
  49738. var a = 0 != (o & u)
  49739. , s = 0 != (o & d)
  49740. , l = new Ci.ShaderMaterial({
  49741. uniforms: i,
  49742. vertexShader: t.vertexShader,
  49743. fragmentShader: t.fragmentShader,
  49744. morphTargets: a,
  49745. skinning: s
  49746. });
  49747. p[o] = l;
  49748. var c = new Ci.ShaderMaterial({
  49749. defines: {
  49750. USE_SHADOWMAP: ""
  49751. },
  49752. uniforms: r,
  49753. vertexShader: n.vertexShader,
  49754. fragmentShader: n.fragmentShader,
  49755. morphTargets: a,
  49756. skinning: s
  49757. });
  49758. f[o] = c
  49759. }
  49760. var q = this;
  49761. this.enabled = !1,
  49762. this.autoUpdate = !0,
  49763. this.needsUpdate = !1,
  49764. this.type = Ci.PCFShadowMap,
  49765. this.cullFace = Ci.CullFaceFront,
  49766. this.render = function(e, t) {
  49767. var i, n, r = O.shadows;
  49768. if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
  49769. B.clearColor(1, 1, 1, 1),
  49770. B.disable(F.BLEND),
  49771. B.enable(F.CULL_FACE),
  49772. F.frontFace(F.CCW),
  49773. F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
  49774. B.setDepthTest(!0),
  49775. B.setScissorTest(!1);
  49776. for (var o = 0, a = r.length; o < a; o++) {
  49777. var s = r[o]
  49778. , l = s.shadow
  49779. , c = l.camera;
  49780. if (U.copy(l.mapSize),
  49781. s instanceof Ci.PointLight) {
  49782. i = 6,
  49783. n = !0;
  49784. var h = U.x
  49785. , u = U.y;
  49786. Y[0].set(2 * h, u, h, u),
  49787. Y[1].set(0, u, h, u),
  49788. Y[2].set(3 * h, u, h, u),
  49789. Y[3].set(h, u, h, u),
  49790. Y[4].set(3 * h, 0, h, u),
  49791. Y[5].set(h, 0, h, u),
  49792. U.x *= 4,
  49793. U.y *= 2
  49794. } else
  49795. n = !(i = 1);
  49796. if (null === l.map) {
  49797. var d = {
  49798. minFilter: Ci.NearestFilter,
  49799. magFilter: Ci.NearestFilter,
  49800. format: Ci.RGBAFormat
  49801. };
  49802. l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
  49803. s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
  49804. c.updateProjectionMatrix()
  49805. }
  49806. var p = l.map
  49807. , f = l.matrix;
  49808. z.setFromMatrixPosition(s.matrixWorld),
  49809. c.position.copy(z),
  49810. P.setRenderTarget(p),
  49811. P.clear();
  49812. for (var g = 0; g < i; g++) {
  49813. if (n) {
  49814. H.copy(c.position),
  49815. H.add(W[g]),
  49816. c.up.copy(j[g]),
  49817. c.lookAt(H);
  49818. var m = Y[g];
  49819. B.viewport(m)
  49820. } else
  49821. H.setFromMatrixPosition(s.target.matrixWorld),
  49822. c.lookAt(H);
  49823. c.updateMatrixWorld(),
  49824. c.matrixWorldInverse.getInverse(c.matrixWorld),
  49825. f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  49826. f.multiply(c.projectionMatrix),
  49827. f.multiply(c.matrixWorldInverse),
  49828. k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
  49829. V.setFromMatrix(k),
  49830. G.length = 0,
  49831. N(e, t, c);
  49832. for (var v = 0, y = G.length; v < y; v++) {
  49833. var A = G[v]
  49834. , C = L.update(A)
  49835. , I = A.material;
  49836. if (I instanceof Ci.MultiMaterial)
  49837. for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
  49838. var T = E[b]
  49839. , x = _[T.materialIndex];
  49840. if (!0 === x.visible) {
  49841. var S = D(A, x, n, z);
  49842. P.renderBufferDirect(c, null, C, S, A, T)
  49843. }
  49844. }
  49845. else {
  49846. S = D(A, I, n, z);
  49847. P.renderBufferDirect(c, null, C, S, A, null)
  49848. }
  49849. }
  49850. }
  49851. }
  49852. var M = P.getClearColor()
  49853. , R = P.getClearAlpha();
  49854. P.setClearColor(M, R),
  49855. B.enable(F.BLEND),
  49856. q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
  49857. q.needsUpdate = !1
  49858. }
  49859. }
  49860. }
  49861. ,
  49862. Ci.WebGLState = function(l, i, c) {
  49863. var n = this
  49864. , r = new Ci.Vector4
  49865. , o = new Uint8Array(16)
  49866. , a = new Uint8Array(16)
  49867. , s = new Uint8Array(16)
  49868. , t = {}
  49869. , h = null
  49870. , u = null
  49871. , d = null
  49872. , p = null
  49873. , f = null
  49874. , g = null
  49875. , m = null
  49876. , v = null
  49877. , y = !1
  49878. , A = null
  49879. , C = null
  49880. , I = null
  49881. , E = null
  49882. , _ = null
  49883. , b = null
  49884. , w = null
  49885. , T = null
  49886. , x = null
  49887. , S = null
  49888. , M = null
  49889. , R = null
  49890. , P = null
  49891. , O = null
  49892. , L = null
  49893. , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
  49894. , N = void 0
  49895. , F = {}
  49896. , B = new Ci.Vector4
  49897. , V = null
  49898. , k = null
  49899. , U = new Ci.Vector4
  49900. , H = new Ci.Vector4
  49901. , z = l.createTexture();
  49902. l.bindTexture(l.TEXTURE_2D, z),
  49903. l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
  49904. l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
  49905. this.init = function() {
  49906. this.clearColor(0, 0, 0, 1),
  49907. this.clearDepth(1),
  49908. this.clearStencil(0),
  49909. this.enable(l.DEPTH_TEST),
  49910. l.depthFunc(l.LEQUAL),
  49911. l.frontFace(l.CCW),
  49912. l.cullFace(l.BACK),
  49913. this.enable(l.CULL_FACE),
  49914. this.enable(l.BLEND),
  49915. l.blendEquation(l.FUNC_ADD),
  49916. l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
  49917. }
  49918. ,
  49919. this.initAttributes = function() {
  49920. for (var e = 0, t = o.length; e < t; e++)
  49921. o[e] = 0
  49922. }
  49923. ,
  49924. this.enableAttribute = function(e) {
  49925. o[e] = 1,
  49926. 0 === a[e] && (l.enableVertexAttribArray(e),
  49927. a[e] = 1),
  49928. 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
  49929. s[e] = 0)
  49930. }
  49931. ,
  49932. this.enableAttributeAndDivisor = function(e, t, i) {
  49933. o[e] = 1,
  49934. 0 === a[e] && (l.enableVertexAttribArray(e),
  49935. a[e] = 1),
  49936. s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
  49937. s[e] = t)
  49938. }
  49939. ,
  49940. this.disableUnusedAttributes = function() {
  49941. for (var e = 0, t = a.length; e < t; e++)
  49942. a[e] !== o[e] && (l.disableVertexAttribArray(e),
  49943. a[e] = 0)
  49944. }
  49945. ,
  49946. this.enable = function(e) {
  49947. !0 !== t[e] && (l.enable(e),
  49948. t[e] = !0)
  49949. }
  49950. ,
  49951. this.disable = function(e) {
  49952. !1 !== t[e] && (l.disable(e),
  49953. t[e] = !1)
  49954. }
  49955. ,
  49956. this.getCompressedTextureFormats = function() {
  49957. if (null === h && (h = [],
  49958. i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
  49959. for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
  49960. h.push(e[t]);
  49961. return h
  49962. }
  49963. ,
  49964. this.setBlending = function(e, t, i, n, r, o, a, s) {
  49965. e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
  49966. e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  49967. l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
  49968. l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  49969. l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  49970. l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  49971. l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
  49972. l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  49973. l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
  49974. l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
  49975. u = e,
  49976. y = s),
  49977. e === Ci.CustomBlending ? (r = r || t,
  49978. o = o || i,
  49979. a = a || n,
  49980. t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
  49981. d = t,
  49982. g = r),
  49983. i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
  49984. p = i,
  49985. f = n,
  49986. m = o,
  49987. v = a)) : v = m = g = f = p = d = null
  49988. }
  49989. ,
  49990. this.setDepthFunc = function(e) {
  49991. if (A !== e) {
  49992. if (e)
  49993. switch (e) {
  49994. case Ci.NeverDepth:
  49995. l.depthFunc(l.NEVER);
  49996. break;
  49997. case Ci.AlwaysDepth:
  49998. l.depthFunc(l.ALWAYS);
  49999. break;
  50000. case Ci.LessDepth:
  50001. l.depthFunc(l.LESS);
  50002. break;
  50003. case Ci.LessEqualDepth:
  50004. l.depthFunc(l.LEQUAL);
  50005. break;
  50006. case Ci.EqualDepth:
  50007. l.depthFunc(l.EQUAL);
  50008. break;
  50009. case Ci.GreaterEqualDepth:
  50010. l.depthFunc(l.GEQUAL);
  50011. break;
  50012. case Ci.GreaterDepth:
  50013. l.depthFunc(l.GREATER);
  50014. break;
  50015. case Ci.NotEqualDepth:
  50016. l.depthFunc(l.NOTEQUAL);
  50017. break;
  50018. default:
  50019. l.depthFunc(l.LEQUAL)
  50020. }
  50021. else
  50022. l.depthFunc(l.LEQUAL);
  50023. A = e
  50024. }
  50025. }
  50026. ,
  50027. this.setDepthTest = function(e) {
  50028. e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
  50029. }
  50030. ,
  50031. this.setDepthWrite = function(e) {
  50032. C !== e && (l.depthMask(e),
  50033. C = e)
  50034. }
  50035. ,
  50036. this.setColorWrite = function(e) {
  50037. I !== e && (l.colorMask(e, e, e, e),
  50038. I = e)
  50039. }
  50040. ,
  50041. this.setStencilFunc = function(e, t, i) {
  50042. _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
  50043. _ = e,
  50044. b = t,
  50045. w = i)
  50046. }
  50047. ,
  50048. this.setStencilOp = function(e, t, i) {
  50049. T === e && x === t && S === i || (l.stencilOp(e, t, i),
  50050. T = e,
  50051. x = t,
  50052. S = i)
  50053. }
  50054. ,
  50055. this.setStencilTest = function(e) {
  50056. e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
  50057. }
  50058. ,
  50059. this.setStencilWrite = function(e) {
  50060. E !== e && (l.stencilMask(e),
  50061. E = e)
  50062. }
  50063. ,
  50064. this.setFlipSided = function(e) {
  50065. M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
  50066. M = e)
  50067. }
  50068. ,
  50069. this.setLineWidth = function(e) {
  50070. e !== R && (l.lineWidth(e),
  50071. R = e)
  50072. }
  50073. ,
  50074. this.setPolygonOffset = function(e, t, i) {
  50075. e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
  50076. !e || P === t && O === i || (l.polygonOffset(t, i),
  50077. P = t,
  50078. O = i)
  50079. }
  50080. ,
  50081. this.getScissorTest = function() {
  50082. return L
  50083. }
  50084. ,
  50085. this.setScissorTest = function(e) {
  50086. (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
  50087. }
  50088. ,
  50089. this.activeTexture = function(e) {
  50090. void 0 === e && (e = l.TEXTURE0 + D - 1),
  50091. N !== e && (l.activeTexture(e),
  50092. N = e)
  50093. }
  50094. ,
  50095. this.bindTexture = function(e, t) {
  50096. void 0 === N && n.activeTexture();
  50097. var i = F[N];
  50098. void 0 === i && (i = {
  50099. type: void 0,
  50100. texture: void 0
  50101. },
  50102. F[N] = i),
  50103. i.type === e && i.texture === t || (l.bindTexture(e, t || z),
  50104. i.type = e,
  50105. i.texture = t)
  50106. }
  50107. ,
  50108. this.compressedTexImage2D = function() {
  50109. try {
  50110. l.compressedTexImage2D.apply(l, arguments)
  50111. } catch (e) {
  50112. console.error(e)
  50113. }
  50114. }
  50115. ,
  50116. this.texImage2D = function() {
  50117. try {
  50118. l.texImage2D.apply(l, arguments)
  50119. } catch (e) {
  50120. console.error(e)
  50121. }
  50122. }
  50123. ,
  50124. this.clearColor = function(e, t, i, n) {
  50125. r.set(e, t, i, n),
  50126. !1 === B.equals(r) && (l.clearColor(e, t, i, n),
  50127. B.copy(r))
  50128. }
  50129. ,
  50130. this.clearDepth = function(e) {
  50131. V !== e && (l.clearDepth(e),
  50132. V = e)
  50133. }
  50134. ,
  50135. this.clearStencil = function(e) {
  50136. k !== e && (l.clearStencil(e),
  50137. k = e)
  50138. }
  50139. ,
  50140. this.scissor = function(e) {
  50141. !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
  50142. U.copy(e))
  50143. }
  50144. ,
  50145. this.viewport = function(e) {
  50146. !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
  50147. H.copy(e))
  50148. }
  50149. ,
  50150. this.reset = function() {
  50151. for (var e = 0; e < a.length; e++)
  50152. 1 === a[e] && (l.disableVertexAttribArray(e),
  50153. a[e] = 0);
  50154. t = {},
  50155. N = void 0,
  50156. F = {},
  50157. M = E = C = I = u = h = null
  50158. }
  50159. }
  50160. ,
  50161. Ci.LensFlarePlugin = function(v, y) {
  50162. function A() {
  50163. 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]);
  50164. C = S.createBuffer(),
  50165. I = S.createBuffer(),
  50166. S.bindBuffer(S.ARRAY_BUFFER, C),
  50167. S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
  50168. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50169. S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
  50170. T = S.createTexture(),
  50171. x = S.createTexture(),
  50172. M.bindTexture(S.TEXTURE_2D, T),
  50173. S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
  50174. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50175. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50176. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50177. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50178. M.bindTexture(S.TEXTURE_2D, x),
  50179. S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
  50180. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
  50181. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
  50182. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
  50183. S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
  50184. e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
  50185. 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"),
  50186. 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")
  50187. } : {
  50188. 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"),
  50189. 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")
  50190. },
  50191. E = function(e) {
  50192. var t = S.createProgram()
  50193. , i = S.createShader(S.FRAGMENT_SHADER)
  50194. , n = S.createShader(S.VERTEX_SHADER)
  50195. , r = "precision " + v.getPrecision() + " float;\n";
  50196. return S.shaderSource(i, r + e.fragmentShader),
  50197. S.shaderSource(n, r + e.vertexShader),
  50198. S.compileShader(i),
  50199. S.compileShader(n),
  50200. S.attachShader(t, i),
  50201. S.attachShader(t, n),
  50202. S.linkProgram(t),
  50203. t
  50204. }(e),
  50205. _ = {
  50206. vertex: S.getAttribLocation(E, "position"),
  50207. uv: S.getAttribLocation(E, "uv")
  50208. },
  50209. b = {
  50210. renderType: S.getUniformLocation(E, "renderType"),
  50211. map: S.getUniformLocation(E, "map"),
  50212. occlusionMap: S.getUniformLocation(E, "occlusionMap"),
  50213. opacity: S.getUniformLocation(E, "opacity"),
  50214. color: S.getUniformLocation(E, "color"),
  50215. scale: S.getUniformLocation(E, "scale"),
  50216. rotation: S.getUniformLocation(E, "rotation"),
  50217. screenPosition: S.getUniformLocation(E, "screenPosition")
  50218. }
  50219. }
  50220. var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
  50221. this.render = function(e, t, i) {
  50222. if (0 !== y.length) {
  50223. var n = new Ci.Vector3
  50224. , r = i.w / i.z
  50225. , o = .5 * i.z
  50226. , a = .5 * i.w
  50227. , s = 16 / i.w
  50228. , l = new Ci.Vector2(s * r,s)
  50229. , c = new Ci.Vector3(1,1,0)
  50230. , h = new Ci.Vector2(1,1);
  50231. void 0 === E && A(),
  50232. S.useProgram(E),
  50233. M.initAttributes(),
  50234. M.enableAttribute(_.vertex),
  50235. M.enableAttribute(_.uv),
  50236. M.disableUnusedAttributes(),
  50237. S.uniform1i(b.occlusionMap, 0),
  50238. S.uniform1i(b.map, 1),
  50239. S.bindBuffer(S.ARRAY_BUFFER, C),
  50240. S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
  50241. S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
  50242. S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
  50243. M.disable(S.CULL_FACE),
  50244. M.setDepthWrite(!1);
  50245. for (var u = 0, d = y.length; u < d; u++) {
  50246. s = 16 / i.w,
  50247. l.set(s * r, s);
  50248. var p = y[u];
  50249. if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
  50250. n.applyMatrix4(t.matrixWorldInverse),
  50251. n.applyProjection(t.projectionMatrix),
  50252. c.copy(n),
  50253. h.x = c.x * o + o,
  50254. h.y = c.y * a + a,
  50255. w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
  50256. M.activeTexture(S.TEXTURE0),
  50257. M.bindTexture(S.TEXTURE_2D, null),
  50258. M.activeTexture(S.TEXTURE1),
  50259. M.bindTexture(S.TEXTURE_2D, T),
  50260. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50261. S.uniform1i(b.renderType, 0),
  50262. S.uniform2f(b.scale, l.x, l.y),
  50263. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50264. M.disable(S.BLEND),
  50265. M.enable(S.DEPTH_TEST),
  50266. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50267. M.activeTexture(S.TEXTURE0),
  50268. M.bindTexture(S.TEXTURE_2D, x),
  50269. S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
  50270. S.uniform1i(b.renderType, 1),
  50271. M.disable(S.DEPTH_TEST),
  50272. M.activeTexture(S.TEXTURE1),
  50273. M.bindTexture(S.TEXTURE_2D, T),
  50274. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
  50275. p.positionScreen.copy(c),
  50276. p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
  50277. S.uniform1i(b.renderType, 2),
  50278. M.enable(S.BLEND);
  50279. for (var f = 0, g = p.lensFlares.length; f < g; f++) {
  50280. var m = p.lensFlares[f];
  50281. .001 < m.opacity && .001 < m.scale && (c.x = m.x,
  50282. c.y = m.y,
  50283. c.z = m.z,
  50284. s = m.size * m.scale / i.w,
  50285. l.x = s * r,
  50286. l.y = s,
  50287. S.uniform3f(b.screenPosition, c.x, c.y, c.z),
  50288. S.uniform2f(b.scale, l.x, l.y),
  50289. S.uniform1f(b.rotation, m.rotation),
  50290. S.uniform1f(b.opacity, m.opacity),
  50291. S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
  50292. M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
  50293. v.setTexture(m.texture, 1),
  50294. S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
  50295. }
  50296. }
  50297. }
  50298. M.enable(S.CULL_FACE),
  50299. M.enable(S.DEPTH_TEST),
  50300. M.setDepthWrite(!0),
  50301. v.resetGLState()
  50302. }
  50303. }
  50304. }
  50305. ,
  50306. Ci.SpritePlugin = function(u, d) {
  50307. function p() {
  50308. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  50309. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  50310. g = I.createBuffer(),
  50311. m = I.createBuffer(),
  50312. I.bindBuffer(I.ARRAY_BUFFER, g),
  50313. I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
  50314. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50315. I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
  50316. v = function() {
  50317. var e = I.createProgram()
  50318. , t = I.createShader(I.VERTEX_SHADER)
  50319. , i = I.createShader(I.FRAGMENT_SHADER);
  50320. 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")),
  50321. 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")),
  50322. I.compileShader(t),
  50323. I.compileShader(i),
  50324. I.attachShader(e, t),
  50325. I.attachShader(e, i),
  50326. I.linkProgram(e),
  50327. e
  50328. }(),
  50329. y = {
  50330. position: I.getAttribLocation(v, "position"),
  50331. uv: I.getAttribLocation(v, "uv")
  50332. },
  50333. A = {
  50334. uvOffset: I.getUniformLocation(v, "uvOffset"),
  50335. uvScale: I.getUniformLocation(v, "uvScale"),
  50336. rotation: I.getUniformLocation(v, "rotation"),
  50337. scale: I.getUniformLocation(v, "scale"),
  50338. color: I.getUniformLocation(v, "color"),
  50339. map: I.getUniformLocation(v, "map"),
  50340. opacity: I.getUniformLocation(v, "opacity"),
  50341. modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
  50342. projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
  50343. fogType: I.getUniformLocation(v, "fogType"),
  50344. fogDensity: I.getUniformLocation(v, "fogDensity"),
  50345. fogNear: I.getUniformLocation(v, "fogNear"),
  50346. fogFar: I.getUniformLocation(v, "fogFar"),
  50347. fogColor: I.getUniformLocation(v, "fogColor"),
  50348. alphaTest: I.getUniformLocation(v, "alphaTest")
  50349. };
  50350. var i = document.createElement("canvas");
  50351. i.width = 8,
  50352. i.height = 8;
  50353. var n = i.getContext("2d");
  50354. n.fillStyle = "white",
  50355. n.fillRect(0, 0, 8, 8),
  50356. (C = new Ci.Texture(i)).needsUpdate = !0
  50357. }
  50358. function f(e, t) {
  50359. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  50360. }
  50361. var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
  50362. this.render = function(e, t) {
  50363. if (0 !== d.length) {
  50364. void 0 === v && p(),
  50365. I.useProgram(v),
  50366. E.initAttributes(),
  50367. E.enableAttribute(y.position),
  50368. E.enableAttribute(y.uv),
  50369. E.disableUnusedAttributes(),
  50370. E.disable(I.CULL_FACE),
  50371. E.enable(I.BLEND),
  50372. I.bindBuffer(I.ARRAY_BUFFER, g),
  50373. I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
  50374. I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
  50375. I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
  50376. I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
  50377. E.activeTexture(I.TEXTURE0),
  50378. I.uniform1i(A.map, 0);
  50379. var i = 0
  50380. , n = 0
  50381. , r = e.fog;
  50382. r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
  50383. r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
  50384. I.uniform1f(A.fogFar, r.far),
  50385. I.uniform1i(A.fogType, 1),
  50386. n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
  50387. I.uniform1i(A.fogType, 2),
  50388. n = i = 2)) : (I.uniform1i(A.fogType, 0),
  50389. n = i = 0);
  50390. for (var o = 0, a = d.length; o < a; o++) {
  50391. (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  50392. l.z = -l.modelViewMatrix.elements[14]
  50393. }
  50394. d.sort(f);
  50395. var s = [];
  50396. for (o = 0,
  50397. a = d.length; o < a; o++) {
  50398. var l, c = (l = d[o]).material;
  50399. I.uniform1f(A.alphaTest, c.alphaTest),
  50400. I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
  50401. l.matrixWorld.decompose(_, b, w),
  50402. s[0] = w.x,
  50403. s[1] = w.y;
  50404. var h = 0;
  50405. e.fog && c.fog && (h = n),
  50406. i !== h && (I.uniform1i(A.fogType, h),
  50407. i = h),
  50408. null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
  50409. I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
  50410. I.uniform2f(A.uvScale, 1, 1)),
  50411. I.uniform1f(A.opacity, c.opacity),
  50412. I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
  50413. I.uniform1f(A.rotation, c.rotation),
  50414. I.uniform2fv(A.scale, s),
  50415. E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
  50416. E.setDepthTest(c.depthTest),
  50417. E.setDepthWrite(c.depthWrite),
  50418. c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
  50419. I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
  50420. }
  50421. E.enable(I.CULL_FACE),
  50422. u.resetGLState()
  50423. }
  50424. }
  50425. }
  50426. ,
  50427. Object.defineProperties(Ci.Box2.prototype, {
  50428. empty: {
  50429. value: function() {
  50430. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  50431. this.isEmpty()
  50432. }
  50433. },
  50434. isIntersectionBox: {
  50435. value: function(e) {
  50436. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50437. this.intersectsBox(e)
  50438. }
  50439. }
  50440. }),
  50441. Object.defineProperties(Ci.Box3.prototype, {
  50442. empty: {
  50443. value: function() {
  50444. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  50445. this.isEmpty()
  50446. }
  50447. },
  50448. isIntersectionBox: {
  50449. value: function(e) {
  50450. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50451. this.intersectsBox(e)
  50452. }
  50453. },
  50454. isIntersectionSphere: {
  50455. value: function(e) {
  50456. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  50457. this.intersectsSphere(e)
  50458. }
  50459. }
  50460. }),
  50461. Object.defineProperties(Ci.Matrix3.prototype, {
  50462. multiplyVector3: {
  50463. value: function(e) {
  50464. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  50465. e.applyMatrix3(this)
  50466. }
  50467. },
  50468. multiplyVector3Array: {
  50469. value: function(e) {
  50470. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  50471. this.applyToVector3Array(e)
  50472. }
  50473. }
  50474. }),
  50475. Object.defineProperties(Ci.Matrix4.prototype, {
  50476. extractPosition: {
  50477. value: function(e) {
  50478. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  50479. this.copyPosition(e)
  50480. }
  50481. },
  50482. setRotationFromQuaternion: {
  50483. value: function(e) {
  50484. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  50485. this.makeRotationFromQuaternion(e)
  50486. }
  50487. },
  50488. multiplyVector3: {
  50489. value: function(e) {
  50490. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  50491. e.applyProjection(this)
  50492. }
  50493. },
  50494. multiplyVector4: {
  50495. value: function(e) {
  50496. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  50497. e.applyMatrix4(this)
  50498. }
  50499. },
  50500. multiplyVector3Array: {
  50501. value: function(e) {
  50502. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  50503. this.applyToVector3Array(e)
  50504. }
  50505. },
  50506. rotateAxis: {
  50507. value: function(e) {
  50508. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  50509. e.transformDirection(this)
  50510. }
  50511. },
  50512. crossVector: {
  50513. value: function(e) {
  50514. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  50515. e.applyMatrix4(this)
  50516. }
  50517. },
  50518. translate: {
  50519. value: function(e) {
  50520. console.error("THREE.Matrix4: .translate() has been removed.")
  50521. }
  50522. },
  50523. rotateX: {
  50524. value: function(e) {
  50525. console.error("THREE.Matrix4: .rotateX() has been removed.")
  50526. }
  50527. },
  50528. rotateY: {
  50529. value: function(e) {
  50530. console.error("THREE.Matrix4: .rotateY() has been removed.")
  50531. }
  50532. },
  50533. rotateZ: {
  50534. value: function(e) {
  50535. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  50536. }
  50537. },
  50538. rotateByAxis: {
  50539. value: function(e, t) {
  50540. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  50541. }
  50542. }
  50543. }),
  50544. Object.defineProperties(Ci.Plane.prototype, {
  50545. isIntersectionLine: {
  50546. value: function(e) {
  50547. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  50548. this.intersectsLine(e)
  50549. }
  50550. }
  50551. }),
  50552. Object.defineProperties(Ci.Quaternion.prototype, {
  50553. multiplyVector3: {
  50554. value: function(e) {
  50555. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  50556. e.applyQuaternion(this)
  50557. }
  50558. }
  50559. }),
  50560. Object.defineProperties(Ci.Ray.prototype, {
  50561. isIntersectionBox: {
  50562. value: function(e) {
  50563. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  50564. this.intersectsBox(e)
  50565. }
  50566. },
  50567. isIntersectionPlane: {
  50568. value: function(e) {
  50569. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  50570. this.intersectsPlane(e)
  50571. }
  50572. },
  50573. isIntersectionSphere: {
  50574. value: function(e) {
  50575. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  50576. this.intersectsSphere(e)
  50577. }
  50578. }
  50579. }),
  50580. Object.defineProperties(Ci.Vector3.prototype, {
  50581. setEulerFromRotationMatrix: {
  50582. value: function() {
  50583. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  50584. }
  50585. },
  50586. setEulerFromQuaternion: {
  50587. value: function() {
  50588. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  50589. }
  50590. },
  50591. getPositionFromMatrix: {
  50592. value: function(e) {
  50593. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  50594. this.setFromMatrixPosition(e)
  50595. }
  50596. },
  50597. getScaleFromMatrix: {
  50598. value: function(e) {
  50599. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  50600. this.setFromMatrixScale(e)
  50601. }
  50602. },
  50603. getColumnFromMatrix: {
  50604. value: function(e, t) {
  50605. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  50606. this.setFromMatrixColumn(e, t)
  50607. }
  50608. }
  50609. }),
  50610. Ci.Face4 = function(e, t, i, n, r, o, a) {
  50611. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  50612. new Ci.Face3(e,t,i,r,o,a)
  50613. }
  50614. ,
  50615. Ci.Vertex = function(e, t, i) {
  50616. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  50617. new Ci.Vector3(e,t,i)
  50618. }
  50619. ,
  50620. Object.defineProperties(Ci.Object3D.prototype, {
  50621. eulerOrder: {
  50622. get: function() {
  50623. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  50624. this.rotation.order
  50625. },
  50626. set: function(e) {
  50627. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  50628. this.rotation.order = e
  50629. }
  50630. },
  50631. getChildByName: {
  50632. value: function(e) {
  50633. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  50634. this.getObjectByName(e)
  50635. }
  50636. },
  50637. renderDepth: {
  50638. set: function(e) {
  50639. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  50640. }
  50641. },
  50642. translate: {
  50643. value: function(e, t) {
  50644. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  50645. this.translateOnAxis(t, e)
  50646. }
  50647. },
  50648. useQuaternion: {
  50649. get: function() {
  50650. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  50651. },
  50652. set: function(e) {
  50653. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  50654. }
  50655. }
  50656. }),
  50657. Object.defineProperties(Ci, {
  50658. PointCloud: {
  50659. value: function(e, t) {
  50660. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  50661. new Ci.Points(e,t)
  50662. }
  50663. },
  50664. ParticleSystem: {
  50665. value: function(e, t) {
  50666. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  50667. new Ci.Points(e,t)
  50668. }
  50669. }
  50670. }),
  50671. Object.defineProperties(Ci.Light.prototype, {
  50672. onlyShadow: {
  50673. set: function(e) {
  50674. console.warn("THREE.Light: .onlyShadow has been removed.")
  50675. }
  50676. },
  50677. shadowCameraFov: {
  50678. set: function(e) {
  50679. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  50680. this.shadow.camera.fov = e
  50681. }
  50682. },
  50683. shadowCameraLeft: {
  50684. set: function(e) {
  50685. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  50686. this.shadow.camera.left = e
  50687. }
  50688. },
  50689. shadowCameraRight: {
  50690. set: function(e) {
  50691. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  50692. this.shadow.camera.right = e
  50693. }
  50694. },
  50695. shadowCameraTop: {
  50696. set: function(e) {
  50697. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  50698. this.shadow.camera.top = e
  50699. }
  50700. },
  50701. shadowCameraBottom: {
  50702. set: function(e) {
  50703. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  50704. this.shadow.camera.bottom = e
  50705. }
  50706. },
  50707. shadowCameraNear: {
  50708. set: function(e) {
  50709. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  50710. this.shadow.camera.near = e
  50711. }
  50712. },
  50713. shadowCameraFar: {
  50714. set: function(e) {
  50715. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  50716. this.shadow.camera.far = e
  50717. }
  50718. },
  50719. shadowCameraVisible: {
  50720. set: function(e) {
  50721. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  50722. }
  50723. },
  50724. shadowBias: {
  50725. set: function(e) {
  50726. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  50727. this.shadow.bias = e
  50728. }
  50729. },
  50730. shadowDarkness: {
  50731. set: function(e) {
  50732. console.warn("THREE.Light: .shadowDarkness has been removed.")
  50733. }
  50734. },
  50735. shadowMapWidth: {
  50736. set: function(e) {
  50737. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  50738. this.shadow.mapSize.width = e
  50739. }
  50740. },
  50741. shadowMapHeight: {
  50742. set: function(e) {
  50743. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  50744. this.shadow.mapSize.height = e
  50745. }
  50746. }
  50747. }),
  50748. Object.defineProperties(Ci.BufferAttribute.prototype, {
  50749. length: {
  50750. get: function() {
  50751. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  50752. this.array.length
  50753. }
  50754. }
  50755. }),
  50756. Object.defineProperties(Ci.BufferGeometry.prototype, {
  50757. drawcalls: {
  50758. get: function() {
  50759. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  50760. this.groups
  50761. }
  50762. },
  50763. offsets: {
  50764. get: function() {
  50765. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  50766. this.groups
  50767. }
  50768. },
  50769. addIndex: {
  50770. value: function(e) {
  50771. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  50772. this.setIndex(e)
  50773. }
  50774. },
  50775. addDrawCall: {
  50776. value: function(e, t, i) {
  50777. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  50778. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  50779. this.addGroup(e, t)
  50780. }
  50781. },
  50782. clearDrawCalls: {
  50783. value: function() {
  50784. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  50785. this.clearGroups()
  50786. }
  50787. },
  50788. computeTangents: {
  50789. value: function() {
  50790. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  50791. }
  50792. },
  50793. computeOffsets: {
  50794. value: function() {
  50795. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  50796. }
  50797. }
  50798. }),
  50799. Object.defineProperties(Ci.Material.prototype, {
  50800. wrapAround: {
  50801. get: function() {
  50802. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  50803. },
  50804. set: function(e) {
  50805. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  50806. }
  50807. },
  50808. wrapRGB: {
  50809. get: function() {
  50810. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  50811. new Ci.Color
  50812. }
  50813. }
  50814. }),
  50815. Object.defineProperties(Ci, {
  50816. PointCloudMaterial: {
  50817. value: function(e) {
  50818. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  50819. new Ci.PointsMaterial(e)
  50820. }
  50821. },
  50822. ParticleBasicMaterial: {
  50823. value: function(e) {
  50824. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  50825. new Ci.PointsMaterial(e)
  50826. }
  50827. },
  50828. ParticleSystemMaterial: {
  50829. value: function(e) {
  50830. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  50831. new Ci.PointsMaterial(e)
  50832. }
  50833. }
  50834. }),
  50835. Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
  50836. metal: {
  50837. get: function() {
  50838. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  50839. !1
  50840. },
  50841. set: function(e) {
  50842. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  50843. }
  50844. }
  50845. }),
  50846. Object.defineProperties(Ci.ShaderMaterial.prototype, {
  50847. derivatives: {
  50848. get: function() {
  50849. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  50850. this.extensions.derivatives
  50851. },
  50852. set: function(e) {
  50853. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  50854. this.extensions.derivatives = e
  50855. }
  50856. }
  50857. }),
  50858. Object.defineProperties(Ci.WebGLRenderer.prototype, {
  50859. supportsFloatTextures: {
  50860. value: function() {
  50861. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  50862. this.extensions.get("OES_texture_float")
  50863. }
  50864. },
  50865. supportsHalfFloatTextures: {
  50866. value: function() {
  50867. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  50868. this.extensions.get("OES_texture_half_float")
  50869. }
  50870. },
  50871. supportsStandardDerivatives: {
  50872. value: function() {
  50873. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  50874. this.extensions.get("OES_standard_derivatives")
  50875. }
  50876. },
  50877. supportsCompressedTextureS3TC: {
  50878. value: function() {
  50879. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  50880. this.extensions.get("WEBGL_compressed_texture_s3tc")
  50881. }
  50882. },
  50883. supportsCompressedTexturePVRTC: {
  50884. value: function() {
  50885. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  50886. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  50887. }
  50888. },
  50889. supportsBlendMinMax: {
  50890. value: function() {
  50891. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  50892. this.extensions.get("EXT_blend_minmax")
  50893. }
  50894. },
  50895. supportsVertexTextures: {
  50896. value: function() {
  50897. return this.capabilities.vertexTextures
  50898. }
  50899. },
  50900. supportsInstancedArrays: {
  50901. value: function() {
  50902. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  50903. this.extensions.get("ANGLE_instanced_arrays")
  50904. }
  50905. },
  50906. enableScissorTest: {
  50907. value: function(e) {
  50908. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  50909. this.setScissorTest(e)
  50910. }
  50911. },
  50912. initMaterial: {
  50913. value: function() {
  50914. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  50915. }
  50916. },
  50917. addPrePlugin: {
  50918. value: function() {
  50919. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  50920. }
  50921. },
  50922. addPostPlugin: {
  50923. value: function() {
  50924. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  50925. }
  50926. },
  50927. updateShadowMap: {
  50928. value: function() {
  50929. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  50930. }
  50931. },
  50932. shadowMapEnabled: {
  50933. get: function() {
  50934. return this.shadowMap.enabled
  50935. },
  50936. set: function(e) {
  50937. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  50938. this.shadowMap.enabled = e
  50939. }
  50940. },
  50941. shadowMapType: {
  50942. get: function() {
  50943. return this.shadowMap.type
  50944. },
  50945. set: function(e) {
  50946. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  50947. this.shadowMap.type = e
  50948. }
  50949. },
  50950. shadowMapCullFace: {
  50951. get: function() {
  50952. return this.shadowMap.cullFace
  50953. },
  50954. set: function(e) {
  50955. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  50956. this.shadowMap.cullFace = e
  50957. }
  50958. }
  50959. }),
  50960. Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
  50961. wrapS: {
  50962. get: function() {
  50963. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  50964. this.texture.wrapS
  50965. },
  50966. set: function(e) {
  50967. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  50968. this.texture.wrapS = e
  50969. }
  50970. },
  50971. wrapT: {
  50972. get: function() {
  50973. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  50974. this.texture.wrapT
  50975. },
  50976. set: function(e) {
  50977. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  50978. this.texture.wrapT = e
  50979. }
  50980. },
  50981. magFilter: {
  50982. get: function() {
  50983. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  50984. this.texture.magFilter
  50985. },
  50986. set: function(e) {
  50987. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  50988. this.texture.magFilter = e
  50989. }
  50990. },
  50991. minFilter: {
  50992. get: function() {
  50993. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  50994. this.texture.minFilter
  50995. },
  50996. set: function(e) {
  50997. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  50998. this.texture.minFilter = e
  50999. }
  51000. },
  51001. anisotropy: {
  51002. get: function() {
  51003. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51004. this.texture.anisotropy
  51005. },
  51006. set: function(e) {
  51007. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  51008. this.texture.anisotropy = e
  51009. }
  51010. },
  51011. offset: {
  51012. get: function() {
  51013. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51014. this.texture.offset
  51015. },
  51016. set: function(e) {
  51017. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  51018. this.texture.offset = e
  51019. }
  51020. },
  51021. repeat: {
  51022. get: function() {
  51023. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51024. this.texture.repeat
  51025. },
  51026. set: function(e) {
  51027. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  51028. this.texture.repeat = e
  51029. }
  51030. },
  51031. format: {
  51032. get: function() {
  51033. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51034. this.texture.format
  51035. },
  51036. set: function(e) {
  51037. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  51038. this.texture.format = e
  51039. }
  51040. },
  51041. type: {
  51042. get: function() {
  51043. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51044. this.texture.type
  51045. },
  51046. set: function(e) {
  51047. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  51048. this.texture.type = e
  51049. }
  51050. },
  51051. generateMipmaps: {
  51052. get: function() {
  51053. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51054. this.texture.generateMipmaps
  51055. },
  51056. set: function(e) {
  51057. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  51058. this.texture.generateMipmaps = e
  51059. }
  51060. }
  51061. }),
  51062. Ci.GeometryUtils = {
  51063. merge: function(e, t, i) {
  51064. var n;
  51065. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
  51066. t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  51067. n = t.matrix,
  51068. t = t.geometry),
  51069. e.merge(t, n, i)
  51070. },
  51071. center: function(e) {
  51072. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  51073. e.center()
  51074. }
  51075. },
  51076. Ci.ImageUtils = {
  51077. crossOrigin: void 0,
  51078. loadTexture: function(e, t, i, n) {
  51079. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  51080. var r = new Ci.TextureLoader;
  51081. r.setCrossOrigin(this.crossOrigin);
  51082. var o = r.load(e, i, void 0, n);
  51083. return t && (o.mapping = t),
  51084. o
  51085. },
  51086. loadTextureCube: function(e, t, i, n) {
  51087. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  51088. var r = new Ci.CubeTextureLoader;
  51089. r.setCrossOrigin(this.crossOrigin);
  51090. var o = r.load(e, i, void 0, n);
  51091. return t && (o.mapping = t),
  51092. o
  51093. },
  51094. loadCompressedTexture: function() {
  51095. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  51096. },
  51097. loadCompressedTextureCube: function() {
  51098. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  51099. }
  51100. },
  51101. Ci.Projector = function() {
  51102. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  51103. this.projectVector = function(e, t) {
  51104. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  51105. e.project(t)
  51106. }
  51107. ,
  51108. this.unprojectVector = function(e, t) {
  51109. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  51110. e.unproject(t)
  51111. }
  51112. ,
  51113. this.pickingRay = function(e, t) {
  51114. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  51115. }
  51116. }
  51117. ,
  51118. Ci.CanvasRenderer = function() {
  51119. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  51120. this.domElement = document.createElement("canvas"),
  51121. this.clear = function() {}
  51122. ,
  51123. this.render = function() {}
  51124. ,
  51125. this.setClearColor = function() {}
  51126. ,
  51127. this.setSize = function() {}
  51128. }
  51129. ,
  51130. Ci.MeshFaceMaterial = Ci.MultiMaterial,
  51131. Ci.CurveUtils = {
  51132. tangentQuadraticBezier: function(e, t, i, n) {
  51133. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  51134. },
  51135. tangentCubicBezier: function(e, t, i, n, r) {
  51136. 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
  51137. },
  51138. tangentSpline: function(e, t, i, n, r) {
  51139. return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
  51140. },
  51141. interpolate: function(e, t, i, n, r) {
  51142. var o = .5 * (i - e)
  51143. , a = .5 * (n - t)
  51144. , s = r * r;
  51145. return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  51146. }
  51147. },
  51148. Ci.SceneUtils = {
  51149. createMultiMaterialObject: function(e, t) {
  51150. for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
  51151. i.add(new Ci.Mesh(e,t[n]));
  51152. return i
  51153. },
  51154. detach: function(e, t, i) {
  51155. e.applyMatrix(t.matrixWorld),
  51156. t.remove(e),
  51157. i.add(e)
  51158. },
  51159. attach: function(e, t, i) {
  51160. var n = new Ci.Matrix4;
  51161. n.getInverse(i.matrixWorld),
  51162. e.applyMatrix(n),
  51163. t.remove(e),
  51164. i.add(e)
  51165. }
  51166. },
  51167. Ci.ShapeUtils = {
  51168. area: function(e) {
  51169. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  51170. i += e[n].x * e[r].y - e[r].x * e[n].y;
  51171. return .5 * i
  51172. },
  51173. triangulate: function(e, t) {
  51174. var i = e.length;
  51175. if (i < 3)
  51176. return null;
  51177. var n, r, o, a = [], s = [], l = [];
  51178. if (0 < Ci.ShapeUtils.area(e))
  51179. for (r = 0; r < i; r++)
  51180. s[r] = r;
  51181. else
  51182. for (r = 0; r < i; r++)
  51183. s[r] = i - 1 - r;
  51184. var c = i
  51185. , h = 2 * c;
  51186. for (r = c - 1; 2 < c; ) {
  51187. if (h-- <= 0)
  51188. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  51189. t ? l : a;
  51190. if (c <= (n = r) && (n = 0),
  51191. c <= (r = n + 1) && (r = 0),
  51192. c <= (o = r + 1) && (o = 0),
  51193. Si(e, n, r, o, c, s)) {
  51194. var u, d, p, f, g;
  51195. for (u = s[n],
  51196. d = s[r],
  51197. p = s[o],
  51198. a.push([e[u], e[d], e[p]]),
  51199. l.push([s[n], s[r], s[o]]),
  51200. g = (f = r) + 1; g < c; f++,
  51201. g++)
  51202. s[f] = s[g];
  51203. h = 2 * --c
  51204. }
  51205. }
  51206. return t ? l : a
  51207. },
  51208. triangulateShape: function(e, t) {
  51209. function w(e, t, i) {
  51210. 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
  51211. }
  51212. function b(e, t, i, n, r) {
  51213. var o = t.x - e.x
  51214. , a = t.y - e.y
  51215. , s = n.x - i.x
  51216. , l = n.y - i.y
  51217. , c = e.x - i.x
  51218. , h = e.y - i.y
  51219. , u = a * s - o * l
  51220. , d = a * c - o * h;
  51221. if (Math.abs(u) > Number.EPSILON) {
  51222. var p;
  51223. if (0 < u) {
  51224. if (d < 0 || u < d)
  51225. return [];
  51226. if ((p = l * c - s * h) < 0 || u < p)
  51227. return []
  51228. } else {
  51229. if (0 < d || d < u)
  51230. return [];
  51231. if (0 < (p = l * c - s * h) || p < u)
  51232. return []
  51233. }
  51234. if (0 === p)
  51235. return !r || 0 != d && d != u ? [e] : [];
  51236. if (p === u)
  51237. return !r || 0 != d && d != u ? [t] : [];
  51238. if (0 == d)
  51239. return [i];
  51240. if (d == u)
  51241. return [n];
  51242. var f = p / u;
  51243. return [{
  51244. x: e.x + f * o,
  51245. y: e.y + f * a
  51246. }]
  51247. }
  51248. if (0 != d || l * c != s * h)
  51249. return [];
  51250. var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
  51251. 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,
  51252. (m = t).x) : (v = (g = t).x,
  51253. (m = e).x),
  51254. i.x < n.x ? (I = (A = i).x,
  51255. (C = n).x) : (I = (A = n).x,
  51256. (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
  51257. (m = t).y) : (v = (g = t).y,
  51258. (m = e).y),
  51259. i.y < n.y ? (I = (A = i).y,
  51260. (C = n).y) : (I = (A = n).y,
  51261. (C = i).y)),
  51262. 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])
  51263. }
  51264. function T(e, t, i, n) {
  51265. var r = t.x - e.x
  51266. , o = t.y - e.y
  51267. , a = i.x - e.x
  51268. , s = i.y - e.y
  51269. , l = n.x - e.x
  51270. , c = n.y - e.y
  51271. , h = r * s - o * a
  51272. , u = r * c - o * l;
  51273. if (Math.abs(h) > Number.EPSILON) {
  51274. var d = l * s - c * a;
  51275. return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
  51276. }
  51277. return 0 < u
  51278. }
  51279. for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
  51280. Array.prototype.push.apply(c, t[h]);
  51281. for (i = 0,
  51282. n = c.length; i < n; i++)
  51283. void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
  51284. l[a] = i;
  51285. var d = function(e, a) {
  51286. function t(e, t) {
  51287. var i = m.length - 1
  51288. , n = e - 1;
  51289. n < 0 && (n = i);
  51290. var r = e + 1;
  51291. i < r && (r = 0);
  51292. var o = T(m[e], m[n], m[r], c[t]);
  51293. if (!o)
  51294. return !1;
  51295. var a = c.length - 1
  51296. , s = t - 1;
  51297. s < 0 && (s = a);
  51298. var l = t + 1;
  51299. return a < l && (l = 0),
  51300. !!(o = T(c[t], c[s], c[l], m[e]))
  51301. }
  51302. function i(e, t) {
  51303. var i, n;
  51304. for (i = 0; i < m.length; i++)
  51305. if (n = i + 1,
  51306. n %= m.length,
  51307. 0 < b(e, t, m[i], m[n], !0).length)
  51308. return !0;
  51309. return !1
  51310. }
  51311. function n(e, t) {
  51312. var i, n, r, o;
  51313. for (i = 0; i < v.length; i++)
  51314. for (n = a[v[i]],
  51315. r = 0; r < n.length; r++)
  51316. if (o = r + 1,
  51317. o %= n.length,
  51318. 0 < b(e, t, n[r], n[o], !0).length)
  51319. return !0;
  51320. return !1
  51321. }
  51322. 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++)
  51323. v.push(A);
  51324. for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
  51325. if (--E < 0) {
  51326. console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
  51327. break
  51328. }
  51329. for (o = I; o < m.length; o++) {
  51330. s = m[o],
  51331. r = -1;
  51332. for (A = 0; A < v.length; A++)
  51333. if (h = v[A],
  51334. void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
  51335. c = a[h];
  51336. for (var _ = 0; _ < c.length; _++)
  51337. if (l = c[_],
  51338. t(o, _) && !i(s, l) && !n(s, l)) {
  51339. r = _,
  51340. v.splice(A, 1),
  51341. d = m.slice(0, o + 1),
  51342. p = m.slice(o),
  51343. f = c.slice(r),
  51344. g = c.slice(0, r + 1),
  51345. m = d.concat(f).concat(g).concat(p),
  51346. I = o;
  51347. break
  51348. }
  51349. if (0 <= r)
  51350. break;
  51351. y[u] = !0
  51352. }
  51353. if (0 <= r)
  51354. break
  51355. }
  51356. }
  51357. return m
  51358. }(e, t)
  51359. , p = Ci.ShapeUtils.triangulate(d, !1);
  51360. for (i = 0,
  51361. n = p.length; i < n; i++)
  51362. for (o = p[i],
  51363. r = 0; r < 3; r++)
  51364. void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
  51365. return p.concat()
  51366. },
  51367. isClockWise: function(e) {
  51368. return Ci.ShapeUtils.area(e) < 0
  51369. },
  51370. b2: function(e, t, i, n) {
  51371. return function(e, t) {
  51372. var i = 1 - e;
  51373. return i * i * t
  51374. }(e, t) + function(e, t) {
  51375. return 2 * (1 - e) * e * t
  51376. }(e, i) + function(e, t) {
  51377. return e * e * t
  51378. }(e, n)
  51379. },
  51380. b3: function(e, t, i, n, r) {
  51381. return function(e, t) {
  51382. var i = 1 - e;
  51383. return i * i * i * t
  51384. }(e, t) + function(e, t) {
  51385. var i = 1 - e;
  51386. return 3 * i * i * e * t
  51387. }(e, i) + function(e, t) {
  51388. return 3 * (1 - e) * e * e * t
  51389. }(e, n) + function(e, t) {
  51390. return e * e * e * t
  51391. }(e, r)
  51392. }
  51393. },
  51394. Ci.Curve = function() {}
  51395. ,
  51396. Ci.Curve.prototype = {
  51397. constructor: Ci.Curve,
  51398. getPoint: function(e) {
  51399. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  51400. null
  51401. },
  51402. getPointAt: function(e) {
  51403. var t = this.getUtoTmapping(e);
  51404. return this.getPoint(t)
  51405. },
  51406. getPoints: function(e) {
  51407. e = e || 5;
  51408. var t, i = [];
  51409. for (t = 0; t <= e; t++)
  51410. i.push(this.getPoint(t / e));
  51411. return i
  51412. },
  51413. getSpacedPoints: function(e) {
  51414. e = e || 5;
  51415. var t, i = [];
  51416. for (t = 0; t <= e; t++)
  51417. i.push(this.getPointAt(t / e));
  51418. return i
  51419. },
  51420. getLength: function() {
  51421. var e = this.getLengths();
  51422. return e[e.length - 1]
  51423. },
  51424. getLengths: function(e) {
  51425. if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  51426. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  51427. return this.cacheArcLengths;
  51428. this.needsUpdate = !1;
  51429. var t, i, n = [], r = this.getPoint(0), o = 0;
  51430. for (n.push(0),
  51431. i = 1; i <= e; i++)
  51432. o += (t = this.getPoint(i / e)).distanceTo(r),
  51433. n.push(o),
  51434. r = t;
  51435. return this.cacheArcLengths = n
  51436. },
  51437. updateArcLengths: function() {
  51438. this.needsUpdate = !0,
  51439. this.getLengths()
  51440. },
  51441. getUtoTmapping: function(e, t) {
  51442. var i, n = this.getLengths(), r = 0, o = n.length;
  51443. i = t || e * n[o - 1];
  51444. for (var a, s = 0, l = o - 1; s <= l; )
  51445. if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
  51446. s = r + 1;
  51447. else {
  51448. if (!(0 < a)) {
  51449. l = r;
  51450. break
  51451. }
  51452. l = r - 1
  51453. }
  51454. if (n[r = l] === i)
  51455. return r / (o - 1);
  51456. var c = n[r];
  51457. return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
  51458. },
  51459. getTangent: function(e) {
  51460. var t = e - 1e-4
  51461. , i = e + 1e-4;
  51462. t < 0 && (t = 0),
  51463. 1 < i && (i = 1);
  51464. var n = this.getPoint(t);
  51465. return this.getPoint(i).clone().sub(n).normalize()
  51466. },
  51467. getTangentAt: function(e) {
  51468. var t = this.getUtoTmapping(e);
  51469. return this.getTangent(t)
  51470. }
  51471. },
  51472. Ci.Curve.create = function(e, t) {
  51473. return e.prototype = Object.create(Ci.Curve.prototype),
  51474. (e.prototype.constructor = e).prototype.getPoint = t,
  51475. e
  51476. }
  51477. ,
  51478. Ci.CurvePath = function() {
  51479. this.curves = [],
  51480. this.autoClose = !1
  51481. }
  51482. ,
  51483. Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
  51484. Ci.CurvePath.prototype.constructor = Ci.CurvePath,
  51485. Ci.CurvePath.prototype.add = function(e) {
  51486. this.curves.push(e)
  51487. }
  51488. ,
  51489. Ci.CurvePath.prototype.closePath = function() {
  51490. var e = this.curves[0].getPoint(0)
  51491. , t = this.curves[this.curves.length - 1].getPoint(1);
  51492. e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
  51493. }
  51494. ,
  51495. Ci.CurvePath.prototype.getPoint = function(e) {
  51496. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  51497. if (i[n] >= t) {
  51498. var r = i[n] - t
  51499. , o = this.curves[n]
  51500. , a = 1 - r / o.getLength();
  51501. return o.getPointAt(a)
  51502. }
  51503. n++
  51504. }
  51505. return null
  51506. }
  51507. ,
  51508. Ci.CurvePath.prototype.getLength = function() {
  51509. var e = this.getCurveLengths();
  51510. return e[e.length - 1]
  51511. }
  51512. ,
  51513. Ci.CurvePath.prototype.getCurveLengths = function() {
  51514. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  51515. return this.cacheLengths;
  51516. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  51517. t += this.curves[i].getLength(),
  51518. e.push(t);
  51519. return this.cacheLengths = e
  51520. }
  51521. ,
  51522. Ci.CurvePath.prototype.createPointsGeometry = function(e) {
  51523. var t = this.getPoints(e);
  51524. return this.createGeometry(t)
  51525. }
  51526. ,
  51527. Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  51528. var t = this.getSpacedPoints(e);
  51529. return this.createGeometry(t)
  51530. }
  51531. ,
  51532. Ci.CurvePath.prototype.createGeometry = function(e) {
  51533. for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
  51534. var r = e[i];
  51535. t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
  51536. }
  51537. return t
  51538. }
  51539. ,
  51540. Ci.Font = function(e) {
  51541. this.data = e
  51542. }
  51543. ,
  51544. Ci.Font.prototype = {
  51545. constructor: Ci.Font,
  51546. generateShapes: function(e, s, b) {
  51547. function l(e, t, i) {
  51548. var n = w.glyphs[e] || w.glyphs["?"];
  51549. if (n) {
  51550. 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;
  51551. if (n.o)
  51552. for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
  51553. switch (A[C++]) {
  51554. case "m":
  51555. r = A[C++] * t + i,
  51556. o = A[C++] * t,
  51557. g.moveTo(r, o);
  51558. break;
  51559. case "l":
  51560. r = A[C++] * t + i,
  51561. o = A[C++] * t,
  51562. g.lineTo(r, o);
  51563. break;
  51564. case "q":
  51565. if (a = A[C++] * t + i,
  51566. s = A[C++] * t,
  51567. h = A[C++] * t + i,
  51568. u = A[C++] * t,
  51569. g.quadraticCurveTo(h, u, a, s),
  51570. f = m[m.length - 1]) {
  51571. l = f.x,
  51572. c = f.y;
  51573. for (var E = 1; E <= b; E++) {
  51574. v(_ = E / b, l, h, a),
  51575. v(_, c, u, s)
  51576. }
  51577. }
  51578. break;
  51579. case "b":
  51580. if (a = A[C++] * t + i,
  51581. s = A[C++] * t,
  51582. h = A[C++] * t + i,
  51583. u = A[C++] * t,
  51584. d = A[C++] * t + i,
  51585. p = A[C++] * t,
  51586. g.bezierCurveTo(h, u, d, p, a, s),
  51587. f = m[m.length - 1]) {
  51588. l = f.x,
  51589. c = f.y;
  51590. for (E = 1; E <= b; E++) {
  51591. var _;
  51592. y(_ = E / b, l, h, d, a),
  51593. y(_, c, u, p, s)
  51594. }
  51595. }
  51596. }
  51597. }
  51598. return {
  51599. offset: n.ha * t,
  51600. path: g
  51601. }
  51602. }
  51603. }
  51604. void 0 === s && (s = 100),
  51605. void 0 === b && (b = 4);
  51606. for (var w = this.data, t = function(e) {
  51607. for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
  51608. var a = l(t[o], i, n);
  51609. n += a.offset,
  51610. r.push(a.path)
  51611. }
  51612. return r
  51613. }(e), i = [], n = 0, r = t.length; n < r; n++)
  51614. Array.prototype.push.apply(i, t[n].toShapes());
  51615. return i
  51616. }
  51617. },
  51618. Ci.Path = function(e) {
  51619. Ci.CurvePath.call(this),
  51620. this.actions = [],
  51621. e && this.fromPoints(e)
  51622. }
  51623. ,
  51624. Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
  51625. Ci.Path.prototype.constructor = Ci.Path,
  51626. Ci.Path.prototype.fromPoints = function(e) {
  51627. this.moveTo(e[0].x, e[0].y);
  51628. for (var t = 1, i = e.length; t < i; t++)
  51629. this.lineTo(e[t].x, e[t].y)
  51630. }
  51631. ,
  51632. Ci.Path.prototype.moveTo = function(e, t) {
  51633. this.actions.push({
  51634. action: "moveTo",
  51635. args: [e, t]
  51636. })
  51637. }
  51638. ,
  51639. Ci.Path.prototype.lineTo = function(e, t) {
  51640. var i = this.actions[this.actions.length - 1].args
  51641. , n = i[i.length - 2]
  51642. , r = i[i.length - 1]
  51643. , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
  51644. this.curves.push(o),
  51645. this.actions.push({
  51646. action: "lineTo",
  51647. args: [e, t]
  51648. })
  51649. }
  51650. ,
  51651. Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
  51652. var r = this.actions[this.actions.length - 1].args
  51653. , o = r[r.length - 2]
  51654. , a = r[r.length - 1]
  51655. , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
  51656. this.curves.push(s),
  51657. this.actions.push({
  51658. action: "quadraticCurveTo",
  51659. args: [e, t, i, n]
  51660. })
  51661. }
  51662. ,
  51663. Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
  51664. var a = this.actions[this.actions.length - 1].args
  51665. , s = a[a.length - 2]
  51666. , l = a[a.length - 1]
  51667. , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
  51668. this.curves.push(c),
  51669. this.actions.push({
  51670. action: "bezierCurveTo",
  51671. args: [e, t, i, n, r, o]
  51672. })
  51673. }
  51674. ,
  51675. Ci.Path.prototype.splineThru = function(e) {
  51676. var t = Array.prototype.slice.call(arguments)
  51677. , i = this.actions[this.actions.length - 1].args
  51678. , n = i[i.length - 2]
  51679. , r = i[i.length - 1]
  51680. , o = [new Ci.Vector2(n,r)];
  51681. Array.prototype.push.apply(o, e);
  51682. var a = new Ci.SplineCurve(o);
  51683. this.curves.push(a),
  51684. this.actions.push({
  51685. action: "splineThru",
  51686. args: t
  51687. })
  51688. }
  51689. ,
  51690. Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
  51691. var a = this.actions[this.actions.length - 1].args
  51692. , s = a[a.length - 2]
  51693. , l = a[a.length - 1];
  51694. this.absarc(e + s, t + l, i, n, r, o)
  51695. }
  51696. ,
  51697. Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
  51698. this.absellipse(e, t, i, i, n, r, o)
  51699. }
  51700. ,
  51701. Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  51702. var l = this.actions[this.actions.length - 1].args
  51703. , c = l[l.length - 2]
  51704. , h = l[l.length - 1];
  51705. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  51706. }
  51707. ,
  51708. Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
  51709. var l = [e, t, i, n, r, o, a, s || 0]
  51710. , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
  51711. this.curves.push(c);
  51712. var h = c.getPoint(1);
  51713. l.push(h.x),
  51714. l.push(h.y),
  51715. this.actions.push({
  51716. action: "ellipse",
  51717. args: l
  51718. })
  51719. }
  51720. ,
  51721. Ci.Path.prototype.getSpacedPoints = function(e) {
  51722. e = e || 40;
  51723. for (var t = [], i = 0; i < e; i++)
  51724. t.push(this.getPoint(i / e));
  51725. return this.autoClose && t.push(t[0]),
  51726. t
  51727. }
  51728. ,
  51729. Ci.Path.prototype.getPoints = function(e) {
  51730. e = e || 12;
  51731. 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++) {
  51732. var v = this.actions[g]
  51733. , y = v.action
  51734. , A = v.args;
  51735. switch (y) {
  51736. case "moveTo":
  51737. case "lineTo":
  51738. f.push(new Ci.Vector2(A[0],A[1]));
  51739. break;
  51740. case "quadraticCurveTo":
  51741. t = A[2],
  51742. i = A[3],
  51743. o = A[0],
  51744. a = A[1],
  51745. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  51746. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  51747. c[c.length - 1]);
  51748. for (var C = 1; C <= e; C++) {
  51749. h = d(O = C / e, s, o, t),
  51750. u = d(O, l, a, i),
  51751. f.push(new Ci.Vector2(h,u))
  51752. }
  51753. break;
  51754. case "bezierCurveTo":
  51755. t = A[4],
  51756. i = A[5],
  51757. o = A[0],
  51758. a = A[1],
  51759. n = A[2],
  51760. r = A[3],
  51761. l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
  51762. c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
  51763. c[c.length - 1]);
  51764. for (C = 1; C <= e; C++) {
  51765. h = p(O = C / e, s, o, n, t),
  51766. u = p(O, l, a, r, i),
  51767. f.push(new Ci.Vector2(h,u))
  51768. }
  51769. break;
  51770. case "splineThru":
  51771. c = this.actions[g - 1].args;
  51772. var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
  51773. , E = e * A[0].length;
  51774. I = I.concat(A[0]);
  51775. var _ = new Ci.SplineCurve(I);
  51776. for (C = 1; C <= E; C++)
  51777. f.push(_.getPointAt(C / E));
  51778. break;
  51779. case "arc":
  51780. var b = A[0]
  51781. , w = A[1]
  51782. , T = A[2]
  51783. , x = A[3]
  51784. , S = A[4]
  51785. , M = !!A[5]
  51786. , R = S - x
  51787. , P = 2 * e;
  51788. for (C = 1; C <= P; C++) {
  51789. var O = C / P;
  51790. M || (O = 1 - O),
  51791. L = x + O * R,
  51792. h = b + T * Math.cos(L),
  51793. u = w + T * Math.sin(L),
  51794. f.push(new Ci.Vector2(h,u))
  51795. }
  51796. break;
  51797. case "ellipse":
  51798. b = A[0],
  51799. w = A[1];
  51800. var L, D, N, F = A[2], B = A[3], V = (x = A[4],
  51801. S = A[5],
  51802. M = !!A[6],
  51803. A[7]);
  51804. R = S - x,
  51805. P = 2 * e;
  51806. 0 !== V && (D = Math.cos(V),
  51807. N = Math.sin(V));
  51808. for (C = 1; C <= P; C++) {
  51809. O = C / P;
  51810. if (M || (O = 1 - O),
  51811. L = x + O * R,
  51812. h = b + F * Math.cos(L),
  51813. u = w + B * Math.sin(L),
  51814. 0 !== V) {
  51815. var k = h;
  51816. h = (k - b) * D - (u - w) * N + b,
  51817. u = (k - b) * N + (u - w) * D + w
  51818. }
  51819. f.push(new Ci.Vector2(h,u))
  51820. }
  51821. }
  51822. }
  51823. var U = f[f.length - 1];
  51824. 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),
  51825. this.autoClose && f.push(f[0]),
  51826. f
  51827. }
  51828. ,
  51829. Ci.Path.prototype.toShapes = function(e, t) {
  51830. function i(e) {
  51831. for (var t = [], i = 0, n = e.length; i < n; i++) {
  51832. var r = e[i]
  51833. , o = new Ci.Shape;
  51834. o.actions = r.actions,
  51835. o.curves = r.curves,
  51836. t.push(o)
  51837. }
  51838. return t
  51839. }
  51840. function n(e, t) {
  51841. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  51842. var a = t[r]
  51843. , s = t[o]
  51844. , l = s.x - a.x
  51845. , c = s.y - a.y;
  51846. if (Math.abs(c) > Number.EPSILON) {
  51847. if (c < 0 && (a = t[o],
  51848. l = -l,
  51849. s = t[r],
  51850. c = -c),
  51851. e.y < a.y || e.y > s.y)
  51852. continue;
  51853. if (e.y === a.y) {
  51854. if (e.x === a.x)
  51855. return !0
  51856. } else {
  51857. var h = c * (e.x - a.x) - l * (e.y - a.y);
  51858. if (0 == h)
  51859. return !0;
  51860. if (h < 0)
  51861. continue;
  51862. n = !n
  51863. }
  51864. } else {
  51865. if (e.y !== a.y)
  51866. continue;
  51867. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  51868. return !0
  51869. }
  51870. }
  51871. return n
  51872. }
  51873. var r = Ci.ShapeUtils.isClockWise
  51874. , o = function(e) {
  51875. for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
  51876. var o = e[n]
  51877. , a = o.args
  51878. , s = o.action;
  51879. "moveTo" === s && 0 !== i.actions.length && (t.push(i),
  51880. i = new Ci.Path),
  51881. i[s].apply(i, a)
  51882. }
  51883. return 0 !== i.actions.length && t.push(i),
  51884. t
  51885. }(this.actions);
  51886. if (0 === o.length)
  51887. return [];
  51888. if (!0 === t)
  51889. return i(o);
  51890. var a, s, l, c = [];
  51891. if (1 === o.length)
  51892. return s = o[0],
  51893. (l = new Ci.Shape).actions = s.actions,
  51894. l.curves = s.curves,
  51895. c.push(l),
  51896. c;
  51897. var h = !r(o[0].getPoints());
  51898. h = e ? !h : h;
  51899. var u, d = [], p = [], f = [], g = 0;
  51900. p[g] = void 0,
  51901. f[g] = [];
  51902. for (var m = 0, v = o.length; m < v; m++)
  51903. a = r(u = (s = o[m]).getPoints()),
  51904. (a = e ? !a : a) ? (!h && p[g] && g++,
  51905. p[g] = {
  51906. s: new Ci.Shape,
  51907. p: u
  51908. },
  51909. p[g].s.actions = s.actions,
  51910. p[g].s.curves = s.curves,
  51911. h && g++,
  51912. f[g] = []) : f[g].push({
  51913. h: s,
  51914. p: u[0]
  51915. });
  51916. if (!p[0])
  51917. return i(o);
  51918. if (1 < p.length) {
  51919. for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
  51920. d[C] = [];
  51921. for (C = 0,
  51922. I = p.length; C < I; C++)
  51923. for (var E = f[C], _ = 0; _ < E.length; _++) {
  51924. for (var b = E[_], w = !0, T = 0; T < p.length; T++)
  51925. n(b.p, p[T].p) && (C !== T && A.push({
  51926. froms: C,
  51927. tos: T,
  51928. hole: _
  51929. }),
  51930. w ? (w = !1,
  51931. d[T].push(b)) : y = !0);
  51932. w && d[C].push(b)
  51933. }
  51934. 0 < A.length && (y || (f = d))
  51935. }
  51936. m = 0;
  51937. for (var x, S = p.length; m < S; m++) {
  51938. l = p[m].s,
  51939. c.push(l);
  51940. for (var M = 0, R = (x = f[m]).length; M < R; M++)
  51941. l.holes.push(x[M].h)
  51942. }
  51943. return c
  51944. }
  51945. ,
  51946. Ci.Shape = function() {
  51947. Ci.Path.apply(this, arguments),
  51948. this.holes = []
  51949. }
  51950. ,
  51951. Ci.Shape.prototype = Object.create(Ci.Path.prototype),
  51952. Ci.Shape.prototype.constructor = Ci.Shape,
  51953. Ci.Shape.prototype.extrude = function(e) {
  51954. return new Ci.ExtrudeGeometry(this,e)
  51955. }
  51956. ,
  51957. Ci.Shape.prototype.makeGeometry = function(e) {
  51958. return new Ci.ShapeGeometry(this,e)
  51959. }
  51960. ,
  51961. Ci.Shape.prototype.getPointsHoles = function(e) {
  51962. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  51963. t[i] = this.holes[i].getPoints(e);
  51964. return t
  51965. }
  51966. ,
  51967. Ci.Shape.prototype.extractAllPoints = function(e) {
  51968. return {
  51969. shape: this.getPoints(e),
  51970. holes: this.getPointsHoles(e)
  51971. }
  51972. }
  51973. ,
  51974. Ci.Shape.prototype.extractPoints = function(e) {
  51975. return this.extractAllPoints(e)
  51976. }
  51977. ,
  51978. Ci.LineCurve = function(e, t) {
  51979. this.v1 = e,
  51980. this.v2 = t
  51981. }
  51982. ,
  51983. Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
  51984. Ci.LineCurve.prototype.constructor = Ci.LineCurve,
  51985. Ci.LineCurve.prototype.getPoint = function(e) {
  51986. var t = this.v2.clone().sub(this.v1);
  51987. return t.multiplyScalar(e).add(this.v1),
  51988. t
  51989. }
  51990. ,
  51991. Ci.LineCurve.prototype.getPointAt = function(e) {
  51992. return this.getPoint(e)
  51993. }
  51994. ,
  51995. Ci.LineCurve.prototype.getTangent = function(e) {
  51996. return this.v2.clone().sub(this.v1).normalize()
  51997. }
  51998. ,
  51999. Ci.QuadraticBezierCurve = function(e, t, i) {
  52000. this.v0 = e,
  52001. this.v1 = t,
  52002. this.v2 = i
  52003. }
  52004. ,
  52005. Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52006. Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
  52007. Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
  52008. var t = Ci.ShapeUtils.b2;
  52009. 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))
  52010. }
  52011. ,
  52012. Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
  52013. var t = Ci.CurveUtils.tangentQuadraticBezier;
  52014. 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()
  52015. }
  52016. ,
  52017. Ci.CubicBezierCurve = function(e, t, i, n) {
  52018. this.v0 = e,
  52019. this.v1 = t,
  52020. this.v2 = i,
  52021. this.v3 = n
  52022. }
  52023. ,
  52024. Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
  52025. Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
  52026. Ci.CubicBezierCurve.prototype.getPoint = function(e) {
  52027. var t = Ci.ShapeUtils.b3;
  52028. 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))
  52029. }
  52030. ,
  52031. Ci.CubicBezierCurve.prototype.getTangent = function(e) {
  52032. var t = Ci.CurveUtils.tangentCubicBezier;
  52033. 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()
  52034. }
  52035. ,
  52036. Ci.SplineCurve = function(e) {
  52037. this.points = null == e ? [] : e
  52038. }
  52039. ,
  52040. Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
  52041. Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
  52042. Ci.SplineCurve.prototype.getPoint = function(e) {
  52043. var t = this.points
  52044. , i = (t.length - 1) * e
  52045. , n = Math.floor(i)
  52046. , r = i - n
  52047. , o = t[0 === n ? n : n - 1]
  52048. , a = t[n]
  52049. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52050. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52051. , c = Ci.CurveUtils.interpolate;
  52052. return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
  52053. }
  52054. ,
  52055. Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  52056. this.aX = e,
  52057. this.aY = t,
  52058. this.xRadius = i,
  52059. this.yRadius = n,
  52060. this.aStartAngle = r,
  52061. this.aEndAngle = o,
  52062. this.aClockwise = a,
  52063. this.aRotation = s || 0
  52064. }
  52065. ,
  52066. Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
  52067. Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
  52068. Ci.EllipseCurve.prototype.getPoint = function(e) {
  52069. var t, i = this.aEndAngle - this.aStartAngle;
  52070. i < 0 && (i += 2 * Math.PI),
  52071. i > 2 * Math.PI && (i -= 2 * Math.PI),
  52072. t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
  52073. var n = this.aX + this.xRadius * Math.cos(t)
  52074. , r = this.aY + this.yRadius * Math.sin(t);
  52075. if (0 !== this.aRotation) {
  52076. var o = Math.cos(this.aRotation)
  52077. , a = Math.sin(this.aRotation)
  52078. , s = n
  52079. , l = r;
  52080. n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
  52081. r = (s - this.aX) * a + (l - this.aY) * o + this.aY
  52082. }
  52083. return new Ci.Vector2(n,r)
  52084. }
  52085. ,
  52086. Ci.ArcCurve = function(e, t, i, n, r, o) {
  52087. Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
  52088. }
  52089. ,
  52090. Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
  52091. Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
  52092. Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
  52093. this.v1 = e,
  52094. this.v2 = t
  52095. }, function(e) {
  52096. var t = new Ci.Vector3;
  52097. return t.subVectors(this.v2, this.v1),
  52098. t.multiplyScalar(e),
  52099. t.add(this.v1),
  52100. t
  52101. }),
  52102. Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
  52103. this.v0 = e,
  52104. this.v1 = t,
  52105. this.v2 = i
  52106. }, function(e) {
  52107. var t = Ci.ShapeUtils.b2;
  52108. 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))
  52109. }),
  52110. Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
  52111. this.v0 = e,
  52112. this.v1 = t,
  52113. this.v2 = i,
  52114. this.v3 = n
  52115. }, function(e) {
  52116. var t = Ci.ShapeUtils.b3;
  52117. 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))
  52118. }),
  52119. Ci.SplineCurve3 = Ci.Curve.create(function(e) {
  52120. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  52121. this.points = null == e ? [] : e
  52122. }, function(e) {
  52123. var t = this.points
  52124. , i = (t.length - 1) * e
  52125. , n = Math.floor(i)
  52126. , r = i - n
  52127. , o = t[0 == n ? n : n - 1]
  52128. , a = t[n]
  52129. , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
  52130. , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
  52131. , c = Ci.CurveUtils.interpolate;
  52132. 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))
  52133. }),
  52134. Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
  52135. Xt = new xi,
  52136. Zt = new xi,
  52137. Kt = new xi,
  52138. xi.prototype.init = function(e, t, i, n) {
  52139. this.c0 = e,
  52140. this.c1 = i,
  52141. this.c2 = -3 * e + 3 * t - 2 * i - n,
  52142. this.c3 = 2 * e - 2 * t + i + n
  52143. }
  52144. ,
  52145. xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  52146. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  52147. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  52148. s *= o,
  52149. l *= o,
  52150. this.init(t, i, s, l)
  52151. }
  52152. ,
  52153. xi.prototype.initCatmullRom = function(e, t, i, n, r) {
  52154. this.init(t, i, r * (i - e), r * (n - t))
  52155. }
  52156. ,
  52157. xi.prototype.calc = function(e) {
  52158. var t = e * e
  52159. , i = t * e;
  52160. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  52161. }
  52162. ,
  52163. Ci.Curve.create(function(e) {
  52164. this.points = e || [],
  52165. this.closed = !1
  52166. }, function(e) {
  52167. var t, i, n, r, o, a, s, l, c = this.points;
  52168. if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
  52169. n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
  52170. this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
  52171. n = 1),
  52172. o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
  52173. qt),
  52174. a = c[i % r],
  52175. s = c[(i + 1) % r],
  52176. l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
  52177. qt),
  52178. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  52179. var h = "chordal" === this.type ? .5 : .25
  52180. , u = Math.pow(o.distanceToSquared(a), h)
  52181. , d = Math.pow(a.distanceToSquared(s), h)
  52182. , p = Math.pow(s.distanceToSquared(l), h);
  52183. d < 1e-4 && (d = 1),
  52184. u < 1e-4 && (u = d),
  52185. p < 1e-4 && (p = d),
  52186. Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
  52187. Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
  52188. Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
  52189. } else if ("catmullrom" === this.type) {
  52190. var f = void 0 !== this.tension ? this.tension : .5;
  52191. Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
  52192. Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
  52193. Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
  52194. }
  52195. return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
  52196. })),
  52197. Ci.ClosedSplineCurve3 = function(e) {
  52198. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  52199. Ci.CatmullRomCurve3.call(this, e),
  52200. this.type = "catmullrom",
  52201. this.closed = !0
  52202. }
  52203. ,
  52204. Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
  52205. Ci.BoxGeometry = function(e, t, i, n, r, o) {
  52206. Ci.Geometry.call(this),
  52207. this.type = "BoxGeometry",
  52208. this.parameters = {
  52209. width: e,
  52210. height: t,
  52211. depth: i,
  52212. widthSegments: n,
  52213. heightSegments: r,
  52214. depthSegments: o
  52215. },
  52216. this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
  52217. this.mergeVertices()
  52218. }
  52219. ,
  52220. Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52221. Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
  52222. Ci.CubeGeometry = Ci.BoxGeometry,
  52223. Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
  52224. function a(e, t, i, n, r, o, a, s, l, c, h) {
  52225. 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++)
  52226. for (var E = I * d - f, _ = 0; _ < m; _++) {
  52227. var b = _ * u - p;
  52228. C[e] = b * n,
  52229. C[t] = E * r,
  52230. C[i] = g,
  52231. P[D] = C.x,
  52232. P[D + 1] = C.y,
  52233. P[D + 2] = C.z,
  52234. C[e] = 0,
  52235. C[t] = 0,
  52236. C[i] = 0 < s ? 1 : -1,
  52237. O[D] = C.x,
  52238. O[D + 1] = C.y,
  52239. O[D + 2] = C.z,
  52240. L[N] = _ / l,
  52241. L[N + 1] = 1 - I / c,
  52242. D += 3,
  52243. N += 2,
  52244. y += 1
  52245. }
  52246. for (I = 0; I < c; I++)
  52247. for (_ = 0; _ < l; _++) {
  52248. var w = B + _ + m * I
  52249. , T = B + _ + m * (I + 1)
  52250. , x = B + (_ + 1) + m * (I + 1)
  52251. , S = B + (_ + 1) + m * I;
  52252. R[F] = w,
  52253. R[F + 1] = T,
  52254. R[F + 2] = S,
  52255. R[F + 3] = T,
  52256. R[F + 4] = x,
  52257. R[F + 5] = S,
  52258. F += 6,
  52259. A += 6
  52260. }
  52261. M.addGroup(V, A, h),
  52262. V += A,
  52263. B += y
  52264. }
  52265. Ci.BufferGeometry.call(this),
  52266. this.type = "BoxBufferGeometry",
  52267. this.parameters = {
  52268. width: e,
  52269. height: t,
  52270. depth: i,
  52271. widthSegments: n,
  52272. heightSegments: r,
  52273. depthSegments: o
  52274. };
  52275. var M = this;
  52276. n = Math.floor(n) || 1,
  52277. r = Math.floor(r) || 1,
  52278. o = Math.floor(o) || 1;
  52279. var s, l, c, h, u = (h = 0,
  52280. h += (s = n) * (l = r) * 2,
  52281. h += s * (c = o) * 2,
  52282. 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;
  52283. a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
  52284. a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
  52285. a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
  52286. a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
  52287. a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
  52288. a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
  52289. this.setIndex(new Ci.BufferAttribute(R,1)),
  52290. this.addAttribute("position", new Ci.BufferAttribute(P,3)),
  52291. this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
  52292. this.addAttribute("uv", new Ci.BufferAttribute(L,2))
  52293. }
  52294. ,
  52295. Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52296. Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
  52297. Ci.CircleGeometry = function(e, t, i, n) {
  52298. Ci.Geometry.call(this),
  52299. this.type = "CircleGeometry",
  52300. this.parameters = {
  52301. radius: e,
  52302. segments: t,
  52303. thetaStart: i,
  52304. thetaLength: n
  52305. },
  52306. this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
  52307. }
  52308. ,
  52309. Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52310. Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
  52311. Ci.CircleBufferGeometry = function(e, t, i, n) {
  52312. Ci.BufferGeometry.call(this),
  52313. this.type = "CircleBufferGeometry",
  52314. this.parameters = {
  52315. radius: e,
  52316. segments: t,
  52317. thetaStart: i,
  52318. thetaLength: n
  52319. },
  52320. e = e || 50,
  52321. t = void 0 !== t ? Math.max(3, t) : 8,
  52322. i = void 0 !== i ? i : 0,
  52323. n = void 0 !== n ? n : 2 * Math.PI;
  52324. var r = t + 2
  52325. , o = new Float32Array(3 * r)
  52326. , a = new Float32Array(3 * r)
  52327. , s = new Float32Array(2 * r);
  52328. a[2] = 1,
  52329. s[0] = .5,
  52330. s[1] = .5;
  52331. for (var l = 0, c = 3, h = 2; l <= t; l++,
  52332. c += 3,
  52333. h += 2) {
  52334. var u = i + l / t * n;
  52335. o[c] = e * Math.cos(u),
  52336. o[c + 1] = e * Math.sin(u),
  52337. a[c + 2] = 1,
  52338. s[h] = (o[c] / e + 1) / 2,
  52339. s[h + 1] = (o[c + 1] / e + 1) / 2
  52340. }
  52341. var d = [];
  52342. for (c = 1; c <= t; c++)
  52343. d.push(c, c + 1, 0);
  52344. this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
  52345. this.addAttribute("position", new Ci.BufferAttribute(o,3)),
  52346. this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
  52347. this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
  52348. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  52349. }
  52350. ,
  52351. Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52352. Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
  52353. Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
  52354. function t(e) {
  52355. var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
  52356. for (i = b,
  52357. t = 1; t <= m; t++)
  52358. I.setXYZ(b, 0, x * s, 0),
  52359. E.setXYZ(b, 0, s, 0),
  52360. !0 === e ? (r.x = t / m,
  52361. r.y = 0) : (r.x = (t - 1) / m,
  52362. r.y = 1),
  52363. _.setXY(b, r.x, r.y),
  52364. b++;
  52365. for (n = b,
  52366. t = 0; t <= m; t++) {
  52367. var l = t / m;
  52368. o.x = a * Math.sin(l * A + y),
  52369. o.y = x * s,
  52370. o.z = a * Math.cos(l * A + y),
  52371. I.setXYZ(b, o.x, o.y, o.z),
  52372. E.setXYZ(b, 0, s, 0),
  52373. _.setXY(b, l, !0 === e ? 1 : 0),
  52374. b++
  52375. }
  52376. for (t = 0; t < m; t++) {
  52377. var c = i + t
  52378. , h = n + t;
  52379. !0 === e ? (C.setX(w, h),
  52380. w++,
  52381. C.setX(w, h + 1)) : (C.setX(w, h + 1),
  52382. w++,
  52383. C.setX(w, h)),
  52384. w++,
  52385. C.setX(w, c),
  52386. w++
  52387. }
  52388. }
  52389. Ci.BufferGeometry.call(this),
  52390. this.type = "CylinderBufferGeometry",
  52391. this.parameters = {
  52392. radiusTop: p,
  52393. radiusBottom: f,
  52394. height: g,
  52395. radialSegments: m,
  52396. heightSegments: v,
  52397. openEnded: e,
  52398. thetaStart: y,
  52399. thetaLength: A
  52400. },
  52401. p = void 0 !== p ? p : 20,
  52402. f = void 0 !== f ? f : 20,
  52403. g = void 0 !== g ? g : 100,
  52404. m = Math.floor(m) || 8,
  52405. v = Math.floor(v) || 1,
  52406. e = void 0 !== e && e,
  52407. y = void 0 !== y ? y : 0,
  52408. A = void 0 !== A ? A : 2 * Math.PI;
  52409. var i, n, r = (n = (m + 1) * (v + 1),
  52410. !1 === e && (n += 2 * (m + 1) + 2 * m),
  52411. n), o = (i = m * v * 2 * 3,
  52412. !1 === e && (i += 2 * m * 3),
  52413. 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;
  52414. (function() {
  52415. var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
  52416. for (t = 0; t <= v; t++) {
  52417. var o = []
  52418. , a = t / v
  52419. , s = a * (f - p) + p;
  52420. for (e = 0; e <= m; e++) {
  52421. var l = e / m;
  52422. n.x = s * Math.sin(l * A + y),
  52423. n.y = -a * g + x,
  52424. n.z = s * Math.cos(l * A + y),
  52425. I.setXYZ(b, n.x, n.y, n.z),
  52426. i.copy(n),
  52427. (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
  52428. i.z = Math.cos(l * A + y)),
  52429. i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
  52430. E.setXYZ(b, i.x, i.y, i.z),
  52431. _.setXY(b, l, 1 - a),
  52432. o.push(b),
  52433. b++
  52434. }
  52435. T.push(o)
  52436. }
  52437. for (e = 0; e < m; e++)
  52438. for (t = 0; t < v; t++) {
  52439. var c = T[t][e]
  52440. , h = T[t + 1][e]
  52441. , u = T[t + 1][e + 1]
  52442. , d = T[t][e + 1];
  52443. C.setX(w, c),
  52444. w++,
  52445. C.setX(w, h),
  52446. w++,
  52447. C.setX(w, d),
  52448. w++,
  52449. C.setX(w, h),
  52450. w++,
  52451. C.setX(w, u),
  52452. w++,
  52453. C.setX(w, d),
  52454. w++
  52455. }
  52456. }
  52457. )(),
  52458. !1 === e && (0 < p && t(!0),
  52459. 0 < f && t(!1)),
  52460. this.setIndex(C),
  52461. this.addAttribute("position", I),
  52462. this.addAttribute("normal", E),
  52463. this.addAttribute("uv", _)
  52464. }
  52465. ,
  52466. Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52467. Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
  52468. Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
  52469. Ci.Geometry.call(this),
  52470. this.type = "CylinderGeometry",
  52471. this.parameters = {
  52472. radiusTop: e,
  52473. radiusBottom: t,
  52474. height: i,
  52475. radialSegments: n,
  52476. heightSegments: r,
  52477. openEnded: o,
  52478. thetaStart: a,
  52479. thetaLength: s
  52480. },
  52481. this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
  52482. this.mergeVertices()
  52483. }
  52484. ,
  52485. Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52486. Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
  52487. Ci.EdgesGeometry = function(e, t) {
  52488. function i(e, t) {
  52489. return e - t
  52490. }
  52491. Ci.BufferGeometry.call(this),
  52492. t = void 0 !== t ? t : 1;
  52493. var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
  52494. e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
  52495. n.mergeVertices(),
  52496. n.computeFaceNormals();
  52497. for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
  52498. for (var d = c[h], p = 0; p < 3; p++) {
  52499. o[0] = d[s[p]],
  52500. o[1] = d[s[(p + 1) % 3]],
  52501. o.sort(i),
  52502. void 0 === a[g = o.toString()] ? a[g] = {
  52503. vert1: o[0],
  52504. vert2: o[1],
  52505. face1: h,
  52506. face2: void 0
  52507. } : a[g].face2 = h
  52508. }
  52509. var f = [];
  52510. for (var g in a) {
  52511. var m = a[g];
  52512. if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
  52513. var v = l[m.vert1];
  52514. f.push(v.x),
  52515. f.push(v.y),
  52516. f.push(v.z),
  52517. v = l[m.vert2],
  52518. f.push(v.x),
  52519. f.push(v.y),
  52520. f.push(v.z)
  52521. }
  52522. }
  52523. this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
  52524. }
  52525. ,
  52526. Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52527. Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
  52528. Ci.ExtrudeGeometry = function(e, t) {
  52529. return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
  52530. this.type = "ExtrudeGeometry",
  52531. e = Array.isArray(e) ? e : [e],
  52532. this.addShapeList(e, t),
  52533. void this.computeFaceNormals())
  52534. }
  52535. ;
  52536. Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52537. Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
  52538. Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  52539. for (var i = e.length, n = 0; n < i; n++) {
  52540. var r = e[n];
  52541. this.addShape(r, t)
  52542. }
  52543. }
  52544. ,
  52545. Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
  52546. function i(e, t, i) {
  52547. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  52548. t.clone().multiplyScalar(i).add(e)
  52549. }
  52550. function n(e, t, i) {
  52551. 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;
  52552. if (Math.abs(u) > Number.EPSILON) {
  52553. var d = Math.sqrt(h)
  52554. , p = Math.sqrt(l * l + c * c)
  52555. , f = t.x - s / d
  52556. , g = t.y + a / d
  52557. , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
  52558. , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
  52559. if (v <= 2)
  52560. return new Ci.Vector2(n,r);
  52561. o = Math.sqrt(v / 2)
  52562. } else {
  52563. var y = !1;
  52564. a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
  52565. o = y ? (n = -s,
  52566. r = a,
  52567. Math.sqrt(h)) : (n = a,
  52568. r = s,
  52569. Math.sqrt(h / 2))
  52570. }
  52571. return new Ci.Vector2(n / o,r / o)
  52572. }
  52573. function r(e, t) {
  52574. var i, n;
  52575. for (G = e.length; 0 <= --G; ) {
  52576. (n = (i = G) - 1) < 0 && (n = e.length - 1);
  52577. var r = 0
  52578. , o = A + 2 * m;
  52579. for (r = 0; r < o; r++) {
  52580. var a = U * r
  52581. , s = U * (r + 1);
  52582. l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
  52583. }
  52584. }
  52585. }
  52586. function o(e, t, i) {
  52587. T.vertices.push(new Ci.Vector3(e,t,i))
  52588. }
  52589. function a(e, t, i) {
  52590. e += x,
  52591. t += x,
  52592. i += x,
  52593. T.faces.push(new Ci.Face3(e,t,i,null,null,0));
  52594. var n = E.generateTopUV(T, e, t, i);
  52595. T.faceVertexUvs[0].push(n)
  52596. }
  52597. function l(e, t, i, n) {
  52598. e += x,
  52599. t += x,
  52600. i += x,
  52601. n += x,
  52602. T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
  52603. T.faces.push(new Ci.Face3(t,i,n,null,null,1));
  52604. var r = E.generateSideWallUV(T, e, t, i, n);
  52605. T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
  52606. T.faceVertexUvs[0].push([r[1], r[2], r[3]])
  52607. }
  52608. 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;
  52609. C && (s = C.getSpacedPoints(A),
  52610. v = !(I = !0),
  52611. c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
  52612. h = new Ci.Vector3,
  52613. u = new Ci.Vector3,
  52614. d = new Ci.Vector3),
  52615. v || (g = f = m = 0);
  52616. var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
  52617. if (P) {
  52618. for (M = M.reverse(),
  52619. b = 0,
  52620. w = R.length; b < w; b++)
  52621. _ = R[b],
  52622. Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
  52623. P = !1
  52624. }
  52625. var O = Ci.ShapeUtils.triangulateShape(M, R)
  52626. , L = M;
  52627. for (b = 0,
  52628. w = R.length; b < w; b++)
  52629. _ = R[b],
  52630. M = M.concat(_);
  52631. 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++,
  52632. j++,
  52633. Y++)
  52634. j === W && (j = 0),
  52635. Y === W && (Y = 0),
  52636. z[G] = n(L[G], L[j], L[Y]);
  52637. var q, X, Z = [], K = z.concat();
  52638. for (b = 0,
  52639. w = R.length; b < w; b++) {
  52640. for (_ = R[b],
  52641. q = [],
  52642. G = 0,
  52643. j = (W = _.length) - 1,
  52644. Y = G + 1; G < W; G++,
  52645. j++,
  52646. Y++)
  52647. j === W && (j = 0),
  52648. Y === W && (Y = 0),
  52649. q[G] = n(_[G], _[j], _[Y]);
  52650. Z.push(q),
  52651. K = K.concat(q)
  52652. }
  52653. for (D = 0; D < m; D++) {
  52654. for (B = f * (1 - (F = D / m)),
  52655. N = g * Math.sin(F * Math.PI / 2),
  52656. G = 0,
  52657. W = L.length; G < W; G++)
  52658. o((V = i(L[G], z[G], N)).x, V.y, -B);
  52659. for (b = 0,
  52660. w = R.length; b < w; b++)
  52661. for (_ = R[b],
  52662. q = Z[b],
  52663. G = 0,
  52664. W = _.length; G < W; G++)
  52665. o((V = i(_[G], q[G], N)).x, V.y, -B)
  52666. }
  52667. for (N = g,
  52668. G = 0; G < U; G++)
  52669. V = v ? i(M[G], K[G], N) : M[G],
  52670. I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
  52671. h.copy(c.binormals[0]).multiplyScalar(V.y),
  52672. d.copy(s[0]).add(u).add(h),
  52673. o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
  52674. for (X = 1; X <= A; X++)
  52675. for (G = 0; G < U; G++)
  52676. V = v ? i(M[G], K[G], N) : M[G],
  52677. I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
  52678. h.copy(c.binormals[X]).multiplyScalar(V.y),
  52679. d.copy(s[X]).add(u).add(h),
  52680. o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
  52681. for (D = m - 1; 0 <= D; D--) {
  52682. for (B = f * (1 - (F = D / m)),
  52683. N = g * Math.sin(F * Math.PI / 2),
  52684. G = 0,
  52685. W = L.length; G < W; G++)
  52686. o((V = i(L[G], z[G], N)).x, V.y, p + B);
  52687. for (b = 0,
  52688. w = R.length; b < w; b++)
  52689. for (_ = R[b],
  52690. q = Z[b],
  52691. G = 0,
  52692. W = _.length; G < W; G++)
  52693. V = i(_[G], q[G], N),
  52694. I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
  52695. }
  52696. (function() {
  52697. if (v) {
  52698. var e = 0
  52699. , t = U * e;
  52700. for (G = 0; G < H; G++)
  52701. a((k = O[G])[2] + t, k[1] + t, k[0] + t);
  52702. for (t = U * (e = A + 2 * m),
  52703. G = 0; G < H; G++)
  52704. a((k = O[G])[0] + t, k[1] + t, k[2] + t)
  52705. } else {
  52706. for (G = 0; G < H; G++)
  52707. a((k = O[G])[2], k[1], k[0]);
  52708. for (G = 0; G < H; G++)
  52709. a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
  52710. }
  52711. }
  52712. )(),
  52713. function() {
  52714. var e = 0;
  52715. for (r(L, e),
  52716. e += L.length,
  52717. b = 0,
  52718. w = R.length; b < w; b++)
  52719. r(_ = R[b], e),
  52720. e += _.length
  52721. }()
  52722. }
  52723. ,
  52724. Ci.ExtrudeGeometry.WorldUVGenerator = {
  52725. generateTopUV: function(e, t, i, n) {
  52726. var r = e.vertices
  52727. , o = r[t]
  52728. , a = r[i]
  52729. , s = r[n];
  52730. return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
  52731. },
  52732. generateSideWallUV: function(e, t, i, n, r) {
  52733. var o = e.vertices
  52734. , a = o[t]
  52735. , s = o[i]
  52736. , l = o[n]
  52737. , c = o[r];
  52738. 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)]
  52739. }
  52740. },
  52741. Ci.ShapeGeometry = function(e, t) {
  52742. Ci.Geometry.call(this),
  52743. !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
  52744. this.addShapeList(e, t),
  52745. this.computeFaceNormals()
  52746. }
  52747. ,
  52748. Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52749. Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
  52750. Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
  52751. for (var i = 0, n = e.length; i < n; i++)
  52752. this.addShape(e[i], t);
  52753. return this
  52754. }
  52755. ,
  52756. Ci.ShapeGeometry.prototype.addShape = function(e, t) {
  52757. void 0 === t && (t = {});
  52758. 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);
  52759. if (d) {
  52760. for (h = h.reverse(),
  52761. i = 0,
  52762. n = u.length; i < n; i++)
  52763. r = u[i],
  52764. Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
  52765. d = !1
  52766. }
  52767. var p = Ci.ShapeUtils.triangulateShape(h, u);
  52768. for (i = 0,
  52769. n = u.length; i < n; i++)
  52770. r = u[i],
  52771. h = h.concat(r);
  52772. var f, g, m = h.length, v = p.length;
  52773. for (i = 0; i < m; i++)
  52774. f = h[i],
  52775. this.vertices.push(new Ci.Vector3(f.x,f.y,0));
  52776. for (i = 0; i < v; i++) {
  52777. var y = (g = p[i])[0] + l
  52778. , A = g[1] + l
  52779. , C = g[2] + l;
  52780. this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
  52781. this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
  52782. }
  52783. }
  52784. ,
  52785. Ci.LatheBufferGeometry = function(e, t, i, n) {
  52786. Ci.BufferGeometry.call(this),
  52787. this.type = "LatheBufferGeometry",
  52788. this.parameters = {
  52789. points: e,
  52790. segments: t,
  52791. phiStart: i,
  52792. phiLength: n
  52793. },
  52794. t = Math.floor(t) || 12,
  52795. i = i || 0,
  52796. n = n || 2 * Math.PI,
  52797. n = Ci.Math.clamp(n, 0, 2 * Math.PI);
  52798. 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,
  52799. 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
  52800. for (o = 0; o <= t; o++) {
  52801. var v = i + o * f * n
  52802. , y = Math.sin(v)
  52803. , A = Math.cos(v);
  52804. for (a = 0; a <= e.length - 1; a++)
  52805. g.x = e[a].x * y,
  52806. g.y = e[a].y,
  52807. g.z = e[a].x * A,
  52808. h.setXYZ(d, g.x, g.y, g.z),
  52809. m.x = o / t,
  52810. m.y = a / (e.length - 1),
  52811. u.setXY(d, m.x, m.y),
  52812. d++
  52813. }
  52814. for (o = 0; o < t; o++)
  52815. for (a = 0; a < e.length - 1; a++) {
  52816. var C = r = a + o * e.length
  52817. , I = r + e.length
  52818. , E = r + e.length + 1
  52819. , _ = r + 1;
  52820. c.setX(p, C),
  52821. p++,
  52822. c.setX(p, I),
  52823. p++,
  52824. c.setX(p, _),
  52825. p++,
  52826. c.setX(p, I),
  52827. p++,
  52828. c.setX(p, E),
  52829. p++,
  52830. c.setX(p, _),
  52831. p++
  52832. }
  52833. if (this.setIndex(c),
  52834. this.addAttribute("position", h),
  52835. this.addAttribute("uv", u),
  52836. this.computeVertexNormals(),
  52837. n === 2 * Math.PI) {
  52838. var b = this.attributes.normal.array
  52839. , w = new Ci.Vector3
  52840. , T = new Ci.Vector3
  52841. , x = new Ci.Vector3;
  52842. for (r = t * e.length * 3,
  52843. a = o = 0; o < e.length; o++,
  52844. a += 3)
  52845. w.x = b[a + 0],
  52846. w.y = b[a + 1],
  52847. w.z = b[a + 2],
  52848. T.x = b[r + a + 0],
  52849. T.y = b[r + a + 1],
  52850. T.z = b[r + a + 2],
  52851. x.addVectors(w, T).normalize(),
  52852. b[a + 0] = b[r + a + 0] = x.x,
  52853. b[a + 1] = b[r + a + 1] = x.y,
  52854. b[a + 2] = b[r + a + 2] = x.z
  52855. }
  52856. }
  52857. ,
  52858. Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52859. Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
  52860. Ci.LatheGeometry = function(e, t, i, n) {
  52861. Ci.Geometry.call(this),
  52862. this.type = "LatheGeometry",
  52863. this.parameters = {
  52864. points: e,
  52865. segments: t,
  52866. phiStart: i,
  52867. phiLength: n
  52868. },
  52869. this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
  52870. this.mergeVertices()
  52871. }
  52872. ,
  52873. Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52874. Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
  52875. Ci.PlaneGeometry = function(e, t, i, n) {
  52876. Ci.Geometry.call(this),
  52877. this.type = "PlaneGeometry",
  52878. this.parameters = {
  52879. width: e,
  52880. height: t,
  52881. widthSegments: i,
  52882. heightSegments: n
  52883. },
  52884. this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
  52885. }
  52886. ,
  52887. Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
  52888. Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
  52889. Ci.PlaneBufferGeometry = function(e, t, i, n) {
  52890. Ci.BufferGeometry.call(this),
  52891. this.type = "PlaneBufferGeometry",
  52892. this.parameters = {
  52893. width: e,
  52894. height: t,
  52895. widthSegments: i,
  52896. heightSegments: n
  52897. };
  52898. 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++)
  52899. for (var y = v * u - o, A = 0; A < l; A++) {
  52900. var C = A * h - r;
  52901. d[g] = C,
  52902. d[g + 1] = -y,
  52903. p[g + 2] = 1,
  52904. f[m] = A / a,
  52905. f[m + 1] = 1 - v / s,
  52906. g += 3,
  52907. m += 2
  52908. }
  52909. g = 0;
  52910. var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
  52911. for (v = 0; v < s; v++)
  52912. for (A = 0; A < a; A++) {
  52913. var E = A + l * v
  52914. , _ = A + l * (v + 1)
  52915. , b = A + 1 + l * (v + 1)
  52916. , w = A + 1 + l * v;
  52917. I[g] = E,
  52918. I[g + 1] = _,
  52919. I[g + 2] = w,
  52920. I[g + 3] = _,
  52921. I[g + 4] = b,
  52922. I[g + 5] = w,
  52923. g += 6
  52924. }
  52925. this.setIndex(new Ci.BufferAttribute(I,1)),
  52926. this.addAttribute("position", new Ci.BufferAttribute(d,3)),
  52927. this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
  52928. this.addAttribute("uv", new Ci.BufferAttribute(f,2))
  52929. }
  52930. ,
  52931. Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52932. Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
  52933. Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
  52934. Ci.BufferGeometry.call(this),
  52935. this.type = "RingBufferGeometry",
  52936. this.parameters = {
  52937. innerRadius: e,
  52938. outerRadius: t,
  52939. thetaSegments: i,
  52940. phiSegments: n,
  52941. thetaStart: r,
  52942. thetaLength: o
  52943. },
  52944. e = e || 20,
  52945. t = t || 50,
  52946. r = void 0 !== r ? r : 0,
  52947. o = void 0 !== o ? o : 2 * Math.PI;
  52948. 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;
  52949. for (s = 0; s <= n; s++) {
  52950. for (l = 0; l <= i; l++)
  52951. a = r + l / i * o,
  52952. A.x = v * Math.cos(a),
  52953. A.y = v * Math.sin(a),
  52954. d.setXYZ(g, A.x, A.y, A.z),
  52955. p.setXYZ(g, 0, 0, 1),
  52956. C.x = (A.x / t + 1) / 2,
  52957. C.y = (A.y / t + 1) / 2,
  52958. f.setXY(g, C.x, C.y),
  52959. g++;
  52960. v += y
  52961. }
  52962. for (s = 0; s < n; s++) {
  52963. var I = s * (i + 1);
  52964. for (l = 0; l < i; l++) {
  52965. var E = a = l + I
  52966. , _ = a + i + 1
  52967. , b = a + i + 2
  52968. , w = a + 1;
  52969. u.setX(m, E),
  52970. m++,
  52971. u.setX(m, _),
  52972. m++,
  52973. u.setX(m, b),
  52974. m++,
  52975. u.setX(m, E),
  52976. m++,
  52977. u.setX(m, b),
  52978. m++,
  52979. u.setX(m, w),
  52980. m++
  52981. }
  52982. }
  52983. this.setIndex(u),
  52984. this.addAttribute("position", d),
  52985. this.addAttribute("normal", p),
  52986. this.addAttribute("uv", f)
  52987. }
  52988. ,
  52989. Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  52990. Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
  52991. Ci.RingGeometry = function(e, t, i, n, r, o) {
  52992. Ci.Geometry.call(this),
  52993. this.type = "RingGeometry",
  52994. this.parameters = {
  52995. innerRadius: e,
  52996. outerRadius: t,
  52997. thetaSegments: i,
  52998. phiSegments: n,
  52999. thetaStart: r,
  53000. thetaLength: o
  53001. },
  53002. this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
  53003. }
  53004. ,
  53005. Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53006. Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
  53007. Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
  53008. Ci.Geometry.call(this),
  53009. this.type = "SphereGeometry",
  53010. this.parameters = {
  53011. radius: e,
  53012. widthSegments: t,
  53013. heightSegments: i,
  53014. phiStart: n,
  53015. phiLength: r,
  53016. thetaStart: o,
  53017. thetaLength: a
  53018. },
  53019. this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
  53020. }
  53021. ,
  53022. Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53023. Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
  53024. Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
  53025. Ci.BufferGeometry.call(this),
  53026. this.type = "SphereBufferGeometry",
  53027. this.parameters = {
  53028. radius: e,
  53029. widthSegments: t,
  53030. heightSegments: i,
  53031. phiStart: n,
  53032. phiLength: r,
  53033. thetaStart: o,
  53034. thetaLength: a
  53035. },
  53036. e = e || 50,
  53037. t = Math.max(3, Math.floor(t) || 8),
  53038. i = Math.max(2, Math.floor(i) || 6),
  53039. n = void 0 !== n ? n : 0,
  53040. r = void 0 !== r ? r : 2 * Math.PI;
  53041. 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++) {
  53042. for (var m = [], v = g / i, y = 0; y <= t; y++) {
  53043. var A = y / t
  53044. , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
  53045. , I = e * Math.cos(o + v * a)
  53046. , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
  53047. f.set(C, I, E).normalize(),
  53048. c.setXYZ(d, C, I, E),
  53049. h.setXYZ(d, f.x, f.y, f.z),
  53050. u.setXY(d, A, 1 - v),
  53051. m.push(d),
  53052. d++
  53053. }
  53054. p.push(m)
  53055. }
  53056. var _ = [];
  53057. for (g = 0; g < i; g++)
  53058. for (y = 0; y < t; y++) {
  53059. var b = p[g][y + 1]
  53060. , w = p[g][y]
  53061. , T = p[g + 1][y]
  53062. , x = p[g + 1][y + 1];
  53063. (0 !== g || 0 < o) && _.push(b, w, x),
  53064. (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
  53065. }
  53066. this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
  53067. this.addAttribute("position", c),
  53068. this.addAttribute("normal", h),
  53069. this.addAttribute("uv", u),
  53070. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
  53071. }
  53072. ,
  53073. Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53074. Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
  53075. Ci.TextGeometry = function(e, t) {
  53076. var i = (t = t || {}).font;
  53077. if (i instanceof Ci.Font == 0)
  53078. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  53079. new Ci.Geometry;
  53080. var n = i.generateShapes(e, t.size, t.curveSegments);
  53081. t.amount = void 0 !== t.height ? t.height : 50,
  53082. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  53083. void 0 === t.bevelSize && (t.bevelSize = 8),
  53084. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  53085. Ci.ExtrudeGeometry.call(this, n, t),
  53086. this.type = "TextGeometry"
  53087. }
  53088. ,
  53089. Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
  53090. Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
  53091. Ci.TorusBufferGeometry = function(e, t, i, n, r) {
  53092. Ci.BufferGeometry.call(this),
  53093. this.type = "TorusBufferGeometry",
  53094. this.parameters = {
  53095. radius: e,
  53096. tube: t,
  53097. radialSegments: i,
  53098. tubularSegments: n,
  53099. arc: r
  53100. },
  53101. e = e || 100,
  53102. t = t || 40,
  53103. i = Math.floor(i) || 8,
  53104. n = Math.floor(n) || 6,
  53105. r = r || 2 * Math.PI;
  53106. 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;
  53107. for (o = 0; o <= i; o++)
  53108. for (a = 0; a <= n; a++) {
  53109. var A = a / n * r
  53110. , C = o / i * Math.PI * 2;
  53111. v.x = (e + t * Math.cos(C)) * Math.cos(A),
  53112. v.y = (e + t * Math.cos(C)) * Math.sin(A),
  53113. v.z = t * Math.sin(C),
  53114. h[p] = v.x,
  53115. h[p + 1] = v.y,
  53116. h[p + 2] = v.z,
  53117. m.x = e * Math.cos(A),
  53118. m.y = e * Math.sin(A),
  53119. y.subVectors(v, m).normalize(),
  53120. u[p] = y.x,
  53121. u[p + 1] = y.y,
  53122. u[p + 2] = y.z,
  53123. d[f] = a / n,
  53124. d[f + 1] = o / i,
  53125. p += 3,
  53126. f += 2
  53127. }
  53128. for (o = 1; o <= i; o++)
  53129. for (a = 1; a <= n; a++) {
  53130. var I = (n + 1) * o + a - 1
  53131. , E = (n + 1) * (o - 1) + a - 1
  53132. , _ = (n + 1) * (o - 1) + a
  53133. , b = (n + 1) * o + a;
  53134. c[g] = I,
  53135. c[g + 1] = E,
  53136. c[g + 2] = b,
  53137. c[g + 3] = E,
  53138. c[g + 4] = _,
  53139. c[g + 5] = b,
  53140. g += 6
  53141. }
  53142. this.setIndex(new Ci.BufferAttribute(c,1)),
  53143. this.addAttribute("position", new Ci.BufferAttribute(h,3)),
  53144. this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
  53145. this.addAttribute("uv", new Ci.BufferAttribute(d,2))
  53146. }
  53147. ,
  53148. Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53149. Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
  53150. Ci.TorusGeometry = function(e, t, i, n, r) {
  53151. Ci.Geometry.call(this),
  53152. this.type = "TorusGeometry",
  53153. this.parameters = {
  53154. radius: e,
  53155. tube: t,
  53156. radialSegments: i,
  53157. tubularSegments: n,
  53158. arc: r
  53159. },
  53160. this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
  53161. }
  53162. ,
  53163. Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53164. Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
  53165. Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
  53166. function a(e, t, i, n, r) {
  53167. var o = Math.cos(e)
  53168. , a = Math.sin(e)
  53169. , s = i / t * e
  53170. , l = Math.cos(s);
  53171. r.x = n * (2 + l) * .5 * o,
  53172. r.y = n * (2 + l) * a * .5,
  53173. r.z = n * Math.sin(s) * .5
  53174. }
  53175. Ci.BufferGeometry.call(this),
  53176. this.type = "TorusKnotBufferGeometry",
  53177. this.parameters = {
  53178. radius: e,
  53179. tube: t,
  53180. tubularSegments: i,
  53181. radialSegments: n,
  53182. p: r,
  53183. q: o
  53184. },
  53185. e = e || 100,
  53186. t = t || 40,
  53187. i = Math.floor(i) || 64,
  53188. r = r || 2,
  53189. o = o || 3;
  53190. 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;
  53191. for (s = 0; s <= i; ++s) {
  53192. var w = s / i * r * Math.PI * 2;
  53193. for (a(w, r, o, e, C),
  53194. a(.01 + w, r, o, e, I),
  53195. _.subVectors(I, C),
  53196. b.addVectors(I, C),
  53197. E.crossVectors(_, b),
  53198. b.crossVectors(E, _),
  53199. E.normalize(),
  53200. b.normalize(),
  53201. l = 0; l <= n; ++l) {
  53202. var T = l / n * Math.PI * 2
  53203. , x = -t * Math.cos(T)
  53204. , S = t * Math.sin(T);
  53205. v.x = C.x + (x * b.x + S * E.x),
  53206. v.y = C.y + (x * b.y + S * E.y),
  53207. v.z = C.z + (x * b.z + S * E.z),
  53208. d.setXYZ(g, v.x, v.y, v.z),
  53209. y.subVectors(v, C).normalize(),
  53210. p.setXYZ(g, y.x, y.y, y.z),
  53211. A.x = s / i,
  53212. A.y = l / n,
  53213. f.setXY(g, A.x, A.y),
  53214. g++
  53215. }
  53216. }
  53217. for (l = 1; l <= i; l++)
  53218. for (s = 1; s <= n; s++) {
  53219. var M = (n + 1) * (l - 1) + (s - 1)
  53220. , R = (n + 1) * l + (s - 1)
  53221. , P = (n + 1) * l + s
  53222. , O = (n + 1) * (l - 1) + s;
  53223. u.setX(m, M),
  53224. m++,
  53225. u.setX(m, R),
  53226. m++,
  53227. u.setX(m, O),
  53228. m++,
  53229. u.setX(m, R),
  53230. m++,
  53231. u.setX(m, P),
  53232. m++,
  53233. u.setX(m, O),
  53234. m++
  53235. }
  53236. this.setIndex(u),
  53237. this.addAttribute("position", d),
  53238. this.addAttribute("normal", p),
  53239. this.addAttribute("uv", f)
  53240. }
  53241. ,
  53242. Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53243. Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
  53244. Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
  53245. Ci.Geometry.call(this),
  53246. this.type = "TorusKnotGeometry",
  53247. this.parameters = {
  53248. radius: e,
  53249. tube: t,
  53250. tubularSegments: i,
  53251. radialSegments: n,
  53252. p: r,
  53253. q: o
  53254. },
  53255. void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  53256. this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
  53257. this.mergeVertices()
  53258. }
  53259. ,
  53260. Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53261. Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
  53262. Ci.TubeGeometry = function(e, t, i, n, r, o) {
  53263. Ci.Geometry.call(this),
  53264. this.type = "TubeGeometry",
  53265. this.parameters = {
  53266. path: e,
  53267. segments: t,
  53268. radius: i,
  53269. radialSegments: n,
  53270. closed: r,
  53271. taper: o
  53272. },
  53273. t = t || 64,
  53274. i = i || 1,
  53275. n = n || 8,
  53276. r = r || !1,
  53277. o = o || Ci.TubeGeometry.NoTaper;
  53278. 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;
  53279. for (this.tangents = D,
  53280. this.normals = N,
  53281. this.binormals = F,
  53282. f = 0; f < P; f++)
  53283. for (M[f] = [],
  53284. l = f / (P - 1),
  53285. p = e.getPointAt(l),
  53286. D[f],
  53287. a = N[f],
  53288. s = F[f],
  53289. h = i * o(l),
  53290. g = 0; g < n; g++)
  53291. c = g / n * 2 * Math.PI,
  53292. u = -h * Math.cos(c),
  53293. d = h * Math.sin(c),
  53294. O.copy(p),
  53295. O.x += u * a.x + d * s.x,
  53296. O.y += u * a.y + d * s.y,
  53297. O.z += u * a.z + d * s.z,
  53298. M[f][g] = (T = O.x,
  53299. x = O.y,
  53300. S = O.z,
  53301. R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
  53302. for (f = 0; f < t; f++)
  53303. for (g = 0; g < n; g++)
  53304. m = r ? (f + 1) % t : f + 1,
  53305. v = (g + 1) % n,
  53306. y = M[f][g],
  53307. A = M[m][g],
  53308. C = M[m][v],
  53309. I = M[f][v],
  53310. E = new Ci.Vector2(f / t,g / n),
  53311. _ = new Ci.Vector2((f + 1) / t,g / n),
  53312. b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
  53313. w = new Ci.Vector2(f / t,(g + 1) / n),
  53314. this.faces.push(new Ci.Face3(y,A,I)),
  53315. this.faceVertexUvs[0].push([E, _, w]),
  53316. this.faces.push(new Ci.Face3(A,C,I)),
  53317. this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
  53318. this.computeFaceNormals(),
  53319. this.computeVertexNormals()
  53320. }
  53321. ,
  53322. Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53323. Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
  53324. Ci.TubeGeometry.NoTaper = function(e) {
  53325. return 1
  53326. }
  53327. ,
  53328. Ci.TubeGeometry.SinusoidalTaper = function(e) {
  53329. return Math.sin(Math.PI * e)
  53330. }
  53331. ,
  53332. Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
  53333. 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;
  53334. for (this.tangents = u,
  53335. this.normals = d,
  53336. this.binormals = p,
  53337. l = 0; l < m; l++)
  53338. c = l / (m - 1),
  53339. u[l] = e.getTangentAt(c),
  53340. u[l].normalize();
  53341. for (d[0] = new Ci.Vector3,
  53342. p[0] = new Ci.Vector3,
  53343. r = Number.MAX_VALUE,
  53344. o = Math.abs(u[0].x),
  53345. a = Math.abs(u[0].y),
  53346. s = Math.abs(u[0].z),
  53347. o <= r && (r = o,
  53348. h.set(1, 0, 0)),
  53349. a <= r && (r = a,
  53350. h.set(0, 1, 0)),
  53351. s <= r && h.set(0, 0, 1),
  53352. f.crossVectors(u[0], h).normalize(),
  53353. d[0].crossVectors(u[0], f),
  53354. p[0].crossVectors(u[0], d[0]),
  53355. l = 1; l < m; l++)
  53356. d[l] = d[l - 1].clone(),
  53357. p[l] = p[l - 1].clone(),
  53358. f.crossVectors(u[l - 1], u[l]),
  53359. f.length() > Number.EPSILON && (f.normalize(),
  53360. n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
  53361. d[l].applyMatrix4(g.makeRotationAxis(f, n))),
  53362. p[l].crossVectors(u[l], d[l]);
  53363. if (i)
  53364. for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
  53365. n /= m - 1,
  53366. 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
  53367. l = 1; l < m; l++)
  53368. d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
  53369. p[l].crossVectors(u[l], d[l])
  53370. }
  53371. ,
  53372. Ci.PolyhedronGeometry = function(e, t, i, n) {
  53373. function f(e) {
  53374. var t = e.normalize().clone();
  53375. t.index = m.vertices.push(t) - 1;
  53376. var i = a(e) / 2 / Math.PI + .5
  53377. , n = function(e) {
  53378. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  53379. }(e) / Math.PI + .5;
  53380. return t.uv = new Ci.Vector2(i,1 - n),
  53381. t
  53382. }
  53383. function g(e, t, i, n) {
  53384. var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
  53385. m.faces.push(r),
  53386. y.copy(e).add(t).add(i).divideScalar(3);
  53387. var o = a(y);
  53388. m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
  53389. }
  53390. function r(e, t) {
  53391. 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++) {
  53392. a[l] = [];
  53393. 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++)
  53394. a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
  53395. }
  53396. for (l = 0; l < i; l++)
  53397. for (d = 0; d < 2 * (i - l) - 1; d++) {
  53398. var p = Math.floor(d / 2);
  53399. 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)
  53400. }
  53401. }
  53402. function a(e) {
  53403. return Math.atan2(e.z, -e.x)
  53404. }
  53405. function s(e, t, i) {
  53406. return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
  53407. 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
  53408. e.clone()
  53409. }
  53410. Ci.Geometry.call(this),
  53411. this.type = "PolyhedronGeometry",
  53412. this.parameters = {
  53413. vertices: e,
  53414. indices: t,
  53415. radius: i,
  53416. detail: n
  53417. },
  53418. i = i || 1,
  53419. n = n || 0;
  53420. for (var m = this, o = 0, l = e.length; o < l; o += 3)
  53421. f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
  53422. var c = this.vertices
  53423. , h = []
  53424. , u = (o = 0,
  53425. 0);
  53426. for (l = t.length; o < l; o += 3,
  53427. u++) {
  53428. var d = c[t[o]]
  53429. , p = c[t[o + 1]]
  53430. , v = c[t[o + 2]];
  53431. h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
  53432. }
  53433. var y = new Ci.Vector3;
  53434. for (o = 0,
  53435. l = h.length; o < l; o++)
  53436. r(h[o], n);
  53437. for (o = 0,
  53438. l = this.faceVertexUvs[0].length; o < l; o++) {
  53439. var A = this.faceVertexUvs[0][o]
  53440. , C = A[0].x
  53441. , I = A[1].x
  53442. , E = A[2].x
  53443. , _ = Math.max(C, I, E)
  53444. , b = Math.min(C, I, E);
  53445. .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
  53446. I < .2 && (A[1].x += 1),
  53447. E < .2 && (A[2].x += 1))
  53448. }
  53449. for (o = 0,
  53450. l = this.vertices.length; o < l; o++)
  53451. this.vertices[o].multiplyScalar(i);
  53452. this.mergeVertices(),
  53453. this.computeFaceNormals(),
  53454. this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
  53455. }
  53456. ,
  53457. Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53458. Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
  53459. Ci.DodecahedronGeometry = function(e, t) {
  53460. var i = (1 + Math.sqrt(5)) / 2
  53461. , n = 1 / i
  53462. , 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];
  53463. 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),
  53464. this.type = "DodecahedronGeometry",
  53465. this.parameters = {
  53466. radius: e,
  53467. detail: t
  53468. }
  53469. }
  53470. ,
  53471. Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53472. Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
  53473. Ci.IcosahedronGeometry = function(e, t) {
  53474. var i = (1 + Math.sqrt(5)) / 2
  53475. , 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];
  53476. 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),
  53477. this.type = "IcosahedronGeometry",
  53478. this.parameters = {
  53479. radius: e,
  53480. detail: t
  53481. }
  53482. }
  53483. ,
  53484. Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53485. Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
  53486. Ci.OctahedronGeometry = function(e, t) {
  53487. 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),
  53488. this.type = "OctahedronGeometry",
  53489. this.parameters = {
  53490. radius: e,
  53491. detail: t
  53492. }
  53493. }
  53494. ,
  53495. Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53496. Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
  53497. Ci.TetrahedronGeometry = function(e, t) {
  53498. 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),
  53499. this.type = "TetrahedronGeometry",
  53500. this.parameters = {
  53501. radius: e,
  53502. detail: t
  53503. }
  53504. }
  53505. ,
  53506. Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
  53507. Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
  53508. Ci.ParametricGeometry = function(e, t, i) {
  53509. Ci.Geometry.call(this),
  53510. this.type = "ParametricGeometry",
  53511. this.parameters = {
  53512. func: e,
  53513. slices: t,
  53514. stacks: i
  53515. };
  53516. 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;
  53517. for (n = 0; n <= i; n++)
  53518. for (a = n / i,
  53519. r = 0; r <= t; r++)
  53520. o = e(r / t, a),
  53521. g.push(o);
  53522. for (n = 0; n < i; n++)
  53523. for (r = 0; r < t; r++)
  53524. l = (s = n * y + r) + 1,
  53525. c = (n + 1) * y + r + 1,
  53526. h = (n + 1) * y + r,
  53527. u = new Ci.Vector2(r / t,n / i),
  53528. d = new Ci.Vector2((r + 1) / t,n / i),
  53529. p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
  53530. f = new Ci.Vector2(r / t,(n + 1) / i),
  53531. m.push(new Ci.Face3(s,l,h)),
  53532. v.push([u, d, f]),
  53533. m.push(new Ci.Face3(l,c,h)),
  53534. v.push([d.clone(), p, f.clone()]);
  53535. this.computeFaceNormals(),
  53536. this.computeVertexNormals()
  53537. }
  53538. ,
  53539. Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
  53540. Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
  53541. Ci.WireframeGeometry = function(e) {
  53542. function t(e, t) {
  53543. return e - t
  53544. }
  53545. Ci.BufferGeometry.call(this);
  53546. var i = [0, 0]
  53547. , n = {}
  53548. , r = ["a", "b", "c"];
  53549. if (e instanceof Ci.Geometry) {
  53550. for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
  53551. for (var u = a[c], d = 0; d < 3; d++) {
  53552. i[0] = u[r[d]],
  53553. i[1] = u[r[(d + 1) % 3]],
  53554. i.sort(t),
  53555. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  53556. l[2 * s + 1] = i[1],
  53557. n[E] = !0,
  53558. s++)
  53559. }
  53560. var p = new Float32Array(2 * s * 3);
  53561. for (c = 0,
  53562. h = s; c < h; c++)
  53563. for (d = 0; d < 2; d++) {
  53564. var f = o[l[2 * c + d]];
  53565. p[(_ = 6 * c + 3 * d) + 0] = f.x,
  53566. p[_ + 1] = f.y,
  53567. p[_ + 2] = f.z
  53568. }
  53569. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  53570. } else if (e instanceof Ci.BufferGeometry)
  53571. if (null !== e.index) {
  53572. var g = e.index.array
  53573. , m = (o = e.attributes.position,
  53574. e.groups);
  53575. s = 0;
  53576. 0 === m.length && e.addGroup(0, g.length);
  53577. l = new Uint32Array(2 * g.length);
  53578. for (var v = 0, y = m.length; v < y; ++v)
  53579. for (var A = m[v], C = A.start, I = (c = C,
  53580. C + A.count); c < I; c += 3)
  53581. for (d = 0; d < 3; d++) {
  53582. var E;
  53583. i[0] = g[c + d],
  53584. i[1] = g[c + (d + 1) % 3],
  53585. i.sort(t),
  53586. void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
  53587. l[2 * s + 1] = i[1],
  53588. n[E] = !0,
  53589. s++)
  53590. }
  53591. for (p = new Float32Array(2 * s * 3),
  53592. c = 0,
  53593. h = s; c < h; c++)
  53594. for (d = 0; d < 2; d++) {
  53595. var _ = 6 * c + 3 * d
  53596. , b = l[2 * c + d];
  53597. p[_ + 0] = o.getX(b),
  53598. p[_ + 1] = o.getY(b),
  53599. p[_ + 2] = o.getZ(b)
  53600. }
  53601. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  53602. } else {
  53603. var w = (s = (o = e.attributes.position.array).length / 3) / 3;
  53604. for (p = new Float32Array(2 * s * 3),
  53605. c = 0,
  53606. h = w; c < h; c++)
  53607. for (d = 0; d < 3; d++) {
  53608. var T = 9 * c + 3 * d;
  53609. p[(_ = 18 * c + 6 * d) + 0] = o[T],
  53610. p[_ + 1] = o[1 + T],
  53611. p[_ + 2] = o[2 + T];
  53612. b = 9 * c + (d + 1) % 3 * 3;
  53613. p[_ + 3] = o[b],
  53614. p[_ + 4] = o[b + 1],
  53615. p[_ + 5] = o[b + 2]
  53616. }
  53617. this.addAttribute("position", new Ci.BufferAttribute(p,3))
  53618. }
  53619. }
  53620. ,
  53621. Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
  53622. Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
  53623. Ci.AxisHelper = function(e) {
  53624. e = e || 1;
  53625. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  53626. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  53627. , n = new Ci.BufferGeometry;
  53628. n.addAttribute("position", new Ci.BufferAttribute(t,3)),
  53629. n.addAttribute("color", new Ci.BufferAttribute(i,3));
  53630. var r = new Ci.LineBasicMaterial({
  53631. vertexColors: Ci.VertexColors
  53632. });
  53633. Ci.LineSegments.call(this, n, r)
  53634. }
  53635. ,
  53636. Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
  53637. Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
  53638. Ci.ArrowHelper = function() {
  53639. var a = new Ci.Geometry;
  53640. a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
  53641. var s = new Ci.CylinderGeometry(0,.5,1,5,1);
  53642. return s.translate(0, -.5, 0),
  53643. function(e, t, i, n, r, o) {
  53644. Ci.Object3D.call(this),
  53645. void 0 === n && (n = 16776960),
  53646. void 0 === i && (i = 1),
  53647. void 0 === r && (r = .2 * i),
  53648. void 0 === o && (o = .2 * r),
  53649. this.position.copy(t),
  53650. this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
  53651. color: n
  53652. })),
  53653. this.line.matrixAutoUpdate = !1,
  53654. this.add(this.line),
  53655. this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
  53656. color: n
  53657. })),
  53658. this.cone.matrixAutoUpdate = !1,
  53659. this.add(this.cone),
  53660. this.setDirection(e),
  53661. this.setLength(i, r, o)
  53662. }
  53663. }(),
  53664. Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
  53665. Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
  53666. Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
  53667. function(e) {
  53668. .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(),
  53669. yi = Math.acos(e.y),
  53670. this.quaternion.setFromAxisAngle(Ai, yi))
  53671. }
  53672. ),
  53673. Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
  53674. void 0 === t && (t = .2 * e),
  53675. void 0 === i && (i = .2 * t),
  53676. this.line.scale.set(1, Math.max(0, e - t), 1),
  53677. this.line.updateMatrix(),
  53678. this.cone.scale.set(i, t, i),
  53679. this.cone.position.y = e,
  53680. this.cone.updateMatrix()
  53681. }
  53682. ,
  53683. Ci.ArrowHelper.prototype.setColor = function(e) {
  53684. this.line.material.color.set(e),
  53685. this.cone.material.color.set(e)
  53686. }
  53687. ,
  53688. Ci.BoxHelper = function(e) {
  53689. 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])
  53690. , i = new Float32Array(24)
  53691. , n = new Ci.BufferGeometry;
  53692. n.setIndex(new Ci.BufferAttribute(t,1)),
  53693. n.addAttribute("position", new Ci.BufferAttribute(i,3)),
  53694. Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
  53695. color: 16776960
  53696. })),
  53697. void 0 !== e && this.update(e)
  53698. }
  53699. ,
  53700. Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
  53701. Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
  53702. Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
  53703. function(e) {
  53704. if (vi.setFromObject(e),
  53705. !vi.isEmpty()) {
  53706. var t = vi.min
  53707. , i = vi.max
  53708. , n = this.geometry.attributes.position
  53709. , r = n.array;
  53710. r[0] = i.x,
  53711. r[1] = i.y,
  53712. r[2] = i.z,
  53713. r[3] = t.x,
  53714. r[4] = i.y,
  53715. r[5] = i.z,
  53716. r[6] = t.x,
  53717. r[7] = t.y,
  53718. r[8] = i.z,
  53719. r[9] = i.x,
  53720. r[10] = t.y,
  53721. r[11] = i.z,
  53722. r[12] = i.x,
  53723. r[13] = i.y,
  53724. r[14] = t.z,
  53725. r[15] = t.x,
  53726. r[16] = i.y,
  53727. r[17] = t.z,
  53728. r[18] = t.x,
  53729. r[19] = t.y,
  53730. r[20] = t.z,
  53731. r[21] = i.x,
  53732. r[22] = t.y,
  53733. r[23] = t.z,
  53734. n.needsUpdate = !0,
  53735. this.geometry.computeBoundingSphere()
  53736. }
  53737. }
  53738. ),
  53739. Ci.BoundingBoxHelper = function(e, t) {
  53740. var i = void 0 !== t ? t : 8947848;
  53741. this.object = e,
  53742. this.box = new Ci.Box3,
  53743. Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
  53744. color: i,
  53745. wireframe: !0
  53746. }))
  53747. }
  53748. ,
  53749. Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
  53750. Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
  53751. Ci.BoundingBoxHelper.prototype.update = function() {
  53752. this.box.setFromObject(this.object),
  53753. this.box.size(this.scale),
  53754. this.box.center(this.position)
  53755. }
  53756. ,
  53757. Ci.CameraHelper = function(e) {
  53758. function t(e, t, i) {
  53759. n(e, i),
  53760. n(t, i)
  53761. }
  53762. function n(e, t) {
  53763. i.vertices.push(new Ci.Vector3),
  53764. i.colors.push(new Ci.Color(t)),
  53765. void 0 === o[e] && (o[e] = []),
  53766. o[e].push(i.vertices.length - 1)
  53767. }
  53768. var i = new Ci.Geometry
  53769. , r = new Ci.LineBasicMaterial({
  53770. color: 16777215,
  53771. vertexColors: Ci.FaceColors
  53772. })
  53773. , o = {}
  53774. , a = 16755200
  53775. , s = 16711680
  53776. , l = 3355443;
  53777. t("n1", "n2", a),
  53778. t("n2", "n4", a),
  53779. t("n4", "n3", a),
  53780. t("n3", "n1", a),
  53781. t("f1", "f2", a),
  53782. t("f2", "f4", a),
  53783. t("f4", "f3", a),
  53784. t("f3", "f1", a),
  53785. t("n1", "f1", a),
  53786. t("n2", "f2", a),
  53787. t("n3", "f3", a),
  53788. t("n4", "f4", a),
  53789. t("p", "n1", s),
  53790. t("p", "n2", s),
  53791. t("p", "n3", s),
  53792. t("p", "n4", s),
  53793. t("u1", "u2", 43775),
  53794. t("u2", "u3", 43775),
  53795. t("u3", "u1", 43775),
  53796. t("c", "t", 16777215),
  53797. t("p", "c", l),
  53798. t("cn1", "cn2", l),
  53799. t("cn3", "cn4", l),
  53800. t("cf1", "cf2", l),
  53801. t("cf3", "cf4", l),
  53802. Ci.LineSegments.call(this, i, r),
  53803. this.camera = e,
  53804. this.camera.updateProjectionMatrix(),
  53805. this.matrix = e.matrixWorld,
  53806. this.matrixAutoUpdate = !1,
  53807. this.pointMap = o,
  53808. this.update()
  53809. }
  53810. ,
  53811. Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
  53812. Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
  53813. Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
  53814. mi = new Ci.Camera,
  53815. function() {
  53816. pi = this.geometry,
  53817. fi = this.pointMap,
  53818. mi.projectionMatrix.copy(this.camera.projectionMatrix),
  53819. Ni("c", 0, 0, -1),
  53820. Ni("t", 0, 0, 1),
  53821. Ni("n1", -1, -1, -1),
  53822. Ni("n2", 1, -1, -1),
  53823. Ni("n3", -1, 1, -1),
  53824. Ni("n4", 1, 1, -1),
  53825. Ni("f1", -1, -1, 1),
  53826. Ni("f2", 1, -1, 1),
  53827. Ni("f3", -1, 1, 1),
  53828. Ni("f4", 1, 1, 1),
  53829. Ni("u1", .7, 1.1, -1),
  53830. Ni("u2", -.7, 1.1, -1),
  53831. Ni("u3", 0, 2, -1),
  53832. Ni("cf1", -1, 0, 1),
  53833. Ni("cf2", 1, 0, 1),
  53834. Ni("cf3", 0, -1, 1),
  53835. Ni("cf4", 0, 1, 1),
  53836. Ni("cn1", -1, 0, -1),
  53837. Ni("cn2", 1, 0, -1),
  53838. Ni("cn3", 0, -1, -1),
  53839. Ni("cn4", 0, 1, -1),
  53840. pi.verticesNeedUpdate = !0
  53841. }
  53842. ),
  53843. Ci.DirectionalLightHelper = function(e, t) {
  53844. Ci.Object3D.call(this),
  53845. this.light = e,
  53846. this.light.updateMatrixWorld(),
  53847. this.matrix = e.matrixWorld,
  53848. this.matrixAutoUpdate = !1,
  53849. t = t || 1;
  53850. var i = new Ci.Geometry;
  53851. 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));
  53852. var n = new Ci.LineBasicMaterial({
  53853. fog: !1
  53854. });
  53855. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  53856. this.lightPlane = new Ci.Line(i,n),
  53857. this.add(this.lightPlane),
  53858. (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
  53859. (n = new Ci.LineBasicMaterial({
  53860. fog: !1
  53861. })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
  53862. this.targetLine = new Ci.Line(i,n),
  53863. this.add(this.targetLine),
  53864. this.update()
  53865. }
  53866. ,
  53867. Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  53868. Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
  53869. Ci.DirectionalLightHelper.prototype.dispose = function() {
  53870. this.lightPlane.geometry.dispose(),
  53871. this.lightPlane.material.dispose(),
  53872. this.targetLine.geometry.dispose(),
  53873. this.targetLine.material.dispose()
  53874. }
  53875. ,
  53876. Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
  53877. ui = new Ci.Vector3,
  53878. di = new Ci.Vector3,
  53879. function() {
  53880. hi.setFromMatrixPosition(this.light.matrixWorld),
  53881. ui.setFromMatrixPosition(this.light.target.matrixWorld),
  53882. di.subVectors(ui, hi),
  53883. this.lightPlane.lookAt(di),
  53884. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  53885. this.targetLine.geometry.vertices[1].copy(di),
  53886. this.targetLine.geometry.verticesNeedUpdate = !0,
  53887. this.targetLine.material.color.copy(this.lightPlane.material.color)
  53888. }
  53889. ),
  53890. Ci.EdgesHelper = function(e, t, i) {
  53891. var n = void 0 !== t ? t : 16777215;
  53892. Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
  53893. color: n
  53894. })),
  53895. this.matrix = e.matrixWorld,
  53896. this.matrixAutoUpdate = !1
  53897. }
  53898. ,
  53899. Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
  53900. Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
  53901. Ci.FaceNormalsHelper = function(e, t, i, n) {
  53902. this.object = e,
  53903. this.size = void 0 !== t ? t : 1;
  53904. var r = void 0 !== i ? i : 16776960
  53905. , o = void 0 !== n ? n : 1
  53906. , a = 0
  53907. , s = this.object.geometry;
  53908. s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  53909. var l = new Ci.BufferGeometry
  53910. , c = new Ci.Float32Attribute(2 * a * 3,3);
  53911. l.addAttribute("position", c),
  53912. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  53913. color: r,
  53914. linewidth: o
  53915. })),
  53916. this.matrixAutoUpdate = !1,
  53917. this.update()
  53918. }
  53919. ,
  53920. Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  53921. Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
  53922. Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
  53923. li = new Ci.Vector3,
  53924. ci = new Ci.Matrix3,
  53925. function() {
  53926. this.object.updateMatrixWorld(!0),
  53927. ci.getNormalMatrix(this.object.matrixWorld);
  53928. 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++) {
  53929. var l = r[a]
  53930. , c = l.normal;
  53931. si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
  53932. li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
  53933. t.setXYZ(o, si.x, si.y, si.z),
  53934. o += 1,
  53935. t.setXYZ(o, li.x, li.y, li.z),
  53936. o += 1
  53937. }
  53938. return t.needsUpdate = !0,
  53939. this
  53940. }
  53941. ),
  53942. Ci.GridHelper = function(e, t) {
  53943. var i = new Ci.Geometry
  53944. , n = new Ci.LineBasicMaterial({
  53945. vertexColors: Ci.VertexColors
  53946. });
  53947. this.color1 = new Ci.Color(4473924),
  53948. this.color2 = new Ci.Color(8947848);
  53949. for (var r = -e; r <= e; r += t) {
  53950. 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));
  53951. var o = 0 === r ? this.color1 : this.color2;
  53952. i.colors.push(o, o, o, o)
  53953. }
  53954. Ci.LineSegments.call(this, i, n)
  53955. }
  53956. ,
  53957. Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
  53958. Ci.GridHelper.prototype.constructor = Ci.GridHelper,
  53959. Ci.GridHelper.prototype.setColors = function(e, t) {
  53960. this.color1.set(e),
  53961. this.color2.set(t),
  53962. this.geometry.colorsNeedUpdate = !0
  53963. }
  53964. ,
  53965. Ci.HemisphereLightHelper = function(e, t) {
  53966. Ci.Object3D.call(this),
  53967. this.light = e,
  53968. this.light.updateMatrixWorld(),
  53969. this.matrix = e.matrixWorld,
  53970. this.matrixAutoUpdate = !1,
  53971. this.colors = [new Ci.Color, new Ci.Color];
  53972. var i = new Ci.SphereGeometry(t,4,2);
  53973. i.rotateX(-Math.PI / 2);
  53974. for (var n = 0; n < 8; n++)
  53975. i.faces[n].color = this.colors[n < 4 ? 0 : 1];
  53976. var r = new Ci.MeshBasicMaterial({
  53977. vertexColors: Ci.FaceColors,
  53978. wireframe: !0
  53979. });
  53980. this.lightSphere = new Ci.Mesh(i,r),
  53981. this.add(this.lightSphere),
  53982. this.update()
  53983. }
  53984. ,
  53985. Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  53986. Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
  53987. Ci.HemisphereLightHelper.prototype.dispose = function() {
  53988. this.lightSphere.geometry.dispose(),
  53989. this.lightSphere.material.dispose()
  53990. }
  53991. ,
  53992. Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
  53993. function() {
  53994. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  53995. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  53996. this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
  53997. this.lightSphere.geometry.colorsNeedUpdate = !0
  53998. }
  53999. ),
  54000. Ci.PointLightHelper = function(e, t) {
  54001. this.light = e,
  54002. this.light.updateMatrixWorld();
  54003. var i = new Ci.SphereGeometry(t,4,2)
  54004. , n = new Ci.MeshBasicMaterial({
  54005. wireframe: !0,
  54006. fog: !1
  54007. });
  54008. n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  54009. Ci.Mesh.call(this, i, n),
  54010. this.matrix = this.light.matrixWorld,
  54011. this.matrixAutoUpdate = !1
  54012. }
  54013. ,
  54014. Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
  54015. Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
  54016. Ci.PointLightHelper.prototype.dispose = function() {
  54017. this.geometry.dispose(),
  54018. this.material.dispose()
  54019. }
  54020. ,
  54021. Ci.PointLightHelper.prototype.update = function() {
  54022. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54023. }
  54024. ,
  54025. Ci.SkeletonHelper = function(e) {
  54026. this.bones = this.getBoneList(e);
  54027. for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
  54028. this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
  54029. t.vertices.push(new Ci.Vector3),
  54030. t.colors.push(new Ci.Color(0,0,1)),
  54031. t.colors.push(new Ci.Color(0,1,0)))
  54032. }
  54033. t.dynamic = !0;
  54034. var n = new Ci.LineBasicMaterial({
  54035. vertexColors: Ci.VertexColors,
  54036. depthTest: !1,
  54037. depthWrite: !1,
  54038. transparent: !0
  54039. });
  54040. Ci.LineSegments.call(this, t, n),
  54041. this.root = e,
  54042. this.matrix = e.matrixWorld,
  54043. this.matrixAutoUpdate = !1,
  54044. this.update()
  54045. }
  54046. ,
  54047. Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54048. Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
  54049. Ci.SkeletonHelper.prototype.getBoneList = function(e) {
  54050. var t = [];
  54051. e instanceof Ci.Bone && t.push(e);
  54052. for (var i = 0; i < e.children.length; i++)
  54053. t.push.apply(t, this.getBoneList(e.children[i]));
  54054. return t
  54055. }
  54056. ,
  54057. Ci.SkeletonHelper.prototype.update = function() {
  54058. 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++) {
  54059. var o = this.bones[r];
  54060. o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
  54061. e.vertices[n].setFromMatrixPosition(i),
  54062. i.multiplyMatrices(t, o.parent.matrixWorld),
  54063. e.vertices[n + 1].setFromMatrixPosition(i),
  54064. n += 2)
  54065. }
  54066. e.verticesNeedUpdate = !0,
  54067. e.computeBoundingSphere()
  54068. }
  54069. ,
  54070. Ci.SpotLightHelper = function(e) {
  54071. Ci.Object3D.call(this),
  54072. this.light = e,
  54073. this.light.updateMatrixWorld(),
  54074. this.matrix = e.matrixWorld,
  54075. this.matrixAutoUpdate = !1;
  54076. var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
  54077. t.translate(0, -.5, 0),
  54078. t.rotateX(-Math.PI / 2);
  54079. var i = new Ci.MeshBasicMaterial({
  54080. wireframe: !0,
  54081. fog: !1
  54082. });
  54083. this.cone = new Ci.Mesh(t,i),
  54084. this.add(this.cone),
  54085. this.update()
  54086. }
  54087. ,
  54088. Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
  54089. Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
  54090. Ci.SpotLightHelper.prototype.dispose = function() {
  54091. this.cone.geometry.dispose(),
  54092. this.cone.material.dispose()
  54093. }
  54094. ,
  54095. Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
  54096. oi = new Ci.Vector3,
  54097. function() {
  54098. var e = this.light.distance ? this.light.distance : 1e4
  54099. , t = e * Math.tan(this.light.angle);
  54100. this.cone.scale.set(t, t, e),
  54101. ri.setFromMatrixPosition(this.light.matrixWorld),
  54102. oi.setFromMatrixPosition(this.light.target.matrixWorld),
  54103. this.cone.lookAt(oi.sub(ri)),
  54104. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  54105. }
  54106. ),
  54107. Ci.VertexNormalsHelper = function(e, t, i, n) {
  54108. this.object = e,
  54109. this.size = void 0 !== t ? t : 1;
  54110. var r = void 0 !== i ? i : 16711680
  54111. , o = void 0 !== n ? n : 1
  54112. , a = 0
  54113. , s = this.object.geometry;
  54114. s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
  54115. var l = new Ci.BufferGeometry
  54116. , c = new Ci.Float32Attribute(2 * a * 3,3);
  54117. l.addAttribute("position", c),
  54118. Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
  54119. color: r,
  54120. linewidth: o
  54121. })),
  54122. this.matrixAutoUpdate = !1,
  54123. this.update()
  54124. }
  54125. ,
  54126. Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54127. Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
  54128. Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
  54129. ii = new Ci.Vector3,
  54130. ni = new Ci.Matrix3,
  54131. function() {
  54132. var e = ["a", "b", "c"];
  54133. this.object.updateMatrixWorld(!0),
  54134. ni.getNormalMatrix(this.object.matrixWorld);
  54135. var t = this.object.matrixWorld
  54136. , i = this.geometry.attributes.position
  54137. , n = this.object.geometry;
  54138. if (n instanceof Ci.Geometry)
  54139. for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
  54140. for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
  54141. var d = r[c[e[h]]]
  54142. , p = c.vertexNormals[h];
  54143. ti.copy(d).applyMatrix4(t),
  54144. ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54145. i.setXYZ(a, ti.x, ti.y, ti.z),
  54146. a += 1,
  54147. i.setXYZ(a, ii.x, ii.y, ii.z),
  54148. a += 1
  54149. }
  54150. else if (n instanceof Ci.BufferGeometry) {
  54151. var f = n.attributes.position
  54152. , g = n.attributes.normal;
  54153. for (h = a = 0,
  54154. u = f.count; h < u; h++)
  54155. ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
  54156. ii.set(g.getX(h), g.getY(h), g.getZ(h)),
  54157. ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
  54158. i.setXYZ(a, ti.x, ti.y, ti.z),
  54159. a += 1,
  54160. i.setXYZ(a, ii.x, ii.y, ii.z),
  54161. a += 1
  54162. }
  54163. return i.needsUpdate = !0,
  54164. this
  54165. }
  54166. ),
  54167. Ci.WireframeHelper = function(e, t) {
  54168. var i = void 0 !== t ? t : 16777215;
  54169. Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
  54170. color: i
  54171. })),
  54172. this.matrix = e.matrixWorld,
  54173. this.matrixAutoUpdate = !1
  54174. }
  54175. ,
  54176. Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
  54177. Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
  54178. Ci.ImmediateRenderObject = function(e) {
  54179. Ci.Object3D.call(this),
  54180. this.material = e,
  54181. this.render = function(e) {}
  54182. }
  54183. ,
  54184. Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
  54185. Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
  54186. Ci.MorphBlendMesh = function(e, t) {
  54187. Ci.Mesh.call(this, e, t),
  54188. this.animationsMap = {},
  54189. this.animationsList = [];
  54190. var i = this.geometry.morphTargets.length
  54191. , n = i - 1
  54192. , r = i / 1;
  54193. this.createAnimation("__default", 0, n, r),
  54194. this.setAnimationWeight("__default", 1)
  54195. }
  54196. ,
  54197. Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
  54198. Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
  54199. Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  54200. var r = {
  54201. start: t,
  54202. end: i,
  54203. length: i - t + 1,
  54204. fps: n,
  54205. duration: (i - t) / n,
  54206. lastFrame: 0,
  54207. currentFrame: 0,
  54208. active: !1,
  54209. time: 0,
  54210. direction: 1,
  54211. weight: 1,
  54212. directionBackwards: !1,
  54213. mirroredLoop: !1
  54214. };
  54215. this.animationsMap[e] = r,
  54216. this.animationsList.push(r)
  54217. }
  54218. ,
  54219. Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  54220. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  54221. var s = r.morphTargets[o].name.match(i);
  54222. if (s && 1 < s.length)
  54223. n[l = s[1]] || (n[l] = {
  54224. start: 1 / 0,
  54225. end: -1 / 0
  54226. }),
  54227. o < (c = n[l]).start && (c.start = o),
  54228. o > c.end && (c.end = o),
  54229. t = t || l
  54230. }
  54231. for (var l in n) {
  54232. var c = n[l];
  54233. this.createAnimation(l, c.start, c.end, e)
  54234. }
  54235. this.firstAnimation = t
  54236. }
  54237. ,
  54238. Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  54239. var t = this.animationsMap[e];
  54240. t && (t.direction = 1,
  54241. t.directionBackwards = !1)
  54242. }
  54243. ,
  54244. Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  54245. var t = this.animationsMap[e];
  54246. t && (t.direction = -1,
  54247. t.directionBackwards = !0)
  54248. }
  54249. ,
  54250. Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  54251. var i = this.animationsMap[e];
  54252. i && (i.fps = t,
  54253. i.duration = (i.end - i.start) / i.fps)
  54254. }
  54255. ,
  54256. Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  54257. var i = this.animationsMap[e];
  54258. i && (i.duration = t,
  54259. i.fps = (i.end - i.start) / i.duration)
  54260. }
  54261. ,
  54262. Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  54263. var i = this.animationsMap[e];
  54264. i && (i.weight = t)
  54265. }
  54266. ,
  54267. Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  54268. var i = this.animationsMap[e];
  54269. i && (i.time = t)
  54270. }
  54271. ,
  54272. Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  54273. var t = 0
  54274. , i = this.animationsMap[e];
  54275. return i && (t = i.time),
  54276. t
  54277. }
  54278. ,
  54279. Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  54280. var t = -1
  54281. , i = this.animationsMap[e];
  54282. return i && (t = i.duration),
  54283. t
  54284. }
  54285. ,
  54286. Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
  54287. var t = this.animationsMap[e];
  54288. t ? (t.time = 0,
  54289. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  54290. }
  54291. ,
  54292. Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
  54293. var t = this.animationsMap[e];
  54294. t && (t.active = !1)
  54295. }
  54296. ,
  54297. Ci.MorphBlendMesh.prototype.update = function(e) {
  54298. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  54299. var n = this.animationsList[t];
  54300. if (n.active) {
  54301. var r = n.duration / n.length;
  54302. n.time += n.direction * e,
  54303. n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
  54304. n.time > n.duration && (n.time = n.duration,
  54305. n.directionBackwards = !0),
  54306. n.time < 0 && (n.time = 0,
  54307. n.directionBackwards = !1)) : (n.time = n.time % n.duration,
  54308. n.time < 0 && (n.time += n.duration));
  54309. var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
  54310. , a = n.weight;
  54311. o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
  54312. this.morphTargetInfluences[n.currentFrame] = 1 * a,
  54313. this.morphTargetInfluences[o] = 0,
  54314. n.lastFrame = n.currentFrame,
  54315. n.currentFrame = o);
  54316. var s = n.time % r / r;
  54317. n.directionBackwards && (s = 1 - s),
  54318. n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
  54319. this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
  54320. }
  54321. }
  54322. }
  54323. ,
  54324. void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
  54325. i.THREE = Ci) : this.THREE = Ci
  54326. }
  54327. , {}]
  54328. }, {}, [116]);