Session 022: Migrate Lts/Tools (72 submodules) to Qt6
- Copied complete Lts/Tools directory from qt5-before to qt6-after - Updated 32 CMakeLists.txt files (Qt5:: → Qt6::) - Tools subdirectory already included in parent Lts/CMakeLists.txt - All 72 tool submodules now present in qt6-migrated-legatus - Includes: Adler, ArAssets, ConfigX, DBAdministration, DBUpdate, DdsView, InfrastructureManagement, and 67 more tools - C++17 standard (RTI 7.7.0 compatibility maintained) - Tests deferred until final validation phase Migration progress: ✅ Lts/Application (68 files) ✅ Lts/DDS (verified Qt6-ready) ✅ Lts/Plugins (60 submodules, verified) ✅ Lts/Projects (5 submodules, verified) ✅ Lts/Proxies (13 submodules, verified) ✅ Lts/Services (47 submodules, verified) ✅ Lts/Tools (72 submodules, copied + CMake updated) ✅ Lts/Viewer (LtsFileDialog, LtsReportDisplay, SituationMap) 🟡 TetraIF (partial) 🟡 Z (partial: nglwidgets, QtSingleApplication, qsql_informix, WMS_Interface)
No files matched your search
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# $Id$
|
||||
# $HeadURL$
|
||||
# $Author$
|
||||
#
|
||||
|
||||
ADD_SUBDIRECTORY(WebSocketSimulator)
|
||||
@@ -0,0 +1,53 @@
|
||||
#
|
||||
# $Id$
|
||||
# $HeadURL$
|
||||
# $Author$
|
||||
#
|
||||
|
||||
|
||||
SET(awss_SRCS
|
||||
main.cpp
|
||||
#awss_webscoket_server.cpp
|
||||
#awss_login.cpp
|
||||
awss_base_layout.h
|
||||
awss_base_layout.cpp
|
||||
awss_login.h
|
||||
awss_login.cpp
|
||||
logger.h
|
||||
logger.cpp
|
||||
awss_exercise_chooser.h
|
||||
awss_exercise_chooser.cpp
|
||||
awss_websocket_interface.h
|
||||
awss_websocket_interface.cpp
|
||||
awss_icd_test.h
|
||||
awss_icd_test.cpp
|
||||
#awss_telegrams.h
|
||||
#awss_telegrams.cpp
|
||||
log4cxx_adlerWebSocketSimulator.props
|
||||
)
|
||||
|
||||
NGL_WRAP_UI(awss_SRCS
|
||||
awss_base_layout.ui
|
||||
awss_login.ui
|
||||
awss_exercise_chooser.ui
|
||||
awss_icd_test.ui
|
||||
)
|
||||
|
||||
NGL_ADD_EXECUTABLE(TOOLSSV AdlerWebSocketSimulator ${awss_SRCS})
|
||||
|
||||
NGL_TARGET_LINK_LIBRARIES(AdlerWebSocketSimulator
|
||||
NGLLogger
|
||||
LtsCommandLineParser
|
||||
nglsettings
|
||||
nglapplication
|
||||
saaTelegrams
|
||||
Qt6::Network
|
||||
Qt6::WebSockets
|
||||
)
|
||||
NGL_INSTALL_TARGET(AdlerWebSocketSimulator)
|
||||
|
||||
SET(LOG4CXX_PROPS_FILE log4cxx_adlerWebSocketSimulator.props)
|
||||
NGL_INSTALL(FILES SV ${CMAKE_CURRENT_SOURCE_DIR}/${LOG4CXX_PROPS_FILE} DESTINATION "bin")
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Main ADLER WebsocketSimulator Widget
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, ESZS, 2025-03-03
|
||||
*/
|
||||
|
||||
#include "awss_base_layout.h"
|
||||
#include "ui_awss_base_layout.h"
|
||||
|
||||
// widgets
|
||||
#include "awss_login.h"
|
||||
#include "awss_exercise_chooser.h"
|
||||
#include "awss_icd_test.h"
|
||||
//other
|
||||
#include "awss_websocket_interface.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
|
||||
namespace AdlerWebSocketSimulator {
|
||||
|
||||
BaseLayout::BaseLayout(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
, m_ui(new Ui::BaseLayout)
|
||||
, m_logger(getLogger("BaseLayout"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
connect(m_ui->actionBeenden, &QAction::triggered, this, &BaseLayout::close );
|
||||
connect(m_ui->actionReset, &QAction::triggered, this, &BaseLayout::onRestart );
|
||||
m_websocketInterface = new WebSocketInterface(this);
|
||||
connect(m_websocketInterface, &WebSocketInterface::gotServiceData, this, &BaseLayout::onConnectedToServer);
|
||||
connect(m_websocketInterface, &WebSocketInterface::gotExerciseData, this, &BaseLayout::onConnectedToExerciseManagement);
|
||||
connect(m_websocketInterface, &WebSocketInterface::gotPartyData, this, &BaseLayout::onExerciseChoosen);
|
||||
connect(m_websocketInterface, &WebSocketInterface::connectedToParty, this, &BaseLayout::onPartyAccepted);
|
||||
|
||||
connect(m_websocketInterface, &WebSocketInterface::statusMessage, this, &BaseLayout::onStatusMessage);
|
||||
|
||||
m_login = new Login(this);
|
||||
connect (m_login, &Login::connectToServer, m_websocketInterface, &WebSocketInterface::connectToServer);
|
||||
|
||||
|
||||
m_ui->stackWidget->addWidget(m_login);
|
||||
|
||||
m_exerciseChooser = new ExerciseChooser(this);
|
||||
connect( m_exerciseChooser, &ExerciseChooser::connectToExercise, m_websocketInterface, &WebSocketInterface::connectToParticipantManagement);
|
||||
connect( m_exerciseChooser, &ExerciseChooser::requestExerciseInformation, m_websocketInterface, &WebSocketInterface::connectToExerciseManagement);
|
||||
connect( m_exerciseChooser, &ExerciseChooser::connectToProxy, m_websocketInterface, &WebSocketInterface::connectToProxy);
|
||||
m_ui->stackWidget->addWidget(m_exerciseChooser);
|
||||
|
||||
m_icdTest = new ICDTest(this);
|
||||
connect(m_icdTest, &ICDTest::messsageToProxy, m_websocketInterface, &WebSocketInterface::sendToProxy);
|
||||
connect(m_icdTest, &ICDTest::doRestart, this, &BaseLayout::onRestart);
|
||||
connect(m_websocketInterface, &WebSocketInterface::proxyMessage, m_icdTest, &ICDTest::messsageFromProxy);
|
||||
|
||||
m_ui->stackWidget->addWidget(m_icdTest);
|
||||
|
||||
|
||||
}
|
||||
|
||||
BaseLayout::~BaseLayout()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
|
||||
void BaseLayout::onConnectedToServer(const QString &message)
|
||||
{
|
||||
m_ui->stackWidget->setCurrentWidget(m_exerciseChooser);
|
||||
m_exerciseChooser->setExercises(message);
|
||||
}
|
||||
|
||||
void BaseLayout::onConnectedToExerciseManagement(const QString &message)
|
||||
{
|
||||
m_exerciseChooser->setExeciseInfo(message);
|
||||
}
|
||||
|
||||
void BaseLayout::onExerciseChoosen(const QString &message)
|
||||
{
|
||||
m_ui->stackWidget->setCurrentWidget(m_exerciseChooser);
|
||||
m_exerciseChooser->setPartyData(message);
|
||||
|
||||
}
|
||||
|
||||
void BaseLayout::onPartyAccepted(int partyId, const QString &partyName, int saaId )
|
||||
{
|
||||
m_ui->stackWidget->setCurrentWidget(m_icdTest);
|
||||
m_icdTest->initParty(partyId, partyName, saaId);
|
||||
|
||||
//m_icdTest->setParty()
|
||||
}
|
||||
|
||||
void BaseLayout::onStatusMessage(const QString &message)
|
||||
{
|
||||
m_ui->statusbar->showMessage(message);
|
||||
}
|
||||
|
||||
void BaseLayout::onRestart()
|
||||
{
|
||||
m_ui->stackWidget->setCurrentWidget(m_login);
|
||||
m_websocketInterface->reset();
|
||||
|
||||
}
|
||||
|
||||
} // #namespace AdlerWebSocketSimulator
|
||||
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Main ADLER WebsocketSimulator Widget
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, ESZS, 2025-03-03
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <QMainWindow>
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
namespace Ui {
|
||||
class BaseLayout;
|
||||
}
|
||||
|
||||
namespace AdlerWebSocketSimulator {
|
||||
// Casses
|
||||
class Login;
|
||||
class ExerciseChooser;
|
||||
class WebSocketInterface;
|
||||
class ICDTest;
|
||||
|
||||
class BaseLayout : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BaseLayout(QWidget *parent = nullptr);
|
||||
~BaseLayout();
|
||||
|
||||
private:
|
||||
//void connectToServer(const QString &servername, int port);
|
||||
|
||||
private slots:
|
||||
void onConnectedToServer(const QString &message);
|
||||
void onConnectedToExerciseManagement(const QString &message);
|
||||
void onExerciseChoosen(const QString &message);
|
||||
void onPartyAccepted(int partyId, const QString &partyName, int saaId);
|
||||
void onStatusMessage(const QString &message);
|
||||
void onRestart();
|
||||
|
||||
private:
|
||||
Ui::BaseLayout *m_ui;
|
||||
Login *m_login {nullptr};
|
||||
ExerciseChooser *m_exerciseChooser {nullptr};
|
||||
ICDTest *m_icdTest{nullptr};
|
||||
WebSocketInterface *m_websocketInterface {nullptr};
|
||||
LOGGER_T m_logger;
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // #namespace AdlerWebSocketSimulator
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>BaseLayout</class>
|
||||
<widget class="QMainWindow" name="BaseLayout">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QStackedWidget" name="stackWidget"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFiles">
|
||||
<property name="title">
|
||||
<string>Datei</string>
|
||||
</property>
|
||||
<addaction name="actionBeenden"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuAblage">
|
||||
<property name="title">
|
||||
<string>Ablage</string>
|
||||
</property>
|
||||
<addaction name="actionReset"/>
|
||||
</widget>
|
||||
<addaction name="menuFiles"/>
|
||||
<addaction name="menuAblage"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<action name="actionBeenden">
|
||||
<property name="text">
|
||||
<string>Beenden</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionReset">
|
||||
<property name="text">
|
||||
<string>Reset</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,235 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* ExerciseChooser Widget for ADLER WebsocketSimulator
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, ESZS, 2025-03-03
|
||||
*/
|
||||
|
||||
#include "awss_exercise_chooser.h"
|
||||
#include "ui_awss_exercise_chooser.h"
|
||||
|
||||
#include <QtCore/QJsonDocument>
|
||||
#include <QtCore/QJsonArray>
|
||||
#include <QtCore/QJsonObject>
|
||||
#include <QPushButton>
|
||||
|
||||
namespace AdlerWebSocketSimulator {
|
||||
|
||||
ExerciseChooser::ExerciseChooser(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_ui(new Ui::ExerciseChooser)
|
||||
, m_logger(getLogger("ExerciseChooser"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_ui->stackedWidget->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
ExerciseChooser::~ExerciseChooser()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void ExerciseChooser::setExercises(const QString &message)
|
||||
{
|
||||
ERROR_LOG(m_logger) << message;
|
||||
if (!m_ui->vlExercises->isEmpty())
|
||||
{
|
||||
for (auto ptr : m_ui->Exercise->findChildren<QPushButton*>())
|
||||
{
|
||||
m_ui->vlExercises->removeWidget(ptr);
|
||||
ptr->deleteLater();
|
||||
}
|
||||
//remove all
|
||||
}
|
||||
QJsonDocument doc = QJsonDocument::fromJson(message.toUtf8());// = QJsonDocument::fromJson(message);
|
||||
if (!doc.object().contains(QStringLiteral("data")))
|
||||
return;
|
||||
|
||||
QJsonValue val = doc.object().value(QStringLiteral("data"));
|
||||
if (!val.isArray())
|
||||
return;
|
||||
|
||||
for (const auto &ex: val.toArray())
|
||||
{
|
||||
// ERROR_LOG(m_logger) << ex;
|
||||
int ppmPort = 0;
|
||||
QJsonObject ob = ex.toObject();
|
||||
if (!ob.contains(QStringLiteral("exerciseId")))
|
||||
return;
|
||||
//get current Exercise ID
|
||||
int id = ob.value(QStringLiteral("exerciseId")).toInt();
|
||||
|
||||
// now querry services for PPM Port
|
||||
if (ob.contains(QStringLiteral("services")))
|
||||
{
|
||||
QJsonValue services = ob.value(QStringLiteral("services"));
|
||||
if (!services.isArray())
|
||||
return;
|
||||
for (const auto &serv :services.toArray())
|
||||
{
|
||||
if (!serv.toObject().isEmpty()
|
||||
&& serv.toObject().contains(QStringLiteral("nameAbbrevation")))
|
||||
{
|
||||
bool isTab = serv.toObject().value(QStringLiteral("nameAbbrevation")).toString().toLower() == QStringLiteral("tab");
|
||||
bool isPpm = serv.toObject().value(QStringLiteral("nameAbbrevation")).toString().toLower() == QStringLiteral("ppm");
|
||||
bool isExm = serv.toObject().value(QStringLiteral("nameAbbrevation")).toString().toLower() == QStringLiteral("exm");
|
||||
if (!isTab && !isPpm && !isExm)
|
||||
continue;
|
||||
|
||||
QJsonValue ports = serv.toObject().value(QStringLiteral("ports"));
|
||||
if (!ports.isArray())
|
||||
return;
|
||||
|
||||
for (const auto &port: ports.toArray())
|
||||
{
|
||||
if (!port.toObject().contains(QStringLiteral("typeId")) || !port.toObject().contains(QStringLiteral("number")) )
|
||||
return;
|
||||
if (isExm && port.toObject().value(QStringLiteral("typeId")).toInt() == 1)
|
||||
{
|
||||
m_exmPort = port.toObject().value(QStringLiteral("number")).toInt() ;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isPpm && port.toObject().value(QStringLiteral("typeId")).toInt() == 1)
|
||||
{
|
||||
ppmPort = port.toObject().value(QStringLiteral("number")).toInt() ;
|
||||
}
|
||||
if (isTab && port.toObject().value(QStringLiteral("typeId")).toInt() == 3)
|
||||
{
|
||||
int tabPort = port.toObject().value(QStringLiteral("number")).toInt() ;
|
||||
m_execerciseToProxyPort.insert(id, tabPort );
|
||||
continue;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (ppmPort <= 0 || id <= 0)
|
||||
continue;
|
||||
QPushButton *btn = new QPushButton(tr("Exercise: ")+ QString::number(id));
|
||||
btn->setProperty("port", ppmPort);
|
||||
btn->setProperty("excerciseId", id);
|
||||
btn->setDisabled(true);
|
||||
btn->setSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding);
|
||||
connect( btn, &QPushButton::clicked, this, &ExerciseChooser::onExerciseClicked);
|
||||
m_ui->vlExercises->addWidget(btn);
|
||||
}
|
||||
|
||||
if (m_exmPort > 0)
|
||||
{
|
||||
emit requestExerciseInformation(m_exmPort);
|
||||
}
|
||||
|
||||
//parse exercises
|
||||
}
|
||||
|
||||
void ExerciseChooser::setExeciseInfo(const QString &message)
|
||||
{
|
||||
ERROR_LOG(m_logger) << message;
|
||||
if (m_ui->vlExercises->isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
QJsonDocument doc = QJsonDocument::fromJson(message.toUtf8());// = QJsonDocument::fromJson(message);
|
||||
if (!doc.object().contains(QStringLiteral("data")))
|
||||
return;
|
||||
|
||||
QJsonValue val = doc.object().value(QStringLiteral("data"));
|
||||
if (!val.isArray())
|
||||
return;
|
||||
|
||||
for (const auto &ex: val.toArray())
|
||||
{
|
||||
if (ex.toObject().isEmpty())
|
||||
return;
|
||||
const QJsonObject &exOb = ex.toObject();
|
||||
if (!exOb.contains(QStringLiteral("status")) || !exOb.contains(QStringLiteral("id")))
|
||||
return;
|
||||
int id = exOb.value(QStringLiteral("id")).toInt();
|
||||
int status = exOb.value(QStringLiteral("status")).toInt();
|
||||
for (auto ptr : m_ui->Exercise->findChildren<QPushButton *>(QString()))
|
||||
{
|
||||
if (ptr->property("excerciseId").toInt() == id)
|
||||
{
|
||||
if (status > 1 && status < 6)
|
||||
ptr->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void ExerciseChooser::setPartyData(const QString &message)
|
||||
{
|
||||
if (!m_ui->vlParty->isEmpty())
|
||||
{
|
||||
for (auto ptr : m_ui->Party->findChildren<QPushButton*>())
|
||||
{
|
||||
m_ui->vlParty->removeWidget(ptr);
|
||||
ptr->deleteLater();
|
||||
}
|
||||
//remove all
|
||||
}
|
||||
QJsonDocument doc = QJsonDocument::fromJson(message.toUtf8());// = QJsonDocument::fromJson(message);
|
||||
if (!doc.object().contains(QStringLiteral("data")))
|
||||
return;
|
||||
|
||||
QJsonValue val = doc.object().value(QStringLiteral("data"));
|
||||
if (!val.isArray())
|
||||
return;
|
||||
|
||||
for (const auto &partyData: val.toArray())
|
||||
{
|
||||
// ERROR_LOG(m_logger) << ex;
|
||||
|
||||
QJsonObject ob = partyData.toObject();
|
||||
|
||||
int id = ob.value(QStringLiteral("id")).toInt();
|
||||
if (id <= 1) // 0 ist pool 1 is OC
|
||||
continue;
|
||||
QString name;
|
||||
QColor color;
|
||||
// now querry services for PPM Port
|
||||
if (!ob.contains(QStringLiteral("name")))
|
||||
return;
|
||||
|
||||
name = ob.value(QStringLiteral("name")).toString();
|
||||
|
||||
if (!ob.contains(QStringLiteral("color")))
|
||||
return;
|
||||
|
||||
color = QColor::fromRgb(QRgb(ob.value(QStringLiteral("color")).toInt()));
|
||||
|
||||
QPushButton *btn = new QPushButton(tr("Name: ") + name);
|
||||
btn->setStyleSheet(QStringLiteral("background-color: %1").arg(color.name()));
|
||||
btn->setProperty("id", id);
|
||||
btn->setProperty("name", name);
|
||||
btn->setSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding);
|
||||
connect( btn, &QPushButton::clicked, this, &ExerciseChooser::onPartyClicked);
|
||||
m_ui->vlParty->addWidget(btn);
|
||||
}
|
||||
|
||||
m_ui->stackedWidget->setCurrentIndex(1);
|
||||
|
||||
}
|
||||
|
||||
void ExerciseChooser::onExerciseClicked()
|
||||
{
|
||||
int port = sender()->property("port").toInt();
|
||||
int excerciseId = sender()->property("excerciseId").toInt();
|
||||
m_currentExercise = excerciseId;
|
||||
emit connectToExercise(port);
|
||||
}
|
||||
|
||||
void ExerciseChooser::onPartyClicked()
|
||||
{
|
||||
int partyId = sender()->property("id").toInt();
|
||||
QString partyName = sender()->property("name").toString();
|
||||
emit connectToProxy(m_execerciseToProxyPort.value(m_currentExercise), partyId, partyName);
|
||||
}
|
||||
|
||||
} //namespace AdlerWebSocketSimulator
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* ExerciseChooser Widget for ADLER WebsocketSimulator
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, ESZS, 2025-03-03
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <QWidget>
|
||||
#include <QtCore/QMap>
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
namespace Ui {
|
||||
class ExerciseChooser;
|
||||
}
|
||||
namespace AdlerWebSocketSimulator {
|
||||
|
||||
class ExerciseChooser : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ExerciseChooser(QWidget *parent = nullptr);
|
||||
~ExerciseChooser();
|
||||
void setExercises(const QString &message);
|
||||
void setExeciseInfo(const QString &message);
|
||||
void setPartyData(const QString &message);
|
||||
|
||||
private slots:
|
||||
void onExerciseClicked();
|
||||
void onPartyClicked();
|
||||
|
||||
signals:
|
||||
void connectToExercise(int);
|
||||
void requestExerciseInformation(int);
|
||||
void connectToProxy(int, int, const QString &);
|
||||
|
||||
private:
|
||||
Ui::ExerciseChooser *m_ui;
|
||||
int m_exmPort {0};
|
||||
int m_currentExercise {0};
|
||||
QMap<int,int> m_execerciseToProxyPort;
|
||||
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
|
||||
} //namespace AdlerWebSocketSimulator
|
||||
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ExerciseChooser</class>
|
||||
<widget class="QWidget" name="ExerciseChooser">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="0">
|
||||
<widget class="QStackedWidget" name="stackedWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="Exercise">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>17</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Choose Exercise</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QVBoxLayout" name="vlExercises"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>216</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="Party">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>17</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Choose Party</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QVBoxLayout" name="vlParty"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>216</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,106 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Main Test UI for ADLER WebsocketSimulator
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, ESZS, 2025-03-03
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <QtCore/QTimer>
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class ICDTest;
|
||||
}
|
||||
namespace AdlerJson
|
||||
{
|
||||
struct EXTelegramBase;
|
||||
enum class Szenarstatus;
|
||||
} // namespace AdlerJson
|
||||
namespace AdlerWebSocketSimulator
|
||||
{
|
||||
class ICDTest : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ICDTest(QWidget *parent = nullptr);
|
||||
~ICDTest();
|
||||
void initParty(int partyId, const QString &name, int saaId);
|
||||
void messsageFromProxy(const QString &message);
|
||||
|
||||
signals:
|
||||
void messsageToProxy(const QString &message);
|
||||
void doRestart();
|
||||
|
||||
private slots:
|
||||
void generateConnectMessage();
|
||||
void generateConnectMessageStandalone();
|
||||
|
||||
void sendDirectInputMessage();
|
||||
void generateDisconnectMessage();
|
||||
void generateTechnischeQuittierung();
|
||||
void generateStatusMessageStop();
|
||||
void generateStatusMessagePlanned();
|
||||
void generateStatusMessageInactive();
|
||||
void generateStatusMessageActive();
|
||||
void generateStatusMessage(AdlerJson::Szenarstatus status);
|
||||
void generateConnectionTestMessage();
|
||||
// fire
|
||||
void generateEXFQBABBFK(); // Planungsdaten
|
||||
void generateEXFQBABBFK_Gmlrs(); // Planungsdaten Gmlrs
|
||||
void generateEXFQBABBFK_Dm72(); // Planungsdaten DM72
|
||||
void generateEXFQBABBFK_ESG(); // Planungsdaten Original ESG-Telegramm
|
||||
void generateEXFQBABBFK_SMART_ESG(); // Planungsdaten SMART Original ESG-Telegramm
|
||||
void generateEXFQFN(); // Feuern
|
||||
void generateEXFQFN_Gmlrs(); // Feuern Gmlrs
|
||||
void generateEXFQFN_Dm72(); // Feuern DM72
|
||||
void generateEXFQFN_ESG(); // Feuern Original ESG-Telegramm
|
||||
void generateFlugbahndaten_ESG();
|
||||
|
||||
void generateEXFH(); // Feuer Halt / Einstellen
|
||||
void generateEXSQFS(); // Stellungsmeldung Feuerstellung
|
||||
void generateEXSQWS(); // Stellungsmeldung Waffensystem
|
||||
void generateEXSQWS_Gmlrs(); // Stellungsmeldung Waffensystem Gmlrs
|
||||
void generateEXSQWS_dm72(); // Stellungsmeldung Waffensystem DM72
|
||||
void generateEXSQWS_ESG(); // Stellungsmeldung Waffensystem
|
||||
// dont fire
|
||||
void generateEXFQnFN(); // Nicht Feuern -> wird ausgeführt wenn Feuerhalt ausgeführt wurde
|
||||
// special EXSQWS
|
||||
void generateEXSQWS_8MTP(); // Stellungsmeldung Waffensystem
|
||||
|
||||
void generateEXSQLP(); // Stellungsmeldung Ladeplatz
|
||||
void generateEXRES(); // Senden Erkundungsergebnisse
|
||||
void generateEXHQK(); // Fuehrungslinien (Koordinierungsmassnahmen zur Feuerunterstuetzung)
|
||||
void generateEXHQ_G_ALLE_EX_L24(); // EX-HQ(G) Aus Jira-Punkt E01562_388
|
||||
void generateEXHQ_K_ALLE_EX_L25(); // EX-HQ(K) Aus Jira-Punkt E01562_388
|
||||
void generateEXHQG(); // Fuehrungslinien und Grenzen
|
||||
void generateEXAQ(); // Freitextmeldung
|
||||
void generateEXFlugbahnberechnung(); // Flugbahnberechnung
|
||||
void generateEXFlugbahndaten(); // Flugbahndaten
|
||||
void onSendHeartbeatChanged();
|
||||
|
||||
private:
|
||||
void generateConnectionPage();
|
||||
void generateEsgPage();
|
||||
void generateFirePage();
|
||||
void generatePositionReportsPage();
|
||||
void generateTrajectoryGenerationPage();
|
||||
void generateTextMessagePage();
|
||||
void generateErkundungsergebnissePage();
|
||||
void generateStatusPage();
|
||||
void generateEXSQWS_1WS(const QString &verein, const QString &kenner);
|
||||
|
||||
private:
|
||||
Ui::ICDTest *m_ui;
|
||||
int m_partyId{0};
|
||||
int m_saaId{0};
|
||||
QTimer m_heartbeatTimer;
|
||||
QString m_lastFeuerkampfReferenz;
|
||||
QString m_fixedReference;
|
||||
};
|
||||
|
||||
} // namespace AdlerWebSocketSimulator
|
||||
@@ -0,0 +1,181 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ICDTest</class>
|
||||
<widget class="QWidget" name="ICDTest">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>639</width>
|
||||
<height>455</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>17</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Test ADLER for Party:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblParty">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>17</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><Party></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>17</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>SAA: </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lblId">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>17</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><ID></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="tbRestart">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>13</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Restart</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="0,2">
|
||||
<item>
|
||||
<widget class="QToolBox" name="toolBox">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="pConnection">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>76</width>
|
||||
<height>364</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
<string>Connections</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTextEdit" name="textEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButton_2">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="tbTrash">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="edit-clear"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Login Screen for ADLER WebsocketSimulator
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, ESZS, 2025-03-03
|
||||
*/
|
||||
|
||||
#include "awss_login.h"
|
||||
#include "ui_awss_login.h"
|
||||
|
||||
|
||||
namespace AdlerWebSocketSimulator {
|
||||
|
||||
Login::Login(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_ui(new Ui::Login)
|
||||
, m_logger(getLogger("Login"))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
connect( m_ui->pbConnect, &QPushButton::clicked, this, &Login::onConnectToServer);
|
||||
}
|
||||
|
||||
Login::~Login()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void Login::onConnectToServer()
|
||||
{
|
||||
QString serverName = m_ui->leServerName->text();
|
||||
int port = m_ui->lePort->text().toInt();
|
||||
int id = m_ui->leSaaId->text().toInt();
|
||||
if (m_ui->leServerName->text().isEmpty())
|
||||
serverName = m_ui->leServerName->placeholderText();
|
||||
|
||||
if (m_ui->lePort->text().isEmpty())
|
||||
port = m_ui->lePort->placeholderText().toInt();
|
||||
|
||||
if (m_ui->leSaaId->text().isEmpty())
|
||||
id = m_ui->leSaaId->placeholderText().toInt();
|
||||
|
||||
emit connectToServer(serverName, port, id);
|
||||
}
|
||||
|
||||
} // #namespace AdlerWebSocketSimulator
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Login Screen for ADLER WebsocketSimulator
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, ESZS, 2025-03-03
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <QWidget>
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
namespace Ui {
|
||||
class Login;
|
||||
}
|
||||
|
||||
namespace AdlerWebSocketSimulator {
|
||||
|
||||
class Login : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit Login(QWidget *parent = nullptr);
|
||||
~Login();
|
||||
|
||||
private slots:
|
||||
void onConnectToServer();
|
||||
|
||||
signals:
|
||||
void connectToServer(const QString servername, int port , int id = 0);
|
||||
|
||||
private:
|
||||
Ui::Login *m_ui;
|
||||
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
} // #namespace AdlerWebSocketSimulator
|
||||
@@ -0,0 +1,134 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Login</class>
|
||||
<widget class="QWidget" name="Login">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>514</width>
|
||||
<height>381</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="leServerName">
|
||||
<property name="placeholderText">
|
||||
<string notr="true">localhost</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="Line" name="line">
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="midLineWidth">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>17</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Connect To Server:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>17</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="lePort">
|
||||
<property name="inputMethodHints">
|
||||
<set>Qt::ImhDigitsOnly</set>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string notr="true">7300</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lblServerName">
|
||||
<property name="text">
|
||||
<string>Server Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="pbConnect">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>13</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Connect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lblPort">
|
||||
<property name="text">
|
||||
<string>Port:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="leSaaId">
|
||||
<property name="inputMethodHints">
|
||||
<set>Qt::ImhDigitsOnly</set>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>1</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>SAAX@GUEZ.DE</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -0,0 +1,287 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Websocket interface for ADLER WebsocketSimulator
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, ESZS, 2025-03-03
|
||||
*/
|
||||
|
||||
#include "awss_websocket_interface.h"
|
||||
|
||||
namespace AdlerWebSocketSimulator {
|
||||
|
||||
WebSocketInterface::WebSocketInterface(QObject *parent)
|
||||
: QObject{parent}
|
||||
, m_logger(getLogger("WebSocketInterface"))
|
||||
{
|
||||
m_socket = new QWebSocket();
|
||||
connect(m_socket, &QWebSocket::textMessageReceived, this, &WebSocketInterface::onTextMessageRecived);
|
||||
connect(m_socket, &QWebSocket::connected, this, &WebSocketInterface::onConnected);
|
||||
connect(m_socket, &QWebSocket::disconnected, this, &WebSocketInterface::onDisconnected);
|
||||
connect(m_socket, QOverload<QAbstractSocket::SocketError>::of(&QWebSocket::error), this, &WebSocketInterface::onError);
|
||||
}
|
||||
|
||||
void WebSocketInterface::reset()
|
||||
{
|
||||
m_socket->close();
|
||||
m_hostname.clear();
|
||||
m_partyId = 0;
|
||||
m_partyName.clear();
|
||||
m_awss_state = AWSS_STATE::Unconnected;
|
||||
}
|
||||
|
||||
void WebSocketInterface::requestServicePortInformation()
|
||||
{
|
||||
emit statusMessage(tr("Start Service Information Request"));
|
||||
m_socket->sendTextMessage(QStringLiteral("{\"type\": \"servicePortsInformationRequest\",\"uuid\": \"%s\"}").arg(QUuid::createUuid().toString()));
|
||||
m_awss_state = AWSS_STATE::RequestServicePorts;
|
||||
|
||||
}
|
||||
|
||||
void WebSocketInterface::requestExcerciseInformation()
|
||||
{
|
||||
emit statusMessage(tr("Start Excercise Information Request"));
|
||||
m_awss_state = AWSS_STATE::RequestExerciseInformation;
|
||||
m_socket->sendTextMessage(QStringLiteral("{\"type\": \"exerciseInformationRequest\",\"uuid\": \"%1\"}").arg(QUuid::createUuid().toString()));
|
||||
|
||||
}
|
||||
|
||||
void WebSocketInterface::requestPartyInformation()
|
||||
{
|
||||
emit statusMessage(tr("Start Party Information Request"));
|
||||
m_awss_state = AWSS_STATE::RequestPartyInformation;
|
||||
m_socket->sendTextMessage(QStringLiteral("{\"type\": \"partyBaseData\",\"uuid\": \"%1\"}").arg(QUuid::createUuid().toString()));
|
||||
}
|
||||
|
||||
void WebSocketInterface::connectToServer(const QString servername, int port, int saaId)
|
||||
{
|
||||
emit statusMessage(tr("Connecting to ServiceManagement on %1 : %2 for SAA%3").arg(servername).arg(port, saaId));
|
||||
if (m_socket->state() != QAbstractSocket::UnconnectedState)
|
||||
m_socket->close();
|
||||
m_hostname = servername;
|
||||
m_port = port;
|
||||
m_saaId = saaId;
|
||||
QUrl url = QUrl(QLatin1String("ws://") + servername + QLatin1Char(':') + QString::number(port));
|
||||
m_socket->open(url);
|
||||
m_awss_state = AWSS_STATE::ConnectToServer;
|
||||
}
|
||||
|
||||
void WebSocketInterface::connectToExerciseManagement(int port)
|
||||
{
|
||||
emit statusMessage(tr("Connecting to ExcerciseManagement on %1 : %2 ").arg(m_hostname).arg(port));
|
||||
m_socket->close();
|
||||
m_port = port;
|
||||
QUrl url = QUrl(QLatin1String("ws://") + m_hostname + QLatin1Char(':') + QString::number(port));
|
||||
m_awss_state = AWSS_STATE::ConnectToExerciseManagement;
|
||||
|
||||
m_socket->open(url);
|
||||
}
|
||||
|
||||
void WebSocketInterface::connectToParticipantManagement(int port)
|
||||
{
|
||||
emit statusMessage(tr("Connecting to ParticimantManagement on %1 : %2 ").arg(m_hostname).arg(port));
|
||||
m_socket->close();
|
||||
m_port = port;
|
||||
QUrl url = QUrl(QLatin1String("ws://") + m_hostname + QLatin1Char(':') + QString::number(port));
|
||||
m_awss_state = AWSS_STATE::ConnectToParticipantManagement;
|
||||
|
||||
m_socket->open(url);
|
||||
}
|
||||
|
||||
void WebSocketInterface::connectToProxy(int port, int partyId, const QString &partyName)
|
||||
{
|
||||
emit statusMessage(tr("Connecting to Proxy on %1 : %2 for party: %3").arg(m_hostname).arg(port).arg(partyName));
|
||||
m_socket->close();
|
||||
m_port = port;
|
||||
m_partyId = partyId;
|
||||
m_partyName = partyName;
|
||||
QUrl url = QUrl(QLatin1String("ws://") + m_hostname + QLatin1Char(':') + QString::number(port));
|
||||
m_awss_state = AWSS_STATE::ConnectToProxy;
|
||||
m_socket->open(url);
|
||||
|
||||
}
|
||||
|
||||
void WebSocketInterface::sendToProxy(const QString &message)
|
||||
{
|
||||
if (m_socket->state() != QAbstractSocket::ConnectedState)
|
||||
return;
|
||||
m_socket->sendTextMessage(message);
|
||||
}
|
||||
|
||||
void WebSocketInterface::sendFlugbahndaten(QString uuid)
|
||||
{
|
||||
AdlerJson::ExFlugbahndaten req;
|
||||
NOTICE_LOG(m_logger) << "WebSocketInterface::sendFlugbahndaten uuid=" << uuid;
|
||||
GenerateTelegrams::addHeaderData(req, m_saaId);
|
||||
GenerateTelegrams::generateFlugbahndaten(req);
|
||||
req.referenceUuid = uuid;
|
||||
|
||||
QJsonObject messageObj =req.toJson();
|
||||
QString message = QString::fromUtf8(QJsonDocument(messageObj).toJson());
|
||||
sendToProxy(message);
|
||||
}
|
||||
|
||||
|
||||
void WebSocketInterface::onTextMessageRecived(const QString &message)
|
||||
{
|
||||
switch (m_awss_state)
|
||||
{
|
||||
case AWSS_STATE::RequestServicePorts:
|
||||
emit statusMessage(tr("Recieved Service Ports"));
|
||||
emit gotServiceData(message);
|
||||
break;
|
||||
case AWSS_STATE::RequestExerciseInformation:
|
||||
emit statusMessage(tr("Recieved Exercise Information"));
|
||||
emit gotExerciseData(message);
|
||||
break;
|
||||
case AWSS_STATE::RequestPartyInformation:
|
||||
emit statusMessage(tr("Recieved Party Information"));
|
||||
emit gotPartyData(message);
|
||||
break;
|
||||
case AWSS_STATE::ConnectedToProxy:
|
||||
emit statusMessage(tr("Recieved Message"));
|
||||
emit proxyMessage(message);
|
||||
//emit gotPartyData(message);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
QJsonDocument jsonDoc = QJsonDocument::fromJson(message.toUtf8());
|
||||
const QJsonObject jsonObj = jsonDoc.object();
|
||||
if ( jsonObj.contains(QStringLiteral("type")))
|
||||
if ( jsonObj.value(QStringLiteral("type")) == QStringLiteral("EX-Flugbahnberechnung"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "type=" << jsonObj.value(QStringLiteral("type")).toString();
|
||||
DEBUG_LOG(m_logger) << "reciver=" << jsonObj.value(QStringLiteral("reciver")).toString();
|
||||
DEBUG_LOG(m_logger) << "sender=" << jsonObj.value(QStringLiteral("sender")).toString();
|
||||
DEBUG_LOG(m_logger) << "timestamp=" << jsonObj.value(QStringLiteral("timestamp")).toString();
|
||||
DEBUG_LOG(m_logger) << "uuid=" << jsonObj.value(QStringLiteral("uuid")).toString();
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "Sende Flugbahndaten";
|
||||
if ( !jsonObj.contains(QStringLiteral("uuid")))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "No uuid available"
|
||||
<< ", message=" << message;
|
||||
return;
|
||||
}
|
||||
QString uuid = jsonObj.value(QStringLiteral("uuid")).toString();
|
||||
sendFlugbahndaten(uuid);
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "Received Message from WebSocket: "
|
||||
<< ", port :" << m_port
|
||||
<< ", message : " << message;
|
||||
}
|
||||
|
||||
void WebSocketInterface::onConnected()
|
||||
{
|
||||
switch (m_awss_state)
|
||||
{
|
||||
case AWSS_STATE::ConnectToServer:
|
||||
{
|
||||
m_awss_state = AWSS_STATE::ConnectedToServer;
|
||||
DEBUG_LOG(m_logger) << "ConnectedToServer";
|
||||
emit statusMessage(tr("Connected To ServiceManagement"));
|
||||
requestServicePortInformation();
|
||||
break;
|
||||
}
|
||||
case AWSS_STATE::ConnectToExerciseManagement:
|
||||
{
|
||||
m_awss_state = AWSS_STATE::ConnectedToExerciseManagement;
|
||||
DEBUG_LOG(m_logger) << "ConnectedToExercise";
|
||||
emit statusMessage(tr("Connected To ExerciseManagement for Exercise"));
|
||||
requestExcerciseInformation();
|
||||
break;
|
||||
}
|
||||
case AWSS_STATE::ConnectToParticipantManagement:
|
||||
{
|
||||
m_awss_state = AWSS_STATE::ConnectedToParticipantManagement;
|
||||
DEBUG_LOG(m_logger) << "ConnectedToParticipantManagement";
|
||||
emit statusMessage(tr("Connected To ParticipantManagement for Exercise"));
|
||||
requestPartyInformation();
|
||||
break;
|
||||
}
|
||||
case AWSS_STATE::ConnectToProxy:
|
||||
{
|
||||
emit statusMessage(tr("Connected To Exercise Proxy for party: %1").arg(m_partyName));
|
||||
m_awss_state = AWSS_STATE::ConnectedToProxy;
|
||||
DEBUG_LOG(m_logger) << "ConnectedToProxy";
|
||||
//TEST
|
||||
emit connectedToParty(m_partyId, m_partyName, m_saaId);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
emit statusMessage(tr("Connected during wrong connection State"));
|
||||
|
||||
DEBUG_LOG(m_logger) << "connected during wrong connection State";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void WebSocketInterface::onReconnect()
|
||||
{
|
||||
|
||||
DEBUG_LOG(m_logger) << "Disconnected - current state: " << m_awss_state;
|
||||
|
||||
|
||||
switch (m_awss_state)
|
||||
{
|
||||
case AWSS_STATE::RequestServicePorts:
|
||||
case AWSS_STATE::ConnectedToServer:
|
||||
{
|
||||
m_awss_state = AWSS_STATE::ConnectToServer;
|
||||
emit statusMessage(tr("Try Recconect to ServiceManagement"));
|
||||
connectToServer(m_hostname, m_port, m_saaId);
|
||||
break;
|
||||
}
|
||||
case AWSS_STATE::ConnectedToExerciseManagement:
|
||||
case AWSS_STATE::RequestExerciseInformation:
|
||||
{
|
||||
m_awss_state = AWSS_STATE::ConnectToExerciseManagement;
|
||||
emit statusMessage(tr("Try Recconect to ExceriseManagement"));
|
||||
connectToExerciseManagement(m_port);
|
||||
break;
|
||||
}
|
||||
case AWSS_STATE::ConnectToParticipantManagement:
|
||||
case AWSS_STATE::RequestPartyInformation:
|
||||
{
|
||||
m_awss_state = AWSS_STATE::ConnectToParticipantManagement;
|
||||
|
||||
emit statusMessage(tr("Try Recconect to ParticipantManagement"));
|
||||
connectToParticipantManagement(m_port);
|
||||
break;
|
||||
}
|
||||
case AWSS_STATE::ConnectToProxy:
|
||||
case AWSS_STATE::ConnectedToProxy:
|
||||
{
|
||||
m_awss_state = AWSS_STATE::ConnectToProxy;
|
||||
emit statusMessage(tr("Try Recconect to TrainingAreaBase Proxy for party:").arg(m_partyName));
|
||||
connectToProxy(m_port, m_partyId, m_partyName);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
DEBUG_LOG(m_logger) << "Disconnected during wrong connection State";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void WebSocketInterface::onDisconnected()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "On DisConnect: " ;
|
||||
emit statusMessage(tr("Discconected "));
|
||||
// QTimer::singleShot(10000,this, &WebSocketInterface::onReconnect);
|
||||
}
|
||||
|
||||
void WebSocketInterface::onError(QAbstractSocket::SocketError error)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "On Error: " << error;
|
||||
emit statusMessage(tr("got Socket Error: %1").arg(error));
|
||||
QTimer::singleShot(10000,this, &WebSocketInterface::onReconnect);
|
||||
//onReconnect();
|
||||
}
|
||||
|
||||
} //namespace AdlerWebSocketSimulator
|
||||
@@ -0,0 +1,101 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Websocket interface for ADLER WebsocketSimulator
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, ESZS, 2025-03-03
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <QtCore/QObject>
|
||||
#include <QtWebSockets/QtWebSockets>
|
||||
|
||||
#include "logger.h"
|
||||
#include <AdlerJson/generatetelegrams.h>
|
||||
|
||||
namespace AdlerWebSocketSimulator {
|
||||
|
||||
|
||||
enum AWSS_STATE {
|
||||
Unconnected,
|
||||
ConnectToServer,
|
||||
ConnectedToServer,
|
||||
RequestServicePorts,
|
||||
ConnectToParticipantManagement,
|
||||
ConnectedToParticipantManagement,
|
||||
RequestExerciseInformation,
|
||||
ConnectToExerciseManagement,
|
||||
ConnectedToExerciseManagement,
|
||||
RequestPartyInformation,
|
||||
ConnectToProxy,
|
||||
ConnectedToProxy,
|
||||
};
|
||||
|
||||
class WebSocketInterface : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WebSocketInterface(QObject *parent = nullptr);
|
||||
|
||||
/**
|
||||
* @brief disconnects and resets everyting to startuip.
|
||||
*
|
||||
*/
|
||||
void reset();
|
||||
|
||||
signals:
|
||||
void gotServiceData(const QString &message);
|
||||
void gotExerciseData(const QString &message);
|
||||
void gotPartyData(const QString &message);
|
||||
void connectedToExercise();
|
||||
void connectedToParty(int id, const QString &name, int saaId);
|
||||
|
||||
/**
|
||||
* @brief emits a Status Message during operations.
|
||||
*
|
||||
*/
|
||||
void statusMessage(const QString& message);
|
||||
/**
|
||||
* @brief emits a an incommin message from proxy.
|
||||
*
|
||||
*/
|
||||
void proxyMessage(const QString& message);
|
||||
|
||||
private:
|
||||
void requestServicePortInformation();
|
||||
void requestExcerciseInformation();
|
||||
void requestPartyInformation();
|
||||
void sendFlugbahndaten(QString uuid);
|
||||
|
||||
public slots:
|
||||
void connectToServer(const QString servername, int port, int saaId);
|
||||
void connectToExerciseManagement(int port);
|
||||
void connectToParticipantManagement(int port);
|
||||
void connectToProxy(int port, int partyId, const QString &partyName);
|
||||
void sendToProxy(const QString &message);
|
||||
|
||||
|
||||
|
||||
private slots:
|
||||
void onTextMessageRecived(const QString &message);
|
||||
void onConnected();
|
||||
void onReconnect();
|
||||
void onDisconnected();
|
||||
|
||||
void onError(QAbstractSocket::SocketError error);
|
||||
|
||||
private:
|
||||
QWebSocket *m_socket {nullptr};
|
||||
AWSS_STATE m_awss_state {AWSS_STATE::Unconnected};
|
||||
|
||||
QString m_hostname {QString()};
|
||||
int m_port {0};
|
||||
int m_saaId {0};
|
||||
int m_partyId {0};
|
||||
QString m_partyName {QString()};
|
||||
|
||||
LOGGER_T m_logger;
|
||||
|
||||
};
|
||||
} // namespace AdlerWebSocketSimulator
|
||||
@@ -0,0 +1,92 @@
|
||||
log4j.reset=true
|
||||
log4j.rootLogger=INFO, file
|
||||
|
||||
# Service: ReportManagement
|
||||
###########################################################
|
||||
|
||||
#log4j.logger.REP=DEBUG
|
||||
#log4j.logger.REP.main=DEBUG
|
||||
#log4j.logger.REP.MainHandler=DEBUG
|
||||
#log4j.logger.REP.HandlerDynamicParticipantData=DEBUG
|
||||
#log4j.logger.REP.HandlerReportData=DEBUG
|
||||
#log4j.logger.REP.ObjectReportInfo=DEBUG
|
||||
#log4j.logger.REP.DbHandler=DEBUG
|
||||
#log4j.logger.REP.DdsHandler=DEBUG
|
||||
#log4j.logger.REP.Settings=INFO
|
||||
#log4j.logger.REP.Publisher=INFO
|
||||
#log4j.logger.REP.FtsImpl=INFO
|
||||
#log4j.logger.REP.FtcImpl=INFO
|
||||
#log4j.logger.REP.FtTest=DEBUG
|
||||
|
||||
|
||||
# Service: PresentationManagement
|
||||
###########################################################
|
||||
#log4j.logger.PRE=DEBUG
|
||||
|
||||
|
||||
# File
|
||||
###########################################################
|
||||
log4j.appender.file=Lts::RollingFileAppender
|
||||
log4j.appender.file.MaxFileSize=1MB
|
||||
log4j.appender.file.MaxBackupIndex=9
|
||||
log4j.appender.file.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.file.layout.ConversionPattern=%d %-5p %c |#| %m (%.50F:%L) %n
|
||||
|
||||
# Appnd_Console
|
||||
###########################################################
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern= %d %p %c %c{1} - %m (%-.30F:%L) %n
|
||||
|
||||
# Appnd_Syslog
|
||||
###########################################################
|
||||
log4j.appender.syslog=org.apache.log4j.SyslogAppender
|
||||
log4j.appender.syslog.Threshold=ERROR
|
||||
log4j.appender.syslog.SysLogHost=localhost
|
||||
log4j.appender.syslog.Facility=LOCAL7
|
||||
log4j.appender.syslog.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.syslog.layout.ConversionPattern= %-4r %-5p %c %x - %m
|
||||
log4j.appender.syslog.LevelRangeFilter.AcceptOnMatch=true
|
||||
log4j.appender.syslog.LevelRangeFilter.LevelMin=INFO
|
||||
log4j.appender.syslog.LevelRangeFilter.LevelMax=FATAL
|
||||
|
||||
###########################################################
|
||||
###########################################################
|
||||
###########################################################
|
||||
# 1) Available Levels in LOG4CXX Version 0.10.0:
|
||||
# TRACE,
|
||||
# DEBUG,
|
||||
# INFO,
|
||||
# WARN,
|
||||
# ERROR
|
||||
# FATAL
|
||||
#
|
||||
# d = date/time
|
||||
# p = priority (Level)
|
||||
# c = category/channel
|
||||
# m = message
|
||||
# F = file
|
||||
# L = line
|
||||
# n = platform dependent line separator character or characters.
|
||||
# ....
|
||||
#
|
||||
# Examples for console:
|
||||
# a)
|
||||
# %d %p %c #%m# (%.50F:%L)%n
|
||||
# date/time
|
||||
# priority
|
||||
# category/channel
|
||||
# #message#
|
||||
# (Maximal 50Character des Filename von rechts:Line)
|
||||
# line separator
|
||||
#
|
||||
# b)
|
||||
# %d (%.15F:%L) %-5p %c |#| %m%n
|
||||
# date/time
|
||||
# (Maximal 15Character des Filename von rechts:Line)
|
||||
# priority, Right pad with spaces if the priority name is less than 5 characters long.
|
||||
# category/channel
|
||||
# message
|
||||
# line separator
|
||||
#
|
||||
# Examples for files:
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Logging for ADLER Websocket Simulator
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, ESZS, 2025-03-03
|
||||
*/
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
|
||||
namespace AdlerWebSocketSimulator
|
||||
{
|
||||
|
||||
LOGGER_T getLogger(const char *name)
|
||||
{
|
||||
static const char ns[] = "ALM.";
|
||||
std::string loggerName;
|
||||
const size_t len = strlen(name);
|
||||
loggerName.reserve(sizeof(ns) + len);
|
||||
loggerName.append(ns, sizeof(ns) - 1);
|
||||
loggerName.append(name, len);
|
||||
|
||||
try
|
||||
{
|
||||
return NGL::NGLLoggerBootstrap::getNGLRootLogger().
|
||||
getNGLLogger(loggerName);
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
fprintf(stderr, "Error retrieving logger: %s", ex.what());
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace AdlerWebSocketSimulator
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Logging for ADLER Websocket Simulator
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, ESZS, 2025-03-03
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
|
||||
namespace AdlerWebSocketSimulator
|
||||
{
|
||||
using LOGGER_T = NGL::INGLLogger &;
|
||||
|
||||
LOGGER_T getLogger(const char *name);
|
||||
inline LOGGER_T getLogger(const QString &loggerName)
|
||||
{
|
||||
return getLogger(loggerName.toUtf8().constData());
|
||||
}
|
||||
} // namespace AdlerWebSocketSimulator
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* @RDE_HEADER@
|
||||
* Main for AdlerSimulation
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, ESZS, 2025-03-03
|
||||
*/
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QPointF>
|
||||
|
||||
#include <QSettings>
|
||||
#include <QNetworkProxy>
|
||||
|
||||
#include <nglapplication/nglapplication.h>
|
||||
#include <nglapplication/nglloggerhandler.h>
|
||||
#include <nglsettings/nglsettings_settings.h>
|
||||
#include <ngltranslator/ngltranslator.h>
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
#include <nglapplication/nglcoreapplication.h>
|
||||
#include <nglsettings/nglsettings_settings.h>
|
||||
|
||||
#include <LtsCommandLineParser/LtsCommandLineParser.h>
|
||||
|
||||
|
||||
#include "awss_base_layout.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QCoreApplication::setApplicationName(QLatin1String("ADLER Websocket Simulator"));
|
||||
QCoreApplication::setOrganizationName(QLatin1String("RME"));
|
||||
|
||||
NGLApplication app(argc, argv);
|
||||
QApplication::setQuitOnLastWindowClosed(true); // we are cool enough to handle it ourselves 8)
|
||||
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
QNetworkProxy::setApplicationProxy(QNetworkProxy()); // do NOT use proxies anywhere!
|
||||
|
||||
app.createLogger("awss", "log4cxx_adlerWebSocketSimulator.props");
|
||||
NGL::INGLLogger &logger = app.baseLogger();
|
||||
QScopedPointer<QSettings> settings(new QSettings(app.organizationName(), app.applicationName()));
|
||||
|
||||
ERROR_LOG(logger) << "Settings Directory: " << settings->fileName();
|
||||
|
||||
LtsCommandLineParser::LtsCommandLineParser options(LtsCommandLineParser::LtsCommandLineParser::CustomConfigFile);
|
||||
|
||||
options.addOption({ QStringList() << QLatin1String("p") << QLatin1String("port")
|
||||
, QLatin1String("port to connect to server")
|
||||
, QLatin1String("Default value")
|
||||
, QLatin1String("2300")
|
||||
});
|
||||
|
||||
options.addOption({ QStringList() << QLatin1String("s") << QLatin1String("server")
|
||||
, QLatin1String("hostname or Ip of the server")
|
||||
, QLatin1String("Default value")
|
||||
, QLatin1String("exctds01")
|
||||
});
|
||||
|
||||
if (!options.init())
|
||||
{
|
||||
options.showHelp();
|
||||
return -1;
|
||||
}
|
||||
QSettings serverSettings(app.applicationDirPath() + QLatin1String("/") + options.iniFile(), QSettings::IniFormat);
|
||||
|
||||
DEBUG_LOG(logger) << "Starting Server";
|
||||
AdlerWebSocketSimulator::BaseLayout *bl = new AdlerWebSocketSimulator::BaseLayout();
|
||||
bl->show();
|
||||
int ret = app.exec();
|
||||
|
||||
// delete s;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,273 @@
|
||||
# Leaflet map for displaying mounting points
|
||||
|
||||
## Table of contents
|
||||
|
||||
1. [Usage](#usage)
|
||||
2. [Programming](#programming)
|
||||
1. [Basics](#basics)
|
||||
1. [TypeScript](#typescript)
|
||||
2. [AngularJs](#angularjs)
|
||||
3. [Leaflet](#leaflet)
|
||||
2. [The code](#the-code)
|
||||
|
||||
_Note: view this in a program that supports markdown_
|
||||
_(e.g. VS Code or a browser with plugin) and it will look much better_
|
||||
|
||||
---
|
||||
|
||||
## Usage
|
||||
|
||||
### Connection
|
||||
|
||||
When opening index.html you will first see the connection menu.
|
||||
Here you can choose if you want to connect to localhost:2080, enter
|
||||
a custom ip or load data from the browser cache.
|
||||
|
||||
### Main page
|
||||
|
||||
The main page consists of two parts: the map on the left side and the selection
|
||||
menu on the right side.
|
||||
The map will display the buildings and mouting points received from the previously
|
||||
entered websocket. Buildings are currently light blue while mounting points are
|
||||
highlighted with a typical map marker in black. These markers will open a popup
|
||||
that displays additional info when clicked.
|
||||
The selection menu on the right side has three sections, namely "Layers", "Asset
|
||||
types" and finally "Selected mounting points".
|
||||
|
||||
- The layer selection is handled via checkboxes where checked means displayed
|
||||
- The asset type selection happens with a dropdown menu
|
||||
- Selected mounting points are displayed in a table with tag/designation and id
|
||||
|
||||
The table displaying selected mounting points also features a button for each
|
||||
point that centers the map on it and opens its popup. It can also be searched
|
||||
using the text input above it (case sensitive, checks if name or id contain given
|
||||
text).
|
||||
|
||||
---
|
||||
|
||||
## Programming
|
||||
|
||||
### Basics
|
||||
|
||||
This program is a kind of messy combination of several libraries/frameworks that
|
||||
weren't really made to work with each other soI have to explain some things first:
|
||||
|
||||
#### TypeScript
|
||||
|
||||
TypeScript (TS) is a superset of JavaScript (JS) which means every JS command is also valid TS.
|
||||
The big difference is that TS is typed (who would have guessed?) andfeatures object
|
||||
oriented programming. Concepts such as classes and inheritance are
|
||||
supported. TS is transpiled into JS. This secures compatibility with most browsers.
|
||||
|
||||
A little syntax example of TS:
|
||||
|
||||
```typescript
|
||||
var name: type = value;
|
||||
|
||||
function name(parameter: type): returnType {
|
||||
// ...
|
||||
}
|
||||
|
||||
class name extends inheritedClass {
|
||||
PropertyOne: type;
|
||||
PropertyTwo: type = value;
|
||||
|
||||
constructor(parameter: type) {
|
||||
this.PropertyOne = parameter;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The command `tsc --build <file.ts>` can be used to transpile "file.ts",
|
||||
`tsc --watch <file.ts>` however will stay running and always retranspile when
|
||||
it detects changes in "file.ts".
|
||||
|
||||
#### AngularJs
|
||||
|
||||
AngularJs is a kind of library for JS/htm which allows you to build dynamic pages
|
||||
with really little actual code. There has to be some backing code but most of it
|
||||
will actually happen wihtin the html file. It's kinda hard to explain but here's
|
||||
an example:
|
||||
|
||||
```html
|
||||
<li>
|
||||
<ul ng-repeat="x in [1, 2, 3, 4, 5]">
|
||||
{{x}}
|
||||
</ul>
|
||||
</li>
|
||||
```
|
||||
|
||||
This example doesn't really show anything too useful but you can see two of the most
|
||||
important concepts of AngularJs: directives and templates.
|
||||
|
||||
- The directive `ng-repeat` for example will repeat the tag it is in dynamically
|
||||
depending on its content, in this case 5 times
|
||||
- The template `{{x}}` will be dynamically replaced by the value of x, in this
|
||||
case 1 thorugh 5
|
||||
|
||||
When viewed in a browser the example will render as this:
|
||||
|
||||
> - 1
|
||||
> - 2
|
||||
> - 3
|
||||
> - 4
|
||||
> - 5
|
||||
|
||||
We can make JS variables visible to AngularJs by attaching them to its `$scope`
|
||||
object.
|
||||
|
||||
This was really short but I can't really teach a whole framework within a
|
||||
readme. There is a nice (German) [tutorial](https://angular.de/artikel/angularjs-tutorial-deutsch/)
|
||||
though.
|
||||
|
||||
There actually is a newer version of Angular explicitly for TS but it's way more
|
||||
complicated so I stuck with the old JS version. It was a headache to get that to
|
||||
work but now it does. Don't touch it.
|
||||
|
||||
#### Leaflet
|
||||
|
||||
Leaflet is a JS library for creating maps. It's rather simple to understand
|
||||
and has nice [documentation](https://leafletjs.com/reference-1.4.0.html).
|
||||
Basically you create a div with a special id and then put stuff like markers
|
||||
into it via JS. Not much I could explain here. Except maybe I can say a sentence
|
||||
about function chaining. Leaflet smartly uses return types in its functions that
|
||||
allow you to chain them like crazy. For example:
|
||||
|
||||
```typescript
|
||||
var marker: L.Marker = L.marker(coordinates)
|
||||
.bindPopup(popupContent)
|
||||
.addTo(map);
|
||||
```
|
||||
|
||||
`.bindPopup()` and `.addTo()` both still return the marker. This way you can get
|
||||
a lot of stuff done with a single statement.
|
||||
In this example you can also see that Leaflet likes to use factory methods instead
|
||||
of instance contructors (`new`). Feels weird in the beginning but makes sense when
|
||||
you keep in mind that this is a TS port of a JS library.
|
||||
|
||||
### The code
|
||||
|
||||
Let me first tell you how to actually run the code:
|
||||
|
||||
1. Transpile: Ctrl+Shift+B in VS Code, choose "build"
|
||||
2. Browserify: `browserify main.js -o scripts/main.js`
|
||||
3. Open index.html
|
||||
|
||||
The browserify step is needed since this program is basically a nodejs app.
|
||||
Browserify combines all node modules into a single .js file
|
||||
so we can actually use the file in a html website.
|
||||
|
||||
To clear things up:
|
||||
|
||||
- ./main.ts is the source file - _develop here_
|
||||
- ./main.js is the transpiled file - _don't touch it_
|
||||
- ./scripts/main.js is the final browerified file - _don't even look at it_
|
||||
|
||||
When developing it is way easier to have those commands in watch mode so
|
||||
you can simply refresh the browser to see the changes you made:
|
||||
|
||||
- Ctrl+Shift+B in VS Code, choose watch
|
||||
- `watchify main.js -o scripts/main.js`
|
||||
|
||||
These commands will automatically retranspile and rebrowserify main.ts when you
|
||||
hit save in an editor of your choice (use VS Code though - it's the best).
|
||||
|
||||
tsc, browserify and watchify can be installed via npm.
|
||||
|
||||
**Also, don't update utm-latlng!**
|
||||
utm-latlng is a dependency which features conversion of coordinates from
|
||||
latitude/longtitude to UTM and vice-versa. There's a bug in it that prevents
|
||||
the correct conversion from UTM back to lat/lon in the current version. There's
|
||||
a pull request with a one line fix on GitHub but that was half a year ago and
|
||||
has never been merged so I copied the line and pasted it in the local installation
|
||||
of the library. Updating it will probably break it. So don't.
|
||||
_Actually, it's probably best to not update anything, just to be sure._
|
||||
|
||||
---
|
||||
|
||||
Now let's get to the actual code. I wont explain every little detail since there
|
||||
are additional comments in the code but I will highlight _some_ things. For writing
|
||||
I recommend VS Code.
|
||||
|
||||
- The only files needed to display the final page in the end are:
|
||||
- index.html
|
||||
- style.css
|
||||
- The scripts folder and its content
|
||||
- the img forler and its content
|
||||
- index.html is rather simple. Contains additional comments as well but here's
|
||||
some more things:
|
||||
- leaflet.css has to be before leaflet.min.js apparently
|
||||
- Everything withing `{{}}` is an AngularJs template and will be filled
|
||||
dynamically with the code inside
|
||||
- `ng-click` is basically `onclick`
|
||||
- I wont even talk about style.css
|
||||
- main.ts. This is the evil one
|
||||
- Don't question the angular module and controllers. They are basically magic.
|
||||
- `module Calc` is a little collection of some math stuff:
|
||||
- `RadToDeg()` and `DegToRad()` are really just one-liner functions to
|
||||
convert between degrees and radians
|
||||
- `RotatePoint()` rotates a point around an angle using fancy trigonometry
|
||||
I snatched of the internet
|
||||
- class UTM` is just there so a have a uniform way of representing UTM
|
||||
coords
|
||||
- `LatLonToUtm()` and `UtmToLatLon()` are just wrappers to simplify the
|
||||
respective utm-latlng functions
|
||||
- `class MountingPoint` is a leaflet marker which stores additional info
|
||||
about the mounting point it represents
|
||||
- `class Layer` stores the markers and is basically a representation of
|
||||
floors but floors with the same name are stored in the same layer
|
||||
- `IsStringEmpty()` returns `true` when the given string is either empty,
|
||||
`null` or `undefined`
|
||||
- Any property of `$scope` within the angular controller is visible to
|
||||
angular templates within index.html
|
||||
- `$scope.loadData()` gets the data from the entered websocket and calls
|
||||
the event `webSocketResponse`
|
||||
- `$scope.$on("webSocketResponse", /* ... */)`:
|
||||
This handles the `webSocketResponse`-event. Almost the whole program is
|
||||
contained wihtin its callback. This is so that nothing tries to access
|
||||
any data that has not been received yet. It is divided into sections
|
||||
that handle the different types of objects we want to display, namely
|
||||
buildings, levels, mounting points and assets. It also sets up the leaflet
|
||||
map.
|
||||
- Nested `for (let x of y)`-"loops" are godsent. I mostly use them to get two
|
||||
objects with matching properties and then do stuff with them. For example:
|
||||
|
||||
```typescript
|
||||
for (let m of mountingPoints) {
|
||||
for (let b of buildings) {
|
||||
if (m.objectId == b.id) {
|
||||
// ...
|
||||
```
|
||||
|
||||
- `(layer.LLayer.getLayers() as unknown[]) as MountingPoint[])`
|
||||
This thing... Let me break it down.
|
||||
`layer` is an instance of my `Layer`-class. `LLayer` is the leaflet map
|
||||
layer it encapsulates.
|
||||
`.getLayers()` returns the array of markers on that layer. The problem
|
||||
I faced here was that they lost the properties I added in my
|
||||
`MountingPoint`-class because it returns `L.Marker`s.
|
||||
More precisely, the values is still there but not accessible since
|
||||
`L.Marker` doesn't have the properties.
|
||||
But I can't directly cast from `L.Marker` to `MountingPoint`.
|
||||
Therefore I do a cheaty cast via `unknown`.
|
||||
It's confusing as heck but the only way I can easily get access to the
|
||||
`MountingPoint`-properties.
|
||||
- The mean conditional statement at `foundBySearch` within
|
||||
`$scope.MountingPointFilter()` is a short way of saying
|
||||
`true` if either
|
||||
- `$scope.mpSearch` (search text input in index.html) is empty
|
||||
- currently tested mounting point tag/designation or id contain
|
||||
`$scope.mpSearch`
|
||||
- `$scope.SelectionChanged()` is called in the end so that I don't have
|
||||
to manually fix all the default selections
|
||||
- `$scope.$apply()` will update the `$scope`-object so that it's values
|
||||
are actually available in the angular templates within index.html.
|
||||
It would happen automatically eventually but I want to be on the safe side.
|
||||
Sometimes it is nessecary to call it, sometimes it thorws an error. Just try
|
||||
it out. The error doesn't seem to matter.
|
||||
|
||||
---
|
||||
|
||||
I hope this and the comments in the code are enough to understand it.
|
||||
If not, you can send me a [mail](mailto:justus.hertel@rheinmetall.com).
|
||||
If you are lucky I might remember how it works :p
|
||||
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
@@ -0,0 +1,194 @@
|
||||
<!DOCTYPE html>
|
||||
<html ng-app="main">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<!-- Leaflet Stylesheet -->
|
||||
<link rel="stylesheet" type="text/css" href="scripts/leaflet.css" />
|
||||
|
||||
<!-- Wikitude, only in mobile app -->
|
||||
<script src="architect://architect.js" type="text/javascript"></script>
|
||||
|
||||
<!-- Main Script (includes angular, leaflet and utm-latlng) -->
|
||||
<script src="scripts/main.js" type="text/javascript"></script>
|
||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||
</head>
|
||||
<body ng-controller="ctrl">
|
||||
<div id="parentContainer" ng-hide="arMode">
|
||||
<!-- Contains everything, needed for css -->
|
||||
|
||||
<div id="connectionConatiner" ng-hide="connected">
|
||||
<!-- Contains the connection menu, only shown in the beginning -->
|
||||
<h1>
|
||||
Connection
|
||||
</h1>
|
||||
<button
|
||||
ng-click="loadDataFromWS('ws://localhost:2080')"
|
||||
ng-disabled="disableInput"
|
||||
style="width: 100%"
|
||||
>
|
||||
Connect to localhost
|
||||
</button>
|
||||
<br class="bigBr" />
|
||||
OR
|
||||
<br class="bigBr" />
|
||||
<button
|
||||
ng-click="loadDataFromWS(websocketIp)"
|
||||
ng-disabled="disableInput"
|
||||
>
|
||||
Connect to
|
||||
</button>
|
||||
<input
|
||||
type="text"
|
||||
ng-model="websocketIp"
|
||||
placeholder="ws://192.168.133.140:2080"
|
||||
ng-disabled="disableInput"
|
||||
/>
|
||||
<br class="bigBr" />
|
||||
OR
|
||||
<br class="bigBr" />
|
||||
<button
|
||||
ng-click="loadDataFromCache()"
|
||||
ng-disabled="disableInput"
|
||||
style="width: 100%"
|
||||
>
|
||||
Load cached data
|
||||
</button>
|
||||
<hr />
|
||||
<label>
|
||||
{{ status }}
|
||||
</label>
|
||||
<progress
|
||||
ng-show="disableInput"
|
||||
max="6"
|
||||
value="0"
|
||||
id="progressBar"
|
||||
>
|
||||
</progress>
|
||||
</div>
|
||||
|
||||
<div id="mapContainer">
|
||||
<!-- Contains the leaflet map, needed for css -->
|
||||
<div id="map">
|
||||
<!-- This is the actual map, see main.ts -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="guiContainer" ng-hide="loading">
|
||||
<!-- Contains the selection menu,
|
||||
disabled when the websocket response is being processed -->
|
||||
|
||||
<div ng-show="connected">
|
||||
<h1>
|
||||
Layers
|
||||
</h1>
|
||||
<table>
|
||||
<tr ng-repeat="layer in layers">
|
||||
<td>
|
||||
<input
|
||||
type="checkbox"
|
||||
ng-model="layer.Selected"
|
||||
ng-change="SelectionChanged()"
|
||||
/>
|
||||
{{ layer.Name }}
|
||||
</td>
|
||||
<!-- Creates table rows with a checkbox for every layer -->
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<hr />
|
||||
|
||||
<h1>
|
||||
Asset type
|
||||
</h1>
|
||||
<select
|
||||
ng-options="asset as asset.designation for asset in assets.availableAssets"
|
||||
ng-model="assets.selectedAsset"
|
||||
ng-change="SelectionChanged()"
|
||||
>
|
||||
</select>
|
||||
<!-- Creates a dropdown menu with all available asset types -->
|
||||
<hr />
|
||||
|
||||
<h1>
|
||||
Selected mounting points:
|
||||
{{
|
||||
(
|
||||
mountingPoints
|
||||
| filter: MountingPointFilter(mountingPoint)
|
||||
).length
|
||||
}}
|
||||
<!-- Displays the amount of mounting points that
|
||||
fit the selected criteria -->
|
||||
</h1>
|
||||
<input
|
||||
type="text"
|
||||
ng-model="mpSearch"
|
||||
placeholder="Search... (case sensitive)"
|
||||
/>
|
||||
<!-- The table below will be filtered according to the entered text,
|
||||
see main.ts -->
|
||||
<button ng-click="mpSearch = ''">Clear</button>
|
||||
<!-- This just clears the text input above -->
|
||||
<br />
|
||||
<br />
|
||||
<div id="mp">
|
||||
<table
|
||||
ng-show="
|
||||
(
|
||||
mountingPoints
|
||||
| filter: MountingPointFilter(mountingPoint)
|
||||
).length > 0
|
||||
"
|
||||
>
|
||||
<!-- Enables the table if theres more than 0 selected mounting points -->
|
||||
<tr>
|
||||
<th>
|
||||
Name
|
||||
</th>
|
||||
<th>
|
||||
ID
|
||||
</th>
|
||||
<th>
|
||||
Position
|
||||
</th>
|
||||
</tr>
|
||||
<tr
|
||||
ng-repeat="mountingPoint in mountingPoints | filter: MountingPointFilter(mountingPoint)"
|
||||
>
|
||||
<!-- Creates table rows for each selected mounting point -->
|
||||
<td>
|
||||
{{
|
||||
mountingPoint.tag != ""
|
||||
? mountingPoint.tag
|
||||
: mountingPoint.designation
|
||||
}}
|
||||
</td>
|
||||
<!-- Displays mounting point tag if available,
|
||||
otherwise designation is displayed -->
|
||||
<td>
|
||||
{{ mountingPoint.id }}
|
||||
</td>
|
||||
<td>
|
||||
<button ng-click="ShowMp(mountingPoint)">
|
||||
Show
|
||||
</button>
|
||||
<!-- Opens the marker popup of the according mounting point,
|
||||
and centers the map on it, see main.ts -->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<hr />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-show="arMode" id="arCtrl">
|
||||
{{ arMountingPoint }}
|
||||
<br />
|
||||
<button onclick="window.Functions.BackFromAr()">
|
||||
Back
|
||||
</button>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,503 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// #region Initialization
|
||||
console.log("\nBegin initialization ##################################################");
|
||||
var angular_1 = __importDefault(require("angular"));
|
||||
angular_1.default != undefined
|
||||
? console.log("\tLoaded AngularJs.")
|
||||
: console.error("\tFailed to load AngularJs.");
|
||||
var leaflet_1 = __importDefault(require("leaflet"));
|
||||
leaflet_1.default != undefined
|
||||
? console.log("\tLoaded Leaflet.")
|
||||
: console.error("\tFailed to load Leaflet.");
|
||||
var utm_latlng_1 = __importDefault(require("utm-latlng"));
|
||||
utm_latlng_1.default != undefined
|
||||
? console.log("\tLoaded utm-latlng.")
|
||||
: console.error("\tFailed to load utm-latlng.");
|
||||
var isMobile = /Android/i.test(navigator.userAgent); // Check for mobile browser
|
||||
console.log("\tDetected " + (isMobile ? "mobile browser." : "desktop browser, disabling AR features."));
|
||||
// AngularJS
|
||||
var ngApp = angular_1.default.module("main", []);
|
||||
console.log("\tInitialized AngularJs.");
|
||||
console.log("Initialization finished ###############################################");
|
||||
// #endregion
|
||||
// #region Helpers
|
||||
var Calc;
|
||||
(function (Calc) {
|
||||
// Converts radians to degrees
|
||||
function RadToDeg(rad) {
|
||||
return rad * (180 / Math.PI);
|
||||
}
|
||||
Calc.RadToDeg = RadToDeg;
|
||||
// Converts degrees to radians
|
||||
function DegToRad(deg) {
|
||||
return (deg * Math.PI) / 180;
|
||||
}
|
||||
Calc.DegToRad = DegToRad;
|
||||
// Rotates a point around 0,0 by an angle in radians
|
||||
function RotatePoint(point, angle) {
|
||||
return {
|
||||
x: point.x * Math.cos(angle) - point.y * Math.sin(angle),
|
||||
y: point.x * Math.sin(angle) + point.y * Math.cos(angle)
|
||||
};
|
||||
}
|
||||
Calc.RotatePoint = RotatePoint;
|
||||
// UTM Coordinates
|
||||
var UTM = /** @class */ (function () {
|
||||
function UTM(e, n, zn, zl) {
|
||||
this.Easting = e;
|
||||
this.Northing = n;
|
||||
this.ZoneNumber = zn;
|
||||
this.ZoneLetter = zl;
|
||||
}
|
||||
return UTM;
|
||||
}());
|
||||
var _precision = 7; // Precision for LatLon to UTM conversion
|
||||
var _utm = new utm_latlng_1.default("WGS 84"); // Create UTM/LatLng converter for WGS84 projection
|
||||
// Wrapper for LatLon to UTM conversion
|
||||
function LatLonToUtm(lat, lon) {
|
||||
return _utm.convertLatLngToUtm(lat, lon, _precision);
|
||||
}
|
||||
Calc.LatLonToUtm = LatLonToUtm;
|
||||
// Wrapper for UTM to LatLon conversion
|
||||
function UtmToLatLon(utm) {
|
||||
var temp = _utm.convertUtmToLatLng(utm.Easting, utm.Northing, utm.ZoneNumber, utm.ZoneLetter);
|
||||
return { lat: temp.lat, lon: temp.lng };
|
||||
}
|
||||
Calc.UtmToLatLon = UtmToLatLon;
|
||||
})(Calc || (Calc = {}));
|
||||
// Leaflet marker with additional info to represent a mounting point
|
||||
var MountingPoint = /** @class */ (function (_super) {
|
||||
__extends(MountingPoint, _super);
|
||||
function MountingPoint() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this.SupportedAssets = [];
|
||||
_this.ID = -1;
|
||||
return _this;
|
||||
}
|
||||
return MountingPoint;
|
||||
}(leaflet_1.default.Marker));
|
||||
// Represents all levels with the same designation,
|
||||
// Stores the mounting points of those levels
|
||||
var Layer = /** @class */ (function () {
|
||||
function Layer(name) {
|
||||
this.Name = name;
|
||||
this.Ids = [];
|
||||
this.Selected = true;
|
||||
this.LLayer = leaflet_1.default.layerGroup(undefined);
|
||||
}
|
||||
return Layer;
|
||||
}());
|
||||
// Returns true if str is undefined, empty or null
|
||||
function IsStringEmpty(str) {
|
||||
return str == undefined || str == "" || str == null;
|
||||
}
|
||||
// jQuery like shortcut to get html elements
|
||||
function $(query) {
|
||||
return document.querySelector(query);
|
||||
}
|
||||
// Retrieves the angular $scope from outside a controller
|
||||
function GetScope() {
|
||||
return angular_1.default.element($("body")).scope();
|
||||
}
|
||||
function Status(str) {
|
||||
GetScope().status = str;
|
||||
console.log(str);
|
||||
$("#progressBar").value++;
|
||||
}
|
||||
// #endregion
|
||||
// Main AngularJs controller
|
||||
ngApp.controller("ctrl", function ($scope) {
|
||||
var data = {}; // Will hold the websocket response
|
||||
var t0 = null; // Measures the time it takes to load and parse
|
||||
$scope.disableInput = false; // True when loadData kicks in, disables the inputs
|
||||
$scope.connected = false; // True when websocket response was received
|
||||
$scope.status = undefined; // String that will be shown while connecting
|
||||
// Writes the websocket response to data when the load button is clicked
|
||||
/** @function */ $scope.loadDataFromWS = function (ip) {
|
||||
$scope.disableInput = true;
|
||||
console.log("Begin loading data ####################################################");
|
||||
t0 = performance.now(); // Get start time
|
||||
// Default value for ip if nothing was entered
|
||||
ip = IsStringEmpty(ip) ? "ws://192.168.133.140:2080" : ip;
|
||||
// Catch invalid ips
|
||||
try {
|
||||
var ws = new WebSocket(ip); // Connect to the websocket
|
||||
}
|
||||
catch (e) {
|
||||
alert("Invalid IP");
|
||||
return;
|
||||
}
|
||||
Status("\tConnecting to " + ip + "...");
|
||||
// Connect to the web socket
|
||||
ws.onopen = function () {
|
||||
console.log("\tConnected.");
|
||||
ws.send(JSON.stringify({
|
||||
type: "getEssentials",
|
||||
uuid: "UUID"
|
||||
}));
|
||||
};
|
||||
// Handles the response of the websocket
|
||||
ws.onmessage = function (response) {
|
||||
console.log("\tFetched " + Math.round(new TextEncoder().encode(response.data).length / 1000) + "kb.");
|
||||
data = JSON.parse(response.data).data; // Parse websocket response to data
|
||||
window.localStorage.setItem("data", escape(response.data));
|
||||
$scope.$broadcast("dataLoaded"); // Call response event to kick in the map and selection GUI
|
||||
};
|
||||
// Handle bad websocket responses
|
||||
ws.onclose = function (event) {
|
||||
if (event.code > 1000) {
|
||||
t0 = null;
|
||||
$scope.status = "";
|
||||
alert("Error when getting websocket response.\n" + event.code);
|
||||
$scope.disableInput = false;
|
||||
}
|
||||
};
|
||||
};
|
||||
/** @function */ $scope.loadDataFromCache = function () {
|
||||
$scope.disableInput = true;
|
||||
console.log("Begin loading data ####################################################");
|
||||
t0 = performance.now();
|
||||
Status("Loading data from cache...");
|
||||
try {
|
||||
if (window.localStorage.getItem("data") == null)
|
||||
throw new Error();
|
||||
var _data = unescape(window.localStorage.getItem("data"));
|
||||
data = JSON.parse(_data).data;
|
||||
console.log("\tLoaded " + Math.round(new TextEncoder().encode(_data).length / 1000) + "kb from cache.");
|
||||
$scope.$broadcast("dataLoaded");
|
||||
}
|
||||
catch (_a) {
|
||||
$scope.status = "";
|
||||
$scope.disableInput = false;
|
||||
t0 = null;
|
||||
console.log("\tCould not load data from cache.");
|
||||
alert("No data cached.");
|
||||
}
|
||||
};
|
||||
// Handles websocket response event
|
||||
$scope.$on("dataLoaded", function () {
|
||||
var _data = data;
|
||||
$scope.connected = true; // Switches the connection menu for the mounting point selection
|
||||
$scope.loading = true; // Disables the GUI while doing stuff
|
||||
// #region MAP
|
||||
console.log("\tCreating map.");
|
||||
// Create the map, set view and image
|
||||
var map = new leaflet_1.default.Map("map").setView(new leaflet_1.default.LatLng(53.0528064472226, 8.89412999153137), 8);
|
||||
var imageBounds = new leaflet_1.default.LatLngBounds([
|
||||
[53.0528064472226, 8.89412999153137],
|
||||
[53.056520842139, 8.90030980110168]
|
||||
]);
|
||||
var mapImage = leaflet_1.default.imageOverlay("img/RDE2.jpg", imageBounds);
|
||||
map.addLayer(mapImage);
|
||||
map.fitBounds(imageBounds);
|
||||
// #endregion
|
||||
// #region BUILDINGS
|
||||
// Get buildings
|
||||
var buildings = _data.objects;
|
||||
Status("\tParsing " + buildings.length + " buildings...");
|
||||
// Create GeoJson from buidling footprints
|
||||
var footprintPolygons = {
|
||||
type: "FeatureCollection",
|
||||
features: []
|
||||
};
|
||||
for (var _i = 0, buildings_1 = buildings; _i < buildings_1.length; _i++) {
|
||||
var currentBuilding = buildings_1[_i];
|
||||
// Check if current builing has footprint data, if not: skip
|
||||
if (!(currentBuilding.path[0] == undefined)) {
|
||||
// Holds footprint coordinates of the current building
|
||||
var footprintCoords = [[]];
|
||||
// Parse footprint coordinates from current building
|
||||
for (var _a = 0, _b = currentBuilding.path; _a < _b.length; _a++) {
|
||||
var pos = _b[_a];
|
||||
footprintCoords[0].push([
|
||||
// Convert from radians to degrees and add to the array
|
||||
Calc.RadToDeg(pos.lon),
|
||||
Calc.RadToDeg(pos.lat)
|
||||
]);
|
||||
}
|
||||
// Last point has to be the same as the first point so we add it again
|
||||
footprintCoords[0].push([
|
||||
Calc.RadToDeg(currentBuilding.path[0].lon),
|
||||
Calc.RadToDeg(currentBuilding.path[0].lat)
|
||||
]);
|
||||
// Create new GeoJson Feature with building footprint
|
||||
var currentFootprint = {
|
||||
type: "Feature",
|
||||
properties: {
|
||||
name: currentBuilding.designation
|
||||
},
|
||||
geometry: {
|
||||
type: "Polygon",
|
||||
coordinates: footprintCoords
|
||||
}
|
||||
};
|
||||
// Add GeoJson feature to feature collection
|
||||
footprintPolygons.features.push(currentFootprint);
|
||||
}
|
||||
}
|
||||
// Draw building footprints to map, add name popups
|
||||
var footprintGeoJson = leaflet_1.default.geoJSON(footprintPolygons, {
|
||||
onEachFeature: function (feature, layer) {
|
||||
layer.bindPopup("<h2>" + feature.properties.name + "</h2>");
|
||||
}
|
||||
}).addTo(map);
|
||||
// #endregion
|
||||
// #region LEVELS
|
||||
var levels = _data.levels; // Levels are the actual floors in the building
|
||||
var layers = []; // Layers are their representation on the map
|
||||
Status("\tParsing " + levels.length + " levels...");
|
||||
for (var _c = 0, levels_1 = levels; _c < levels_1.length; _c++) {
|
||||
var level = levels_1[_c];
|
||||
// Create a layer for each level
|
||||
var add = true;
|
||||
for (var _d = 0, layers_1 = layers; _d < layers_1.length; _d++) {
|
||||
var layer = layers_1[_d];
|
||||
// Levels with duplicate names will be on the same layer
|
||||
if (level.designation === layer.Name) {
|
||||
add = false;
|
||||
layer.Ids.push(level.id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (add) {
|
||||
// Create new Layer if level is not a duplicate
|
||||
var newLayer = new Layer(level.designation);
|
||||
newLayer.Ids.push(level.id);
|
||||
layers.push(newLayer);
|
||||
}
|
||||
}
|
||||
var outdoorLayer = new Layer("outdoor"); // Create a layer for mounting points outside of buildings
|
||||
outdoorLayer.Ids = [-1];
|
||||
var footprintLayer = new Layer("buildings"); // Create a layer for the building footprint
|
||||
footprintLayer.LLayer = footprintGeoJson;
|
||||
layers.push(outdoorLayer); // Add outdoor and footprint layers
|
||||
layers.push(footprintLayer);
|
||||
$scope.layers = layers; // Add layers to the checkbox menu
|
||||
// #endregion
|
||||
// #region MOUNTING POINTS
|
||||
// Get mounting points
|
||||
var mountingPoints = _data.mountingPoints;
|
||||
Status("\tParsing " + mountingPoints.length + " mounting points...");
|
||||
for (var _e = 0, mountingPoints_1 = mountingPoints; _e < mountingPoints_1.length; _e++) {
|
||||
var m = mountingPoints_1[_e];
|
||||
for (var _f = 0, buildings_2 = buildings; _f < buildings_2.length; _f++) {
|
||||
var b = buildings_2[_f];
|
||||
if (b.id == m.objectId) {
|
||||
// Current mounting point is in current buidling?
|
||||
b.utmRefPoint = Calc.LatLonToUtm(Calc.RadToDeg(b.refPoint.lat), Calc.RadToDeg(b.refPoint.lon)); // Converts refPoint of the building to UTM
|
||||
m.fixedPosition = Calc.RotatePoint({ x: m.position3d.x, y: m.position3d.y }, Calc.DegToRad(b.rotationDegree)); // Rotates coords of the mounting point by rotationDegree of the building
|
||||
m.absoluteUtm = b.utmRefPoint;
|
||||
m.absoluteUtm.Easting += m.fixedPosition.x;
|
||||
m.absoluteUtm.Northing += m.fixedPosition.y;
|
||||
m.absoluteLatLon = Calc.UtmToLatLon(m.absoluteUtm);
|
||||
// Add refPoint to the relative position and convert back to lat/lng
|
||||
var arButtonHtml = isMobile
|
||||
? "<button\n\t\t\t\t\t\t\t\tonclick=\"window.Functions.DisplayInAr(" + m.id + ")\"\n\t\t\t\t\t\t\t\tid=\"arButton\"\n\t\t\t\t\t\t >\n\t\t\t\t\t\t\t\tShow in AR\n\t\t\t\t\t\t\t</button>"
|
||||
: "<i>AR not supported on desktop.</i>";
|
||||
for (var _g = 0, layers_2 = layers; _g < layers_2.length; _g++) {
|
||||
var l = layers_2[_g];
|
||||
for (var _h = 0, _j = l.Ids; _h < _j.length; _h++) {
|
||||
var i = _j[_h];
|
||||
if (i == m.levelId) {
|
||||
// Current mouting point is on current level?
|
||||
var marker = new MountingPoint(
|
||||
// Create a marker for the mounting point
|
||||
new leaflet_1.default.LatLng(m.absoluteLatLon.lat, m.absoluteLatLon.lon), {
|
||||
icon: leaflet_1.default.icon({
|
||||
iconUrl: "img/marker.png",
|
||||
iconSize: [30, 30]
|
||||
})
|
||||
})
|
||||
.bindPopup(
|
||||
// Create a popup with info about the mounting point
|
||||
"<h2>\n\t\t\t\t\t\t\t\t\t\t" + (IsStringEmpty(m.tag) ? m.designation : m.tag) + "\n\t\t\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<td>ID</td>\n\t\t\t\t\t\t\t\t\t\t\t\t<td>" + m.id + "</td>\n\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<td>Object ID</td>\n\t\t\t\t\t\t\t\t\t\t\t\t<td>" + m.objectId + "</td>\n\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<td>Supported Asset Type IDs</td>\n\t\t\t\t\t\t\t\t\t\t\t\t<td>" + m.supportedAssetTypeIds + "</td>\n\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t" + arButtonHtml + "\n\t\t\t\t\t\t\t\t\t\t")
|
||||
.addTo(map); // Add it to the map
|
||||
marker.SupportedAssets = // Add info about supported asset types
|
||||
m.supportedAssetTypeIds;
|
||||
marker.ID = m.id; // Add mounting point id
|
||||
l.LLayer.addLayer(marker); // Add marker to corresponding layer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$scope.mountingPoints = mountingPoints;
|
||||
// #endregion
|
||||
// #region ASSETS
|
||||
// Get asset types
|
||||
var assets = _data.assetTypes;
|
||||
Status("\tParsing " + assets.length + " assets...");
|
||||
// Add asset types to the dropdown menu
|
||||
$scope.assets = {
|
||||
availableAssets: assets,
|
||||
selectedAsset: assets[0]
|
||||
};
|
||||
// #endregion
|
||||
// #region ANGULAR FUNCTIONS
|
||||
// Called by either the layer or asset selection
|
||||
/** @function */ $scope.SelectionChanged = function () {
|
||||
var points = 0;
|
||||
for (var _i = 0, layers_3 = layers; _i < layers_3.length; _i++) {
|
||||
var layer = layers_3[_i];
|
||||
if (layer.Selected) {
|
||||
map.addLayer(layer.LLayer); // Add selected layers
|
||||
// Hacky type conversion to get the supported asset types from each mounting point on a layer
|
||||
// If it's stupid but it works it's not stupid
|
||||
for (var _a = 0, _b = layer.LLayer.getLayers(); _a < _b.length; _a++) {
|
||||
var m = _b[_a];
|
||||
try {
|
||||
for (var _c = 0, _d = m.SupportedAssets; _c < _d.length; _c++) {
|
||||
var a = _d[_c];
|
||||
if (a == $scope.assets.selectedAsset.id) {
|
||||
m.addTo(map); // Add markers for selected asset type
|
||||
++points;
|
||||
}
|
||||
else {
|
||||
m.removeFrom(map); // Remove all other markers
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (_e) {
|
||||
/** Sometimes theres an error here...
|
||||
* Doesn't seem to interfere with anything though and
|
||||
* I don't want to see it in the console
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
map.removeLayer(layer.LLayer); // Remove unselected layers
|
||||
}
|
||||
console.log("Selected " + points + " mounting point" + (points == 1 ? "" : "s") + ".");
|
||||
};
|
||||
// Filter for selected mounting point table and count
|
||||
/** @function */ $scope.MountingPointFilter = function () {
|
||||
return function (mp) {
|
||||
var correctAssetType = false;
|
||||
for (var _i = 0, _a = mp.supportedAssetTypeIds; _i < _a.length; _i++) {
|
||||
var i = _a[_i];
|
||||
if (i == $scope.assets.selectedAsset.id) {
|
||||
correctAssetType = true;
|
||||
break;
|
||||
}
|
||||
} // Current mounting point supports selected asset type
|
||||
var correctLayer = false;
|
||||
for (var _b = 0, layers_4 = layers; _b < layers_4.length; _b++) {
|
||||
var layer = layers_4[_b];
|
||||
for (var _c = 0, _d = layer.Ids; _c < _d.length; _c++) {
|
||||
var i = _d[_c];
|
||||
if (layer.Selected && i == mp.levelId) {
|
||||
correctLayer = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} // Current mounting point is on a selected layer
|
||||
var foundBySearch = IsStringEmpty($scope.mpSearch)
|
||||
? true // Automatically true if search input empty
|
||||
: (IsStringEmpty(mp.tag) ? mp.designation : mp.tag).indexOf($scope.mpSearch) >= 0 || mp.id.toString().indexOf($scope.mpSearch) >= 0;
|
||||
// true if tag, designation or id contain search input
|
||||
return correctAssetType && correctLayer && foundBySearch;
|
||||
};
|
||||
};
|
||||
// Function for the Show button
|
||||
/** @function */ $scope.ShowMp = function (mp) {
|
||||
for (var _i = 0, layers_5 = layers; _i < layers_5.length; _i++) {
|
||||
var l = layers_5[_i];
|
||||
// Not this again...
|
||||
for (var _a = 0, _b = l.LLayer.getLayers(); _a < _b.length; _a++) {
|
||||
var m = _b[_a];
|
||||
if (m.ID == mp.id) {
|
||||
// Find clicked mounting point
|
||||
m.openPopup(); // Open corresponding popup
|
||||
map.panTo(m.getLatLng()); // Center map on the popup
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
// #endregion
|
||||
// Get final time and format it
|
||||
var time = t0 != null
|
||||
? "Finished loading data in " + (performance.now() -
|
||||
t0) + "ms ########################################"
|
||||
: "Finished loading data #################################################";
|
||||
console.log(time);
|
||||
$scope.SelectionChanged(); // Make initial map state fit the initial menu state
|
||||
$scope.loading = false; // Done loading
|
||||
$scope.$apply();
|
||||
});
|
||||
});
|
||||
// #region WIKITUDE FUNCTIONS
|
||||
var currentPOI = undefined; // Holds current wikitude ar marker
|
||||
// Shows an augmented reality marker vor the selected mounting point
|
||||
function _displayInAr(id) {
|
||||
var $scope = GetScope(); // Retrieve angular scope
|
||||
var mountingPoint;
|
||||
for (var _i = 0, _a = $scope.mountingPoints; _i < _a.length; _i++) {
|
||||
var mp = _a[_i];
|
||||
if (mp.id == id) {
|
||||
mountingPoint = mp;
|
||||
break;
|
||||
}
|
||||
} // Get correct mounting point
|
||||
var name = IsStringEmpty(mountingPoint.tag)
|
||||
? mountingPoint.designation
|
||||
: mountingPoint.tag;
|
||||
$scope.arMountingPoint = name;
|
||||
// Display mounting point tag/designation
|
||||
currentPOI = new AR.GeoObject([
|
||||
new AR.GeoLocation(mountingPoint.absoluteLatLon.lat, mountingPoint.absoluteLatLon.lon)
|
||||
], {
|
||||
drawables: {
|
||||
cam: [
|
||||
new AR.ImageDrawable(new AR.ImageResource("img/armarker.png"), 2.5, { zOrder: 0, opacity: 1 }),
|
||||
new AR.Label(name, 1, {
|
||||
zOrder: 1,
|
||||
style: { textColor: "#ffffff" }
|
||||
})
|
||||
],
|
||||
indicator: new AR.ImageDrawable(new AR.ImageResource("img/arindicator.png"), 0.1, {
|
||||
enabled: true,
|
||||
verticalAnchor: AR.CONST.VERTICAL_ANCHOR.TOP
|
||||
})
|
||||
}
|
||||
}); // Create AR marker
|
||||
$scope.arMode = true; // Hide map and menu
|
||||
$scope.$apply();
|
||||
console.log("Switched to AR mode.");
|
||||
}
|
||||
// Goes back to the map view
|
||||
function _backFromAr() {
|
||||
var $scope = GetScope(); // Retrieve angular scope
|
||||
$scope.arMountingPoint = ""; // Clear name display
|
||||
$scope.arMode = false; // Show map and menu again
|
||||
currentPOI.destroy();
|
||||
currentPOI = undefined;
|
||||
$scope.$apply();
|
||||
console.log("Switched to map mode.");
|
||||
}
|
||||
// Attach functions
|
||||
window.Functions = window.Functions || {
|
||||
DisplayInAr: _displayInAr,
|
||||
BackFromAr: _backFromAr
|
||||
};
|
||||
// #endregion
|
||||
// #endregion
|
||||
@@ -0,0 +1,664 @@
|
||||
// #region Initialization
|
||||
console.log(
|
||||
"\nBegin initialization ##################################################"
|
||||
);
|
||||
|
||||
import angular from "angular";
|
||||
angular != undefined
|
||||
? console.log("\tLoaded AngularJs.")
|
||||
: console.error("\tFailed to load AngularJs.");
|
||||
|
||||
import L, { PopupEvent, Popup } from "leaflet";
|
||||
L != undefined
|
||||
? console.log("\tLoaded Leaflet.")
|
||||
: console.error("\tFailed to load Leaflet.");
|
||||
|
||||
import UTMLatLng from "utm-latlng";
|
||||
UTMLatLng != undefined
|
||||
? console.log("\tLoaded utm-latlng.")
|
||||
: console.error("\tFailed to load utm-latlng.");
|
||||
|
||||
const isMobile: boolean = /Android/i.test(navigator.userAgent); // Check for mobile browser
|
||||
console.log(
|
||||
`\tDetected ${
|
||||
isMobile ? "mobile browser." : "desktop browser, disabling AR features."
|
||||
}`
|
||||
);
|
||||
|
||||
// import AR from "scripts/architect"
|
||||
declare var AR: any; // Is loaded in html from scripts/architect.js
|
||||
|
||||
// AngularJS
|
||||
const ngApp = angular.module("main", []);
|
||||
console.log("\tInitialized AngularJs.");
|
||||
|
||||
console.log(
|
||||
"Initialization finished ###############################################"
|
||||
);
|
||||
// #endregion
|
||||
|
||||
// #region Helpers
|
||||
|
||||
module Calc {
|
||||
// Converts radians to degrees
|
||||
export function RadToDeg(rad: number): number {
|
||||
return rad * (180 / Math.PI);
|
||||
}
|
||||
|
||||
// Converts degrees to radians
|
||||
export function DegToRad(deg: number): number {
|
||||
return (deg * Math.PI) / 180;
|
||||
}
|
||||
|
||||
// Rotates a point around 0,0 by an angle in radians
|
||||
export function RotatePoint(
|
||||
point: { x: number; y: number },
|
||||
angle: number
|
||||
): { x: number; y: number } {
|
||||
return {
|
||||
x: point.x * Math.cos(angle) - point.y * Math.sin(angle),
|
||||
y: point.x * Math.sin(angle) + point.y * Math.cos(angle)
|
||||
};
|
||||
}
|
||||
|
||||
// UTM Coordinates
|
||||
class UTM {
|
||||
Easting: number;
|
||||
Northing: number;
|
||||
ZoneNumber: number;
|
||||
ZoneLetter: string;
|
||||
constructor(e: number, n: number, zn: number, zl: string) {
|
||||
this.Easting = e;
|
||||
this.Northing = n;
|
||||
this.ZoneNumber = zn;
|
||||
this.ZoneLetter = zl;
|
||||
}
|
||||
}
|
||||
|
||||
const _precision: number = 7; // Precision for LatLon to UTM conversion
|
||||
const _utm = new UTMLatLng("WGS 84"); // Create UTM/LatLng converter for WGS84 projection
|
||||
|
||||
// Wrapper for LatLon to UTM conversion
|
||||
export function LatLonToUtm(lat: number, lon: number) {
|
||||
return _utm.convertLatLngToUtm(lat, lon, _precision);
|
||||
}
|
||||
|
||||
// Wrapper for UTM to LatLon conversion
|
||||
export function UtmToLatLon(utm: UTM): { lat: number; lon: number } {
|
||||
let temp = _utm.convertUtmToLatLng(
|
||||
utm.Easting,
|
||||
utm.Northing,
|
||||
utm.ZoneNumber,
|
||||
utm.ZoneLetter
|
||||
);
|
||||
return { lat: temp.lat, lon: temp.lng };
|
||||
}
|
||||
}
|
||||
|
||||
// Leaflet marker with additional info to represent a mounting point
|
||||
class MountingPoint extends L.Marker {
|
||||
SupportedAssets: number[] = [];
|
||||
ID: number = -1;
|
||||
}
|
||||
|
||||
// Represents all levels with the same designation,
|
||||
// Stores the mounting points of those levels
|
||||
class Layer {
|
||||
Name: string;
|
||||
Ids: number[];
|
||||
Selected: boolean;
|
||||
LLayer: L.LayerGroup;
|
||||
|
||||
constructor(name) {
|
||||
this.Name = name;
|
||||
this.Ids = [];
|
||||
this.Selected = true;
|
||||
this.LLayer = L.layerGroup(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
// Returns true if str is undefined, empty or null
|
||||
function IsStringEmpty(str: string): boolean {
|
||||
return str == undefined || str == "" || str == null;
|
||||
}
|
||||
|
||||
// jQuery like shortcut to get html elements
|
||||
function $(query: string): HTMLElement | null {
|
||||
return document.querySelector(query);
|
||||
}
|
||||
|
||||
// Retrieves the angular $scope from outside a controller
|
||||
function GetScope(): any {
|
||||
return angular.element($("body") as Element).scope() as any;
|
||||
}
|
||||
|
||||
function Status(str: string): void {
|
||||
GetScope().status = str;
|
||||
console.log(str);
|
||||
($("#progressBar") as HTMLProgressElement).value++;
|
||||
}
|
||||
|
||||
// #endregion
|
||||
|
||||
// Main AngularJs controller
|
||||
ngApp.controller("ctrl", $scope => {
|
||||
let data: any = {}; // Will hold the websocket response
|
||||
let t0: number | null = null; // Measures the time it takes to load and parse
|
||||
$scope.disableInput = false; // True when loadData kicks in, disables the inputs
|
||||
$scope.connected = false; // True when websocket response was received
|
||||
$scope.status = undefined; // String that will be shown while connecting
|
||||
|
||||
// Writes the websocket response to data when the load button is clicked
|
||||
/** @function */ $scope.loadDataFromWS = (ip: string): void => {
|
||||
$scope.disableInput = true;
|
||||
console.log(
|
||||
"Begin loading data ####################################################"
|
||||
);
|
||||
|
||||
t0 = performance.now(); // Get start time
|
||||
|
||||
// Default value for ip if nothing was entered
|
||||
ip = IsStringEmpty(ip) ? "ws://192.168.133.140:2080" : ip;
|
||||
|
||||
// Catch invalid ips
|
||||
try {
|
||||
var ws = new WebSocket(ip); // Connect to the websocket
|
||||
} catch (e) {
|
||||
alert("Invalid IP");
|
||||
return;
|
||||
}
|
||||
|
||||
Status(`\tConnecting to ${ip}...`);
|
||||
|
||||
// Connect to the web socket
|
||||
ws.onopen = () => {
|
||||
console.log("\tConnected.");
|
||||
ws.send(
|
||||
JSON.stringify({
|
||||
type: "getEssentials",
|
||||
uuid: "UUID"
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
// Handles the response of the websocket
|
||||
ws.onmessage = response => {
|
||||
console.log(
|
||||
`\tFetched ${Math.round(
|
||||
new TextEncoder().encode(response.data).length / 1000
|
||||
)}kb.`
|
||||
);
|
||||
data = JSON.parse(response.data).data; // Parse websocket response to data
|
||||
window.localStorage.setItem("data", escape(response.data));
|
||||
$scope.$broadcast("dataLoaded"); // Call response event to kick in the map and selection GUI
|
||||
};
|
||||
|
||||
// Handle bad websocket responses
|
||||
ws.onclose = event => {
|
||||
if (event.code > 1000) {
|
||||
t0 = null;
|
||||
$scope.status = "";
|
||||
alert(`Error when getting websocket response.\n${event.code}`);
|
||||
$scope.disableInput = false;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/** @function */ $scope.loadDataFromCache = () => {
|
||||
$scope.disableInput = true;
|
||||
console.log(
|
||||
"Begin loading data ####################################################"
|
||||
);
|
||||
t0 = performance.now();
|
||||
Status("Loading data from cache...");
|
||||
|
||||
try {
|
||||
if (window.localStorage.getItem("data") == null) throw new Error();
|
||||
let _data = unescape(window.localStorage.getItem("data") as string);
|
||||
data = JSON.parse(_data).data;
|
||||
console.log(
|
||||
`\tLoaded ${Math.round(
|
||||
new TextEncoder().encode(_data).length / 1000
|
||||
)}kb from cache.`
|
||||
);
|
||||
$scope.$broadcast("dataLoaded");
|
||||
} catch {
|
||||
$scope.status = "";
|
||||
$scope.disableInput = false;
|
||||
t0 = null;
|
||||
console.log("\tCould not load data from cache.");
|
||||
alert("No data cached.");
|
||||
}
|
||||
};
|
||||
|
||||
// Handles websocket response event
|
||||
$scope.$on("dataLoaded", () => {
|
||||
let _data: any = data;
|
||||
|
||||
$scope.connected = true; // Switches the connection menu for the mounting point selection
|
||||
$scope.loading = true; // Disables the GUI while doing stuff
|
||||
|
||||
// #region MAP
|
||||
|
||||
console.log("\tCreating map.");
|
||||
|
||||
// Create the map, set view and image
|
||||
let map = new L.Map("map").setView(
|
||||
new L.LatLng(53.0528064472226, 8.89412999153137),
|
||||
8
|
||||
);
|
||||
let imageBounds = new L.LatLngBounds([
|
||||
[53.0528064472226, 8.89412999153137],
|
||||
[53.056520842139, 8.90030980110168]
|
||||
]);
|
||||
let mapImage = L.imageOverlay("img/RDE2.jpg", imageBounds);
|
||||
map.addLayer(mapImage);
|
||||
map.fitBounds(imageBounds);
|
||||
|
||||
// #endregion
|
||||
// #region BUILDINGS
|
||||
|
||||
// Get buildings
|
||||
let buildings: any[] = _data.objects;
|
||||
|
||||
Status(`\tParsing ${buildings.length} buildings...`);
|
||||
|
||||
// Create GeoJson from buidling footprints
|
||||
let footprintPolygons: GeoJSON.FeatureCollection = {
|
||||
type: "FeatureCollection",
|
||||
features: []
|
||||
};
|
||||
|
||||
for (let currentBuilding of buildings) {
|
||||
// Check if current builing has footprint data, if not: skip
|
||||
if (!(currentBuilding.path[0] == undefined)) {
|
||||
// Holds footprint coordinates of the current building
|
||||
let footprintCoords: number[][][] = [[]];
|
||||
|
||||
// Parse footprint coordinates from current building
|
||||
for (let pos of currentBuilding.path) {
|
||||
footprintCoords[0].push([
|
||||
// Convert from radians to degrees and add to the array
|
||||
Calc.RadToDeg(pos.lon),
|
||||
Calc.RadToDeg(pos.lat)
|
||||
]);
|
||||
}
|
||||
|
||||
// Last point has to be the same as the first point so we add it again
|
||||
footprintCoords[0].push([
|
||||
Calc.RadToDeg(currentBuilding.path[0].lon),
|
||||
Calc.RadToDeg(currentBuilding.path[0].lat)
|
||||
]);
|
||||
|
||||
// Create new GeoJson Feature with building footprint
|
||||
let currentFootprint: GeoJSON.Feature = {
|
||||
type: "Feature",
|
||||
properties: {
|
||||
name: currentBuilding.designation
|
||||
},
|
||||
geometry: {
|
||||
type: "Polygon",
|
||||
coordinates: footprintCoords
|
||||
}
|
||||
};
|
||||
|
||||
// Add GeoJson feature to feature collection
|
||||
footprintPolygons.features.push(currentFootprint);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw building footprints to map, add name popups
|
||||
let footprintGeoJson = L.geoJSON(footprintPolygons, {
|
||||
onEachFeature: (feature, layer) => {
|
||||
layer.bindPopup(`<h2>${feature.properties.name}</h2>`);
|
||||
}
|
||||
}).addTo(map);
|
||||
|
||||
// #endregion
|
||||
// #region LEVELS
|
||||
|
||||
let levels: any[] = _data.levels; // Levels are the actual floors in the building
|
||||
let layers: Layer[] = []; // Layers are their representation on the map
|
||||
|
||||
Status(`\tParsing ${levels.length} levels...`);
|
||||
|
||||
for (let level of levels) {
|
||||
// Create a layer for each level
|
||||
|
||||
let add: boolean = true;
|
||||
for (let layer of layers) {
|
||||
// Levels with duplicate names will be on the same layer
|
||||
if (level.designation === layer.Name) {
|
||||
add = false;
|
||||
layer.Ids.push(level.id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (add) {
|
||||
// Create new Layer if level is not a duplicate
|
||||
let newLayer: Layer = new Layer(level.designation);
|
||||
newLayer.Ids.push(level.id);
|
||||
layers.push(newLayer);
|
||||
}
|
||||
}
|
||||
|
||||
let outdoorLayer: Layer = new Layer("outdoor"); // Create a layer for mounting points outside of buildings
|
||||
outdoorLayer.Ids = [-1];
|
||||
|
||||
let footprintLayer: Layer = new Layer("buildings"); // Create a layer for the building footprint
|
||||
footprintLayer.LLayer = footprintGeoJson;
|
||||
|
||||
layers.push(outdoorLayer); // Add outdoor and footprint layers
|
||||
layers.push(footprintLayer);
|
||||
|
||||
$scope.layers = layers; // Add layers to the checkbox menu
|
||||
|
||||
// #endregion
|
||||
// #region MOUNTING POINTS
|
||||
|
||||
// Get mounting points
|
||||
let mountingPoints: any[] = _data.mountingPoints;
|
||||
|
||||
Status(`\tParsing ${mountingPoints.length} mounting points...`);
|
||||
|
||||
for (let m of mountingPoints) {
|
||||
for (let b of buildings) {
|
||||
if (b.id == m.objectId) {
|
||||
// Current mounting point is in current buidling?
|
||||
|
||||
b.utmRefPoint = Calc.LatLonToUtm(
|
||||
Calc.RadToDeg(b.refPoint.lat),
|
||||
Calc.RadToDeg(b.refPoint.lon)
|
||||
); // Converts refPoint of the building to UTM
|
||||
|
||||
m.fixedPosition = Calc.RotatePoint(
|
||||
{ x: m.position3d.x, y: m.position3d.y },
|
||||
Calc.DegToRad(b.rotationDegree)
|
||||
); // Rotates coords of the mounting point by rotationDegree of the building
|
||||
|
||||
m.absoluteUtm = b.utmRefPoint;
|
||||
m.absoluteUtm.Easting += m.fixedPosition.x;
|
||||
m.absoluteUtm.Northing += m.fixedPosition.y;
|
||||
m.absoluteLatLon = Calc.UtmToLatLon(m.absoluteUtm);
|
||||
// Add refPoint to the relative position and convert back to lat/lng
|
||||
|
||||
const arButtonHtml = isMobile
|
||||
? `<button
|
||||
onclick="window.Functions.DisplayInAr(${m.id})"
|
||||
id="arButton"
|
||||
>
|
||||
Show in AR
|
||||
</button>`
|
||||
: "<i>AR not supported on desktop.</i>";
|
||||
|
||||
for (let l of layers) {
|
||||
for (let i of l.Ids) {
|
||||
if (i == m.levelId) {
|
||||
// Current mouting point is on current level?
|
||||
|
||||
let marker = new MountingPoint(
|
||||
// Create a marker for the mounting point
|
||||
new L.LatLng(
|
||||
m.absoluteLatLon.lat,
|
||||
m.absoluteLatLon.lon
|
||||
),
|
||||
{
|
||||
icon: L.icon({
|
||||
iconUrl: "img/marker.png",
|
||||
iconSize: [30, 30]
|
||||
})
|
||||
}
|
||||
)
|
||||
.bindPopup(
|
||||
// Create a popup with info about the mounting point
|
||||
`<h2>
|
||||
${IsStringEmpty(m.tag) ? m.designation : m.tag}
|
||||
</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<td>ID</td>
|
||||
<td>${m.id}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Object ID</td>
|
||||
<td>${m.objectId}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Supported Asset Type IDs</td>
|
||||
<td>${m.supportedAssetTypeIds}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
${arButtonHtml}
|
||||
`
|
||||
)
|
||||
.addTo(map); // Add it to the map
|
||||
|
||||
marker.SupportedAssets = // Add info about supported asset types
|
||||
m.supportedAssetTypeIds;
|
||||
marker.ID = m.id; // Add mounting point id
|
||||
|
||||
l.LLayer.addLayer(marker); // Add marker to corresponding layer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$scope.mountingPoints = mountingPoints;
|
||||
|
||||
// #endregion
|
||||
// #region ASSETS
|
||||
|
||||
// Get asset types
|
||||
let assets: any[] = _data.assetTypes;
|
||||
|
||||
Status(`\tParsing ${assets.length} assets...`);
|
||||
|
||||
// Add asset types to the dropdown menu
|
||||
$scope.assets = {
|
||||
availableAssets: assets,
|
||||
selectedAsset: assets[0]
|
||||
};
|
||||
|
||||
// #endregion
|
||||
// #region ANGULAR FUNCTIONS
|
||||
|
||||
// Called by either the layer or asset selection
|
||||
/** @function */ $scope.SelectionChanged = () => {
|
||||
let points: number = 0;
|
||||
for (let layer of layers) {
|
||||
if (layer.Selected) {
|
||||
map.addLayer(layer.LLayer); // Add selected layers
|
||||
|
||||
// Hacky type conversion to get the supported asset types from each mounting point on a layer
|
||||
// If it's stupid but it works it's not stupid
|
||||
for (let m of (layer.LLayer.getLayers() as unknown[]) as MountingPoint[]) {
|
||||
try {
|
||||
for (let a of m.SupportedAssets) {
|
||||
if (a == $scope.assets.selectedAsset.id) {
|
||||
m.addTo(map); // Add markers for selected asset type
|
||||
++points;
|
||||
} else {
|
||||
m.removeFrom(map); // Remove all other markers
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
/** Sometimes theres an error here...
|
||||
* Doesn't seem to interfere with anything though and
|
||||
* I don't want to see it in the console
|
||||
*/
|
||||
}
|
||||
}
|
||||
} else map.removeLayer(layer.LLayer); // Remove unselected layers
|
||||
}
|
||||
console.log(
|
||||
`Selected ${points} mounting point${points == 1 ? "" : "s"}.`
|
||||
);
|
||||
};
|
||||
|
||||
// Filter for selected mounting point table and count
|
||||
/** @function */ $scope.MountingPointFilter = () => {
|
||||
return mp => {
|
||||
let correctAssetType: boolean = false;
|
||||
|
||||
for (let i of mp.supportedAssetTypeIds) {
|
||||
if (i == $scope.assets.selectedAsset.id) {
|
||||
correctAssetType = true;
|
||||
break;
|
||||
}
|
||||
} // Current mounting point supports selected asset type
|
||||
|
||||
let correctLayer: boolean = false;
|
||||
|
||||
for (let layer of layers) {
|
||||
for (let i of layer.Ids) {
|
||||
if (layer.Selected && i == mp.levelId) {
|
||||
correctLayer = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} // Current mounting point is on a selected layer
|
||||
|
||||
let foundBySearch: boolean = IsStringEmpty($scope.mpSearch)
|
||||
? true // Automatically true if search input empty
|
||||
: (IsStringEmpty(mp.tag) ? mp.designation : mp.tag).indexOf(
|
||||
$scope.mpSearch
|
||||
) >= 0 || mp.id.toString().indexOf($scope.mpSearch) >= 0;
|
||||
// true if tag, designation or id contain search input
|
||||
|
||||
return correctAssetType && correctLayer && foundBySearch;
|
||||
};
|
||||
};
|
||||
|
||||
// Function for the Show button
|
||||
/** @function */ $scope.ShowMp = mp => {
|
||||
for (let l of layers) {
|
||||
// Not this again...
|
||||
for (let m of (l.LLayer.getLayers() as unknown[]) as MountingPoint[]) {
|
||||
if (m.ID == mp.id) {
|
||||
// Find clicked mounting point
|
||||
m.openPopup(); // Open corresponding popup
|
||||
map.panTo(m.getLatLng()); // Center map on the popup
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// #endregion
|
||||
|
||||
// Get final time and format it
|
||||
let time: string =
|
||||
t0 != null
|
||||
? `Finished loading data in ${performance.now() -
|
||||
t0}ms ########################################`
|
||||
: `Finished loading data #################################################`;
|
||||
console.log(time);
|
||||
|
||||
$scope.SelectionChanged(); // Make initial map state fit the initial menu state
|
||||
$scope.loading = false; // Done loading
|
||||
$scope.$apply();
|
||||
});
|
||||
});
|
||||
|
||||
// #region WIKITUDE FUNCTIONS
|
||||
|
||||
var currentPOI: any = undefined; // Holds current wikitude ar marker
|
||||
|
||||
// Shows an augmented reality marker vor the selected mounting point
|
||||
function _displayInAr(id: number): void {
|
||||
let $scope = GetScope(); // Retrieve angular scope
|
||||
let mountingPoint: any;
|
||||
|
||||
for (let mp of $scope.mountingPoints) {
|
||||
if (mp.id == id) {
|
||||
mountingPoint = mp;
|
||||
break;
|
||||
}
|
||||
} // Get correct mounting point
|
||||
|
||||
let name = IsStringEmpty(mountingPoint.tag)
|
||||
? mountingPoint.designation
|
||||
: mountingPoint.tag;
|
||||
|
||||
$scope.arMountingPoint = name;
|
||||
// Display mounting point tag/designation
|
||||
|
||||
currentPOI = new AR.GeoObject(
|
||||
[
|
||||
new AR.GeoLocation(
|
||||
mountingPoint.absoluteLatLon.lat,
|
||||
mountingPoint.absoluteLatLon.lon
|
||||
)
|
||||
],
|
||||
{
|
||||
drawables: {
|
||||
cam: [
|
||||
new AR.ImageDrawable(
|
||||
new AR.ImageResource("img/armarker.png"),
|
||||
2.5,
|
||||
{ zOrder: 0, opacity: 1 }
|
||||
),
|
||||
new AR.Label(name, 1, {
|
||||
zOrder: 1,
|
||||
style: { textColor: "#ffffff" }
|
||||
})
|
||||
],
|
||||
indicator: new AR.ImageDrawable(
|
||||
new AR.ImageResource("img/arindicator.png"),
|
||||
0.1,
|
||||
{
|
||||
enabled: true,
|
||||
verticalAnchor: AR.CONST.VERTICAL_ANCHOR.TOP
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
); // Create AR marker
|
||||
|
||||
$scope.arMode = true; // Hide map and menu
|
||||
|
||||
$scope.$apply();
|
||||
|
||||
console.log("Switched to AR mode.");
|
||||
}
|
||||
|
||||
// Goes back to the map view
|
||||
function _backFromAr(): void {
|
||||
let $scope = GetScope(); // Retrieve angular scope
|
||||
|
||||
$scope.arMountingPoint = ""; // Clear name display
|
||||
$scope.arMode = false; // Show map and menu again
|
||||
|
||||
currentPOI.destroy();
|
||||
currentPOI = undefined;
|
||||
|
||||
$scope.$apply();
|
||||
|
||||
console.log("Switched to map mode.");
|
||||
}
|
||||
|
||||
// #region TS -> JS
|
||||
/**
|
||||
* Hacky way to make typescript functions accessible from the html page
|
||||
* like in regular javascript
|
||||
*/
|
||||
|
||||
// Add "Functions"-object to window
|
||||
declare global {
|
||||
interface Window {
|
||||
Functions: any;
|
||||
}
|
||||
}
|
||||
|
||||
// Attach functions
|
||||
window.Functions = window.Functions || {
|
||||
DisplayInAr: _displayInAr,
|
||||
BackFromAr: _backFromAr
|
||||
};
|
||||
// #endregion
|
||||
|
||||
// #endregion
|
||||
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"requires": true,
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"@types/angular": {
|
||||
"version": "1.6.54",
|
||||
"resolved": "https://registry.npmjs.org/@types/angular/-/angular-1.6.54.tgz",
|
||||
"integrity": "sha512-xA1FuozWXeRQ7FClUbvk8ePL+dydBeDoCWRPFTHU5+8uvVtIIfLGiHA8CMkwsbddFCYnTDVbLxG85a/HBx7LtA=="
|
||||
},
|
||||
"@types/geojson": {
|
||||
"version": "7946.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.5.tgz",
|
||||
"integrity": "sha512-rLlMXpd3rdlrp0+xsrda/hFfOpIxgqFcRpk005UKbHtcdFK+QXAjhBAPnvO58qF4O1LdDXrcaiJxMgstCIlcaw=="
|
||||
},
|
||||
"@types/leaflet": {
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.4.2.tgz",
|
||||
"integrity": "sha512-iRyUFh6m5OSbhekHxlZb5SkdfUVpaXhk+e8fgQviZL6iZ1chV3Q030/+M6jO2A6VM235A1hYuUmBMVsrLAvKEA==",
|
||||
"requires": {
|
||||
"@types/geojson": "*"
|
||||
}
|
||||
},
|
||||
"angular": {
|
||||
"version": "1.7.7",
|
||||
"resolved": "https://registry.npmjs.org/angular/-/angular-1.7.7.tgz",
|
||||
"integrity": "sha512-MH3JEGd8y/EkNCKJ8EV6Ch0j9X0rZTta/QVIDpBWaIdfh85/e5KO8+ZKgvWIb02MQuiS20pDFmMFlv4ZaLcLWg=="
|
||||
},
|
||||
"leaflet": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.4.0.tgz",
|
||||
"integrity": "sha512-x9j9tGY1+PDLN9pcWTx9/y6C5nezoTMB8BLK5jTakx+H7bPlnbCHfi9Hjg+Qt36sgDz/cb9lrSpNQXmk45Tvhw=="
|
||||
},
|
||||
"utm-latlng": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/utm-latlng/-/utm-latlng-1.0.5.tgz",
|
||||
"integrity": "sha1-rmBbTCLSapYVmoH2vLOSkyEj18I="
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@types/angular": "^1.6.54",
|
||||
"@types/leaflet": "^1.4.2",
|
||||
"angular": "^1.7.7",
|
||||
"leaflet": "^1.4.0",
|
||||
"utm-latlng": "^1.0.5"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,624 @@
|
||||
/* required styles */
|
||||
|
||||
.leaflet-pane,
|
||||
.leaflet-tile,
|
||||
.leaflet-marker-icon,
|
||||
.leaflet-marker-shadow,
|
||||
.leaflet-tile-container,
|
||||
.leaflet-pane > svg,
|
||||
.leaflet-pane > canvas,
|
||||
.leaflet-zoom-box,
|
||||
.leaflet-image-layer,
|
||||
.leaflet-layer {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.leaflet-container {
|
||||
overflow: hidden;
|
||||
}
|
||||
.leaflet-tile,
|
||||
.leaflet-marker-icon,
|
||||
.leaflet-marker-shadow {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
-webkit-user-drag: none;
|
||||
}
|
||||
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
|
||||
.leaflet-safari .leaflet-tile {
|
||||
image-rendering: -webkit-optimize-contrast;
|
||||
}
|
||||
/* hack that prevents hw layers "stretching" when loading new tiles */
|
||||
.leaflet-safari .leaflet-tile-container {
|
||||
width: 1600px;
|
||||
height: 1600px;
|
||||
-webkit-transform-origin: 0 0;
|
||||
}
|
||||
.leaflet-marker-icon,
|
||||
.leaflet-marker-shadow {
|
||||
display: block;
|
||||
}
|
||||
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
|
||||
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
|
||||
.leaflet-container .leaflet-overlay-pane svg,
|
||||
.leaflet-container .leaflet-marker-pane img,
|
||||
.leaflet-container .leaflet-shadow-pane img,
|
||||
.leaflet-container .leaflet-tile-pane img,
|
||||
.leaflet-container img.leaflet-image-layer {
|
||||
max-width: none !important;
|
||||
}
|
||||
|
||||
.leaflet-container.leaflet-touch-zoom {
|
||||
-ms-touch-action: pan-x pan-y;
|
||||
touch-action: pan-x pan-y;
|
||||
}
|
||||
.leaflet-container.leaflet-touch-drag {
|
||||
-ms-touch-action: pinch-zoom;
|
||||
}
|
||||
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
.leaflet-tile {
|
||||
filter: inherit;
|
||||
visibility: hidden;
|
||||
}
|
||||
.leaflet-tile-loaded {
|
||||
visibility: inherit;
|
||||
}
|
||||
.leaflet-zoom-box {
|
||||
width: 0;
|
||||
height: 0;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
z-index: 800;
|
||||
}
|
||||
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
|
||||
.leaflet-overlay-pane svg {
|
||||
-moz-user-select: none;
|
||||
}
|
||||
|
||||
.leaflet-pane { z-index: 400; }
|
||||
|
||||
.leaflet-tile-pane { z-index: 200; }
|
||||
.leaflet-overlay-pane { z-index: 400; }
|
||||
.leaflet-shadow-pane { z-index: 500; }
|
||||
.leaflet-marker-pane { z-index: 600; }
|
||||
.leaflet-tooltip-pane { z-index: 650; }
|
||||
.leaflet-popup-pane { z-index: 700; }
|
||||
|
||||
.leaflet-map-pane canvas { z-index: 100; }
|
||||
.leaflet-map-pane svg { z-index: 200; }
|
||||
|
||||
.leaflet-vml-shape {
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
}
|
||||
.lvml {
|
||||
behavior: url(#default#VML);
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
|
||||
/* control positioning */
|
||||
|
||||
.leaflet-control {
|
||||
position: relative;
|
||||
z-index: 800;
|
||||
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
|
||||
pointer-events: auto;
|
||||
}
|
||||
.leaflet-top,
|
||||
.leaflet-bottom {
|
||||
position: absolute;
|
||||
z-index: 1000;
|
||||
pointer-events: none;
|
||||
}
|
||||
.leaflet-top {
|
||||
top: 0;
|
||||
}
|
||||
.leaflet-right {
|
||||
right: 0;
|
||||
}
|
||||
.leaflet-bottom {
|
||||
bottom: 0;
|
||||
}
|
||||
.leaflet-left {
|
||||
left: 0;
|
||||
}
|
||||
.leaflet-control {
|
||||
float: left;
|
||||
clear: both;
|
||||
}
|
||||
.leaflet-right .leaflet-control {
|
||||
float: right;
|
||||
}
|
||||
.leaflet-top .leaflet-control {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.leaflet-bottom .leaflet-control {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.leaflet-left .leaflet-control {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.leaflet-right .leaflet-control {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
|
||||
/* zoom and fade animations */
|
||||
|
||||
.leaflet-fade-anim .leaflet-tile {
|
||||
will-change: opacity;
|
||||
}
|
||||
.leaflet-fade-anim .leaflet-popup {
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.2s linear;
|
||||
-moz-transition: opacity 0.2s linear;
|
||||
-o-transition: opacity 0.2s linear;
|
||||
transition: opacity 0.2s linear;
|
||||
}
|
||||
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
|
||||
opacity: 1;
|
||||
}
|
||||
.leaflet-zoom-animated {
|
||||
-webkit-transform-origin: 0 0;
|
||||
-ms-transform-origin: 0 0;
|
||||
transform-origin: 0 0;
|
||||
}
|
||||
.leaflet-zoom-anim .leaflet-zoom-animated {
|
||||
will-change: transform;
|
||||
}
|
||||
.leaflet-zoom-anim .leaflet-zoom-animated {
|
||||
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
|
||||
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
|
||||
-o-transition: -o-transform 0.25s cubic-bezier(0,0,0.25,1);
|
||||
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
|
||||
}
|
||||
.leaflet-zoom-anim .leaflet-tile,
|
||||
.leaflet-pan-anim .leaflet-tile {
|
||||
-webkit-transition: none;
|
||||
-moz-transition: none;
|
||||
-o-transition: none;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.leaflet-zoom-anim .leaflet-zoom-hide {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
|
||||
/* cursors */
|
||||
|
||||
.leaflet-interactive {
|
||||
cursor: pointer;
|
||||
}
|
||||
.leaflet-grab {
|
||||
cursor: -webkit-grab;
|
||||
cursor: -moz-grab;
|
||||
}
|
||||
.leaflet-crosshair,
|
||||
.leaflet-crosshair .leaflet-interactive {
|
||||
cursor: crosshair;
|
||||
}
|
||||
.leaflet-popup-pane,
|
||||
.leaflet-control {
|
||||
cursor: auto;
|
||||
}
|
||||
.leaflet-dragging .leaflet-grab,
|
||||
.leaflet-dragging .leaflet-grab .leaflet-interactive,
|
||||
.leaflet-dragging .leaflet-marker-draggable {
|
||||
cursor: move;
|
||||
cursor: -webkit-grabbing;
|
||||
cursor: -moz-grabbing;
|
||||
}
|
||||
|
||||
/* marker & overlays interactivity */
|
||||
.leaflet-marker-icon,
|
||||
.leaflet-marker-shadow,
|
||||
.leaflet-image-layer,
|
||||
.leaflet-pane > svg path,
|
||||
.leaflet-tile-container {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.leaflet-marker-icon.leaflet-interactive,
|
||||
.leaflet-image-layer.leaflet-interactive,
|
||||
.leaflet-pane > svg path.leaflet-interactive {
|
||||
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
/* visual tweaks */
|
||||
|
||||
.leaflet-container {
|
||||
background: #ddd;
|
||||
outline: 0;
|
||||
}
|
||||
.leaflet-container a {
|
||||
color: #0078A8;
|
||||
}
|
||||
.leaflet-container a.leaflet-active {
|
||||
outline: 2px solid orange;
|
||||
}
|
||||
.leaflet-zoom-box {
|
||||
border: 2px dotted #38f;
|
||||
background: rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
|
||||
/* general typography */
|
||||
.leaflet-container {
|
||||
font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
|
||||
/* general toolbar styles */
|
||||
|
||||
.leaflet-bar {
|
||||
box-shadow: 0 1px 5px rgba(0,0,0,0.65);
|
||||
border-radius: 4px;
|
||||
}
|
||||
.leaflet-bar a,
|
||||
.leaflet-bar a:hover {
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #ccc;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
line-height: 26px;
|
||||
display: block;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
}
|
||||
.leaflet-bar a,
|
||||
.leaflet-control-layers-toggle {
|
||||
background-position: 50% 50%;
|
||||
background-repeat: no-repeat;
|
||||
display: block;
|
||||
}
|
||||
.leaflet-bar a:hover {
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
.leaflet-bar a:first-child {
|
||||
border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
}
|
||||
.leaflet-bar a:last-child {
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom: none;
|
||||
}
|
||||
.leaflet-bar a.leaflet-disabled {
|
||||
cursor: default;
|
||||
background-color: #f4f4f4;
|
||||
color: #bbb;
|
||||
}
|
||||
|
||||
.leaflet-touch .leaflet-bar a {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
|
||||
/* zoom control */
|
||||
|
||||
.leaflet-control-zoom-in,
|
||||
.leaflet-control-zoom-out {
|
||||
font: bold 18px 'Lucida Console', Monaco, monospace;
|
||||
text-indent: 1px;
|
||||
}
|
||||
.leaflet-control-zoom-out {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.leaflet-touch .leaflet-control-zoom-in {
|
||||
font-size: 22px;
|
||||
}
|
||||
.leaflet-touch .leaflet-control-zoom-out {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
|
||||
/* layers control */
|
||||
|
||||
.leaflet-control-layers {
|
||||
box-shadow: 0 1px 5px rgba(0,0,0,0.4);
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.leaflet-control-layers-toggle {
|
||||
background-image: url(images/layers.png);
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
.leaflet-retina .leaflet-control-layers-toggle {
|
||||
background-image: url(images/layers-2x.png);
|
||||
background-size: 26px 26px;
|
||||
}
|
||||
.leaflet-touch .leaflet-control-layers-toggle {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
}
|
||||
.leaflet-control-layers .leaflet-control-layers-list,
|
||||
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
|
||||
display: none;
|
||||
}
|
||||
.leaflet-control-layers-expanded .leaflet-control-layers-list {
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
.leaflet-control-layers-expanded {
|
||||
padding: 6px 10px 6px 6px;
|
||||
color: #333;
|
||||
background: #fff;
|
||||
}
|
||||
.leaflet-control-layers-scrollbar {
|
||||
overflow-y: scroll;
|
||||
padding-right: 5px;
|
||||
}
|
||||
.leaflet-control-layers-selector {
|
||||
margin-top: 2px;
|
||||
position: relative;
|
||||
top: 1px;
|
||||
}
|
||||
.leaflet-control-layers label {
|
||||
display: block;
|
||||
}
|
||||
.leaflet-control-layers-separator {
|
||||
height: 0;
|
||||
border-top: 1px solid #ddd;
|
||||
margin: 5px -10px 5px -6px;
|
||||
}
|
||||
|
||||
/* Default icon URLs */
|
||||
.leaflet-default-icon-path {
|
||||
background-image: url(images/marker-icon.png);
|
||||
}
|
||||
|
||||
|
||||
/* attribution and scale controls */
|
||||
|
||||
.leaflet-container .leaflet-control-attribution {
|
||||
background: #fff;
|
||||
background: rgba(255, 255, 255, 0.7);
|
||||
margin: 0;
|
||||
}
|
||||
.leaflet-control-attribution,
|
||||
.leaflet-control-scale-line {
|
||||
padding: 0 5px;
|
||||
color: #333;
|
||||
}
|
||||
.leaflet-control-attribution a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.leaflet-control-attribution a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.leaflet-container .leaflet-control-attribution,
|
||||
.leaflet-container .leaflet-control-scale {
|
||||
font-size: 11px;
|
||||
}
|
||||
.leaflet-left .leaflet-control-scale {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.leaflet-bottom .leaflet-control-scale {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.leaflet-control-scale-line {
|
||||
border: 2px solid #777;
|
||||
border-top: none;
|
||||
line-height: 1.1;
|
||||
padding: 2px 5px 1px;
|
||||
font-size: 11px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
|
||||
background: #fff;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
.leaflet-control-scale-line:not(:first-child) {
|
||||
border-top: 2px solid #777;
|
||||
border-bottom: none;
|
||||
margin-top: -2px;
|
||||
}
|
||||
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
|
||||
border-bottom: 2px solid #777;
|
||||
}
|
||||
|
||||
.leaflet-touch .leaflet-control-attribution,
|
||||
.leaflet-touch .leaflet-control-layers,
|
||||
.leaflet-touch .leaflet-bar {
|
||||
box-shadow: none;
|
||||
}
|
||||
.leaflet-touch .leaflet-control-layers,
|
||||
.leaflet-touch .leaflet-bar {
|
||||
border: 2px solid rgba(0,0,0,0.2);
|
||||
background-clip: padding-box;
|
||||
}
|
||||
|
||||
|
||||
/* popup */
|
||||
|
||||
.leaflet-popup {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.leaflet-popup-content-wrapper {
|
||||
padding: 1px;
|
||||
text-align: left;
|
||||
border-radius: 12px;
|
||||
}
|
||||
.leaflet-popup-content {
|
||||
margin: 13px 19px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.leaflet-popup-content p {
|
||||
margin: 18px 0;
|
||||
}
|
||||
.leaflet-popup-tip-container {
|
||||
width: 40px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
margin-left: -20px;
|
||||
overflow: hidden;
|
||||
pointer-events: none;
|
||||
}
|
||||
.leaflet-popup-tip {
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
padding: 1px;
|
||||
|
||||
margin: -10px auto 0;
|
||||
|
||||
-webkit-transform: rotate(45deg);
|
||||
-moz-transform: rotate(45deg);
|
||||
-ms-transform: rotate(45deg);
|
||||
-o-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
.leaflet-popup-content-wrapper,
|
||||
.leaflet-popup-tip {
|
||||
background: white;
|
||||
color: #333;
|
||||
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
|
||||
}
|
||||
.leaflet-container a.leaflet-popup-close-button {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
padding: 4px 4px 0 0;
|
||||
border: none;
|
||||
text-align: center;
|
||||
width: 18px;
|
||||
height: 14px;
|
||||
font: 16px/14px Tahoma, Verdana, sans-serif;
|
||||
color: #c3c3c3;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
background: transparent;
|
||||
}
|
||||
.leaflet-container a.leaflet-popup-close-button:hover {
|
||||
color: #999;
|
||||
}
|
||||
.leaflet-popup-scrolled {
|
||||
overflow: auto;
|
||||
border-bottom: 1px solid #ddd;
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.leaflet-oldie .leaflet-popup-content-wrapper {
|
||||
zoom: 1;
|
||||
}
|
||||
.leaflet-oldie .leaflet-popup-tip {
|
||||
width: 24px;
|
||||
margin: 0 auto;
|
||||
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
|
||||
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
|
||||
}
|
||||
.leaflet-oldie .leaflet-popup-tip-container {
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
.leaflet-oldie .leaflet-control-zoom,
|
||||
.leaflet-oldie .leaflet-control-layers,
|
||||
.leaflet-oldie .leaflet-popup-content-wrapper,
|
||||
.leaflet-oldie .leaflet-popup-tip {
|
||||
border: 1px solid #999;
|
||||
}
|
||||
|
||||
|
||||
/* div icon */
|
||||
|
||||
.leaflet-div-icon {
|
||||
background: #fff;
|
||||
border: 1px solid #666;
|
||||
}
|
||||
|
||||
|
||||
/* Tooltip */
|
||||
/* Base styles for the element that has a tooltip */
|
||||
.leaflet-tooltip {
|
||||
position: absolute;
|
||||
padding: 6px;
|
||||
background-color: #fff;
|
||||
border: 1px solid #fff;
|
||||
border-radius: 3px;
|
||||
color: #222;
|
||||
white-space: nowrap;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
pointer-events: none;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.4);
|
||||
}
|
||||
.leaflet-tooltip.leaflet-clickable {
|
||||
cursor: pointer;
|
||||
pointer-events: auto;
|
||||
}
|
||||
.leaflet-tooltip-top:before,
|
||||
.leaflet-tooltip-bottom:before,
|
||||
.leaflet-tooltip-left:before,
|
||||
.leaflet-tooltip-right:before {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
border: 6px solid transparent;
|
||||
background: transparent;
|
||||
content: "";
|
||||
}
|
||||
|
||||
/* Directions */
|
||||
|
||||
.leaflet-tooltip-bottom {
|
||||
margin-top: 6px;
|
||||
}
|
||||
.leaflet-tooltip-top {
|
||||
margin-top: -6px;
|
||||
}
|
||||
.leaflet-tooltip-bottom:before,
|
||||
.leaflet-tooltip-top:before {
|
||||
left: 50%;
|
||||
margin-left: -6px;
|
||||
}
|
||||
.leaflet-tooltip-top:before {
|
||||
bottom: 0;
|
||||
margin-bottom: -12px;
|
||||
border-top-color: #fff;
|
||||
}
|
||||
.leaflet-tooltip-bottom:before {
|
||||
top: 0;
|
||||
margin-top: -12px;
|
||||
margin-left: -6px;
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
.leaflet-tooltip-left {
|
||||
margin-left: -6px;
|
||||
}
|
||||
.leaflet-tooltip-right {
|
||||
margin-left: 6px;
|
||||
}
|
||||
.leaflet-tooltip-left:before,
|
||||
.leaflet-tooltip-right:before {
|
||||
top: 50%;
|
||||
margin-top: -6px;
|
||||
}
|
||||
.leaflet-tooltip-left:before {
|
||||
right: 0;
|
||||
margin-right: -12px;
|
||||
border-left-color: #fff;
|
||||
}
|
||||
.leaflet-tooltip-right:before {
|
||||
left: 0;
|
||||
margin-left: -12px;
|
||||
border-right-color: #fff;
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
|
||||
table {
|
||||
background-color: darkgray;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
text-align: left;
|
||||
padding: 5px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.bigBr {
|
||||
line-height: 200%;
|
||||
}
|
||||
|
||||
#map {
|
||||
height: 100vh;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#parentContainer {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
#connectionConatiner {
|
||||
border: 1px solid black;
|
||||
padding: 10px;
|
||||
margin: auto;
|
||||
width: 300px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#mapContainer {
|
||||
height: 100%;
|
||||
width: 66%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#guiContainer {
|
||||
height: 100%;
|
||||
width: 34%;
|
||||
float: right;
|
||||
box-sizing: border-box;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
#arCtrl {
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
top: 90vh;
|
||||
height: 10vh;
|
||||
width: 98%;
|
||||
text-align: center;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
#mp {
|
||||
overflow: auto;
|
||||
height: 350px;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 500px) {
|
||||
|
||||
#map {
|
||||
height: 50%;
|
||||
width: 99%;
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
#parentContainer {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
#mapContainer {
|
||||
height: 50%;
|
||||
width: 100%;
|
||||
float: unset;
|
||||
}
|
||||
|
||||
#guiContainer {
|
||||
position: fixed;
|
||||
overflow: auto;
|
||||
top: 55%;
|
||||
height: 45%;
|
||||
box-sizing: border-box;
|
||||
padding: 20px;
|
||||
width: 100%;
|
||||
float: unset;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
body {
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": { "*": ["types/*"] },
|
||||
/* Basic Options */
|
||||
"target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
|
||||
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
|
||||
// "lib": [], /* Specify library files to be included in the compilation. */
|
||||
// "allowJs": true, /* Allow javascript files to be compiled. */
|
||||
// "checkJs": true, /* Report errors in .js files. */
|
||||
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
||||
// "declaration": true, /* Generates corresponding '.d.ts' file. */
|
||||
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
||||
// "sourceMap": true, /* Generates corresponding '.map' file. */
|
||||
// "outFile": "./", /* Concatenate and emit output to single file. */
|
||||
// "outDir": "./", /* Redirect output structure to the directory. */
|
||||
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||
// "composite": true, /* Enable project compilation */
|
||||
// "removeComments": true, /* Do not emit comments to output. */
|
||||
// "noEmit": true, /* Do not emit outputs. */
|
||||
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
||||
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
||||
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
||||
|
||||
/* Strict Type-Checking Options */
|
||||
"strict": true /* Enable all strict type-checking options. */,
|
||||
"noImplicitAny": false /* Raise error on expressions and declarations with an implied 'any' type. */,
|
||||
// "strictNullChecks": true, /* Enable strict null checks. */
|
||||
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
||||
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
|
||||
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
||||
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
||||
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
||||
|
||||
/* Additional Checks */
|
||||
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
||||
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
||||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||
|
||||
/* Module Resolution Options */
|
||||
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
||||
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
||||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||
"types": [
|
||||
"angular",
|
||||
"leaflet"
|
||||
] /* Type declaration files to be included in compilation. */,
|
||||
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
||||
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
||||
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
||||
|
||||
/* Source Map Options */
|
||||
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
||||
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
||||
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
||||
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
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
|
||||
@@ -0,0 +1,16 @@
|
||||
# Installation
|
||||
> `npm install --save @types/angular`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for Angular JS ( http://angularjs.org ).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/angular
|
||||
|
||||
Additional Details
|
||||
* Last updated: Wed, 06 Feb 2019 21:12:43 GMT
|
||||
* Dependencies: none
|
||||
* Global values: angular
|
||||
|
||||
# Credits
|
||||
These definitions were written by Diego Vilar <https://github.com/diegovilar>, Georgii Dolzhykov <https://github.com/thorn0>, Caleb St-Denis <https://github.com/calebstdenis>, Leonard Thieu <https://github.com/leonard-thieu>, Steffen Kowalski <https://github.com/scipper>.
|
||||
@@ -0,0 +1,829 @@
|
||||
// Project: http://jquery.com/
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
|
||||
// Christian Hoffmeister <https://github.com/choffmeister>
|
||||
// Steve Fenton <https://github.com/Steve-Fenton>
|
||||
// Diullei Gomes <https://github.com/Diullei>
|
||||
// Tass Iliopoulos <https://github.com/tasoili>
|
||||
// Jason Swearingen <https://github.com/jasons-novaleaf>
|
||||
// Sean Hill <https://github.com/seanski>
|
||||
// Guus Goossens <https://github.com/Guuz>
|
||||
// Kelly Summerlin <https://github.com/ksummerlin>
|
||||
// Basarat Ali Syed <https://github.com/basarat>
|
||||
// Nicholas Wolverson <https://github.com/nwolverson>
|
||||
// Derek Cicerone <https://github.com/derekcicerone>
|
||||
// Andrew Gaspar <https://github.com/AndrewGaspar>
|
||||
// Seikichi Kondo <https://github.com/seikichi>
|
||||
// Benjamin Jackman <https://github.com/benjaminjackman>
|
||||
// Poul Sorensen <https://github.com/s093294>
|
||||
// Josh Strobl <https://github.com/JoshStrobl>
|
||||
// John Reilly <https://github.com/johnnyreilly/>
|
||||
// Dick van den Brink <https://github.com/DickvdBrink>
|
||||
// Thomas Schulz <https://github.com/King2500>
|
||||
// Leonard Thieu <https://github.com/leonard-thieu>
|
||||
// Andre Wiggins <https://github.com/andrewiggins>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// Definitions copied from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/0480c5ec87fab41aa23047a02b27f0ea71aaf975/types/jquery/v2/index.d.ts
|
||||
|
||||
interface JQLite extends JQuery {
|
||||
[index: number]: HTMLElement;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
/**
|
||||
* Adds the specified class(es) to each of the set of matched elements.
|
||||
*
|
||||
* @param className One or more space-separated classes to be added to the class attribute of each matched element.
|
||||
* @see {@link https://api.jquery.com/addClass/#addClass-className}
|
||||
*/
|
||||
addClass(className: string): this;
|
||||
|
||||
/**
|
||||
* Insert content, specified by the parameter, after each element in the set of matched elements.
|
||||
*
|
||||
* @param content1 HTML string, DOM element, DocumentFragment, array of elements, or jQuery object to insert after each element in the set of matched elements.
|
||||
* @param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements.
|
||||
* @see {@link https://api.jquery.com/after/#after-content-content}
|
||||
*/
|
||||
after(content1: JQuery | any[] | Element | DocumentFragment | Text | string, ...content2: any[]): this;
|
||||
/**
|
||||
* Insert content, specified by the parameter, after each element in the set of matched elements.
|
||||
*
|
||||
* @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
|
||||
* @see {@link https://api.jquery.com/after/#after-function}
|
||||
*/
|
||||
after(func: (index: number, html: string) => string | Element | JQuery): this;
|
||||
|
||||
/**
|
||||
* Insert content, specified by the parameter, to the end of each element in the set of matched elements.
|
||||
*
|
||||
* @param content1 DOM element, DocumentFragment, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements.
|
||||
* @param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements.
|
||||
* @see {@link https://api.jquery.com/append/#append-content-content}
|
||||
*/
|
||||
append(content1: JQuery | any[] | Element | DocumentFragment | Text | string, ...content2: any[]): this;
|
||||
/**
|
||||
* Insert content, specified by the parameter, to the end of each element in the set of matched elements.
|
||||
*
|
||||
* @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.
|
||||
* @see {@link https://api.jquery.com/append/#append-function}
|
||||
*/
|
||||
append(func: (index: number, html: string) => string | Element | JQuery): this;
|
||||
|
||||
/**
|
||||
* Get the value of an attribute for the first element in the set of matched elements.
|
||||
*
|
||||
* @param attributeName The name of the attribute to get.
|
||||
* @see {@link https://api.jquery.com/attr/#attr-attributeName}
|
||||
*/
|
||||
attr(attributeName: string): string;
|
||||
/**
|
||||
* Set one or more attributes for the set of matched elements.
|
||||
*
|
||||
* @param attributeName The name of the attribute to set.
|
||||
* @param value A value to set for the attribute. If this is `null`, the attribute will be deleted.
|
||||
* @see {@link https://api.jquery.com/attr/#attr-attributeName-value}
|
||||
*/
|
||||
attr(attributeName: string, value: string | number | null): this;
|
||||
/**
|
||||
* Set one or more attributes for the set of matched elements.
|
||||
*
|
||||
* @param attributes An object of attribute-value pairs to set.
|
||||
* @see {@link https://api.jquery.com/attr/#attr-attributes}
|
||||
*/
|
||||
attr(attributes: Object): this;
|
||||
|
||||
/**
|
||||
* Attach a handler to an event for the elements.
|
||||
*
|
||||
* @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
|
||||
* @param handler A function to execute each time the event is triggered.
|
||||
* @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-handler}
|
||||
*/
|
||||
bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): this;
|
||||
/**
|
||||
* Attach a handler to an event for the elements.
|
||||
*
|
||||
* @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
|
||||
* @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true.
|
||||
* @see {@link https://api.jquery.com/bind/#bind-eventType-eventData-preventBubble}
|
||||
*/
|
||||
bind(eventType: string, preventBubble: boolean): this;
|
||||
/**
|
||||
* Attach a handler to an event for the elements.
|
||||
*
|
||||
* @param events An object containing one or more DOM event types and functions to execute for them.
|
||||
* @see {@link https://api.jquery.com/bind/#bind-events}
|
||||
*/
|
||||
bind(events: any): this;
|
||||
|
||||
/**
|
||||
* Get the children of each element in the set of matched elements, optionally filtered by a selector.
|
||||
*
|
||||
* @see {@link https://api.jquery.com/children/}
|
||||
*/
|
||||
children(): this;
|
||||
|
||||
/**
|
||||
* Create a deep copy of the set of matched elements.
|
||||
*
|
||||
* @param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false.
|
||||
* @param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false).
|
||||
* @see {@link https://api.jquery.com/clone/}
|
||||
*/
|
||||
clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): this;
|
||||
|
||||
/**
|
||||
* Get the children of each element in the set of matched elements, including text and comment nodes.
|
||||
* @see {@link https://api.jquery.com/contents/}
|
||||
*/
|
||||
contents(): this;
|
||||
|
||||
/**
|
||||
* Get the value of style properties for the first element in the set of matched elements.
|
||||
*
|
||||
* @param propertyName A CSS property.
|
||||
* @see {@link https://api.jquery.com/css/#css-propertyName}
|
||||
*/
|
||||
css(propertyName: string): string;
|
||||
/**
|
||||
* Get the value of style properties for the first element in the set of matched elements.
|
||||
* Results in an object of property-value pairs.
|
||||
*
|
||||
* @param propertyNames An array of one or more CSS properties.
|
||||
* @see {@link https://api.jquery.com/css/#css-propertyNames}
|
||||
*/
|
||||
css(propertyNames: string[]): any;
|
||||
/**
|
||||
* Set one or more CSS properties for the set of matched elements.
|
||||
*
|
||||
* @param propertyName A CSS property name.
|
||||
* @param value A value to set for the property.
|
||||
* @see {@link https://api.jquery.com/css/#css-propertyName-value}
|
||||
*/
|
||||
css(propertyName: string, value: string | number): this;
|
||||
/**
|
||||
* Set one or more CSS properties for the set of matched elements.
|
||||
*
|
||||
* @param propertyName A CSS property name.
|
||||
* @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
|
||||
* @see {@link https://api.jquery.com/css/#css-propertyName-function}
|
||||
*/
|
||||
css(propertyName: string, value: (index: number, value: string) => string | number): this;
|
||||
/**
|
||||
* Set one or more CSS properties for the set of matched elements.
|
||||
*
|
||||
* @param properties An object of property-value pairs to set.
|
||||
* @see {@link https://api.jquery.com/css/#css-properties}
|
||||
*/
|
||||
css(properties: JQLiteCssProperties): this;
|
||||
|
||||
/**
|
||||
* Store arbitrary data associated with the matched elements.
|
||||
*
|
||||
* @param key A string naming the piece of data to set.
|
||||
* @param value The new data value; it can be any JavaScript type including Array or Object.
|
||||
* @see {@link https://api.jquery.com/data/#data-key-value}
|
||||
*/
|
||||
data(key: string, value: any): this;
|
||||
/**
|
||||
* Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
|
||||
*
|
||||
* @param key Name of the data stored.
|
||||
* @see {@link https://api.jquery.com/data/#data-key}
|
||||
*/
|
||||
data(key: string): any;
|
||||
/**
|
||||
* Store arbitrary data associated with the matched elements.
|
||||
*
|
||||
* @param obj An object of key-value pairs of data to update.
|
||||
* @see {@link https://api.jquery.com/data/#data-obj}
|
||||
*/
|
||||
data(obj: { [key: string]: any; }): this;
|
||||
/**
|
||||
* Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
|
||||
* @see {@link https://api.jquery.com/data/#data}
|
||||
*/
|
||||
data(): any;
|
||||
|
||||
/**
|
||||
* Remove the set of matched elements from the DOM.
|
||||
*
|
||||
* @param selector A selector expression that filters the set of matched elements to be removed.
|
||||
* @see {@link https://api.jquery.com/detach/}
|
||||
*/
|
||||
detach(selector?: string): this;
|
||||
|
||||
/**
|
||||
* Remove all child nodes of the set of matched elements from the DOM.
|
||||
* @see {@link https://api.jquery.com/empty/}
|
||||
*/
|
||||
empty(): this;
|
||||
|
||||
/**
|
||||
* Reduce the set of matched elements to the one at the specified index.
|
||||
*
|
||||
* @param index An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set.
|
||||
* @see {@link https://api.jquery.com/eq/}
|
||||
*/
|
||||
eq(index: number): this;
|
||||
|
||||
/**
|
||||
* Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
|
||||
*
|
||||
* @param selector A string containing a selector expression to match elements against.
|
||||
* @see {@link https://api.jquery.com/find/#find-selector}
|
||||
*/
|
||||
find(selector: string): this;
|
||||
find(element: any): this;
|
||||
find(obj: JQuery): this;
|
||||
|
||||
/**
|
||||
* Determine whether any of the matched elements are assigned the given class.
|
||||
*
|
||||
* @param className The class name to search for.
|
||||
* @see {@link https://api.jquery.com/hasClass/}
|
||||
*/
|
||||
hasClass(className: string): boolean;
|
||||
|
||||
/**
|
||||
* Get the HTML contents of the first element in the set of matched elements.
|
||||
* @see {@link https://api.jquery.com/html/#html}
|
||||
*/
|
||||
html(): string;
|
||||
/**
|
||||
* Set the HTML contents of each element in the set of matched elements.
|
||||
*
|
||||
* @param htmlString A string of HTML to set as the content of each matched element.
|
||||
* @see {@link https://api.jquery.com/html/#html-htmlString}
|
||||
*/
|
||||
html(htmlString: string): this;
|
||||
/**
|
||||
* Set the HTML contents of each element in the set of matched elements.
|
||||
*
|
||||
* @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set.
|
||||
* @see {@link https://api.jquery.com/html/#html-function}
|
||||
*/
|
||||
html(func: (index: number, oldhtml: string) => string): this;
|
||||
|
||||
/**
|
||||
* Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.
|
||||
*
|
||||
* @see {@link https://api.jquery.com/next/}
|
||||
*/
|
||||
next(): this;
|
||||
|
||||
/**
|
||||
* Attach an event handler function for one or more events to the selected elements.
|
||||
*
|
||||
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
|
||||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax).
|
||||
* @see {@link https://api.jquery.com/on/#on-events-selector-data-handler}
|
||||
*/
|
||||
on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): this;
|
||||
/**
|
||||
* Attach an event handler function for one or more events to the selected elements.
|
||||
*
|
||||
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
|
||||
* @param data Data to be passed to the handler in event.data when an event is triggered.
|
||||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
|
||||
* @see {@link https://api.jquery.com/on/#on-events-selector-data-handler}
|
||||
*/
|
||||
on(events: string, data: any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): this;
|
||||
/**
|
||||
* Attach an event handler function for one or more events to the selected elements.
|
||||
*
|
||||
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
|
||||
* @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
|
||||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
|
||||
* @see {@link https://api.jquery.com/on/#on-events-selector-data-handler}
|
||||
*/
|
||||
on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): this;
|
||||
/**
|
||||
* Attach an event handler function for one or more events to the selected elements.
|
||||
*
|
||||
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
|
||||
* @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
|
||||
* @param data Data to be passed to the handler in event.data when an event is triggered.
|
||||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
|
||||
* @see {@link https://api.jquery.com/on/#on-events-selector-data-handler}
|
||||
*/
|
||||
on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): this;
|
||||
/**
|
||||
* Attach an event handler function for one or more events to the selected elements.
|
||||
*
|
||||
* @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
|
||||
* @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element.
|
||||
* @param data Data to be passed to the handler in event.data when an event occurs.
|
||||
* @see {@link https://api.jquery.com/on/#on-events-selector-data}
|
||||
*/
|
||||
on(events: { [key: string]: (eventObject: JQueryEventObject, ...args: any[]) => any; }, selector?: string, data?: any): this;
|
||||
/**
|
||||
* Attach an event handler function for one or more events to the selected elements.
|
||||
*
|
||||
* @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
|
||||
* @param data Data to be passed to the handler in event.data when an event occurs.
|
||||
* @see {@link https://api.jquery.com/on/#on-events-selector-data}
|
||||
*/
|
||||
on(events: { [key: string]: (eventObject: JQueryEventObject, ...args: any[]) => any; }, data?: any): this;
|
||||
|
||||
/**
|
||||
* Remove an event handler.
|
||||
* @see {@link https://api.jquery.com/off/#off}
|
||||
*/
|
||||
off(): this;
|
||||
/**
|
||||
* Remove an event handler.
|
||||
*
|
||||
* @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
|
||||
* @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
|
||||
* @param handler A handler function previously attached for the event(s), or the special value false.
|
||||
* @see {@link https://api.jquery.com/off/#off-events-selector-handler}
|
||||
*/
|
||||
off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): this;
|
||||
/**
|
||||
* Remove an event handler.
|
||||
*
|
||||
* @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
|
||||
* @param handler A handler function previously attached for the event(s), or the special value false. Takes handler with extra args that can be attached with on().
|
||||
* @see {@link https://api.jquery.com/off/#off-events-selector-handler}
|
||||
*/
|
||||
off(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): this;
|
||||
/**
|
||||
* Remove an event handler.
|
||||
*
|
||||
* @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
|
||||
* @param handler A handler function previously attached for the event(s), or the special value false.
|
||||
* @see {@link https://api.jquery.com/off/#off-events-selector-handler}
|
||||
*/
|
||||
off(events: string, handler: (eventObject: JQueryEventObject) => any): this;
|
||||
/**
|
||||
* Remove an event handler.
|
||||
*
|
||||
* @param events An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s).
|
||||
* @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
|
||||
* @see {@link https://api.jquery.com/off/#off-events-selector}
|
||||
*/
|
||||
off(events: { [key: string]: any; }, selector?: string): this;
|
||||
|
||||
/**
|
||||
* Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
|
||||
*
|
||||
* @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
|
||||
* @param handler A function to execute at the time the event is triggered.
|
||||
* @see {@link https://api.jquery.com/one/#one-events-data-handler}
|
||||
*/
|
||||
one(events: string, handler: (eventObject: JQueryEventObject) => any): this;
|
||||
/**
|
||||
* Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
|
||||
*
|
||||
* @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
|
||||
* @param data An object containing data that will be passed to the event handler.
|
||||
* @param handler A function to execute at the time the event is triggered.
|
||||
* @see {@link https://api.jquery.com/one/#one-events-data-handler}
|
||||
*/
|
||||
one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): this;
|
||||
/**
|
||||
* Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
|
||||
*
|
||||
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
|
||||
* @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
|
||||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
|
||||
* @see {@link https://api.jquery.com/one/#one-events-selector-data-handler}
|
||||
*/
|
||||
one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): this;
|
||||
/**
|
||||
* Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
|
||||
*
|
||||
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
|
||||
* @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
|
||||
* @param data Data to be passed to the handler in event.data when an event is triggered.
|
||||
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
|
||||
* @see {@link https://api.jquery.com/one/#one-events-selector-data-handler}
|
||||
*/
|
||||
one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): this;
|
||||
/**
|
||||
* Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
|
||||
*
|
||||
* @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
|
||||
* @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element.
|
||||
* @param data Data to be passed to the handler in event.data when an event occurs.
|
||||
* @see {@link https://api.jquery.com/one/#one-events-selector-data}
|
||||
*/
|
||||
one(events: { [key: string]: any; }, selector?: string, data?: any): this;
|
||||
/**
|
||||
* Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
|
||||
*
|
||||
* @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
|
||||
* @param data Data to be passed to the handler in event.data when an event occurs.
|
||||
* @see {@link https://api.jquery.com/one/#one-events-selector-data}
|
||||
*/
|
||||
one(events: { [key: string]: any; }, data?: any): this;
|
||||
|
||||
/**
|
||||
* Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
|
||||
*
|
||||
* @see {@link https://api.jquery.com/parent/}
|
||||
*/
|
||||
parent(): this;
|
||||
|
||||
/**
|
||||
* Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
|
||||
*
|
||||
* @param content1 DOM element, DocumentFragment, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements.
|
||||
* @param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements.
|
||||
* @see {@link https://api.jquery.com/prepend/#prepend-content-content}
|
||||
*/
|
||||
prepend(content1: JQuery | any[] | Element | DocumentFragment | Text | string, ...content2: any[]): this;
|
||||
/**
|
||||
* Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
|
||||
*
|
||||
* @param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.
|
||||
* @see {@link https://api.jquery.com/prepend/#prepend-function}
|
||||
*/
|
||||
prepend(func: (index: number, html: string) => string | Element | JQuery): this;
|
||||
|
||||
/**
|
||||
* Get the value of a property for the first element in the set of matched elements.
|
||||
*
|
||||
* @param propertyName The name of the property to get.
|
||||
* @see {@link https://api.jquery.com/prop/#prop-propertyName}
|
||||
*/
|
||||
prop(propertyName: string): any;
|
||||
/**
|
||||
* Set one or more properties for the set of matched elements.
|
||||
*
|
||||
* @param propertyName The name of the property to set.
|
||||
* @param value A value to set for the property.
|
||||
* @see {@link https://api.jquery.com/prop/#prop-propertyName-value}
|
||||
*/
|
||||
prop(propertyName: string, value: string | number | boolean): this;
|
||||
/**
|
||||
* Set one or more properties for the set of matched elements.
|
||||
*
|
||||
* @param properties An object of property-value pairs to set.
|
||||
* @see {@link https://api.jquery.com/prop/#prop-properties}
|
||||
*/
|
||||
prop(properties: Object): this;
|
||||
/**
|
||||
* Set one or more properties for the set of matched elements.
|
||||
*
|
||||
* @param propertyName The name of the property to set.
|
||||
* @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element.
|
||||
* @see {@link https://api.jquery.com/prop/#prop-propertyName-function}
|
||||
*/
|
||||
prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): this;
|
||||
|
||||
/**
|
||||
* Specify a function to execute when the DOM is fully loaded.
|
||||
*
|
||||
* @param handler A function to execute after the DOM is ready.
|
||||
* @see {@link https://api.jquery.com/ready/}
|
||||
*/
|
||||
ready(handler: (jQueryAlias?: JQueryStatic) => any): this;
|
||||
|
||||
/**
|
||||
* Remove the set of matched elements from the DOM.
|
||||
*
|
||||
* @param selector A selector expression that filters the set of matched elements to be removed.
|
||||
* @see {@link https://api.jquery.com/remove/}
|
||||
*/
|
||||
remove(selector?: string): this;
|
||||
|
||||
/**
|
||||
* Remove an attribute from each element in the set of matched elements.
|
||||
*
|
||||
* @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes.
|
||||
* @see {@link https://api.jquery.com/removeAttr/}
|
||||
*/
|
||||
removeAttr(attributeName: string): this;
|
||||
|
||||
/**
|
||||
* Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
|
||||
*
|
||||
* @param className One or more space-separated classes to be removed from the class attribute of each matched element.
|
||||
* @see {@link https://api.jquery.com/removeClass/#removeClass-className}
|
||||
*/
|
||||
removeClass(className?: string): this;
|
||||
|
||||
/**
|
||||
* Remove a previously-stored piece of data.
|
||||
*
|
||||
* @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete.
|
||||
* @see {@link https://api.jquery.com/removeData/#removeData-name}
|
||||
*/
|
||||
removeData(name: string): this;
|
||||
/**
|
||||
* Remove a previously-stored piece of data.
|
||||
*
|
||||
* @param list An array of strings naming the pieces of data to delete.
|
||||
* @see {@link https://api.jquery.com/removeData/#removeData-list}
|
||||
*/
|
||||
removeData(list: string[]): this;
|
||||
/**
|
||||
* Remove all previously-stored piece of data.
|
||||
* @see {@link https://api.jquery.com/removeData/}
|
||||
*/
|
||||
removeData(): this;
|
||||
|
||||
/**
|
||||
* Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
|
||||
*
|
||||
* @param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object.
|
||||
* @see {@link https://api.jquery.com/replaceWith/#replaceWith-newContent}
|
||||
*/
|
||||
replaceWith(newContent: JQuery | any[] | Element | Text | string): this;
|
||||
/**
|
||||
* Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
|
||||
*
|
||||
* @param func A function that returns content with which to replace the set of matched elements.
|
||||
* @see {@link https://api.jquery.com/replaceWith/#replaceWith-function}
|
||||
*/
|
||||
replaceWith(func: () => Element | JQuery): this;
|
||||
|
||||
/**
|
||||
* Get the combined text contents of each element in the set of matched elements, including their descendants.
|
||||
* @see {@link https://api.jquery.com/text/#text}
|
||||
*/
|
||||
text(): string;
|
||||
/**
|
||||
* Set the content of each element in the set of matched elements to the specified text.
|
||||
*
|
||||
* @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation.
|
||||
* @see {@link https://api.jquery.com/text/#text-text}
|
||||
*/
|
||||
text(text: string | number | boolean): this;
|
||||
/**
|
||||
* Set the content of each element in the set of matched elements to the specified text.
|
||||
*
|
||||
* @param func A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments.
|
||||
* @see {@link https://api.jquery.com/text/#text-function}
|
||||
*/
|
||||
text(func: (index: number, text: string) => string): this;
|
||||
|
||||
/**
|
||||
* Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
|
||||
*
|
||||
* @param className One or more class names (separated by spaces) to be toggled for each element in the matched set.
|
||||
* @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed.
|
||||
* @see {@link https://api.jquery.com/toggleClass/#toggleClass-className}
|
||||
*/
|
||||
toggleClass(className: string, swtch?: boolean): this;
|
||||
/**
|
||||
* Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
|
||||
*
|
||||
* @param swtch A boolean value to determine whether the class should be added or removed.
|
||||
* @see {@link https://api.jquery.com/toggleClass/#toggleClass-state}
|
||||
*/
|
||||
toggleClass(swtch?: boolean): this;
|
||||
|
||||
/**
|
||||
* Execute all handlers attached to an element for an event.
|
||||
*
|
||||
* @param eventType A string containing a JavaScript event type, such as click or submit.
|
||||
* @param extraParameters An array of additional parameters to pass along to the event handler.
|
||||
* @see {@link https://api.jquery.com/triggerHandler/#triggerHandler-eventType-extraParameters}
|
||||
*/
|
||||
triggerHandler(eventType: string, ...extraParameters: any[]): Object;
|
||||
/**
|
||||
* Execute all handlers attached to an element for an event.
|
||||
*
|
||||
* @param event A jQuery.Event object.
|
||||
* @param extraParameters An array of additional parameters to pass along to the event handler.
|
||||
* @see {@link https://api.jquery.com/triggerHandler/#triggerHandler-event-extraParameters}
|
||||
*/
|
||||
triggerHandler(event: JQueryEventObject, ...extraParameters: any[]): Object;
|
||||
|
||||
/**
|
||||
* Remove a previously-attached event handler from the elements.
|
||||
*
|
||||
* @param eventType A string containing a JavaScript event type, such as click or submit.
|
||||
* @param handler The function that is to be no longer executed.
|
||||
* @see {@link https://api.jquery.com/unbind/#unbind-eventType-handler}
|
||||
*/
|
||||
unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): this;
|
||||
/**
|
||||
* Remove a previously-attached event handler from the elements.
|
||||
*
|
||||
* @param eventType A string containing a JavaScript event type, such as click or submit.
|
||||
* @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ).
|
||||
* @see {@link https://api.jquery.com/unbind/#unbind-eventType-false}
|
||||
*/
|
||||
unbind(eventType: string, fls: boolean): this;
|
||||
/**
|
||||
* Remove a previously-attached event handler from the elements.
|
||||
*
|
||||
* @param evt A JavaScript event object as passed to an event handler.
|
||||
* @see {@link https://api.jquery.com/unbind/#unbind-event}
|
||||
*/
|
||||
unbind(evt: any): this;
|
||||
|
||||
/**
|
||||
* Get the current value of the first element in the set of matched elements.
|
||||
* @see {@link https://api.jquery.com/val/#val}
|
||||
*/
|
||||
val(): any;
|
||||
/**
|
||||
* Set the value of each element in the set of matched elements.
|
||||
*
|
||||
* @param value A string of text, an array of strings or number corresponding to the value of each matched element to set as selected/checked.
|
||||
* @see {@link https://api.jquery.com/val/#val-value}
|
||||
*/
|
||||
val(value: string | string[] | number): this;
|
||||
/**
|
||||
* Set the value of each element in the set of matched elements.
|
||||
*
|
||||
* @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
|
||||
* @see {@link https://api.jquery.com/val/#val-function}
|
||||
*/
|
||||
val(func: (index: number, value: string) => string): this;
|
||||
|
||||
/**
|
||||
* Wrap an HTML structure around each element in the set of matched elements.
|
||||
*
|
||||
* @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
|
||||
* @see {@link https://api.jquery.com/wrap/#wrap-wrappingElement}
|
||||
*/
|
||||
wrap(wrappingElement: JQuery | Element | string): this;
|
||||
/**
|
||||
* Wrap an HTML structure around each element in the set of matched elements.
|
||||
*
|
||||
* @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
|
||||
* @see {@link https://api.jquery.com/wrap/#wrap-function}
|
||||
*/
|
||||
wrap(func: (index: number) => string | JQuery): this;
|
||||
|
||||
// Undocumented
|
||||
length: number;
|
||||
|
||||
// TODO: events, how to define?
|
||||
// $destroy
|
||||
|
||||
controller(name?: string): any;
|
||||
injector(): ng.auto.IInjectorService;
|
||||
/**
|
||||
* Returns the `$scope` of the element.
|
||||
*
|
||||
* **IMPORTANT**: Requires `debugInfoEnabled` to be true.
|
||||
*
|
||||
* See https://docs.angularjs.org/guide/production#disabling-debug-data for more information.
|
||||
*/
|
||||
scope<T extends ng.IScope>(): T;
|
||||
/**
|
||||
* Returns the `$scope` of the element.
|
||||
*
|
||||
* **IMPORTANT**: Requires `debugInfoEnabled` to be true.
|
||||
*
|
||||
* See https://docs.angularjs.org/guide/production#disabling-debug-data for more information.
|
||||
*/
|
||||
isolateScope<T extends ng.IScope>(): T;
|
||||
|
||||
inheritedData(key: string, value: any): this;
|
||||
inheritedData(obj: { [key: string]: any; }): this;
|
||||
inheritedData(key?: string): any;
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
(element: string | Element | Document | JQuery | ArrayLike<Element> | (() => void)): JQLite;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface of the JQuery extension of the W3C event object
|
||||
* @see {@link https://api.jquery.com/category/events/event-object/}
|
||||
*/
|
||||
interface BaseJQueryEventObject extends Event {
|
||||
/**
|
||||
* The current DOM element within the event bubbling phase.
|
||||
* @see {@link https://api.jquery.com/event.currentTarget/}
|
||||
*/
|
||||
currentTarget: Element;
|
||||
/**
|
||||
* An optional object of data passed to an event method when the current executing handler is bound.
|
||||
* @see {@link https://api.jquery.com/event.data/}
|
||||
*/
|
||||
data: any;
|
||||
/**
|
||||
* The element where the currently-called jQuery event handler was attached.
|
||||
* @see {@link https://api.jquery.com/event.delegateTarget/}
|
||||
*/
|
||||
delegateTarget: Element;
|
||||
/**
|
||||
* Returns whether event.preventDefault() was ever called on this event object.
|
||||
* @see {@link https://api.jquery.com/event.isDefaultPrevented/}
|
||||
*/
|
||||
isDefaultPrevented(): boolean;
|
||||
/**
|
||||
* Returns whether event.stopImmediatePropagation() was ever called on this event object.
|
||||
* @see {@link https://api.jquery.com/event.isImmediatePropagationStopped/}
|
||||
*/
|
||||
isImmediatePropagationStopped(): boolean;
|
||||
/**
|
||||
* Returns whether event.stopPropagation() was ever called on this event object.
|
||||
* @see {@link https://api.jquery.com/event.isPropagationStopped/}
|
||||
*/
|
||||
isPropagationStopped(): boolean;
|
||||
/**
|
||||
* The namespace specified when the event was triggered.
|
||||
* @see {@link https://api.jquery.com/event.namespace/}
|
||||
*/
|
||||
namespace: string;
|
||||
/**
|
||||
* The browser's original Event object.
|
||||
* @see {@link https://api.jquery.com/category/events/event-object/}
|
||||
*/
|
||||
originalEvent: Event;
|
||||
/**
|
||||
* If this method is called, the default action of the event will not be triggered.
|
||||
* @see {@link https://api.jquery.com/event.preventDefault/}
|
||||
*/
|
||||
preventDefault(): any;
|
||||
/**
|
||||
* The other DOM element involved in the event, if any.
|
||||
* @see {@link https://api.jquery.com/event.relatedTarget/}
|
||||
*/
|
||||
relatedTarget: Element;
|
||||
/**
|
||||
* The last value returned by an event handler that was triggered by this event, unless the value was undefined.
|
||||
* @see {@link https://api.jquery.com/event.result/}
|
||||
*/
|
||||
result: any;
|
||||
/**
|
||||
* Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree.
|
||||
* @see {@link https://api.jquery.com/event.stopImmediatePropagation/}
|
||||
*/
|
||||
stopImmediatePropagation(): void;
|
||||
/**
|
||||
* Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event.
|
||||
* @see {@link https://api.jquery.com/event.stopPropagation/}
|
||||
*/
|
||||
stopPropagation(): void;
|
||||
/**
|
||||
* The DOM element that initiated the event.
|
||||
* @see {@link https://api.jquery.com/event.target/}
|
||||
*/
|
||||
target: Element;
|
||||
/**
|
||||
* The mouse position relative to the left edge of the document.
|
||||
* @see {@link https://api.jquery.com/event.pageX/}
|
||||
*/
|
||||
pageX: number;
|
||||
/**
|
||||
* The mouse position relative to the top edge of the document.
|
||||
* @see {@link https://api.jquery.com/event.pageY/}
|
||||
*/
|
||||
pageY: number;
|
||||
/**
|
||||
* For key or mouse events, this property indicates the specific key or button that was pressed.
|
||||
* @deprecated Use `key` for KeyEvents or `button` for MouseEvents instead.
|
||||
* @see {@link https://api.jquery.com/event.which/}
|
||||
*/
|
||||
which: number;
|
||||
/**
|
||||
* Indicates whether the META key was pressed when the event fired.
|
||||
* @see {@link https://api.jquery.com/event.metaKey/}
|
||||
*/
|
||||
metaKey: boolean;
|
||||
}
|
||||
|
||||
interface JQueryInputEventObject extends BaseJQueryEventObject {
|
||||
altKey: boolean;
|
||||
ctrlKey: boolean;
|
||||
metaKey: boolean;
|
||||
shiftKey: boolean;
|
||||
}
|
||||
|
||||
interface JQueryMouseEventObject extends JQueryInputEventObject {
|
||||
button: number;
|
||||
clientX: number;
|
||||
clientY: number;
|
||||
offsetX: number;
|
||||
offsetY: number;
|
||||
pageX: number;
|
||||
pageY: number;
|
||||
screenX: number;
|
||||
screenY: number;
|
||||
}
|
||||
|
||||
interface JQueryKeyEventObject extends JQueryInputEventObject {
|
||||
/** @deprecated */
|
||||
char: string;
|
||||
/** @deprecated */
|
||||
charCode: number;
|
||||
key: string;
|
||||
/** @deprecated */
|
||||
keyCode: number;
|
||||
}
|
||||
|
||||
interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject {
|
||||
}
|
||||
|
||||
/**
|
||||
* The interface used to specify the properties parameter in css()
|
||||
*/
|
||||
// tslint:disable-next-line:class-name
|
||||
interface cssPropertySetter {
|
||||
(index: number, value?: string): string | number;
|
||||
}
|
||||
interface JQLiteCssProperties {
|
||||
[propertyName: string]: string | number | cssPropertySetter;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@types/angular@1.6.54",
|
||||
"/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "@types/angular@1.6.54",
|
||||
"_id": "@types/angular@1.6.54",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-xA1FuozWXeRQ7FClUbvk8ePL+dydBeDoCWRPFTHU5+8uvVtIIfLGiHA8CMkwsbddFCYnTDVbLxG85a/HBx7LtA==",
|
||||
"_location": "/@types/angular",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@types/angular@1.6.54",
|
||||
"name": "@types/angular",
|
||||
"escapedName": "@types%2fangular",
|
||||
"scope": "@types",
|
||||
"rawSpec": "1.6.54",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.6.54"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@types/angular/-/angular-1.6.54.tgz",
|
||||
"_spec": "1.6.54",
|
||||
"_where": "/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2",
|
||||
"bugs": {
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Diego Vilar",
|
||||
"url": "https://github.com/diegovilar"
|
||||
},
|
||||
{
|
||||
"name": "Georgii Dolzhykov",
|
||||
"url": "https://github.com/thorn0"
|
||||
},
|
||||
{
|
||||
"name": "Caleb St-Denis",
|
||||
"url": "https://github.com/calebstdenis"
|
||||
},
|
||||
{
|
||||
"name": "Leonard Thieu",
|
||||
"url": "https://github.com/leonard-thieu"
|
||||
},
|
||||
{
|
||||
"name": "Steffen Kowalski",
|
||||
"url": "https://github.com/scipper"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"description": "TypeScript definitions for Angular JS",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
|
||||
"license": "MIT",
|
||||
"main": "",
|
||||
"name": "@types/angular",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"typeScriptVersion": "2.3",
|
||||
"types": "index",
|
||||
"typesPublisherContentHash": "0d6dd74d56b56b6a5d13d2e6c34e2ffd8a406fbe13fa7f38a2b85ccb1a82fdad",
|
||||
"version": "1.6.54"
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
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
|
||||
@@ -0,0 +1,16 @@
|
||||
# Installation
|
||||
> `npm install --save @types/geojson`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for geojson ( https://geojson.org/ ).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/geojson
|
||||
|
||||
Additional Details
|
||||
* Last updated: Wed, 13 Feb 2019 18:42:09 GMT
|
||||
* Dependencies: none
|
||||
* Global values: GeoJSON
|
||||
|
||||
# Credits
|
||||
These definitions were written by Jacob Bruun <https://github.com/cobster>, Arne Schubert <https://github.com/atd-schubert>, Jeff Jacobson <https://github.com/JeffJacobson>, Ilia Choly <https://github.com/icholy>, Dan Vanderkam <https://github.com/danvk>.
|
||||
@@ -0,0 +1,175 @@
|
||||
// Type definitions for geojson 7946.0
|
||||
// Project: https://geojson.org/, https://github.com/caseycesari/geojson.js
|
||||
// Definitions by: Jacob Bruun <https://github.com/cobster>
|
||||
// Arne Schubert <https://github.com/atd-schubert>
|
||||
// Jeff Jacobson <https://github.com/JeffJacobson>
|
||||
// Ilia Choly <https://github.com/icholy>
|
||||
// Dan Vanderkam <https://github.com/danvk>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// Note: as of the RFC 7946 version of GeoJSON, Coordinate Reference Systems
|
||||
// are no longer supported. (See https://tools.ietf.org/html/rfc7946#appendix-B)}
|
||||
|
||||
export as namespace GeoJSON;
|
||||
|
||||
/**
|
||||
* The valid values for the "type" property of GeoJSON geometry objects.
|
||||
* https://tools.ietf.org/html/rfc7946#section-1.4
|
||||
*/
|
||||
export type GeoJsonGeometryTypes = Geometry['type'];
|
||||
|
||||
/**
|
||||
* The value values for the "type" property of GeoJSON Objects.
|
||||
* https://tools.ietf.org/html/rfc7946#section-1.4
|
||||
*/
|
||||
export type GeoJsonTypes = GeoJSON['type'];
|
||||
|
||||
/**
|
||||
* Bounding box
|
||||
* https://tools.ietf.org/html/rfc7946#section-5
|
||||
*/
|
||||
export type BBox = [number, number, number, number] | [number, number, number, number, number, number];
|
||||
|
||||
/**
|
||||
* A Position is an array of coordinates.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.1
|
||||
* Array should contain between two and three elements.
|
||||
* The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values),
|
||||
* but the current specification only allows X, Y, and (optionally) Z to be defined.
|
||||
*/
|
||||
export type Position = number[]; // [number, number] | [number, number, number];
|
||||
|
||||
/**
|
||||
* The base GeoJSON object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3
|
||||
* The GeoJSON specification also allows foreign members
|
||||
* (https://tools.ietf.org/html/rfc7946#section-6.1)
|
||||
* Developers should use "&" type in TypeScript or extend the interface
|
||||
* to add these foreign members.
|
||||
*/
|
||||
export interface GeoJsonObject {
|
||||
// Don't include foreign members directly into this type def.
|
||||
// in order to preserve type safety.
|
||||
// [key: string]: any;
|
||||
/**
|
||||
* Specifies the type of GeoJSON object.
|
||||
*/
|
||||
type: GeoJsonTypes;
|
||||
/**
|
||||
* Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections.
|
||||
* The value of the bbox member is an array of length 2*n where n is the number of dimensions
|
||||
* represented in the contained geometries, with all axes of the most southwesterly point
|
||||
* followed by all axes of the more northeasterly point.
|
||||
* The axes order of a bbox follows the axes order of geometries.
|
||||
* https://tools.ietf.org/html/rfc7946#section-5
|
||||
*/
|
||||
bbox?: BBox;
|
||||
}
|
||||
|
||||
/**
|
||||
* Union of GeoJSON objects.
|
||||
*/
|
||||
export type GeoJSON = Geometry | Feature | FeatureCollection;
|
||||
|
||||
/**
|
||||
* Geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3
|
||||
*/
|
||||
export type Geometry = Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon | GeometryCollection;
|
||||
export type GeometryObject = Geometry;
|
||||
|
||||
/**
|
||||
* Point geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.2
|
||||
*/
|
||||
export interface Point extends GeoJsonObject {
|
||||
type: "Point";
|
||||
coordinates: Position;
|
||||
}
|
||||
|
||||
/**
|
||||
* MultiPoint geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.3
|
||||
*/
|
||||
export interface MultiPoint extends GeoJsonObject {
|
||||
type: "MultiPoint";
|
||||
coordinates: Position[];
|
||||
}
|
||||
|
||||
/**
|
||||
* LineString geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.4
|
||||
*/
|
||||
export interface LineString extends GeoJsonObject {
|
||||
type: "LineString";
|
||||
coordinates: Position[];
|
||||
}
|
||||
|
||||
/**
|
||||
* MultiLineString geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.5
|
||||
*/
|
||||
export interface MultiLineString extends GeoJsonObject {
|
||||
type: "MultiLineString";
|
||||
coordinates: Position[][];
|
||||
}
|
||||
|
||||
/**
|
||||
* Polygon geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.6
|
||||
*/
|
||||
export interface Polygon extends GeoJsonObject {
|
||||
type: "Polygon";
|
||||
coordinates: Position[][];
|
||||
}
|
||||
|
||||
/**
|
||||
* MultiPolygon geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.7
|
||||
*/
|
||||
export interface MultiPolygon extends GeoJsonObject {
|
||||
type: "MultiPolygon";
|
||||
coordinates: Position[][][];
|
||||
}
|
||||
|
||||
/**
|
||||
* Geometry Collection
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.8
|
||||
*/
|
||||
export interface GeometryCollection extends GeoJsonObject {
|
||||
type: "GeometryCollection";
|
||||
geometries: Geometry[];
|
||||
}
|
||||
|
||||
export type GeoJsonProperties = { [name: string]: any; } | null;
|
||||
|
||||
/**
|
||||
* A feature object which contains a geometry and associated properties.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.2
|
||||
*/
|
||||
export interface Feature<G extends Geometry | null = Geometry, P = GeoJsonProperties> extends GeoJsonObject {
|
||||
type: "Feature";
|
||||
/**
|
||||
* The feature's geometry
|
||||
*/
|
||||
geometry: G;
|
||||
/**
|
||||
* A value that uniquely identifies this feature in a
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.2.
|
||||
*/
|
||||
id?: string | number;
|
||||
/**
|
||||
* Properties associated with this feature.
|
||||
*/
|
||||
properties: P;
|
||||
}
|
||||
|
||||
/**
|
||||
* A collection of feature objects.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.3
|
||||
*/
|
||||
export interface FeatureCollection<G extends Geometry | null = Geometry, P = GeoJsonProperties> extends GeoJsonObject {
|
||||
type: "FeatureCollection";
|
||||
features: Array<Feature<G, P>>;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@types/geojson@7946.0.6",
|
||||
"/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "@types/geojson@7946.0.6",
|
||||
"_id": "@types/geojson@7946.0.6",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-f6qai3iR62QuMPPdgyH+LyiXTL2n9Rf62UniJjV7KHrbiwzLTZUKsdq0mFSTxAHbO7JvwxwC4tH0m1UnweuLrA==",
|
||||
"_location": "/@types/geojson",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@types/geojson@7946.0.6",
|
||||
"name": "@types/geojson",
|
||||
"escapedName": "@types%2fgeojson",
|
||||
"scope": "@types",
|
||||
"rawSpec": "7946.0.6",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7946.0.6"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/",
|
||||
"/@types/leaflet"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.6.tgz",
|
||||
"_spec": "7946.0.6",
|
||||
"_where": "/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2",
|
||||
"bugs": {
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Jacob Bruun",
|
||||
"url": "https://github.com/cobster"
|
||||
},
|
||||
{
|
||||
"name": "Arne Schubert",
|
||||
"url": "https://github.com/atd-schubert"
|
||||
},
|
||||
{
|
||||
"name": "Jeff Jacobson",
|
||||
"url": "https://github.com/JeffJacobson"
|
||||
},
|
||||
{
|
||||
"name": "Ilia Choly",
|
||||
"url": "https://github.com/icholy"
|
||||
},
|
||||
{
|
||||
"name": "Dan Vanderkam",
|
||||
"url": "https://github.com/danvk"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"description": "TypeScript definitions for geojson",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
|
||||
"license": "MIT",
|
||||
"main": "",
|
||||
"name": "@types/geojson",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"typeScriptVersion": "2.3",
|
||||
"types": "index",
|
||||
"typesPublisherContentHash": "6fa1b4d098782bf1b169ffa27e24d7b40e668c22633c8cd169b000c4fc08dc8a",
|
||||
"version": "7946.0.6"
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
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
|
||||
@@ -0,0 +1,16 @@
|
||||
# Installation
|
||||
> `npm install --save @types/leaflet`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for Leaflet.js ( https://github.com/Leaflet/Leaflet ).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/leaflet
|
||||
|
||||
Additional Details
|
||||
* Last updated: Thu, 21 Feb 2019 18:40:08 GMT
|
||||
* Dependencies: @types/geojson
|
||||
* Global values: L
|
||||
|
||||
# Credits
|
||||
These definitions were written by Alejandro Sánchez <https://github.com/alejo90>, Arne Schubert <https://github.com/atd-schubert>, Michael Auer <https://github.com/mcauer>, Roni Karilkar <https://github.com/ronikar>.
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@types/leaflet@1.4.3",
|
||||
"/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "@types/leaflet@1.4.3",
|
||||
"_id": "@types/leaflet@1.4.3",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-jFRBSsPHi1EwQSwrN0cOJLdPhwOZsRl4IMxvm/2ShLh0YM5GfCtQXCzsrv8RE7DWL+AykXdYSAd9bFLWbZT4CQ==",
|
||||
"_location": "/@types/leaflet",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@types/leaflet@1.4.3",
|
||||
"name": "@types/leaflet",
|
||||
"escapedName": "@types%2fleaflet",
|
||||
"scope": "@types",
|
||||
"rawSpec": "1.4.3",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.4.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.4.3.tgz",
|
||||
"_spec": "1.4.3",
|
||||
"_where": "/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2",
|
||||
"bugs": {
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Alejandro Sánchez",
|
||||
"url": "https://github.com/alejo90"
|
||||
},
|
||||
{
|
||||
"name": "Arne Schubert",
|
||||
"url": "https://github.com/atd-schubert"
|
||||
},
|
||||
{
|
||||
"name": "Michael Auer",
|
||||
"url": "https://github.com/mcauer"
|
||||
},
|
||||
{
|
||||
"name": "Roni Karilkar",
|
||||
"url": "https://github.com/ronikar"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"@types/geojson": "*"
|
||||
},
|
||||
"description": "TypeScript definitions for Leaflet.js",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
|
||||
"license": "MIT",
|
||||
"main": "",
|
||||
"name": "@types/leaflet",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"typeScriptVersion": "2.3",
|
||||
"types": "index",
|
||||
"typesPublisherContentHash": "d6ab1715fa8311f4f2c70d725cb407e3f3c595161e94c7ee85caaeeb496578cc",
|
||||
"version": "1.4.3"
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Angular
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,64 @@
|
||||
# packaged angular
|
||||
|
||||
This repo is for distribution on `npm` and `bower`. The source for this module is in the
|
||||
[main AngularJS repo](https://github.com/angular/angular.js).
|
||||
Please file issues and pull requests against that repo.
|
||||
|
||||
## Install
|
||||
|
||||
You can install this package either with `npm` or with `bower`.
|
||||
|
||||
### npm
|
||||
|
||||
```shell
|
||||
npm install angular
|
||||
```
|
||||
|
||||
Then add a `<script>` to your `index.html`:
|
||||
|
||||
```html
|
||||
<script src="/node_modules/angular/angular.js"></script>
|
||||
```
|
||||
|
||||
Or `require('angular')` from your code.
|
||||
|
||||
### bower
|
||||
|
||||
```shell
|
||||
bower install angular
|
||||
```
|
||||
|
||||
Then add a `<script>` to your `index.html`:
|
||||
|
||||
```html
|
||||
<script src="/bower_components/angular/angular.js"></script>
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation is available on the
|
||||
[AngularJS docs site](http://docs.angularjs.org/).
|
||||
|
||||
## License
|
||||
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,25 @@
|
||||
/* Include this file in your html if you are using the CSP mode. */
|
||||
|
||||
@charset "UTF-8";
|
||||
|
||||
[ng\:cloak],
|
||||
[ng-cloak],
|
||||
[data-ng-cloak],
|
||||
[x-ng-cloak],
|
||||
.ng-cloak,
|
||||
.x-ng-cloak,
|
||||
.ng-hide:not(.ng-hide-animate) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
ng\:form {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.ng-animate-shim {
|
||||
visibility:hidden;
|
||||
}
|
||||
|
||||
.ng-anchor {
|
||||
position:absolute;
|
||||
}
|
||||
@@ -0,0 +1,350 @@
|
||||
/*
|
||||
AngularJS v1.7.7
|
||||
(c) 2010-2018 Google, Inc. http://angularjs.org
|
||||
License: MIT
|
||||
*/
|
||||
(function(C){'use strict';function re(a){if(D(a))w(a.objectMaxDepth)&&(Wb.objectMaxDepth=Xb(a.objectMaxDepth)?a.objectMaxDepth:NaN),w(a.urlErrorParamsEnabled)&&Ga(a.urlErrorParamsEnabled)&&(Wb.urlErrorParamsEnabled=a.urlErrorParamsEnabled);else return Wb}function Xb(a){return W(a)&&0<a}function F(a,b){b=b||Error;return function(){var d=arguments[0],c;c="["+(a?a+":":"")+d+"] http://errors.angularjs.org/1.7.7/"+(a?a+"/":"")+d;for(d=1;d<arguments.length;d++){c=c+(1==d?"?":"&")+"p"+(d-1)+"=";var e=encodeURIComponent,
|
||||
f;f=arguments[d];f="function"==typeof f?f.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof f?"undefined":"string"!=typeof f?JSON.stringify(f):f;c+=e(f)}return new b(c)}}function ya(a){if(null==a||$a(a))return!1;if(H(a)||A(a)||x&&a instanceof x)return!0;var b="length"in Object(a)&&a.length;return W(b)&&(0<=b&&b-1 in a||"function"===typeof a.item)}function r(a,b,d){var c,e;if(a)if(B(a))for(c in a)"prototype"!==c&&"length"!==c&&"name"!==c&&a.hasOwnProperty(c)&&b.call(d,a[c],c,a);else if(H(a)||
|
||||
ya(a)){var f="object"!==typeof a;c=0;for(e=a.length;c<e;c++)(f||c in a)&&b.call(d,a[c],c,a)}else if(a.forEach&&a.forEach!==r)a.forEach(b,d,a);else if(Nc(a))for(c in a)b.call(d,a[c],c,a);else if("function"===typeof a.hasOwnProperty)for(c in a)a.hasOwnProperty(c)&&b.call(d,a[c],c,a);else for(c in a)ta.call(a,c)&&b.call(d,a[c],c,a);return a}function Oc(a,b,d){for(var c=Object.keys(a).sort(),e=0;e<c.length;e++)b.call(d,a[c[e]],c[e]);return c}function Yb(a){return function(b,d){a(d,b)}}function se(){return++pb}
|
||||
function Zb(a,b,d){for(var c=a.$$hashKey,e=0,f=b.length;e<f;++e){var g=b[e];if(D(g)||B(g))for(var k=Object.keys(g),h=0,l=k.length;h<l;h++){var m=k[h],p=g[m];d&&D(p)?ha(p)?a[m]=new Date(p.valueOf()):ab(p)?a[m]=new RegExp(p):p.nodeName?a[m]=p.cloneNode(!0):$b(p)?a[m]=p.clone():(D(a[m])||(a[m]=H(p)?[]:{}),Zb(a[m],[p],!0)):a[m]=p}}c?a.$$hashKey=c:delete a.$$hashKey;return a}function S(a){return Zb(a,Ha.call(arguments,1),!1)}function te(a){return Zb(a,Ha.call(arguments,1),!0)}function fa(a){return parseInt(a,
|
||||
10)}function ac(a,b){return S(Object.create(a),b)}function E(){}function Ta(a){return a}function ia(a){return function(){return a}}function bc(a){return B(a.toString)&&a.toString!==la}function z(a){return"undefined"===typeof a}function w(a){return"undefined"!==typeof a}function D(a){return null!==a&&"object"===typeof a}function Nc(a){return null!==a&&"object"===typeof a&&!Pc(a)}function A(a){return"string"===typeof a}function W(a){return"number"===typeof a}function ha(a){return"[object Date]"===la.call(a)}
|
||||
function H(a){return Array.isArray(a)||a instanceof Array}function cc(a){switch(la.call(a)){case "[object Error]":return!0;case "[object Exception]":return!0;case "[object DOMException]":return!0;default:return a instanceof Error}}function B(a){return"function"===typeof a}function ab(a){return"[object RegExp]"===la.call(a)}function $a(a){return a&&a.window===a}function bb(a){return a&&a.$evalAsync&&a.$watch}function Ga(a){return"boolean"===typeof a}function ue(a){return a&&W(a.length)&&ve.test(la.call(a))}
|
||||
function $b(a){return!(!a||!(a.nodeName||a.prop&&a.attr&&a.find))}function we(a){var b={};a=a.split(",");var d;for(d=0;d<a.length;d++)b[a[d]]=!0;return b}function ua(a){return K(a.nodeName||a[0]&&a[0].nodeName)}function cb(a,b){var d=a.indexOf(b);0<=d&&a.splice(d,1);return d}function Ia(a,b,d){function c(a,b,c){c--;if(0>c)return"...";var d=b.$$hashKey,f;if(H(a)){f=0;for(var g=a.length;f<g;f++)b.push(e(a[f],c))}else if(Nc(a))for(f in a)b[f]=e(a[f],c);else if(a&&"function"===typeof a.hasOwnProperty)for(f in a)a.hasOwnProperty(f)&&
|
||||
(b[f]=e(a[f],c));else for(f in a)ta.call(a,f)&&(b[f]=e(a[f],c));d?b.$$hashKey=d:delete b.$$hashKey;return b}function e(a,b){if(!D(a))return a;var d=g.indexOf(a);if(-1!==d)return k[d];if($a(a)||bb(a))throw pa("cpws");var d=!1,e=f(a);void 0===e&&(e=H(a)?[]:Object.create(Pc(a)),d=!0);g.push(a);k.push(e);return d?c(a,e,b):e}function f(a){switch(la.call(a)){case "[object Int8Array]":case "[object Int16Array]":case "[object Int32Array]":case "[object Float32Array]":case "[object Float64Array]":case "[object Uint8Array]":case "[object Uint8ClampedArray]":case "[object Uint16Array]":case "[object Uint32Array]":return new a.constructor(e(a.buffer),
|
||||
a.byteOffset,a.length);case "[object ArrayBuffer]":if(!a.slice){var b=new ArrayBuffer(a.byteLength);(new Uint8Array(b)).set(new Uint8Array(a));return b}return a.slice(0);case "[object Boolean]":case "[object Number]":case "[object String]":case "[object Date]":return new a.constructor(a.valueOf());case "[object RegExp]":return b=new RegExp(a.source,a.toString().match(/[^/]*$/)[0]),b.lastIndex=a.lastIndex,b;case "[object Blob]":return new a.constructor([a],{type:a.type})}if(B(a.cloneNode))return a.cloneNode(!0)}
|
||||
var g=[],k=[];d=Xb(d)?d:NaN;if(b){if(ue(b)||"[object ArrayBuffer]"===la.call(b))throw pa("cpta");if(a===b)throw pa("cpi");H(b)?b.length=0:r(b,function(a,c){"$$hashKey"!==c&&delete b[c]});g.push(a);k.push(b);return c(a,b,d)}return e(a,d)}function dc(a,b){return a===b||a!==a&&b!==b}function va(a,b){if(a===b)return!0;if(null===a||null===b)return!1;if(a!==a&&b!==b)return!0;var d=typeof a,c;if(d===typeof b&&"object"===d)if(H(a)){if(!H(b))return!1;if((d=a.length)===b.length){for(c=0;c<d;c++)if(!va(a[c],
|
||||
b[c]))return!1;return!0}}else{if(ha(a))return ha(b)?dc(a.getTime(),b.getTime()):!1;if(ab(a))return ab(b)?a.toString()===b.toString():!1;if(bb(a)||bb(b)||$a(a)||$a(b)||H(b)||ha(b)||ab(b))return!1;d=T();for(c in a)if("$"!==c.charAt(0)&&!B(a[c])){if(!va(a[c],b[c]))return!1;d[c]=!0}for(c in b)if(!(c in d)&&"$"!==c.charAt(0)&&w(b[c])&&!B(b[c]))return!1;return!0}return!1}function db(a,b,d){return a.concat(Ha.call(b,d))}function Va(a,b){var d=2<arguments.length?Ha.call(arguments,2):[];return!B(b)||b instanceof
|
||||
RegExp?b:d.length?function(){return arguments.length?b.apply(a,db(d,arguments,0)):b.apply(a,d)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}}function Qc(a,b){var d=b;"string"===typeof a&&"$"===a.charAt(0)&&"$"===a.charAt(1)?d=void 0:$a(b)?d="$WINDOW":b&&C.document===b?d="$DOCUMENT":bb(b)&&(d="$SCOPE");return d}function eb(a,b){if(!z(a))return W(b)||(b=b?2:null),JSON.stringify(a,Qc,b)}function Rc(a){return A(a)?JSON.parse(a):a}function ec(a,b){a=a.replace(xe,"");var d=Date.parse("Jan 01, 1970 00:00:00 "+
|
||||
a)/6E4;return X(d)?b:d}function Sc(a,b){a=new Date(a.getTime());a.setMinutes(a.getMinutes()+b);return a}function fc(a,b,d){d=d?-1:1;var c=a.getTimezoneOffset();b=ec(b,c);return Sc(a,d*(b-c))}function za(a){a=x(a).clone().empty();var b=x("<div></div>").append(a).html();try{return a[0].nodeType===Pa?K(b):b.match(/^(<[^>]+>)/)[1].replace(/^<([\w-]+)/,function(a,b){return"<"+K(b)})}catch(d){return K(b)}}function Tc(a){try{return decodeURIComponent(a)}catch(b){}}function gc(a){var b={};r((a||"").split("&"),
|
||||
function(a){var c,e,f;a&&(e=a=a.replace(/\+/g,"%20"),c=a.indexOf("="),-1!==c&&(e=a.substring(0,c),f=a.substring(c+1)),e=Tc(e),w(e)&&(f=w(f)?Tc(f):!0,ta.call(b,e)?H(b[e])?b[e].push(f):b[e]=[b[e],f]:b[e]=f))});return b}function ye(a){var b=[];r(a,function(a,c){H(a)?r(a,function(a){b.push(ba(c,!0)+(!0===a?"":"="+ba(a,!0)))}):b.push(ba(c,!0)+(!0===a?"":"="+ba(a,!0)))});return b.length?b.join("&"):""}function hc(a){return ba(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ba(a,
|
||||
b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function ze(a,b){var d,c,e=Qa.length;for(c=0;c<e;++c)if(d=Qa[c]+b,A(d=a.getAttribute(d)))return d;return null}function Ae(a,b){var d,c,e={};r(Qa,function(b){b+="app";!d&&a.hasAttribute&&a.hasAttribute(b)&&(d=a,c=a.getAttribute(b))});r(Qa,function(b){b+="app";var e;!d&&(e=a.querySelector("["+b.replace(":","\\:")+"]"))&&(d=e,c=e.getAttribute(b))});
|
||||
d&&(Be?(e.strictDi=null!==ze(d,"strict-di"),b(d,c?[c]:[],e)):C.console.error("AngularJS: disabling automatic bootstrap. <script> protocol indicates an extension, document.location.href does not match."))}function Uc(a,b,d){D(d)||(d={});d=S({strictDi:!1},d);var c=function(){a=x(a);if(a.injector()){var c=a[0]===C.document?"document":za(a);throw pa("btstrpd",c.replace(/</,"<").replace(/>/,">"));}b=b||[];b.unshift(["$provide",function(b){b.value("$rootElement",a)}]);d.debugInfoEnabled&&b.push(["$compileProvider",
|
||||
function(a){a.debugInfoEnabled(!0)}]);b.unshift("ng");c=fb(b,d.strictDi);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;C&&e.test(C.name)&&(d.debugInfoEnabled=!0,C.name=C.name.replace(e,""));if(C&&!f.test(C.name))return c();C.name=C.name.replace(f,"");ca.resumeBootstrap=function(a){r(a,function(a){b.push(a)});return c()};B(ca.resumeDeferredBootstrap)&&
|
||||
ca.resumeDeferredBootstrap()}function Ce(){C.name="NG_ENABLE_DEBUG_INFO!"+C.name;C.location.reload()}function De(a){a=ca.element(a).injector();if(!a)throw pa("test");return a.get("$$testability")}function Vc(a,b){b=b||"_";return a.replace(Ee,function(a,c){return(c?b:"")+a.toLowerCase()})}function Fe(){var a;if(!Wc){var b=qb();(rb=z(b)?C.jQuery:b?C[b]:void 0)&&rb.fn.on?(x=rb,S(rb.fn,{scope:Wa.scope,isolateScope:Wa.isolateScope,controller:Wa.controller,injector:Wa.injector,inheritedData:Wa.inheritedData})):
|
||||
x=Y;a=x.cleanData;x.cleanData=function(b){for(var c,e=0,f;null!=(f=b[e]);e++)(c=(x._data(f)||{}).events)&&c.$destroy&&x(f).triggerHandler("$destroy");a(b)};ca.element=x;Wc=!0}}function gb(a,b,d){if(!a)throw pa("areq",b||"?",d||"required");return a}function sb(a,b,d){d&&H(a)&&(a=a[a.length-1]);gb(B(a),b,"not a function, got "+(a&&"object"===typeof a?a.constructor.name||"Object":typeof a));return a}function Ja(a,b){if("hasOwnProperty"===a)throw pa("badname",b);}function Ge(a,b,d){if(!b)return a;b=b.split(".");
|
||||
for(var c,e=a,f=b.length,g=0;g<f;g++)c=b[g],a&&(a=(e=a)[c]);return!d&&B(a)?Va(e,a):a}function tb(a){for(var b=a[0],d=a[a.length-1],c,e=1;b!==d&&(b=b.nextSibling);e++)if(c||a[e]!==b)c||(c=x(Ha.call(a,0,e))),c.push(b);return c||a}function T(){return Object.create(null)}function ic(a){if(null==a)return"";switch(typeof a){case "string":break;case "number":a=""+a;break;default:a=!bc(a)||H(a)||ha(a)?eb(a):a.toString()}return a}function He(a){function b(a,b,c){return a[b]||(a[b]=c())}var d=F("$injector"),
|
||||
c=F("ng");a=b(a,"angular",Object);a.$$minErr=a.$$minErr||F;return b(a,"module",function(){var a={};return function(f,g,k){var h={};if("hasOwnProperty"===f)throw c("badname","module");g&&a.hasOwnProperty(f)&&(a[f]=null);return b(a,f,function(){function a(b,c,d,f){f||(f=e);return function(){f[d||"push"]([b,c,arguments]);return t}}function b(a,c,d){d||(d=e);return function(b,e){e&&B(e)&&(e.$$moduleName=f);d.push([a,c,arguments]);return t}}if(!g)throw d("nomod",f);var e=[],n=[],s=[],G=a("$injector","invoke",
|
||||
"push",n),t={_invokeQueue:e,_configBlocks:n,_runBlocks:s,info:function(a){if(w(a)){if(!D(a))throw c("aobj","value");h=a;return this}return h},requires:g,name:f,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),decorator:b("$provide","decorator",n),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider","register"),directive:b("$compileProvider",
|
||||
"directive"),component:b("$compileProvider","component"),config:G,run:function(a){s.push(a);return this}};k&&G(k);return t})}})}function ja(a,b){if(H(a)){b=b||[];for(var d=0,c=a.length;d<c;d++)b[d]=a[d]}else if(D(a))for(d in b=b||{},a)if("$"!==d.charAt(0)||"$"!==d.charAt(1))b[d]=a[d];return b||a}function Ie(a,b){var d=[];Xb(b)&&(a=ca.copy(a,null,b));return JSON.stringify(a,function(a,b){b=Qc(a,b);if(D(b)){if(0<=d.indexOf(b))return"...";d.push(b)}return b})}function Je(a){S(a,{errorHandlingConfig:re,
|
||||
bootstrap:Uc,copy:Ia,extend:S,merge:te,equals:va,element:x,forEach:r,injector:fb,noop:E,bind:Va,toJson:eb,fromJson:Rc,identity:Ta,isUndefined:z,isDefined:w,isString:A,isFunction:B,isObject:D,isNumber:W,isElement:$b,isArray:H,version:Ke,isDate:ha,callbacks:{$$counter:0},getTestability:De,reloadWithDebugInfo:Ce,$$minErr:F,$$csp:Aa,$$encodeUriSegment:hc,$$encodeUriQuery:ba,$$lowercase:K,$$stringify:ic,$$uppercase:ub});kc=He(C);kc("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:Le});
|
||||
a.provider("$compile",Xc).directive({a:Me,input:Yc,textarea:Yc,form:Ne,script:Oe,select:Pe,option:Qe,ngBind:Re,ngBindHtml:Se,ngBindTemplate:Te,ngClass:Ue,ngClassEven:Ve,ngClassOdd:We,ngCloak:Xe,ngController:Ye,ngForm:Ze,ngHide:$e,ngIf:af,ngInclude:bf,ngInit:cf,ngNonBindable:df,ngPluralize:ef,ngRef:ff,ngRepeat:gf,ngShow:hf,ngStyle:jf,ngSwitch:kf,ngSwitchWhen:lf,ngSwitchDefault:mf,ngOptions:nf,ngTransclude:of,ngModel:pf,ngList:qf,ngChange:rf,pattern:Zc,ngPattern:Zc,required:$c,ngRequired:$c,minlength:ad,
|
||||
ngMinlength:ad,maxlength:bd,ngMaxlength:bd,ngValue:sf,ngModelOptions:tf}).directive({ngInclude:uf,input:vf}).directive(vb).directive(cd);a.provider({$anchorScroll:wf,$animate:xf,$animateCss:yf,$$animateJs:zf,$$animateQueue:Af,$$AnimateRunner:Bf,$$animateAsyncRun:Cf,$browser:Df,$cacheFactory:Ef,$controller:Ff,$document:Gf,$$isDocumentHidden:Hf,$exceptionHandler:If,$filter:dd,$$forceReflow:Jf,$interpolate:Kf,$interval:Lf,$$intervalFactory:Mf,$http:Nf,$httpParamSerializer:Of,$httpParamSerializerJQLike:Pf,
|
||||
$httpBackend:Qf,$xhrFactory:Rf,$jsonpCallbacks:Sf,$location:Tf,$log:Uf,$parse:Vf,$rootScope:Wf,$q:Xf,$$q:Yf,$sce:Zf,$sceDelegate:$f,$sniffer:ag,$$taskTrackerFactory:bg,$templateCache:cg,$templateRequest:dg,$$testability:eg,$timeout:fg,$window:gg,$$rAF:hg,$$jqLite:ig,$$Map:jg,$$cookieReader:kg})}]).info({angularVersion:"1.7.7"})}function wb(a,b){return b.toUpperCase()}function xb(a){return a.replace(lg,wb)}function lc(a){a=a.nodeType;return 1===a||!a||9===a}function ed(a,b){var d,c,e=b.createDocumentFragment(),
|
||||
f=[];if(mc.test(a)){d=e.appendChild(b.createElement("div"));c=(mg.exec(a)||["",""])[1].toLowerCase();c=oa[c]||oa._default;d.innerHTML=c[1]+a.replace(ng,"<$1></$2>")+c[2];for(c=c[0];c--;)d=d.lastChild;f=db(f,d.childNodes);d=e.firstChild;d.textContent=""}else f.push(b.createTextNode(a));e.textContent="";e.innerHTML="";r(f,function(a){e.appendChild(a)});return e}function Y(a){if(a instanceof Y)return a;var b;A(a)&&(a=U(a),b=!0);if(!(this instanceof Y)){if(b&&"<"!==a.charAt(0))throw nc("nosel");return new Y(a)}if(b){b=
|
||||
C.document;var d;a=(d=og.exec(a))?[b.createElement(d[1])]:(d=ed(a,b))?d.childNodes:[];oc(this,a)}else B(a)?fd(a):oc(this,a)}function pc(a){return a.cloneNode(!0)}function yb(a,b){!b&&lc(a)&&x.cleanData([a]);a.querySelectorAll&&x.cleanData(a.querySelectorAll("*"))}function gd(a){for(var b in a)return!1;return!0}function hd(a){var b=a.ng339,d=b&&Ka[b],c=d&&d.events,d=d&&d.data;d&&!gd(d)||c&&!gd(c)||(delete Ka[b],a.ng339=void 0)}function id(a,b,d,c){if(w(c))throw nc("offargs");var e=(c=zb(a))&&c.events,
|
||||
f=c&&c.handle;if(f){if(b){var g=function(b){var c=e[b];w(d)&&cb(c||[],d);w(d)&&c&&0<c.length||(a.removeEventListener(b,f),delete e[b])};r(b.split(" "),function(a){g(a);Ab[a]&&g(Ab[a])})}else for(b in e)"$destroy"!==b&&a.removeEventListener(b,f),delete e[b];hd(a)}}function qc(a,b){var d=a.ng339;if(d=d&&Ka[d])b?delete d.data[b]:d.data={},hd(a)}function zb(a,b){var d=a.ng339,d=d&&Ka[d];b&&!d&&(a.ng339=d=++pg,d=Ka[d]={events:{},data:{},handle:void 0});return d}function rc(a,b,d){if(lc(a)){var c,e=w(d),
|
||||
f=!e&&b&&!D(b),g=!b;a=(a=zb(a,!f))&&a.data;if(e)a[xb(b)]=d;else{if(g)return a;if(f)return a&&a[xb(b)];for(c in b)a[xb(c)]=b[c]}}}function Bb(a,b){return a.getAttribute?-1<(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+b+" "):!1}function Cb(a,b){if(b&&a.setAttribute){var d=(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),c=d;r(b.split(" "),function(a){a=U(a);c=c.replace(" "+a+" "," ")});c!==d&&a.setAttribute("class",U(c))}}function Db(a,b){if(b&&a.setAttribute){var d=
|
||||
(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),c=d;r(b.split(" "),function(a){a=U(a);-1===c.indexOf(" "+a+" ")&&(c+=a+" ")});c!==d&&a.setAttribute("class",U(c))}}function oc(a,b){if(b)if(b.nodeType)a[a.length++]=b;else{var d=b.length;if("number"===typeof d&&b.window!==b){if(d)for(var c=0;c<d;c++)a[a.length++]=b[c]}else a[a.length++]=b}}function jd(a,b){return Eb(a,"$"+(b||"ngController")+"Controller")}function Eb(a,b,d){9===a.nodeType&&(a=a.documentElement);for(b=H(b)?b:[b];a;){for(var c=
|
||||
0,e=b.length;c<e;c++)if(w(d=x.data(a,b[c])))return d;a=a.parentNode||11===a.nodeType&&a.host}}function kd(a){for(yb(a,!0);a.firstChild;)a.removeChild(a.firstChild)}function Fb(a,b){b||yb(a);var d=a.parentNode;d&&d.removeChild(a)}function qg(a,b){b=b||C;if("complete"===b.document.readyState)b.setTimeout(a);else x(b).on("load",a)}function fd(a){function b(){C.document.removeEventListener("DOMContentLoaded",b);C.removeEventListener("load",b);a()}"complete"===C.document.readyState?C.setTimeout(a):(C.document.addEventListener("DOMContentLoaded",
|
||||
b),C.addEventListener("load",b))}function ld(a,b){var d=Gb[b.toLowerCase()];return d&&md[ua(a)]&&d}function rg(a,b){var d=function(c,d){c.isDefaultPrevented=function(){return c.defaultPrevented};var f=b[d||c.type],g=f?f.length:0;if(g){if(z(c.immediatePropagationStopped)){var k=c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=!0;c.stopPropagation&&c.stopPropagation();k&&k.call(c)}}c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};
|
||||
var h=f.specialHandlerWrapper||sg;1<g&&(f=ja(f));for(var l=0;l<g;l++)c.isImmediatePropagationStopped()||h(a,c,f[l])}};d.elem=a;return d}function sg(a,b,d){d.call(a,b)}function tg(a,b,d){var c=b.relatedTarget;c&&(c===a||ug.call(a,c))||d.call(a,b)}function ig(){this.$get=function(){return S(Y,{hasClass:function(a,b){a.attr&&(a=a[0]);return Bb(a,b)},addClass:function(a,b){a.attr&&(a=a[0]);return Db(a,b)},removeClass:function(a,b){a.attr&&(a=a[0]);return Cb(a,b)}})}}function La(a,b){var d=a&&a.$$hashKey;
|
||||
if(d)return"function"===typeof d&&(d=a.$$hashKey()),d;d=typeof a;return d="function"===d||"object"===d&&null!==a?a.$$hashKey=d+":"+(b||se)():d+":"+a}function nd(){this._keys=[];this._values=[];this._lastKey=NaN;this._lastIndex=-1}function od(a){a=Function.prototype.toString.call(a).replace(vg,"");return a.match(wg)||a.match(xg)}function yg(a){return(a=od(a))?"function("+(a[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function fb(a,b){function d(a){return function(b,c){if(D(b))r(b,Yb(a));else return a(b,
|
||||
c)}}function c(a,b){Ja(a,"service");if(B(b)||H(b))b=n.instantiate(b);if(!b.$get)throw Ba("pget",a);return p[a+"Provider"]=b}function e(a,b){return function(){var c=t.invoke(b,this);if(z(c))throw Ba("undef",a);return c}}function f(a,b,d){return c(a,{$get:!1!==d?e(a,b):b})}function g(a){gb(z(a)||H(a),"modulesToLoad","not an array");var b=[],c;r(a,function(a){function d(a){var b,c;b=0;for(c=a.length;b<c;b++){var e=a[b],f=n.get(e[0]);f[e[1]].apply(f,e[2])}}if(!m.get(a)){m.set(a,!0);try{A(a)?(c=kc(a),
|
||||
t.modules[a]=c,b=b.concat(g(c.requires)).concat(c._runBlocks),d(c._invokeQueue),d(c._configBlocks)):B(a)?b.push(n.invoke(a)):H(a)?b.push(n.invoke(a)):sb(a,"module")}catch(e){throw H(a)&&(a=a[a.length-1]),e.message&&e.stack&&-1===e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ba("modulerr",a,e.stack||e.message||e);}}});return b}function k(a,c){function d(b,e){if(a.hasOwnProperty(b)){if(a[b]===h)throw Ba("cdep",b+" <- "+l.join(" <- "));return a[b]}try{return l.unshift(b),a[b]=h,a[b]=c(b,e),
|
||||
a[b]}catch(f){throw a[b]===h&&delete a[b],f;}finally{l.shift()}}function e(a,c,f){var g=[];a=fb.$$annotate(a,b,f);for(var h=0,k=a.length;h<k;h++){var l=a[h];if("string"!==typeof l)throw Ba("itkn",l);g.push(c&&c.hasOwnProperty(l)?c[l]:d(l,f))}return g}return{invoke:function(a,b,c,d){"string"===typeof c&&(d=c,c=null);c=e(a,c,d);H(a)&&(a=a[a.length-1]);d=a;if(Ca||"function"!==typeof d)d=!1;else{var f=d.$$ngIsClass;Ga(f)||(f=d.$$ngIsClass=/^class\b/.test(Function.prototype.toString.call(d)));d=f}return d?
|
||||
(c.unshift(null),new (Function.prototype.bind.apply(a,c))):a.apply(b,c)},instantiate:function(a,b,c){var d=H(a)?a[a.length-1]:a;a=e(a,b,c);a.unshift(null);return new (Function.prototype.bind.apply(d,a))},get:d,annotate:fb.$$annotate,has:function(b){return p.hasOwnProperty(b+"Provider")||a.hasOwnProperty(b)}}}b=!0===b;var h={},l=[],m=new Hb,p={$provide:{provider:d(c),factory:d(f),service:d(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:d(function(a,b){return f(a,
|
||||
ia(b),!1)}),constant:d(function(a,b){Ja(a,"constant");p[a]=b;s[a]=b}),decorator:function(a,b){var c=n.get(a+"Provider"),d=c.$get;c.$get=function(){var a=t.invoke(d,c);return t.invoke(b,null,{$delegate:a})}}}},n=p.$injector=k(p,function(a,b){ca.isString(b)&&l.push(b);throw Ba("unpr",l.join(" <- "));}),s={},G=k(s,function(a,b){var c=n.get(a+"Provider",b);return t.invoke(c.$get,c,void 0,a)}),t=G;p.$injectorProvider={$get:ia(G)};t.modules=n.modules=T();var N=g(a),t=G.get("$injector");t.strictDi=b;r(N,
|
||||
function(a){a&&t.invoke(a)});t.loadNewModules=function(a){r(g(a),function(a){a&&t.invoke(a)})};return t}function wf(){var a=!0;this.disableAutoScrolling=function(){a=!1};this.$get=["$window","$location","$rootScope",function(b,d,c){function e(a){var b=null;Array.prototype.some.call(a,function(a){if("a"===ua(a))return b=a,!0});return b}function f(a){if(a){a.scrollIntoView();var c;c=g.yOffset;B(c)?c=c():$b(c)?(c=c[0],c="fixed"!==b.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):W(c)||
|
||||
(c=0);c&&(a=a.getBoundingClientRect().top,b.scrollBy(0,a-c))}else b.scrollTo(0,0)}function g(a){a=A(a)?a:W(a)?a.toString():d.hash();var b;a?(b=k.getElementById(a))?f(b):(b=e(k.getElementsByName(a)))?f(b):"top"===a&&f(null):f(null)}var k=b.document;a&&c.$watch(function(){return d.hash()},function(a,b){a===b&&""===a||qg(function(){c.$evalAsync(g)})});return g}]}function hb(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;H(a)&&(a=a.join(" "));H(b)&&(b=b.join(" "));return a+" "+b}function zg(a){A(a)&&
|
||||
(a=a.split(" "));var b=T();r(a,function(a){a.length&&(b[a]=!0)});return b}function ra(a){return D(a)?a:{}}function Ag(a,b,d,c,e){function f(){qa=null;k()}function g(){t=y();t=z(t)?null:t;va(t,P)&&(t=P);N=P=t}function k(){var a=N;g();if(v!==h.url()||a!==t)v=h.url(),N=t,r(J,function(a){a(h.url(),t)})}var h=this,l=a.location,m=a.history,p=a.setTimeout,n=a.clearTimeout,s={},G=e(d);h.isMock=!1;h.$$completeOutstandingRequest=G.completeTask;h.$$incOutstandingRequestCount=G.incTaskCount;h.notifyWhenNoOutstandingRequests=
|
||||
G.notifyWhenNoPendingTasks;var t,N,v=l.href,jc=b.find("base"),qa=null,y=c.history?function(){try{return m.state}catch(a){}}:E;g();h.url=function(b,d,e){z(e)&&(e=null);l!==a.location&&(l=a.location);m!==a.history&&(m=a.history);if(b){var f=N===e;b=ga(b).href;if(v===b&&(!c.history||f))return h;var k=v&&Da(v)===Da(b);v=b;N=e;!c.history||k&&f?(k||(qa=b),d?l.replace(b):k?(d=l,e=b,f=e.indexOf("#"),e=-1===f?"":e.substr(f),d.hash=e):l.href=b,l.href!==b&&(qa=b)):(m[d?"replaceState":"pushState"](e,"",b),g());
|
||||
qa&&(qa=b);return h}return(qa||l.href).replace(/#$/,"")};h.state=function(){return t};var J=[],I=!1,P=null;h.onUrlChange=function(b){if(!I){if(c.history)x(a).on("popstate",f);x(a).on("hashchange",f);I=!0}J.push(b);return b};h.$$applicationDestroyed=function(){x(a).off("hashchange popstate",f)};h.$$checkUrlChange=k;h.baseHref=function(){var a=jc.attr("href");return a?a.replace(/^(https?:)?\/\/[^/]*/,""):""};h.defer=function(a,b,c){var d;b=b||0;c=c||G.DEFAULT_TASK_TYPE;G.incTaskCount(c);d=p(function(){delete s[d];
|
||||
G.completeTask(a,c)},b);s[d]=c;return d};h.defer.cancel=function(a){if(s.hasOwnProperty(a)){var b=s[a];delete s[a];n(a);G.completeTask(E,b);return!0}return!1}}function Df(){this.$get=["$window","$log","$sniffer","$document","$$taskTrackerFactory",function(a,b,d,c,e){return new Ag(a,c,b,d,e)}]}function Ef(){this.$get=function(){function a(a,c){function e(a){a!==p&&(n?n===a&&(n=a.n):n=a,f(a.n,a.p),f(a,p),p=a,p.n=null)}function f(a,b){a!==b&&(a&&(a.p=b),b&&(b.n=a))}if(a in b)throw F("$cacheFactory")("iid",
|
||||
a);var g=0,k=S({},c,{id:a}),h=T(),l=c&&c.capacity||Number.MAX_VALUE,m=T(),p=null,n=null;return b[a]={put:function(a,b){if(!z(b)){if(l<Number.MAX_VALUE){var c=m[a]||(m[a]={key:a});e(c)}a in h||g++;h[a]=b;g>l&&this.remove(n.key);return b}},get:function(a){if(l<Number.MAX_VALUE){var b=m[a];if(!b)return;e(b)}return h[a]},remove:function(a){if(l<Number.MAX_VALUE){var b=m[a];if(!b)return;b===p&&(p=b.p);b===n&&(n=b.n);f(b.n,b.p);delete m[a]}a in h&&(delete h[a],g--)},removeAll:function(){h=T();g=0;m=T();
|
||||
p=n=null},destroy:function(){m=k=h=null;delete b[a]},info:function(){return S({},k,{size:g})}}}var b={};a.info=function(){var a={};r(b,function(b,e){a[e]=b.info()});return a};a.get=function(a){return b[a]};return a}}function cg(){this.$get=["$cacheFactory",function(a){return a("templates")}]}function Xc(a,b){function d(a,b,c){var d=/^([@&]|[=<](\*?))(\??)\s*([\w$]*)$/,e=T();r(a,function(a,f){a=a.trim();if(a in p)e[f]=p[a];else{var g=a.match(d);if(!g)throw $("iscp",b,f,a,c?"controller bindings definition":
|
||||
"isolate scope definition");e[f]={mode:g[1][0],collection:"*"===g[2],optional:"?"===g[3],attrName:g[4]||f};g[4]&&(p[a]=e[f])}});return e}function c(a){var b=a.charAt(0);if(!b||b!==K(b))throw $("baddir",a);if(a!==a.trim())throw $("baddir",a);}function e(a){var b=a.require||a.controller&&a.name;!H(b)&&D(b)&&r(b,function(a,c){var d=a.match(l);a.substring(d[0].length)||(b[c]=d[0]+c)});return b}var f={},g=/^\s*directive:\s*([\w-]+)\s+(.*)$/,k=/(([\w-]+)(?::([^;]+))?;?)/,h=we("ngSrc,ngSrcset,src,srcset"),
|
||||
l=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,m=/^(on[a-z]+|formaction)$/,p=T();this.directive=function qa(b,d){gb(b,"name");Ja(b,"directive");A(b)?(c(b),gb(d,"directiveFactory"),f.hasOwnProperty(b)||(f[b]=[],a.factory(b+"Directive",["$injector","$exceptionHandler",function(a,c){var d=[];r(f[b],function(f,g){try{var h=a.invoke(f);B(h)?h={compile:ia(h)}:!h.compile&&h.link&&(h.compile=ia(h.link));h.priority=h.priority||0;h.index=g;h.name=h.name||b;h.require=e(h);var k=h,l=h.restrict;if(l&&(!A(l)||!/[EACM]/.test(l)))throw $("badrestrict",
|
||||
l,b);k.restrict=l||"EA";h.$$moduleName=f.$$moduleName;d.push(h)}catch(m){c(m)}});return d}])),f[b].push(d)):r(b,Yb(qa));return this};this.component=function y(a,b){function c(a){function e(b){return B(b)||H(b)?function(c,d){return a.invoke(b,this,{$element:c,$attrs:d})}:b}var f=b.template||b.templateUrl?b.template:"",g={controller:d,controllerAs:Bg(b.controller)||b.controllerAs||"$ctrl",template:e(f),templateUrl:e(b.templateUrl),transclude:b.transclude,scope:{},bindToController:b.bindings||{},restrict:"E",
|
||||
require:b.require};r(b,function(a,b){"$"===b.charAt(0)&&(g[b]=a)});return g}if(!A(a))return r(a,Yb(Va(this,y))),this;var d=b.controller||function(){};r(b,function(a,b){"$"===b.charAt(0)&&(c[b]=a,B(d)&&(d[b]=a))});c.$inject=["$injector"];return this.directive(a,c)};this.aHrefSanitizationWhitelist=function(a){return w(a)?(b.aHrefSanitizationWhitelist(a),this):b.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(a){return w(a)?(b.imgSrcSanitizationWhitelist(a),this):b.imgSrcSanitizationWhitelist()};
|
||||
var n=!0;this.debugInfoEnabled=function(a){return w(a)?(n=a,this):n};var s=!1;this.strictComponentBindingsEnabled=function(a){return w(a)?(s=a,this):s};var G=10;this.onChangesTtl=function(a){return arguments.length?(G=a,this):G};var t=!0;this.commentDirectivesEnabled=function(a){return arguments.length?(t=a,this):t};var N=!0;this.cssClassDirectivesEnabled=function(a){return arguments.length?(N=a,this):N};var v=T();this.addPropertySecurityContext=function(a,b,c){var d=a.toLowerCase()+"|"+b.toLowerCase();
|
||||
if(d in v&&v[d]!==c)throw $("ctxoverride",a,b,v[d],c);v[d]=c;return this};(function(){function a(b,c){r(c,function(a){v[a.toLowerCase()]=b})}a(V.HTML,["iframe|srcdoc","*|innerHTML","*|outerHTML"]);a(V.CSS,["*|style"]);a(V.URL,"area|href area|ping a|href a|ping blockquote|cite body|background del|cite input|src ins|cite q|cite".split(" "));a(V.MEDIA_URL,"audio|src img|src img|srcset source|src source|srcset track|src video|src video|poster".split(" "));a(V.RESOURCE_URL,"*|formAction applet|code applet|codebase base|href embed|src frame|src form|action head|profile html|manifest iframe|src link|href media|src object|codebase object|data script|src".split(" "))})();
|
||||
this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$sce","$animate",function(a,b,c,e,p,M,L,u,R){function q(){try{if(!--Ja)throw Ua=void 0,$("infchng",G);L.$apply(function(){for(var a=0,b=Ua.length;a<b;++a)try{Ua[a]()}catch(d){c(d)}Ua=void 0})}finally{Ja++}}function ma(a,b){if(!a)return a;if(!A(a))throw $("srcset",b,a.toString());for(var c="",d=U(a),e=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,e=/\s/.test(d)?e:/(,)/,d=d.split(e),e=Math.floor(d.length/
|
||||
2),f=0;f<e;f++)var g=2*f,c=c+u.getTrustedMediaUrl(U(d[g])),c=c+(" "+U(d[g+1]));d=U(d[2*f]).split(/\s/);c+=u.getTrustedMediaUrl(U(d[0]));2===d.length&&(c+=" "+U(d[1]));return c}function w(a,b){if(b){var c=Object.keys(b),d,e,f;d=0;for(e=c.length;d<e;d++)f=c[d],this[f]=b[f]}else this.$attr={};this.$$element=a}function O(a,b,c){Fa.innerHTML="<span "+b+">";b=Fa.firstChild.attributes;var d=b[0];b.removeNamedItem(d.name);d.value=c;a.attributes.setNamedItem(d)}function sa(a,b){try{a.addClass(b)}catch(c){}}
|
||||
function da(a,b,c,d,e){a instanceof x||(a=x(a));var f=Xa(a,b,a,c,d,e);da.$$addScopeClass(a);var g=null;return function(b,c,d){if(!a)throw $("multilink");gb(b,"scope");e&&e.needsNewScope&&(b=b.$parent.$new());d=d||{};var h=d.parentBoundTranscludeFn,k=d.transcludeControllers;d=d.futureParentElement;h&&h.$$boundTransclude&&(h=h.$$boundTransclude);g||(g=(d=d&&d[0])?"foreignobject"!==ua(d)&&la.call(d).match(/SVG/)?"svg":"html":"html");d="html"!==g?x(ja(g,x("<div></div>").append(a).html())):c?Wa.clone.call(a):
|
||||
a;if(k)for(var l in k)d.data("$"+l+"Controller",k[l].instance);da.$$addScopeInfo(d,b);c&&c(d,b);f&&f(b,d,d,h);c||(a=f=null);return d}}function Xa(a,b,c,d,e,f){function g(a,c,d,e){var f,k,l,m,p,I,t;if(n)for(t=Array(c.length),m=0;m<h.length;m+=3)f=h[m],t[f]=c[f];else t=c;m=0;for(p=h.length;m<p;)k=t[h[m++]],c=h[m++],f=h[m++],c?(c.scope?(l=a.$new(),da.$$addScopeInfo(x(k),l)):l=a,I=c.transcludeOnThisElement?ka(a,c.transclude,e):!c.templateOnThisElement&&e?e:!e&&b?ka(a,b):null,c(f,l,k,d,I)):f&&f(a,k.childNodes,
|
||||
void 0,e)}for(var h=[],k=H(a)||a instanceof x,l,m,p,I,n,t=0;t<a.length;t++){l=new w;11===Ca&&ib(a,t,k);m=sc(a[t],[],l,0===t?d:void 0,e);(f=m.length?aa(m,a[t],l,b,c,null,[],[],f):null)&&f.scope&&da.$$addScopeClass(l.$$element);l=f&&f.terminal||!(p=a[t].childNodes)||!p.length?null:Xa(p,f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b);if(f||l)h.push(t,f,l),I=!0,n=n||f;f=null}return I?g:null}function ib(a,b,c){var d=a[b],e=d.parentNode,f;if(d.nodeType===Pa)for(;;){f=e?d.nextSibling:
|
||||
a[b+1];if(!f||f.nodeType!==Pa)break;d.nodeValue+=f.nodeValue;f.parentNode&&f.parentNode.removeChild(f);c&&f===a[b+1]&&a.splice(b+1,1)}}function ka(a,b,c){function d(e,f,g,h,k){e||(e=a.$new(!1,k),e.$$transcluded=!0);return b(e,f,{parentBoundTranscludeFn:c,transcludeControllers:g,futureParentElement:h})}var e=d.$$slots=T(),f;for(f in b.$$slots)e[f]=b.$$slots[f]?ka(a,b.$$slots[f],c):null;return d}function sc(a,b,d,e,f){var g=d.$attr,h;switch(a.nodeType){case 1:h=ua(a);X(b,wa(h),"E",e,f);for(var l,m,
|
||||
n,t,J,s=a.attributes,v=0,G=s&&s.length;v<G;v++){var P=!1,N=!1,r=!1,y=!1,u=!1,M;l=s[v];m=l.name;t=l.value;n=wa(m.toLowerCase());(J=n.match(Ra))?(r="Attr"===J[1],y="Prop"===J[1],u="On"===J[1],m=m.replace(pd,"").toLowerCase().substr(4+J[1].length).replace(/_(.)/g,function(a,b){return b.toUpperCase()})):(M=n.match(Sa))&&ca(M[1])&&(P=m,N=m.substr(0,m.length-5)+"end",m=m.substr(0,m.length-6));if(y||u)d[n]=t,g[n]=l.name,y?Ea(a,b,n,m):b.push(qd(p,L,c,n,m,!1));else{n=wa(m.toLowerCase());g[n]=m;if(r||!d.hasOwnProperty(n))d[n]=
|
||||
t,ld(a,n)&&(d[n]=!0);Ia(a,b,t,n,r);X(b,n,"A",e,f,P,N)}}"input"===h&&"hidden"===a.getAttribute("type")&&a.setAttribute("autocomplete","off");if(!Qa)break;g=a.className;D(g)&&(g=g.animVal);if(A(g)&&""!==g)for(;a=k.exec(g);)n=wa(a[2]),X(b,n,"C",e,f)&&(d[n]=U(a[3])),g=g.substr(a.index+a[0].length);break;case Pa:na(b,a.nodeValue);break;case 8:if(!Oa)break;F(a,b,d,e,f)}b.sort(ia);return b}function F(a,b,c,d,e){try{var f=g.exec(a.nodeValue);if(f){var h=wa(f[1]);X(b,h,"M",d,e)&&(c[h]=U(f[2]))}}catch(k){}}
|
||||
function V(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw $("uterdir",b,c);1===a.nodeType&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return x(d)}function Y(a,b,c){return function(d,e,f,g,h){e=V(e[0],b,c);return a(d,e,f,g,h)}}function Z(a,b,c,d,e,f){var g;return a?da(b,c,d,e,f):function(){g||(g=da(b,c,d,e,f),b=c=f=null);return g.apply(this,arguments)}}function aa(a,b,d,e,f,g,h,k,l){function m(a,b,c,d){if(a){c&&(a=
|
||||
Y(a,c,d));a.require=u.require;a.directiveName=Q;if(s===u||u.$$isolateScope)a=Aa(a,{isolateScope:!0});h.push(a)}if(b){c&&(b=Y(b,c,d));b.require=u.require;b.directiveName=Q;if(s===u||u.$$isolateScope)b=Aa(b,{isolateScope:!0});k.push(b)}}function p(a,e,f,g,l){function m(a,b,c,d){var e;bb(a)||(d=c,c=b,b=a,a=void 0);N&&(e=P);c||(c=N?Q.parent():Q);if(d){var f=l.$$slots[d];if(f)return f(a,b,e,c,R);if(z(f))throw $("noslot",d,za(Q));}else return l(a,b,e,c,R)}var n,u,L,y,G,P,M,Q;b===f?(g=d,Q=d.$$element):(Q=
|
||||
x(f),g=new w(Q,d));G=e;s?y=e.$new(!0):t&&(G=e.$parent);l&&(M=m,M.$$boundTransclude=l,M.isSlotFilled=function(a){return!!l.$$slots[a]});J&&(P=ea(Q,g,M,J,y,e,s));s&&(da.$$addScopeInfo(Q,y,!0,!(v&&(v===s||v===s.$$originalDirective))),da.$$addScopeClass(Q,!0),y.$$isolateBindings=s.$$isolateBindings,u=Da(e,g,y,y.$$isolateBindings,s),u.removeWatches&&y.$on("$destroy",u.removeWatches));for(n in P){u=J[n];L=P[n];var Cg=u.$$bindings.bindToController;L.instance=L();Q.data("$"+u.name+"Controller",L.instance);
|
||||
L.bindingInfo=Da(G,g,L.instance,Cg,u)}r(J,function(a,b){var c=a.require;a.bindToController&&!H(c)&&D(c)&&S(P[b].instance,W(b,c,Q,P))});r(P,function(a){var b=a.instance;if(B(b.$onChanges))try{b.$onChanges(a.bindingInfo.initialChanges)}catch(d){c(d)}if(B(b.$onInit))try{b.$onInit()}catch(e){c(e)}B(b.$doCheck)&&(G.$watch(function(){b.$doCheck()}),b.$doCheck());B(b.$onDestroy)&&G.$on("$destroy",function(){b.$onDestroy()})});n=0;for(u=h.length;n<u;n++)L=h[n],Ba(L,L.isolateScope?y:e,Q,g,L.require&&W(L.directiveName,
|
||||
L.require,Q,P),M);var R=e;s&&(s.template||null===s.templateUrl)&&(R=y);a&&a(R,f.childNodes,void 0,l);for(n=k.length-1;0<=n;n--)L=k[n],Ba(L,L.isolateScope?y:e,Q,g,L.require&&W(L.directiveName,L.require,Q,P),M);r(P,function(a){a=a.instance;B(a.$postLink)&&a.$postLink()})}l=l||{};for(var n=-Number.MAX_VALUE,t=l.newScopeDirective,J=l.controllerDirectives,s=l.newIsolateScopeDirective,v=l.templateDirective,L=l.nonTlbTranscludeDirective,G=!1,P=!1,N=l.hasElementTranscludeDirective,y=d.$$element=x(b),u,Q,
|
||||
M,R=e,q,ma=!1,Ib=!1,O,sa=0,A=a.length;sa<A;sa++){u=a[sa];var E=u.$$start,ib=u.$$end;E&&(y=V(b,E,ib));M=void 0;if(n>u.priority)break;if(O=u.scope)u.templateUrl||(D(O)?(ba("new/isolated scope",s||t,u,y),s=u):ba("new/isolated scope",s,u,y)),t=t||u;Q=u.name;if(!ma&&(u.replace&&(u.templateUrl||u.template)||u.transclude&&!u.$$tlb)){for(O=sa+1;ma=a[O++];)if(ma.transclude&&!ma.$$tlb||ma.replace&&(ma.templateUrl||ma.template)){Ib=!0;break}ma=!0}!u.templateUrl&&u.controller&&(J=J||T(),ba("'"+Q+"' controller",
|
||||
J[Q],u,y),J[Q]=u);if(O=u.transclude)if(G=!0,u.$$tlb||(ba("transclusion",L,u,y),L=u),"element"===O)N=!0,n=u.priority,M=y,y=d.$$element=x(da.$$createComment(Q,d[Q])),b=y[0],pa(f,Ha.call(M,0),b),R=Z(Ib,M,e,n,g&&g.name,{nonTlbTranscludeDirective:L});else{var ka=T();if(D(O)){M=C.document.createDocumentFragment();var Xa=T(),F=T();r(O,function(a,b){var c="?"===a.charAt(0);a=c?a.substring(1):a;Xa[a]=b;ka[b]=null;F[b]=c});r(y.contents(),function(a){var b=Xa[wa(ua(a))];b?(F[b]=!0,ka[b]=ka[b]||C.document.createDocumentFragment(),
|
||||
ka[b].appendChild(a)):M.appendChild(a)});r(F,function(a,b){if(!a)throw $("reqslot",b);});for(var K in ka)ka[K]&&(R=x(ka[K].childNodes),ka[K]=Z(Ib,R,e));M=x(M.childNodes)}else M=x(pc(b)).contents();y.empty();R=Z(Ib,M,e,void 0,void 0,{needsNewScope:u.$$isolateScope||u.$$newScope});R.$$slots=ka}if(u.template)if(P=!0,ba("template",v,u,y),v=u,O=B(u.template)?u.template(y,d):u.template,O=Na(O),u.replace){g=u;M=mc.test(O)?rd(ja(u.templateNamespace,U(O))):[];b=M[0];if(1!==M.length||1!==b.nodeType)throw $("tplrt",
|
||||
Q,"");pa(f,y,b);A={$attr:{}};O=sc(b,[],A);var Dg=a.splice(sa+1,a.length-(sa+1));(s||t)&&fa(O,s,t);a=a.concat(O).concat(Dg);ga(d,A);A=a.length}else y.html(O);if(u.templateUrl)P=!0,ba("template",v,u,y),v=u,u.replace&&(g=u),p=ha(a.splice(sa,a.length-sa),y,d,f,G&&R,h,k,{controllerDirectives:J,newScopeDirective:t!==u&&t,newIsolateScopeDirective:s,templateDirective:v,nonTlbTranscludeDirective:L}),A=a.length;else if(u.compile)try{q=u.compile(y,d,R);var X=u.$$originalDirective||u;B(q)?m(null,Va(X,q),E,ib):
|
||||
q&&m(Va(X,q.pre),Va(X,q.post),E,ib)}catch(ca){c(ca,za(y))}u.terminal&&(p.terminal=!0,n=Math.max(n,u.priority))}p.scope=t&&!0===t.scope;p.transcludeOnThisElement=G;p.templateOnThisElement=P;p.transclude=R;l.hasElementTranscludeDirective=N;return p}function W(a,b,c,d){var e;if(A(b)){var f=b.match(l);b=b.substring(f[0].length);var g=f[1]||f[3],f="?"===f[2];"^^"===g?c=c.parent():e=(e=d&&d[b])&&e.instance;if(!e){var h="$"+b+"Controller";e="^^"===g&&c[0]&&9===c[0].nodeType?null:g?c.inheritedData(h):c.data(h)}if(!e&&
|
||||
!f)throw $("ctreq",b,a);}else if(H(b))for(e=[],g=0,f=b.length;g<f;g++)e[g]=W(a,b[g],c,d);else D(b)&&(e={},r(b,function(b,f){e[f]=W(a,b,c,d)}));return e||null}function ea(a,b,c,d,e,f,g){var h=T(),k;for(k in d){var l=d[k],m={$scope:l===g||l.$$isolateScope?e:f,$element:a,$attrs:b,$transclude:c},p=l.controller;"@"===p&&(p=b[l.name]);m=M(p,m,!0,l.controllerAs);h[l.name]=m;a.data("$"+l.name+"Controller",m.instance)}return h}function fa(a,b,c){for(var d=0,e=a.length;d<e;d++)a[d]=ac(a[d],{$$isolateScope:b,
|
||||
$$newScope:c})}function X(b,c,e,g,h,k,l){if(c===h)return null;var m=null;if(f.hasOwnProperty(c)){h=a.get(c+"Directive");for(var p=0,n=h.length;p<n;p++)if(c=h[p],(z(g)||g>c.priority)&&-1!==c.restrict.indexOf(e)){k&&(c=ac(c,{$$start:k,$$end:l}));if(!c.$$bindings){var I=m=c,t=c.name,u={isolateScope:null,bindToController:null};D(I.scope)&&(!0===I.bindToController?(u.bindToController=d(I.scope,t,!0),u.isolateScope={}):u.isolateScope=d(I.scope,t,!1));D(I.bindToController)&&(u.bindToController=d(I.bindToController,
|
||||
t,!0));if(u.bindToController&&!I.controller)throw $("noctrl",t);m=m.$$bindings=u;D(m.isolateScope)&&(c.$$isolateBindings=m.isolateScope)}b.push(c);m=c}}return m}function ca(b){if(f.hasOwnProperty(b))for(var c=a.get(b+"Directive"),d=0,e=c.length;d<e;d++)if(b=c[d],b.multiElement)return!0;return!1}function ga(a,b){var c=b.$attr,d=a.$attr;r(a,function(d,e){"$"!==e.charAt(0)&&(b[e]&&b[e]!==d&&(d=d.length?d+(("style"===e?";":" ")+b[e]):b[e]),a.$set(e,d,!0,c[e]))});r(b,function(b,e){a.hasOwnProperty(e)||
|
||||
"$"===e.charAt(0)||(a[e]=b,"class"!==e&&"style"!==e&&(d[e]=c[e]))})}function ha(a,b,d,f,g,h,k,l){var m=[],p,n,t=b[0],u=a.shift(),J=ac(u,{templateUrl:null,transclude:null,replace:null,$$originalDirective:u}),s=B(u.templateUrl)?u.templateUrl(b,d):u.templateUrl,L=u.templateNamespace;b.empty();e(s).then(function(c){var e,I;c=Na(c);if(u.replace){c=mc.test(c)?rd(ja(L,U(c))):[];e=c[0];if(1!==c.length||1!==e.nodeType)throw $("tplrt",u.name,s);c={$attr:{}};pa(f,b,e);var v=sc(e,[],c);D(u.scope)&&fa(v,!0);a=
|
||||
v.concat(a);ga(d,c)}else e=t,b.html(c);a.unshift(J);p=aa(a,e,d,g,b,u,h,k,l);r(f,function(a,c){a===e&&(f[c]=b[0])});for(n=Xa(b[0].childNodes,g);m.length;){c=m.shift();I=m.shift();var y=m.shift(),P=m.shift(),v=b[0];if(!c.$$destroyed){if(I!==t){var G=I.className;l.hasElementTranscludeDirective&&u.replace||(v=pc(e));pa(y,x(I),v);sa(x(v),G)}I=p.transcludeOnThisElement?ka(c,p.transclude,P):P;p(n,c,v,f,I)}}m=null}).catch(function(a){cc(a)&&c(a)});return function(a,b,c,d,e){a=e;b.$$destroyed||(m?m.push(b,
|
||||
c,d,a):(p.transcludeOnThisElement&&(a=ka(b,p.transclude,e)),p(n,b,c,d,a)))}}function ia(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function ba(a,b,c,d){function e(a){return a?" (module: "+a+")":""}if(b)throw $("multidir",b.name,e(b.$$moduleName),c.name,e(c.$$moduleName),a,za(d));}function na(a,c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){a=a.parent();var b=!!a.length;b&&da.$$addBindingClass(a);return function(a,c){var e=c.parent();
|
||||
b||da.$$addBindingClass(e);da.$$addBindingInfo(e,d.expressions);a.$watch(d,function(a){c[0].nodeValue=a})}}})}function ja(a,b){a=K(a||"html");switch(a){case "svg":case "math":var c=C.document.createElement("div");c.innerHTML="<"+a+">"+b+"</"+a+">";return c.childNodes[0].childNodes;default:return b}}function oa(a,b){if("srcdoc"===b)return u.HTML;if("src"===b||"ngSrc"===b)return-1===["img","video","audio","source","track"].indexOf(a)?u.RESOURCE_URL:u.MEDIA_URL;if("xlinkHref"===b)return"image"===a?u.MEDIA_URL:
|
||||
"a"===a?u.URL:u.RESOURCE_URL;if("form"===a&&"action"===b||"base"===a&&"href"===b||"link"===a&&"href"===b)return u.RESOURCE_URL;if("a"===a&&("href"===b||"ngHref"===b))return u.URL}function xa(a,b){var c=b.toLowerCase();return v[a+"|"+c]||v["*|"+c]}function ya(a){return ma(u.valueOf(a),"ng-prop-srcset")}function Ea(a,b,c,d){if(m.test(d))throw $("nodomevents");a=ua(a);var e=xa(a,d),f=Ta;"srcset"!==d||"img"!==a&&"source"!==a?e&&(f=u.getTrusted.bind(u,e)):f=ya;b.push({priority:100,compile:function(a,b){var e=
|
||||
p(b[c]),g=p(b[c],function(a){return u.valueOf(a)});return{pre:function(a,b){function c(){var g=e(a);b[0][d]=f(g)}c();a.$watch(g,c)}}}})}function Ia(a,c,d,e,f){var g=ua(a),k=oa(g,e),l=h[e]||f,p=b(d,!f,k,l);if(p){if("multiple"===e&&"select"===g)throw $("selmulti",za(a));if(m.test(e))throw $("nodomevents");c.push({priority:100,compile:function(){return{pre:function(a,c,f){c=f.$$observers||(f.$$observers=T());var g=f[e];g!==d&&(p=g&&b(g,!0,k,l),d=g);p&&(f[e]=p(a),(c[e]||(c[e]=[])).$$inter=!0,(f.$$observers&&
|
||||
f.$$observers[e].$$scope||a).$watch(p,function(a,b){"class"===e&&a!==b?f.$updateClass(a,b):f.$set(e,a)}))}}}})}}function pa(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g<h;g++)if(a[g]===d){a[g++]=c;h=g+e-1;for(var k=a.length;g<k;g++,h++)h<k?a[g]=a[h]:delete a[g];a.length-=e-1;a.context===d&&(a.context=c);break}f&&f.replaceChild(c,d);a=C.document.createDocumentFragment();for(g=0;g<e;g++)a.appendChild(b[g]);x.hasData(d)&&(x.data(c,x.data(d)),x(d).off("$destroy"));x.cleanData(a.querySelectorAll("*"));
|
||||
for(g=1;g<e;g++)delete b[g];b[0]=c;b.length=1}function Aa(a,b){return S(function(){return a.apply(null,arguments)},a,b)}function Ba(a,b,d,e,f,g){try{a(b,d,e,f,g)}catch(h){c(h,za(d))}}function ra(a,b){if(s)throw $("missingattr",a,b);}function Da(a,c,d,e,f){function g(b,c,e){B(d.$onChanges)&&!dc(c,e)&&(Ua||(a.$$postDigest(q),Ua=[]),m||(m={},Ua.push(h)),m[b]&&(e=m[b].previousValue),m[b]=new Jb(e,c))}function h(){d.$onChanges(m);m=void 0}var k=[],l={},m;r(e,function(e,h){var m=e.attrName,n=e.optional,
|
||||
I,t,u,s;switch(e.mode){case "@":n||ta.call(c,m)||(ra(m,f.name),d[h]=c[m]=void 0);n=c.$observe(m,function(a){if(A(a)||Ga(a))g(h,a,d[h]),d[h]=a});c.$$observers[m].$$scope=a;I=c[m];A(I)?d[h]=b(I)(a):Ga(I)&&(d[h]=I);l[h]=new Jb(tc,d[h]);k.push(n);break;case "=":if(!ta.call(c,m)){if(n)break;ra(m,f.name);c[m]=void 0}if(n&&!c[m])break;t=p(c[m]);s=t.literal?va:dc;u=t.assign||function(){I=d[h]=t(a);throw $("nonassign",c[m],m,f.name);};I=d[h]=t(a);n=function(b){s(b,d[h])||(s(b,I)?u(a,b=d[h]):d[h]=b);return I=
|
||||
b};n.$stateful=!0;n=e.collection?a.$watchCollection(c[m],n):a.$watch(p(c[m],n),null,t.literal);k.push(n);break;case "<":if(!ta.call(c,m)){if(n)break;ra(m,f.name);c[m]=void 0}if(n&&!c[m])break;t=p(c[m]);var v=t.literal,L=d[h]=t(a);l[h]=new Jb(tc,d[h]);n=a[e.collection?"$watchCollection":"$watch"](t,function(a,b){if(b===a){if(b===L||v&&va(b,L))return;b=L}g(h,a,b);d[h]=a});k.push(n);break;case "&":n||ta.call(c,m)||ra(m,f.name);t=c.hasOwnProperty(m)?p(c[m]):E;if(t===E&&n)break;d[h]=function(b){return t(a,
|
||||
b)}}});return{initialChanges:l,removeWatches:k.length&&function(){for(var a=0,b=k.length;a<b;++a)k[a]()}}}var Ma=/^\w/,Fa=C.document.createElement("div"),Oa=t,Qa=N,Ja=G,Ua;w.prototype={$normalize:wa,$addClass:function(a){a&&0<a.length&&R.addClass(this.$$element,a)},$removeClass:function(a){a&&0<a.length&&R.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=sd(a,b);c&&c.length&&R.addClass(this.$$element,c);(c=sd(b,a))&&c.length&&R.removeClass(this.$$element,c)},$set:function(a,b,d,e){var f=
|
||||
ld(this.$$element[0],a),g=td[a],h=a;f?(this.$$element.prop(a,b),e=f):g&&(this[g]=b,h=g);this[a]=b;e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=e=Vc(a,"-"));"img"===ua(this.$$element)&&"srcset"===a&&(this[a]=b=ma(b,"$set('srcset', value)"));!1!==d&&(null===b||z(b)?this.$$element.removeAttr(e):Ma.test(e)?f&&!1===b?this.$$element.removeAttr(e):this.$$element.attr(e,b):O(this.$$element[0],e,b));(a=this.$$observers)&&r(a[h],function(a){try{a(b)}catch(d){c(d)}})},$observe:function(a,b){var c=this,
|
||||
d=c.$$observers||(c.$$observers=T()),e=d[a]||(d[a]=[]);e.push(b);L.$evalAsync(function(){e.$$inter||!c.hasOwnProperty(a)||z(c[a])||b(c[a])});return function(){cb(e,b)}}};var Ka=b.startSymbol(),La=b.endSymbol(),Na="{{"===Ka&&"}}"===La?Ta:function(a){return a.replace(/\{\{/g,Ka).replace(/}}/g,La)},Ra=/^ng(Attr|Prop|On)([A-Z].*)$/,Sa=/^(.+)Start$/;da.$$addBindingInfo=n?function(a,b){var c=a.data("$binding")||[];H(b)?c=c.concat(b):c.push(b);a.data("$binding",c)}:E;da.$$addBindingClass=n?function(a){sa(a,
|
||||
"ng-binding")}:E;da.$$addScopeInfo=n?function(a,b,c,d){a.data(c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope",b)}:E;da.$$addScopeClass=n?function(a,b){sa(a,b?"ng-isolate-scope":"ng-scope")}:E;da.$$createComment=function(a,b){var c="";n&&(c=" "+(a||"")+": ",b&&(c+=b+" "));return C.document.createComment(c)};return da}]}function Jb(a,b){this.previousValue=a;this.currentValue=b}function wa(a){return a.replace(pd,"").replace(Eg,function(a,d,c){return c?d.toUpperCase():d})}function sd(a,b){var d=
|
||||
"",c=a.split(/\s+/),e=b.split(/\s+/),f=0;a:for(;f<c.length;f++){for(var g=c[f],k=0;k<e.length;k++)if(g===e[k])continue a;d+=(0<d.length?" ":"")+g}return d}function rd(a){a=x(a);var b=a.length;if(1>=b)return a;for(;b--;){var d=a[b];(8===d.nodeType||d.nodeType===Pa&&""===d.nodeValue.trim())&&Fg.call(a,b,1)}return a}function Bg(a,b){if(b&&A(b))return b;if(A(a)){var d=ud.exec(a);if(d)return d[3]}}function Ff(){var a={};this.has=function(b){return a.hasOwnProperty(b)};this.register=function(b,d){Ja(b,
|
||||
"controller");D(b)?S(a,b):a[b]=d};this.$get=["$injector",function(b){function d(a,b,d,g){if(!a||!D(a.$scope))throw F("$controller")("noscp",g,b);a.$scope[b]=d}return function(c,e,f,g){var k,h,l;f=!0===f;g&&A(g)&&(l=g);if(A(c)){g=c.match(ud);if(!g)throw vd("ctrlfmt",c);h=g[1];l=l||g[3];c=a.hasOwnProperty(h)?a[h]:Ge(e.$scope,h,!0);if(!c)throw vd("ctrlreg",h);sb(c,h,!0)}if(f)return f=(H(c)?c[c.length-1]:c).prototype,k=Object.create(f||null),l&&d(e,l,k,h||c.name),S(function(){var a=b.invoke(c,k,e,h);
|
||||
a!==k&&(D(a)||B(a))&&(k=a,l&&d(e,l,k,h||c.name));return k},{instance:k,identifier:l});k=b.instantiate(c,e,h);l&&d(e,l,k,h||c.name);return k}}]}function Gf(){this.$get=["$window",function(a){return x(a.document)}]}function Hf(){this.$get=["$document","$rootScope",function(a,b){function d(){e=c.hidden}var c=a[0],e=c&&c.hidden;a.on("visibilitychange",d);b.$on("$destroy",function(){a.off("visibilitychange",d)});return function(){return e}}]}function If(){this.$get=["$log",function(a){return function(b,
|
||||
d){a.error.apply(a,arguments)}}]}function uc(a){return D(a)?ha(a)?a.toISOString():eb(a):a}function Of(){this.$get=function(){return function(a){if(!a)return"";var b=[];Oc(a,function(a,c){null===a||z(a)||B(a)||(H(a)?r(a,function(a){b.push(ba(c)+"="+ba(uc(a)))}):b.push(ba(c)+"="+ba(uc(a))))});return b.join("&")}}}function Pf(){this.$get=function(){return function(a){function b(a,e,f){H(a)?r(a,function(a,c){b(a,e+"["+(D(a)?c:"")+"]")}):D(a)&&!ha(a)?Oc(a,function(a,c){b(a,e+(f?"":"[")+c+(f?"":"]"))}):
|
||||
(B(a)&&(a=a()),d.push(ba(e)+"="+(null==a?"":ba(uc(a)))))}if(!a)return"";var d=[];b(a,"",!0);return d.join("&")}}}function vc(a,b){if(A(a)){var d=a.replace(Gg,"").trim();if(d){var c=b("Content-Type"),c=c&&0===c.indexOf(wd),e;(e=c)||(e=(e=d.match(Hg))&&Ig[e[0]].test(d));if(e)try{a=Rc(d)}catch(f){if(!c)return a;throw Kb("baddata",a,f);}}}return a}function xd(a){var b=T(),d;A(a)?r(a.split("\n"),function(a){d=a.indexOf(":");var e=K(U(a.substr(0,d)));a=U(a.substr(d+1));e&&(b[e]=b[e]?b[e]+", "+a:a)}):D(a)&&
|
||||
r(a,function(a,d){var f=K(d),g=U(a);f&&(b[f]=b[f]?b[f]+", "+g:g)});return b}function yd(a){var b;return function(d){b||(b=xd(a));return d?(d=b[K(d)],void 0===d&&(d=null),d):b}}function zd(a,b,d,c){if(B(c))return c(a,b,d);r(c,function(c){a=c(a,b,d)});return a}function Nf(){var a=this.defaults={transformResponse:[vc],transformRequest:[function(a){return D(a)&&"[object File]"!==la.call(a)&&"[object Blob]"!==la.call(a)&&"[object FormData]"!==la.call(a)?eb(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},
|
||||
post:ja(wc),put:ja(wc),patch:ja(wc)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer",jsonpCallbackParam:"callback"},b=!1;this.useApplyAsync=function(a){return w(a)?(b=!!a,this):b};var d=this.interceptors=[],c=this.xsrfWhitelistedOrigins=[];this.$get=["$browser","$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector","$sce",function(e,f,g,k,h,l,m,p){function n(b){function c(a,b){for(var d=0,e=b.length;d<e;){var f=b[d++],g=b[d++];
|
||||
a=a.then(f,g)}b.length=0;return a}function d(a,b){var c,e={};r(a,function(a,d){B(a)?(c=a(b),null!=c&&(e[d]=c)):e[d]=a});return e}function f(a){var b=S({},a);b.data=zd(a.data,a.headers,a.status,g.transformResponse);a=a.status;return 200<=a&&300>a?b:l.reject(b)}if(!D(b))throw F("$http")("badreq",b);if(!A(p.valueOf(b.url)))throw F("$http")("badreq",b.url);var g=S({method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse,paramSerializer:a.paramSerializer,jsonpCallbackParam:a.jsonpCallbackParam},
|
||||
b);g.headers=function(b){var c=a.headers,e=S({},b.headers),f,g,h,c=S({},c.common,c[K(b.method)]);a:for(f in c){g=K(f);for(h in e)if(K(h)===g)continue a;e[f]=c[f]}return d(e,ja(b))}(b);g.method=ub(g.method);g.paramSerializer=A(g.paramSerializer)?m.get(g.paramSerializer):g.paramSerializer;e.$$incOutstandingRequestCount("$http");var h=[],k=[];b=l.resolve(g);r(v,function(a){(a.request||a.requestError)&&h.unshift(a.request,a.requestError);(a.response||a.responseError)&&k.push(a.response,a.responseError)});
|
||||
b=c(b,h);b=b.then(function(b){var c=b.headers,d=zd(b.data,yd(c),void 0,b.transformRequest);z(d)&&r(c,function(a,b){"content-type"===K(b)&&delete c[b]});z(b.withCredentials)&&!z(a.withCredentials)&&(b.withCredentials=a.withCredentials);return s(b,d).then(f,f)});b=c(b,k);return b=b.finally(function(){e.$$completeOutstandingRequest(E,"$http")})}function s(c,d){function e(a){if(a){var c={};r(a,function(a,d){c[d]=function(c){function d(){a(c)}b?h.$applyAsync(d):h.$$phase?d():h.$apply(d)}});return c}}function k(a,
|
||||
c,d,e,f){function g(){m(c,a,d,e,f)}R&&(200<=a&&300>a?R.put(O,[a,c,xd(d),e,f]):R.remove(O));b?h.$applyAsync(g):(g(),h.$$phase||h.$apply())}function m(a,b,d,e,f){b=-1<=b?b:0;(200<=b&&300>b?L.resolve:L.reject)({data:a,status:b,headers:yd(d),config:c,statusText:e,xhrStatus:f})}function s(a){m(a.data,a.status,ja(a.headers()),a.statusText,a.xhrStatus)}function v(){var a=n.pendingRequests.indexOf(c);-1!==a&&n.pendingRequests.splice(a,1)}var L=l.defer(),u=L.promise,R,q,ma=c.headers,x="jsonp"===K(c.method),
|
||||
O=c.url;x?O=p.getTrustedResourceUrl(O):A(O)||(O=p.valueOf(O));O=G(O,c.paramSerializer(c.params));x&&(O=t(O,c.jsonpCallbackParam));n.pendingRequests.push(c);u.then(v,v);!c.cache&&!a.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(R=D(c.cache)?c.cache:D(a.cache)?a.cache:N);R&&(q=R.get(O),w(q)?q&&B(q.then)?q.then(s,s):H(q)?m(q[1],q[0],ja(q[2]),q[3],q[4]):m(q,200,{},"OK","complete"):R.put(O,u));z(q)&&((q=jc(c.url)?g()[c.xsrfCookieName||a.xsrfCookieName]:void 0)&&(ma[c.xsrfHeaderName||a.xsrfHeaderName]=
|
||||
q),f(c.method,O,d,k,ma,c.timeout,c.withCredentials,c.responseType,e(c.eventHandlers),e(c.uploadEventHandlers)));return u}function G(a,b){0<b.length&&(a+=(-1===a.indexOf("?")?"?":"&")+b);return a}function t(a,b){var c=a.split("?");if(2<c.length)throw Kb("badjsonp",a);c=gc(c[1]);r(c,function(c,d){if("JSON_CALLBACK"===c)throw Kb("badjsonp",a);if(d===b)throw Kb("badjsonp",b,a);});return a+=(-1===a.indexOf("?")?"?":"&")+b+"=JSON_CALLBACK"}var N=k("$http");a.paramSerializer=A(a.paramSerializer)?m.get(a.paramSerializer):
|
||||
a.paramSerializer;var v=[];r(d,function(a){v.unshift(A(a)?m.get(a):m.invoke(a))});var jc=Jg(c);n.pendingRequests=[];(function(a){r(arguments,function(a){n[a]=function(b,c){return n(S({},c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){r(arguments,function(a){n[a]=function(b,c,d){return n(S({},d||{},{method:a,url:b,data:c}))}})})("post","put","patch");n.defaults=a;return n}]}function Rf(){this.$get=function(){return function(){return new C.XMLHttpRequest}}}function Qf(){this.$get=
|
||||
["$browser","$jsonpCallbacks","$document","$xhrFactory",function(a,b,d,c){return Kg(a,c,a.defer,b,d[0])}]}function Kg(a,b,d,c,e){function f(a,b,d){a=a.replace("JSON_CALLBACK",b);var f=e.createElement("script"),m=null;f.type="text/javascript";f.src=a;f.async=!0;m=function(a){f.removeEventListener("load",m);f.removeEventListener("error",m);e.body.removeChild(f);f=null;var g=-1,s="unknown";a&&("load"!==a.type||c.wasCalled(b)||(a={type:"error"}),s=a.type,g="error"===a.type?404:200);d&&d(g,s)};f.addEventListener("load",
|
||||
m);f.addEventListener("error",m);e.body.appendChild(f);return m}return function(e,k,h,l,m,p,n,s,G,t){function N(a){J="timeout"===a;qa&&qa();y&&y.abort()}function v(a,b,c,e,f,g){w(P)&&d.cancel(P);qa=y=null;a(b,c,e,f,g)}k=k||a.url();if("jsonp"===K(e))var q=c.createCallback(k),qa=f(k,q,function(a,b){var d=200===a&&c.getResponse(q);v(l,a,d,"",b,"complete");c.removeCallback(q)});else{var y=b(e,k),J=!1;y.open(e,k,!0);r(m,function(a,b){w(a)&&y.setRequestHeader(b,a)});y.onload=function(){var a=y.statusText||
|
||||
"",b="response"in y?y.response:y.responseText,c=1223===y.status?204:y.status;0===c&&(c=b?200:"file"===ga(k).protocol?404:0);v(l,c,b,y.getAllResponseHeaders(),a,"complete")};y.onerror=function(){v(l,-1,null,null,"","error")};y.ontimeout=function(){v(l,-1,null,null,"","timeout")};y.onabort=function(){v(l,-1,null,null,"",J?"timeout":"abort")};r(G,function(a,b){y.addEventListener(b,a)});r(t,function(a,b){y.upload.addEventListener(b,a)});n&&(y.withCredentials=!0);if(s)try{y.responseType=s}catch(I){if("json"!==
|
||||
s)throw I;}y.send(z(h)?null:h)}if(0<p)var P=d(function(){N("timeout")},p);else p&&B(p.then)&&p.then(function(){N(w(p.$$timeoutId)?"timeout":"abort")})}}function Kf(){var a="{{",b="}}";this.startSymbol=function(b){return b?(a=b,this):a};this.endSymbol=function(a){return a?(b=a,this):b};this.$get=["$parse","$exceptionHandler","$sce",function(d,c,e){function f(a){return"\\\\\\"+a}function g(c){return c.replace(p,a).replace(n,b)}function k(a,b,c,d){var e=a.$watch(function(a){e();return d(a)},b,c);return e}
|
||||
function h(f,h,n,p){function v(a){try{return a=n&&!r?e.getTrusted(n,a):e.valueOf(a),p&&!w(a)?a:ic(a)}catch(b){c(Ma.interr(f,b))}}var r=n===e.URL||n===e.MEDIA_URL;if(!f.length||-1===f.indexOf(a)){if(h)return;h=g(f);r&&(h=e.getTrusted(n,h));h=ia(h);h.exp=f;h.expressions=[];h.$$watchDelegate=k;return h}p=!!p;for(var q,y,J=0,I=[],P,Q=f.length,M=[],L=[],u;J<Q;)if(-1!==(q=f.indexOf(a,J))&&-1!==(y=f.indexOf(b,q+l)))J!==q&&M.push(g(f.substring(J,q))),J=f.substring(q+l,y),I.push(J),J=y+m,L.push(M.length),
|
||||
M.push("");else{J!==Q&&M.push(g(f.substring(J)));break}u=1===M.length&&1===L.length;var R=r&&u?void 0:v;P=I.map(function(a){return d(a,R)});if(!h||I.length){var x=function(a){for(var b=0,c=I.length;b<c;b++){if(p&&z(a[b]))return;M[L[b]]=a[b]}if(r)return e.getTrusted(n,u?M[0]:M.join(""));n&&1<M.length&&Ma.throwNoconcat(f);return M.join("")};return S(function(a){var b=0,d=I.length,e=Array(d);try{for(;b<d;b++)e[b]=P[b](a);return x(e)}catch(g){c(Ma.interr(f,g))}},{exp:f,expressions:I,$$watchDelegate:function(a,
|
||||
b){var c;return a.$watchGroup(P,function(d,e){var f=x(d);b.call(this,f,d!==e?c:f,a);c=f})}})}}var l=a.length,m=b.length,p=new RegExp(a.replace(/./g,f),"g"),n=new RegExp(b.replace(/./g,f),"g");h.startSymbol=function(){return a};h.endSymbol=function(){return b};return h}]}function Lf(){this.$get=["$$intervalFactory","$window",function(a,b){var d={},c=function(a){b.clearInterval(a);delete d[a]},e=a(function(a,c,e){a=b.setInterval(a,c);d[a]=e;return a},c);e.cancel=function(a){if(!a)return!1;if(!a.hasOwnProperty("$$intervalId"))throw Lg("badprom");
|
||||
if(!d.hasOwnProperty(a.$$intervalId))return!1;a=a.$$intervalId;var b=d[a],e=b.promise;e.$$state&&(e.$$state.pur=!0);b.reject("canceled");c(a);return!0};return e}]}function Mf(){this.$get=["$browser","$q","$$q","$rootScope",function(a,b,d,c){return function(e,f){return function(g,k,h,l){function m(){p?g.apply(null,n):g(s)}var p=4<arguments.length,n=p?Ha.call(arguments,4):[],s=0,G=w(l)&&!l,t=(G?d:b).defer(),r=t.promise;h=w(h)?h:0;r.$$intervalId=e(function(){G?a.defer(m):c.$evalAsync(m);t.notify(s++);
|
||||
0<h&&s>=h&&(t.resolve(s),f(r.$$intervalId));G||c.$apply()},k,t,G);return r}}}]}function Ad(a,b){var d=ga(a);b.$$protocol=d.protocol;b.$$host=d.hostname;b.$$port=fa(d.port)||Mg[d.protocol]||null}function Bd(a,b,d){if(Ng.test(a))throw jb("badpath",a);var c="/"!==a.charAt(0);c&&(a="/"+a);a=ga(a);for(var c=(c&&"/"===a.pathname.charAt(0)?a.pathname.substring(1):a.pathname).split("/"),e=c.length;e--;)c[e]=decodeURIComponent(c[e]),d&&(c[e]=c[e].replace(/\//g,"%2F"));d=c.join("/");b.$$path=d;b.$$search=gc(a.search);
|
||||
b.$$hash=decodeURIComponent(a.hash);b.$$path&&"/"!==b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function xc(a,b){return a.slice(0,b.length)===b}function xa(a,b){if(xc(b,a))return b.substr(a.length)}function Da(a){var b=a.indexOf("#");return-1===b?a:a.substr(0,b)}function yc(a,b,d){this.$$html5=!0;d=d||"";Ad(a,this);this.$$parse=function(a){var d=xa(b,a);if(!A(d))throw jb("ipthprfx",a,b);Bd(d,this,!0);this.$$path||(this.$$path="/");this.$$compose()};this.$$normalizeUrl=function(a){return b+a.substr(1)};
|
||||
this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;w(f=xa(a,c))?(g=f,g=d&&w(f=xa(d,f))?b+(xa("/",f)||f):a+g):w(f=xa(b,c))?g=b+f:b===c+"/"&&(g=b);g&&this.$$parse(g);return!!g}}function zc(a,b,d){Ad(a,this);this.$$parse=function(c){var e=xa(a,c)||xa(b,c),f;z(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",z(e)&&(a=c,this.replace())):(f=xa(d,e),z(f)&&(f=e));Bd(f,this,!1);c=this.$$path;var e=a,g=/^\/[A-Z]:(\/.*)/;xc(f,e)&&(f=f.replace(e,""));g.exec(f)||(c=(f=g.exec(c))?
|
||||
f[1]:c);this.$$path=c;this.$$compose()};this.$$normalizeUrl=function(b){return a+(b?d+b:"")};this.$$parseLinkUrl=function(b,d){return Da(a)===Da(b)?(this.$$parse(b),!0):!1}}function Cd(a,b,d){this.$$html5=!0;zc.apply(this,arguments);this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;a===Da(c)?f=c:(g=xa(b,c))?f=a+d+g:b===c+"/"&&(f=b);f&&this.$$parse(f);return!!f};this.$$normalizeUrl=function(b){return a+d+b}}function Lb(a){return function(){return this[a]}}function Dd(a,
|
||||
b){return function(d){if(z(d))return this[a];this[a]=b(d);this.$$compose();return this}}function Tf(){var a="!",b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return w(b)?(a=b,this):a};this.html5Mode=function(a){if(Ga(a))return b.enabled=a,this;if(D(a)){Ga(a.enabled)&&(b.enabled=a.enabled);Ga(a.requireBase)&&(b.requireBase=a.requireBase);if(Ga(a.rewriteLinks)||A(a.rewriteLinks))b.rewriteLinks=a.rewriteLinks;return this}return b};this.$get=["$rootScope","$browser","$sniffer",
|
||||
"$rootElement","$window",function(d,c,e,f,g){function k(a,b){return a===b||ga(a).href===ga(b).href}function h(a,b,d){var e=m.url(),f=m.$$state;try{c.url(a,b,d),m.$$state=c.state()}catch(g){throw m.url(e),m.$$state=f,g;}}function l(a,b){d.$broadcast("$locationChangeSuccess",m.absUrl(),a,m.$$state,b)}var m,p;p=c.baseHref();var n=c.url(),s;if(b.enabled){if(!p&&b.requireBase)throw jb("nobase");s=n.substring(0,n.indexOf("/",n.indexOf("//")+2))+(p||"/");p=e.history?yc:Cd}else s=Da(n),p=zc;var r=s.substr(0,
|
||||
Da(s).lastIndexOf("/")+1);m=new p(s,r,"#"+a);m.$$parseLinkUrl(n,n);m.$$state=c.state();var t=/^\s*(javascript|mailto):/i;f.on("click",function(a){var e=b.rewriteLinks;if(e&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&2!==a.which&&2!==a.button){for(var g=x(a.target);"a"!==ua(g[0]);)if(g[0]===f[0]||!(g=g.parent())[0])return;if(!A(e)||!z(g.attr(e))){var e=g.prop("href"),h=g.attr("href")||g.attr("xlink:href");D(e)&&"[object SVGAnimatedString]"===e.toString()&&(e=ga(e.animVal).href);t.test(e)||!e||g.attr("target")||
|
||||
a.isDefaultPrevented()||!m.$$parseLinkUrl(e,h)||(a.preventDefault(),m.absUrl()!==c.url()&&d.$apply())}}});m.absUrl()!==n&&c.url(m.absUrl(),!0);var N=!0;c.onUrlChange(function(a,b){xc(a,r)?(d.$evalAsync(function(){var c=m.absUrl(),e=m.$$state,f;m.$$parse(a);m.$$state=b;f=d.$broadcast("$locationChangeStart",a,c,b,e).defaultPrevented;m.absUrl()===a&&(f?(m.$$parse(c),m.$$state=e,h(c,!1,e)):(N=!1,l(c,e)))}),d.$$phase||d.$digest()):g.location.href=a});d.$watch(function(){if(N||m.$$urlUpdatedByLocation){m.$$urlUpdatedByLocation=
|
||||
!1;var a=c.url(),b=m.absUrl(),f=c.state(),g=m.$$replace,n=!k(a,b)||m.$$html5&&e.history&&f!==m.$$state;if(N||n)N=!1,d.$evalAsync(function(){var b=m.absUrl(),c=d.$broadcast("$locationChangeStart",b,a,m.$$state,f).defaultPrevented;m.absUrl()===b&&(c?(m.$$parse(a),m.$$state=f):(n&&h(b,g,f===m.$$state?null:m.$$state),l(a,f)))})}m.$$replace=!1});return m}]}function Uf(){var a=!0,b=this;this.debugEnabled=function(b){return w(b)?(a=b,this):a};this.$get=["$window",function(d){function c(a){cc(a)&&(a.stack&&
|
||||
f?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=d.console||{},e=b[a]||b.log||E;return function(){var a=[];r(arguments,function(b){a.push(c(b))});return Function.prototype.apply.call(e,b,a)}}var f=Ca||/\bEdge\//.test(d.navigator&&d.navigator.userAgent);return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){a&&c.apply(b,
|
||||
arguments)}}()}}]}function Og(a){return a+""}function Pg(a,b){return"undefined"!==typeof a?a:b}function Ed(a,b){return"undefined"===typeof a?b:"undefined"===typeof b?a:a+b}function Qg(a,b){switch(a.type){case q.MemberExpression:if(a.computed)return!1;break;case q.UnaryExpression:return 1;case q.BinaryExpression:return"+"!==a.operator?1:!1;case q.CallExpression:return!1}return void 0===b?Fd:b}function Z(a,b,d){var c,e,f=a.isPure=Qg(a,d);switch(a.type){case q.Program:c=!0;r(a.body,function(a){Z(a.expression,
|
||||
b,f);c=c&&a.expression.constant});a.constant=c;break;case q.Literal:a.constant=!0;a.toWatch=[];break;case q.UnaryExpression:Z(a.argument,b,f);a.constant=a.argument.constant;a.toWatch=a.argument.toWatch;break;case q.BinaryExpression:Z(a.left,b,f);Z(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.left.toWatch.concat(a.right.toWatch);break;case q.LogicalExpression:Z(a.left,b,f);Z(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.constant?[]:[a];break;case q.ConditionalExpression:Z(a.test,
|
||||
b,f);Z(a.alternate,b,f);Z(a.consequent,b,f);a.constant=a.test.constant&&a.alternate.constant&&a.consequent.constant;a.toWatch=a.constant?[]:[a];break;case q.Identifier:a.constant=!1;a.toWatch=[a];break;case q.MemberExpression:Z(a.object,b,f);a.computed&&Z(a.property,b,f);a.constant=a.object.constant&&(!a.computed||a.property.constant);a.toWatch=a.constant?[]:[a];break;case q.CallExpression:c=d=a.filter?!b(a.callee.name).$stateful:!1;e=[];r(a.arguments,function(a){Z(a,b,f);c=c&&a.constant;e.push.apply(e,
|
||||
a.toWatch)});a.constant=c;a.toWatch=d?e:[a];break;case q.AssignmentExpression:Z(a.left,b,f);Z(a.right,b,f);a.constant=a.left.constant&&a.right.constant;a.toWatch=[a];break;case q.ArrayExpression:c=!0;e=[];r(a.elements,function(a){Z(a,b,f);c=c&&a.constant;e.push.apply(e,a.toWatch)});a.constant=c;a.toWatch=e;break;case q.ObjectExpression:c=!0;e=[];r(a.properties,function(a){Z(a.value,b,f);c=c&&a.value.constant;e.push.apply(e,a.value.toWatch);a.computed&&(Z(a.key,b,!1),c=c&&a.key.constant,e.push.apply(e,
|
||||
a.key.toWatch))});a.constant=c;a.toWatch=e;break;case q.ThisExpression:a.constant=!1;a.toWatch=[];break;case q.LocalsExpression:a.constant=!1,a.toWatch=[]}}function Gd(a){if(1===a.length){a=a[0].expression;var b=a.toWatch;return 1!==b.length?b:b[0]!==a?b:void 0}}function Hd(a){return a.type===q.Identifier||a.type===q.MemberExpression}function Id(a){if(1===a.body.length&&Hd(a.body[0].expression))return{type:q.AssignmentExpression,left:a.body[0].expression,right:{type:q.NGValueParameter},operator:"="}}
|
||||
function Jd(a){this.$filter=a}function Kd(a){this.$filter=a}function Mb(a,b,d){this.ast=new q(a,d);this.astCompiler=d.csp?new Kd(b):new Jd(b)}function Ac(a){return B(a.valueOf)?a.valueOf():Rg.call(a)}function Vf(){var a=T(),b={"true":!0,"false":!1,"null":null,undefined:void 0},d,c;this.addLiteral=function(a,c){b[a]=c};this.setIdentifierFns=function(a,b){d=a;c=b;return this};this.$get=["$filter",function(e){function f(b,c){var d,f;switch(typeof b){case "string":return f=b=b.trim(),d=a[f],d||(d=new Nb(G),
|
||||
d=(new Mb(d,e,G)).parse(b),a[f]=p(d)),s(d,c);case "function":return s(b,c);default:return s(E,c)}}function g(a,b,c){return null==a||null==b?a===b:"object"!==typeof a||(a=Ac(a),"object"!==typeof a||c)?a===b||a!==a&&b!==b:!1}function k(a,b,c,d,e){var f=d.inputs,h;if(1===f.length){var k=g,f=f[0];return a.$watch(function(a){var b=f(a);g(b,k,f.isPure)||(h=d(a,void 0,void 0,[b]),k=b&&Ac(b));return h},b,c,e)}for(var l=[],m=[],n=0,p=f.length;n<p;n++)l[n]=g,m[n]=null;return a.$watch(function(a){for(var b=
|
||||
!1,c=0,e=f.length;c<e;c++){var k=f[c](a);if(b||(b=!g(k,l[c],f[c].isPure)))m[c]=k,l[c]=k&&Ac(k)}b&&(h=d(a,void 0,void 0,m));return h},b,c,e)}function h(a,b,c,d,e){function f(){h(m)&&k()}function g(a,b,c,d){m=u&&d?d[0]:n(a,b,c,d);h(m)&&a.$$postDigest(f);return s(m)}var h=d.literal?l:w,k,m,n=d.$$intercepted||d,s=d.$$interceptor||Ta,u=d.inputs&&!n.inputs;g.literal=d.literal;g.constant=d.constant;g.inputs=d.inputs;p(g);return k=a.$watch(g,b,c,e)}function l(a){var b=!0;r(a,function(a){w(a)||(b=!1)});return b}
|
||||
function m(a,b,c,d){var e=a.$watch(function(a){e();return d(a)},b,c);return e}function p(a){a.constant?a.$$watchDelegate=m:a.oneTime?a.$$watchDelegate=h:a.inputs&&(a.$$watchDelegate=k);return a}function n(a,b){function c(d){return b(a(d))}c.$stateful=a.$stateful||b.$stateful;c.$$pure=a.$$pure&&b.$$pure;return c}function s(a,b){if(!b)return a;a.$$interceptor&&(b=n(a.$$interceptor,b),a=a.$$intercepted);var c=!1,d=function(d,e,f,g){d=c&&g?g[0]:a(d,e,f,g);return b(d)};d.$$intercepted=a;d.$$interceptor=
|
||||
b;d.literal=a.literal;d.oneTime=a.oneTime;d.constant=a.constant;b.$stateful||(c=!a.inputs,d.inputs=a.inputs?a.inputs:[a],b.$$pure||(d.inputs=d.inputs.map(function(a){return a.isPure===Fd?function(b){return a(b)}:a})));return p(d)}var G={csp:Aa().noUnsafeEval,literals:Ia(b),isIdentifierStart:B(d)&&d,isIdentifierContinue:B(c)&&c};f.$$getAst=function(a){var b=new Nb(G);return(new Mb(b,e,G)).getAst(a).ast};return f}]}function Xf(){var a=!0;this.$get=["$rootScope","$exceptionHandler",function(b,d){return Ld(function(a){b.$evalAsync(a)},
|
||||
d,a)}];this.errorOnUnhandledRejections=function(b){return w(b)?(a=b,this):a}}function Yf(){var a=!0;this.$get=["$browser","$exceptionHandler",function(b,d){return Ld(function(a){b.defer(a)},d,a)}];this.errorOnUnhandledRejections=function(b){return w(b)?(a=b,this):a}}function Ld(a,b,d){function c(){return new e}function e(){var a=this.promise=new f;this.resolve=function(b){h(a,b)};this.reject=function(b){m(a,b)};this.notify=function(b){n(a,b)}}function f(){this.$$state={status:0}}function g(){for(;!w&&
|
||||
x.length;){var a=x.shift();if(!a.pur){a.pur=!0;var c=a.value,c="Possibly unhandled rejection: "+("function"===typeof c?c.toString().replace(/ \{[\s\S]*$/,""):z(c)?"undefined":"string"!==typeof c?Ie(c,void 0):c);cc(a.value)?b(a.value,c):b(c)}}}function k(c){!d||c.pending||2!==c.status||c.pur||(0===w&&0===x.length&&a(g),x.push(c));!c.processScheduled&&c.pending&&(c.processScheduled=!0,++w,a(function(){var e,f,k;k=c.pending;c.processScheduled=!1;c.pending=void 0;try{for(var l=0,n=k.length;l<n;++l){c.pur=
|
||||
!0;f=k[l][0];e=k[l][c.status];try{B(e)?h(f,e(c.value)):1===c.status?h(f,c.value):m(f,c.value)}catch(p){m(f,p),p&&!0===p.$$passToExceptionHandler&&b(p)}}}finally{--w,d&&0===w&&a(g)}}))}function h(a,b){a.$$state.status||(b===a?p(a,v("qcycle",b)):l(a,b))}function l(a,b){function c(b){g||(g=!0,l(a,b))}function d(b){g||(g=!0,p(a,b))}function e(b){n(a,b)}var f,g=!1;try{if(D(b)||B(b))f=b.then;B(f)?(a.$$state.status=-1,f.call(b,c,d,e)):(a.$$state.value=b,a.$$state.status=1,k(a.$$state))}catch(h){d(h)}}function m(a,
|
||||
b){a.$$state.status||p(a,b)}function p(a,b){a.$$state.value=b;a.$$state.status=2;k(a.$$state)}function n(c,d){var e=c.$$state.pending;0>=c.$$state.status&&e&&e.length&&a(function(){for(var a,c,f=0,g=e.length;f<g;f++){c=e[f][0];a=e[f][3];try{n(c,B(a)?a(d):d)}catch(h){b(h)}}})}function s(a){var b=new f;m(b,a);return b}function G(a,b,c){var d=null;try{B(c)&&(d=c())}catch(e){return s(e)}return d&&B(d.then)?d.then(function(){return b(a)},s):b(a)}function t(a,b,c,d){var e=new f;h(e,a);return e.then(b,c,
|
||||
d)}function q(a){if(!B(a))throw v("norslvr",a);var b=new f;a(function(a){h(b,a)},function(a){m(b,a)});return b}var v=F("$q",TypeError),w=0,x=[];S(f.prototype,{then:function(a,b,c){if(z(a)&&z(b)&&z(c))return this;var d=new f;this.$$state.pending=this.$$state.pending||[];this.$$state.pending.push([d,a,b,c]);0<this.$$state.status&&k(this.$$state);return d},"catch":function(a){return this.then(null,a)},"finally":function(a,b){return this.then(function(b){return G(b,y,a)},function(b){return G(b,s,a)},
|
||||
b)}});var y=t;q.prototype=f.prototype;q.defer=c;q.reject=s;q.when=t;q.resolve=y;q.all=function(a){var b=new f,c=0,d=H(a)?[]:{};r(a,function(a,e){c++;t(a).then(function(a){d[e]=a;--c||h(b,d)},function(a){m(b,a)})});0===c&&h(b,d);return b};q.race=function(a){var b=c();r(a,function(a){t(a).then(b.resolve,b.reject)});return b.promise};return q}function hg(){this.$get=["$window","$timeout",function(a,b){var d=a.requestAnimationFrame||a.webkitRequestAnimationFrame,c=a.cancelAnimationFrame||a.webkitCancelAnimationFrame||
|
||||
a.webkitCancelRequestAnimationFrame,e=!!d,f=e?function(a){var b=d(a);return function(){c(b)}}:function(a){var c=b(a,16.66,!1);return function(){b.cancel(c)}};f.supported=e;return f}]}function Wf(){function a(a){function b(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$id=++pb;this.$$ChildScope=null;this.$$suspended=!1}b.prototype=a;return b}var b=10,d=F("$rootScope"),c=null,e=null;this.digestTtl=
|
||||
function(a){arguments.length&&(b=a);return b};this.$get=["$exceptionHandler","$parse","$browser",function(f,g,k){function h(a){a.currentScope.$$destroyed=!0}function l(a){9===Ca&&(a.$$childHead&&l(a.$$childHead),a.$$nextSibling&&l(a.$$nextSibling));a.$parent=a.$$nextSibling=a.$$prevSibling=a.$$childHead=a.$$childTail=a.$root=a.$$watchers=null}function m(){this.$id=++pb;this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this.$root=
|
||||
this;this.$$suspended=this.$$destroyed=!1;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$$isolateBindings=null}function p(a){if(v.$$phase)throw d("inprog",v.$$phase);v.$$phase=a}function n(a,b){do a.$$watchersCount+=b;while(a=a.$parent)}function s(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function G(){}function t(){for(;y.length;)try{y.shift()()}catch(a){f(a)}e=null}function q(){null===e&&(e=k.defer(function(){v.$apply(t)},
|
||||
null,"$applyAsync"))}m.prototype={constructor:m,$new:function(b,c){var d;c=c||this;b?(d=new m,d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=a(this)),d=new this.$$ChildScope);d.$parent=c;d.$$prevSibling=c.$$childTail;c.$$childHead?(c.$$childTail.$$nextSibling=d,c.$$childTail=d):c.$$childHead=c.$$childTail=d;(b||c!==this)&&d.$on("$destroy",h);return d},$watch:function(a,b,d,e){var f=g(a);b=B(b)?b:E;if(f.$$watchDelegate)return f.$$watchDelegate(this,b,d,f,a);var h=this,k=h.$$watchers,l=
|
||||
{fn:b,last:G,get:f,exp:e||a,eq:!!d};c=null;k||(k=h.$$watchers=[],k.$$digestWatchIndex=-1);k.unshift(l);k.$$digestWatchIndex++;n(this,1);return function(){var a=cb(k,l);0<=a&&(n(h,-1),a<k.$$digestWatchIndex&&k.$$digestWatchIndex--);c=null}},$watchGroup:function(a,b){function c(){h=!1;try{k?(k=!1,b(e,e,g)):b(e,d,g)}finally{for(var f=0;f<a.length;f++)d[f]=e[f]}}var d=Array(a.length),e=Array(a.length),f=[],g=this,h=!1,k=!0;if(!a.length){var l=!0;g.$evalAsync(function(){l&&b(e,e,g)});return function(){l=
|
||||
!1}}if(1===a.length)return this.$watch(a[0],function(a,c,f){e[0]=a;d[0]=c;b(e,a===c?e:d,f)});r(a,function(a,b){var d=g.$watch(a,function(a){e[b]=a;h||(h=!0,g.$evalAsync(c))});f.push(d)});return function(){for(;f.length;)f.shift()()}},$watchCollection:function(a,b){function c(a){e=a;var b,d,g,h;if(!z(e)){if(D(e))if(ya(e))for(f!==n&&(f=n,t=f.length=0,l++),a=e.length,t!==a&&(l++,f.length=t=a),b=0;b<a;b++)h=f[b],g=e[b],d=h!==h&&g!==g,d||h===g||(l++,f[b]=g);else{f!==p&&(f=p={},t=0,l++);a=0;for(b in e)ta.call(e,
|
||||
b)&&(a++,g=e[b],h=f[b],b in f?(d=h!==h&&g!==g,d||h===g||(l++,f[b]=g)):(t++,f[b]=g,l++));if(t>a)for(b in l++,f)ta.call(e,b)||(t--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$$pure=g(a).literal;c.$stateful=!c.$$pure;var d=this,e,f,h,k=1<b.length,l=0,m=g(a,c),n=[],p={},s=!0,t=0;return this.$watch(m,function(){s?(s=!1,b(e,e,d)):b(e,h,d);if(k)if(D(e))if(ya(e)){h=Array(e.length);for(var a=0;a<e.length;a++)h[a]=e[a]}else for(a in h={},e)ta.call(e,a)&&(h[a]=e[a]);else h=e})},$digest:function(){var a,
|
||||
g,h,l,m,n,s,r=b,q,y=w.length?v:this,N=[],z,A;p("$digest");k.$$checkUrlChange();this===v&&null!==e&&(k.defer.cancel(e),t());c=null;do{s=!1;q=y;for(n=0;n<w.length;n++){try{A=w[n],l=A.fn,l(A.scope,A.locals)}catch(C){f(C)}c=null}w.length=0;a:do{if(n=!q.$$suspended&&q.$$watchers)for(n.$$digestWatchIndex=n.length;n.$$digestWatchIndex--;)try{if(a=n[n.$$digestWatchIndex])if(m=a.get,(g=m(q))!==(h=a.last)&&!(a.eq?va(g,h):X(g)&&X(h)))s=!0,c=a,a.last=a.eq?Ia(g,null):g,l=a.fn,l(g,h===G?g:h,q),5>r&&(z=4-r,N[z]||
|
||||
(N[z]=[]),N[z].push({msg:B(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,newVal:g,oldVal:h}));else if(a===c){s=!1;break a}}catch(E){f(E)}if(!(n=!q.$$suspended&&q.$$watchersCount&&q.$$childHead||q!==y&&q.$$nextSibling))for(;q!==y&&!(n=q.$$nextSibling);)q=q.$parent}while(q=n);if((s||w.length)&&!r--)throw v.$$phase=null,d("infdig",b,N);}while(s||w.length);for(v.$$phase=null;J<x.length;)try{x[J++]()}catch(D){f(D)}x.length=J=0;k.$$checkUrlChange()},$suspend:function(){this.$$suspended=!0},$isSuspended:function(){return this.$$suspended},
|
||||
$resume:function(){this.$$suspended=!1},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this===v&&k.$$applicationDestroyed();n(this,-this.$$watchersCount);for(var b in this.$$listenerCount)s(this,this.$$listenerCount[b],b);a&&a.$$childHead===this&&(a.$$childHead=this.$$nextSibling);a&&a.$$childTail===this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=
|
||||
this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=E;this.$on=this.$watch=this.$watchGroup=function(){return E};this.$$listeners={};this.$$nextSibling=null;l(this)}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a,b){v.$$phase||w.length||k.defer(function(){w.length&&v.$digest()},null,"$evalAsync");w.push({scope:this,fn:g(a),locals:b})},$$postDigest:function(a){x.push(a)},$apply:function(a){try{p("$apply");try{return this.$eval(a)}finally{v.$$phase=
|
||||
null}}catch(b){f(b)}finally{try{v.$digest()}catch(c){throw f(c),c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&y.push(b);a=g(a);q()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(delete c[d],s(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,g=!1,h={name:a,targetScope:e,stopPropagation:function(){g=
|
||||
!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},k=db([h],arguments,1),l,m;do{d=e.$$listeners[a]||c;h.currentScope=e;l=0;for(m=d.length;l<m;l++)if(d[l])try{d[l].apply(null,k)}catch(n){f(n)}else d.splice(l,1),l--,m--;if(g)break;e=e.$parent}while(e);h.currentScope=null;return h},$broadcast:function(a,b){var c=this,d=this,e={name:a,targetScope:this,preventDefault:function(){e.defaultPrevented=!0},defaultPrevented:!1};if(!this.$$listenerCount[a])return e;for(var g=db([e],arguments,
|
||||
1),h,k;c=d;){e.currentScope=c;d=c.$$listeners[a]||[];h=0;for(k=d.length;h<k;h++)if(d[h])try{d[h].apply(null,g)}catch(l){f(l)}else d.splice(h,1),h--,k--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}e.currentScope=null;return e}};var v=new m,w=v.$$asyncQueue=[],x=v.$$postDigestQueue=[],y=v.$$applyAsyncQueue=[],J=0;return v}]}function Le(){var a=/^\s*(https?|s?ftp|mailto|tel|file):/,b=/^\s*((https?|ftp|file|blob):|data:image\/)/;
|
||||
this.aHrefSanitizationWhitelist=function(b){return w(b)?(a=b,this):a};this.imgSrcSanitizationWhitelist=function(a){return w(a)?(b=a,this):b};this.$get=function(){return function(d,c){var e=c?b:a,f=ga(d&&d.trim()).href;return""===f||f.match(e)?d:"unsafe:"+f}}}function Sg(a){if("self"===a)return a;if(A(a)){if(-1<a.indexOf("***"))throw Ea("iwcard",a);a=Md(a).replace(/\\\*\\\*/g,".*").replace(/\\\*/g,"[^:/.?&;]*");return new RegExp("^"+a+"$")}if(ab(a))return new RegExp("^"+a.source+"$");throw Ea("imatcher");
|
||||
}function Nd(a){var b=[];w(a)&&r(a,function(a){b.push(Sg(a))});return b}function $f(){this.SCE_CONTEXTS=V;var a=["self"],b=[];this.resourceUrlWhitelist=function(b){arguments.length&&(a=Nd(b));return a};this.resourceUrlBlacklist=function(a){arguments.length&&(b=Nd(a));return b};this.$get=["$injector","$$sanitizeUri",function(d,c){function e(a,b){var c;"self"===a?(c=Bc(b,Od))||(C.document.baseURI?c=C.document.baseURI:(Na||(Na=C.document.createElement("a"),Na.href=".",Na=Na.cloneNode(!1)),c=Na.href),
|
||||
c=Bc(b,c)):c=!!a.exec(b.href);return c}function f(a){var b=function(a){this.$$unwrapTrustedValue=function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()};b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()};return b}var g=function(a){throw Ea("unsafe");};d.has("$sanitize")&&(g=d.get("$sanitize"));var k=f(),h={};h[V.HTML]=f(k);h[V.CSS]=f(k);h[V.MEDIA_URL]=f(k);h[V.URL]=f(h[V.MEDIA_URL]);h[V.JS]=f(k);h[V.RESOURCE_URL]=
|
||||
f(h[V.URL]);return{trustAs:function(a,b){var c=h.hasOwnProperty(a)?h[a]:null;if(!c)throw Ea("icontext",a,b);if(null===b||z(b)||""===b)return b;if("string"!==typeof b)throw Ea("itype",a);return new c(b)},getTrusted:function(d,f){if(null===f||z(f)||""===f)return f;var k=h.hasOwnProperty(d)?h[d]:null;if(k&&f instanceof k)return f.$$unwrapTrustedValue();B(f.$$unwrapTrustedValue)&&(f=f.$$unwrapTrustedValue());if(d===V.MEDIA_URL||d===V.URL)return c(f.toString(),d===V.MEDIA_URL);if(d===V.RESOURCE_URL){var k=
|
||||
ga(f.toString()),n,s,r=!1;n=0;for(s=a.length;n<s;n++)if(e(a[n],k)){r=!0;break}if(r)for(n=0,s=b.length;n<s;n++)if(e(b[n],k)){r=!1;break}if(r)return f;throw Ea("insecurl",f.toString());}if(d===V.HTML)return g(f);throw Ea("unsafe");},valueOf:function(a){return a instanceof k?a.$$unwrapTrustedValue():a}}}]}function Zf(){var a=!0;this.enabled=function(b){arguments.length&&(a=!!b);return a};this.$get=["$parse","$sceDelegate",function(b,d){if(a&&8>Ca)throw Ea("iequirks");var c=ja(V);c.isEnabled=function(){return a};
|
||||
c.trustAs=d.trustAs;c.getTrusted=d.getTrusted;c.valueOf=d.valueOf;a||(c.trustAs=c.getTrusted=function(a,b){return b},c.valueOf=Ta);c.parseAs=function(a,d){var e=b(d);return e.literal&&e.constant?e:b(d,function(b){return c.getTrusted(a,b)})};var e=c.parseAs,f=c.getTrusted,g=c.trustAs;r(V,function(a,b){var d=K(b);c[("parse_as_"+d).replace(Cc,wb)]=function(b){return e(a,b)};c[("get_trusted_"+d).replace(Cc,wb)]=function(b){return f(a,b)};c[("trust_as_"+d).replace(Cc,wb)]=function(b){return g(a,b)}});
|
||||
return c}]}function ag(){this.$get=["$window","$document",function(a,b){var d={},c=!((!a.nw||!a.nw.process)&&a.chrome&&(a.chrome.app&&a.chrome.app.runtime||!a.chrome.app&&a.chrome.runtime&&a.chrome.runtime.id))&&a.history&&a.history.pushState,e=fa((/android (\d+)/.exec(K((a.navigator||{}).userAgent))||[])[1]),f=/Boxee/i.test((a.navigator||{}).userAgent),g=b[0]||{},k=g.body&&g.body.style,h=!1,l=!1;k&&(h=!!("transition"in k||"webkitTransition"in k),l=!!("animation"in k||"webkitAnimation"in k));return{history:!(!c||
|
||||
4>e||f),hasEvent:function(a){if("input"===a&&Ca)return!1;if(z(d[a])){var b=g.createElement("div");d[a]="on"+a in b}return d[a]},csp:Aa(),transitions:h,animations:l,android:e}}]}function bg(){this.$get=ia(function(a){return new Tg(a)})}function Tg(a){function b(){var a=e.pop();return a&&a.cb}function d(a){for(var b=e.length-1;0<=b;--b){var c=e[b];if(c.type===a)return e.splice(b,1),c.cb}}var c={},e=[],f=this.ALL_TASKS_TYPE="$$all$$",g=this.DEFAULT_TASK_TYPE="$$default$$";this.completeTask=function(e,
|
||||
h){h=h||g;try{e()}finally{var l;l=h||g;c[l]&&(c[l]--,c[f]--);l=c[h];var m=c[f];if(!m||!l)for(l=m?d:b;m=l(h);)try{m()}catch(p){a.error(p)}}};this.incTaskCount=function(a){a=a||g;c[a]=(c[a]||0)+1;c[f]=(c[f]||0)+1};this.notifyWhenNoPendingTasks=function(a,b){b=b||f;c[b]?e.push({type:b,cb:a}):a()}}function dg(){var a;this.httpOptions=function(b){return b?(a=b,this):a};this.$get=["$exceptionHandler","$templateCache","$http","$q","$sce",function(b,d,c,e,f){function g(k,h){g.totalPendingRequests++;if(!A(k)||
|
||||
z(d.get(k)))k=f.getTrustedResourceUrl(k);var l=c.defaults&&c.defaults.transformResponse;H(l)?l=l.filter(function(a){return a!==vc}):l===vc&&(l=null);return c.get(k,S({cache:d,transformResponse:l},a)).finally(function(){g.totalPendingRequests--}).then(function(a){return d.put(k,a.data)},function(a){h||(a=Ug("tpload",k,a.status,a.statusText),b(a));return e.reject(a)})}g.totalPendingRequests=0;return g}]}function eg(){this.$get=["$rootScope","$browser","$location",function(a,b,d){return{findBindings:function(a,
|
||||
b,d){a=a.getElementsByClassName("ng-binding");var g=[];r(a,function(a){var c=ca.element(a).data("$binding");c&&r(c,function(c){d?(new RegExp("(^|\\s)"+Md(b)+"(\\s|\\||$)")).test(c)&&g.push(a):-1!==c.indexOf(b)&&g.push(a)})});return g},findModels:function(a,b,d){for(var g=["ng-","data-ng-","ng\\:"],k=0;k<g.length;++k){var h=a.querySelectorAll("["+g[k]+"model"+(d?"=":"*=")+'"'+b+'"]');if(h.length)return h}},getLocation:function(){return d.url()},setLocation:function(b){b!==d.url()&&(d.url(b),a.$digest())},
|
||||
whenStable:function(a){b.notifyWhenNoOutstandingRequests(a)}}}]}function fg(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function(a,b,d,c,e){function f(f,h,l){B(f)||(l=h,h=f,f=E);var m=Ha.call(arguments,3),p=w(l)&&!l,n=(p?c:d).defer(),s=n.promise,r;r=b.defer(function(){try{n.resolve(f.apply(null,m))}catch(b){n.reject(b),e(b)}finally{delete g[s.$$timeoutId]}p||a.$apply()},h,"$timeout");s.$$timeoutId=r;g[r]=n;return s}var g={};f.cancel=function(a){if(!a)return!1;if(!a.hasOwnProperty("$$timeoutId"))throw Vg("badprom");
|
||||
if(!g.hasOwnProperty(a.$$timeoutId))return!1;a=a.$$timeoutId;var c=g[a],d=c.promise;d.$$state&&(d.$$state.pur=!0);c.reject("canceled");delete g[a];return b.defer.cancel(a)};return f}]}function ga(a){if(!A(a))return a;Ca&&(aa.setAttribute("href",a),a=aa.href);aa.setAttribute("href",a);a=aa.hostname;!Wg&&-1<a.indexOf(":")&&(a="["+a+"]");return{href:aa.href,protocol:aa.protocol?aa.protocol.replace(/:$/,""):"",host:aa.host,search:aa.search?aa.search.replace(/^\?/,""):"",hash:aa.hash?aa.hash.replace(/^#/,
|
||||
""):"",hostname:a,port:aa.port,pathname:"/"===aa.pathname.charAt(0)?aa.pathname:"/"+aa.pathname}}function Jg(a){var b=[Od].concat(a.map(ga));return function(a){a=ga(a);return b.some(Bc.bind(null,a))}}function Bc(a,b){a=ga(a);b=ga(b);return a.protocol===b.protocol&&a.host===b.host}function gg(){this.$get=ia(C)}function Pd(a){function b(a){try{return decodeURIComponent(a)}catch(b){return a}}var d=a[0]||{},c={},e="";return function(){var a,g,k,h,l;try{a=d.cookie||""}catch(m){a=""}if(a!==e)for(e=a,a=
|
||||
e.split("; "),c={},k=0;k<a.length;k++)g=a[k],h=g.indexOf("="),0<h&&(l=b(g.substring(0,h)),z(c[l])&&(c[l]=b(g.substring(h+1))));return c}}function kg(){this.$get=Pd}function dd(a){function b(d,c){if(D(d)){var e={};r(d,function(a,c){e[c]=b(c,a)});return e}return a.factory(d+"Filter",c)}this.register=b;this.$get=["$injector",function(a){return function(b){return a.get(b+"Filter")}}];b("currency",Qd);b("date",Rd);b("filter",Xg);b("json",Yg);b("limitTo",Zg);b("lowercase",$g);b("number",Sd);b("orderBy",
|
||||
Td);b("uppercase",ah)}function Xg(){return function(a,b,d,c){if(!ya(a)){if(null==a)return a;throw F("filter")("notarray",a);}c=c||"$";var e;switch(Dc(b)){case "function":break;case "boolean":case "null":case "number":case "string":e=!0;case "object":b=bh(b,d,c,e);break;default:return a}return Array.prototype.filter.call(a,b)}}function bh(a,b,d,c){var e=D(a)&&d in a;!0===b?b=va:B(b)||(b=function(a,b){if(z(a))return!1;if(null===a||null===b)return a===b;if(D(b)||D(a)&&!bc(a))return!1;a=K(""+a);b=K(""+
|
||||
b);return-1!==a.indexOf(b)});return function(f){return e&&!D(f)?Fa(f,a[d],b,d,!1):Fa(f,a,b,d,c)}}function Fa(a,b,d,c,e,f){var g=Dc(a),k=Dc(b);if("string"===k&&"!"===b.charAt(0))return!Fa(a,b.substring(1),d,c,e);if(H(a))return a.some(function(a){return Fa(a,b,d,c,e)});switch(g){case "object":var h;if(e){for(h in a)if(h.charAt&&"$"!==h.charAt(0)&&Fa(a[h],b,d,c,!0))return!0;return f?!1:Fa(a,b,d,c,!1)}if("object"===k){for(h in b)if(f=b[h],!B(f)&&!z(f)&&(g=h===c,!Fa(g?a:a[h],f,d,c,g,g)))return!1;return!0}return d(a,
|
||||
b);case "function":return!1;default:return d(a,b)}}function Dc(a){return null===a?"null":typeof a}function Qd(a){var b=a.NUMBER_FORMATS;return function(a,c,e){z(c)&&(c=b.CURRENCY_SYM);z(e)&&(e=b.PATTERNS[1].maxFrac);var f=c?/\u00A4/g:/\s*\u00A4\s*/g;return null==a?a:Ud(a,b.PATTERNS[1],b.GROUP_SEP,b.DECIMAL_SEP,e).replace(f,c)}}function Sd(a){var b=a.NUMBER_FORMATS;return function(a,c){return null==a?a:Ud(a,b.PATTERNS[0],b.GROUP_SEP,b.DECIMAL_SEP,c)}}function ch(a){var b=0,d,c,e,f,g;-1<(c=a.indexOf(Vd))&&
|
||||
(a=a.replace(Vd,""));0<(e=a.search(/e/i))?(0>c&&(c=e),c+=+a.slice(e+1),a=a.substring(0,e)):0>c&&(c=a.length);for(e=0;a.charAt(e)===Ec;e++);if(e===(g=a.length))d=[0],c=1;else{for(g--;a.charAt(g)===Ec;)g--;c-=e;d=[];for(f=0;e<=g;e++,f++)d[f]=+a.charAt(e)}c>Wd&&(d=d.splice(0,Wd-1),b=c-1,c=1);return{d:d,e:b,i:c}}function dh(a,b,d,c){var e=a.d,f=e.length-a.i;b=z(b)?Math.min(Math.max(d,f),c):+b;d=b+a.i;c=e[d];if(0<d){e.splice(Math.max(a.i,d));for(var g=d;g<e.length;g++)e[g]=0}else for(f=Math.max(0,f),a.i=
|
||||
1,e.length=Math.max(1,d=b+1),e[0]=0,g=1;g<d;g++)e[g]=0;if(5<=c)if(0>d-1){for(c=0;c>d;c--)e.unshift(0),a.i++;e.unshift(1);a.i++}else e[d-1]++;for(;f<Math.max(0,b);f++)e.push(0);if(b=e.reduceRight(function(a,b,c,d){b+=a;d[c]=b%10;return Math.floor(b/10)},0))e.unshift(b),a.i++}function Ud(a,b,d,c,e){if(!A(a)&&!W(a)||isNaN(a))return"";var f=!isFinite(a),g=!1,k=Math.abs(a)+"",h="";if(f)h="\u221e";else{g=ch(k);dh(g,e,b.minFrac,b.maxFrac);h=g.d;k=g.i;e=g.e;f=[];for(g=h.reduce(function(a,b){return a&&!b},
|
||||
!0);0>k;)h.unshift(0),k++;0<k?f=h.splice(k,h.length):(f=h,h=[0]);k=[];for(h.length>=b.lgSize&&k.unshift(h.splice(-b.lgSize,h.length).join(""));h.length>b.gSize;)k.unshift(h.splice(-b.gSize,h.length).join(""));h.length&&k.unshift(h.join(""));h=k.join(d);f.length&&(h+=c+f.join(""));e&&(h+="e+"+e)}return 0>a&&!g?b.negPre+h+b.negSuf:b.posPre+h+b.posSuf}function Ob(a,b,d,c){var e="";if(0>a||c&&0>=a)c?a=-a+1:(a=-a,e="-");for(a=""+a;a.length<b;)a=Ec+a;d&&(a=a.substr(a.length-b));return e+a}function ea(a,
|
||||
b,d,c,e){d=d||0;return function(f){f=f["get"+a]();if(0<d||f>-d)f+=d;0===f&&-12===d&&(f=12);return Ob(f,b,c,e)}}function kb(a,b,d){return function(c,e){var f=c["get"+a](),g=ub((d?"STANDALONE":"")+(b?"SHORT":"")+a);return e[g][f]}}function Xd(a){var b=(new Date(a,0,1)).getDay();return new Date(a,0,(4>=b?5:12)-b)}function Yd(a){return function(b){var d=Xd(b.getFullYear());b=+new Date(b.getFullYear(),b.getMonth(),b.getDate()+(4-b.getDay()))-+d;b=1+Math.round(b/6048E5);return Ob(b,a)}}function Fc(a,b){return 0>=
|
||||
a.getFullYear()?b.ERAS[0]:b.ERAS[1]}function Rd(a){function b(a){var b;if(b=a.match(d)){a=new Date(0);var f=0,g=0,k=b[8]?a.setUTCFullYear:a.setFullYear,h=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=fa(b[9]+b[10]),g=fa(b[9]+b[11]));k.call(a,fa(b[1]),fa(b[2])-1,fa(b[3]));f=fa(b[4]||0)-f;g=fa(b[5]||0)-g;k=fa(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));h.call(a,f,g,k,b)}return a}var d=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,
|
||||
d,f){var g="",k=[],h,l;d=d||"mediumDate";d=a.DATETIME_FORMATS[d]||d;A(c)&&(c=eh.test(c)?fa(c):b(c));W(c)&&(c=new Date(c));if(!ha(c)||!isFinite(c.getTime()))return c;for(;d;)(l=fh.exec(d))?(k=db(k,l,1),d=k.pop()):(k.push(d),d=null);var m=c.getTimezoneOffset();f&&(m=ec(f,m),c=fc(c,f,!0));r(k,function(b){h=gh[b];g+=h?h(c,a.DATETIME_FORMATS,m):"''"===b?"'":b.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function Yg(){return function(a,b){z(b)&&(b=2);return eb(a,b)}}function Zg(){return function(a,
|
||||
b,d){b=Infinity===Math.abs(Number(b))?Number(b):fa(b);if(X(b))return a;W(a)&&(a=a.toString());if(!ya(a))return a;d=!d||isNaN(d)?0:fa(d);d=0>d?Math.max(0,a.length+d):d;return 0<=b?Gc(a,d,d+b):0===d?Gc(a,b,a.length):Gc(a,Math.max(0,d+b),d)}}function Gc(a,b,d){return A(a)?a.slice(b,d):Ha.call(a,b,d)}function Td(a){function b(b){return b.map(function(b){var c=1,d=Ta;if(B(b))d=b;else if(A(b)){if("+"===b.charAt(0)||"-"===b.charAt(0))c="-"===b.charAt(0)?-1:1,b=b.substring(1);if(""!==b&&(d=a(b),d.constant))var e=
|
||||
d(),d=function(a){return a[e]}}return{get:d,descending:c}})}function d(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}}function c(a,b){var c=0,d=a.type,h=b.type;if(d===h){var h=a.value,l=b.value;"string"===d?(h=h.toLowerCase(),l=l.toLowerCase()):"object"===d&&(D(h)&&(h=a.index),D(l)&&(l=b.index));h!==l&&(c=h<l?-1:1)}else c="undefined"===d?1:"undefined"===h?-1:"null"===d?1:"null"===h?-1:d<h?-1:1;return c}return function(a,f,g,k){if(null==a)return a;if(!ya(a))throw F("orderBy")("notarray",
|
||||
a);H(f)||(f=[f]);0===f.length&&(f=["+"]);var h=b(f),l=g?-1:1,m=B(k)?k:c;a=Array.prototype.map.call(a,function(a,b){return{value:a,tieBreaker:{value:b,type:"number",index:b},predicateValues:h.map(function(c){var e=c.get(a);c=typeof e;if(null===e)c="null";else if("object"===c)a:{if(B(e.valueOf)&&(e=e.valueOf(),d(e)))break a;bc(e)&&(e=e.toString(),d(e))}return{value:e,type:c,index:b}})}});a.sort(function(a,b){for(var d=0,e=h.length;d<e;d++){var f=m(a.predicateValues[d],b.predicateValues[d]);if(f)return f*
|
||||
h[d].descending*l}return(m(a.tieBreaker,b.tieBreaker)||c(a.tieBreaker,b.tieBreaker))*l});return a=a.map(function(a){return a.value})}}function Ra(a){B(a)&&(a={link:a});a.restrict=a.restrict||"AC";return ia(a)}function Pb(a,b,d,c,e){this.$$controls=[];this.$error={};this.$$success={};this.$pending=void 0;this.$name=e(b.name||b.ngForm||"")(d);this.$dirty=!1;this.$valid=this.$pristine=!0;this.$submitted=this.$invalid=!1;this.$$parentForm=lb;this.$$element=a;this.$$animate=c;Zd(this)}function Zd(a){a.$$classCache=
|
||||
{};a.$$classCache[$d]=!(a.$$classCache[mb]=a.$$element.hasClass(mb))}function ae(a){function b(a,b,c){c&&!a.$$classCache[b]?(a.$$animate.addClass(a.$$element,b),a.$$classCache[b]=!0):!c&&a.$$classCache[b]&&(a.$$animate.removeClass(a.$$element,b),a.$$classCache[b]=!1)}function d(a,c,d){c=c?"-"+Vc(c,"-"):"";b(a,mb+c,!0===d);b(a,$d+c,!1===d)}var c=a.set,e=a.unset;a.clazz.prototype.$setValidity=function(a,g,k){z(g)?(this.$pending||(this.$pending={}),c(this.$pending,a,k)):(this.$pending&&e(this.$pending,
|
||||
a,k),be(this.$pending)&&(this.$pending=void 0));Ga(g)?g?(e(this.$error,a,k),c(this.$$success,a,k)):(c(this.$error,a,k),e(this.$$success,a,k)):(e(this.$error,a,k),e(this.$$success,a,k));this.$pending?(b(this,"ng-pending",!0),this.$valid=this.$invalid=void 0,d(this,"",null)):(b(this,"ng-pending",!1),this.$valid=be(this.$error),this.$invalid=!this.$valid,d(this,"",this.$valid));g=this.$pending&&this.$pending[a]?void 0:this.$error[a]?!1:this.$$success[a]?!0:null;d(this,a,g);this.$$parentForm.$setValidity(a,
|
||||
g,this)}}function be(a){if(a)for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}function Hc(a){a.$formatters.push(function(b){return a.$isEmpty(b)?b:b.toString()})}function Sa(a,b,d,c,e,f){var g=K(b[0].type);if(!e.android){var k=!1;b.on("compositionstart",function(){k=!0});b.on("compositionupdate",function(a){if(z(a.data)||""===a.data)k=!1});b.on("compositionend",function(){k=!1;l()})}var h,l=function(a){h&&(f.defer.cancel(h),h=null);if(!k){var e=b.val();a=a&&a.type;"password"===g||d.ngTrim&&
|
||||
"false"===d.ngTrim||(e=U(e));(c.$viewValue!==e||""===e&&c.$$hasNativeValidators)&&c.$setViewValue(e,a)}};if(e.hasEvent("input"))b.on("input",l);else{var m=function(a,b,c){h||(h=f.defer(function(){h=null;b&&b.value===c||l(a)}))};b.on("keydown",function(a){var b=a.keyCode;91===b||15<b&&19>b||37<=b&&40>=b||m(a,this,this.value)});if(e.hasEvent("paste"))b.on("paste cut drop",m)}b.on("change",l);if(ce[g]&&c.$$hasNativeValidators&&g===d.type)b.on("keydown wheel mousedown",function(a){if(!h){var b=this.validity,
|
||||
c=b.badInput,d=b.typeMismatch;h=f.defer(function(){h=null;b.badInput===c&&b.typeMismatch===d||l(a)})}});c.$render=function(){var a=c.$isEmpty(c.$viewValue)?"":c.$viewValue;b.val()!==a&&b.val(a)}}function Qb(a,b){return function(d,c){var e,f;if(ha(d))return d;if(A(d)){'"'===d.charAt(0)&&'"'===d.charAt(d.length-1)&&(d=d.substring(1,d.length-1));if(hh.test(d))return new Date(d);a.lastIndex=0;if(e=a.exec(d))return e.shift(),f=c?{yyyy:c.getFullYear(),MM:c.getMonth()+1,dd:c.getDate(),HH:c.getHours(),mm:c.getMinutes(),
|
||||
ss:c.getSeconds(),sss:c.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},r(e,function(a,c){c<b.length&&(f[b[c]]=+a)}),e=new Date(f.yyyy,f.MM-1,f.dd,f.HH,f.mm,f.ss||0,1E3*f.sss||0),100>f.yyyy&&e.setFullYear(f.yyyy),e}return NaN}}function nb(a,b,d,c){return function(e,f,g,k,h,l,m,p){function n(a){return a&&!(a.getTime&&a.getTime()!==a.getTime())}function s(a){return w(a)&&!ha(a)?r(a)||void 0:a}function r(a,b){var c=k.$options.getOption("timezone");v&&v!==c&&(b=Sc(b,ec(v)));var e=d(a,
|
||||
b);!isNaN(e)&&c&&(e=fc(e,c));return e}Ic(e,f,g,k,a);Sa(e,f,g,k,h,l);var t="time"===a||"datetimelocal"===a,q,v;k.$parsers.push(function(c){if(k.$isEmpty(c))return null;if(b.test(c))return r(c,q);k.$$parserName=a});k.$formatters.push(function(a){if(a&&!ha(a))throw ob("datefmt",a);if(n(a)){q=a;var b=k.$options.getOption("timezone");b&&(v=b,q=fc(q,b,!0));var d=c;t&&A(k.$options.getOption("timeSecondsFormat"))&&(d=c.replace("ss.sss",k.$options.getOption("timeSecondsFormat")).replace(/:$/,""));a=m("date")(a,
|
||||
d,b);t&&k.$options.getOption("timeStripZeroSeconds")&&(a=a.replace(/(?::00)?(?:\.000)?$/,""));return a}v=q=null;return""});if(w(g.min)||g.ngMin){var x=g.min||p(g.ngMin)(e),B=s(x);k.$validators.min=function(a){return!n(a)||z(B)||d(a)>=B};g.$observe("min",function(a){a!==x&&(B=s(a),x=a,k.$validate())})}if(w(g.max)||g.ngMax){var y=g.max||p(g.ngMax)(e),J=s(y);k.$validators.max=function(a){return!n(a)||z(J)||d(a)<=J};g.$observe("max",function(a){a!==y&&(J=s(a),y=a,k.$validate())})}}}function Ic(a,b,d,
|
||||
c,e){(c.$$hasNativeValidators=D(b[0].validity))&&c.$parsers.push(function(a){var d=b.prop("validity")||{};if(d.badInput||d.typeMismatch)c.$$parserName=e;else return a})}function de(a){a.$parsers.push(function(b){if(a.$isEmpty(b))return null;if(ih.test(b))return parseFloat(b);a.$$parserName="number"});a.$formatters.push(function(b){if(!a.$isEmpty(b)){if(!W(b))throw ob("numfmt",b);b=b.toString()}return b})}function na(a){w(a)&&!W(a)&&(a=parseFloat(a));return X(a)?void 0:a}function Jc(a){var b=a.toString(),
|
||||
d=b.indexOf(".");return-1===d?-1<a&&1>a&&(a=/e-(\d+)$/.exec(b))?Number(a[1]):0:b.length-d-1}function ee(a,b,d){a=Number(a);var c=(a|0)!==a,e=(b|0)!==b,f=(d|0)!==d;if(c||e||f){var g=c?Jc(a):0,k=e?Jc(b):0,h=f?Jc(d):0,g=Math.max(g,k,h),g=Math.pow(10,g);a*=g;b*=g;d*=g;c&&(a=Math.round(a));e&&(b=Math.round(b));f&&(d=Math.round(d))}return 0===(a-b)%d}function fe(a,b,d,c,e){if(w(c)){a=a(c);if(!a.constant)throw ob("constexpr",d,c);return a(b)}return e}function Kc(a,b){function d(a,b){if(!a||!a.length)return[];
|
||||
if(!b||!b.length)return a;var c=[],d=0;a:for(;d<a.length;d++){for(var e=a[d],m=0;m<b.length;m++)if(e===b[m])continue a;c.push(e)}return c}function c(a){if(!a)return a;var b=a;H(a)?b=a.map(c).join(" "):D(a)?b=Object.keys(a).filter(function(b){return a[b]}).join(" "):A(a)||(b=a+"");return b}a="ngClass"+a;var e;return["$parse",function(f){return{restrict:"AC",link:function(g,k,h){function l(a,b){var c=[];r(a,function(a){if(0<b||p[a])p[a]=(p[a]||0)+b,p[a]===+(0<b)&&c.push(a)});return c.join(" ")}function m(a){if(a===
|
||||
b){var c=s,c=l(c&&c.split(" "),1);h.$addClass(c)}else c=s,c=l(c&&c.split(" "),-1),h.$removeClass(c);n=a}var p=k.data("$classCounts"),n=!0,s;p||(p=T(),k.data("$classCounts",p));"ngClass"!==a&&(e||(e=f("$index",function(a){return a&1})),g.$watch(e,m));g.$watch(f(h[a],c),function(a){if(n===b){var c=s&&s.split(" "),e=a&&a.split(" "),f=d(c,e),c=d(e,c),f=l(f,-1),c=l(c,1);h.$addClass(c);h.$removeClass(f)}s=a})}}}]}function qd(a,b,d,c,e,f){return{restrict:"A",compile:function(g,k){var h=a(k[c]);return function(a,
|
||||
c){c.on(e,function(c){var e=function(){h(a,{$event:c})};if(b.$$phase)if(f)a.$evalAsync(e);else try{e()}catch(g){d(g)}else a.$apply(e)})}}}}function Rb(a,b,d,c,e,f,g,k,h){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=void 0;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=
|
||||
void 0;this.$name=h(d.name||"",!1)(a);this.$$parentForm=lb;this.$options=Sb;this.$$updateEvents="";this.$$updateEventHandler=this.$$updateEventHandler.bind(this);this.$$parsedNgModel=e(d.ngModel);this.$$parsedNgModelAssign=this.$$parsedNgModel.assign;this.$$ngModelGet=this.$$parsedNgModel;this.$$ngModelSet=this.$$parsedNgModelAssign;this.$$pendingDebounce=null;this.$$parserValid=void 0;this.$$parserName="parse";this.$$currentValidationRunId=0;this.$$scope=a;this.$$rootScope=a.$root;this.$$attr=d;
|
||||
this.$$element=c;this.$$animate=f;this.$$timeout=g;this.$$parse=e;this.$$q=k;this.$$exceptionHandler=b;Zd(this);jh(this)}function jh(a){a.$$scope.$watch(function(b){b=a.$$ngModelGet(b);b===a.$modelValue||a.$modelValue!==a.$modelValue&&b!==b||a.$$setModelValue(b);return b})}function Lc(a){this.$$options=a}function ge(a,b){r(b,function(b,c){w(a[c])||(a[c]=b)})}function Oa(a,b){a.prop("selected",b);a.attr("selected",b)}function he(a,b,d){if(a){A(a)&&(a=new RegExp("^"+a+"$"));if(!a.test)throw F("ngPattern")("noregexp",
|
||||
b,a,za(d));return a}}function Tb(a){a=fa(a);return X(a)?-1:a}var Wb={objectMaxDepth:5,urlErrorParamsEnabled:!0},ie=/^\/(.+)\/([a-z]*)$/,ta=Object.prototype.hasOwnProperty,K=function(a){return A(a)?a.toLowerCase():a},ub=function(a){return A(a)?a.toUpperCase():a},Ca,x,rb,Ha=[].slice,Fg=[].splice,kh=[].push,la=Object.prototype.toString,Pc=Object.getPrototypeOf,pa=F("ng"),ca=C.angular||(C.angular={}),kc,pb=0;Ca=C.document.documentMode;var X=Number.isNaN||function(a){return a!==a};E.$inject=[];Ta.$inject=
|
||||
[];var ve=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/,U=function(a){return A(a)?a.trim():a},Md=function(a){return a.replace(/([-()[\]{}+?*.$^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},Aa=function(){if(!w(Aa.rules)){var a=C.document.querySelector("[ng-csp]")||C.document.querySelector("[data-ng-csp]");if(a){var b=a.getAttribute("ng-csp")||a.getAttribute("data-ng-csp");Aa.rules={noUnsafeEval:!b||-1!==b.indexOf("no-unsafe-eval"),noInlineStyle:!b||-1!==
|
||||
b.indexOf("no-inline-style")}}else{a=Aa;try{new Function(""),b=!1}catch(d){b=!0}a.rules={noUnsafeEval:b,noInlineStyle:!1}}}return Aa.rules},qb=function(){if(w(qb.name_))return qb.name_;var a,b,d=Qa.length,c,e;for(b=0;b<d;++b)if(c=Qa[b],a=C.document.querySelector("["+c.replace(":","\\:")+"jq]")){e=a.getAttribute(c+"jq");break}return qb.name_=e},xe=/:/g,Qa=["ng-","data-ng-","ng:","x-ng-"],Be=function(a){var b=a.currentScript;if(!b)return!0;if(!(b instanceof C.HTMLScriptElement||b instanceof C.SVGScriptElement))return!1;
|
||||
b=b.attributes;return[b.getNamedItem("src"),b.getNamedItem("href"),b.getNamedItem("xlink:href")].every(function(b){if(!b)return!0;if(!b.value)return!1;var c=a.createElement("a");c.href=b.value;if(a.location.origin===c.origin)return!0;switch(c.protocol){case "http:":case "https:":case "ftp:":case "blob:":case "file:":case "data:":return!0;default:return!1}})}(C.document),Ee=/[A-Z]/g,Wc=!1,Pa=3,Ke={full:"1.7.7",major:1,minor:7,dot:7,codeName:"kingly-exiting"};Y.expando="ng339";var Ka=Y.cache={},pg=
|
||||
1;Y._data=function(a){return this.cache[a[this.expando]]||{}};var lg=/-([a-z])/g,lh=/^-ms-/,Ab={mouseleave:"mouseout",mouseenter:"mouseover"},nc=F("jqLite"),og=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,mc=/<|&#?\w+;/,mg=/<([\w:-]+)/,ng=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,oa={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>",
|
||||
"</tr></tbody></table>"],_default:[0,"",""]};oa.optgroup=oa.option;oa.tbody=oa.tfoot=oa.colgroup=oa.caption=oa.thead;oa.th=oa.td;var ug=C.Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)&16)},Wa=Y.prototype={ready:fd,toString:function(){var a=[];r(this,function(b){a.push(""+b)});return"["+a.join(", ")+"]"},eq:function(a){return 0<=a?x(this[a]):x(this[this.length+a])},length:0,push:kh,sort:[].sort,splice:[].splice},Gb={};r("multiple selected checked disabled readOnly required open".split(" "),
|
||||
function(a){Gb[K(a)]=a});var md={};r("input select option textarea button form details".split(" "),function(a){md[a]=!0});var td={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern",ngStep:"step"};r({data:rc,removeData:qc,hasData:function(a){for(var b in Ka[a.ng339])return!0;return!1},cleanData:function(a){for(var b=0,d=a.length;b<d;b++)qc(a[b]),id(a[b])}},function(a,b){Y[b]=a});r({data:rc,inheritedData:Eb,scope:function(a){return x.data(a,"$scope")||Eb(a.parentNode||
|
||||
a,["$isolateScope","$scope"])},isolateScope:function(a){return x.data(a,"$isolateScope")||x.data(a,"$isolateScopeNoTemplate")},controller:jd,injector:function(a){return Eb(a,"$injector")},removeAttr:function(a,b){a.removeAttribute(b)},hasClass:Bb,css:function(a,b,d){b=xb(b.replace(lh,"ms-"));if(w(d))a.style[b]=d;else return a.style[b]},attr:function(a,b,d){var c=a.nodeType;if(c!==Pa&&2!==c&&8!==c&&a.getAttribute){var c=K(b),e=Gb[c];if(w(d))null===d||!1===d&&e?a.removeAttribute(b):a.setAttribute(b,
|
||||
e?c:d);else return a=a.getAttribute(b),e&&null!==a&&(a=c),null===a?void 0:a}},prop:function(a,b,d){if(w(d))a[b]=d;else return a[b]},text:function(){function a(a,d){if(z(d)){var c=a.nodeType;return 1===c||c===Pa?a.textContent:""}a.textContent=d}a.$dv="";return a}(),val:function(a,b){if(z(b)){if(a.multiple&&"select"===ua(a)){var d=[];r(a.options,function(a){a.selected&&d.push(a.value||a.text)});return d}return a.value}a.value=b},html:function(a,b){if(z(b))return a.innerHTML;yb(a,!0);a.innerHTML=b},
|
||||
empty:kd},function(a,b){Y.prototype[b]=function(b,c){var e,f,g=this.length;if(a!==kd&&z(2===a.length&&a!==Bb&&a!==jd?b:c)){if(D(b)){for(e=0;e<g;e++)if(a===rc)a(this[e],b);else for(f in b)a(this[e],f,b[f]);return this}e=a.$dv;g=z(e)?Math.min(g,1):g;for(f=0;f<g;f++){var k=a(this[f],b,c);e=e?e+k:k}return e}for(e=0;e<g;e++)a(this[e],b,c);return this}});r({removeData:qc,on:function(a,b,d,c){if(w(c))throw nc("onargs");if(lc(a)){c=zb(a,!0);var e=c.events,f=c.handle;f||(f=c.handle=rg(a,e));c=0<=b.indexOf(" ")?
|
||||
b.split(" "):[b];for(var g=c.length,k=function(b,c,g){var k=e[b];k||(k=e[b]=[],k.specialHandlerWrapper=c,"$destroy"===b||g||a.addEventListener(b,f));k.push(d)};g--;)b=c[g],Ab[b]?(k(Ab[b],tg),k(b,void 0,!0)):k(b)}},off:id,one:function(a,b,d){a=x(a);a.on(b,function e(){a.off(b,d);a.off(b,e)});a.on(b,d)},replaceWith:function(a,b){var d,c=a.parentNode;yb(a);r(new Y(b),function(b){d?c.insertBefore(b,d.nextSibling):c.replaceChild(b,a);d=b})},children:function(a){var b=[];r(a.childNodes,function(a){1===
|
||||
a.nodeType&&b.push(a)});return b},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,b){var d=a.nodeType;if(1===d||11===d){b=new Y(b);for(var d=0,c=b.length;d<c;d++)a.appendChild(b[d])}},prepend:function(a,b){if(1===a.nodeType){var d=a.firstChild;r(new Y(b),function(b){a.insertBefore(b,d)})}},wrap:function(a,b){var d=x(b).eq(0).clone()[0],c=a.parentNode;c&&c.replaceChild(d,a);d.appendChild(a)},remove:Fb,detach:function(a){Fb(a,!0)},after:function(a,b){var d=a,c=a.parentNode;
|
||||
if(c){b=new Y(b);for(var e=0,f=b.length;e<f;e++){var g=b[e];c.insertBefore(g,d.nextSibling);d=g}}},addClass:Db,removeClass:Cb,toggleClass:function(a,b,d){b&&r(b.split(" "),function(b){var e=d;z(e)&&(e=!Bb(a,b));(e?Db:Cb)(a,b)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){return a.nextElementSibling},find:function(a,b){return a.getElementsByTagName?a.getElementsByTagName(b):[]},clone:pc,triggerHandler:function(a,b,d){var c,e,f=b.type||b,g=zb(a);if(g=(g=g&&g.events)&&
|
||||
g[f])c={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:E,type:f,target:a},b.type&&(c=S(c,b)),b=ja(g),e=d?[c].concat(d):[c],r(b,function(b){c.isImmediatePropagationStopped()||b.apply(a,e)})}},function(a,b){Y.prototype[b]=function(b,c,e){for(var f,g=0,k=this.length;g<
|
||||
k;g++)z(f)?(f=a(this[g],b,c,e),w(f)&&(f=x(f))):oc(f,a(this[g],b,c,e));return w(f)?f:this}});Y.prototype.bind=Y.prototype.on;Y.prototype.unbind=Y.prototype.off;var mh=Object.create(null);nd.prototype={_idx:function(a){a!==this._lastKey&&(this._lastKey=a,this._lastIndex=this._keys.indexOf(a));return this._lastIndex},_transformKey:function(a){return X(a)?mh:a},get:function(a){a=this._transformKey(a);a=this._idx(a);if(-1!==a)return this._values[a]},has:function(a){a=this._transformKey(a);return-1!==this._idx(a)},
|
||||
set:function(a,b){a=this._transformKey(a);var d=this._idx(a);-1===d&&(d=this._lastIndex=this._keys.length);this._keys[d]=a;this._values[d]=b},delete:function(a){a=this._transformKey(a);a=this._idx(a);if(-1===a)return!1;this._keys.splice(a,1);this._values.splice(a,1);this._lastKey=NaN;this._lastIndex=-1;return!0}};var Hb=nd,jg=[function(){this.$get=[function(){return Hb}]}],wg=/^([^(]+?)=>/,xg=/^[^(]*\(\s*([^)]*)\)/m,nh=/,/,oh=/^\s*(_?)(\S+?)\1\s*$/,vg=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ba=F("$injector");
|
||||
fb.$$annotate=function(a,b,d){var c;if("function"===typeof a){if(!(c=a.$inject)){c=[];if(a.length){if(b)throw A(d)&&d||(d=a.name||yg(a)),Ba("strictdi",d);b=od(a);r(b[1].split(nh),function(a){a.replace(oh,function(a,b,d){c.push(d)})})}a.$inject=c}}else H(a)?(b=a.length-1,sb(a[b],"fn"),c=a.slice(0,b)):sb(a,"fn",!0);return c};var je=F("$animate"),zf=function(){this.$get=E},Af=function(){var a=new Hb,b=[];this.$get=["$$AnimateRunner","$rootScope",function(d,c){function e(a,b,c){var d=!1;b&&(b=A(b)?b.split(" "):
|
||||
H(b)?b:[],r(b,function(b){b&&(d=!0,a[b]=c)}));return d}function f(){r(b,function(b){var c=a.get(b);if(c){var d=zg(b.attr("class")),e="",f="";r(c,function(a,b){a!==!!d[b]&&(a?e+=(e.length?" ":"")+b:f+=(f.length?" ":"")+b)});r(b,function(a){e&&Db(a,e);f&&Cb(a,f)});a.delete(b)}});b.length=0}return{enabled:E,on:E,off:E,pin:E,push:function(g,k,h,l){l&&l();h=h||{};h.from&&g.css(h.from);h.to&&g.css(h.to);if(h.addClass||h.removeClass)if(k=h.addClass,l=h.removeClass,h=a.get(g)||{},k=e(h,k,!0),l=e(h,l,!1),
|
||||
k||l)a.set(g,h),b.push(g),1===b.length&&c.$$postDigest(f);g=new d;g.complete();return g}}}]},xf=["$provide",function(a){var b=this,d=null,c=null;this.$$registeredAnimations=Object.create(null);this.register=function(c,d){if(c&&"."!==c.charAt(0))throw je("notcsel",c);var g=c+"-animation";b.$$registeredAnimations[c.substr(1)]=g;a.factory(g,d)};this.customFilter=function(a){1===arguments.length&&(c=B(a)?a:null);return c};this.classNameFilter=function(a){if(1===arguments.length&&(d=a instanceof RegExp?
|
||||
a:null)&&/[(\s|\/)]ng-animate[(\s|\/)]/.test(d.toString()))throw d=null,je("nongcls","ng-animate");return d};this.$get=["$$animateQueue",function(a){function b(a,c,d){if(d){var e;a:{for(e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){e=f;break a}}e=void 0}!e||e.parentNode||e.previousElementSibling||(d=null)}d?d.after(a):c.prepend(a)}return{on:a.on,off:a.off,pin:a.pin,enabled:a.enabled,cancel:function(a){a.cancel&&a.cancel()},enter:function(c,d,h,l){d=d&&x(d);h=h&&x(h);d=d||h.parent();b(c,d,h);return a.push(c,
|
||||
"enter",ra(l))},move:function(c,d,h,l){d=d&&x(d);h=h&&x(h);d=d||h.parent();b(c,d,h);return a.push(c,"move",ra(l))},leave:function(b,c){return a.push(b,"leave",ra(c),function(){b.remove()})},addClass:function(b,c,d){d=ra(d);d.addClass=hb(d.addclass,c);return a.push(b,"addClass",d)},removeClass:function(b,c,d){d=ra(d);d.removeClass=hb(d.removeClass,c);return a.push(b,"removeClass",d)},setClass:function(b,c,d,f){f=ra(f);f.addClass=hb(f.addClass,c);f.removeClass=hb(f.removeClass,d);return a.push(b,"setClass",
|
||||
f)},animate:function(b,c,d,f,m){m=ra(m);m.from=m.from?S(m.from,c):c;m.to=m.to?S(m.to,d):d;m.tempClasses=hb(m.tempClasses,f||"ng-inline-animate");return a.push(b,"animate",m)}}}]}],Cf=function(){this.$get=["$$rAF",function(a){function b(b){d.push(b);1<d.length||a(function(){for(var a=0;a<d.length;a++)d[a]();d=[]})}var d=[];return function(){var a=!1;b(function(){a=!0});return function(d){a?d():b(d)}}}]},Bf=function(){this.$get=["$q","$sniffer","$$animateAsyncRun","$$isDocumentHidden","$timeout",function(a,
|
||||
b,d,c,e){function f(a){this.setHost(a);var b=d();this._doneCallbacks=[];this._tick=function(a){c()?e(a,0,!1):b(a)};this._state=0}f.chain=function(a,b){function c(){if(d===a.length)b(!0);else a[d](function(a){!1===a?b(!1):(d++,c())})}var d=0;c()};f.all=function(a,b){function c(f){e=e&&f;++d===a.length&&b(e)}var d=0,e=!0;r(a,function(a){a.done(c)})};f.prototype={setHost:function(a){this.host=a||{}},done:function(a){2===this._state?a():this._doneCallbacks.push(a)},progress:E,getPromise:function(){if(!this.promise){var b=
|
||||
this;this.promise=a(function(a,c){b.done(function(b){!1===b?c():a()})})}return this.promise},then:function(a,b){return this.getPromise().then(a,b)},"catch":function(a){return this.getPromise()["catch"](a)},"finally":function(a){return this.getPromise()["finally"](a)},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&&this.host.end();this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel();this._resolve(!1)},
|
||||
complete:function(a){var b=this;0===b._state&&(b._state=1,b._tick(function(){b._resolve(a)}))},_resolve:function(a){2!==this._state&&(r(this._doneCallbacks,function(b){b(a)}),this._doneCallbacks.length=0,this._state=2)}};return f}]},yf=function(){this.$get=["$$rAF","$q","$$AnimateRunner",function(a,b,d){return function(b,e){function f(){a(function(){g.addClass&&(b.addClass(g.addClass),g.addClass=null);g.removeClass&&(b.removeClass(g.removeClass),g.removeClass=null);g.to&&(b.css(g.to),g.to=null);k||
|
||||
h.complete();k=!0});return h}var g=e||{};g.$$prepared||(g=Ia(g));g.cleanupStyles&&(g.from=g.to=null);g.from&&(b.css(g.from),g.from=null);var k,h=new d;return{start:f,end:f}}}]},$=F("$compile"),tc=new function(){};Xc.$inject=["$provide","$$sanitizeUriProvider"];Jb.prototype.isFirstChange=function(){return this.previousValue===tc};var pd=/^((?:x|data)[:\-_])/i,Eg=/[:\-_]+(.)/g,vd=F("$controller"),ud=/^(\S+)(\s+as\s+([\w$]+))?$/,Jf=function(){this.$get=["$document",function(a){return function(b){b?!b.nodeType&&
|
||||
b instanceof x&&(b=b[0]):b=a[0].body;return b.offsetWidth+1}}]},wd="application/json",wc={"Content-Type":wd+";charset=utf-8"},Hg=/^\[|^\{(?!\{)/,Ig={"[":/]$/,"{":/}$/},Gg=/^\)]\}',?\n/,Kb=F("$http"),Ma=ca.$interpolateMinErr=F("$interpolate");Ma.throwNoconcat=function(a){throw Ma("noconcat",a);};Ma.interr=function(a,b){return Ma("interr",a,b.toString())};var Lg=F("$interval"),Sf=function(){this.$get=function(){function a(a){var b=function(a){b.data=a;b.called=!0};b.id=a;return b}var b=ca.callbacks,
|
||||
d={};return{createCallback:function(c){c="_"+(b.$$counter++).toString(36);var e="angular.callbacks."+c,f=a(c);d[e]=b[c]=f;return e},wasCalled:function(a){return d[a].called},getResponse:function(a){return d[a].data},removeCallback:function(a){delete b[d[a].id];delete d[a]}}}},ph=/^([^?#]*)(\?([^#]*))?(#(.*))?$/,Mg={http:80,https:443,ftp:21},jb=F("$location"),Ng=/^\s*[\\/]{2,}/,qh={$$absUrl:"",$$html5:!1,$$replace:!1,$$compose:function(){for(var a=this.$$path,b=this.$$hash,d=ye(this.$$search),b=b?
|
||||
"#"+hc(b):"",a=a.split("/"),c=a.length;c--;)a[c]=hc(a[c].replace(/%2F/g,"/"));this.$$url=a.join("/")+(d?"?"+d:"")+b;this.$$absUrl=this.$$normalizeUrl(this.$$url);this.$$urlUpdatedByLocation=!0},absUrl:Lb("$$absUrl"),url:function(a){if(z(a))return this.$$url;var b=ph.exec(a);(b[1]||""===a)&&this.path(decodeURIComponent(b[1]));(b[2]||b[1]||""===a)&&this.search(b[3]||"");this.hash(b[5]||"");return this},protocol:Lb("$$protocol"),host:Lb("$$host"),port:Lb("$$port"),path:Dd("$$path",function(a){a=null!==
|
||||
a?a.toString():"";return"/"===a.charAt(0)?a:"/"+a}),search:function(a,b){switch(arguments.length){case 0:return this.$$search;case 1:if(A(a)||W(a))a=a.toString(),this.$$search=gc(a);else if(D(a))a=Ia(a,{}),r(a,function(b,c){null==b&&delete a[c]}),this.$$search=a;else throw jb("isrcharg");break;default:z(b)||null===b?delete this.$$search[a]:this.$$search[a]=b}this.$$compose();return this},hash:Dd("$$hash",function(a){return null!==a?a.toString():""}),replace:function(){this.$$replace=!0;return this}};
|
||||
r([Cd,zc,yc],function(a){a.prototype=Object.create(qh);a.prototype.state=function(b){if(!arguments.length)return this.$$state;if(a!==yc||!this.$$html5)throw jb("nostate");this.$$state=z(b)?null:b;this.$$urlUpdatedByLocation=!0;return this}});var Ya=F("$parse"),Rg={}.constructor.prototype.valueOf,Ub=T();r("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(a){Ub[a]=!0});var rh={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},Nb=function(a){this.options=a};Nb.prototype={constructor:Nb,
|
||||
lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index<this.text.length;)if(a=this.text.charAt(this.index),'"'===a||"'"===a)this.readString(a);else if(this.isNumber(a)||"."===a&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdentifierStart(this.peekMultichar()))this.readIdent();else if(this.is(a,"(){}[].,;:?"))this.tokens.push({index:this.index,text:a}),this.index++;else if(this.isWhitespace(a))this.index++;else{var b=a+this.peek(),d=b+this.peek(2),c=Ub[b],e=Ub[d];Ub[a]||
|
||||
c||e?(a=e?d:c?b:a,this.tokens.push({index:this.index,text:a,operator:!0}),this.index+=a.length):this.throwError("Unexpected next character ",this.index,this.index+1)}return this.tokens},is:function(a,b){return-1!==b.indexOf(a)},peek:function(a){a=a||1;return this.index+a<this.text.length?this.text.charAt(this.index+a):!1},isNumber:function(a){return"0"<=a&&"9">=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdentifierStart:function(a){return this.options.isIdentifierStart?
|
||||
this.options.isIdentifierStart(a,this.codePointAt(a)):this.isValidIdentifierStart(a)},isValidIdentifierStart:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isIdentifierContinue:function(a){return this.options.isIdentifierContinue?this.options.isIdentifierContinue(a,this.codePointAt(a)):this.isValidIdentifierContinue(a)},isValidIdentifierContinue:function(a,b){return this.isValidIdentifierStart(a,b)||this.isNumber(a)},codePointAt:function(a){return 1===a.length?a.charCodeAt(0):
|
||||
(a.charCodeAt(0)<<10)+a.charCodeAt(1)-56613888},peekMultichar:function(){var a=this.text.charAt(this.index),b=this.peek();if(!b)return a;var d=a.charCodeAt(0),c=b.charCodeAt(0);return 55296<=d&&56319>=d&&56320<=c&&57343>=c?a+b:a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,b,d){d=d||this.index;b=w(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,d)+"]":" "+d;throw Ya("lexerr",a,b,this.text);},readNumber:function(){for(var a="",b=this.index;this.index<
|
||||
this.text.length;){var d=K(this.text.charAt(this.index));if("."===d||this.isNumber(d))a+=d;else{var c=this.peek();if("e"===d&&this.isExpOperator(c))a+=d;else if(this.isExpOperator(d)&&c&&this.isNumber(c)&&"e"===a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||c&&this.isNumber(c)||"e"!==a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:b,text:a,constant:!0,value:Number(a)})},readIdent:function(){var a=this.index;for(this.index+=this.peekMultichar().length;this.index<
|
||||
this.text.length;){var b=this.peekMultichar();if(!this.isIdentifierContinue(b))break;this.index+=b.length}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var b=this.index;this.index++;for(var d="",c=a,e=!1;this.index<this.text.length;){var f=this.text.charAt(this.index),c=c+f;if(e)"u"===f?(e=this.text.substring(this.index+1,this.index+5),e.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+e+"]"),this.index+=4,d+=String.fromCharCode(parseInt(e,
|
||||
16))):d+=rh[f]||f,e=!1;else if("\\"===f)e=!0;else{if(f===a){this.index++;this.tokens.push({index:b,text:c,constant:!0,value:d});return}d+=f}this.index++}this.throwError("Unterminated quote",b)}};var q=function(a,b){this.lexer=a;this.options=b};q.Program="Program";q.ExpressionStatement="ExpressionStatement";q.AssignmentExpression="AssignmentExpression";q.ConditionalExpression="ConditionalExpression";q.LogicalExpression="LogicalExpression";q.BinaryExpression="BinaryExpression";q.UnaryExpression="UnaryExpression";
|
||||
q.CallExpression="CallExpression";q.MemberExpression="MemberExpression";q.Identifier="Identifier";q.Literal="Literal";q.ArrayExpression="ArrayExpression";q.Property="Property";q.ObjectExpression="ObjectExpression";q.ThisExpression="ThisExpression";q.LocalsExpression="LocalsExpression";q.NGValueParameter="NGValueParameter";q.prototype={ast:function(a){this.text=a;this.tokens=this.lexer.lex(a);a=this.program();0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]);return a},
|
||||
program:function(){for(var a=[];;)if(0<this.tokens.length&&!this.peek("}",")",";","]")&&a.push(this.expressionStatement()),!this.expect(";"))return{type:q.Program,body:a}},expressionStatement:function(){return{type:q.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var a=this.expression();this.expect("|");)a=this.filter(a);return a},expression:function(){return this.assignment()},assignment:function(){var a=this.ternary();if(this.expect("=")){if(!Hd(a))throw Ya("lval");
|
||||
a={type:q.AssignmentExpression,left:a,right:this.assignment(),operator:"="}}return a},ternary:function(){var a=this.logicalOR(),b,d;return this.expect("?")&&(b=this.expression(),this.consume(":"))?(d=this.expression(),{type:q.ConditionalExpression,test:a,alternate:b,consequent:d}):a},logicalOR:function(){for(var a=this.logicalAND();this.expect("||");)a={type:q.LogicalExpression,operator:"||",left:a,right:this.logicalAND()};return a},logicalAND:function(){for(var a=this.equality();this.expect("&&");)a=
|
||||
{type:q.LogicalExpression,operator:"&&",left:a,right:this.equality()};return a},equality:function(){for(var a=this.relational(),b;b=this.expect("==","!=","===","!==");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.relational()};return a},relational:function(){for(var a=this.additive(),b;b=this.expect("<",">","<=",">=");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),b;b=this.expect("+","-");)a={type:q.BinaryExpression,
|
||||
operator:b.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),b;b=this.expect("*","/","%");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:q.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?
|
||||
a=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?a=Ia(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?a={type:q.Literal,value:this.options.literals[this.consume().text]}:this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var b;b=this.expect("(","[",".");)"("===b.text?(a={type:q.CallExpression,callee:a,arguments:this.parseArguments()},this.consume(")")):
|
||||
"["===b.text?(a={type:q.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===b.text?a={type:q.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var b={type:q.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return b},parseArguments:function(){var a=[];if(")"!==this.peekToken().text){do a.push(this.filterChain());while(this.expect(","))
|
||||
}return a},identifier:function(){var a=this.consume();a.identifier||this.throwError("is not a valid identifier",a);return{type:q.Identifier,name:a.text}},constant:function(){return{type:q.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]");return{type:q.ArrayExpression,elements:a}},object:function(){var a=[],b;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;
|
||||
b={type:q.Property,kind:"init"};this.peek().constant?(b.key=this.constant(),b.computed=!1,this.consume(":"),b.value=this.expression()):this.peek().identifier?(b.key=this.identifier(),b.computed=!1,this.peek(":")?(this.consume(":"),b.value=this.expression()):b.value=b.key):this.peek("[")?(this.consume("["),b.key=this.expression(),this.consume("]"),b.computed=!0,this.consume(":"),b.value=this.expression()):this.throwError("invalid key",this.peek());a.push(b)}while(this.expect(","))}this.consume("}");
|
||||
return{type:q.ObjectExpression,properties:a}},throwError:function(a,b){throw Ya("syntax",b.text,a,b.index+1,this.text,this.text.substring(b.index));},consume:function(a){if(0===this.tokens.length)throw Ya("ueoe",this.text);var b=this.expect(a);b||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return b},peekToken:function(){if(0===this.tokens.length)throw Ya("ueoe",this.text);return this.tokens[0]},peek:function(a,b,d,c){return this.peekAhead(0,a,b,d,c)},peekAhead:function(a,b,d,c,
|
||||
e){if(this.tokens.length>a){a=this.tokens[a];var f=a.text;if(f===b||f===d||f===c||f===e||!(b||d||c||e))return a}return!1},expect:function(a,b,d,c){return(a=this.peek(a,b,d,c))?(this.tokens.shift(),a):!1},selfReferential:{"this":{type:q.ThisExpression},$locals:{type:q.LocalsExpression}}};var Fd=2;Jd.prototype={compile:function(a){var b=this;this.state={nextId:0,filters:{},fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};Z(a,b.$filter);var d="",c;this.stage="assign";if(c=Id(a))this.state.computing=
|
||||
"assign",d=this.nextId(),this.recurse(c,d),this.return_(d),d="fn.assign="+this.generateFunction("assign","s,v,l");c=Gd(a.body);b.stage="inputs";r(c,function(a,c){var d="fn"+c;b.state[d]={vars:[],body:[],own:{}};b.state.computing=d;var k=b.nextId();b.recurse(a,k);b.return_(k);b.state.inputs.push({name:d,isPure:a.isPure});a.watchId=c});this.state.computing="fn";this.stage="main";this.recurse(a);a='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+
|
||||
d+this.watchFns()+"return fn;";a=(new Function("$filter","getStringValue","ifDefined","plus",a))(this.$filter,Og,Pg,Ed);this.state=this.stage=void 0;return a},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs,d=this;r(b,function(b){a.push("var "+b.name+"="+d.generateFunction(b.name,"s"));b.isPure&&a.push(b.name,".isPure="+JSON.stringify(b.isPure)+";")});b.length&&a.push("fn.inputs=["+b.map(function(a){return a.name}).join(",")+"];");return a.join("")},generateFunction:function(a,
|
||||
b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;r(this.state.filters,function(d,c){a.push(d+"=$filter("+b.escape(c)+")")});return a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,b,d,c,e,f){var g,k,h=this,l,m,p;c=c||E;if(!f&&w(a.watchId))b=b||this.nextId(),this.if_("i",this.lazyAssign(b,
|
||||
this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,d,c,e,!0));else switch(a.type){case q.Program:r(a.body,function(b,c){h.recurse(b.expression,void 0,void 0,function(a){k=a});c!==a.body.length-1?h.current().body.push(k,";"):h.return_(k)});break;case q.Literal:m=this.escape(a.value);this.assign(b,m);c(b||m);break;case q.UnaryExpression:this.recurse(a.argument,void 0,void 0,function(a){k=a});m=a.operator+"("+this.ifDefined(k,0)+")";this.assign(b,m);c(m);break;case q.BinaryExpression:this.recurse(a.left,
|
||||
void 0,void 0,function(a){g=a});this.recurse(a.right,void 0,void 0,function(a){k=a});m="+"===a.operator?this.plus(g,k):"-"===a.operator?this.ifDefined(g,0)+a.operator+this.ifDefined(k,0):"("+g+")"+a.operator+"("+k+")";this.assign(b,m);c(m);break;case q.LogicalExpression:b=b||this.nextId();h.recurse(a.left,b);h.if_("&&"===a.operator?b:h.not(b),h.lazyRecurse(a.right,b));c(b);break;case q.ConditionalExpression:b=b||this.nextId();h.recurse(a.test,b);h.if_(b,h.lazyRecurse(a.alternate,b),h.lazyRecurse(a.consequent,
|
||||
b));c(b);break;case q.Identifier:b=b||this.nextId();d&&(d.context="inputs"===h.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",a.name)+"?l:s"),d.computed=!1,d.name=a.name);h.if_("inputs"===h.stage||h.not(h.getHasOwnProperty("l",a.name)),function(){h.if_("inputs"===h.stage||"s",function(){e&&1!==e&&h.if_(h.isNull(h.nonComputedMember("s",a.name)),h.lazyAssign(h.nonComputedMember("s",a.name),"{}"));h.assign(b,h.nonComputedMember("s",a.name))})},b&&h.lazyAssign(b,h.nonComputedMember("l",
|
||||
a.name)));c(b);break;case q.MemberExpression:g=d&&(d.context=this.nextId())||this.nextId();b=b||this.nextId();h.recurse(a.object,g,void 0,function(){h.if_(h.notNull(g),function(){a.computed?(k=h.nextId(),h.recurse(a.property,k),h.getStringValue(k),e&&1!==e&&h.if_(h.not(h.computedMember(g,k)),h.lazyAssign(h.computedMember(g,k),"{}")),m=h.computedMember(g,k),h.assign(b,m),d&&(d.computed=!0,d.name=k)):(e&&1!==e&&h.if_(h.isNull(h.nonComputedMember(g,a.property.name)),h.lazyAssign(h.nonComputedMember(g,
|
||||
a.property.name),"{}")),m=h.nonComputedMember(g,a.property.name),h.assign(b,m),d&&(d.computed=!1,d.name=a.property.name))},function(){h.assign(b,"undefined")});c(b)},!!e);break;case q.CallExpression:b=b||this.nextId();a.filter?(k=h.filter(a.callee.name),l=[],r(a.arguments,function(a){var b=h.nextId();h.recurse(a,b);l.push(b)}),m=k+"("+l.join(",")+")",h.assign(b,m),c(b)):(k=h.nextId(),g={},l=[],h.recurse(a.callee,k,g,function(){h.if_(h.notNull(k),function(){r(a.arguments,function(b){h.recurse(b,a.constant?
|
||||
void 0:h.nextId(),void 0,function(a){l.push(a)})});m=g.name?h.member(g.context,g.name,g.computed)+"("+l.join(",")+")":k+"("+l.join(",")+")";h.assign(b,m)},function(){h.assign(b,"undefined")});c(b)}));break;case q.AssignmentExpression:k=this.nextId();g={};this.recurse(a.left,void 0,g,function(){h.if_(h.notNull(g.context),function(){h.recurse(a.right,k);m=h.member(g.context,g.name,g.computed)+a.operator+k;h.assign(b,m);c(b||m)})},1);break;case q.ArrayExpression:l=[];r(a.elements,function(b){h.recurse(b,
|
||||
a.constant?void 0:h.nextId(),void 0,function(a){l.push(a)})});m="["+l.join(",")+"]";this.assign(b,m);c(b||m);break;case q.ObjectExpression:l=[];p=!1;r(a.properties,function(a){a.computed&&(p=!0)});p?(b=b||this.nextId(),this.assign(b,"{}"),r(a.properties,function(a){a.computed?(g=h.nextId(),h.recurse(a.key,g)):g=a.key.type===q.Identifier?a.key.name:""+a.key.value;k=h.nextId();h.recurse(a.value,k);h.assign(h.member(b,g,a.computed),k)})):(r(a.properties,function(b){h.recurse(b.value,a.constant?void 0:
|
||||
h.nextId(),void 0,function(a){l.push(h.escape(b.key.type===q.Identifier?b.key.name:""+b.key.value)+":"+a)})}),m="{"+l.join(",")+"}",this.assign(b,m));c(b||m);break;case q.ThisExpression:this.assign(b,"s");c(b||"s");break;case q.LocalsExpression:this.assign(b,"l");c(b||"l");break;case q.NGValueParameter:this.assign(b,"v"),c(b||"v")}},getHasOwnProperty:function(a,b){var d=a+"."+b,c=this.current().own;c.hasOwnProperty(d)||(c[d]=this.nextId(!1,a+"&&("+this.escape(b)+" in "+a+")"));return c[d]},assign:function(a,
|
||||
b){if(a)return this.current().body.push(a,"=",b,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a,b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,b,d){if(!0===a)b();else{var c=this.current().body;c.push("if(",a,"){");b();c.push("}");d&&(c.push("else{"),d(),c.push("}"))}},
|
||||
not:function(a){return"!("+a+")"},isNull:function(a){return a+"==null"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,b){var d=/[^$_a-zA-Z0-9]/g;return/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(b)?a+"."+b:a+'["'+b.replace(d,this.stringEscapeFn)+'"]'},computedMember:function(a,b){return a+"["+b+"]"},member:function(a,b,d){return d?this.computedMember(a,b):this.nonComputedMember(a,b)},getStringValue:function(a){this.assign(a,"getStringValue("+a+")")},lazyRecurse:function(a,b,d,c,e,f){var g=
|
||||
this;return function(){g.recurse(a,b,d,c,e,f)}},lazyAssign:function(a,b){var d=this;return function(){d.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(A(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(W(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if("undefined"===typeof a)return"undefined";throw Ya("esc");},nextId:function(a,
|
||||
b){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(b?"="+b:""));return d},current:function(){return this.state[this.state.computing]}};Kd.prototype={compile:function(a){var b=this;Z(a,b.$filter);var d,c;if(d=Id(a))c=this.recurse(d);d=Gd(a.body);var e;d&&(e=[],r(d,function(a,c){var d=b.recurse(a);d.isPure=a.isPure;a.input=d;e.push(d);a.watchId=c}));var f=[];r(a.body,function(a){f.push(b.recurse(a.expression))});a=0===a.body.length?E:1===a.body.length?f[0]:function(a,b){var c;r(f,function(d){c=
|
||||
d(a,b)});return c};c&&(a.assign=function(a,b,d){return c(a,d,b)});e&&(a.inputs=e);return a},recurse:function(a,b,d){var c,e,f=this,g;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case q.Literal:return this.value(a.value,b);case q.UnaryExpression:return e=this.recurse(a.argument),this["unary"+a.operator](e,b);case q.BinaryExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case q.LogicalExpression:return c=this.recurse(a.left),e=this.recurse(a.right),
|
||||
this["binary"+a.operator](c,e,b);case q.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),b);case q.Identifier:return f.identifier(a.name,b,d);case q.MemberExpression:return c=this.recurse(a.object,!1,!!d),a.computed||(e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(c,e,b,d):this.nonComputedMember(c,e,b,d);case q.CallExpression:return g=[],r(a.arguments,function(a){g.push(f.recurse(a))}),
|
||||
a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var p=[],n=0;n<g.length;++n)p.push(g[n](a,c,d,f));a=e.apply(void 0,p,f);return b?{context:void 0,name:void 0,value:a}:a}:function(a,c,d,f){var p=e(a,c,d,f),n;if(null!=p.value){n=[];for(var s=0;s<g.length;++s)n.push(g[s](a,c,d,f));n=p.value.apply(p.context,n)}return b?{value:n}:n};case q.AssignmentExpression:return c=this.recurse(a.left,!0,1),e=this.recurse(a.right),function(a,d,f,g){var p=
|
||||
c(a,d,f,g);a=e(a,d,f,g);p.context[p.name]=a;return b?{value:a}:a};case q.ArrayExpression:return g=[],r(a.elements,function(a){g.push(f.recurse(a))}),function(a,c,d,e){for(var f=[],n=0;n<g.length;++n)f.push(g[n](a,c,d,e));return b?{value:f}:f};case q.ObjectExpression:return g=[],r(a.properties,function(a){a.computed?g.push({key:f.recurse(a.key),computed:!0,value:f.recurse(a.value)}):g.push({key:a.key.type===q.Identifier?a.key.name:""+a.key.value,computed:!1,value:f.recurse(a.value)})}),function(a,
|
||||
c,d,e){for(var f={},n=0;n<g.length;++n)g[n].computed?f[g[n].key(a,c,d,e)]=g[n].value(a,c,d,e):f[g[n].key]=g[n].value(a,c,d,e);return b?{value:f}:f};case q.ThisExpression:return function(a){return b?{value:a}:a};case q.LocalsExpression:return function(a,c){return b?{value:c}:c};case q.NGValueParameter:return function(a,c,d){return b?{value:d}:d}}},"unary+":function(a,b){return function(d,c,e,f){d=a(d,c,e,f);d=w(d)?+d:0;return b?{value:d}:d}},"unary-":function(a,b){return function(d,c,e,f){d=a(d,c,
|
||||
e,f);d=w(d)?-d:-0;return b?{value:d}:d}},"unary!":function(a,b){return function(d,c,e,f){d=!a(d,c,e,f);return b?{value:d}:d}},"binary+":function(a,b,d){return function(c,e,f,g){var k=a(c,e,f,g);c=b(c,e,f,g);k=Ed(k,c);return d?{value:k}:k}},"binary-":function(a,b,d){return function(c,e,f,g){var k=a(c,e,f,g);c=b(c,e,f,g);k=(w(k)?k:0)-(w(c)?c:0);return d?{value:k}:k}},"binary*":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)*b(c,e,f,g);return d?{value:c}:c}},"binary/":function(a,b,d){return function(c,
|
||||
e,f,g){c=a(c,e,f,g)/b(c,e,f,g);return d?{value:c}:c}},"binary%":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)%b(c,e,f,g);return d?{value:c}:c}},"binary===":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)===b(c,e,f,g);return d?{value:c}:c}},"binary!==":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)!==b(c,e,f,g);return d?{value:c}:c}},"binary==":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)==b(c,e,f,g);return d?{value:c}:c}},"binary!=":function(a,b,d){return function(c,
|
||||
e,f,g){c=a(c,e,f,g)!=b(c,e,f,g);return d?{value:c}:c}},"binary<":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)<b(c,e,f,g);return d?{value:c}:c}},"binary>":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>b(c,e,f,g);return d?{value:c}:c}},"binary<=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)<=b(c,e,f,g);return d?{value:c}:c}},"binary>=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>=b(c,e,f,g);return d?{value:c}:c}},"binary&&":function(a,b,d){return function(c,e,f,g){c=
|
||||
a(c,e,f,g)&&b(c,e,f,g);return d?{value:c}:c}},"binary||":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)||b(c,e,f,g);return d?{value:c}:c}},"ternary?:":function(a,b,d,c){return function(e,f,g,k){e=a(e,f,g,k)?b(e,f,g,k):d(e,f,g,k);return c?{value:e}:e}},value:function(a,b){return function(){return b?{context:void 0,name:void 0,value:a}:a}},identifier:function(a,b,d){return function(c,e,f,g){c=e&&a in e?e:c;d&&1!==d&&c&&null==c[a]&&(c[a]={});e=c?c[a]:void 0;return b?{context:c,name:a,value:e}:
|
||||
e}},computedMember:function(a,b,d,c){return function(e,f,g,k){var h=a(e,f,g,k),l,m;null!=h&&(l=b(e,f,g,k),l+="",c&&1!==c&&h&&!h[l]&&(h[l]={}),m=h[l]);return d?{context:h,name:l,value:m}:m}},nonComputedMember:function(a,b,d,c){return function(e,f,g,k){e=a(e,f,g,k);c&&1!==c&&e&&null==e[b]&&(e[b]={});f=null!=e?e[b]:void 0;return d?{context:e,name:b,value:f}:f}},inputs:function(a,b){return function(d,c,e,f){return f?f[b]:a(d,c,e)}}};Mb.prototype={constructor:Mb,parse:function(a){a=this.getAst(a);var b=
|
||||
this.astCompiler.compile(a.ast),d=a.ast;b.literal=0===d.body.length||1===d.body.length&&(d.body[0].expression.type===q.Literal||d.body[0].expression.type===q.ArrayExpression||d.body[0].expression.type===q.ObjectExpression);b.constant=a.ast.constant;b.oneTime=a.oneTime;return b},getAst:function(a){var b=!1;a=a.trim();":"===a.charAt(0)&&":"===a.charAt(1)&&(b=!0,a=a.substring(2));return{ast:this.ast.ast(a),oneTime:b}}};var Ea=F("$sce"),V={HTML:"html",CSS:"css",MEDIA_URL:"mediaUrl",URL:"url",RESOURCE_URL:"resourceUrl",
|
||||
JS:"js"},Cc=/_([a-z])/g,Ug=F("$templateRequest"),Vg=F("$timeout"),aa=C.document.createElement("a"),Od=ga(C.location.href),Na;aa.href="http://[::1]";var Wg="[::1]"===aa.hostname;Pd.$inject=["$document"];dd.$inject=["$provide"];var Wd=22,Vd=".",Ec="0";Qd.$inject=["$locale"];Sd.$inject=["$locale"];var gh={yyyy:ea("FullYear",4,0,!1,!0),yy:ea("FullYear",2,0,!0,!0),y:ea("FullYear",1,0,!1,!0),MMMM:kb("Month"),MMM:kb("Month",!0),MM:ea("Month",2,1),M:ea("Month",1,1),LLLL:kb("Month",!1,!0),dd:ea("Date",2),
|
||||
d:ea("Date",1),HH:ea("Hours",2),H:ea("Hours",1),hh:ea("Hours",2,-12),h:ea("Hours",1,-12),mm:ea("Minutes",2),m:ea("Minutes",1),ss:ea("Seconds",2),s:ea("Seconds",1),sss:ea("Milliseconds",3),EEEE:kb("Day"),EEE:kb("Day",!0),a:function(a,b){return 12>a.getHours()?b.AMPMS[0]:b.AMPMS[1]},Z:function(a,b,d){a=-1*d;return a=(0<=a?"+":"")+(Ob(Math[0<a?"floor":"ceil"](a/60),2)+Ob(Math.abs(a%60),2))},ww:Yd(2),w:Yd(1),G:Fc,GG:Fc,GGG:Fc,GGGG:function(a,b){return 0>=a.getFullYear()?b.ERANAMES[0]:b.ERANAMES[1]}},
|
||||
fh=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\s\S]*)/,eh=/^-?\d+$/;Rd.$inject=["$locale"];var $g=ia(K),ah=ia(ub);Td.$inject=["$parse"];var Me=ia({restrict:"E",compile:function(a,b){if(!b.href&&!b.xlinkHref)return function(a,b){if("a"===b[0].nodeName.toLowerCase()){var e="[object SVGAnimatedString]"===la.call(b.prop("href"))?"xlink:href":"href";b.on("click",function(a){b.attr(e)||a.preventDefault()})}}}}),vb={};r(Gb,function(a,b){function d(a,d,e){a.$watch(e[c],
|
||||
function(a){e.$set(b,!!a)})}if("multiple"!==a){var c=wa("ng-"+b),e=d;"checked"===a&&(e=function(a,b,e){e.ngModel!==e[c]&&d(a,b,e)});vb[c]=function(){return{restrict:"A",priority:100,link:e}}}});r(td,function(a,b){vb[b]=function(){return{priority:100,link:function(a,c,e){if("ngPattern"===b&&"/"===e.ngPattern.charAt(0)&&(c=e.ngPattern.match(ie))){e.$set("ngPattern",new RegExp(c[1],c[2]));return}a.$watch(e[b],function(a){e.$set(b,a)})}}}});r(["src","srcset","href"],function(a){var b=wa("ng-"+a);vb[b]=
|
||||
["$sce",function(d){return{priority:99,link:function(c,e,f){var g=a,k=a;"href"===a&&"[object SVGAnimatedString]"===la.call(e.prop("href"))&&(k="xlinkHref",f.$attr[k]="xlink:href",g=null);f.$set(b,d.getTrustedMediaUrl(f[b]));f.$observe(b,function(b){b?(f.$set(k,b),Ca&&g&&e.prop(g,f[k])):"href"===a&&f.$set(k,null)})}}}]});var lb={$addControl:E,$getControls:ia([]),$$renameControl:function(a,b){a.$name=b},$removeControl:E,$setValidity:E,$setDirty:E,$setPristine:E,$setSubmitted:E,$$setSubmitted:E};Pb.$inject=
|
||||
["$element","$attrs","$scope","$animate","$interpolate"];Pb.prototype={$rollbackViewValue:function(){r(this.$$controls,function(a){a.$rollbackViewValue()})},$commitViewValue:function(){r(this.$$controls,function(a){a.$commitViewValue()})},$addControl:function(a){Ja(a.$name,"input");this.$$controls.push(a);a.$name&&(this[a.$name]=a);a.$$parentForm=this},$getControls:function(){return ja(this.$$controls)},$$renameControl:function(a,b){var d=a.$name;this[d]===a&&delete this[d];this[b]=a;a.$name=b},$removeControl:function(a){a.$name&&
|
||||
this[a.$name]===a&&delete this[a.$name];r(this.$pending,function(b,d){this.$setValidity(d,null,a)},this);r(this.$error,function(b,d){this.$setValidity(d,null,a)},this);r(this.$$success,function(b,d){this.$setValidity(d,null,a)},this);cb(this.$$controls,a);a.$$parentForm=lb},$setDirty:function(){this.$$animate.removeClass(this.$$element,Za);this.$$animate.addClass(this.$$element,Vb);this.$dirty=!0;this.$pristine=!1;this.$$parentForm.$setDirty()},$setPristine:function(){this.$$animate.setClass(this.$$element,
|
||||
Za,Vb+" ng-submitted");this.$dirty=!1;this.$pristine=!0;this.$submitted=!1;r(this.$$controls,function(a){a.$setPristine()})},$setUntouched:function(){r(this.$$controls,function(a){a.$setUntouched()})},$setSubmitted:function(){for(var a=this;a.$$parentForm&&a.$$parentForm!==lb;)a=a.$$parentForm;a.$$setSubmitted()},$$setSubmitted:function(){this.$$animate.addClass(this.$$element,"ng-submitted");this.$submitted=!0;r(this.$$controls,function(a){a.$$setSubmitted&&a.$$setSubmitted()})}};ae({clazz:Pb,set:function(a,
|
||||
b,d){var c=a[b];c?-1===c.indexOf(d)&&c.push(d):a[b]=[d]},unset:function(a,b,d){var c=a[b];c&&(cb(c,d),0===c.length&&delete a[b])}});var ke=function(a){return["$timeout","$parse",function(b,d){function c(a){return""===a?d('this[""]').assign:d(a).assign||E}return{name:"form",restrict:a?"EAC":"E",require:["form","^^?form"],controller:Pb,compile:function(d,f){d.addClass(Za).addClass(mb);var g=f.name?"name":a&&f.ngForm?"ngForm":!1;return{pre:function(a,d,e,f){var p=f[0];if(!("action"in e)){var n=function(b){a.$apply(function(){p.$commitViewValue();
|
||||
p.$setSubmitted()});b.preventDefault()};d[0].addEventListener("submit",n);d.on("$destroy",function(){b(function(){d[0].removeEventListener("submit",n)},0,!1)})}(f[1]||p.$$parentForm).$addControl(p);var s=g?c(p.$name):E;g&&(s(a,p),e.$observe(g,function(b){p.$name!==b&&(s(a,void 0),p.$$parentForm.$$renameControl(p,b),s=c(p.$name),s(a,p))}));d.on("$destroy",function(){p.$$parentForm.$removeControl(p);s(a,void 0);S(p,lb)})}}}}}]},Ne=ke(),Ze=ke(!0),hh=/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,
|
||||
sh=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,th=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,ih=/^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,le=/^(\d{4,})-(\d{2})-(\d{2})$/,me=/^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Mc=/^(\d{4,})-W(\d\d)$/,ne=/^(\d{4,})-(\d\d)$/,
|
||||
oe=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,ce=T();r(["date","datetime-local","month","time","week"],function(a){ce[a]=!0});var pe={text:function(a,b,d,c,e,f){Sa(a,b,d,c,e,f);Hc(c)},date:nb("date",le,Qb(le,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":nb("datetimelocal",me,Qb(me,"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:nb("time",oe,Qb(oe,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:nb("week",Mc,function(a,b){if(ha(a))return a;if(A(a)){Mc.lastIndex=0;var d=Mc.exec(a);
|
||||
if(d){var c=+d[1],e=+d[2],f=d=0,g=0,k=0,h=Xd(c),e=7*(e-1);b&&(d=b.getHours(),f=b.getMinutes(),g=b.getSeconds(),k=b.getMilliseconds());return new Date(c,0,h.getDate()+e,d,f,g,k)}}return NaN},"yyyy-Www"),month:nb("month",ne,Qb(ne,["yyyy","MM"]),"yyyy-MM"),number:function(a,b,d,c,e,f,g,k){Ic(a,b,d,c,"number");de(c);Sa(a,b,d,c,e,f);var h;if(w(d.min)||d.ngMin){var l=d.min||k(d.ngMin)(a);h=na(l);c.$validators.min=function(a,b){return c.$isEmpty(b)||z(h)||b>=h};d.$observe("min",function(a){a!==l&&(h=na(a),
|
||||
l=a,c.$validate())})}if(w(d.max)||d.ngMax){var m=d.max||k(d.ngMax)(a),p=na(m);c.$validators.max=function(a,b){return c.$isEmpty(b)||z(p)||b<=p};d.$observe("max",function(a){a!==m&&(p=na(a),m=a,c.$validate())})}if(w(d.step)||d.ngStep){var n=d.step||k(d.ngStep)(a),s=na(n);c.$validators.step=function(a,b){return c.$isEmpty(b)||z(s)||ee(b,h||0,s)};d.$observe("step",function(a){a!==n&&(s=na(a),n=a,c.$validate())})}},url:function(a,b,d,c,e,f){Sa(a,b,d,c,e,f);Hc(c);c.$validators.url=function(a,b){var d=
|
||||
a||b;return c.$isEmpty(d)||sh.test(d)}},email:function(a,b,d,c,e,f){Sa(a,b,d,c,e,f);Hc(c);c.$validators.email=function(a,b){var d=a||b;return c.$isEmpty(d)||th.test(d)}},radio:function(a,b,d,c){var e=!d.ngTrim||"false"!==U(d.ngTrim);z(d.name)&&b.attr("name",++pb);b.on("change",function(a){var g;b[0].checked&&(g=d.value,e&&(g=U(g)),c.$setViewValue(g,a&&a.type))});c.$render=function(){var a=d.value;e&&(a=U(a));b[0].checked=a===c.$viewValue};d.$observe("value",c.$render)},range:function(a,b,d,c,e,f){function g(a,
|
||||
c){b.attr(a,d[a]);var e=d[a];d.$observe(a,function(a){a!==e&&(e=a,c(a))})}function k(a){p=na(a);X(c.$modelValue)||(m?(a=b.val(),p>a&&(a=p,b.val(a)),c.$setViewValue(a)):c.$validate())}function h(a){n=na(a);X(c.$modelValue)||(m?(a=b.val(),n<a&&(b.val(n),a=n<p?p:n),c.$setViewValue(a)):c.$validate())}function l(a){s=na(a);X(c.$modelValue)||(m?c.$viewValue!==b.val()&&c.$setViewValue(b.val()):c.$validate())}Ic(a,b,d,c,"range");de(c);Sa(a,b,d,c,e,f);var m=c.$$hasNativeValidators&&"range"===b[0].type,p=m?
|
||||
0:void 0,n=m?100:void 0,s=m?1:void 0,r=b[0].validity;a=w(d.min);e=w(d.max);f=w(d.step);var q=c.$render;c.$render=m&&w(r.rangeUnderflow)&&w(r.rangeOverflow)?function(){q();c.$setViewValue(b.val())}:q;a&&(p=na(d.min),c.$validators.min=m?function(){return!0}:function(a,b){return c.$isEmpty(b)||z(p)||b>=p},g("min",k));e&&(n=na(d.max),c.$validators.max=m?function(){return!0}:function(a,b){return c.$isEmpty(b)||z(n)||b<=n},g("max",h));f&&(s=na(d.step),c.$validators.step=m?function(){return!r.stepMismatch}:
|
||||
function(a,b){return c.$isEmpty(b)||z(s)||ee(b,p||0,s)},g("step",l))},checkbox:function(a,b,d,c,e,f,g,k){var h=fe(k,a,"ngTrueValue",d.ngTrueValue,!0),l=fe(k,a,"ngFalseValue",d.ngFalseValue,!1);b.on("change",function(a){c.$setViewValue(b[0].checked,a&&a.type)});c.$render=function(){b[0].checked=c.$viewValue};c.$isEmpty=function(a){return!1===a};c.$formatters.push(function(a){return va(a,h)});c.$parsers.push(function(a){return a?h:l})},hidden:E,button:E,submit:E,reset:E,file:E},Yc=["$browser","$sniffer",
|
||||
"$filter","$parse",function(a,b,d,c){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,f,g,k){k[0]&&(pe[K(g.type)]||pe.text)(e,f,g,k[0],b,a,d,c)}}}}],vf=function(){var a={configurable:!0,enumerable:!1,get:function(){return this.getAttribute("value")||""},set:function(a){this.setAttribute("value",a)}};return{restrict:"E",priority:200,compile:function(b,d){if("hidden"===K(d.type))return{pre:function(b,d,f,g){b=d[0];b.parentNode&&b.parentNode.insertBefore(b,b.nextSibling);Object.defineProperty&&
|
||||
Object.defineProperty(b,"value",a)}}}}},uh=/^(true|false|\d+)$/,sf=function(){function a(a,d,c){var e=w(c)?c:9===Ca?"":null;a.prop("value",e);d.$set("value",c)}return{restrict:"A",priority:100,compile:function(b,d){return uh.test(d.ngValue)?function(b,d,f){b=b.$eval(f.ngValue);a(d,f,b)}:function(b,d,f){b.$watch(f.ngValue,function(b){a(d,f,b)})}}}},Re=["$compile",function(a){return{restrict:"AC",compile:function(b){a.$$addBindingClass(b);return function(b,c,e){a.$$addBindingInfo(c,e.ngBind);c=c[0];
|
||||
b.$watch(e.ngBind,function(a){c.textContent=ic(a)})}}}}],Te=["$interpolate","$compile",function(a,b){return{compile:function(d){b.$$addBindingClass(d);return function(c,d,f){c=a(d.attr(f.$attr.ngBindTemplate));b.$$addBindingInfo(d,c.expressions);d=d[0];f.$observe("ngBindTemplate",function(a){d.textContent=z(a)?"":a})}}}}],Se=["$sce","$parse","$compile",function(a,b,d){return{restrict:"A",compile:function(c,e){var f=b(e.ngBindHtml),g=b(e.ngBindHtml,function(b){return a.valueOf(b)});d.$$addBindingClass(c);
|
||||
return function(b,c,e){d.$$addBindingInfo(c,e.ngBindHtml);b.$watch(g,function(){var d=f(b);c.html(a.getTrustedHtml(d)||"")})}}}}],rf=ia({restrict:"A",require:"ngModel",link:function(a,b,d,c){c.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),Ue=Kc("",!0),We=Kc("Odd",0),Ve=Kc("Even",1),Xe=Ra({compile:function(a,b){b.$set("ngCloak",void 0);a.removeClass("ng-cloak")}}),Ye=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],cd={},vh={blur:!0,focus:!0};r("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),
|
||||
function(a){var b=wa("ng-"+a);cd[b]=["$parse","$rootScope","$exceptionHandler",function(d,c,e){return qd(d,c,e,b,a,vh[a])}]});var af=["$animate","$compile",function(a,b){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(d,c,e,f,g){var k,h,l;d.$watch(e.ngIf,function(d){d?h||g(function(d,f){h=f;d[d.length++]=b.$$createComment("end ngIf",e.ngIf);k={clone:d};a.enter(d,c.parent(),c)}):(l&&(l.remove(),l=null),h&&(h.$destroy(),h=null),k&&(l=tb(k.clone),
|
||||
a.leave(l).done(function(a){!1!==a&&(l=null)}),k=null))})}}}],bf=["$templateRequest","$anchorScroll","$animate",function(a,b,d){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:ca.noop,compile:function(c,e){var f=e.ngInclude||e.src,g=e.onload||"",k=e.autoscroll;return function(c,e,m,p,n){var r=0,q,t,x,v=function(){t&&(t.remove(),t=null);q&&(q.$destroy(),q=null);x&&(d.leave(x).done(function(a){!1!==a&&(t=null)}),t=x,x=null)};c.$watch(f,function(f){var m=function(a){!1===
|
||||
a||!w(k)||k&&!c.$eval(k)||b()},t=++r;f?(a(f,!0).then(function(a){if(!c.$$destroyed&&t===r){var b=c.$new();p.template=a;a=n(b,function(a){v();d.enter(a,null,e).done(m)});q=b;x=a;q.$emit("$includeContentLoaded",f);c.$eval(g)}},function(){c.$$destroyed||t!==r||(v(),c.$emit("$includeContentError",f))}),c.$emit("$includeContentRequested",f)):(v(),p.template=null)})}}}}],uf=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(b,d,c,e){la.call(d[0]).match(/SVG/)?
|
||||
(d.empty(),a(ed(e.template,C.document).childNodes)(b,function(a){d.append(a)},{futureParentElement:d})):(d.html(e.template),a(d.contents())(b))}}}],cf=Ra({priority:450,compile:function(){return{pre:function(a,b,d){a.$eval(d.ngInit)}}}}),qf=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,b,d,c){var e=d.ngList||", ",f="false"!==d.ngTrim,g=f?U(e):e;c.$parsers.push(function(a){if(!z(a)){var b=[];a&&r(a.split(g),function(a){a&&b.push(f?U(a):a)});return b}});c.$formatters.push(function(a){if(H(a))return a.join(e)});
|
||||
c.$isEmpty=function(a){return!a||!a.length}}}},mb="ng-valid",$d="ng-invalid",Za="ng-pristine",Vb="ng-dirty",ob=F("ngModel");Rb.$inject="$scope $exceptionHandler $attrs $element $parse $animate $timeout $q $interpolate".split(" ");Rb.prototype={$$initGetterSetters:function(){if(this.$options.getOption("getterSetter")){var a=this.$$parse(this.$$attr.ngModel+"()"),b=this.$$parse(this.$$attr.ngModel+"($$$p)");this.$$ngModelGet=function(b){var c=this.$$parsedNgModel(b);B(c)&&(c=a(b));return c};this.$$ngModelSet=
|
||||
function(a,c){B(this.$$parsedNgModel(a))?b(a,{$$$p:c}):this.$$parsedNgModelAssign(a,c)}}else if(!this.$$parsedNgModel.assign)throw ob("nonassign",this.$$attr.ngModel,za(this.$$element));},$render:E,$isEmpty:function(a){return z(a)||""===a||null===a||a!==a},$$updateEmptyClasses:function(a){this.$isEmpty(a)?(this.$$animate.removeClass(this.$$element,"ng-not-empty"),this.$$animate.addClass(this.$$element,"ng-empty")):(this.$$animate.removeClass(this.$$element,"ng-empty"),this.$$animate.addClass(this.$$element,
|
||||
"ng-not-empty"))},$setPristine:function(){this.$dirty=!1;this.$pristine=!0;this.$$animate.removeClass(this.$$element,Vb);this.$$animate.addClass(this.$$element,Za)},$setDirty:function(){this.$dirty=!0;this.$pristine=!1;this.$$animate.removeClass(this.$$element,Za);this.$$animate.addClass(this.$$element,Vb);this.$$parentForm.$setDirty()},$setUntouched:function(){this.$touched=!1;this.$untouched=!0;this.$$animate.setClass(this.$$element,"ng-untouched","ng-touched")},$setTouched:function(){this.$touched=
|
||||
!0;this.$untouched=!1;this.$$animate.setClass(this.$$element,"ng-touched","ng-untouched")},$rollbackViewValue:function(){this.$$timeout.cancel(this.$$pendingDebounce);this.$viewValue=this.$$lastCommittedViewValue;this.$render()},$validate:function(){if(!X(this.$modelValue)){var a=this.$$lastCommittedViewValue,b=this.$$rawModelValue,d=this.$valid,c=this.$modelValue,e=this.$options.getOption("allowInvalid"),f=this;this.$$runValidators(b,a,function(a){e||d===a||(f.$modelValue=a?b:void 0,f.$modelValue!==
|
||||
c&&f.$$writeModelToScope())})}},$$runValidators:function(a,b,d){function c(){var c=!0;r(h.$validators,function(d,e){var g=Boolean(d(a,b));c=c&&g;f(e,g)});return c?!0:(r(h.$asyncValidators,function(a,b){f(b,null)}),!1)}function e(){var c=[],d=!0;r(h.$asyncValidators,function(e,g){var h=e(a,b);if(!h||!B(h.then))throw ob("nopromise",h);f(g,void 0);c.push(h.then(function(){f(g,!0)},function(){d=!1;f(g,!1)}))});c.length?h.$$q.all(c).then(function(){g(d)},E):g(!0)}function f(a,b){k===h.$$currentValidationRunId&&
|
||||
h.$setValidity(a,b)}function g(a){k===h.$$currentValidationRunId&&d(a)}this.$$currentValidationRunId++;var k=this.$$currentValidationRunId,h=this;(function(){var a=h.$$parserName;if(z(h.$$parserValid))f(a,null);else return h.$$parserValid||(r(h.$validators,function(a,b){f(b,null)}),r(h.$asyncValidators,function(a,b){f(b,null)})),f(a,h.$$parserValid),h.$$parserValid;return!0})()?c()?e():g(!1):g(!1)},$commitViewValue:function(){var a=this.$viewValue;this.$$timeout.cancel(this.$$pendingDebounce);if(this.$$lastCommittedViewValue!==
|
||||
a||""===a&&this.$$hasNativeValidators)this.$$updateEmptyClasses(a),this.$$lastCommittedViewValue=a,this.$pristine&&this.$setDirty(),this.$$parseAndValidate()},$$parseAndValidate:function(){var a=this.$$lastCommittedViewValue,b=this;this.$$parserValid=z(a)?void 0:!0;this.$setValidity(this.$$parserName,null);this.$$parserName="parse";if(this.$$parserValid)for(var d=0;d<this.$parsers.length;d++)if(a=this.$parsers[d](a),z(a)){this.$$parserValid=!1;break}X(this.$modelValue)&&(this.$modelValue=this.$$ngModelGet(this.$$scope));
|
||||
var c=this.$modelValue,e=this.$options.getOption("allowInvalid");this.$$rawModelValue=a;e&&(this.$modelValue=a,b.$modelValue!==c&&b.$$writeModelToScope());this.$$runValidators(a,this.$$lastCommittedViewValue,function(d){e||(b.$modelValue=d?a:void 0,b.$modelValue!==c&&b.$$writeModelToScope())})},$$writeModelToScope:function(){this.$$ngModelSet(this.$$scope,this.$modelValue);r(this.$viewChangeListeners,function(a){try{a()}catch(b){this.$$exceptionHandler(b)}},this)},$setViewValue:function(a,b){this.$viewValue=
|
||||
a;this.$options.getOption("updateOnDefault")&&this.$$debounceViewValueCommit(b)},$$debounceViewValueCommit:function(a){var b=this.$options.getOption("debounce");W(b[a])?b=b[a]:W(b["default"])&&-1===this.$options.getOption("updateOn").indexOf(a)?b=b["default"]:W(b["*"])&&(b=b["*"]);this.$$timeout.cancel(this.$$pendingDebounce);var d=this;0<b?this.$$pendingDebounce=this.$$timeout(function(){d.$commitViewValue()},b):this.$$rootScope.$$phase?this.$commitViewValue():this.$$scope.$apply(function(){d.$commitViewValue()})},
|
||||
$overrideModelOptions:function(a){this.$options=this.$options.createChild(a);this.$$setUpdateOnEvents()},$processModelValue:function(){var a=this.$$format();this.$viewValue!==a&&(this.$$updateEmptyClasses(a),this.$viewValue=this.$$lastCommittedViewValue=a,this.$render(),this.$$runValidators(this.$modelValue,this.$viewValue,E))},$$format:function(){for(var a=this.$formatters,b=a.length,d=this.$modelValue;b--;)d=a[b](d);return d},$$setModelValue:function(a){this.$modelValue=this.$$rawModelValue=a;this.$$parserValid=
|
||||
void 0;this.$processModelValue()},$$setUpdateOnEvents:function(){this.$$updateEvents&&this.$$element.off(this.$$updateEvents,this.$$updateEventHandler);if(this.$$updateEvents=this.$options.getOption("updateOn"))this.$$element.on(this.$$updateEvents,this.$$updateEventHandler)},$$updateEventHandler:function(a){this.$$debounceViewValueCommit(a&&a.type)}};ae({clazz:Rb,set:function(a,b){a[b]=!0},unset:function(a,b){delete a[b]}});var pf=["$rootScope",function(a){return{restrict:"A",require:["ngModel",
|
||||
"^?form","^?ngModelOptions"],controller:Rb,priority:1,compile:function(b){b.addClass(Za).addClass("ng-untouched").addClass(mb);return{pre:function(a,b,e,f){var g=f[0];b=f[1]||g.$$parentForm;if(f=f[2])g.$options=f.$options;g.$$initGetterSetters();b.$addControl(g);e.$observe("name",function(a){g.$name!==a&&g.$$parentForm.$$renameControl(g,a)});a.$on("$destroy",function(){g.$$parentForm.$removeControl(g)})},post:function(b,c,e,f){function g(){k.$setTouched()}var k=f[0];k.$$setUpdateOnEvents();c.on("blur",
|
||||
function(){k.$touched||(a.$$phase?b.$evalAsync(g):b.$apply(g))})}}}}}],Sb,wh=/(\s+|^)default(\s+|$)/;Lc.prototype={getOption:function(a){return this.$$options[a]},createChild:function(a){var b=!1;a=S({},a);r(a,function(d,c){"$inherit"===d?"*"===c?b=!0:(a[c]=this.$$options[c],"updateOn"===c&&(a.updateOnDefault=this.$$options.updateOnDefault)):"updateOn"===c&&(a.updateOnDefault=!1,a[c]=U(d.replace(wh,function(){a.updateOnDefault=!0;return" "})))},this);b&&(delete a["*"],ge(a,this.$$options));ge(a,Sb.$$options);
|
||||
return new Lc(a)}};Sb=new Lc({updateOn:"",updateOnDefault:!0,debounce:0,getterSetter:!1,allowInvalid:!1,timezone:null});var tf=function(){function a(a,d){this.$$attrs=a;this.$$scope=d}a.$inject=["$attrs","$scope"];a.prototype={$onInit:function(){var a=this.parentCtrl?this.parentCtrl.$options:Sb,d=this.$$scope.$eval(this.$$attrs.ngModelOptions);this.$options=a.createChild(d)}};return{restrict:"A",priority:10,require:{parentCtrl:"?^^ngModelOptions"},bindToController:!0,controller:a}},df=Ra({terminal:!0,
|
||||
priority:1E3}),xh=F("ngOptions"),yh=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([$\w][$\w]*)|(?:\(\s*([$\w][$\w]*)\s*,\s*([$\w][$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,nf=["$compile","$document","$parse",function(a,b,d){function c(a,b,c){function e(a,b,c,d,f){this.selectValue=a;this.viewValue=b;this.label=c;this.group=d;this.disabled=f}function f(a){var b;if(!r&&ya(a))b=a;else{b=[];for(var c in a)a.hasOwnProperty(c)&&
|
||||
"$"!==c.charAt(0)&&b.push(c)}return b}var p=a.match(yh);if(!p)throw xh("iexp",a,za(b));var n=p[5]||p[7],r=p[6];a=/ as /.test(p[0])&&p[1];var q=p[9];b=d(p[2]?p[1]:n);var t=a&&d(a)||b,w=q&&d(q),v=q?function(a,b){return w(c,b)}:function(a){return La(a)},x=function(a,b){return v(a,A(a,b))},z=d(p[2]||p[1]),y=d(p[3]||""),J=d(p[4]||""),I=d(p[8]),B={},A=r?function(a,b){B[r]=b;B[n]=a;return B}:function(a){B[n]=a;return B};return{trackBy:q,getTrackByValue:x,getWatchables:d(I,function(a){var b=[];a=a||[];for(var d=
|
||||
f(a),e=d.length,g=0;g<e;g++){var k=a===d?g:d[g],l=a[k],k=A(l,k),l=v(l,k);b.push(l);if(p[2]||p[1])l=z(c,k),b.push(l);p[4]&&(k=J(c,k),b.push(k))}return b}),getOptions:function(){for(var a=[],b={},d=I(c)||[],g=f(d),k=g.length,n=0;n<k;n++){var p=d===g?n:g[n],r=A(d[p],p),s=t(c,r),p=v(s,r),w=z(c,r),B=y(c,r),r=J(c,r),s=new e(p,s,w,B,r);a.push(s);b[p]=s}return{items:a,selectValueMap:b,getOptionFromViewValue:function(a){return b[x(a)]},getViewValueFromOption:function(a){return q?Ia(a.viewValue):a.viewValue}}}}}
|
||||
var e=C.document.createElement("option"),f=C.document.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","ngModel"],link:{pre:function(a,b,c,d){d[0].registerOption=E},post:function(d,k,h,l){function m(a){var b=(a=v.getOptionFromViewValue(a))&&a.element;b&&!b.selected&&(b.selected=!0);return a}function p(a,b){a.element=b;b.disabled=a.disabled;a.label!==b.label&&(b.label=a.label,b.textContent=a.label);b.value=a.selectValue}var n=l[0],q=l[1],z=h.multiple;l=0;for(var t=k.children(),
|
||||
B=t.length;l<B;l++)if(""===t[l].value){n.hasEmptyOption=!0;n.emptyOption=t.eq(l);break}k.empty();l=!!n.emptyOption;x(e.cloneNode(!1)).val("?");var v,A=c(h.ngOptions,k,d),C=b[0].createDocumentFragment();n.generateUnknownOptionValue=function(a){return"?"};z?(n.writeValue=function(a){if(v){var b=a&&a.map(m)||[];v.items.forEach(function(a){a.element.selected&&-1===Array.prototype.indexOf.call(b,a)&&(a.element.selected=!1)})}},n.readValue=function(){var a=k.val()||[],b=[];r(a,function(a){(a=v.selectValueMap[a])&&
|
||||
!a.disabled&&b.push(v.getViewValueFromOption(a))});return b},A.trackBy&&d.$watchCollection(function(){if(H(q.$viewValue))return q.$viewValue.map(function(a){return A.getTrackByValue(a)})},function(){q.$render()})):(n.writeValue=function(a){if(v){var b=k[0].options[k[0].selectedIndex],c=v.getOptionFromViewValue(a);b&&b.removeAttribute("selected");c?(k[0].value!==c.selectValue&&(n.removeUnknownOption(),k[0].value=c.selectValue,c.element.selected=!0),c.element.setAttribute("selected","selected")):n.selectUnknownOrEmptyOption(a)}},
|
||||
n.readValue=function(){var a=v.selectValueMap[k.val()];return a&&!a.disabled?(n.unselectEmptyOption(),n.removeUnknownOption(),v.getViewValueFromOption(a)):null},A.trackBy&&d.$watch(function(){return A.getTrackByValue(q.$viewValue)},function(){q.$render()}));l&&(a(n.emptyOption)(d),k.prepend(n.emptyOption),8===n.emptyOption[0].nodeType?(n.hasEmptyOption=!1,n.registerOption=function(a,b){""===b.val()&&(n.hasEmptyOption=!0,n.emptyOption=b,n.emptyOption.removeClass("ng-scope"),q.$render(),b.on("$destroy",
|
||||
function(){var a=n.$isEmptyOptionSelected();n.hasEmptyOption=!1;n.emptyOption=void 0;a&&q.$render()}))}):n.emptyOption.removeClass("ng-scope"));d.$watchCollection(A.getWatchables,function(){var a=v&&n.readValue();if(v)for(var b=v.items.length-1;0<=b;b--){var c=v.items[b];w(c.group)?Fb(c.element.parentNode):Fb(c.element)}v=A.getOptions();var d={};v.items.forEach(function(a){var b;if(w(a.group)){b=d[a.group];b||(b=f.cloneNode(!1),C.appendChild(b),b.label=null===a.group?"null":a.group,d[a.group]=b);
|
||||
var c=e.cloneNode(!1);b.appendChild(c);p(a,c)}else b=e.cloneNode(!1),C.appendChild(b),p(a,b)});k[0].appendChild(C);q.$render();q.$isEmpty(a)||(b=n.readValue(),(A.trackBy||z?va(a,b):a===b)||(q.$setViewValue(b),q.$render()))})}}}}],ef=["$locale","$interpolate","$log",function(a,b,d){var c=/{}/g,e=/^when(Minus)?(.+)$/;return{link:function(f,g,k){function h(a){g.text(a||"")}var l=k.count,m=k.$attr.when&&g.attr(k.$attr.when),p=k.offset||0,n=f.$eval(m)||{},q={},w=b.startSymbol(),t=b.endSymbol(),x=w+l+"-"+
|
||||
p+t,v=ca.noop,A;r(k,function(a,b){var c=e.exec(b);c&&(c=(c[1]?"-":"")+K(c[2]),n[c]=g.attr(k.$attr[b]))});r(n,function(a,d){q[d]=b(a.replace(c,x))});f.$watch(l,function(b){var c=parseFloat(b),e=X(c);e||c in n||(c=a.pluralCat(c-p));c===A||e&&X(A)||(v(),e=q[c],z(e)?(null!=b&&d.debug("ngPluralize: no rule defined for '"+c+"' in "+m),v=E,h()):v=f.$watch(e,h),A=c)})}}}],qe=F("ngRef"),ff=["$parse",function(a){return{priority:-1,restrict:"A",compile:function(b,d){var c=wa(ua(b)),e=a(d.ngRef),f=e.assign||
|
||||
function(){throw qe("nonassign",d.ngRef);};return function(a,b,h){var l;if(h.hasOwnProperty("ngRefRead"))if("$element"===h.ngRefRead)l=b;else{if(l=b.data("$"+h.ngRefRead+"Controller"),!l)throw qe("noctrl",h.ngRefRead,d.ngRef);}else l=b.data("$"+c+"Controller");l=l||b;f(a,l);b.on("$destroy",function(){e(a)===l&&f(a,null)})}}}}],gf=["$parse","$animate","$compile",function(a,b,d){var c=F("ngRepeat"),e=function(a,b,c,d,e,f,g){a[c]=d;e&&(a[e]=f);a.$index=b;a.$first=0===b;a.$last=b===g-1;a.$middle=!(a.$first||
|
||||
a.$last);a.$odd=!(a.$even=0===(b&1))},f=function(a,b,c){return La(c)},g=function(a,b){return b};return{restrict:"A",multiElement:!0,transclude:"element",priority:1E3,terminal:!0,$$tlb:!0,compile:function(k,h){var l=h.ngRepeat,m=d.$$createComment("end ngRepeat",l),p=l.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!p)throw c("iexp",l);var n=p[1],q=p[2],w=p[3],t=p[4],p=n.match(/^(?:(\s*[$\w]+)|\(\s*([$\w]+)\s*,\s*([$\w]+)\s*\))$/);if(!p)throw c("iidexp",
|
||||
n);var x=p[3]||p[1],v=p[2];if(w&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(w)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(w)))throw c("badident",w);var z;if(t){var A={$id:La},y=a(t);z=function(a,b,c,d){v&&(A[v]=b);A[x]=c;A.$index=d;return y(a,A)}}return function(a,d,h,k,n){var p=T();a.$watchCollection(q,function(h){var k,q,t=d[0],s,y=T(),B,C,E,D,H,F,K;w&&(a[w]=h);if(ya(h))H=h,q=z||f;else for(K in q=z||g,H=[],h)ta.call(h,K)&&"$"!==K.charAt(0)&&H.push(K);
|
||||
B=H.length;K=Array(B);for(k=0;k<B;k++)if(C=h===H?k:H[k],E=h[C],D=q(a,C,E,k),p[D])F=p[D],delete p[D],y[D]=F,K[k]=F;else{if(y[D])throw r(K,function(a){a&&a.scope&&(p[a.id]=a)}),c("dupes",l,D,E);K[k]={id:D,scope:void 0,clone:void 0};y[D]=!0}A&&(A[x]=void 0);for(s in p){F=p[s];D=tb(F.clone);b.leave(D);if(D[0].parentNode)for(k=0,q=D.length;k<q;k++)D[k].$$NG_REMOVED=!0;F.scope.$destroy()}for(k=0;k<B;k++)if(C=h===H?k:H[k],E=h[C],F=K[k],F.scope){s=t;do s=s.nextSibling;while(s&&s.$$NG_REMOVED);F.clone[0]!==
|
||||
s&&b.move(tb(F.clone),null,t);t=F.clone[F.clone.length-1];e(F.scope,k,x,E,v,C,B)}else n(function(a,c){F.scope=c;var d=m.cloneNode(!1);a[a.length++]=d;b.enter(a,null,t);t=d;F.clone=a;y[F.id]=F;e(F.scope,k,x,E,v,C,B)});p=y})}}}}],hf=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,d,c){b.$watch(c.ngShow,function(b){a[b?"removeClass":"addClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],$e=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,
|
||||
d,c){b.$watch(c.ngHide,function(b){a[b?"addClass":"removeClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],jf=Ra(function(a,b,d){a.$watchCollection(d.ngStyle,function(a,d){d&&a!==d&&(a||(a={}),r(d,function(b,d){null==a[d]&&(a[d]="")}));a&&b.css(a)})}),kf=["$animate","$compile",function(a,b){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(d,c,e,f){var g=[],k=[],h=[],l=[],m=function(a,b){return function(c){!1!==c&&a.splice(b,1)}};d.$watch(e.ngSwitch||
|
||||
e.on,function(c){for(var d,e;h.length;)a.cancel(h.pop());d=0;for(e=l.length;d<e;++d){var q=tb(k[d].clone);l[d].$destroy();(h[d]=a.leave(q)).done(m(h,d))}k.length=0;l.length=0;(g=f.cases["!"+c]||f.cases["?"])&&r(g,function(c){c.transclude(function(d,e){l.push(e);var f=c.element;d[d.length++]=b.$$createComment("end ngSwitchWhen");k.push({clone:d});a.enter(d,f.parent(),f)})})})}}}],lf=Ra({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,d,c,e){a=d.ngSwitchWhen.split(d.ngSwitchWhenSeparator).sort().filter(function(a,
|
||||
b,c){return c[b-1]!==a});r(a,function(a){c.cases["!"+a]=c.cases["!"+a]||[];c.cases["!"+a].push({transclude:e,element:b})})}}),mf=Ra({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,d,c,e){c.cases["?"]=c.cases["?"]||[];c.cases["?"].push({transclude:e,element:b})}}),zh=F("ngTransclude"),of=["$compile",function(a){return{restrict:"EAC",compile:function(b){var d=a(b.contents());b.empty();return function(a,b,f,g,k){function h(){d(a,function(a){b.append(a)})}if(!k)throw zh("orphan",
|
||||
za(b));f.ngTransclude===f.$attr.ngTransclude&&(f.ngTransclude="");f=f.ngTransclude||f.ngTranscludeSlot;k(function(a,c){var d;if(d=a.length)a:{d=0;for(var f=a.length;d<f;d++){var g=a[d];if(g.nodeType!==Pa||g.nodeValue.trim()){d=!0;break a}}d=void 0}d?b.append(a):(h(),c.$destroy())},null,f);f&&!k.isSlotFilled(f)&&h()}}}}],Oe=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(b,d){"text/ng-template"===d.type&&a.put(d.id,b[0].text)}}}],Ah={$setViewValue:E,$render:E},Bh=["$element",
|
||||
"$scope",function(a,b){function d(){g||(g=!0,b.$$postDigest(function(){g=!1;e.ngModelCtrl.$render()}))}function c(a){k||(k=!0,b.$$postDigest(function(){b.$$destroyed||(k=!1,e.ngModelCtrl.$setViewValue(e.readValue()),a&&e.ngModelCtrl.$render())}))}var e=this,f=new Hb;e.selectValueMap={};e.ngModelCtrl=Ah;e.multiple=!1;e.unknownOption=x(C.document.createElement("option"));e.hasEmptyOption=!1;e.emptyOption=void 0;e.renderUnknownOption=function(b){b=e.generateUnknownOptionValue(b);e.unknownOption.val(b);
|
||||
a.prepend(e.unknownOption);Oa(e.unknownOption,!0);a.val(b)};e.updateUnknownOption=function(b){b=e.generateUnknownOptionValue(b);e.unknownOption.val(b);Oa(e.unknownOption,!0);a.val(b)};e.generateUnknownOptionValue=function(a){return"? "+La(a)+" ?"};e.removeUnknownOption=function(){e.unknownOption.parent()&&e.unknownOption.remove()};e.selectEmptyOption=function(){e.emptyOption&&(a.val(""),Oa(e.emptyOption,!0))};e.unselectEmptyOption=function(){e.hasEmptyOption&&Oa(e.emptyOption,!1)};b.$on("$destroy",
|
||||
function(){e.renderUnknownOption=E});e.readValue=function(){var b=a.val(),b=b in e.selectValueMap?e.selectValueMap[b]:b;return e.hasOption(b)?b:null};e.writeValue=function(b){var c=a[0].options[a[0].selectedIndex];c&&Oa(x(c),!1);e.hasOption(b)?(e.removeUnknownOption(),c=La(b),a.val(c in e.selectValueMap?c:b),Oa(x(a[0].options[a[0].selectedIndex]),!0)):e.selectUnknownOrEmptyOption(b)};e.addOption=function(a,b){if(8!==b[0].nodeType){Ja(a,'"option value"');""===a&&(e.hasEmptyOption=!0,e.emptyOption=
|
||||
b);var c=f.get(a)||0;f.set(a,c+1);d()}};e.removeOption=function(a){var b=f.get(a);b&&(1===b?(f.delete(a),""===a&&(e.hasEmptyOption=!1,e.emptyOption=void 0)):f.set(a,b-1))};e.hasOption=function(a){return!!f.get(a)};e.$hasEmptyOption=function(){return e.hasEmptyOption};e.$isUnknownOptionSelected=function(){return a[0].options[0]===e.unknownOption[0]};e.$isEmptyOptionSelected=function(){return e.hasEmptyOption&&a[0].options[a[0].selectedIndex]===e.emptyOption[0]};e.selectUnknownOrEmptyOption=function(a){null==
|
||||
a&&e.emptyOption?(e.removeUnknownOption(),e.selectEmptyOption()):e.unknownOption.parent().length?e.updateUnknownOption(a):e.renderUnknownOption(a)};var g=!1,k=!1;e.registerOption=function(a,b,f,g,k){if(f.$attr.ngValue){var q,r;f.$observe("value",function(a){var d,f=b.prop("selected");w(r)&&(e.removeOption(q),delete e.selectValueMap[r],d=!0);r=La(a);q=a;e.selectValueMap[r]=a;e.addOption(a,b);b.attr("value",r);d&&f&&c()})}else g?f.$observe("value",function(a){e.readValue();var d,f=b.prop("selected");
|
||||
w(q)&&(e.removeOption(q),d=!0);q=a;e.addOption(a,b);d&&f&&c()}):k?a.$watch(k,function(a,d){f.$set("value",a);var g=b.prop("selected");d!==a&&e.removeOption(d);e.addOption(a,b);d&&g&&c()}):e.addOption(f.value,b);f.$observe("disabled",function(a){if("true"===a||a&&b.prop("selected"))e.multiple?c(!0):(e.ngModelCtrl.$setViewValue(null),e.ngModelCtrl.$render())});b.on("$destroy",function(){var a=e.readValue(),b=f.value;e.removeOption(b);d();(e.multiple&&a&&-1!==a.indexOf(b)||a===b)&&c(!0)})}}],Pe=function(){return{restrict:"E",
|
||||
require:["select","?ngModel"],controller:Bh,priority:1,link:{pre:function(a,b,d,c){var e=c[0],f=c[1];if(f){if(e.ngModelCtrl=f,b.on("change",function(){e.removeUnknownOption();a.$apply(function(){f.$setViewValue(e.readValue())})}),d.multiple){e.multiple=!0;e.readValue=function(){var a=[];r(b.find("option"),function(b){b.selected&&!b.disabled&&(b=b.value,a.push(b in e.selectValueMap?e.selectValueMap[b]:b))});return a};e.writeValue=function(a){r(b.find("option"),function(b){var c=!!a&&(-1!==Array.prototype.indexOf.call(a,
|
||||
b.value)||-1!==Array.prototype.indexOf.call(a,e.selectValueMap[b.value]));c!==b.selected&&Oa(x(b),c)})};var g,k=NaN;a.$watch(function(){k!==f.$viewValue||va(g,f.$viewValue)||(g=ja(f.$viewValue),f.$render());k=f.$viewValue});f.$isEmpty=function(a){return!a||0===a.length}}}else e.registerOption=E},post:function(a,b,d,c){var e=c[1];if(e){var f=c[0];e.$render=function(){f.writeValue(e.$viewValue)}}}}}},Qe=["$interpolate",function(a){return{restrict:"E",priority:100,compile:function(b,d){var c,e;w(d.ngValue)||
|
||||
(w(d.value)?c=a(d.value,!0):(e=a(b.text(),!0))||d.$set("value",b.text()));return function(a,b,d){var h=b.parent();(h=h.data("$selectController")||h.parent().data("$selectController"))&&h.registerOption(a,b,d,c,e)}}}}],$c=["$parse",function(a){return{restrict:"A",require:"?ngModel",link:function(b,d,c,e){if(e){var f=c.required||a(c.ngRequired)(b);c.required=!0;e.$validators.required=function(a,b){return!f||!e.$isEmpty(b)};c.$observe("required",function(a){f!==a&&(f=a,e.$validate())})}}}}],Zc=["$parse",
|
||||
function(a){return{restrict:"A",require:"?ngModel",compile:function(b,d){var c,e;d.ngPattern&&(c=d.ngPattern,e="/"===d.ngPattern.charAt(0)&&ie.test(d.ngPattern)?function(){return d.ngPattern}:a(d.ngPattern));return function(a,b,d,h){if(h){var l=d.pattern;d.ngPattern?l=e(a):c=d.pattern;var m=he(l,c,b);d.$observe("pattern",function(a){var d=m;m=he(a,c,b);(d&&d.toString())!==(m&&m.toString())&&h.$validate()});h.$validators.pattern=function(a,b){return h.$isEmpty(b)||z(m)||m.test(b)}}}}}}],bd=["$parse",
|
||||
function(a){return{restrict:"A",require:"?ngModel",link:function(b,d,c,e){if(e){var f=c.maxlength||a(c.ngMaxlength)(b),g=Tb(f);c.$observe("maxlength",function(a){f!==a&&(g=Tb(a),f=a,e.$validate())});e.$validators.maxlength=function(a,b){return 0>g||e.$isEmpty(b)||b.length<=g}}}}}],ad=["$parse",function(a){return{restrict:"A",require:"?ngModel",link:function(b,d,c,e){if(e){var f=c.minlength||a(c.ngMinlength)(b),g=Tb(f)||-1;c.$observe("minlength",function(a){f!==a&&(g=Tb(a)||-1,f=a,e.$validate())});
|
||||
e.$validators.minlength=function(a,b){return e.$isEmpty(b)||b.length>=g}}}}}];C.angular.bootstrap?C.console&&console.log("WARNING: Tried to load AngularJS more than once."):(Fe(),Je(ca),ca.module("ngLocale",[],["$provide",function(a){function b(a){a+="";var b=a.indexOf(".");return-1==b?0:a.length-b-1}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,
|
||||
MONTH:"January February March April May June July August September October November December".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),STANDALONEMONTH:"January February March April May June July August September October November December".split(" "),WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a","short":"M/d/yy h:mm a",
|
||||
shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-\u00a4",negSuf:"",posPre:"\u00a4",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(a,c){var e=a|0,f=c;void 0===f&&(f=Math.min(b(a),3));Math.pow(10,f);return 1==e&&0==f?"one":"other"}})}]),x(function(){Ae(C.document,Uc)}))})(window);
|
||||
!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>');
|
||||
//# sourceMappingURL=angular.min.js.map
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"version":3,
|
||||
"file":"angular.min.js",
|
||||
"lineCount":349,
|
||||
"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAAS,CAwClBC,QAASA,GAAmB,CAACC,CAAD,CAAS,CACnC,GAAIC,CAAA,CAASD,CAAT,CAAJ,CACME,CAAA,CAAUF,CAAAG,eAAV,CAGJ,GAFEC,EAAAD,eAEF,CAFgCE,EAAA,CAAsBL,CAAAG,eAAtB,CAAA,CAA+CH,CAAAG,eAA/C,CAAuEG,GAEvG,EAAIJ,CAAA,CAAUF,CAAAO,sBAAV,CAAJ,EAA+CC,EAAA,CAAUR,CAAAO,sBAAV,CAA/C,GACEH,EAAAG,sBADF,CACuCP,CAAAO,sBADvC,CAJF,KAQE,OAAOH,GAT0B,CAkBrCC,QAASA,GAAqB,CAACI,CAAD,CAAW,CACvC,MAAOC,EAAA,CAASD,CAAT,CAAP,EAAwC,CAAxC,CAA6BA,CADU,CAmCzCE,QAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,KAAAA,OAAAA,SAAAA,EAAAA,CAAAA,IAAAA,EAAAA,SAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CAAAA,GAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,GAAAA,CAAAA,EAAAA,EAAAA,CAAAA,CAAAA,sCAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,GAAAA,CAAAA,EAAAA,EAAAA,CAAAA,KAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,SAAAA,OAAAA,CAAAA,CAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CAAAA,EAAAA,CAAAA,CAAAA,GAAAA,CAAAA,GAAAA,EAAAA,GAAAA,EAAAA,CAAAA,CAAAA,CAAAA,EAAAA,GAAAA,KAAAA,EAAAA,kBAAAA;AAAAA,CAAAA,EAAAA,CAAAA,SAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CAAAA,UAAAA,EAAAA,MAAAA,EAAAA,CAAAA,CAAAA,SAAAA,EAAAA,QAAAA,CAAAA,aAAAA,CAAAA,EAAAA,CAAAA,CAAAA,WAAAA,EAAAA,MAAAA,EAAAA,CAAAA,WAAAA,CAAAA,QAAAA,EAAAA,MAAAA,EAAAA,CAAAA,IAAAA,UAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,MAAAA,KAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CA2NAC,QAASA,GAAW,CAACC,CAAD,CAAM,CAGxB,GAAW,IAAX,EAAIA,CAAJ,EAAmBC,EAAA,CAASD,CAAT,CAAnB,CAAkC,MAAO,CAAA,CAMzC,IAAIE,CAAA,CAAQF,CAAR,CAAJ,EAAoBG,CAAA,CAASH,CAAT,CAApB,EAAsCI,CAAtC,EAAgDJ,CAAhD,WAA+DI,EAA/D,CAAwE,MAAO,CAAA,CAI/E,KAAIC,EAAS,QAATA,EAAqBC,OAAA,CAAON,CAAP,CAArBK,EAAoCL,CAAAK,OAIxC,OAAOR,EAAA,CAASQ,CAAT,CAAP,GAAsC,CAAtC,EAA4BA,CAA5B,EAA4CA,CAA5C,CAAqD,CAArD,GAA2DL,EAA3D,EAAsF,UAAtF,GAAkE,MAAOA,EAAAO,KAAzE,CAjBwB,CAwD1BC,QAASA,EAAO,CAACR,CAAD,CAAMS,CAAN,CAAgBC,CAAhB,CAAyB,CAAA,IACnCC,CADmC,CAC9BN,CACT,IAAIL,CAAJ,CACE,GAAIY,CAAA,CAAWZ,CAAX,CAAJ,CACE,IAAKW,CAAL,GAAYX,EAAZ,CACc,WAAZ,GAAIW,CAAJ,EAAmC,QAAnC,GAA2BA,CAA3B,EAAuD,MAAvD,GAA+CA,CAA/C,EAAiEX,CAAAa,eAAA,CAAmBF,CAAnB,CAAjE,EACEF,CAAAK,KAAA,CAAcJ,CAAd,CAAuBV,CAAA,CAAIW,CAAJ,CAAvB,CAAiCA,CAAjC,CAAsCX,CAAtC,CAHN,KAMO,IAAIE,CAAA,CAAQF,CAAR,CAAJ;AAAoBD,EAAA,CAAYC,CAAZ,CAApB,CAAsC,CAC3C,IAAIe,EAA6B,QAA7BA,GAAc,MAAOf,EACpBW,EAAA,CAAM,CAAX,KAAcN,CAAd,CAAuBL,CAAAK,OAAvB,CAAmCM,CAAnC,CAAyCN,CAAzC,CAAiDM,CAAA,EAAjD,CACE,CAAII,CAAJ,EAAmBJ,CAAnB,GAA0BX,EAA1B,GACES,CAAAK,KAAA,CAAcJ,CAAd,CAAuBV,CAAA,CAAIW,CAAJ,CAAvB,CAAiCA,CAAjC,CAAsCX,CAAtC,CAJuC,CAAtC,IAOA,IAAIA,CAAAQ,QAAJ,EAAmBR,CAAAQ,QAAnB,GAAmCA,CAAnC,CACHR,CAAAQ,QAAA,CAAYC,CAAZ,CAAsBC,CAAtB,CAA+BV,CAA/B,CADG,KAEA,IAAIgB,EAAA,CAAchB,CAAd,CAAJ,CAEL,IAAKW,CAAL,GAAYX,EAAZ,CACES,CAAAK,KAAA,CAAcJ,CAAd,CAAuBV,CAAA,CAAIW,CAAJ,CAAvB,CAAiCA,CAAjC,CAAsCX,CAAtC,CAHG,KAKA,IAAkC,UAAlC,GAAI,MAAOA,EAAAa,eAAX,CAEL,IAAKF,CAAL,GAAYX,EAAZ,CACMA,CAAAa,eAAA,CAAmBF,CAAnB,CAAJ,EACEF,CAAAK,KAAA,CAAcJ,CAAd,CAAuBV,CAAA,CAAIW,CAAJ,CAAvB,CAAiCA,CAAjC,CAAsCX,CAAtC,CAJC,KASL,KAAKW,CAAL,GAAYX,EAAZ,CACMa,EAAAC,KAAA,CAAoBd,CAApB,CAAyBW,CAAzB,CAAJ,EACEF,CAAAK,KAAA,CAAcJ,CAAd,CAAuBV,CAAA,CAAIW,CAAJ,CAAvB,CAAiCA,CAAjC,CAAsCX,CAAtC,CAKR,OAAOA,EAvCgC,CA0CzCiB,QAASA,GAAa,CAACjB,CAAD,CAAMS,CAAN,CAAgBC,CAAhB,CAAyB,CAE7C,IADA,IAAIQ,EAAOZ,MAAAY,KAAA,CAAYlB,CAAZ,CAAAmB,KAAA,EAAX,CACSC,EAAI,CAAb,CAAgBA,CAAhB,CAAoBF,CAAAb,OAApB,CAAiCe,CAAA,EAAjC,CACEX,CAAAK,KAAA,CAAcJ,CAAd,CAAuBV,CAAA,CAAIkB,CAAA,CAAKE,CAAL,CAAJ,CAAvB,CAAqCF,CAAA,CAAKE,CAAL,CAArC,CAEF,OAAOF,EALsC,CAc/CG,QAASA,GAAa,CAACC,CAAD,CAAa,CACjC,MAAO,SAAQ,CAACC,CAAD,CAAQZ,CAAR,CAAa,CAACW,CAAA,CAAWX,CAAX,CAAgBY,CAAhB,CAAD,CADK,CAcnCC,QAASA,GAAO,EAAG,CACjB,MAAO,EAAEC,EADQ,CAtbD;AAyclBC,QAASA,GAAU,CAACC,CAAD,CAAMC,CAAN,CAAYC,CAAZ,CAAkB,CAGnC,IAFA,IAAIC,EAAIH,CAAAI,UAAR,CAESX,EAAI,CAFb,CAEgBY,EAAKJ,CAAAvB,OAArB,CAAkCe,CAAlC,CAAsCY,CAAtC,CAA0C,EAAEZ,CAA5C,CAA+C,CAC7C,IAAIpB,EAAM4B,CAAA,CAAKR,CAAL,CACV,IAAKhC,CAAA,CAASY,CAAT,CAAL,EAAuBY,CAAA,CAAWZ,CAAX,CAAvB,CAEA,IADA,IAAIkB,EAAOZ,MAAAY,KAAA,CAAYlB,CAAZ,CAAX,CACSiC,EAAI,CADb,CACgBC,EAAKhB,CAAAb,OAArB,CAAkC4B,CAAlC,CAAsCC,CAAtC,CAA0CD,CAAA,EAA1C,CAA+C,CAC7C,IAAItB,EAAMO,CAAA,CAAKe,CAAL,CAAV,CACIE,EAAMnC,CAAA,CAAIW,CAAJ,CAENkB,EAAJ,EAAYzC,CAAA,CAAS+C,CAAT,CAAZ,CACMC,EAAA,CAAOD,CAAP,CAAJ,CACER,CAAA,CAAIhB,CAAJ,CADF,CACa,IAAI0B,IAAJ,CAASF,CAAAG,QAAA,EAAT,CADb,CAEWC,EAAA,CAASJ,CAAT,CAAJ,CACLR,CAAA,CAAIhB,CAAJ,CADK,CACM,IAAI6B,MAAJ,CAAWL,CAAX,CADN,CAEIA,CAAAM,SAAJ,CACLd,CAAA,CAAIhB,CAAJ,CADK,CACMwB,CAAAO,UAAA,CAAc,CAAA,CAAd,CADN,CAEIC,EAAA,CAAUR,CAAV,CAAJ,CACLR,CAAA,CAAIhB,CAAJ,CADK,CACMwB,CAAAS,MAAA,EADN,EAGAxD,CAAA,CAASuC,CAAA,CAAIhB,CAAJ,CAAT,CACL,GADyBgB,CAAA,CAAIhB,CAAJ,CACzB,CADoCT,CAAA,CAAQiC,CAAR,CAAA,CAAe,EAAf,CAAoB,EACxD,EAAAT,EAAA,CAAWC,CAAA,CAAIhB,CAAJ,CAAX,CAAqB,CAACwB,CAAD,CAArB,CAA4B,CAAA,CAA5B,CAJK,CAPT,CAcER,CAAA,CAAIhB,CAAJ,CAdF,CAcawB,CAlBgC,CAJF,CA2B/BL,CAtChB,CAsCWH,CArCTI,UADF,CAsCgBD,CAtChB,CAGE,OAmCSH,CAnCFI,UAoCT,OAAOJ,EA/B4B,CAoDrCkB,QAASA,EAAM,CAAClB,CAAD,CAAM,CACnB,MAAOD,GAAA,CAAWC,CAAX,CAAgBmB,EAAAhC,KAAA,CAAWiC,SAAX,CAAsB,CAAtB,CAAhB,CAA0C,CAAA,CAA1C,CADY,CAuCrBC,QAASA,GAAK,CAACrB,CAAD,CAAM,CAClB,MAAOD,GAAA,CAAWC,CAAX,CALine truncated
|
||||
"sources":["angular.js"],
|
||||
"names":["window","errorHandlingConfig","config","isObject","isDefined","objectMaxDepth","minErrConfig","isValidObjectMaxDepth","NaN","urlErrorParamsEnabled","isBoolean","maxDepth","isNumber","minErr","isArrayLike","obj","isWindow","isArray","isString","jqLite","length","Object","item","forEach","iterator","context","key","isFunction","hasOwnProperty","call","isPrimitive","isBlankObject","forEachSorted","keys","sort","i","reverseParams","iteratorFn","value","nextUid","uid","baseExtend","dst","objs","deep","h","$$hashKey","ii","j","jj","src","isDate","Date","valueOf","isRegExp","RegExp","nodeName","cloneNode","isElement","clone","extend","slice","arguments","merge","toInt","str","parseInt","inherit","parent","extra","create","noop","identity","$","valueFn","valueRef","hasCustomToString","toString","isUndefined","getPrototypeOf","arr","Array","isError","tag","Error","isScope","$evalAsync","$watch","isTypedArray","TYPED_ARRAY_REGEXP","test","node","prop","attr","find","makeMap","items","split","nodeName_","element","lowercase","arrayRemove","array","index","indexOf","splice","copy","source","destination","copyRecurse","push","copyElement","stackSource","stackDest","ngMinErr","needsRecurse","copyType","undefined","constructor","buffer","byteOffset","copied","ArrayBuffer","byteLength","set","Uint8Array","re","match","lastIndex","type","simpleCompare","a","b","equals","o1","o2","t1","t2","getTime","keySet","createMap","charAt","concat","array1","array2","bind","self","fn","curryArgs","startIndex","apply","toJsonReplacer","val","document","toJson","pretty","JSON","stringify","fromJson","json","parse","timezoneToOffset","timezone","fallback","replace","ALL_COLONS","requestedTimezoneOffset","isNumberNaN","addDateMinutes","date","minutes","setMinutes","getMinutes","convertTimezoneToLocal","reverse","dateTimezoneOffset","getTimezoneOffset","timezoneOffset","startingTag","empty","elemHtml","append","html","nodeType","NODE_TYPE_TEXT","e","tryDecodeURIComponent","decodeURIComponent","parseKeyValue","keyValue","splitPoint","substring","toKeyValue","parts","arrayValue","encodeUriQuery","join","encodeUriSegment","pctEncodeSpaces","encodeURIComponent","getNgAttribute","ngAttr","ngAttrPrefixes","getAttribute","angularInit","bootstrap","appElement","module","prefix","name","hasAttribute","candidate","querySelector","isAutoBootstrapAllowed","strictDi","console","error","modules","defaultConfig","doBootstrap","injector","unshift","$provide","debugInfoEnabled","$compileProvider","createInjector","invoke","bootstrapApply","scope","compile","$apply","data","NG_ENABLE_DEBUG_INFO","NG_DEFER_BOOTSTRAP","angular","resumeBootstrap","angular.resumeBootstrap","extraModules","resumeDeferredBootstrap","reloadWithDebugInfo","location","reload","getTestability","rootElement","get","snake_case","separator","SNAKE_CASE_REGEXP","letter","pos","toLowerCase","bindJQuery","originalCleanData","bindJQueryFired","jqName","jq","jQuery","on","JQLitePrototype","isolateScope","controller","inheritedData","JQLite","cleanData","jqLite.cleanData","elems","events","elem","_data","$destroy","triggerHandler","assertArg","arg","reason","assertArgFn","acceptArrayAnnotation","assertNotHasOwnProperty","getter","path","bindFnToScope","lastInstance","len","getBlockNodes","nodes","endNode","blockNodes","nextSibling","setupModuleLoader","ensure","factory","$injectorMinErr","$$minErr","requires","configFn","info","invokeLater","provider","method","insertMethod","queue","invokeQueue","moduleInstance","invokeLaterAndSetModuleName","recipeName","factoryFunction","$$moduleName","configBlocks","runBlocks","_invokeQueue","_configBlocks","_runBlocks","service","constant","decorator","animation","filter","directive","component","run","block","shallowCopy","serializeObject","seen","publishExternalAPI","version","$$counter","csp","uppercase","angularModule","ngModule","$$sanitizeUri","$$SanitizeUriProvider","$CompileProvider","htmlAnchorDirective","input","inputDirective","textarea","form","formDirective","script","scriptDirective","select","selectDirective","option","optionDirective","ngBind","ngBindDirective","ngBindHtml","ngBindHtmlDirective","ngBindTemplate","ngBindTemplateDirective","ngClass","ngClassDirective","ngClassEven","ngClassEvenDirective","ngClassOdd","ngClassOddDirective","ngCloak","ngCloakDirective","ngController","ngControllerDirective","ngForm","ngFormDirective","ngHide","ngHideDirective","ngIf","ngIfDirective","ngInclude","ngIncludeDirective","ngInit","ngInitDirective","ngNonBindable","ngNonBindableDirective","ngPluralize","ngPluralizeDirective","ngRef","ngRefDirective","ngRepeat","ngRepeatDirective","ngShow","ngShowDirective","ngStyle","ngStyleDirective","ngSwitch","ngSwitchDirective","ngSwitchWhen","ngSwitchWhenDirective","ngSwitchDefault","ngSwitchDefaultDirective","ngOptions","ngOptionsDirective","ngTransclude","ngTranscludeDirective","ngModel","ngModelDirective","ngList","ngListDirective","ngChange","ngChangeDirective","pattern","patternDirective","ngPattLine truncated
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "angular",
|
||||
"version": "1.7.7",
|
||||
"license": "MIT",
|
||||
"main": "./angular.js",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
require('./angular');
|
||||
module.exports = angular;
|
||||
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"angular@1.7.7",
|
||||
"/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "angular@1.7.7",
|
||||
"_id": "angular@1.7.7",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-MH3JEGd8y/EkNCKJ8EV6Ch0j9X0rZTta/QVIDpBWaIdfh85/e5KO8+ZKgvWIb02MQuiS20pDFmMFlv4ZaLcLWg==",
|
||||
"_location": "/angular",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "angular@1.7.7",
|
||||
"name": "angular",
|
||||
"escapedName": "angular",
|
||||
"rawSpec": "1.7.7",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.7.7"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/angular/-/angular-1.7.7.tgz",
|
||||
"_spec": "1.7.7",
|
||||
"_where": "/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2",
|
||||
"author": {
|
||||
"name": "Angular Core Team",
|
||||
"email": "angular-core+npm@google.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/angular/angular.js/issues"
|
||||
},
|
||||
"description": "HTML enhanced for web apps",
|
||||
"homepage": "http://angularjs.org",
|
||||
"keywords": [
|
||||
"angular",
|
||||
"framework",
|
||||
"browser",
|
||||
"client-side"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "angular",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/angular/angular.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"version": "1.7.7"
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
Copyright (c) 2010-2018, Vladimir Agafonkin
|
||||
Copyright (c) 2010-2011, CloudMade
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are
|
||||
permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
of conditions and the following disclaimer in the documentation and/or other materials
|
||||
provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,32 @@
|
||||
<img width="600" src="https://rawgit.com/Leaflet/Leaflet/master/src/images/logo.svg" alt="Leaflet" />
|
||||
|
||||
Leaflet is the leading open-source JavaScript library for **mobile-friendly interactive maps**.
|
||||
Weighing just about 37 KB of gzipped JS code, it has all the mapping [features][] most developers ever need.
|
||||
|
||||
Leaflet is designed with *simplicity*, *performance* and *usability* in mind.
|
||||
It works efficiently across all major desktop and mobile platforms out of the box,
|
||||
taking advantage of HTML5 and CSS3 on modern browsers while being accessible on older ones too.
|
||||
It can be extended with a huge amount of [plugins][],
|
||||
has a beautiful, easy to use and [well-documented][] API
|
||||
and a simple, readable [source code][] that is a joy to [contribute][] to.
|
||||
|
||||
For more info, docs and tutorials, check out the [official website][].<br>
|
||||
For **Leaflet downloads** (including the built master version), check out the [download page][].
|
||||
|
||||
We're happy to meet new contributors.
|
||||
If you want to **get involved** with Leaflet development, check out the [contribution guide][contribute].
|
||||
Let's make the best mapping library that will ever exist,
|
||||
and push the limits of what's possible with online maps!
|
||||
|
||||
[](https://travis-ci.org/Leaflet/Leaflet)
|
||||
|
||||
[contributors]: https://github.com/Leaflet/Leaflet/graphs/contributors
|
||||
[features]: http://leafletjs.com/#features
|
||||
[plugins]: http://leafletjs.com/plugins.html
|
||||
[well-documented]: http://leafletjs.com/reference.html "Leaflet API reference"
|
||||
[source code]: https://github.com/Leaflet/Leaflet "Leaflet GitHub repository"
|
||||
[hosted on GitHub]: http://github.com/Leaflet/Leaflet
|
||||
[contribute]: https://github.com/Leaflet/Leaflet/blob/master/CONTRIBUTING.md "A guide to contributing to Leaflet"
|
||||
[official website]: http://leafletjs.com
|
||||
[download page]: http://leafletjs.com/download.html
|
||||
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 696 B |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 618 B |
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"leaflet-src.esm.js","sources":["../src/core/Util.js","../src/core/Class.js","../src/core/Events.js","../src/geometry/Point.js","../src/geometry/Bounds.js","../src/geo/LatLngBounds.js","../src/geo/LatLng.js","../src/geo/crs/CRS.js","../src/geo/crs/CRS.Earth.js","../src/geo/projection/Projection.SphericalMercator.js","../src/geometry/Transformation.js","../src/geo/crs/CRS.EPSG3857.js","../src/layer/vector/SVG.Util.js","../src/core/Browser.js","../src/dom/DomEvent.Pointer.js","../src/dom/DomEvent.DoubleTap.js","../src/dom/DomUtil.js","../src/dom/DomEvent.js","../src/dom/PosAnimation.js","../src/map/Map.js","../src/control/Control.js","../src/control/Control.Layers.js","../src/control/Control.Zoom.js","../src/control/Control.Scale.js","../src/control/Control.Attribution.js","../src/control/index.js","../src/core/Handler.js","../src/core/index.js","../src/dom/Draggable.js","../src/geometry/LineUtil.js","../src/geometry/PolyUtil.js","../src/geo/projection/Projection.LonLat.js","../src/geo/projection/Projection.Mercator.js","../src/geo/projection/index.js","../src/geo/crs/CRS.EPSG3395.js","../src/geo/crs/CRS.EPSG4326.js","../src/geo/crs/CRS.Simple.js","../src/geo/crs/index.js","../src/layer/Layer.js","../src/layer/LayerGroup.js","../src/layer/FeatureGroup.js","../src/layer/marker/Icon.js","../src/layer/marker/Icon.Default.js","../src/layer/marker/Marker.Drag.js","../src/layer/marker/Marker.js","../src/layer/vector/Path.js","../src/layer/vector/CircleMarker.js","../src/layer/vector/Circle.js","../src/layer/vector/Polyline.js","../src/layer/vector/Polygon.js","../src/layer/GeoJSON.js","../src/layer/ImageOverlay.js","../src/layer/VideoOverlay.js","../src/layer/DivOverlay.js","../src/layer/Popup.js","../src/layer/Tooltip.js","../src/layer/marker/DivIcon.js","../src/layer/marker/index.js","../src/layer/tile/GridLayer.js","../src/layer/tile/TileLayer.js","../src/layer/tile/TileLayer.WMS.js","../src/layer/tile/index.js","../src/layer/vector/Renderer.js","../src/layer/vector/Canvas.js","../src/layer/vector/SVG.VML.js","../src/layer/vector/SVG.js","../src/layer/vector/Renderer.getRenderer.js","../src/layer/vector/Rectangle.js","../src/layer/vector/index.js","../src/layer/index.js","../src/map/handler/Map.BoxZoom.js","../src/map/handler/Map.DoubleClickZoom.js","../src/map/handler/Map.Drag.js","../src/map/handler/Map.Keyboard.js","../src/map/handler/Map.ScrollWheelZoom.js","../src/map/handler/Map.Tap.js","../src/map/handler/Map.TouchZoom.js","../src/map/index.js","../src/Leaflet.js"],"sourcesContent":["/*\r\n * @namespace Util\r\n *\r\n * Various utility functions, used by Leaflet internally.\r\n */\r\n\r\nexport var freeze = Object.freeze;\r\nObject.freeze = function (obj) { return obj; };\r\n\r\n// @function extend(dest: Object, src?: Object): Object\r\n// Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut.\r\nexport function extend(dest) {\r\n\tvar i, j, len, src;\r\n\r\n\tfor (j = 1, len = arguments.length; j < len; j++) {\r\n\t\tsrc = arguments[j];\r\n\t\tfor (i in src) {\r\n\t\t\tdest[i] = src[i];\r\n\t\t}\r\n\t}\r\n\treturn dest;\r\n}\r\n\r\n// @function create(proto: Object, properties?: Object): Object\r\n// Compatibility polyfill for [Object.create](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\r\nexport var create = Object.create || (function () {\r\n\tfunction F() {}\r\n\treturn function (proto) {\r\n\t\tF.prototype = proto;\r\n\t\treturn new F();\r\n\t};\r\n})();\r\n\r\n// @function bind(fn: Function, …): Function\r\n// Returns a new function bound to the arguments passed, like [Function.prototype.bind](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\r\n// Has a `L.bind()` shortcut.\r\nexport function bind(fn, obj) {\r\n\tvar slice = Array.prototype.slice;\r\n\r\n\tif (fn.bind) {\r\n\t\treturn fn.bind.apply(fn, slice.call(arguments, 1));\r\n\t}\r\n\r\n\tvar args = slice.call(arguments, 2);\r\n\r\n\treturn function () {\r\n\t\treturn fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments);\r\n\t};\r\n}\r\n\r\n// @property lastId: Number\r\n// Last unique ID used by [`stamp()`](#util-stamp)\r\nexport var lastId = 0;\r\n\r\n// @function stamp(obj: Object): Number\r\n// Returns the unique ID of an object, assigning it one if it doesn't have it.\r\nexport function stamp(obj) {\r\n\t/*eslint-disable */\r\n\tobj._leaflet_id = obj._leaflet_id || ++lastId;\r\n\treturn obj._leaflet_id;\r\n\t/* eslint-enable */\r\n}\r\n\r\n// @function throttle(fn: Function, time: Number, context: Object): Function\r\n// Returns a function which executes function `fn` with the given scope `context`\r\n// (so that the `this` keyword refers to `context` inside `fn`'s code). The function\r\n// `fn` will be called no more than one time per given amount of `time`. The arguments\r\n// received by the bound function will be any argumentLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"leaflet-src.js","sources":["../src/core/Util.js","../src/core/Class.js","../src/core/Events.js","../src/geometry/Point.js","../src/geometry/Bounds.js","../src/geo/LatLngBounds.js","../src/geo/LatLng.js","../src/geo/crs/CRS.js","../src/geo/crs/CRS.Earth.js","../src/geo/projection/Projection.SphericalMercator.js","../src/geometry/Transformation.js","../src/geo/crs/CRS.EPSG3857.js","../src/layer/vector/SVG.Util.js","../src/core/Browser.js","../src/dom/DomEvent.Pointer.js","../src/dom/DomEvent.DoubleTap.js","../src/dom/DomUtil.js","../src/dom/DomEvent.js","../src/dom/PosAnimation.js","../src/map/Map.js","../src/control/Control.js","../src/control/Control.Layers.js","../src/control/Control.Zoom.js","../src/control/Control.Scale.js","../src/control/Control.Attribution.js","../src/control/index.js","../src/core/Handler.js","../src/core/index.js","../src/dom/Draggable.js","../src/geometry/LineUtil.js","../src/geometry/PolyUtil.js","../src/geo/projection/Projection.LonLat.js","../src/geo/projection/Projection.Mercator.js","../src/geo/projection/index.js","../src/geo/crs/CRS.EPSG3395.js","../src/geo/crs/CRS.EPSG4326.js","../src/geo/crs/CRS.Simple.js","../src/geo/crs/index.js","../src/layer/Layer.js","../src/layer/LayerGroup.js","../src/layer/FeatureGroup.js","../src/layer/marker/Icon.js","../src/layer/marker/Icon.Default.js","../src/layer/marker/Marker.Drag.js","../src/layer/marker/Marker.js","../src/layer/vector/Path.js","../src/layer/vector/CircleMarker.js","../src/layer/vector/Circle.js","../src/layer/vector/Polyline.js","../src/layer/vector/Polygon.js","../src/layer/GeoJSON.js","../src/layer/ImageOverlay.js","../src/layer/VideoOverlay.js","../src/layer/DivOverlay.js","../src/layer/Popup.js","../src/layer/Tooltip.js","../src/layer/marker/DivIcon.js","../src/layer/marker/index.js","../src/layer/tile/GridLayer.js","../src/layer/tile/TileLayer.js","../src/layer/tile/TileLayer.WMS.js","../src/layer/tile/index.js","../src/layer/vector/Renderer.js","../src/layer/vector/Canvas.js","../src/layer/vector/SVG.VML.js","../src/layer/vector/SVG.js","../src/layer/vector/Renderer.getRenderer.js","../src/layer/vector/Rectangle.js","../src/layer/vector/index.js","../src/layer/index.js","../src/map/handler/Map.BoxZoom.js","../src/map/handler/Map.DoubleClickZoom.js","../src/map/handler/Map.Drag.js","../src/map/handler/Map.Keyboard.js","../src/map/handler/Map.ScrollWheelZoom.js","../src/map/handler/Map.Tap.js","../src/map/handler/Map.TouchZoom.js","../src/map/index.js","../src/Leaflet.js"],"sourcesContent":["/*\r\n * @namespace Util\r\n *\r\n * Various utility functions, used by Leaflet internally.\r\n */\r\n\r\nexport var freeze = Object.freeze;\r\nObject.freeze = function (obj) { return obj; };\r\n\r\n// @function extend(dest: Object, src?: Object): Object\r\n// Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut.\r\nexport function extend(dest) {\r\n\tvar i, j, len, src;\r\n\r\n\tfor (j = 1, len = arguments.length; j < len; j++) {\r\n\t\tsrc = arguments[j];\r\n\t\tfor (i in src) {\r\n\t\t\tdest[i] = src[i];\r\n\t\t}\r\n\t}\r\n\treturn dest;\r\n}\r\n\r\n// @function create(proto: Object, properties?: Object): Object\r\n// Compatibility polyfill for [Object.create](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\r\nexport var create = Object.create || (function () {\r\n\tfunction F() {}\r\n\treturn function (proto) {\r\n\t\tF.prototype = proto;\r\n\t\treturn new F();\r\n\t};\r\n})();\r\n\r\n// @function bind(fn: Function, …): Function\r\n// Returns a new function bound to the arguments passed, like [Function.prototype.bind](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\r\n// Has a `L.bind()` shortcut.\r\nexport function bind(fn, obj) {\r\n\tvar slice = Array.prototype.slice;\r\n\r\n\tif (fn.bind) {\r\n\t\treturn fn.bind.apply(fn, slice.call(arguments, 1));\r\n\t}\r\n\r\n\tvar args = slice.call(arguments, 2);\r\n\r\n\treturn function () {\r\n\t\treturn fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments);\r\n\t};\r\n}\r\n\r\n// @property lastId: Number\r\n// Last unique ID used by [`stamp()`](#util-stamp)\r\nexport var lastId = 0;\r\n\r\n// @function stamp(obj: Object): Number\r\n// Returns the unique ID of an object, assigning it one if it doesn't have it.\r\nexport function stamp(obj) {\r\n\t/*eslint-disable */\r\n\tobj._leaflet_id = obj._leaflet_id || ++lastId;\r\n\treturn obj._leaflet_id;\r\n\t/* eslint-enable */\r\n}\r\n\r\n// @function throttle(fn: Function, time: Number, context: Object): Function\r\n// Returns a function which executes function `fn` with the given scope `context`\r\n// (so that the `this` keyword refers to `context` inside `fn`'s code). The function\r\n// `fn` will be called no more than one time per given amount of `time`. The arguments\r\n// received by the bound function will be any arguments paLine truncated
|
||||
@@ -0,0 +1,635 @@
|
||||
/* required styles */
|
||||
|
||||
.leaflet-pane,
|
||||
.leaflet-tile,
|
||||
.leaflet-marker-icon,
|
||||
.leaflet-marker-shadow,
|
||||
.leaflet-tile-container,
|
||||
.leaflet-pane > svg,
|
||||
.leaflet-pane > canvas,
|
||||
.leaflet-zoom-box,
|
||||
.leaflet-image-layer,
|
||||
.leaflet-layer {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.leaflet-container {
|
||||
overflow: hidden;
|
||||
}
|
||||
.leaflet-tile,
|
||||
.leaflet-marker-icon,
|
||||
.leaflet-marker-shadow {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
-webkit-user-drag: none;
|
||||
}
|
||||
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
|
||||
.leaflet-safari .leaflet-tile {
|
||||
image-rendering: -webkit-optimize-contrast;
|
||||
}
|
||||
/* hack that prevents hw layers "stretching" when loading new tiles */
|
||||
.leaflet-safari .leaflet-tile-container {
|
||||
width: 1600px;
|
||||
height: 1600px;
|
||||
-webkit-transform-origin: 0 0;
|
||||
}
|
||||
.leaflet-marker-icon,
|
||||
.leaflet-marker-shadow {
|
||||
display: block;
|
||||
}
|
||||
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
|
||||
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
|
||||
.leaflet-container .leaflet-overlay-pane svg,
|
||||
.leaflet-container .leaflet-marker-pane img,
|
||||
.leaflet-container .leaflet-shadow-pane img,
|
||||
.leaflet-container .leaflet-tile-pane img,
|
||||
.leaflet-container img.leaflet-image-layer,
|
||||
.leaflet-container .leaflet-tile {
|
||||
max-width: none !important;
|
||||
max-height: none !important;
|
||||
}
|
||||
|
||||
.leaflet-container.leaflet-touch-zoom {
|
||||
-ms-touch-action: pan-x pan-y;
|
||||
touch-action: pan-x pan-y;
|
||||
}
|
||||
.leaflet-container.leaflet-touch-drag {
|
||||
-ms-touch-action: pinch-zoom;
|
||||
/* Fallback for FF which doesn't support pinch-zoom */
|
||||
touch-action: none;
|
||||
touch-action: pinch-zoom;
|
||||
}
|
||||
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
}
|
||||
.leaflet-container {
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
.leaflet-container a {
|
||||
-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
|
||||
}
|
||||
.leaflet-tile {
|
||||
filter: inherit;
|
||||
visibility: hidden;
|
||||
}
|
||||
.leaflet-tile-loaded {
|
||||
visibility: inherit;
|
||||
}
|
||||
.leaflet-zoom-box {
|
||||
width: 0;
|
||||
height: 0;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
z-index: 800;
|
||||
}
|
||||
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
|
||||
.leaflet-overlay-pane svg {
|
||||
-moz-user-select: none;
|
||||
}
|
||||
|
||||
.leaflet-pane { z-index: 400; }
|
||||
|
||||
.leaflet-tile-pane { z-index: 200; }
|
||||
.leaflet-overlay-pane { z-index: 400; }
|
||||
.leaflet-shadow-pane { z-index: 500; }
|
||||
.leaflet-marker-pane { z-index: 600; }
|
||||
.leaflet-tooltip-pane { z-index: 650; }
|
||||
.leaflet-popup-pane { z-index: 700; }
|
||||
|
||||
.leaflet-map-pane canvas { z-index: 100; }
|
||||
.leaflet-map-pane svg { z-index: 200; }
|
||||
|
||||
.leaflet-vml-shape {
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
}
|
||||
.lvml {
|
||||
behavior: url(#default#VML);
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
|
||||
/* control positioning */
|
||||
|
||||
.leaflet-control {
|
||||
position: relative;
|
||||
z-index: 800;
|
||||
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
|
||||
pointer-events: auto;
|
||||
}
|
||||
.leaflet-top,
|
||||
.leaflet-bottom {
|
||||
position: absolute;
|
||||
z-index: 1000;
|
||||
pointer-events: none;
|
||||
}
|
||||
.leaflet-top {
|
||||
top: 0;
|
||||
}
|
||||
.leaflet-right {
|
||||
right: 0;
|
||||
}
|
||||
.leaflet-bottom {
|
||||
bottom: 0;
|
||||
}
|
||||
.leaflet-left {
|
||||
left: 0;
|
||||
}
|
||||
.leaflet-control {
|
||||
float: left;
|
||||
clear: both;
|
||||
}
|
||||
.leaflet-right .leaflet-control {
|
||||
float: right;
|
||||
}
|
||||
.leaflet-top .leaflet-control {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.leaflet-bottom .leaflet-control {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.leaflet-left .leaflet-control {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.leaflet-right .leaflet-control {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
|
||||
/* zoom and fade animations */
|
||||
|
||||
.leaflet-fade-anim .leaflet-tile {
|
||||
will-change: opacity;
|
||||
}
|
||||
.leaflet-fade-anim .leaflet-popup {
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.2s linear;
|
||||
-moz-transition: opacity 0.2s linear;
|
||||
transition: opacity 0.2s linear;
|
||||
}
|
||||
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
|
||||
opacity: 1;
|
||||
}
|
||||
.leaflet-zoom-animated {
|
||||
-webkit-transform-origin: 0 0;
|
||||
-ms-transform-origin: 0 0;
|
||||
transform-origin: 0 0;
|
||||
}
|
||||
.leaflet-zoom-anim .leaflet-zoom-animated {
|
||||
will-change: transform;
|
||||
}
|
||||
.leaflet-zoom-anim .leaflet-zoom-animated {
|
||||
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
|
||||
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
|
||||
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
|
||||
}
|
||||
.leaflet-zoom-anim .leaflet-tile,
|
||||
.leaflet-pan-anim .leaflet-tile {
|
||||
-webkit-transition: none;
|
||||
-moz-transition: none;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.leaflet-zoom-anim .leaflet-zoom-hide {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
|
||||
/* cursors */
|
||||
|
||||
.leaflet-interactive {
|
||||
cursor: pointer;
|
||||
}
|
||||
.leaflet-grab {
|
||||
cursor: -webkit-grab;
|
||||
cursor: -moz-grab;
|
||||
cursor: grab;
|
||||
}
|
||||
.leaflet-crosshair,
|
||||
.leaflet-crosshair .leaflet-interactive {
|
||||
cursor: crosshair;
|
||||
}
|
||||
.leaflet-popup-pane,
|
||||
.leaflet-control {
|
||||
cursor: auto;
|
||||
}
|
||||
.leaflet-dragging .leaflet-grab,
|
||||
.leaflet-dragging .leaflet-grab .leaflet-interactive,
|
||||
.leaflet-dragging .leaflet-marker-draggable {
|
||||
cursor: move;
|
||||
cursor: -webkit-grabbing;
|
||||
cursor: -moz-grabbing;
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
/* marker & overlays interactivity */
|
||||
.leaflet-marker-icon,
|
||||
.leaflet-marker-shadow,
|
||||
.leaflet-image-layer,
|
||||
.leaflet-pane > svg path,
|
||||
.leaflet-tile-container {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.leaflet-marker-icon.leaflet-interactive,
|
||||
.leaflet-image-layer.leaflet-interactive,
|
||||
.leaflet-pane > svg path.leaflet-interactive {
|
||||
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
/* visual tweaks */
|
||||
|
||||
.leaflet-container {
|
||||
background: #ddd;
|
||||
outline: 0;
|
||||
}
|
||||
.leaflet-container a {
|
||||
color: #0078A8;
|
||||
}
|
||||
.leaflet-container a.leaflet-active {
|
||||
outline: 2px solid orange;
|
||||
}
|
||||
.leaflet-zoom-box {
|
||||
border: 2px dotted #38f;
|
||||
background: rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
|
||||
/* general typography */
|
||||
.leaflet-container {
|
||||
font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
|
||||
/* general toolbar styles */
|
||||
|
||||
.leaflet-bar {
|
||||
box-shadow: 0 1px 5px rgba(0,0,0,0.65);
|
||||
border-radius: 4px;
|
||||
}
|
||||
.leaflet-bar a,
|
||||
.leaflet-bar a:hover {
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #ccc;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
line-height: 26px;
|
||||
display: block;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
}
|
||||
.leaflet-bar a,
|
||||
.leaflet-control-layers-toggle {
|
||||
background-position: 50% 50%;
|
||||
background-repeat: no-repeat;
|
||||
display: block;
|
||||
}
|
||||
.leaflet-bar a:hover {
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
.leaflet-bar a:first-child {
|
||||
border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
}
|
||||
.leaflet-bar a:last-child {
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom: none;
|
||||
}
|
||||
.leaflet-bar a.leaflet-disabled {
|
||||
cursor: default;
|
||||
background-color: #f4f4f4;
|
||||
color: #bbb;
|
||||
}
|
||||
|
||||
.leaflet-touch .leaflet-bar a {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
.leaflet-touch .leaflet-bar a:first-child {
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 2px;
|
||||
}
|
||||
.leaflet-touch .leaflet-bar a:last-child {
|
||||
border-bottom-left-radius: 2px;
|
||||
border-bottom-right-radius: 2px;
|
||||
}
|
||||
|
||||
/* zoom control */
|
||||
|
||||
.leaflet-control-zoom-in,
|
||||
.leaflet-control-zoom-out {
|
||||
font: bold 18px 'Lucida Console', Monaco, monospace;
|
||||
text-indent: 1px;
|
||||
}
|
||||
|
||||
.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
|
||||
/* layers control */
|
||||
|
||||
.leaflet-control-layers {
|
||||
box-shadow: 0 1px 5px rgba(0,0,0,0.4);
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.leaflet-control-layers-toggle {
|
||||
background-image: url(images/layers.png);
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
.leaflet-retina .leaflet-control-layers-toggle {
|
||||
background-image: url(images/layers-2x.png);
|
||||
background-size: 26px 26px;
|
||||
}
|
||||
.leaflet-touch .leaflet-control-layers-toggle {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
}
|
||||
.leaflet-control-layers .leaflet-control-layers-list,
|
||||
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
|
||||
display: none;
|
||||
}
|
||||
.leaflet-control-layers-expanded .leaflet-control-layers-list {
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
.leaflet-control-layers-expanded {
|
||||
padding: 6px 10px 6px 6px;
|
||||
color: #333;
|
||||
background: #fff;
|
||||
}
|
||||
.leaflet-control-layers-scrollbar {
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
padding-right: 5px;
|
||||
}
|
||||
.leaflet-control-layers-selector {
|
||||
margin-top: 2px;
|
||||
position: relative;
|
||||
top: 1px;
|
||||
}
|
||||
.leaflet-control-layers label {
|
||||
display: block;
|
||||
}
|
||||
.leaflet-control-layers-separator {
|
||||
height: 0;
|
||||
border-top: 1px solid #ddd;
|
||||
margin: 5px -10px 5px -6px;
|
||||
}
|
||||
|
||||
/* Default icon URLs */
|
||||
.leaflet-default-icon-path {
|
||||
background-image: url(images/marker-icon.png);
|
||||
}
|
||||
|
||||
|
||||
/* attribution and scale controls */
|
||||
|
||||
.leaflet-container .leaflet-control-attribution {
|
||||
background: #fff;
|
||||
background: rgba(255, 255, 255, 0.7);
|
||||
margin: 0;
|
||||
}
|
||||
.leaflet-control-attribution,
|
||||
.leaflet-control-scale-line {
|
||||
padding: 0 5px;
|
||||
color: #333;
|
||||
}
|
||||
.leaflet-control-attribution a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.leaflet-control-attribution a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.leaflet-container .leaflet-control-attribution,
|
||||
.leaflet-container .leaflet-control-scale {
|
||||
font-size: 11px;
|
||||
}
|
||||
.leaflet-left .leaflet-control-scale {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.leaflet-bottom .leaflet-control-scale {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.leaflet-control-scale-line {
|
||||
border: 2px solid #777;
|
||||
border-top: none;
|
||||
line-height: 1.1;
|
||||
padding: 2px 5px 1px;
|
||||
font-size: 11px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
|
||||
background: #fff;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
.leaflet-control-scale-line:not(:first-child) {
|
||||
border-top: 2px solid #777;
|
||||
border-bottom: none;
|
||||
margin-top: -2px;
|
||||
}
|
||||
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
|
||||
border-bottom: 2px solid #777;
|
||||
}
|
||||
|
||||
.leaflet-touch .leaflet-control-attribution,
|
||||
.leaflet-touch .leaflet-control-layers,
|
||||
.leaflet-touch .leaflet-bar {
|
||||
box-shadow: none;
|
||||
}
|
||||
.leaflet-touch .leaflet-control-layers,
|
||||
.leaflet-touch .leaflet-bar {
|
||||
border: 2px solid rgba(0,0,0,0.2);
|
||||
background-clip: padding-box;
|
||||
}
|
||||
|
||||
|
||||
/* popup */
|
||||
|
||||
.leaflet-popup {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.leaflet-popup-content-wrapper {
|
||||
padding: 1px;
|
||||
text-align: left;
|
||||
border-radius: 12px;
|
||||
}
|
||||
.leaflet-popup-content {
|
||||
margin: 13px 19px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.leaflet-popup-content p {
|
||||
margin: 18px 0;
|
||||
}
|
||||
.leaflet-popup-tip-container {
|
||||
width: 40px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
margin-left: -20px;
|
||||
overflow: hidden;
|
||||
pointer-events: none;
|
||||
}
|
||||
.leaflet-popup-tip {
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
padding: 1px;
|
||||
|
||||
margin: -10px auto 0;
|
||||
|
||||
-webkit-transform: rotate(45deg);
|
||||
-moz-transform: rotate(45deg);
|
||||
-ms-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
.leaflet-popup-content-wrapper,
|
||||
.leaflet-popup-tip {
|
||||
background: white;
|
||||
color: #333;
|
||||
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
|
||||
}
|
||||
.leaflet-container a.leaflet-popup-close-button {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
padding: 4px 4px 0 0;
|
||||
border: none;
|
||||
text-align: center;
|
||||
width: 18px;
|
||||
height: 14px;
|
||||
font: 16px/14px Tahoma, Verdana, sans-serif;
|
||||
color: #c3c3c3;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
background: transparent;
|
||||
}
|
||||
.leaflet-container a.leaflet-popup-close-button:hover {
|
||||
color: #999;
|
||||
}
|
||||
.leaflet-popup-scrolled {
|
||||
overflow: auto;
|
||||
border-bottom: 1px solid #ddd;
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.leaflet-oldie .leaflet-popup-content-wrapper {
|
||||
zoom: 1;
|
||||
}
|
||||
.leaflet-oldie .leaflet-popup-tip {
|
||||
width: 24px;
|
||||
margin: 0 auto;
|
||||
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
|
||||
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
|
||||
}
|
||||
.leaflet-oldie .leaflet-popup-tip-container {
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
.leaflet-oldie .leaflet-control-zoom,
|
||||
.leaflet-oldie .leaflet-control-layers,
|
||||
.leaflet-oldie .leaflet-popup-content-wrapper,
|
||||
.leaflet-oldie .leaflet-popup-tip {
|
||||
border: 1px solid #999;
|
||||
}
|
||||
|
||||
|
||||
/* div icon */
|
||||
|
||||
.leaflet-div-icon {
|
||||
background: #fff;
|
||||
border: 1px solid #666;
|
||||
}
|
||||
|
||||
|
||||
/* Tooltip */
|
||||
/* Base styles for the element that has a tooltip */
|
||||
.leaflet-tooltip {
|
||||
position: absolute;
|
||||
padding: 6px;
|
||||
background-color: #fff;
|
||||
border: 1px solid #fff;
|
||||
border-radius: 3px;
|
||||
color: #222;
|
||||
white-space: nowrap;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
pointer-events: none;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.4);
|
||||
}
|
||||
.leaflet-tooltip.leaflet-clickable {
|
||||
cursor: pointer;
|
||||
pointer-events: auto;
|
||||
}
|
||||
.leaflet-tooltip-top:before,
|
||||
.leaflet-tooltip-bottom:before,
|
||||
.leaflet-tooltip-left:before,
|
||||
.leaflet-tooltip-right:before {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
border: 6px solid transparent;
|
||||
background: transparent;
|
||||
content: "";
|
||||
}
|
||||
|
||||
/* Directions */
|
||||
|
||||
.leaflet-tooltip-bottom {
|
||||
margin-top: 6px;
|
||||
}
|
||||
.leaflet-tooltip-top {
|
||||
margin-top: -6px;
|
||||
}
|
||||
.leaflet-tooltip-bottom:before,
|
||||
.leaflet-tooltip-top:before {
|
||||
left: 50%;
|
||||
margin-left: -6px;
|
||||
}
|
||||
.leaflet-tooltip-top:before {
|
||||
bottom: 0;
|
||||
margin-bottom: -12px;
|
||||
border-top-color: #fff;
|
||||
}
|
||||
.leaflet-tooltip-bottom:before {
|
||||
top: 0;
|
||||
margin-top: -12px;
|
||||
margin-left: -6px;
|
||||
border-bottom-color: #fff;
|
||||
}
|
||||
.leaflet-tooltip-left {
|
||||
margin-left: -6px;
|
||||
}
|
||||
.leaflet-tooltip-right {
|
||||
margin-left: 6px;
|
||||
}
|
||||
.leaflet-tooltip-left:before,
|
||||
.leaflet-tooltip-right:before {
|
||||
top: 50%;
|
||||
margin-top: -6px;
|
||||
}
|
||||
.leaflet-tooltip-left:before {
|
||||
right: 0;
|
||||
margin-right: -12px;
|
||||
border-left-color: #fff;
|
||||
}
|
||||
.leaflet-tooltip-right:before {
|
||||
left: 0;
|
||||
margin-left: -12px;
|
||||
border-right-color: #fff;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
/* @preserve
|
||||
* Leaflet 1.4.0, a JS library for interactive maps. http://leafletjs.com
|
||||
* (c) 2010-2018 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
||||
*/
|
||||
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i(t.L={})}(this,function(t){"use strict";function i(t){var i,e,n,o;for(e=1,n=arguments.length;e<n;e++){o=arguments[e];for(i in o)t[i]=o[i]}return t}function e(t,i){var e=Array.prototype.slice;if(t.bind)return t.bind.apply(t,e.call(arguments,1));var n=e.call(arguments,2);return function(){return t.apply(i,n.length?n.concat(e.call(arguments)):arguments)}}function n(t){return t._leaflet_id=t._leaflet_id||++ei,t._leaflet_id}function o(t,i,e){var n,o,s,r;return r=function(){n=!1,o&&(s.apply(e,o),o=!1)},s=function(){n?o=arguments:(t.apply(e,arguments),setTimeout(r,i),n=!0)}}function s(t,i,e){var n=i[1],o=i[0],s=n-o;return t===n&&e?t:((t-o)%s+s)%s+o}function r(){return!1}function a(t,i){var e=Math.pow(10,void 0===i?6:i);return Math.round(t*e)/e}function h(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function u(t){return h(t).split(/\s+/)}function l(t,i){t.hasOwnProperty("options")||(t.options=t.options?ii(t.options):{});for(var e in i)t.options[e]=i[e];return t.options}function c(t,i,e){var n=[];for(var o in t)n.push(encodeURIComponent(e?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(i&&-1!==i.indexOf("?")?"&":"?")+n.join("&")}function _(t,i){return t.replace(ni,function(t,e){var n=i[e];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(i)),n})}function d(t,i){for(var e=0;e<t.length;e++)if(t[e]===i)return e;return-1}function p(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}function m(t){var i=+new Date,e=Math.max(0,16-(i-ri));return ri=i+e,window.setTimeout(t,e)}function f(t,i,n){if(!n||ai!==m)return ai.call(window,e(t,i));t.call(i)}function g(t){t&&hi.call(window,t)}function v(){}function y(t){if("undefined"!=typeof L&&L&&L.Mixin){t=oi(t)?t:[t];for(var i=0;i<t.length;i++)t[i]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}function x(t,i,e){this.x=e?Math.round(t):t,this.y=e?Math.round(i):i}function w(t,i,e){return t instanceof x?t:oi(t)?new x(t[0],t[1]):void 0===t||null===t?t:"object"==typeof t&&"x"in t&&"y"in t?new x(t.x,t.y):new x(t,i,e)}function P(t,i){if(t)for(var e=i?[t,i]:t,n=0,o=e.length;n<o;n++)this.extend(e[n])}function b(t,i){return!t||t instanceof P?t:new P(t,i)}function T(t,i){if(t)for(var e=i?[t,i]:t,n=0,o=e.length;n<o;n++)this.extend(e[n])}function z(t,i){return t instanceof T?t:new T(t,i)}function M(t,i,e){if(isNaN(t)||isNaN(i))throw new Error("Invalid LatLng object: ("+t+", "+i+")");this.lat=+t,this.lng=+i,void 0!==e&&(this.alt=+e)}function C(t,i,e){return t instanceof M?t:oi(t)&&"object"!=typeof t[0]?3===t.length?new M(t[0],t[1],t[2]):2===t.length?new M(t[0],t[1]):null:void 0===t||null===t?t:"object"==typeof t&&"lat"in t?new M(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===i?null:new M(t,i,e)}function S(t,i,e,n){if(oi(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=i,this._c=e,this._d=n}function Z(t,i,e,n){return new S(t,i,e,n)}function E(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function k(t,i){var e,n,o,s,r,a,h="";for(e=0,o=t.length;e<o;e++){for(n=0,s=(r=t[e]).length;n<s;n++)a=r[n],h+=(n?"L":"M")+a.x+" "+a.y;h+=i?Ji?"z":"x":""}return h||"M0 0"}function B(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}function A(t,i,e,n){return"touchstart"===i?O(t,e,n):"touchmove"===i?W(t,e,n):"touchend"===i&&H(t,e,n),this}function I(t,i,e){var n=t["_leaflet_"+i+e];return"touchstart"===i?t.removeEventListener(te,n,!1):"touchmove"===i?t.removeEventListener(ie,n,!1):"touchend"===i&&(t.removeEventListener(ee,n,!1),t.removeEventListener(ne,n,!1)),this}function O(t,i,n){var o=e(function(t){if("mouse"!==t.pointerType&&t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(oe.indexOf(t.target.tagName)<0))return;Pt(t)}j(t,i)});t["_leaflet_touchstart"+n]=o,t.addEventListener(te,o,!1),re||(document.documentElement.addEventListener(te,R,!0),document.documentElement.addEventListener(ie,N,!0),document.documentElement.addEventListener(ee,D,!0),document.documentElement.addEventListener(ne,D,!0),re=!0)}function R(t){se[t.pointerId]=t,ae++}function N(t){se[t.pointerId]&&(se[t.pointerId]=t)}function D(t){delete se[t.pointerId],ae--}function j(t,i){t.touches=[];for(var e in se)t.touches.push(se[e]);t.changedTouches=[t],i(t)}function W(t,i,e){var n=function(t){(t.pointerType!==t.MSPOINTER_TYPE_MOUSE&&"mouse"!==t.pointerType||0!==t.buttons)&&j(t,i)};t["_leaflet_touchmove"+e]=n,t.addEventListener(ie,n,!1)}function H(t,i,e){var n=function(t){j(t,i)};t["_leaflet_touchend"+e]=n,t.addEventListener(ee,n,!1),t.addEventListener(ne,n,!1)}function F(t,i,e){function n(t){var i;if(Vi){if(!bi||"mouse"===t.pointerType)return;i=ae}else i=t.touches.length;if(!(i>1)){var e=Date.now(),n=e-(s||e);r=t.touches?t.touches[0]:Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["dist/leaflet-src.js"],"names":["global","factory","exports","module","define","amd","L","this","extend","dest","i","j","len","src","arguments","length","bind","fn","obj","slice","Array","prototype","apply","call","args","concat","stamp","_leaflet_id","lastId","throttle","time","context","lock","wrapperFn","later","setTimeout","wrapNum","x","range","includeMax","max","min","d","falseFn","formatNum","num","digits","pow","Math","undefined","round","trim","str","replace","splitWords","split","setOptions","options","hasOwnProperty","create","getParamString","existingUrl","uppercase","params","push","encodeURIComponent","toUpperCase","indexOf","join","template","data","templateRe","key","value","Error","array","el","getPrefixed","name","window","timeoutDefer","Date","timeToCall","lastTime","requestAnimFrame","immediate","requestFn","cancelAnimFrame","id","cancelFn","Class","checkDeprecatedMixinEvents","includes","Mixin","isArray","Events","console","warn","stack","Point","y","toPoint","Bounds","a","b","points","toBounds","LatLngBounds","corner1","corner2","latlngs","toLatLngBounds","LatLng","lat","lng","alt","isNaN","toLatLng","c","lon","Transformation","_a","_b","_c","_d","toTransformation","svgCreate","document","createElementNS","pointsToPath","rings","closed","len2","p","svg","userAgentContains","navigator","userAgent","toLowerCase","addPointerListener","type","handler","_addPointerStart","_addPointerMove","_addPointerEnd","removePointerListener","removeEventListener","POINTER_DOWN","POINTER_MOVE","POINTER_UP","POINTER_CANCEL","onDown","e","pointerType","MSPOINTER_TYPE_MOUSE","TAG_WHITE_LIST","target","tagName","preventDefault","_handlePointer","addEventListener","_pointerDocListener","documentElement","_globalPointerDown","_globalPointerMove","_globalPointerUp","_pointers","pointerId","_pointersCount","touches","changedTouches","onMove","buttons","onUp","addDoubleTapListener","onTouchStart","count","pointer","edge","now","delta","last","touch$$1","doubleTap","delay","onTouchEnd","cancelBubble","prop","newTouch","_pre","_touchstart","_touchend","removeDoubleTapListener","touchstart","touchend","dblclick","get","getElementById","getStyle","style","currentStyle","defaultView","css","getComputedStyle","create$1","className","container","createElement","appendChild","remove","parent","parentNode","removeChild","empty","firstChild","toFront","lastChild","toBack","insertBefore","hasClass","classList","contains","getClass","RegExp","test","addClass","classes","add","setClass","removeClass","baseVal","correspondingElement","setOpacity","opacity","_setOpacityIE","filter","filterName","filters","item","Enabled","Opacity","testProp","props","setTransform","offset","scale","pos","TRANSFORM","ie3d","setPosition","point","_leaflet_pos","any3d","left","top","getPosition","disableImageDrag","on","enableImageDrag","off","preventOutline","element","tabIndex","restoreOutline","_outlineElement","_outlineStyle","outline","getSizedParentNode","offsetWidth","offsetHeight","body","getScale","rect","getBoundingClientRect","width","height","boundingClientRect","types","addOne","removeOne","eventsKey","event","originalHandler","touch","chrome","isExternalTarget","android","filterClick","attachEvent","detachEvent","stopPropagation","originalEvent","_stopped","skipped","disableScrollPropagation","disableClickPropagation","fakeStop","returnValue","stop","getMousePosition","clientX","clientY","clientLeft","clientTop","getWheelDelta","wheelDeltaY","deltaY","deltaMode","wheelPxFactor","deltaX","deltaZ","wheelDelta","detail","abs","skipEvents","events","related","relatedTarget","err","timeStamp","elapsed","lastClick","_simulatedClick","_simulated","simplify","tolerance","sqTolerance","_reducePoints","_simplifyDP","pointToSegmentDistance","p1","p2","sqrt","_sqClosestPointOnSegment","markers","Uint8Array","_simplifyDPStep","newPoints","first","index","sqDist","maxSqDist","reducedPoints","prev","_sqDist","clipSegment","bounds","useLastCode","codeOut","newCode","codeA","_lastCode","_getBitCode","codeB","_getEdgeIntersection","code","dx","dy","t","dot","isFlat","_flat","clipPolygon","clippedPoints","k","edges","_code","geometryToLayer","geojson","latlng","geometry","coords","coordinates","layers","pointToLayer","_coordsToLatLng","coordsToLatLng","Marker","FeatureGroup","coordsToLatLngs","Polyline","Polygon","geometries","layer","properties","levelsDeep","latLngToCoords","precision","latLngsToCoords","getFeature","newGeometry","feature","asFeature","geoJSON","GeoJSON","tileLayer","url","TileLayer","canvas$1","canvas","Canvas","svg$1","vml","SVG","freeze","Object","F","proto","toString","emptyImageUrl","requestAnimationFrame","cancelAnimationFrame","clearTimeout","Util","NewClass","initialize","callInitHooks","parentProto","__super__","constructor","statics","_initHooks","_initHooksCalled","include","mergeOptions","addInitHook","init","_on","_off","_events","typeListeners","newListener","ctx","listeners","l","_firingCount",Line truncated
|
||||
@@ -0,0 +1,137 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"leaflet@1.4.0",
|
||||
"/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "leaflet@1.4.0",
|
||||
"_id": "leaflet@1.4.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-x9j9tGY1+PDLN9pcWTx9/y6C5nezoTMB8BLK5jTakx+H7bPlnbCHfi9Hjg+Qt36sgDz/cb9lrSpNQXmk45Tvhw==",
|
||||
"_location": "/leaflet",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "leaflet@1.4.0",
|
||||
"name": "leaflet",
|
||||
"escapedName": "leaflet",
|
||||
"rawSpec": "1.4.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.4.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.4.0.tgz",
|
||||
"_spec": "1.4.0",
|
||||
"_where": "/shd/CTC/TOOLS/TDS/TDS-source/Lts/Tools/ArAssetsV2",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Leaflet/Leaflet/issues"
|
||||
},
|
||||
"description": "JavaScript library for mobile-friendly interactive maps",
|
||||
"devDependencies": {
|
||||
"eslint": "^4.5.0",
|
||||
"eslint-config-mourner": "^2.0.1",
|
||||
"git-rev-sync": "^1.8.0",
|
||||
"happen": "~0.3.2",
|
||||
"karma": "^1.3.0",
|
||||
"karma-chrome-launcher": "^2.0.0",
|
||||
"karma-coverage": "~1.1.1",
|
||||
"karma-expect": "^1.1.3",
|
||||
"karma-firefox-launcher": "~1.0.0",
|
||||
"karma-mocha": "^1.2.0",
|
||||
"karma-phantomjs-launcher": "^1.0.2",
|
||||
"karma-rollup-preprocessor": "^5.0.1",
|
||||
"karma-safari-launcher": "~1.0.0",
|
||||
"karma-sinon": "^1.0.5",
|
||||
"leafdoc": "^1.4.1",
|
||||
"mocha": "^3.1.0",
|
||||
"phantomjs-prebuilt": "^2.1.12",
|
||||
"prosthetic-hand": "^1.3.1",
|
||||
"rollup": "^0.51.8",
|
||||
"rollup-plugin-git-version": "0.2.1",
|
||||
"rollup-plugin-json": "^2.1.0",
|
||||
"rollup-watch": "^4.3.1",
|
||||
"sinon": "^1.6.0",
|
||||
"source-map": "^0.5.6",
|
||||
"ssri": "^5.2.2",
|
||||
"uglify-js": "~3.0.26"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"globals": {
|
||||
"L": true
|
||||
},
|
||||
"env": {
|
||||
"commonjs": true,
|
||||
"amd": true,
|
||||
"node": false
|
||||
},
|
||||
"extends": "mourner",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
"linebreak-style": [
|
||||
0,
|
||||
"unix"
|
||||
],
|
||||
"no-mixed-spaces-and-tabs": [
|
||||
2,
|
||||
"smart-tabs"
|
||||
],
|
||||
"indent": [
|
||||
2,
|
||||
"tab",
|
||||
{
|
||||
"VariableDeclarator": 0,
|
||||
"flatTernaryExpressions": true
|
||||
}
|
||||
],
|
||||
"curly": 2,
|
||||
"spaced-comment": 2,
|
||||
"strict": 0,
|
||||
"wrap-iife": 0,
|
||||
"key-spacing": 0,
|
||||
"consistent-return": 0
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"src",
|
||||
"!dist/leaflet.zip"
|
||||
],
|
||||
"homepage": "https://github.com/Leaflet/Leaflet#readme",
|
||||
"keywords": [
|
||||
"gis",
|
||||
"map"
|
||||
],
|
||||
"license": "BSD-2-Clause",
|
||||
"main": "dist/leaflet-src.js",
|
||||
"name": "leaflet",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/Leaflet/Leaflet.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run rollup && npm run uglify",
|
||||
"docs": "node ./build/docs.js",
|
||||
"integrity": "node ./build/integrity.js",
|
||||
"lint": "eslint src",
|
||||
"lint-spec": "eslint spec/suites",
|
||||
"lintfix": "eslint src --fix; eslint spec/suites --fix;",
|
||||
"pretest": "npm run lint && npm run lint-spec",
|
||||
"release": "./build/publish.sh",
|
||||
"rollup": "rollup -c build/rollup-config.js",
|
||||
"test": "npm run test-nolint",
|
||||
"test-nolint": "karma start ./spec/karma.conf.js",
|
||||
"uglify": "uglifyjs dist/leaflet-src.js -c -m -o dist/leaflet.js --source-map filename=dist/leaflet.js.map --in-source-map dist/leaflet-src.js.map --source-map-url leaflet.js.map --comments",
|
||||
"watch": "rollup -w -c build/rollup-watch-config.js"
|
||||
},
|
||||
"style": "dist/leaflet.css",
|
||||
"version": "1.4.0"
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
import {version} from '../package.json';
|
||||
export {version};
|
||||
|
||||
// control
|
||||
export * from './control/index';
|
||||
|
||||
// core
|
||||
export * from './core/index';
|
||||
|
||||
// dom
|
||||
export * from './dom/index';
|
||||
|
||||
// geometry
|
||||
export * from './geometry/index';
|
||||
|
||||
// geo
|
||||
export * from './geo/index';
|
||||
|
||||
// layer
|
||||
export * from './layer/index';
|
||||
|
||||
// map
|
||||
export * from './map/index';
|
||||
|
||||
import {freeze} from './core/Util';
|
||||
Object.freeze = freeze;
|
||||
@@ -0,0 +1,129 @@
|
||||
|
||||
import {Control} from './Control';
|
||||
import {Map} from '../map/Map';
|
||||
import * as Util from '../core/Util';
|
||||
import * as DomEvent from '../dom/DomEvent';
|
||||
import * as DomUtil from '../dom/DomUtil';
|
||||
|
||||
/*
|
||||
* @class Control.Attribution
|
||||
* @aka L.Control.Attribution
|
||||
* @inherits Control
|
||||
*
|
||||
* The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its [`attributionControl` option](#map-attributioncontrol) to `false`, and it fetches attribution texts from layers with the [`getAttribution` method](#layer-getattribution) automatically. Extends Control.
|
||||
*/
|
||||
|
||||
export var Attribution = Control.extend({
|
||||
// @section
|
||||
// @aka Control.Attribution options
|
||||
options: {
|
||||
position: 'bottomright',
|
||||
|
||||
// @option prefix: String = 'Leaflet'
|
||||
// The HTML text shown before the attributions. Pass `false` to disable.
|
||||
prefix: '<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
Util.setOptions(this, options);
|
||||
|
||||
this._attributions = {};
|
||||
},
|
||||
|
||||
onAdd: function (map) {
|
||||
map.attributionControl = this;
|
||||
this._container = DomUtil.create('div', 'leaflet-control-attribution');
|
||||
DomEvent.disableClickPropagation(this._container);
|
||||
|
||||
// TODO ugly, refactor
|
||||
for (var i in map._layers) {
|
||||
if (map._layers[i].getAttribution) {
|
||||
this.addAttribution(map._layers[i].getAttribution());
|
||||
}
|
||||
}
|
||||
|
||||
this._update();
|
||||
|
||||
return this._container;
|
||||
},
|
||||
|
||||
// @method setPrefix(prefix: String): this
|
||||
// Sets the text before the attributions.
|
||||
setPrefix: function (prefix) {
|
||||
this.options.prefix = prefix;
|
||||
this._update();
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method addAttribution(text: String): this
|
||||
// Adds an attribution text (e.g. `'Vector data © Mapbox'`).
|
||||
addAttribution: function (text) {
|
||||
if (!text) { return this; }
|
||||
|
||||
if (!this._attributions[text]) {
|
||||
this._attributions[text] = 0;
|
||||
}
|
||||
this._attributions[text]++;
|
||||
|
||||
this._update();
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method removeAttribution(text: String): this
|
||||
// Removes an attribution text.
|
||||
removeAttribution: function (text) {
|
||||
if (!text) { return this; }
|
||||
|
||||
if (this._attributions[text]) {
|
||||
this._attributions[text]--;
|
||||
this._update();
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_update: function () {
|
||||
if (!this._map) { return; }
|
||||
|
||||
var attribs = [];
|
||||
|
||||
for (var i in this._attributions) {
|
||||
if (this._attributions[i]) {
|
||||
attribs.push(i);
|
||||
}
|
||||
}
|
||||
|
||||
var prefixAndAttribs = [];
|
||||
|
||||
if (this.options.prefix) {
|
||||
prefixAndAttribs.push(this.options.prefix);
|
||||
}
|
||||
if (attribs.length) {
|
||||
prefixAndAttribs.push(attribs.join(', '));
|
||||
}
|
||||
|
||||
this._container.innerHTML = prefixAndAttribs.join(' | ');
|
||||
}
|
||||
});
|
||||
|
||||
// @namespace Map
|
||||
// @section Control options
|
||||
// @option attributionControl: Boolean = true
|
||||
// Whether a [attribution control](#control-attribution) is added to the map by default.
|
||||
Map.mergeOptions({
|
||||
attributionControl: true
|
||||
});
|
||||
|
||||
Map.addInitHook(function () {
|
||||
if (this.options.attributionControl) {
|
||||
new Attribution().addTo(this);
|
||||
}
|
||||
});
|
||||
|
||||
// @namespace Control.Attribution
|
||||
// @factory L.control.attribution(options: Control.Attribution options)
|
||||
// Creates an attribution control.
|
||||
export var attribution = function (options) {
|
||||
return new Attribution(options);
|
||||
};
|
||||
@@ -0,0 +1,431 @@
|
||||
|
||||
import {Control} from './Control';
|
||||
import * as Util from '../core/Util';
|
||||
import * as Browser from '../core/Browser';
|
||||
import * as DomEvent from '../dom/DomEvent';
|
||||
import * as DomUtil from '../dom/DomUtil';
|
||||
|
||||
/*
|
||||
* @class Control.Layers
|
||||
* @aka L.Control.Layers
|
||||
* @inherits Control
|
||||
*
|
||||
* The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the [detailed example](http://leafletjs.com/examples/layers-control/)). Extends `Control`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* var baseLayers = {
|
||||
* "Mapbox": mapbox,
|
||||
* "OpenStreetMap": osm
|
||||
* };
|
||||
*
|
||||
* var overlays = {
|
||||
* "Marker": marker,
|
||||
* "Roads": roadsLayer
|
||||
* };
|
||||
*
|
||||
* L.control.layers(baseLayers, overlays).addTo(map);
|
||||
* ```
|
||||
*
|
||||
* The `baseLayers` and `overlays` parameters are object literals with layer names as keys and `Layer` objects as values:
|
||||
*
|
||||
* ```js
|
||||
* {
|
||||
* "<someName1>": layer1,
|
||||
* "<someName2>": layer2
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* The layer names can contain HTML, which allows you to add additional styling to the items:
|
||||
*
|
||||
* ```js
|
||||
* {"<img src='my-layer-icon' /> <span class='my-layer-item'>My Layer</span>": myLayer}
|
||||
* ```
|
||||
*/
|
||||
|
||||
export var Layers = Control.extend({
|
||||
// @section
|
||||
// @aka Control.Layers options
|
||||
options: {
|
||||
// @option collapsed: Boolean = true
|
||||
// If `true`, the control will be collapsed into an icon and expanded on mouse hover or touch.
|
||||
collapsed: true,
|
||||
position: 'topright',
|
||||
|
||||
// @option autoZIndex: Boolean = true
|
||||
// If `true`, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off.
|
||||
autoZIndex: true,
|
||||
|
||||
// @option hideSingleBase: Boolean = false
|
||||
// If `true`, the base layers in the control will be hidden when there is only one.
|
||||
hideSingleBase: false,
|
||||
|
||||
// @option sortLayers: Boolean = false
|
||||
// Whether to sort the layers. When `false`, layers will keep the order
|
||||
// in which they were added to the control.
|
||||
sortLayers: false,
|
||||
|
||||
// @option sortFunction: Function = *
|
||||
// A [compare function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)
|
||||
// that will be used for sorting the layers, when `sortLayers` is `true`.
|
||||
// The function receives both the `L.Layer` instances and their names, as in
|
||||
// `sortFunction(layerA, layerB, nameA, nameB)`.
|
||||
// By default, it sorts layers alphabetically by their name.
|
||||
sortFunction: function (layerA, layerB, nameA, nameB) {
|
||||
return nameA < nameB ? -1 : (nameB < nameA ? 1 : 0);
|
||||
}
|
||||
},
|
||||
|
||||
initialize: function (baseLayers, overlays, options) {
|
||||
Util.setOptions(this, options);
|
||||
|
||||
this._layerControlInputs = [];
|
||||
this._layers = [];
|
||||
this._lastZIndex = 0;
|
||||
this._handlingClick = false;
|
||||
|
||||
for (var i in baseLayers) {
|
||||
this._addLayer(baseLayers[i], i);
|
||||
}
|
||||
|
||||
for (i in overlays) {
|
||||
this._addLayer(overlays[i], i, true);
|
||||
}
|
||||
},
|
||||
|
||||
onAdd: function (map) {
|
||||
this._initLayout();
|
||||
this._update();
|
||||
|
||||
this._map = map;
|
||||
map.on('zoomend', this._checkDisabledLayers, this);
|
||||
|
||||
for (var i = 0; i < this._layers.length; i++) {
|
||||
this._layers[i].layer.on('add remove', this._onLayerChange, this);
|
||||
}
|
||||
|
||||
return this._container;
|
||||
},
|
||||
|
||||
addTo: function (map) {
|
||||
Control.prototype.addTo.call(this, map);
|
||||
// Trigger expand after Layers Control has been inserted into DOM so that is now has an actual height.
|
||||
return this._expandIfNotCollapsed();
|
||||
},
|
||||
|
||||
onRemove: function () {
|
||||
this._map.off('zoomend', this._checkDisabledLayers, this);
|
||||
|
||||
for (var i = 0; i < this._layers.length; i++) {
|
||||
this._layers[i].layer.off('add remove', this._onLayerChange, this);
|
||||
}
|
||||
},
|
||||
|
||||
// @method addBaseLayer(layer: Layer, name: String): this
|
||||
// Adds a base layer (radio button entry) with the given name to the control.
|
||||
addBaseLayer: function (layer, name) {
|
||||
this._addLayer(layer, name);
|
||||
return (this._map) ? this._update() : this;
|
||||
},
|
||||
|
||||
// @method addOverlay(layer: Layer, name: String): this
|
||||
// Adds an overlay (checkbox entry) with the given name to the control.
|
||||
addOverlay: function (layer, name) {
|
||||
this._addLayer(layer, name, true);
|
||||
return (this._map) ? this._update() : this;
|
||||
},
|
||||
|
||||
// @method removeLayer(layer: Layer): this
|
||||
// Remove the given layer from the control.
|
||||
removeLayer: function (layer) {
|
||||
layer.off('add remove', this._onLayerChange, this);
|
||||
|
||||
var obj = this._getLayer(Util.stamp(layer));
|
||||
if (obj) {
|
||||
this._layers.splice(this._layers.indexOf(obj), 1);
|
||||
}
|
||||
return (this._map) ? this._update() : this;
|
||||
},
|
||||
|
||||
// @method expand(): this
|
||||
// Expand the control container if collapsed.
|
||||
expand: function () {
|
||||
DomUtil.addClass(this._container, 'leaflet-control-layers-expanded');
|
||||
this._section.style.height = null;
|
||||
var acceptableHeight = this._map.getSize().y - (this._container.offsetTop + 50);
|
||||
if (acceptableHeight < this._section.clientHeight) {
|
||||
DomUtil.addClass(this._section, 'leaflet-control-layers-scrollbar');
|
||||
this._section.style.height = acceptableHeight + 'px';
|
||||
} else {
|
||||
DomUtil.removeClass(this._section, 'leaflet-control-layers-scrollbar');
|
||||
}
|
||||
this._checkDisabledLayers();
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method collapse(): this
|
||||
// Collapse the control container if expanded.
|
||||
collapse: function () {
|
||||
DomUtil.removeClass(this._container, 'leaflet-control-layers-expanded');
|
||||
return this;
|
||||
},
|
||||
|
||||
_initLayout: function () {
|
||||
var className = 'leaflet-control-layers',
|
||||
container = this._container = DomUtil.create('div', className),
|
||||
collapsed = this.options.collapsed;
|
||||
|
||||
// makes this work on IE touch devices by stopping it from firing a mouseout event when the touch is released
|
||||
container.setAttribute('aria-haspopup', true);
|
||||
|
||||
DomEvent.disableClickPropagation(container);
|
||||
DomEvent.disableScrollPropagation(container);
|
||||
|
||||
var section = this._section = DomUtil.create('section', className + '-list');
|
||||
|
||||
if (collapsed) {
|
||||
this._map.on('click', this.collapse, this);
|
||||
|
||||
if (!Browser.android) {
|
||||
DomEvent.on(container, {
|
||||
mouseenter: this.expand,
|
||||
mouseleave: this.collapse
|
||||
}, this);
|
||||
}
|
||||
}
|
||||
|
||||
var link = this._layersLink = DomUtil.create('a', className + '-toggle', container);
|
||||
link.href = '#';
|
||||
link.title = 'Layers';
|
||||
|
||||
if (Browser.touch) {
|
||||
DomEvent.on(link, 'click', DomEvent.stop);
|
||||
DomEvent.on(link, 'click', this.expand, this);
|
||||
} else {
|
||||
DomEvent.on(link, 'focus', this.expand, this);
|
||||
}
|
||||
|
||||
if (!collapsed) {
|
||||
this.expand();
|
||||
}
|
||||
|
||||
this._baseLayersList = DomUtil.create('div', className + '-base', section);
|
||||
this._separator = DomUtil.create('div', className + '-separator', section);
|
||||
this._overlaysList = DomUtil.create('div', className + '-overlays', section);
|
||||
|
||||
container.appendChild(section);
|
||||
},
|
||||
|
||||
_getLayer: function (id) {
|
||||
for (var i = 0; i < this._layers.length; i++) {
|
||||
|
||||
if (this._layers[i] && Util.stamp(this._layers[i].layer) === id) {
|
||||
return this._layers[i];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_addLayer: function (layer, name, overlay) {
|
||||
if (this._map) {
|
||||
layer.on('add remove', this._onLayerChange, this);
|
||||
}
|
||||
|
||||
this._layers.push({
|
||||
layer: layer,
|
||||
name: name,
|
||||
overlay: overlay
|
||||
});
|
||||
|
||||
if (this.options.sortLayers) {
|
||||
this._layers.sort(Util.bind(function (a, b) {
|
||||
return this.options.sortFunction(a.layer, b.layer, a.name, b.name);
|
||||
}, this));
|
||||
}
|
||||
|
||||
if (this.options.autoZIndex && layer.setZIndex) {
|
||||
this._lastZIndex++;
|
||||
layer.setZIndex(this._lastZIndex);
|
||||
}
|
||||
|
||||
this._expandIfNotCollapsed();
|
||||
},
|
||||
|
||||
_update: function () {
|
||||
if (!this._container) { return this; }
|
||||
|
||||
DomUtil.empty(this._baseLayersList);
|
||||
DomUtil.empty(this._overlaysList);
|
||||
|
||||
this._layerControlInputs = [];
|
||||
var baseLayersPresent, overlaysPresent, i, obj, baseLayersCount = 0;
|
||||
|
||||
for (i = 0; i < this._layers.length; i++) {
|
||||
obj = this._layers[i];
|
||||
this._addItem(obj);
|
||||
overlaysPresent = overlaysPresent || obj.overlay;
|
||||
baseLayersPresent = baseLayersPresent || !obj.overlay;
|
||||
baseLayersCount += !obj.overlay ? 1 : 0;
|
||||
}
|
||||
|
||||
// Hide base layers section if there's only one layer.
|
||||
if (this.options.hideSingleBase) {
|
||||
baseLayersPresent = baseLayersPresent && baseLayersCount > 1;
|
||||
this._baseLayersList.style.display = baseLayersPresent ? '' : 'none';
|
||||
}
|
||||
|
||||
this._separator.style.display = overlaysPresent && baseLayersPresent ? '' : 'none';
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_onLayerChange: function (e) {
|
||||
if (!this._handlingClick) {
|
||||
this._update();
|
||||
}
|
||||
|
||||
var obj = this._getLayer(Util.stamp(e.target));
|
||||
|
||||
// @namespace Map
|
||||
// @section Layer events
|
||||
// @event baselayerchange: LayersControlEvent
|
||||
// Fired when the base layer is changed through the [layer control](#control-layers).
|
||||
// @event overlayadd: LayersControlEvent
|
||||
// Fired when an overlay is selected through the [layer control](#control-layers).
|
||||
// @event overlayremove: LayersControlEvent
|
||||
// Fired when an overlay is deselected through the [layer control](#control-layers).
|
||||
// @namespace Control.Layers
|
||||
var type = obj.overlay ?
|
||||
(e.type === 'add' ? 'overlayadd' : 'overlayremove') :
|
||||
(e.type === 'add' ? 'baselayerchange' : null);
|
||||
|
||||
if (type) {
|
||||
this._map.fire(type, obj);
|
||||
}
|
||||
},
|
||||
|
||||
// IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see http://bit.ly/PqYLBe)
|
||||
_createRadioElement: function (name, checked) {
|
||||
|
||||
var radioHtml = '<input type="radio" class="leaflet-control-layers-selector" name="' +
|
||||
name + '"' + (checked ? ' checked="checked"' : '') + '/>';
|
||||
|
||||
var radioFragment = document.createElement('div');
|
||||
radioFragment.innerHTML = radioHtml;
|
||||
|
||||
return radioFragment.firstChild;
|
||||
},
|
||||
|
||||
_addItem: function (obj) {
|
||||
var label = document.createElement('label'),
|
||||
checked = this._map.hasLayer(obj.layer),
|
||||
input;
|
||||
|
||||
if (obj.overlay) {
|
||||
input = document.createElement('input');
|
||||
input.type = 'checkbox';
|
||||
input.className = 'leaflet-control-layers-selector';
|
||||
input.defaultChecked = checked;
|
||||
} else {
|
||||
input = this._createRadioElement('leaflet-base-layers', checked);
|
||||
}
|
||||
|
||||
this._layerControlInputs.push(input);
|
||||
input.layerId = Util.stamp(obj.layer);
|
||||
|
||||
DomEvent.on(input, 'click', this._onInputClick, this);
|
||||
|
||||
var name = document.createElement('span');
|
||||
name.innerHTML = ' ' + obj.name;
|
||||
|
||||
// Helps from preventing layer control flicker when checkboxes are disabled
|
||||
// https://github.com/Leaflet/Leaflet/issues/2771
|
||||
var holder = document.createElement('div');
|
||||
|
||||
label.appendChild(holder);
|
||||
holder.appendChild(input);
|
||||
holder.appendChild(name);
|
||||
|
||||
var container = obj.overlay ? this._overlaysList : this._baseLayersList;
|
||||
container.appendChild(label);
|
||||
|
||||
this._checkDisabledLayers();
|
||||
return label;
|
||||
},
|
||||
|
||||
_onInputClick: function () {
|
||||
var inputs = this._layerControlInputs,
|
||||
input, layer;
|
||||
var addedLayers = [],
|
||||
removedLayers = [];
|
||||
|
||||
this._handlingClick = true;
|
||||
|
||||
for (var i = inputs.length - 1; i >= 0; i--) {
|
||||
input = inputs[i];
|
||||
layer = this._getLayer(input.layerId).layer;
|
||||
|
||||
if (input.checked) {
|
||||
addedLayers.push(layer);
|
||||
} else if (!input.checked) {
|
||||
removedLayers.push(layer);
|
||||
}
|
||||
}
|
||||
|
||||
// Bugfix issue 2318: Should remove all old layers before readding new ones
|
||||
for (i = 0; i < removedLayers.length; i++) {
|
||||
if (this._map.hasLayer(removedLayers[i])) {
|
||||
this._map.removeLayer(removedLayers[i]);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < addedLayers.length; i++) {
|
||||
if (!this._map.hasLayer(addedLayers[i])) {
|
||||
this._map.addLayer(addedLayers[i]);
|
||||
}
|
||||
}
|
||||
|
||||
this._handlingClick = false;
|
||||
|
||||
this._refocusOnMap();
|
||||
},
|
||||
|
||||
_checkDisabledLayers: function () {
|
||||
var inputs = this._layerControlInputs,
|
||||
input,
|
||||
layer,
|
||||
zoom = this._map.getZoom();
|
||||
|
||||
for (var i = inputs.length - 1; i >= 0; i--) {
|
||||
input = inputs[i];
|
||||
layer = this._getLayer(input.layerId).layer;
|
||||
input.disabled = (layer.options.minZoom !== undefined && zoom < layer.options.minZoom) ||
|
||||
(layer.options.maxZoom !== undefined && zoom > layer.options.maxZoom);
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
_expandIfNotCollapsed: function () {
|
||||
if (this._map && !this.options.collapsed) {
|
||||
this.expand();
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
_expand: function () {
|
||||
// Backward compatibility, remove me in 1.1.
|
||||
return this.expand();
|
||||
},
|
||||
|
||||
_collapse: function () {
|
||||
// Backward compatibility, remove me in 1.1.
|
||||
return this.collapse();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
// @factory L.control.layers(baselayers?: Object, overlays?: Object, options?: Control.Layers options)
|
||||
// Creates an attribution control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation.
|
||||
export var layers = function (baseLayers, overlays, options) {
|
||||
return new Layers(baseLayers, overlays, options);
|
||||
};
|
||||
@@ -0,0 +1,132 @@
|
||||
|
||||
import {Control} from './Control';
|
||||
import * as DomUtil from '../dom/DomUtil';
|
||||
|
||||
/*
|
||||
* @class Control.Scale
|
||||
* @aka L.Control.Scale
|
||||
* @inherits Control
|
||||
*
|
||||
* A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends `Control`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* L.control.scale().addTo(map);
|
||||
* ```
|
||||
*/
|
||||
|
||||
export var Scale = Control.extend({
|
||||
// @section
|
||||
// @aka Control.Scale options
|
||||
options: {
|
||||
position: 'bottomleft',
|
||||
|
||||
// @option maxWidth: Number = 100
|
||||
// Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).
|
||||
maxWidth: 100,
|
||||
|
||||
// @option metric: Boolean = True
|
||||
// Whether to show the metric scale line (m/km).
|
||||
metric: true,
|
||||
|
||||
// @option imperial: Boolean = True
|
||||
// Whether to show the imperial scale line (mi/ft).
|
||||
imperial: true
|
||||
|
||||
// @option updateWhenIdle: Boolean = false
|
||||
// If `true`, the control is updated on [`moveend`](#map-moveend), otherwise it's always up-to-date (updated on [`move`](#map-move)).
|
||||
},
|
||||
|
||||
onAdd: function (map) {
|
||||
var className = 'leaflet-control-scale',
|
||||
container = DomUtil.create('div', className),
|
||||
options = this.options;
|
||||
|
||||
this._addScales(options, className + '-line', container);
|
||||
|
||||
map.on(options.updateWhenIdle ? 'moveend' : 'move', this._update, this);
|
||||
map.whenReady(this._update, this);
|
||||
|
||||
return container;
|
||||
},
|
||||
|
||||
onRemove: function (map) {
|
||||
map.off(this.options.updateWhenIdle ? 'moveend' : 'move', this._update, this);
|
||||
},
|
||||
|
||||
_addScales: function (options, className, container) {
|
||||
if (options.metric) {
|
||||
this._mScale = DomUtil.create('div', className, container);
|
||||
}
|
||||
if (options.imperial) {
|
||||
this._iScale = DomUtil.create('div', className, container);
|
||||
}
|
||||
},
|
||||
|
||||
_update: function () {
|
||||
var map = this._map,
|
||||
y = map.getSize().y / 2;
|
||||
|
||||
var maxMeters = map.distance(
|
||||
map.containerPointToLatLng([0, y]),
|
||||
map.containerPointToLatLng([this.options.maxWidth, y]));
|
||||
|
||||
this._updateScales(maxMeters);
|
||||
},
|
||||
|
||||
_updateScales: function (maxMeters) {
|
||||
if (this.options.metric && maxMeters) {
|
||||
this._updateMetric(maxMeters);
|
||||
}
|
||||
if (this.options.imperial && maxMeters) {
|
||||
this._updateImperial(maxMeters);
|
||||
}
|
||||
},
|
||||
|
||||
_updateMetric: function (maxMeters) {
|
||||
var meters = this._getRoundNum(maxMeters),
|
||||
label = meters < 1000 ? meters + ' m' : (meters / 1000) + ' km';
|
||||
|
||||
this._updateScale(this._mScale, label, meters / maxMeters);
|
||||
},
|
||||
|
||||
_updateImperial: function (maxMeters) {
|
||||
var maxFeet = maxMeters * 3.2808399,
|
||||
maxMiles, miles, feet;
|
||||
|
||||
if (maxFeet > 5280) {
|
||||
maxMiles = maxFeet / 5280;
|
||||
miles = this._getRoundNum(maxMiles);
|
||||
this._updateScale(this._iScale, miles + ' mi', miles / maxMiles);
|
||||
|
||||
} else {
|
||||
feet = this._getRoundNum(maxFeet);
|
||||
this._updateScale(this._iScale, feet + ' ft', feet / maxFeet);
|
||||
}
|
||||
},
|
||||
|
||||
_updateScale: function (scale, text, ratio) {
|
||||
scale.style.width = Math.round(this.options.maxWidth * ratio) + 'px';
|
||||
scale.innerHTML = text;
|
||||
},
|
||||
|
||||
_getRoundNum: function (num) {
|
||||
var pow10 = Math.pow(10, (Math.floor(num) + '').length - 1),
|
||||
d = num / pow10;
|
||||
|
||||
d = d >= 10 ? 10 :
|
||||
d >= 5 ? 5 :
|
||||
d >= 3 ? 3 :
|
||||
d >= 2 ? 2 : 1;
|
||||
|
||||
return pow10 * d;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// @factory L.control.scale(options?: Control.Scale options)
|
||||
// Creates an scale control with the given options.
|
||||
export var scale = function (options) {
|
||||
return new Scale(options);
|
||||
};
|
||||
@@ -0,0 +1,142 @@
|
||||
|
||||
import {Control} from './Control';
|
||||
import {Map} from '../map/Map';
|
||||
import * as DomUtil from '../dom/DomUtil';
|
||||
import * as DomEvent from '../dom/DomEvent';
|
||||
|
||||
/*
|
||||
* @class Control.Zoom
|
||||
* @aka L.Control.Zoom
|
||||
* @inherits Control
|
||||
*
|
||||
* A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its [`zoomControl` option](#map-zoomcontrol) to `false`. Extends `Control`.
|
||||
*/
|
||||
|
||||
export var Zoom = Control.extend({
|
||||
// @section
|
||||
// @aka Control.Zoom options
|
||||
options: {
|
||||
position: 'topleft',
|
||||
|
||||
// @option zoomInText: String = '+'
|
||||
// The text set on the 'zoom in' button.
|
||||
zoomInText: '+',
|
||||
|
||||
// @option zoomInTitle: String = 'Zoom in'
|
||||
// The title set on the 'zoom in' button.
|
||||
zoomInTitle: 'Zoom in',
|
||||
|
||||
// @option zoomOutText: String = '−'
|
||||
// The text set on the 'zoom out' button.
|
||||
zoomOutText: '−',
|
||||
|
||||
// @option zoomOutTitle: String = 'Zoom out'
|
||||
// The title set on the 'zoom out' button.
|
||||
zoomOutTitle: 'Zoom out'
|
||||
},
|
||||
|
||||
onAdd: function (map) {
|
||||
var zoomName = 'leaflet-control-zoom',
|
||||
container = DomUtil.create('div', zoomName + ' leaflet-bar'),
|
||||
options = this.options;
|
||||
|
||||
this._zoomInButton = this._createButton(options.zoomInText, options.zoomInTitle,
|
||||
zoomName + '-in', container, this._zoomIn);
|
||||
this._zoomOutButton = this._createButton(options.zoomOutText, options.zoomOutTitle,
|
||||
zoomName + '-out', container, this._zoomOut);
|
||||
|
||||
this._updateDisabled();
|
||||
map.on('zoomend zoomlevelschange', this._updateDisabled, this);
|
||||
|
||||
return container;
|
||||
},
|
||||
|
||||
onRemove: function (map) {
|
||||
map.off('zoomend zoomlevelschange', this._updateDisabled, this);
|
||||
},
|
||||
|
||||
disable: function () {
|
||||
this._disabled = true;
|
||||
this._updateDisabled();
|
||||
return this;
|
||||
},
|
||||
|
||||
enable: function () {
|
||||
this._disabled = false;
|
||||
this._updateDisabled();
|
||||
return this;
|
||||
},
|
||||
|
||||
_zoomIn: function (e) {
|
||||
if (!this._disabled && this._map._zoom < this._map.getMaxZoom()) {
|
||||
this._map.zoomIn(this._map.options.zoomDelta * (e.shiftKey ? 3 : 1));
|
||||
}
|
||||
},
|
||||
|
||||
_zoomOut: function (e) {
|
||||
if (!this._disabled && this._map._zoom > this._map.getMinZoom()) {
|
||||
this._map.zoomOut(this._map.options.zoomDelta * (e.shiftKey ? 3 : 1));
|
||||
}
|
||||
},
|
||||
|
||||
_createButton: function (html, title, className, container, fn) {
|
||||
var link = DomUtil.create('a', className, container);
|
||||
link.innerHTML = html;
|
||||
link.href = '#';
|
||||
link.title = title;
|
||||
|
||||
/*
|
||||
* Will force screen readers like VoiceOver to read this as "Zoom in - button"
|
||||
*/
|
||||
link.setAttribute('role', 'button');
|
||||
link.setAttribute('aria-label', title);
|
||||
|
||||
DomEvent.disableClickPropagation(link);
|
||||
DomEvent.on(link, 'click', DomEvent.stop);
|
||||
DomEvent.on(link, 'click', fn, this);
|
||||
DomEvent.on(link, 'click', this._refocusOnMap, this);
|
||||
|
||||
return link;
|
||||
},
|
||||
|
||||
_updateDisabled: function () {
|
||||
var map = this._map,
|
||||
className = 'leaflet-disabled';
|
||||
|
||||
DomUtil.removeClass(this._zoomInButton, className);
|
||||
DomUtil.removeClass(this._zoomOutButton, className);
|
||||
|
||||
if (this._disabled || map._zoom === map.getMinZoom()) {
|
||||
DomUtil.addClass(this._zoomOutButton, className);
|
||||
}
|
||||
if (this._disabled || map._zoom === map.getMaxZoom()) {
|
||||
DomUtil.addClass(this._zoomInButton, className);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// @namespace Map
|
||||
// @section Control options
|
||||
// @option zoomControl: Boolean = true
|
||||
// Whether a [zoom control](#control-zoom) is added to the map by default.
|
||||
Map.mergeOptions({
|
||||
zoomControl: true
|
||||
});
|
||||
|
||||
Map.addInitHook(function () {
|
||||
if (this.options.zoomControl) {
|
||||
// @section Controls
|
||||
// @property zoomControl: Control.Zoom
|
||||
// The default zoom control (only available if the
|
||||
// [`zoomControl` option](#map-zoomcontrol) was `true` when creating the map).
|
||||
this.zoomControl = new Zoom();
|
||||
this.addControl(this.zoomControl);
|
||||
}
|
||||
});
|
||||
|
||||
// @namespace Control.Zoom
|
||||
// @factory L.control.zoom(options: Control.Zoom options)
|
||||
// Creates a zoom control
|
||||
export var zoom = function (options) {
|
||||
return new Zoom(options);
|
||||
};
|
||||
@@ -0,0 +1,171 @@
|
||||
|
||||
import {Class} from '../core/Class';
|
||||
import {Map} from '../map/Map';
|
||||
import * as Util from '../core/Util';
|
||||
import * as DomUtil from '../dom/DomUtil';
|
||||
|
||||
/*
|
||||
* @class Control
|
||||
* @aka L.Control
|
||||
* @inherits Class
|
||||
*
|
||||
* L.Control is a base class for implementing map controls. Handles positioning.
|
||||
* All other controls extend from this class.
|
||||
*/
|
||||
|
||||
export var Control = Class.extend({
|
||||
// @section
|
||||
// @aka Control options
|
||||
options: {
|
||||
// @option position: String = 'topright'
|
||||
// The position of the control (one of the map corners). Possible values are `'topleft'`,
|
||||
// `'topright'`, `'bottomleft'` or `'bottomright'`
|
||||
position: 'topright'
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
Util.setOptions(this, options);
|
||||
},
|
||||
|
||||
/* @section
|
||||
* Classes extending L.Control will inherit the following methods:
|
||||
*
|
||||
* @method getPosition: string
|
||||
* Returns the position of the control.
|
||||
*/
|
||||
getPosition: function () {
|
||||
return this.options.position;
|
||||
},
|
||||
|
||||
// @method setPosition(position: string): this
|
||||
// Sets the position of the control.
|
||||
setPosition: function (position) {
|
||||
var map = this._map;
|
||||
|
||||
if (map) {
|
||||
map.removeControl(this);
|
||||
}
|
||||
|
||||
this.options.position = position;
|
||||
|
||||
if (map) {
|
||||
map.addControl(this);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method getContainer: HTMLElement
|
||||
// Returns the HTMLElement that contains the control.
|
||||
getContainer: function () {
|
||||
return this._container;
|
||||
},
|
||||
|
||||
// @method addTo(map: Map): this
|
||||
// Adds the control to the given map.
|
||||
addTo: function (map) {
|
||||
this.remove();
|
||||
this._map = map;
|
||||
|
||||
var container = this._container = this.onAdd(map),
|
||||
pos = this.getPosition(),
|
||||
corner = map._controlCorners[pos];
|
||||
|
||||
DomUtil.addClass(container, 'leaflet-control');
|
||||
|
||||
if (pos.indexOf('bottom') !== -1) {
|
||||
corner.insertBefore(container, corner.firstChild);
|
||||
} else {
|
||||
corner.appendChild(container);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method remove: this
|
||||
// Removes the control from the map it is currently active on.
|
||||
remove: function () {
|
||||
if (!this._map) {
|
||||
return this;
|
||||
}
|
||||
|
||||
DomUtil.remove(this._container);
|
||||
|
||||
if (this.onRemove) {
|
||||
this.onRemove(this._map);
|
||||
}
|
||||
|
||||
this._map = null;
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_refocusOnMap: function (e) {
|
||||
// if map exists and event is not a keyboard event
|
||||
if (this._map && e && e.screenX > 0 && e.screenY > 0) {
|
||||
this._map.getContainer().focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export var control = function (options) {
|
||||
return new Control(options);
|
||||
};
|
||||
|
||||
/* @section Extension methods
|
||||
* @uninheritable
|
||||
*
|
||||
* Every control should extend from `L.Control` and (re-)implement the following methods.
|
||||
*
|
||||
* @method onAdd(map: Map): HTMLElement
|
||||
* Should return the container DOM element for the control and add listeners on relevant map events. Called on [`control.addTo(map)`](#control-addTo).
|
||||
*
|
||||
* @method onRemove(map: Map)
|
||||
* Optional method. Should contain all clean up code that removes the listeners previously added in [`onAdd`](#control-onadd). Called on [`control.remove()`](#control-remove).
|
||||
*/
|
||||
|
||||
/* @namespace Map
|
||||
* @section Methods for Layers and Controls
|
||||
*/
|
||||
Map.include({
|
||||
// @method addControl(control: Control): this
|
||||
// Adds the given control to the map
|
||||
addControl: function (control) {
|
||||
control.addTo(this);
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method removeControl(control: Control): this
|
||||
// Removes the given control from the map
|
||||
removeControl: function (control) {
|
||||
control.remove();
|
||||
return this;
|
||||
},
|
||||
|
||||
_initControlPos: function () {
|
||||
var corners = this._controlCorners = {},
|
||||
l = 'leaflet-',
|
||||
container = this._controlContainer =
|
||||
DomUtil.create('div', l + 'control-container', this._container);
|
||||
|
||||
function createCorner(vSide, hSide) {
|
||||
var className = l + vSide + ' ' + l + hSide;
|
||||
|
||||
corners[vSide + hSide] = DomUtil.create('div', className, container);
|
||||
}
|
||||
|
||||
createCorner('top', 'left');
|
||||
createCorner('top', 'right');
|
||||
createCorner('bottom', 'left');
|
||||
createCorner('bottom', 'right');
|
||||
},
|
||||
|
||||
_clearControlPos: function () {
|
||||
for (var i in this._controlCorners) {
|
||||
DomUtil.remove(this._controlCorners[i]);
|
||||
}
|
||||
DomUtil.remove(this._controlContainer);
|
||||
delete this._controlCorners;
|
||||
delete this._controlContainer;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
import {Control, control} from './Control';
|
||||
import {Layers, layers} from './Control.Layers';
|
||||
import {Zoom, zoom} from './Control.Zoom';
|
||||
import {Scale, scale} from './Control.Scale';
|
||||
import {Attribution, attribution} from './Control.Attribution';
|
||||
|
||||
Control.Layers = Layers;
|
||||
Control.Zoom = Zoom;
|
||||
Control.Scale = Scale;
|
||||
Control.Attribution = Attribution;
|
||||
|
||||
control.layers = layers;
|
||||
control.zoom = zoom;
|
||||
control.scale = scale;
|
||||
control.attribution = attribution;
|
||||
|
||||
export {Control, control};
|
||||
@@ -0,0 +1,147 @@
|
||||
import {svgCreate} from '../layer/vector/SVG.Util';
|
||||
|
||||
/*
|
||||
* @namespace Browser
|
||||
* @aka L.Browser
|
||||
*
|
||||
* A namespace with static properties for browser/feature detection used by Leaflet internally.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* if (L.Browser.ielt9) {
|
||||
* alert('Upgrade your browser, dude!');
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
|
||||
var style = document.documentElement.style;
|
||||
|
||||
// @property ie: Boolean; `true` for all Internet Explorer versions (not Edge).
|
||||
export var ie = 'ActiveXObject' in window;
|
||||
|
||||
// @property ielt9: Boolean; `true` for Internet Explorer versions less than 9.
|
||||
export var ielt9 = ie && !document.addEventListener;
|
||||
|
||||
// @property edge: Boolean; `true` for the Edge web browser.
|
||||
export var edge = 'msLaunchUri' in navigator && !('documentMode' in document);
|
||||
|
||||
// @property webkit: Boolean;
|
||||
// `true` for webkit-based browsers like Chrome and Safari (including mobile versions).
|
||||
export var webkit = userAgentContains('webkit');
|
||||
|
||||
// @property android: Boolean
|
||||
// `true` for any browser running on an Android platform.
|
||||
export var android = userAgentContains('android');
|
||||
|
||||
// @property android23: Boolean; `true` for browsers running on Android 2 or Android 3.
|
||||
export var android23 = userAgentContains('android 2') || userAgentContains('android 3');
|
||||
|
||||
/* See https://stackoverflow.com/a/17961266 for details on detecting stock Android */
|
||||
var webkitVer = parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10); // also matches AppleWebKit
|
||||
// @property androidStock: Boolean; `true` for the Android stock browser (i.e. not Chrome)
|
||||
export var androidStock = android && userAgentContains('Google') && webkitVer < 537 && !('AudioNode' in window);
|
||||
|
||||
// @property opera: Boolean; `true` for the Opera browser
|
||||
export var opera = !!window.opera;
|
||||
|
||||
// @property chrome: Boolean; `true` for the Chrome browser.
|
||||
export var chrome = userAgentContains('chrome');
|
||||
|
||||
// @property gecko: Boolean; `true` for gecko-based browsers like Firefox.
|
||||
export var gecko = userAgentContains('gecko') && !webkit && !opera && !ie;
|
||||
|
||||
// @property safari: Boolean; `true` for the Safari browser.
|
||||
export var safari = !chrome && userAgentContains('safari');
|
||||
|
||||
export var phantom = userAgentContains('phantom');
|
||||
|
||||
// @property opera12: Boolean
|
||||
// `true` for the Opera browser supporting CSS transforms (version 12 or later).
|
||||
export var opera12 = 'OTransition' in style;
|
||||
|
||||
// @property win: Boolean; `true` when the browser is running in a Windows platform
|
||||
export var win = navigator.platform.indexOf('Win') === 0;
|
||||
|
||||
// @property ie3d: Boolean; `true` for all Internet Explorer versions supporting CSS transforms.
|
||||
export var ie3d = ie && ('transition' in style);
|
||||
|
||||
// @property webkit3d: Boolean; `true` for webkit-based browsers supporting CSS transforms.
|
||||
export var webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()) && !android23;
|
||||
|
||||
// @property gecko3d: Boolean; `true` for gecko-based browsers supporting CSS transforms.
|
||||
export var gecko3d = 'MozPerspective' in style;
|
||||
|
||||
// @property any3d: Boolean
|
||||
// `true` for all browsers supporting CSS transforms.
|
||||
export var any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d) && !opera12 && !phantom;
|
||||
|
||||
// @property mobile: Boolean; `true` for all browsers running in a mobile device.
|
||||
export var mobile = typeof orientation !== 'undefined' || userAgentContains('mobile');
|
||||
|
||||
// @property mobileWebkit: Boolean; `true` for all webkit-based browsers in a mobile device.
|
||||
export var mobileWebkit = mobile && webkit;
|
||||
|
||||
// @property mobileWebkit3d: Boolean
|
||||
// `true` for all webkit-based browsers in a mobile device supporting CSS transforms.
|
||||
export var mobileWebkit3d = mobile && webkit3d;
|
||||
|
||||
// @property msPointer: Boolean
|
||||
// `true` for browsers implementing the Microsoft touch events model (notably IE10).
|
||||
export var msPointer = !window.PointerEvent && window.MSPointerEvent;
|
||||
|
||||
// @property pointer: Boolean
|
||||
// `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx).
|
||||
export var pointer = !!(window.PointerEvent || msPointer);
|
||||
|
||||
// @property touch: Boolean
|
||||
// `true` for all browsers supporting [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events).
|
||||
// This does not necessarily mean that the browser is running in a computer with
|
||||
// a touchscreen, it only means that the browser is capable of understanding
|
||||
// touch events.
|
||||
export var touch = !window.L_NO_TOUCH && (pointer || 'ontouchstart' in window ||
|
||||
(window.DocumentTouch && document instanceof window.DocumentTouch));
|
||||
|
||||
// @property mobileOpera: Boolean; `true` for the Opera browser in a mobile device.
|
||||
export var mobileOpera = mobile && opera;
|
||||
|
||||
// @property mobileGecko: Boolean
|
||||
// `true` for gecko-based browsers running in a mobile device.
|
||||
export var mobileGecko = mobile && gecko;
|
||||
|
||||
// @property retina: Boolean
|
||||
// `true` for browsers on a high-resolution "retina" screen or on any screen when browser's display zoom is more than 100%.
|
||||
export var retina = (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1;
|
||||
|
||||
|
||||
// @property canvas: Boolean
|
||||
// `true` when the browser supports [`<canvas>`](https://developer.mozilla.org/docs/Web/API/Canvas_API).
|
||||
export var canvas = (function () {
|
||||
return !!document.createElement('canvas').getContext;
|
||||
}());
|
||||
|
||||
// @property svg: Boolean
|
||||
// `true` when the browser supports [SVG](https://developer.mozilla.org/docs/Web/SVG).
|
||||
export var svg = !!(document.createElementNS && svgCreate('svg').createSVGRect);
|
||||
|
||||
// @property vml: Boolean
|
||||
// `true` if the browser supports [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language).
|
||||
export var vml = !svg && (function () {
|
||||
try {
|
||||
var div = document.createElement('div');
|
||||
div.innerHTML = '<v:shape adj="1"/>';
|
||||
|
||||
var shape = div.firstChild;
|
||||
shape.style.behavior = 'url(#default#VML)';
|
||||
|
||||
return shape && (typeof shape.adj === 'object');
|
||||
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}());
|
||||
|
||||
|
||||
function userAgentContains(str) {
|
||||
return navigator.userAgent.toLowerCase().indexOf(str) >= 0;
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
import * as Util from './Util';
|
||||
|
||||
// @class Class
|
||||
// @aka L.Class
|
||||
|
||||
// @section
|
||||
// @uninheritable
|
||||
|
||||
// Thanks to John Resig and Dean Edwards for inspiration!
|
||||
|
||||
export function Class() {}
|
||||
|
||||
Class.extend = function (props) {
|
||||
|
||||
// @function extend(props: Object): Function
|
||||
// [Extends the current class](#class-inheritance) given the properties to be included.
|
||||
// Returns a Javascript function that is a class constructor (to be called with `new`).
|
||||
var NewClass = function () {
|
||||
|
||||
// call the constructor
|
||||
if (this.initialize) {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
// call all constructor hooks
|
||||
this.callInitHooks();
|
||||
};
|
||||
|
||||
var parentProto = NewClass.__super__ = this.prototype;
|
||||
|
||||
var proto = Util.create(parentProto);
|
||||
proto.constructor = NewClass;
|
||||
|
||||
NewClass.prototype = proto;
|
||||
|
||||
// inherit parent's statics
|
||||
for (var i in this) {
|
||||
if (this.hasOwnProperty(i) && i !== 'prototype' && i !== '__super__') {
|
||||
NewClass[i] = this[i];
|
||||
}
|
||||
}
|
||||
|
||||
// mix static properties into the class
|
||||
if (props.statics) {
|
||||
Util.extend(NewClass, props.statics);
|
||||
delete props.statics;
|
||||
}
|
||||
|
||||
// mix includes into the prototype
|
||||
if (props.includes) {
|
||||
checkDeprecatedMixinEvents(props.includes);
|
||||
Util.extend.apply(null, [proto].concat(props.includes));
|
||||
delete props.includes;
|
||||
}
|
||||
|
||||
// merge options
|
||||
if (proto.options) {
|
||||
props.options = Util.extend(Util.create(proto.options), props.options);
|
||||
}
|
||||
|
||||
// mix given properties into the prototype
|
||||
Util.extend(proto, props);
|
||||
|
||||
proto._initHooks = [];
|
||||
|
||||
// add method for calling all hooks
|
||||
proto.callInitHooks = function () {
|
||||
|
||||
if (this._initHooksCalled) { return; }
|
||||
|
||||
if (parentProto.callInitHooks) {
|
||||
parentProto.callInitHooks.call(this);
|
||||
}
|
||||
|
||||
this._initHooksCalled = true;
|
||||
|
||||
for (var i = 0, len = proto._initHooks.length; i < len; i++) {
|
||||
proto._initHooks[i].call(this);
|
||||
}
|
||||
};
|
||||
|
||||
return NewClass;
|
||||
};
|
||||
|
||||
|
||||
// @function include(properties: Object): this
|
||||
// [Includes a mixin](#class-includes) into the current class.
|
||||
Class.include = function (props) {
|
||||
Util.extend(this.prototype, props);
|
||||
return this;
|
||||
};
|
||||
|
||||
// @function mergeOptions(options: Object): this
|
||||
// [Merges `options`](#class-options) into the defaults of the class.
|
||||
Class.mergeOptions = function (options) {
|
||||
Util.extend(this.prototype.options, options);
|
||||
return this;
|
||||
};
|
||||
|
||||
// @function addInitHook(fn: Function): this
|
||||
// Adds a [constructor hook](#class-constructor-hooks) to the class.
|
||||
Class.addInitHook = function (fn) { // (Function) || (String, args...)
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
|
||||
var init = typeof fn === 'function' ? fn : function () {
|
||||
this[fn].apply(this, args);
|
||||
};
|
||||
|
||||
this.prototype._initHooks = this.prototype._initHooks || [];
|
||||
this.prototype._initHooks.push(init);
|
||||
return this;
|
||||
};
|
||||
|
||||
function checkDeprecatedMixinEvents(includes) {
|
||||
if (typeof L === 'undefined' || !L || !L.Mixin) { return; }
|
||||
|
||||
includes = Util.isArray(includes) ? includes : [includes];
|
||||
|
||||
for (var i = 0; i < includes.length; i++) {
|
||||
if (includes[i] === L.Mixin.Events) {
|
||||
console.warn('Deprecated include of L.Mixin.Events: ' +
|
||||
'this property will be removed in future releases, ' +
|
||||
'please inherit from L.Evented instead.', new Error().stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
|
||||
@class Class
|
||||
@aka L.Class
|
||||
|
||||
L.Class powers the OOP facilities of Leaflet and is used to create almost all of the Leaflet classes documented here.
|
||||
|
||||
In addition to implementing a simple classical inheritance model, it introduces several special properties for convenient code organization — options, includes and statics.
|
||||
|
||||
|
||||
@example
|
||||
|
||||
```js
|
||||
var MyClass = L.Class.extend({
|
||||
initialize: function (greeter) {
|
||||
this.greeter = greeter;
|
||||
// class constructor
|
||||
},
|
||||
|
||||
greet: function (name) {
|
||||
alert(this.greeter + ', ' + name)
|
||||
}
|
||||
});
|
||||
|
||||
// create instance of MyClass, passing "Hello" to the constructor
|
||||
var a = new MyClass("Hello");
|
||||
|
||||
// call greet method, alerting "Hello, World"
|
||||
a.greet("World");
|
||||
```
|
||||
|
||||
@section Class Factories
|
||||
@example
|
||||
|
||||
You may have noticed that Leaflet objects are created without using
|
||||
the `new` keyword. This is achieved by complementing each class with a
|
||||
lowercase factory method:
|
||||
|
||||
```js
|
||||
new L.Map('map'); // becomes:
|
||||
L.map('map');
|
||||
```
|
||||
|
||||
The factories are implemented very easily, and you can do this for your own classes:
|
||||
|
||||
```js
|
||||
L.map = function (id, options) {
|
||||
return new L.Map(id, options);
|
||||
};
|
||||
```
|
||||
@section Inheritance
|
||||
@example
|
||||
|
||||
You use L.Class.extend to define new classes, but you can use the same method on any class to inherit from it:
|
||||
|
||||
```js
|
||||
var MyChildClass = MyClass.extend({
|
||||
// ... new properties and methods
|
||||
});
|
||||
```
|
||||
|
||||
This will create a class that inherits all methods and properties of the parent class (through a proper prototype chain), adding or overriding the ones you pass to extend. It will also properly react to instanceof:
|
||||
|
||||
```js
|
||||
var a = new MyChildClass();
|
||||
a instanceof MyChildClass; // true
|
||||
a instanceof MyClass; // true
|
||||
```
|
||||
|
||||
You can call parent methods (including constructor) from corresponding child ones (as you do with super calls in other languages) by accessing parent class prototype and using JavaScript's call or apply:
|
||||
|
||||
```
|
||||
var MyChildClass = MyClass.extend({
|
||||
initialize: function () {
|
||||
MyClass.prototype.initialize.call(this, "Yo");
|
||||
},
|
||||
|
||||
greet: function (name) {
|
||||
MyClass.prototype.greet.call(this, 'bro ' + name + '!');
|
||||
}
|
||||
});
|
||||
|
||||
var a = new MyChildClass();
|
||||
a.greet('Jason'); // alerts "Yo, bro Jason!"
|
||||
```
|
||||
|
||||
@section Options
|
||||
@example
|
||||
|
||||
`options` is a special property that unlike other objects that you pass
|
||||
to `extend` will be merged with the parent one instead of overriding it
|
||||
completely, which makes managing configuration of objects and default
|
||||
values convenient:
|
||||
|
||||
```js
|
||||
var MyClass = L.Class.extend({
|
||||
options: {
|
||||
myOption1: 'foo',
|
||||
myOption2: 'bar'
|
||||
}
|
||||
});
|
||||
|
||||
var MyChildClass = MyClass.extend({
|
||||
options: {
|
||||
myOption1: 'baz',
|
||||
myOption3: 5
|
||||
}
|
||||
});
|
||||
|
||||
var a = new MyChildClass();
|
||||
a.options.myOption1; // 'baz'
|
||||
a.options.myOption2; // 'bar'
|
||||
a.options.myOption3; // 5
|
||||
```
|
||||
|
||||
There's also [`L.Util.setOptions`](#util-setoptions), a method for
|
||||
conveniently merging options passed to constructor with the defaults
|
||||
defines in the class:
|
||||
|
||||
```js
|
||||
var MyClass = L.Class.extend({
|
||||
options: {
|
||||
foo: 'bar',
|
||||
bla: 5
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
L.Util.setOptions(this, options);
|
||||
...
|
||||
}
|
||||
});
|
||||
|
||||
var a = new MyClass({bla: 10});
|
||||
a.options; // {foo: 'bar', bla: 10}
|
||||
```
|
||||
|
||||
Note that the options object allows any keys, not just
|
||||
the options defined by the class and its base classes.
|
||||
This means you can use the options object to store
|
||||
application specific information, as long as you avoid
|
||||
keys that are already used by the class in question.
|
||||
|
||||
@section Includes
|
||||
@example
|
||||
|
||||
`includes` is a special class property that merges all specified objects into the class (such objects are called mixins).
|
||||
|
||||
```js
|
||||
var MyMixin = {
|
||||
foo: function () { ... },
|
||||
bar: 5
|
||||
};
|
||||
|
||||
var MyClass = L.Class.extend({
|
||||
includes: MyMixin
|
||||
});
|
||||
|
||||
var a = new MyClass();
|
||||
a.foo();
|
||||
```
|
||||
|
||||
You can also do such includes in runtime with the `include` method:
|
||||
|
||||
```js
|
||||
MyClass.include(MyMixin);
|
||||
```
|
||||
|
||||
`statics` is just a convenience property that injects specified object properties as the static properties of the class, useful for defining constants:
|
||||
|
||||
```js
|
||||
var MyClass = L.Class.extend({
|
||||
statics: {
|
||||
FOO: 'bar',
|
||||
BLA: 5
|
||||
}
|
||||
});
|
||||
|
||||
MyClass.FOO; // 'bar'
|
||||
```
|
||||
|
||||
|
||||
@section Constructor hooks
|
||||
@example
|
||||
|
||||
If you're a plugin developer, you often need to add additional initialization code to existing classes (e.g. editing hooks for `L.Polyline`). Leaflet comes with a way to do it easily using the `addInitHook` method:
|
||||
|
||||
```js
|
||||
MyClass.addInitHook(function () {
|
||||
// ... do something in constructor additionally
|
||||
// e.g. add event listeners, set custom properties etc.
|
||||
});
|
||||
```
|
||||
|
||||
You can also use the following shortcut when you just need to make one additional method call:
|
||||
|
||||
```js
|
||||
MyClass.addInitHook('methodName', arg1, arg2, …);
|
||||
```
|
||||
@@ -0,0 +1,295 @@
|
||||
import {Class} from './Class';
|
||||
import * as Util from './Util';
|
||||
|
||||
/*
|
||||
* @class Evented
|
||||
* @aka L.Evented
|
||||
* @inherits Class
|
||||
*
|
||||
* A set of methods shared between event-powered classes (like `Map` and `Marker`). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire `'click'` event).
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* map.on('click', function(e) {
|
||||
* alert(e.latlng);
|
||||
* } );
|
||||
* ```
|
||||
*
|
||||
* Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:
|
||||
*
|
||||
* ```js
|
||||
* function onClick(e) { ... }
|
||||
*
|
||||
* map.on('click', onClick);
|
||||
* map.off('click', onClick);
|
||||
* ```
|
||||
*/
|
||||
|
||||
export var Events = {
|
||||
/* @method on(type: String, fn: Function, context?: Object): this
|
||||
* Adds a listener function (`fn`) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. `'click dblclick'`).
|
||||
*
|
||||
* @alternative
|
||||
* @method on(eventMap: Object): this
|
||||
* Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`
|
||||
*/
|
||||
on: function (types, fn, context) {
|
||||
|
||||
// types can be a map of types/handlers
|
||||
if (typeof types === 'object') {
|
||||
for (var type in types) {
|
||||
// we don't process space-separated events here for performance;
|
||||
// it's a hot path since Layer uses the on(obj) syntax
|
||||
this._on(type, types[type], fn);
|
||||
}
|
||||
|
||||
} else {
|
||||
// types can be a string of space-separated words
|
||||
types = Util.splitWords(types);
|
||||
|
||||
for (var i = 0, len = types.length; i < len; i++) {
|
||||
this._on(types[i], fn, context);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/* @method off(type: String, fn?: Function, context?: Object): this
|
||||
* Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to `on`, you must pass the same context to `off` in order to remove the listener.
|
||||
*
|
||||
* @alternative
|
||||
* @method off(eventMap: Object): this
|
||||
* Removes a set of type/listener pairs.
|
||||
*
|
||||
* @alternative
|
||||
* @method off: this
|
||||
* Removes all listeners to all events on the object.
|
||||
*/
|
||||
off: function (types, fn, context) {
|
||||
|
||||
if (!types) {
|
||||
// clear all listeners if called without arguments
|
||||
delete this._events;
|
||||
|
||||
} else if (typeof types === 'object') {
|
||||
for (var type in types) {
|
||||
this._off(type, types[type], fn);
|
||||
}
|
||||
|
||||
} else {
|
||||
types = Util.splitWords(types);
|
||||
|
||||
for (var i = 0, len = types.length; i < len; i++) {
|
||||
this._off(types[i], fn, context);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// attach listener (without syntactic sugar now)
|
||||
_on: function (type, fn, context) {
|
||||
this._events = this._events || {};
|
||||
|
||||
/* get/init listeners for type */
|
||||
var typeListeners = this._events[type];
|
||||
if (!typeListeners) {
|
||||
typeListeners = [];
|
||||
this._events[type] = typeListeners;
|
||||
}
|
||||
|
||||
if (context === this) {
|
||||
// Less memory footprint.
|
||||
context = undefined;
|
||||
}
|
||||
var newListener = {fn: fn, ctx: context},
|
||||
listeners = typeListeners;
|
||||
|
||||
// check if fn already there
|
||||
for (var i = 0, len = listeners.length; i < len; i++) {
|
||||
if (listeners[i].fn === fn && listeners[i].ctx === context) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
listeners.push(newListener);
|
||||
},
|
||||
|
||||
_off: function (type, fn, context) {
|
||||
var listeners,
|
||||
i,
|
||||
len;
|
||||
|
||||
if (!this._events) { return; }
|
||||
|
||||
listeners = this._events[type];
|
||||
|
||||
if (!listeners) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fn) {
|
||||
// Set all removed listeners to noop so they are not called if remove happens in fire
|
||||
for (i = 0, len = listeners.length; i < len; i++) {
|
||||
listeners[i].fn = Util.falseFn;
|
||||
}
|
||||
// clear all listeners for a type if function isn't specified
|
||||
delete this._events[type];
|
||||
return;
|
||||
}
|
||||
|
||||
if (context === this) {
|
||||
context = undefined;
|
||||
}
|
||||
|
||||
if (listeners) {
|
||||
|
||||
// find fn and remove it
|
||||
for (i = 0, len = listeners.length; i < len; i++) {
|
||||
var l = listeners[i];
|
||||
if (l.ctx !== context) { continue; }
|
||||
if (l.fn === fn) {
|
||||
|
||||
// set the removed listener to noop so that's not called if remove happens in fire
|
||||
l.fn = Util.falseFn;
|
||||
|
||||
if (this._firingCount) {
|
||||
/* copy array in case events are being fired */
|
||||
this._events[type] = listeners = listeners.slice();
|
||||
}
|
||||
listeners.splice(i, 1);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// @method fire(type: String, data?: Object, propagate?: Boolean): this
|
||||
// Fires an event of the specified type. You can optionally provide an data
|
||||
// object — the first argument of the listener function will contain its
|
||||
// properties. The event can optionally be propagated to event parents.
|
||||
fire: function (type, data, propagate) {
|
||||
if (!this.listens(type, propagate)) { return this; }
|
||||
|
||||
var event = Util.extend({}, data, {
|
||||
type: type,
|
||||
target: this,
|
||||
sourceTarget: data && data.sourceTarget || this
|
||||
});
|
||||
|
||||
if (this._events) {
|
||||
var listeners = this._events[type];
|
||||
|
||||
if (listeners) {
|
||||
this._firingCount = (this._firingCount + 1) || 1;
|
||||
for (var i = 0, len = listeners.length; i < len; i++) {
|
||||
var l = listeners[i];
|
||||
l.fn.call(l.ctx || this, event);
|
||||
}
|
||||
|
||||
this._firingCount--;
|
||||
}
|
||||
}
|
||||
|
||||
if (propagate) {
|
||||
// propagate the event to parents (set with addEventParent)
|
||||
this._propagateEvent(event);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method listens(type: String): Boolean
|
||||
// Returns `true` if a particular event type has any listeners attached to it.
|
||||
listens: function (type, propagate) {
|
||||
var listeners = this._events && this._events[type];
|
||||
if (listeners && listeners.length) { return true; }
|
||||
|
||||
if (propagate) {
|
||||
// also check parents for listeners if event propagates
|
||||
for (var id in this._eventParents) {
|
||||
if (this._eventParents[id].listens(type, propagate)) { return true; }
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
// @method once(…): this
|
||||
// Behaves as [`on(…)`](#evented-on), except the listener will only get fired once and then removed.
|
||||
once: function (types, fn, context) {
|
||||
|
||||
if (typeof types === 'object') {
|
||||
for (var type in types) {
|
||||
this.once(type, types[type], fn);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
var handler = Util.bind(function () {
|
||||
this
|
||||
.off(types, fn, context)
|
||||
.off(types, handler, context);
|
||||
}, this);
|
||||
|
||||
// add a listener that's executed once and removed after that
|
||||
return this
|
||||
.on(types, fn, context)
|
||||
.on(types, handler, context);
|
||||
},
|
||||
|
||||
// @method addEventParent(obj: Evented): this
|
||||
// Adds an event parent - an `Evented` that will receive propagated events
|
||||
addEventParent: function (obj) {
|
||||
this._eventParents = this._eventParents || {};
|
||||
this._eventParents[Util.stamp(obj)] = obj;
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method removeEventParent(obj: Evented): this
|
||||
// Removes an event parent, so it will stop receiving propagated events
|
||||
removeEventParent: function (obj) {
|
||||
if (this._eventParents) {
|
||||
delete this._eventParents[Util.stamp(obj)];
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
_propagateEvent: function (e) {
|
||||
for (var id in this._eventParents) {
|
||||
this._eventParents[id].fire(e.type, Util.extend({
|
||||
layer: e.target,
|
||||
propagatedFrom: e.target
|
||||
}, e), true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// aliases; we should ditch those eventually
|
||||
|
||||
// @method addEventListener(…): this
|
||||
// Alias to [`on(…)`](#evented-on)
|
||||
Events.addEventListener = Events.on;
|
||||
|
||||
// @method removeEventListener(…): this
|
||||
// Alias to [`off(…)`](#evented-off)
|
||||
|
||||
// @method clearAllEventListeners(…): this
|
||||
// Alias to [`off()`](#evented-off)
|
||||
Events.removeEventListener = Events.clearAllEventListeners = Events.off;
|
||||
|
||||
// @method addOneTimeEventListener(…): this
|
||||
// Alias to [`once(…)`](#evented-once)
|
||||
Events.addOneTimeEventListener = Events.once;
|
||||
|
||||
// @method fireEvent(…): this
|
||||
// Alias to [`fire(…)`](#evented-fire)
|
||||
Events.fireEvent = Events.fire;
|
||||
|
||||
// @method hasEventListeners(…): Boolean
|
||||
// Alias to [`listens(…)`](#evented-listens)
|
||||
Events.hasEventListeners = Events.listens;
|
||||
|
||||
export var Evented = Class.extend(Events);
|
||||
@@ -0,0 +1,143 @@
|
||||
|
||||
@namespace Event objects
|
||||
|
||||
|
||||
Whenever a class inheriting from `Evented` fires an event, a listener function
|
||||
will be called with an event argument, which is a plain object containing
|
||||
information about the event. For example:
|
||||
|
||||
```js
|
||||
map.on('click', function(ev) {
|
||||
alert(ev.latlng); // ev is an event object (MouseEvent in this case)
|
||||
});
|
||||
```
|
||||
|
||||
The information available depends on the event type:
|
||||
|
||||
|
||||
@miniclass Event (Event objects)
|
||||
@section
|
||||
The base event object. All other event objects contain these properties too.
|
||||
@property type: String
|
||||
The event type (e.g. `'click'`).
|
||||
@property target: Object
|
||||
The object that fired the event. For propagated events, the last object in
|
||||
the propagation chain that fired the event.
|
||||
@property sourceTarget: Object
|
||||
The object that originally fired the event. For non-propagated events, this will
|
||||
be the same as the `target`.
|
||||
@property propagatedFrom: Object
|
||||
For propagated events, the last object that propagated the event to its
|
||||
event parent.
|
||||
@property layer: Object
|
||||
**Deprecated.** The same as `propagatedFrom`.
|
||||
|
||||
|
||||
@miniclass KeyboardEvent (Event objects)
|
||||
@inherits Event
|
||||
@property originalEvent: DOMEvent
|
||||
The original [DOM `KeyboardEvent`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent) that triggered this Leaflet event.
|
||||
|
||||
@miniclass MouseEvent (Event objects)
|
||||
@inherits Event
|
||||
@property latlng: LatLng
|
||||
The geographical point where the mouse event occured.
|
||||
@property layerPoint: Point
|
||||
Pixel coordinates of the point where the mouse event occured relative to the map layer.
|
||||
@property containerPoint: Point
|
||||
Pixel coordinates of the point where the mouse event occured relative to the map сontainer.
|
||||
@property originalEvent: DOMEvent
|
||||
The original [DOM `MouseEvent`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent) or [DOM `TouchEvent`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent) that triggered this Leaflet event.
|
||||
|
||||
@miniclass LocationEvent (Event objects)
|
||||
@inherits Event
|
||||
@property latlng: LatLng
|
||||
Detected geographical location of the user.
|
||||
@property bounds: LatLngBounds
|
||||
Geographical bounds of the area user is located in (with respect to the accuracy of location).
|
||||
@property accuracy: Number
|
||||
Accuracy of location in meters.
|
||||
@property altitude: Number
|
||||
Height of the position above the WGS84 ellipsoid in meters.
|
||||
@property altitudeAccuracy: Number
|
||||
Accuracy of altitude in meters.
|
||||
@property heading: Number
|
||||
The direction of travel in degrees counting clockwise from true North.
|
||||
@property speed: Number
|
||||
Current velocity in meters per second.
|
||||
@property timestamp: Number
|
||||
The time when the position was acquired.
|
||||
|
||||
@miniclass ErrorEvent (Event objects)
|
||||
@inherits Event
|
||||
@property message: String
|
||||
Error message.
|
||||
@property code: Number
|
||||
Error code (if applicable).
|
||||
|
||||
@miniclass LayerEvent (Event objects)
|
||||
@inherits Event
|
||||
@property layer: Layer
|
||||
The layer that was added or removed.
|
||||
|
||||
@miniclass LayersControlEvent (Event objects)
|
||||
@inherits Event
|
||||
@property layer: Layer
|
||||
The layer that was added or removed.
|
||||
@property name: String
|
||||
The name of the layer that was added or removed.
|
||||
|
||||
@miniclass TileEvent (Event objects)
|
||||
@inherits Event
|
||||
@property tile: HTMLElement
|
||||
The tile element (image).
|
||||
@property coords: Point
|
||||
Point object with the tile's `x`, `y`, and `z` (zoom level) coordinates.
|
||||
|
||||
@miniclass TileErrorEvent (Event objects)
|
||||
@inherits Event
|
||||
@property tile: HTMLElement
|
||||
The tile element (image).
|
||||
@property coords: Point
|
||||
Point object with the tile's `x`, `y`, and `z` (zoom level) coordinates.
|
||||
@property error: *
|
||||
Error passed to the tile's `done()` callback.
|
||||
|
||||
@miniclass ResizeEvent (Event objects)
|
||||
@inherits Event
|
||||
@property oldSize: Point
|
||||
The old size before resize event.
|
||||
@property newSize: Point
|
||||
The new size after the resize event.
|
||||
|
||||
@miniclass GeoJSONEvent (Event objects)
|
||||
@inherits Event
|
||||
@property layer: Layer
|
||||
The layer for the GeoJSON feature that is being added to the map.
|
||||
@property properties: Object
|
||||
GeoJSON properties of the feature.
|
||||
@property geometryType: String
|
||||
GeoJSON geometry type of the feature.
|
||||
@property id: String
|
||||
GeoJSON ID of the feature (if present).
|
||||
|
||||
@miniclass PopupEvent (Event objects)
|
||||
@inherits Event
|
||||
@property popup: Popup
|
||||
The popup that was opened or closed.
|
||||
|
||||
@miniclass TooltipEvent (Event objects)
|
||||
@inherits Event
|
||||
@property tooltip: Tooltip
|
||||
The tooltip that was opened or closed.
|
||||
|
||||
@miniclass DragEndEvent (Event objects)
|
||||
@inherits Event
|
||||
@property distance: Number
|
||||
The distance in pixels the draggable element was moved by.
|
||||
|
||||
@miniclass ZoomAnimEvent (Event objects)
|
||||
@inherits Event
|
||||
@property center: LatLng; The current center of the map
|
||||
@property zoom: Number; The current zoom level of the map
|
||||
@property noUpdate: Boolean; Whether layers should update their contents due to this event
|
||||
@@ -0,0 +1,57 @@
|
||||
import {Class} from './Class';
|
||||
|
||||
/*
|
||||
L.Handler is a base class for handler classes that are used internally to inject
|
||||
interaction features like dragging to classes like Map and Marker.
|
||||
*/
|
||||
|
||||
// @class Handler
|
||||
// @aka L.Handler
|
||||
// Abstract class for map interaction handlers
|
||||
|
||||
export var Handler = Class.extend({
|
||||
initialize: function (map) {
|
||||
this._map = map;
|
||||
},
|
||||
|
||||
// @method enable(): this
|
||||
// Enables the handler
|
||||
enable: function () {
|
||||
if (this._enabled) { return this; }
|
||||
|
||||
this._enabled = true;
|
||||
this.addHooks();
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method disable(): this
|
||||
// Disables the handler
|
||||
disable: function () {
|
||||
if (!this._enabled) { return this; }
|
||||
|
||||
this._enabled = false;
|
||||
this.removeHooks();
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method enabled(): Boolean
|
||||
// Returns `true` if the handler is enabled
|
||||
enabled: function () {
|
||||
return !!this._enabled;
|
||||
}
|
||||
|
||||
// @section Extension methods
|
||||
// Classes inheriting from `Handler` must implement the two following methods:
|
||||
// @method addHooks()
|
||||
// Called when the handler is enabled, should add event hooks.
|
||||
// @method removeHooks()
|
||||
// Called when the handler is disabled, should remove the event hooks added previously.
|
||||
});
|
||||
|
||||
// @section There is static function which can be called without instantiating L.Handler:
|
||||
// @function addTo(map: Map, name: String): this
|
||||
// Adds a new Handler to the given map with the given name.
|
||||
Handler.addTo = function (map, name) {
|
||||
map.addHandler(name, this);
|
||||
return this;
|
||||
};
|
||||
@@ -0,0 +1,241 @@
|
||||
/*
|
||||
* @namespace Util
|
||||
*
|
||||
* Various utility functions, used by Leaflet internally.
|
||||
*/
|
||||
|
||||
export var freeze = Object.freeze;
|
||||
Object.freeze = function (obj) { return obj; };
|
||||
|
||||
// @function extend(dest: Object, src?: Object): Object
|
||||
// Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut.
|
||||
export function extend(dest) {
|
||||
var i, j, len, src;
|
||||
|
||||
for (j = 1, len = arguments.length; j < len; j++) {
|
||||
src = arguments[j];
|
||||
for (i in src) {
|
||||
dest[i] = src[i];
|
||||
}
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
||||
// @function create(proto: Object, properties?: Object): Object
|
||||
// Compatibility polyfill for [Object.create](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create)
|
||||
export var create = Object.create || (function () {
|
||||
function F() {}
|
||||
return function (proto) {
|
||||
F.prototype = proto;
|
||||
return new F();
|
||||
};
|
||||
})();
|
||||
|
||||
// @function bind(fn: Function, …): Function
|
||||
// Returns a new function bound to the arguments passed, like [Function.prototype.bind](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).
|
||||
// Has a `L.bind()` shortcut.
|
||||
export function bind(fn, obj) {
|
||||
var slice = Array.prototype.slice;
|
||||
|
||||
if (fn.bind) {
|
||||
return fn.bind.apply(fn, slice.call(arguments, 1));
|
||||
}
|
||||
|
||||
var args = slice.call(arguments, 2);
|
||||
|
||||
return function () {
|
||||
return fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments);
|
||||
};
|
||||
}
|
||||
|
||||
// @property lastId: Number
|
||||
// Last unique ID used by [`stamp()`](#util-stamp)
|
||||
export var lastId = 0;
|
||||
|
||||
// @function stamp(obj: Object): Number
|
||||
// Returns the unique ID of an object, assigning it one if it doesn't have it.
|
||||
export function stamp(obj) {
|
||||
/*eslint-disable */
|
||||
obj._leaflet_id = obj._leaflet_id || ++lastId;
|
||||
return obj._leaflet_id;
|
||||
/* eslint-enable */
|
||||
}
|
||||
|
||||
// @function throttle(fn: Function, time: Number, context: Object): Function
|
||||
// Returns a function which executes function `fn` with the given scope `context`
|
||||
// (so that the `this` keyword refers to `context` inside `fn`'s code). The function
|
||||
// `fn` will be called no more than one time per given amount of `time`. The arguments
|
||||
// received by the bound function will be any arguments passed when binding the
|
||||
// function, followed by any arguments passed when invoking the bound function.
|
||||
// Has an `L.throttle` shortcut.
|
||||
export function throttle(fn, time, context) {
|
||||
var lock, args, wrapperFn, later;
|
||||
|
||||
later = function () {
|
||||
// reset lock and call if queued
|
||||
lock = false;
|
||||
if (args) {
|
||||
wrapperFn.apply(context, args);
|
||||
args = false;
|
||||
}
|
||||
};
|
||||
|
||||
wrapperFn = function () {
|
||||
if (lock) {
|
||||
// called too soon, queue to call later
|
||||
args = arguments;
|
||||
|
||||
} else {
|
||||
// call and lock until later
|
||||
fn.apply(context, arguments);
|
||||
setTimeout(later, time);
|
||||
lock = true;
|
||||
}
|
||||
};
|
||||
|
||||
return wrapperFn;
|
||||
}
|
||||
|
||||
// @function wrapNum(num: Number, range: Number[], includeMax?: Boolean): Number
|
||||
// Returns the number `num` modulo `range` in such a way so it lies within
|
||||
// `range[0]` and `range[1]`. The returned value will be always smaller than
|
||||
// `range[1]` unless `includeMax` is set to `true`.
|
||||
export function wrapNum(x, range, includeMax) {
|
||||
var max = range[1],
|
||||
min = range[0],
|
||||
d = max - min;
|
||||
return x === max && includeMax ? x : ((x - min) % d + d) % d + min;
|
||||
}
|
||||
|
||||
// @function falseFn(): Function
|
||||
// Returns a function which always returns `false`.
|
||||
export function falseFn() { return false; }
|
||||
|
||||
// @function formatNum(num: Number, digits?: Number): Number
|
||||
// Returns the number `num` rounded to `digits` decimals, or to 6 decimals by default.
|
||||
export function formatNum(num, digits) {
|
||||
var pow = Math.pow(10, (digits === undefined ? 6 : digits));
|
||||
return Math.round(num * pow) / pow;
|
||||
}
|
||||
|
||||
// @function trim(str: String): String
|
||||
// Compatibility polyfill for [String.prototype.trim](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim)
|
||||
export function trim(str) {
|
||||
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
|
||||
// @function splitWords(str: String): String[]
|
||||
// Trims and splits the string on whitespace and returns the array of parts.
|
||||
export function splitWords(str) {
|
||||
return trim(str).split(/\s+/);
|
||||
}
|
||||
|
||||
// @function setOptions(obj: Object, options: Object): Object
|
||||
// Merges the given properties to the `options` of the `obj` object, returning the resulting options. See `Class options`. Has an `L.setOptions` shortcut.
|
||||
export function setOptions(obj, options) {
|
||||
if (!obj.hasOwnProperty('options')) {
|
||||
obj.options = obj.options ? create(obj.options) : {};
|
||||
}
|
||||
for (var i in options) {
|
||||
obj.options[i] = options[i];
|
||||
}
|
||||
return obj.options;
|
||||
}
|
||||
|
||||
// @function getParamString(obj: Object, existingUrl?: String, uppercase?: Boolean): String
|
||||
// Converts an object into a parameter URL string, e.g. `{a: "foo", b: "bar"}`
|
||||
// translates to `'?a=foo&b=bar'`. If `existingUrl` is set, the parameters will
|
||||
// be appended at the end. If `uppercase` is `true`, the parameter names will
|
||||
// be uppercased (e.g. `'?A=foo&B=bar'`)
|
||||
export function getParamString(obj, existingUrl, uppercase) {
|
||||
var params = [];
|
||||
for (var i in obj) {
|
||||
params.push(encodeURIComponent(uppercase ? i.toUpperCase() : i) + '=' + encodeURIComponent(obj[i]));
|
||||
}
|
||||
return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&');
|
||||
}
|
||||
|
||||
var templateRe = /\{ *([\w_-]+) *\}/g;
|
||||
|
||||
// @function template(str: String, data: Object): String
|
||||
// Simple templating facility, accepts a template string of the form `'Hello {a}, {b}'`
|
||||
// and a data object like `{a: 'foo', b: 'bar'}`, returns evaluated string
|
||||
// `('Hello foo, bar')`. You can also specify functions instead of strings for
|
||||
// data values — they will be evaluated passing `data` as an argument.
|
||||
export function template(str, data) {
|
||||
return str.replace(templateRe, function (str, key) {
|
||||
var value = data[key];
|
||||
|
||||
if (value === undefined) {
|
||||
throw new Error('No value provided for variable ' + str);
|
||||
|
||||
} else if (typeof value === 'function') {
|
||||
value = value(data);
|
||||
}
|
||||
return value;
|
||||
});
|
||||
}
|
||||
|
||||
// @function isArray(obj): Boolean
|
||||
// Compatibility polyfill for [Array.isArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray)
|
||||
export var isArray = Array.isArray || function (obj) {
|
||||
return (Object.prototype.toString.call(obj) === '[object Array]');
|
||||
};
|
||||
|
||||
// @function indexOf(array: Array, el: Object): Number
|
||||
// Compatibility polyfill for [Array.prototype.indexOf](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)
|
||||
export function indexOf(array, el) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
if (array[i] === el) { return i; }
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// @property emptyImageUrl: String
|
||||
// Data URI string containing a base64-encoded empty GIF image.
|
||||
// Used as a hack to free memory from unused images on WebKit-powered
|
||||
// mobile devices (by setting image `src` to this string).
|
||||
export var emptyImageUrl = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';
|
||||
|
||||
// inspired by http://paulirish.com/2011/requestanimationframe-for-smart-animating/
|
||||
|
||||
function getPrefixed(name) {
|
||||
return window['webkit' + name] || window['moz' + name] || window['ms' + name];
|
||||
}
|
||||
|
||||
var lastTime = 0;
|
||||
|
||||
// fallback for IE 7-8
|
||||
function timeoutDefer(fn) {
|
||||
var time = +new Date(),
|
||||
timeToCall = Math.max(0, 16 - (time - lastTime));
|
||||
|
||||
lastTime = time + timeToCall;
|
||||
return window.setTimeout(fn, timeToCall);
|
||||
}
|
||||
|
||||
export var requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer;
|
||||
export var cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') ||
|
||||
getPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); };
|
||||
|
||||
// @function requestAnimFrame(fn: Function, context?: Object, immediate?: Boolean): Number
|
||||
// Schedules `fn` to be executed when the browser repaints. `fn` is bound to
|
||||
// `context` if given. When `immediate` is set, `fn` is called immediately if
|
||||
// the browser doesn't have native support for
|
||||
// [`window.requestAnimationFrame`](https://developer.mozilla.org/docs/Web/API/window/requestAnimationFrame),
|
||||
// otherwise it's delayed. Returns a request ID that can be used to cancel the request.
|
||||
export function requestAnimFrame(fn, context, immediate) {
|
||||
if (immediate && requestFn === timeoutDefer) {
|
||||
fn.call(context);
|
||||
} else {
|
||||
return requestFn.call(window, bind(fn, context));
|
||||
}
|
||||
}
|
||||
|
||||
// @function cancelAnimFrame(id: Number): undefined
|
||||
// Cancels a previous `requestAnimFrame`. See also [window.cancelAnimationFrame](https://developer.mozilla.org/docs/Web/API/window/cancelAnimationFrame).
|
||||
export function cancelAnimFrame(id) {
|
||||
if (id) {
|
||||
cancelFn.call(window, id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import * as Browser from './Browser';
|
||||
export {Browser};
|
||||
|
||||
export {Class} from './Class';
|
||||
|
||||
import {Evented} from './Events';
|
||||
import {Events} from './Events';
|
||||
export {Evented};
|
||||
export var Mixin = {Events: Events};
|
||||
|
||||
export {Handler} from './Handler';
|
||||
|
||||
import * as Util from './Util';
|
||||
export {Util};
|
||||
export {extend, bind, stamp, setOptions} from './Util';
|
||||
@@ -0,0 +1,86 @@
|
||||
import * as Browser from '../core/Browser';
|
||||
import {_pointersCount} from './DomEvent.Pointer';
|
||||
|
||||
/*
|
||||
* Extends the event handling code with double tap support for mobile browsers.
|
||||
*/
|
||||
|
||||
var _touchstart = Browser.msPointer ? 'MSPointerDown' : Browser.pointer ? 'pointerdown' : 'touchstart';
|
||||
var _touchend = Browser.msPointer ? 'MSPointerUp' : Browser.pointer ? 'pointerup' : 'touchend';
|
||||
var _pre = '_leaflet_';
|
||||
|
||||
// inspired by Zepto touch code by Thomas Fuchs
|
||||
export function addDoubleTapListener(obj, handler, id) {
|
||||
var last, touch,
|
||||
doubleTap = false,
|
||||
delay = 250;
|
||||
|
||||
function onTouchStart(e) {
|
||||
var count;
|
||||
|
||||
if (Browser.pointer) {
|
||||
if ((!Browser.edge) || e.pointerType === 'mouse') { return; }
|
||||
count = _pointersCount;
|
||||
} else {
|
||||
count = e.touches.length;
|
||||
}
|
||||
|
||||
if (count > 1) { return; }
|
||||
|
||||
var now = Date.now(),
|
||||
delta = now - (last || now);
|
||||
|
||||
touch = e.touches ? e.touches[0] : e;
|
||||
doubleTap = (delta > 0 && delta <= delay);
|
||||
last = now;
|
||||
}
|
||||
|
||||
function onTouchEnd(e) {
|
||||
if (doubleTap && !touch.cancelBubble) {
|
||||
if (Browser.pointer) {
|
||||
if ((!Browser.edge) || e.pointerType === 'mouse') { return; }
|
||||
// work around .type being readonly with MSPointer* events
|
||||
var newTouch = {},
|
||||
prop, i;
|
||||
|
||||
for (i in touch) {
|
||||
prop = touch[i];
|
||||
newTouch[i] = prop && prop.bind ? prop.bind(touch) : prop;
|
||||
}
|
||||
touch = newTouch;
|
||||
}
|
||||
touch.type = 'dblclick';
|
||||
handler(touch);
|
||||
last = null;
|
||||
}
|
||||
}
|
||||
|
||||
obj[_pre + _touchstart + id] = onTouchStart;
|
||||
obj[_pre + _touchend + id] = onTouchEnd;
|
||||
obj[_pre + 'dblclick' + id] = handler;
|
||||
|
||||
obj.addEventListener(_touchstart, onTouchStart, false);
|
||||
obj.addEventListener(_touchend, onTouchEnd, false);
|
||||
|
||||
// On some platforms (notably, chrome<55 on win10 + touchscreen + mouse),
|
||||
// the browser doesn't fire touchend/pointerup events but does fire
|
||||
// native dblclicks. See #4127.
|
||||
// Edge 14 also fires native dblclicks, but only for pointerType mouse, see #5180.
|
||||
obj.addEventListener('dblclick', handler, false);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
export function removeDoubleTapListener(obj, id) {
|
||||
var touchstart = obj[_pre + _touchstart + id],
|
||||
touchend = obj[_pre + _touchend + id],
|
||||
dblclick = obj[_pre + 'dblclick' + id];
|
||||
|
||||
obj.removeEventListener(_touchstart, touchstart, false);
|
||||
obj.removeEventListener(_touchend, touchend, false);
|
||||
if (!Browser.edge) {
|
||||
obj.removeEventListener('dblclick', dblclick, false);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
import * as DomEvent from './DomEvent';
|
||||
import * as Util from '../core/Util';
|
||||
import * as Browser from '../core/Browser';
|
||||
|
||||
/*
|
||||
* Extends L.DomEvent to provide touch support for Internet Explorer and Windows-based devices.
|
||||
*/
|
||||
|
||||
|
||||
var POINTER_DOWN = Browser.msPointer ? 'MSPointerDown' : 'pointerdown';
|
||||
var POINTER_MOVE = Browser.msPointer ? 'MSPointerMove' : 'pointermove';
|
||||
var POINTER_UP = Browser.msPointer ? 'MSPointerUp' : 'pointerup';
|
||||
var POINTER_CANCEL = Browser.msPointer ? 'MSPointerCancel' : 'pointercancel';
|
||||
var TAG_WHITE_LIST = ['INPUT', 'SELECT', 'OPTION'];
|
||||
|
||||
var _pointers = {};
|
||||
var _pointerDocListener = false;
|
||||
|
||||
// DomEvent.DoubleTap needs to know about this
|
||||
export var _pointersCount = 0;
|
||||
|
||||
// Provides a touch events wrapper for (ms)pointer events.
|
||||
// ref http://www.w3.org/TR/pointerevents/ https://www.w3.org/Bugs/Public/show_bug.cgi?id=22890
|
||||
|
||||
export function addPointerListener(obj, type, handler, id) {
|
||||
if (type === 'touchstart') {
|
||||
_addPointerStart(obj, handler, id);
|
||||
|
||||
} else if (type === 'touchmove') {
|
||||
_addPointerMove(obj, handler, id);
|
||||
|
||||
} else if (type === 'touchend') {
|
||||
_addPointerEnd(obj, handler, id);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
export function removePointerListener(obj, type, id) {
|
||||
var handler = obj['_leaflet_' + type + id];
|
||||
|
||||
if (type === 'touchstart') {
|
||||
obj.removeEventListener(POINTER_DOWN, handler, false);
|
||||
|
||||
} else if (type === 'touchmove') {
|
||||
obj.removeEventListener(POINTER_MOVE, handler, false);
|
||||
|
||||
} else if (type === 'touchend') {
|
||||
obj.removeEventListener(POINTER_UP, handler, false);
|
||||
obj.removeEventListener(POINTER_CANCEL, handler, false);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
function _addPointerStart(obj, handler, id) {
|
||||
var onDown = Util.bind(function (e) {
|
||||
if (e.pointerType !== 'mouse' && e.MSPOINTER_TYPE_MOUSE && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) {
|
||||
// In IE11, some touch events needs to fire for form controls, or
|
||||
// the controls will stop working. We keep a whitelist of tag names that
|
||||
// need these events. For other target tags, we prevent default on the event.
|
||||
if (TAG_WHITE_LIST.indexOf(e.target.tagName) < 0) {
|
||||
DomEvent.preventDefault(e);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_handlePointer(e, handler);
|
||||
});
|
||||
|
||||
obj['_leaflet_touchstart' + id] = onDown;
|
||||
obj.addEventListener(POINTER_DOWN, onDown, false);
|
||||
|
||||
// need to keep track of what pointers and how many are active to provide e.touches emulation
|
||||
if (!_pointerDocListener) {
|
||||
// we listen documentElement as any drags that end by moving the touch off the screen get fired there
|
||||
document.documentElement.addEventListener(POINTER_DOWN, _globalPointerDown, true);
|
||||
document.documentElement.addEventListener(POINTER_MOVE, _globalPointerMove, true);
|
||||
document.documentElement.addEventListener(POINTER_UP, _globalPointerUp, true);
|
||||
document.documentElement.addEventListener(POINTER_CANCEL, _globalPointerUp, true);
|
||||
|
||||
_pointerDocListener = true;
|
||||
}
|
||||
}
|
||||
|
||||
function _globalPointerDown(e) {
|
||||
_pointers[e.pointerId] = e;
|
||||
_pointersCount++;
|
||||
}
|
||||
|
||||
function _globalPointerMove(e) {
|
||||
if (_pointers[e.pointerId]) {
|
||||
_pointers[e.pointerId] = e;
|
||||
}
|
||||
}
|
||||
|
||||
function _globalPointerUp(e) {
|
||||
delete _pointers[e.pointerId];
|
||||
_pointersCount--;
|
||||
}
|
||||
|
||||
function _handlePointer(e, handler) {
|
||||
e.touches = [];
|
||||
for (var i in _pointers) {
|
||||
e.touches.push(_pointers[i]);
|
||||
}
|
||||
e.changedTouches = [e];
|
||||
|
||||
handler(e);
|
||||
}
|
||||
|
||||
function _addPointerMove(obj, handler, id) {
|
||||
var onMove = function (e) {
|
||||
// don't fire touch moves when mouse isn't down
|
||||
if ((e.pointerType === e.MSPOINTER_TYPE_MOUSE || e.pointerType === 'mouse') && e.buttons === 0) { return; }
|
||||
|
||||
_handlePointer(e, handler);
|
||||
};
|
||||
|
||||
obj['_leaflet_touchmove' + id] = onMove;
|
||||
obj.addEventListener(POINTER_MOVE, onMove, false);
|
||||
}
|
||||
|
||||
function _addPointerEnd(obj, handler, id) {
|
||||
var onUp = function (e) {
|
||||
_handlePointer(e, handler);
|
||||
};
|
||||
|
||||
obj['_leaflet_touchend' + id] = onUp;
|
||||
obj.addEventListener(POINTER_UP, onUp, false);
|
||||
obj.addEventListener(POINTER_CANCEL, onUp, false);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,316 @@
|
||||
import {Point} from '../geometry/Point';
|
||||
import * as Util from '../core/Util';
|
||||
import * as Browser from '../core/Browser';
|
||||
import {addPointerListener, removePointerListener} from './DomEvent.Pointer';
|
||||
import {addDoubleTapListener, removeDoubleTapListener} from './DomEvent.DoubleTap';
|
||||
import {getScale} from './DomUtil';
|
||||
|
||||
/*
|
||||
* @namespace DomEvent
|
||||
* Utility functions to work with the [DOM events](https://developer.mozilla.org/docs/Web/API/Event), used by Leaflet internally.
|
||||
*/
|
||||
|
||||
// Inspired by John Resig, Dean Edwards and YUI addEvent implementations.
|
||||
|
||||
// @function on(el: HTMLElement, types: String, fn: Function, context?: Object): this
|
||||
// Adds a listener function (`fn`) to a particular DOM event type of the
|
||||
// element `el`. You can optionally specify the context of the listener
|
||||
// (object the `this` keyword will point to). You can also pass several
|
||||
// space-separated types (e.g. `'click dblclick'`).
|
||||
|
||||
// @alternative
|
||||
// @function on(el: HTMLElement, eventMap: Object, context?: Object): this
|
||||
// Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`
|
||||
export function on(obj, types, fn, context) {
|
||||
|
||||
if (typeof types === 'object') {
|
||||
for (var type in types) {
|
||||
addOne(obj, type, types[type], fn);
|
||||
}
|
||||
} else {
|
||||
types = Util.splitWords(types);
|
||||
|
||||
for (var i = 0, len = types.length; i < len; i++) {
|
||||
addOne(obj, types[i], fn, context);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
var eventsKey = '_leaflet_events';
|
||||
|
||||
// @function off(el: HTMLElement, types: String, fn: Function, context?: Object): this
|
||||
// Removes a previously added listener function.
|
||||
// Note that if you passed a custom context to on, you must pass the same
|
||||
// context to `off` in order to remove the listener.
|
||||
|
||||
// @alternative
|
||||
// @function off(el: HTMLElement, eventMap: Object, context?: Object): this
|
||||
// Removes a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`
|
||||
export function off(obj, types, fn, context) {
|
||||
|
||||
if (typeof types === 'object') {
|
||||
for (var type in types) {
|
||||
removeOne(obj, type, types[type], fn);
|
||||
}
|
||||
} else if (types) {
|
||||
types = Util.splitWords(types);
|
||||
|
||||
for (var i = 0, len = types.length; i < len; i++) {
|
||||
removeOne(obj, types[i], fn, context);
|
||||
}
|
||||
} else {
|
||||
for (var j in obj[eventsKey]) {
|
||||
removeOne(obj, j, obj[eventsKey][j]);
|
||||
}
|
||||
delete obj[eventsKey];
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
function addOne(obj, type, fn, context) {
|
||||
var id = type + Util.stamp(fn) + (context ? '_' + Util.stamp(context) : '');
|
||||
|
||||
if (obj[eventsKey] && obj[eventsKey][id]) { return this; }
|
||||
|
||||
var handler = function (e) {
|
||||
return fn.call(context || obj, e || window.event);
|
||||
};
|
||||
|
||||
var originalHandler = handler;
|
||||
|
||||
if (Browser.pointer && type.indexOf('touch') === 0) {
|
||||
// Needs DomEvent.Pointer.js
|
||||
addPointerListener(obj, type, handler, id);
|
||||
|
||||
} else if (Browser.touch && (type === 'dblclick') && addDoubleTapListener &&
|
||||
!(Browser.pointer && Browser.chrome)) {
|
||||
// Chrome >55 does not need the synthetic dblclicks from addDoubleTapListener
|
||||
// See #5180
|
||||
addDoubleTapListener(obj, handler, id);
|
||||
|
||||
} else if ('addEventListener' in obj) {
|
||||
|
||||
if (type === 'mousewheel') {
|
||||
obj.addEventListener('onwheel' in obj ? 'wheel' : 'mousewheel', handler, false);
|
||||
|
||||
} else if ((type === 'mouseenter') || (type === 'mouseleave')) {
|
||||
handler = function (e) {
|
||||
e = e || window.event;
|
||||
if (isExternalTarget(obj, e)) {
|
||||
originalHandler(e);
|
||||
}
|
||||
};
|
||||
obj.addEventListener(type === 'mouseenter' ? 'mouseover' : 'mouseout', handler, false);
|
||||
|
||||
} else {
|
||||
if (type === 'click' && Browser.android) {
|
||||
handler = function (e) {
|
||||
filterClick(e, originalHandler);
|
||||
};
|
||||
}
|
||||
obj.addEventListener(type, handler, false);
|
||||
}
|
||||
|
||||
} else if ('attachEvent' in obj) {
|
||||
obj.attachEvent('on' + type, handler);
|
||||
}
|
||||
|
||||
obj[eventsKey] = obj[eventsKey] || {};
|
||||
obj[eventsKey][id] = handler;
|
||||
}
|
||||
|
||||
function removeOne(obj, type, fn, context) {
|
||||
|
||||
var id = type + Util.stamp(fn) + (context ? '_' + Util.stamp(context) : ''),
|
||||
handler = obj[eventsKey] && obj[eventsKey][id];
|
||||
|
||||
if (!handler) { return this; }
|
||||
|
||||
if (Browser.pointer && type.indexOf('touch') === 0) {
|
||||
removePointerListener(obj, type, id);
|
||||
|
||||
} else if (Browser.touch && (type === 'dblclick') && removeDoubleTapListener &&
|
||||
!(Browser.pointer && Browser.chrome)) {
|
||||
removeDoubleTapListener(obj, id);
|
||||
|
||||
} else if ('removeEventListener' in obj) {
|
||||
|
||||
if (type === 'mousewheel') {
|
||||
obj.removeEventListener('onwheel' in obj ? 'wheel' : 'mousewheel', handler, false);
|
||||
|
||||
} else {
|
||||
obj.removeEventListener(
|
||||
type === 'mouseenter' ? 'mouseover' :
|
||||
type === 'mouseleave' ? 'mouseout' : type, handler, false);
|
||||
}
|
||||
|
||||
} else if ('detachEvent' in obj) {
|
||||
obj.detachEvent('on' + type, handler);
|
||||
}
|
||||
|
||||
obj[eventsKey][id] = null;
|
||||
}
|
||||
|
||||
// @function stopPropagation(ev: DOMEvent): this
|
||||
// Stop the given event from propagation to parent elements. Used inside the listener functions:
|
||||
// ```js
|
||||
// L.DomEvent.on(div, 'click', function (ev) {
|
||||
// L.DomEvent.stopPropagation(ev);
|
||||
// });
|
||||
// ```
|
||||
export function stopPropagation(e) {
|
||||
|
||||
if (e.stopPropagation) {
|
||||
e.stopPropagation();
|
||||
} else if (e.originalEvent) { // In case of Leaflet event.
|
||||
e.originalEvent._stopped = true;
|
||||
} else {
|
||||
e.cancelBubble = true;
|
||||
}
|
||||
skipped(e);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// @function disableScrollPropagation(el: HTMLElement): this
|
||||
// Adds `stopPropagation` to the element's `'mousewheel'` events (plus browser variants).
|
||||
export function disableScrollPropagation(el) {
|
||||
addOne(el, 'mousewheel', stopPropagation);
|
||||
return this;
|
||||
}
|
||||
|
||||
// @function disableClickPropagation(el: HTMLElement): this
|
||||
// Adds `stopPropagation` to the element's `'click'`, `'doubleclick'`,
|
||||
// `'mousedown'` and `'touchstart'` events (plus browser variants).
|
||||
export function disableClickPropagation(el) {
|
||||
on(el, 'mousedown touchstart dblclick', stopPropagation);
|
||||
addOne(el, 'click', fakeStop);
|
||||
return this;
|
||||
}
|
||||
|
||||
// @function preventDefault(ev: DOMEvent): this
|
||||
// Prevents the default action of the DOM Event `ev` from happening (such as
|
||||
// following a link in the href of the a element, or doing a POST request
|
||||
// with page reload when a `<form>` is submitted).
|
||||
// Use it inside listener functions.
|
||||
export function preventDefault(e) {
|
||||
if (e.preventDefault) {
|
||||
e.preventDefault();
|
||||
} else {
|
||||
e.returnValue = false;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
// @function stop(ev: DOMEvent): this
|
||||
// Does `stopPropagation` and `preventDefault` at the same time.
|
||||
export function stop(e) {
|
||||
preventDefault(e);
|
||||
stopPropagation(e);
|
||||
return this;
|
||||
}
|
||||
|
||||
// @function getMousePosition(ev: DOMEvent, container?: HTMLElement): Point
|
||||
// Gets normalized mouse position from a DOM event relative to the
|
||||
// `container` (border excluded) or to the whole page if not specified.
|
||||
export function getMousePosition(e, container) {
|
||||
if (!container) {
|
||||
return new Point(e.clientX, e.clientY);
|
||||
}
|
||||
|
||||
var scale = getScale(container),
|
||||
offset = scale.boundingClientRect; // left and top values are in page scale (like the event clientX/Y)
|
||||
|
||||
return new Point(
|
||||
// offset.left/top values are in page scale (like clientX/Y),
|
||||
// whereas clientLeft/Top (border width) values are the original values (before CSS scale applies).
|
||||
(e.clientX - offset.left) / scale.x - container.clientLeft,
|
||||
(e.clientY - offset.top) / scale.y - container.clientTop
|
||||
);
|
||||
}
|
||||
|
||||
// Chrome on Win scrolls double the pixels as in other platforms (see #4538),
|
||||
// and Firefox scrolls device pixels, not CSS pixels
|
||||
var wheelPxFactor =
|
||||
(Browser.win && Browser.chrome) ? 2 * window.devicePixelRatio :
|
||||
Browser.gecko ? window.devicePixelRatio : 1;
|
||||
|
||||
// @function getWheelDelta(ev: DOMEvent): Number
|
||||
// Gets normalized wheel delta from a mousewheel DOM event, in vertical
|
||||
// pixels scrolled (negative if scrolling down).
|
||||
// Events from pointing devices without precise scrolling are mapped to
|
||||
// a best guess of 60 pixels.
|
||||
export function getWheelDelta(e) {
|
||||
return (Browser.edge) ? e.wheelDeltaY / 2 : // Don't trust window-geometry-based delta
|
||||
(e.deltaY && e.deltaMode === 0) ? -e.deltaY / wheelPxFactor : // Pixels
|
||||
(e.deltaY && e.deltaMode === 1) ? -e.deltaY * 20 : // Lines
|
||||
(e.deltaY && e.deltaMode === 2) ? -e.deltaY * 60 : // Pages
|
||||
(e.deltaX || e.deltaZ) ? 0 : // Skip horizontal/depth wheel events
|
||||
e.wheelDelta ? (e.wheelDeltaY || e.wheelDelta) / 2 : // Legacy IE pixels
|
||||
(e.detail && Math.abs(e.detail) < 32765) ? -e.detail * 20 : // Legacy Moz lines
|
||||
e.detail ? e.detail / -32765 * 60 : // Legacy Moz pages
|
||||
0;
|
||||
}
|
||||
|
||||
var skipEvents = {};
|
||||
|
||||
export function fakeStop(e) {
|
||||
// fakes stopPropagation by setting a special event flag, checked/reset with skipped(e)
|
||||
skipEvents[e.type] = true;
|
||||
}
|
||||
|
||||
export function skipped(e) {
|
||||
var events = skipEvents[e.type];
|
||||
// reset when checking, as it's only used in map container and propagates outside of the map
|
||||
skipEvents[e.type] = false;
|
||||
return events;
|
||||
}
|
||||
|
||||
// check if element really left/entered the event target (for mouseenter/mouseleave)
|
||||
export function isExternalTarget(el, e) {
|
||||
|
||||
var related = e.relatedTarget;
|
||||
|
||||
if (!related) { return true; }
|
||||
|
||||
try {
|
||||
while (related && (related !== el)) {
|
||||
related = related.parentNode;
|
||||
}
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
return (related !== el);
|
||||
}
|
||||
|
||||
var lastClick;
|
||||
|
||||
// this is a horrible workaround for a bug in Android where a single touch triggers two click events
|
||||
function filterClick(e, handler) {
|
||||
var timeStamp = (e.timeStamp || (e.originalEvent && e.originalEvent.timeStamp)),
|
||||
elapsed = lastClick && (timeStamp - lastClick);
|
||||
|
||||
// are they closer together than 500ms yet more than 100ms?
|
||||
// Android typically triggers them ~300ms apart while multiple listeners
|
||||
// on the same event should be triggered far faster;
|
||||
// or check if click is simulated on the element, and if it is, reject any non-simulated events
|
||||
|
||||
if ((elapsed && elapsed > 100 && elapsed < 500) || (e.target._simulatedClick && !e._simulated)) {
|
||||
stop(e);
|
||||
return;
|
||||
}
|
||||
lastClick = timeStamp;
|
||||
|
||||
handler(e);
|
||||
}
|
||||
|
||||
// @function addListener(…): this
|
||||
// Alias to [`L.DomEvent.on`](#domevent-on)
|
||||
export {on as addListener};
|
||||
|
||||
// @function removeListener(…): this
|
||||
// Alias to [`L.DomEvent.off`](#domevent-off)
|
||||
export {off as removeListener};
|
||||
@@ -0,0 +1,349 @@
|
||||
import * as DomEvent from './DomEvent';
|
||||
import * as Util from '../core/Util';
|
||||
import {Point} from '../geometry/Point';
|
||||
import * as Browser from '../core/Browser';
|
||||
|
||||
/*
|
||||
* @namespace DomUtil
|
||||
*
|
||||
* Utility functions to work with the [DOM](https://developer.mozilla.org/docs/Web/API/Document_Object_Model)
|
||||
* tree, used by Leaflet internally.
|
||||
*
|
||||
* Most functions expecting or returning a `HTMLElement` also work for
|
||||
* SVG elements. The only difference is that classes refer to CSS classes
|
||||
* in HTML and SVG classes in SVG.
|
||||
*/
|
||||
|
||||
|
||||
// @property TRANSFORM: String
|
||||
// Vendor-prefixed transform style name (e.g. `'webkitTransform'` for WebKit).
|
||||
export var TRANSFORM = testProp(
|
||||
['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform']);
|
||||
|
||||
// webkitTransition comes first because some browser versions that drop vendor prefix don't do
|
||||
// the same for the transitionend event, in particular the Android 4.1 stock browser
|
||||
|
||||
// @property TRANSITION: String
|
||||
// Vendor-prefixed transition style name.
|
||||
export var TRANSITION = testProp(
|
||||
['webkitTransition', 'transition', 'OTransition', 'MozTransition', 'msTransition']);
|
||||
|
||||
// @property TRANSITION_END: String
|
||||
// Vendor-prefixed transitionend event name.
|
||||
export var TRANSITION_END =
|
||||
TRANSITION === 'webkitTransition' || TRANSITION === 'OTransition' ? TRANSITION + 'End' : 'transitionend';
|
||||
|
||||
|
||||
// @function get(id: String|HTMLElement): HTMLElement
|
||||
// Returns an element given its DOM id, or returns the element itself
|
||||
// if it was passed directly.
|
||||
export function get(id) {
|
||||
return typeof id === 'string' ? document.getElementById(id) : id;
|
||||
}
|
||||
|
||||
// @function getStyle(el: HTMLElement, styleAttrib: String): String
|
||||
// Returns the value for a certain style attribute on an element,
|
||||
// including computed values or values set through CSS.
|
||||
export function getStyle(el, style) {
|
||||
var value = el.style[style] || (el.currentStyle && el.currentStyle[style]);
|
||||
|
||||
if ((!value || value === 'auto') && document.defaultView) {
|
||||
var css = document.defaultView.getComputedStyle(el, null);
|
||||
value = css ? css[style] : null;
|
||||
}
|
||||
return value === 'auto' ? null : value;
|
||||
}
|
||||
|
||||
// @function create(tagName: String, className?: String, container?: HTMLElement): HTMLElement
|
||||
// Creates an HTML element with `tagName`, sets its class to `className`, and optionally appends it to `container` element.
|
||||
export function create(tagName, className, container) {
|
||||
var el = document.createElement(tagName);
|
||||
el.className = className || '';
|
||||
|
||||
if (container) {
|
||||
container.appendChild(el);
|
||||
}
|
||||
return el;
|
||||
}
|
||||
|
||||
// @function remove(el: HTMLElement)
|
||||
// Removes `el` from its parent element
|
||||
export function remove(el) {
|
||||
var parent = el.parentNode;
|
||||
if (parent) {
|
||||
parent.removeChild(el);
|
||||
}
|
||||
}
|
||||
|
||||
// @function empty(el: HTMLElement)
|
||||
// Removes all of `el`'s children elements from `el`
|
||||
export function empty(el) {
|
||||
while (el.firstChild) {
|
||||
el.removeChild(el.firstChild);
|
||||
}
|
||||
}
|
||||
|
||||
// @function toFront(el: HTMLElement)
|
||||
// Makes `el` the last child of its parent, so it renders in front of the other children.
|
||||
export function toFront(el) {
|
||||
var parent = el.parentNode;
|
||||
if (parent && parent.lastChild !== el) {
|
||||
parent.appendChild(el);
|
||||
}
|
||||
}
|
||||
|
||||
// @function toBack(el: HTMLElement)
|
||||
// Makes `el` the first child of its parent, so it renders behind the other children.
|
||||
export function toBack(el) {
|
||||
var parent = el.parentNode;
|
||||
if (parent && parent.firstChild !== el) {
|
||||
parent.insertBefore(el, parent.firstChild);
|
||||
}
|
||||
}
|
||||
|
||||
// @function hasClass(el: HTMLElement, name: String): Boolean
|
||||
// Returns `true` if the element's class attribute contains `name`.
|
||||
export function hasClass(el, name) {
|
||||
if (el.classList !== undefined) {
|
||||
return el.classList.contains(name);
|
||||
}
|
||||
var className = getClass(el);
|
||||
return className.length > 0 && new RegExp('(^|\\s)' + name + '(\\s|$)').test(className);
|
||||
}
|
||||
|
||||
// @function addClass(el: HTMLElement, name: String)
|
||||
// Adds `name` to the element's class attribute.
|
||||
export function addClass(el, name) {
|
||||
if (el.classList !== undefined) {
|
||||
var classes = Util.splitWords(name);
|
||||
for (var i = 0, len = classes.length; i < len; i++) {
|
||||
el.classList.add(classes[i]);
|
||||
}
|
||||
} else if (!hasClass(el, name)) {
|
||||
var className = getClass(el);
|
||||
setClass(el, (className ? className + ' ' : '') + name);
|
||||
}
|
||||
}
|
||||
|
||||
// @function removeClass(el: HTMLElement, name: String)
|
||||
// Removes `name` from the element's class attribute.
|
||||
export function removeClass(el, name) {
|
||||
if (el.classList !== undefined) {
|
||||
el.classList.remove(name);
|
||||
} else {
|
||||
setClass(el, Util.trim((' ' + getClass(el) + ' ').replace(' ' + name + ' ', ' ')));
|
||||
}
|
||||
}
|
||||
|
||||
// @function setClass(el: HTMLElement, name: String)
|
||||
// Sets the element's class.
|
||||
export function setClass(el, name) {
|
||||
if (el.className.baseVal === undefined) {
|
||||
el.className = name;
|
||||
} else {
|
||||
// in case of SVG element
|
||||
el.className.baseVal = name;
|
||||
}
|
||||
}
|
||||
|
||||
// @function getClass(el: HTMLElement): String
|
||||
// Returns the element's class.
|
||||
export function getClass(el) {
|
||||
// Check if the element is an SVGElementInstance and use the correspondingElement instead
|
||||
// (Required for linked SVG elements in IE11.)
|
||||
if (el.correspondingElement) {
|
||||
el = el.correspondingElement;
|
||||
}
|
||||
return el.className.baseVal === undefined ? el.className : el.className.baseVal;
|
||||
}
|
||||
|
||||
// @function setOpacity(el: HTMLElement, opacity: Number)
|
||||
// Set the opacity of an element (including old IE support).
|
||||
// `opacity` must be a number from `0` to `1`.
|
||||
export function setOpacity(el, value) {
|
||||
if ('opacity' in el.style) {
|
||||
el.style.opacity = value;
|
||||
} else if ('filter' in el.style) {
|
||||
_setOpacityIE(el, value);
|
||||
}
|
||||
}
|
||||
|
||||
function _setOpacityIE(el, value) {
|
||||
var filter = false,
|
||||
filterName = 'DXImageTransform.Microsoft.Alpha';
|
||||
|
||||
// filters collection throws an error if we try to retrieve a filter that doesn't exist
|
||||
try {
|
||||
filter = el.filters.item(filterName);
|
||||
} catch (e) {
|
||||
// don't set opacity to 1 if we haven't already set an opacity,
|
||||
// it isn't needed and breaks transparent pngs.
|
||||
if (value === 1) { return; }
|
||||
}
|
||||
|
||||
value = Math.round(value * 100);
|
||||
|
||||
if (filter) {
|
||||
filter.Enabled = (value !== 100);
|
||||
filter.Opacity = value;
|
||||
} else {
|
||||
el.style.filter += ' progid:' + filterName + '(opacity=' + value + ')';
|
||||
}
|
||||
}
|
||||
|
||||
// @function testProp(props: String[]): String|false
|
||||
// Goes through the array of style names and returns the first name
|
||||
// that is a valid style name for an element. If no such name is found,
|
||||
// it returns false. Useful for vendor-prefixed styles like `transform`.
|
||||
export function testProp(props) {
|
||||
var style = document.documentElement.style;
|
||||
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
if (props[i] in style) {
|
||||
return props[i];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// @function setTransform(el: HTMLElement, offset: Point, scale?: Number)
|
||||
// Resets the 3D CSS transform of `el` so it is translated by `offset` pixels
|
||||
// and optionally scaled by `scale`. Does not have an effect if the
|
||||
// browser doesn't support 3D CSS transforms.
|
||||
export function setTransform(el, offset, scale) {
|
||||
var pos = offset || new Point(0, 0);
|
||||
|
||||
el.style[TRANSFORM] =
|
||||
(Browser.ie3d ?
|
||||
'translate(' + pos.x + 'px,' + pos.y + 'px)' :
|
||||
'translate3d(' + pos.x + 'px,' + pos.y + 'px,0)') +
|
||||
(scale ? ' scale(' + scale + ')' : '');
|
||||
}
|
||||
|
||||
// @function setPosition(el: HTMLElement, position: Point)
|
||||
// Sets the position of `el` to coordinates specified by `position`,
|
||||
// using CSS translate or top/left positioning depending on the browser
|
||||
// (used by Leaflet internally to position its layers).
|
||||
export function setPosition(el, point) {
|
||||
|
||||
/*eslint-disable */
|
||||
el._leaflet_pos = point;
|
||||
/* eslint-enable */
|
||||
|
||||
if (Browser.any3d) {
|
||||
setTransform(el, point);
|
||||
} else {
|
||||
el.style.left = point.x + 'px';
|
||||
el.style.top = point.y + 'px';
|
||||
}
|
||||
}
|
||||
|
||||
// @function getPosition(el: HTMLElement): Point
|
||||
// Returns the coordinates of an element previously positioned with setPosition.
|
||||
export function getPosition(el) {
|
||||
// this method is only used for elements previously positioned using setPosition,
|
||||
// so it's safe to cache the position for performance
|
||||
|
||||
return el._leaflet_pos || new Point(0, 0);
|
||||
}
|
||||
|
||||
// @function disableTextSelection()
|
||||
// Prevents the user from generating `selectstart` DOM events, usually generated
|
||||
// when the user drags the mouse through a page with text. Used internally
|
||||
// by Leaflet to override the behaviour of any click-and-drag interaction on
|
||||
// the map. Affects drag interactions on the whole document.
|
||||
|
||||
// @function enableTextSelection()
|
||||
// Cancels the effects of a previous [`L.DomUtil.disableTextSelection`](#domutil-disabletextselection).
|
||||
export var disableTextSelection;
|
||||
export var enableTextSelection;
|
||||
var _userSelect;
|
||||
if ('onselectstart' in document) {
|
||||
disableTextSelection = function () {
|
||||
DomEvent.on(window, 'selectstart', DomEvent.preventDefault);
|
||||
};
|
||||
enableTextSelection = function () {
|
||||
DomEvent.off(window, 'selectstart', DomEvent.preventDefault);
|
||||
};
|
||||
} else {
|
||||
var userSelectProperty = testProp(
|
||||
['userSelect', 'WebkitUserSelect', 'OUserSelect', 'MozUserSelect', 'msUserSelect']);
|
||||
|
||||
disableTextSelection = function () {
|
||||
if (userSelectProperty) {
|
||||
var style = document.documentElement.style;
|
||||
_userSelect = style[userSelectProperty];
|
||||
style[userSelectProperty] = 'none';
|
||||
}
|
||||
};
|
||||
enableTextSelection = function () {
|
||||
if (userSelectProperty) {
|
||||
document.documentElement.style[userSelectProperty] = _userSelect;
|
||||
_userSelect = undefined;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// @function disableImageDrag()
|
||||
// As [`L.DomUtil.disableTextSelection`](#domutil-disabletextselection), but
|
||||
// for `dragstart` DOM events, usually generated when the user drags an image.
|
||||
export function disableImageDrag() {
|
||||
DomEvent.on(window, 'dragstart', DomEvent.preventDefault);
|
||||
}
|
||||
|
||||
// @function enableImageDrag()
|
||||
// Cancels the effects of a previous [`L.DomUtil.disableImageDrag`](#domutil-disabletextselection).
|
||||
export function enableImageDrag() {
|
||||
DomEvent.off(window, 'dragstart', DomEvent.preventDefault);
|
||||
}
|
||||
|
||||
var _outlineElement, _outlineStyle;
|
||||
// @function preventOutline(el: HTMLElement)
|
||||
// Makes the [outline](https://developer.mozilla.org/docs/Web/CSS/outline)
|
||||
// of the element `el` invisible. Used internally by Leaflet to prevent
|
||||
// focusable elements from displaying an outline when the user performs a
|
||||
// drag interaction on them.
|
||||
export function preventOutline(element) {
|
||||
while (element.tabIndex === -1) {
|
||||
element = element.parentNode;
|
||||
}
|
||||
if (!element.style) { return; }
|
||||
restoreOutline();
|
||||
_outlineElement = element;
|
||||
_outlineStyle = element.style.outline;
|
||||
element.style.outline = 'none';
|
||||
DomEvent.on(window, 'keydown', restoreOutline);
|
||||
}
|
||||
|
||||
// @function restoreOutline()
|
||||
// Cancels the effects of a previous [`L.DomUtil.preventOutline`]().
|
||||
export function restoreOutline() {
|
||||
if (!_outlineElement) { return; }
|
||||
_outlineElement.style.outline = _outlineStyle;
|
||||
_outlineElement = undefined;
|
||||
_outlineStyle = undefined;
|
||||
DomEvent.off(window, 'keydown', restoreOutline);
|
||||
}
|
||||
|
||||
// @function getSizedParentNode(el: HTMLElement): HTMLElement
|
||||
// Finds the closest parent node which size (width and height) is not null.
|
||||
export function getSizedParentNode(element) {
|
||||
do {
|
||||
element = element.parentNode;
|
||||
} while ((!element.offsetWidth || !element.offsetHeight) && element !== document.body);
|
||||
return element;
|
||||
}
|
||||
|
||||
// @function getScale(el: HTMLElement): Object
|
||||
// Computes the CSS scale currently applied on the element.
|
||||
// Returns an object with `x` and `y` members as horizontal and vertical scales respectively,
|
||||
// and `boundingClientRect` as the result of [`getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).
|
||||
export function getScale(element) {
|
||||
var rect = element.getBoundingClientRect(); // Read-only in old browsers.
|
||||
|
||||
return {
|
||||
x: rect.width / element.offsetWidth || 1,
|
||||
y: rect.height / element.offsetHeight || 1,
|
||||
boundingClientRect: rect
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
import {Evented} from '../core/Events';
|
||||
import * as Browser from '../core/Browser';
|
||||
import * as DomEvent from './DomEvent';
|
||||
import * as DomUtil from './DomUtil';
|
||||
import * as Util from '../core/Util';
|
||||
import {Point} from '../geometry/Point';
|
||||
|
||||
/*
|
||||
* @class Draggable
|
||||
* @aka L.Draggable
|
||||
* @inherits Evented
|
||||
*
|
||||
* A class for making DOM elements draggable (including touch support).
|
||||
* Used internally for map and marker dragging. Only works for elements
|
||||
* that were positioned with [`L.DomUtil.setPosition`](#domutil-setposition).
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* var draggable = new L.Draggable(elementToDrag);
|
||||
* draggable.enable();
|
||||
* ```
|
||||
*/
|
||||
|
||||
var START = Browser.touch ? 'touchstart mousedown' : 'mousedown';
|
||||
var END = {
|
||||
mousedown: 'mouseup',
|
||||
touchstart: 'touchend',
|
||||
pointerdown: 'touchend',
|
||||
MSPointerDown: 'touchend'
|
||||
};
|
||||
var MOVE = {
|
||||
mousedown: 'mousemove',
|
||||
touchstart: 'touchmove',
|
||||
pointerdown: 'touchmove',
|
||||
MSPointerDown: 'touchmove'
|
||||
};
|
||||
|
||||
|
||||
export var Draggable = Evented.extend({
|
||||
|
||||
options: {
|
||||
// @section
|
||||
// @aka Draggable options
|
||||
// @option clickTolerance: Number = 3
|
||||
// The max number of pixels a user can shift the mouse pointer during a click
|
||||
// for it to be considered a valid click (as opposed to a mouse drag).
|
||||
clickTolerance: 3
|
||||
},
|
||||
|
||||
// @constructor L.Draggable(el: HTMLElement, dragHandle?: HTMLElement, preventOutline?: Boolean, options?: Draggable options)
|
||||
// Creates a `Draggable` object for moving `el` when you start dragging the `dragHandle` element (equals `el` itself by default).
|
||||
initialize: function (element, dragStartTarget, preventOutline, options) {
|
||||
Util.setOptions(this, options);
|
||||
|
||||
this._element = element;
|
||||
this._dragStartTarget = dragStartTarget || element;
|
||||
this._preventOutline = preventOutline;
|
||||
},
|
||||
|
||||
// @method enable()
|
||||
// Enables the dragging ability
|
||||
enable: function () {
|
||||
if (this._enabled) { return; }
|
||||
|
||||
DomEvent.on(this._dragStartTarget, START, this._onDown, this);
|
||||
|
||||
this._enabled = true;
|
||||
},
|
||||
|
||||
// @method disable()
|
||||
// Disables the dragging ability
|
||||
disable: function () {
|
||||
if (!this._enabled) { return; }
|
||||
|
||||
// If we're currently dragging this draggable,
|
||||
// disabling it counts as first ending the drag.
|
||||
if (Draggable._dragging === this) {
|
||||
this.finishDrag();
|
||||
}
|
||||
|
||||
DomEvent.off(this._dragStartTarget, START, this._onDown, this);
|
||||
|
||||
this._enabled = false;
|
||||
this._moved = false;
|
||||
},
|
||||
|
||||
_onDown: function (e) {
|
||||
// Ignore simulated events, since we handle both touch and
|
||||
// mouse explicitly; otherwise we risk getting duplicates of
|
||||
// touch events, see #4315.
|
||||
// Also ignore the event if disabled; this happens in IE11
|
||||
// under some circumstances, see #3666.
|
||||
if (e._simulated || !this._enabled) { return; }
|
||||
|
||||
this._moved = false;
|
||||
|
||||
if (DomUtil.hasClass(this._element, 'leaflet-zoom-anim')) { return; }
|
||||
|
||||
if (Draggable._dragging || e.shiftKey || ((e.which !== 1) && (e.button !== 1) && !e.touches)) { return; }
|
||||
Draggable._dragging = this; // Prevent dragging multiple objects at once.
|
||||
|
||||
if (this._preventOutline) {
|
||||
DomUtil.preventOutline(this._element);
|
||||
}
|
||||
|
||||
DomUtil.disableImageDrag();
|
||||
DomUtil.disableTextSelection();
|
||||
|
||||
if (this._moving) { return; }
|
||||
|
||||
// @event down: Event
|
||||
// Fired when a drag is about to start.
|
||||
this.fire('down');
|
||||
|
||||
var first = e.touches ? e.touches[0] : e,
|
||||
sizedParent = DomUtil.getSizedParentNode(this._element);
|
||||
|
||||
this._startPoint = new Point(first.clientX, first.clientY);
|
||||
|
||||
// Cache the scale, so that we can continuously compensate for it during drag (_onMove).
|
||||
this._parentScale = DomUtil.getScale(sizedParent);
|
||||
|
||||
DomEvent.on(document, MOVE[e.type], this._onMove, this);
|
||||
DomEvent.on(document, END[e.type], this._onUp, this);
|
||||
},
|
||||
|
||||
_onMove: function (e) {
|
||||
// Ignore simulated events, since we handle both touch and
|
||||
// mouse explicitly; otherwise we risk getting duplicates of
|
||||
// touch events, see #4315.
|
||||
// Also ignore the event if disabled; this happens in IE11
|
||||
// under some circumstances, see #3666.
|
||||
if (e._simulated || !this._enabled) { return; }
|
||||
|
||||
if (e.touches && e.touches.length > 1) {
|
||||
this._moved = true;
|
||||
return;
|
||||
}
|
||||
|
||||
var first = (e.touches && e.touches.length === 1 ? e.touches[0] : e),
|
||||
offset = new Point(first.clientX, first.clientY)._subtract(this._startPoint);
|
||||
|
||||
if (!offset.x && !offset.y) { return; }
|
||||
if (Math.abs(offset.x) + Math.abs(offset.y) < this.options.clickTolerance) { return; }
|
||||
|
||||
// We assume that the parent container's position, border and scale do not change for the duration of the drag.
|
||||
// Therefore there is no need to account for the position and border (they are eliminated by the subtraction)
|
||||
// and we can use the cached value for the scale.
|
||||
offset.x /= this._parentScale.x;
|
||||
offset.y /= this._parentScale.y;
|
||||
|
||||
DomEvent.preventDefault(e);
|
||||
|
||||
if (!this._moved) {
|
||||
// @event dragstart: Event
|
||||
// Fired when a drag starts
|
||||
this.fire('dragstart');
|
||||
|
||||
this._moved = true;
|
||||
this._startPos = DomUtil.getPosition(this._element).subtract(offset);
|
||||
|
||||
DomUtil.addClass(document.body, 'leaflet-dragging');
|
||||
|
||||
this._lastTarget = e.target || e.srcElement;
|
||||
// IE and Edge do not give the <use> element, so fetch it
|
||||
// if necessary
|
||||
if ((window.SVGElementInstance) && (this._lastTarget instanceof SVGElementInstance)) {
|
||||
this._lastTarget = this._lastTarget.correspondingUseElement;
|
||||
}
|
||||
DomUtil.addClass(this._lastTarget, 'leaflet-drag-target');
|
||||
}
|
||||
|
||||
this._newPos = this._startPos.add(offset);
|
||||
this._moving = true;
|
||||
|
||||
Util.cancelAnimFrame(this._animRequest);
|
||||
this._lastEvent = e;
|
||||
this._animRequest = Util.requestAnimFrame(this._updatePosition, this, true);
|
||||
},
|
||||
|
||||
_updatePosition: function () {
|
||||
var e = {originalEvent: this._lastEvent};
|
||||
|
||||
// @event predrag: Event
|
||||
// Fired continuously during dragging *before* each corresponding
|
||||
// update of the element's position.
|
||||
this.fire('predrag', e);
|
||||
DomUtil.setPosition(this._element, this._newPos);
|
||||
|
||||
// @event drag: Event
|
||||
// Fired continuously during dragging.
|
||||
this.fire('drag', e);
|
||||
},
|
||||
|
||||
_onUp: function (e) {
|
||||
// Ignore simulated events, since we handle both touch and
|
||||
// mouse explicitly; otherwise we risk getting duplicates of
|
||||
// touch events, see #4315.
|
||||
// Also ignore the event if disabled; this happens in IE11
|
||||
// under some circumstances, see #3666.
|
||||
if (e._simulated || !this._enabled) { return; }
|
||||
this.finishDrag();
|
||||
},
|
||||
|
||||
finishDrag: function () {
|
||||
DomUtil.removeClass(document.body, 'leaflet-dragging');
|
||||
|
||||
if (this._lastTarget) {
|
||||
DomUtil.removeClass(this._lastTarget, 'leaflet-drag-target');
|
||||
this._lastTarget = null;
|
||||
}
|
||||
|
||||
for (var i in MOVE) {
|
||||
DomEvent.off(document, MOVE[i], this._onMove, this);
|
||||
DomEvent.off(document, END[i], this._onUp, this);
|
||||
}
|
||||
|
||||
DomUtil.enableImageDrag();
|
||||
DomUtil.enableTextSelection();
|
||||
|
||||
if (this._moved && this._moving) {
|
||||
// ensure drag is not fired after dragend
|
||||
Util.cancelAnimFrame(this._animRequest);
|
||||
|
||||
// @event dragend: DragEndEvent
|
||||
// Fired when the drag ends.
|
||||
this.fire('dragend', {
|
||||
distance: this._newPos.distanceTo(this._startPos)
|
||||
});
|
||||
}
|
||||
|
||||
this._moving = false;
|
||||
Draggable._dragging = false;
|
||||
}
|
||||
|
||||
});
|
||||
@@ -0,0 +1,100 @@
|
||||
import * as Util from '../core/Util';
|
||||
import {Evented} from '../core/Events';
|
||||
import * as DomUtil from '../dom/DomUtil';
|
||||
|
||||
|
||||
/*
|
||||
* @class PosAnimation
|
||||
* @aka L.PosAnimation
|
||||
* @inherits Evented
|
||||
* Used internally for panning animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* var fx = new L.PosAnimation();
|
||||
* fx.run(el, [300, 500], 0.5);
|
||||
* ```
|
||||
*
|
||||
* @constructor L.PosAnimation()
|
||||
* Creates a `PosAnimation` object.
|
||||
*
|
||||
*/
|
||||
|
||||
export var PosAnimation = Evented.extend({
|
||||
|
||||
// @method run(el: HTMLElement, newPos: Point, duration?: Number, easeLinearity?: Number)
|
||||
// Run an animation of a given element to a new position, optionally setting
|
||||
// duration in seconds (`0.25` by default) and easing linearity factor (3rd
|
||||
// argument of the [cubic bezier curve](http://cubic-bezier.com/#0,0,.5,1),
|
||||
// `0.5` by default).
|
||||
run: function (el, newPos, duration, easeLinearity) {
|
||||
this.stop();
|
||||
|
||||
this._el = el;
|
||||
this._inProgress = true;
|
||||
this._duration = duration || 0.25;
|
||||
this._easeOutPower = 1 / Math.max(easeLinearity || 0.5, 0.2);
|
||||
|
||||
this._startPos = DomUtil.getPosition(el);
|
||||
this._offset = newPos.subtract(this._startPos);
|
||||
this._startTime = +new Date();
|
||||
|
||||
// @event start: Event
|
||||
// Fired when the animation starts
|
||||
this.fire('start');
|
||||
|
||||
this._animate();
|
||||
},
|
||||
|
||||
// @method stop()
|
||||
// Stops the animation (if currently running).
|
||||
stop: function () {
|
||||
if (!this._inProgress) { return; }
|
||||
|
||||
this._step(true);
|
||||
this._complete();
|
||||
},
|
||||
|
||||
_animate: function () {
|
||||
// animation loop
|
||||
this._animId = Util.requestAnimFrame(this._animate, this);
|
||||
this._step();
|
||||
},
|
||||
|
||||
_step: function (round) {
|
||||
var elapsed = (+new Date()) - this._startTime,
|
||||
duration = this._duration * 1000;
|
||||
|
||||
if (elapsed < duration) {
|
||||
this._runFrame(this._easeOut(elapsed / duration), round);
|
||||
} else {
|
||||
this._runFrame(1);
|
||||
this._complete();
|
||||
}
|
||||
},
|
||||
|
||||
_runFrame: function (progress, round) {
|
||||
var pos = this._startPos.add(this._offset.multiplyBy(progress));
|
||||
if (round) {
|
||||
pos._round();
|
||||
}
|
||||
DomUtil.setPosition(this._el, pos);
|
||||
|
||||
// @event step: Event
|
||||
// Fired continuously during the animation.
|
||||
this.fire('step');
|
||||
},
|
||||
|
||||
_complete: function () {
|
||||
Util.cancelAnimFrame(this._animId);
|
||||
|
||||
this._inProgress = false;
|
||||
// @event end: Event
|
||||
// Fired when the animation ends.
|
||||
this.fire('end');
|
||||
},
|
||||
|
||||
_easeOut: function (t) {
|
||||
return 1 - Math.pow(1 - t, this._easeOutPower);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
export {PosAnimation} from './PosAnimation';
|
||||
|
||||
import * as DomEvent from './DomEvent';
|
||||
export {DomEvent};
|
||||
|
||||
import * as DomUtil from './DomUtil';
|
||||
export {DomUtil};
|
||||
|
||||
export {Draggable} from './Draggable';
|
||||
@@ -0,0 +1,137 @@
|
||||
import * as Util from '../core/Util';
|
||||
import {Earth} from './crs/CRS.Earth';
|
||||
import {toLatLngBounds} from './LatLngBounds';
|
||||
|
||||
/* @class LatLng
|
||||
* @aka L.LatLng
|
||||
*
|
||||
* Represents a geographical point with a certain latitude and longitude.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```
|
||||
* var latlng = L.latLng(50.5, 30.5);
|
||||
* ```
|
||||
*
|
||||
* All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent:
|
||||
*
|
||||
* ```
|
||||
* map.panTo([50, 30]);
|
||||
* map.panTo({lon: 30, lat: 50});
|
||||
* map.panTo({lat: 50, lng: 30});
|
||||
* map.panTo(L.latLng(50, 30));
|
||||
* ```
|
||||
*
|
||||
* Note that `LatLng` does not inherit from Leaflet's `Class` object,
|
||||
* which means new classes can't inherit from it, and new methods
|
||||
* can't be added to it with the `include` function.
|
||||
*/
|
||||
|
||||
export function LatLng(lat, lng, alt) {
|
||||
if (isNaN(lat) || isNaN(lng)) {
|
||||
throw new Error('Invalid LatLng object: (' + lat + ', ' + lng + ')');
|
||||
}
|
||||
|
||||
// @property lat: Number
|
||||
// Latitude in degrees
|
||||
this.lat = +lat;
|
||||
|
||||
// @property lng: Number
|
||||
// Longitude in degrees
|
||||
this.lng = +lng;
|
||||
|
||||
// @property alt: Number
|
||||
// Altitude in meters (optional)
|
||||
if (alt !== undefined) {
|
||||
this.alt = +alt;
|
||||
}
|
||||
}
|
||||
|
||||
LatLng.prototype = {
|
||||
// @method equals(otherLatLng: LatLng, maxMargin?: Number): Boolean
|
||||
// Returns `true` if the given `LatLng` point is at the same position (within a small margin of error). The margin of error can be overridden by setting `maxMargin` to a small number.
|
||||
equals: function (obj, maxMargin) {
|
||||
if (!obj) { return false; }
|
||||
|
||||
obj = toLatLng(obj);
|
||||
|
||||
var margin = Math.max(
|
||||
Math.abs(this.lat - obj.lat),
|
||||
Math.abs(this.lng - obj.lng));
|
||||
|
||||
return margin <= (maxMargin === undefined ? 1.0E-9 : maxMargin);
|
||||
},
|
||||
|
||||
// @method toString(): String
|
||||
// Returns a string representation of the point (for debugging purposes).
|
||||
toString: function (precision) {
|
||||
return 'LatLng(' +
|
||||
Util.formatNum(this.lat, precision) + ', ' +
|
||||
Util.formatNum(this.lng, precision) + ')';
|
||||
},
|
||||
|
||||
// @method distanceTo(otherLatLng: LatLng): Number
|
||||
// Returns the distance (in meters) to the given `LatLng` calculated using the [Spherical Law of Cosines](https://en.wikipedia.org/wiki/Spherical_law_of_cosines).
|
||||
distanceTo: function (other) {
|
||||
return Earth.distance(this, toLatLng(other));
|
||||
},
|
||||
|
||||
// @method wrap(): LatLng
|
||||
// Returns a new `LatLng` object with the longitude wrapped so it's always between -180 and +180 degrees.
|
||||
wrap: function () {
|
||||
return Earth.wrapLatLng(this);
|
||||
},
|
||||
|
||||
// @method toBounds(sizeInMeters: Number): LatLngBounds
|
||||
// Returns a new `LatLngBounds` object in which each boundary is `sizeInMeters/2` meters apart from the `LatLng`.
|
||||
toBounds: function (sizeInMeters) {
|
||||
var latAccuracy = 180 * sizeInMeters / 40075017,
|
||||
lngAccuracy = latAccuracy / Math.cos((Math.PI / 180) * this.lat);
|
||||
|
||||
return toLatLngBounds(
|
||||
[this.lat - latAccuracy, this.lng - lngAccuracy],
|
||||
[this.lat + latAccuracy, this.lng + lngAccuracy]);
|
||||
},
|
||||
|
||||
clone: function () {
|
||||
return new LatLng(this.lat, this.lng, this.alt);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
// @factory L.latLng(latitude: Number, longitude: Number, altitude?: Number): LatLng
|
||||
// Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude).
|
||||
|
||||
// @alternative
|
||||
// @factory L.latLng(coords: Array): LatLng
|
||||
// Expects an array of the form `[Number, Number]` or `[Number, Number, Number]` instead.
|
||||
|
||||
// @alternative
|
||||
// @factory L.latLng(coords: Object): LatLng
|
||||
// Expects an plain object of the form `{lat: Number, lng: Number}` or `{lat: Number, lng: Number, alt: Number}` instead.
|
||||
|
||||
export function toLatLng(a, b, c) {
|
||||
if (a instanceof LatLng) {
|
||||
return a;
|
||||
}
|
||||
if (Util.isArray(a) && typeof a[0] !== 'object') {
|
||||
if (a.length === 3) {
|
||||
return new LatLng(a[0], a[1], a[2]);
|
||||
}
|
||||
if (a.length === 2) {
|
||||
return new LatLng(a[0], a[1]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (a === undefined || a === null) {
|
||||
return a;
|
||||
}
|
||||
if (typeof a === 'object' && 'lat' in a) {
|
||||
return new LatLng(a.lat, 'lng' in a ? a.lng : a.lon, a.alt);
|
||||
}
|
||||
if (b === undefined) {
|
||||
return null;
|
||||
}
|
||||
return new LatLng(a, b, c);
|
||||
}
|
||||
@@ -0,0 +1,251 @@
|
||||
import {LatLng, toLatLng} from './LatLng';
|
||||
|
||||
/*
|
||||
* @class LatLngBounds
|
||||
* @aka L.LatLngBounds
|
||||
*
|
||||
* Represents a rectangular geographical area on a map.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```js
|
||||
* var corner1 = L.latLng(40.712, -74.227),
|
||||
* corner2 = L.latLng(40.774, -74.125),
|
||||
* bounds = L.latLngBounds(corner1, corner2);
|
||||
* ```
|
||||
*
|
||||
* All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:
|
||||
*
|
||||
* ```js
|
||||
* map.fitBounds([
|
||||
* [40.712, -74.227],
|
||||
* [40.774, -74.125]
|
||||
* ]);
|
||||
* ```
|
||||
*
|
||||
* Caution: if the area crosses the antimeridian (often confused with the International Date Line), you must specify corners _outside_ the [-180, 180] degrees longitude range.
|
||||
*
|
||||
* Note that `LatLngBounds` does not inherit from Leafet's `Class` object,
|
||||
* which means new classes can't inherit from it, and new methods
|
||||
* can't be added to it with the `include` function.
|
||||
*/
|
||||
|
||||
export function LatLngBounds(corner1, corner2) { // (LatLng, LatLng) or (LatLng[])
|
||||
if (!corner1) { return; }
|
||||
|
||||
var latlngs = corner2 ? [corner1, corner2] : corner1;
|
||||
|
||||
for (var i = 0, len = latlngs.length; i < len; i++) {
|
||||
this.extend(latlngs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
LatLngBounds.prototype = {
|
||||
|
||||
// @method extend(latlng: LatLng): this
|
||||
// Extend the bounds to contain the given point
|
||||
|
||||
// @alternative
|
||||
// @method extend(otherBounds: LatLngBounds): this
|
||||
// Extend the bounds to contain the given bounds
|
||||
extend: function (obj) {
|
||||
var sw = this._southWest,
|
||||
ne = this._northEast,
|
||||
sw2, ne2;
|
||||
|
||||
if (obj instanceof LatLng) {
|
||||
sw2 = obj;
|
||||
ne2 = obj;
|
||||
|
||||
} else if (obj instanceof LatLngBounds) {
|
||||
sw2 = obj._southWest;
|
||||
ne2 = obj._northEast;
|
||||
|
||||
if (!sw2 || !ne2) { return this; }
|
||||
|
||||
} else {
|
||||
return obj ? this.extend(toLatLng(obj) || toLatLngBounds(obj)) : this;
|
||||
}
|
||||
|
||||
if (!sw && !ne) {
|
||||
this._southWest = new LatLng(sw2.lat, sw2.lng);
|
||||
this._northEast = new LatLng(ne2.lat, ne2.lng);
|
||||
} else {
|
||||
sw.lat = Math.min(sw2.lat, sw.lat);
|
||||
sw.lng = Math.min(sw2.lng, sw.lng);
|
||||
ne.lat = Math.max(ne2.lat, ne.lat);
|
||||
ne.lng = Math.max(ne2.lng, ne.lng);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// @method pad(bufferRatio: Number): LatLngBounds
|
||||
// Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.
|
||||
// For example, a ratio of 0.5 extends the bounds by 50% in each direction.
|
||||
// Negative values will retract the bounds.
|
||||
pad: function (bufferRatio) {
|
||||
var sw = this._southWest,
|
||||
ne = this._northEast,
|
||||
heightBuffer = Math.abs(sw.lat - ne.lat) * bufferRatio,
|
||||
widthBuffer = Math.abs(sw.lng - ne.lng) * bufferRatio;
|
||||
|
||||
return new LatLngBounds(
|
||||
new LatLng(sw.lat - heightBuffer, sw.lng - widthBuffer),
|
||||
new LatLng(ne.lat + heightBuffer, ne.lng + widthBuffer));
|
||||
},
|
||||
|
||||
// @method getCenter(): LatLng
|
||||
// Returns the center point of the bounds.
|
||||
getCenter: function () {
|
||||
return new LatLng(
|
||||
(this._southWest.lat + this._northEast.lat) / 2,
|
||||
(this._southWest.lng + this._northEast.lng) / 2);
|
||||
},
|
||||
|
||||
// @method getSouthWest(): LatLng
|
||||
// Returns the south-west point of the bounds.
|
||||
getSouthWest: function () {
|
||||
return this._southWest;
|
||||
},
|
||||
|
||||
// @method getNorthEast(): LatLng
|
||||
// Returns the north-east point of the bounds.
|
||||
getNorthEast: function () {
|
||||
return this._northEast;
|
||||
},
|
||||
|
||||
// @method getNorthWest(): LatLng
|
||||
// Returns the north-west point of the bounds.
|
||||
getNorthWest: function () {
|
||||
return new LatLng(this.getNorth(), this.getWest());
|
||||
},
|
||||
|
||||
// @method getSouthEast(): LatLng
|
||||
// Returns the south-east point of the bounds.
|
||||
getSouthEast: function () {
|
||||
return new LatLng(this.getSouth(), this.getEast());
|
||||
},
|
||||
|
||||
// @method getWest(): Number
|
||||
// Returns the west longitude of the bounds
|
||||
getWest: function () {
|
||||
return this._southWest.lng;
|
||||
},
|
||||
|
||||
// @method getSouth(): Number
|
||||
// Returns the south latitude of the bounds
|
||||
getSouth: function () {
|
||||
return this._southWest.lat;
|
||||
},
|
||||
|
||||
// @method getEast(): Number
|
||||
// Returns the east longitude of the bounds
|
||||
getEast: function () {
|
||||
return this._northEast.lng;
|
||||
},
|
||||
|
||||
// @method getNorth(): Number
|
||||
// Returns the north latitude of the bounds
|
||||
getNorth: function () {
|
||||
return this._northEast.lat;
|
||||
},
|
||||
|
||||
// @method contains(otherBounds: LatLngBounds): Boolean
|
||||
// Returns `true` if the rectangle contains the given one.
|
||||
|
||||
// @alternative
|
||||
// @method contains (latlng: LatLng): Boolean
|
||||
// Returns `true` if the rectangle contains the given point.
|
||||
contains: function (obj) { // (LatLngBounds) or (LatLng) -> Boolean
|
||||
if (typeof obj[0] === 'number' || obj instanceof LatLng || 'lat' in obj) {
|
||||
obj = toLatLng(obj);
|
||||
} else {
|
||||
obj = toLatLngBounds(obj);
|
||||
}
|
||||
|
||||
var sw = this._southWest,
|
||||
ne = this._northEast,
|
||||
sw2, ne2;
|
||||
|
||||
if (obj instanceof LatLngBounds) {
|
||||
sw2 = obj.getSouthWest();
|
||||
ne2 = obj.getNorthEast();
|
||||
} else {
|
||||
sw2 = ne2 = obj;
|
||||
}
|
||||
|
||||
return (sw2.lat >= sw.lat) && (ne2.lat <= ne.lat) &&
|
||||
(sw2.lng >= sw.lng) && (ne2.lng <= ne.lng);
|
||||
},
|
||||
|
||||
// @method intersects(otherBounds: LatLngBounds): Boolean
|
||||
// Returns `true` if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.
|
||||
intersects: function (bounds) {
|
||||
bounds = toLatLngBounds(bounds);
|
||||
|
||||
var sw = this._southWest,
|
||||
ne = this._northEast,
|
||||
sw2 = bounds.getSouthWest(),
|
||||
ne2 = bounds.getNorthEast(),
|
||||
|
||||
latIntersects = (ne2.lat >= sw.lat) && (sw2.lat <= ne.lat),
|
||||
lngIntersects = (ne2.lng >= sw.lng) && (sw2.lng <= ne.lng);
|
||||
|
||||
return latIntersects && lngIntersects;
|
||||
},
|
||||
|
||||
// @method overlaps(otherBounds: Bounds): Boolean
|
||||
// Returns `true` if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.
|
||||
overlaps: function (bounds) {
|
||||
bounds = toLatLngBounds(bounds);
|
||||
|
||||
var sw = this._southWest,
|
||||
ne = this._northEast,
|
||||
sw2 = bounds.getSouthWest(),
|
||||
ne2 = bounds.getNorthEast(),
|
||||
|
||||
latOverlaps = (ne2.lat > sw.lat) && (sw2.lat < ne.lat),
|
||||
lngOverlaps = (ne2.lng > sw.lng) && (sw2.lng < ne.lng);
|
||||
|
||||
return latOverlaps && lngOverlaps;
|
||||
},
|
||||
|
||||
// @method toBBoxString(): String
|
||||
// Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.
|
||||
toBBoxString: function () {
|
||||
return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(',');
|
||||
},
|
||||
|
||||
// @method equals(otherBounds: LatLngBounds, maxMargin?: Number): Boolean
|
||||
// Returns `true` if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting `maxMargin` to a small number.
|
||||
equals: function (bounds, maxMargin) {
|
||||
if (!bounds) { return false; }
|
||||
|
||||
bounds = toLatLngBounds(bounds);
|
||||
|
||||
return this._southWest.equals(bounds.getSouthWest(), maxMargin) &&
|
||||
this._northEast.equals(bounds.getNorthEast(), maxMargin);
|
||||
},
|
||||
|
||||
// @method isValid(): Boolean
|
||||
// Returns `true` if the bounds are properly initialized.
|
||||
isValid: function () {
|
||||
return !!(this._southWest && this._northEast);
|
||||
}
|
||||
};
|
||||
|
||||
// TODO International date line?
|
||||
|
||||
// @factory L.latLngBounds(corner1: LatLng, corner2: LatLng)
|
||||
// Creates a `LatLngBounds` object by defining two diagonally opposite corners of the rectangle.
|
||||
|
||||
// @alternative
|
||||
// @factory L.latLngBounds(latlngs: LatLng[])
|
||||
// Creates a `LatLngBounds` object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with [`fitBounds`](#map-fitbounds).
|
||||
export function toLatLngBounds(a, b) {
|
||||
if (a instanceof LatLngBounds) {
|
||||
return a;
|
||||
}
|
||||
return new LatLngBounds(a, b);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import {Earth} from './CRS.Earth';
|
||||
import {Mercator} from '../projection/Projection.Mercator';
|
||||
import {toTransformation} from '../../geometry/Transformation';
|
||||
import * as Util from '../../core/Util';
|
||||
|
||||
/*
|
||||
* @namespace CRS
|
||||
* @crs L.CRS.EPSG3395
|
||||
*
|
||||
* Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.
|
||||
*/
|
||||
export var EPSG3395 = Util.extend({}, Earth, {
|
||||
code: 'EPSG:3395',
|
||||
projection: Mercator,
|
||||
|
||||
transformation: (function () {
|
||||
var scale = 0.5 / (Math.PI * Mercator.R);
|
||||
return toTransformation(scale, 0.5, -scale, 0.5);
|
||||
}())
|
||||
});
|
||||
@@ -0,0 +1,27 @@
|
||||
import {Earth} from './CRS.Earth';
|
||||
import {SphericalMercator} from '../projection/Projection.SphericalMercator';
|
||||
import {toTransformation} from '../../geometry/Transformation';
|
||||
import * as Util from '../../core/Util';
|
||||
|
||||
/*
|
||||
* @namespace CRS
|
||||
* @crs L.CRS.EPSG3857
|
||||
*
|
||||
* The most common CRS for online maps, used by almost all free and commercial
|
||||
* tile providers. Uses Spherical Mercator projection. Set in by default in
|
||||
* Map's `crs` option.
|
||||
*/
|
||||
|
||||
export var EPSG3857 = Util.extend({}, Earth, {
|
||||
code: 'EPSG:3857',
|
||||
projection: SphericalMercator,
|
||||
|
||||
transformation: (function () {
|
||||
var scale = 0.5 / (Math.PI * SphericalMercator.R);
|
||||
return toTransformation(scale, 0.5, -scale, 0.5);
|
||||
}())
|
||||
});
|
||||
|
||||
export var EPSG900913 = Util.extend({}, EPSG3857, {
|
||||
code: 'EPSG:900913'
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
import {Earth} from './CRS.Earth';
|
||||
import {LonLat} from '../projection/Projection.LonLat';
|
||||
import {toTransformation} from '../../geometry/Transformation';
|
||||
import * as Util from '../../core/Util';
|
||||
|
||||
/*
|
||||
* @namespace CRS
|
||||
* @crs L.CRS.EPSG4326
|
||||
*
|
||||
* A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.
|
||||
*
|
||||
* Leaflet 1.0.x complies with the [TMS coordinate scheme for EPSG:4326](https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification#global-geodetic),
|
||||
* which is a breaking change from 0.7.x behaviour. If you are using a `TileLayer`
|
||||
* with this CRS, ensure that there are two 256x256 pixel tiles covering the
|
||||
* whole earth at zoom level zero, and that the tile coordinate origin is (-180,+90),
|
||||
* or (-180,-90) for `TileLayer`s with [the `tms` option](#tilelayer-tms) set.
|
||||
*/
|
||||
|
||||
export var EPSG4326 = Util.extend({}, Earth, {
|
||||
code: 'EPSG:4326',
|
||||
projection: LonLat,
|
||||
transformation: toTransformation(1 / 180, 1, -1 / 180, 0.5)
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
import {CRS} from './CRS';
|
||||
import * as Util from '../../core/Util';
|
||||
|
||||
/*
|
||||
* @namespace CRS
|
||||
* @crs L.CRS.Earth
|
||||
*
|
||||
* Serves as the base for CRS that are global such that they cover the earth.
|
||||
* Can only be used as the base for other CRS and cannot be used directly,
|
||||
* since it does not have a `code`, `projection` or `transformation`. `distance()` returns
|
||||
* meters.
|
||||
*/
|
||||
|
||||
export var Earth = Util.extend({}, CRS, {
|
||||
wrapLng: [-180, 180],
|
||||
|
||||
// Mean Earth Radius, as recommended for use by
|
||||
// the International Union of Geodesy and Geophysics,
|
||||
// see http://rosettacode.org/wiki/Haversine_formula
|
||||
R: 6371000,
|
||||
|
||||
// distance between two geographical points using spherical law of cosines approximation
|
||||
distance: function (latlng1, latlng2) {
|
||||
var rad = Math.PI / 180,
|
||||
lat1 = latlng1.lat * rad,
|
||||
lat2 = latlng2.lat * rad,
|
||||
sinDLat = Math.sin((latlng2.lat - latlng1.lat) * rad / 2),
|
||||
sinDLon = Math.sin((latlng2.lng - latlng1.lng) * rad / 2),
|
||||
a = sinDLat * sinDLat + Math.cos(lat1) * Math.cos(lat2) * sinDLon * sinDLon,
|
||||
c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
||||
return this.R * c;
|
||||
}
|
||||
});
|
||||