text
stringlengths
3
1.05M
module.exports.config = { name: "noprefix", version: "1.0.1", hasPermssion: 0, credits: "HTHB", description: "", commandCategory: "khรดng cแบงn dแบฅu lแป‡nh", usages: "", cooldowns: 0, denpendencies: { "fs": "", "request": "" } }; module.exports.onLoad = () => { const fs = require("fs-extra"); const request = require("request"); const dirMaterial = __dirname + `/noprefix/`; if (!fs.existsSync(dirMaterial + "noprefix")) fs.mkdirSync(dirMaterial, { recursive: true }); if (!fs.existsSync(dirMaterial + "anlon.gif")) request("https://i.redd.it/fhfb6iv99l561.gif").pipe(fs.createWriteStream(dirMaterial + "anlon.gif")); } module.exports.handleEvent = async ({ event, api, Currencies,Users, args, utils, global, client }) => { const fs = require("fs"); let name = await Users.getNameUser(event.senderID) var msg = { body: `Bye ${name} chรบc mแปซng bแบกn ฤ‘รฃ chแปญi bot vร  ฤƒn lแป“n vรฌ tin nhแบฏn nร y sแบฝ ฤ‘ฦฐแปฃc gแปญi ฤ‘แบฟn chแปง BOT !`, attachment: fs.createReadStream(__dirname + `/noprefix/anlon.gif`) } if (event.body.toLowerCase() == "bแบฃo รณc"){ return api.sendMessage(msg,event.threadID,event.messageID);} if (event.body.toLowerCase() == "bแบฃo ngu"){ return api.sendMessage(msg,event.threadID,event.messageID);} if (event.body.toLowerCase() == "bot rรกc"){ return api.sendMessage(msg,event.threadID,event.messageID);} if (event.body.toLowerCase() == "bot lแป“n"){ return api.sendMessage(msg,event.threadID,event.messageID);} if (event.body.toLowerCase() == "bot ngu"){ return api.sendMessage(msg,event.threadID,event.messageID);} }; module.exports.run = async ({ event, api, Currencies, args, utils }) => { return api.sendMessage("Dรนng sai cรกch rแป“i lรชu lรชu",event.threadID) }
import matplotlib.pyplot as plt import seaborn as sns from sklearn import linear_model from sklearn.datasets import make_regression from sklearn.model_selection import train_test_split # Create a data set for analysis x, y = make_regression(n_samples=500, n_features=1, noise=25, random_state=0) # Split the data set into testing and training data x_train, x_test, y_train, y_test = train_test_split(x, y, random_state=0) # Create a linear regression object regression = linear_model.LinearRegression() # Train the model using the training set regression.fit(x_train, y_train) # Make predictions using the testing set y_predictions = regression.predict(x_test) # Plot the data sns.set_style("darkgrid") sns.regplot(x_test, y_test, fit_reg=False) plt.plot(x_test, y_predictions, color='black') # Remove ticks from the plot plt.xticks([]) plt.yticks([]) plt.tight_layout() plt.show()
import os import time import yaml from platform import python_version from unittest import skipIf import bzt from bzt.engine import EXEC from bzt.modules import ConsolidatingAggregator from bzt.modules.functional import FuncSamplesReader, LoadSamplesReader, FunctionalAggregator from bzt.modules._apiritif import ApiritifNoseExecutor from bzt.modules._pytest import PyTestExecutor from bzt.modules.robot import RobotExecutor from tests.unit import RESOURCES_DIR, ExecutorTestCase from tests.unit.modules._selenium import SeleniumTestCase, MockPythonTool from bzt.utils import EXE_SUFFIX, is_windows class TestSeleniumApiritifRunner(SeleniumTestCase): def obj_prepare(self): tmp_tool = bzt.modules._apiritif.executor.Apiritif try: bzt.modules._apiritif.executor.Apiritif = MockPythonTool self.obj.prepare() finally: bzt.modules._apiritif.executor.Apiritif = tmp_tool def test_selenium_prepare_python_single(self): """ Check if script exists in working dir :return: """ self.obj.execution.merge({"scenario": { "script": RESOURCES_DIR + "selenium/python/test_blazemeter_fail.py" }}) self.obj_prepare() def test_selenium_prepare_python_folder(self): """ Check if scripts exist in working dir :return: """ self.obj.execution.merge({"scenario": {"script": RESOURCES_DIR + "selenium/python/"}}) self.obj_prepare() def test_selenium_startup_shutdown_python_single(self): """ run tests from .py file :return: """ self.configure({ 'execution': { "iterations": 1, 'scenario': {'script': RESOURCES_DIR + 'selenium/python/'}, 'executor': 'selenium' }, 'reporting': [{'module': 'junit-xml'}] }) self.obj.execution.merge({"scenario": { "script": RESOURCES_DIR + "selenium/python/test_blazemeter_fail.py" }}) self.obj_prepare() self.obj.startup() while not self.obj.check(): time.sleep(self.obj.engine.check_interval) self.assertTrue(os.path.exists(os.path.join(self.obj.engine.artifacts_dir, "apiritif.0.csv"))) @skipIf(python_version() >= '3.8' and is_windows(), "Temporary disabled") def test_selenium_startup_shutdown_python_folder(self): """ run tests from .py files :return: """ self.configure({ 'execution': { 'iterations': 1, 'scenario': {'script': RESOURCES_DIR + 'selenium/python/'}, 'executor': 'selenium' }, 'reporting': [{'module': 'junit-xml'}] }) self.obj_prepare() self.obj.startup() while not self.obj.check(): time.sleep(self.obj.engine.check_interval) api_log = os.path.join(self.obj.engine.artifacts_dir, "apiritif.0.csv") nose_log = os.path.join(self.obj.engine.artifacts_dir, "apiritif.out") self.assertTrue(os.path.exists(api_log)) with open(nose_log) as fds: content = fds.read() self.assertIn("Transaction started::", content) self.assertIn("Transaction ended::", content) def test_runner_fail_no_test_found(self): """ Check that Python Apiritif runner fails if no tests were found :return: """ self.configure({ EXEC: { "iterations": 1, "executor": "selenium", "scenario": {"script": RESOURCES_DIR + "selenium/invalid/dummy.py"} } }) self.obj_prepare() self.obj.startup() while not self.obj.check(): time.sleep(self.obj.engine.check_interval) diagnostics = "\n".join(self.obj.get_error_diagnostics()) self.assertIn("Nothing to test.", diagnostics) def test_resource_files_collection_remote_apiritif(self): self.obj.execution.merge({"scenario": {"script": RESOURCES_DIR + "selenium/python/"}}) self.assertEqual(len(self.obj.resource_files()), 1) def test_long_iterations_value(self): self.engine.aggregator = ConsolidatingAggregator() self.engine.aggregator.engine = self.engine self.obj.execution.merge({ "iterations": 2 ** 64, "scenario": { "requests": [ "http://blazedemo.com/", ], } }) self.obj_prepare() try: self.obj.startup() for _ in range(3): self.assertFalse(self.obj.check()) self.engine.aggregator.check() time.sleep(self.obj.engine.check_interval) finally: self.obj.shutdown() def test_check_tools_installed_conf(self): self.obj.execution.merge({"scenario": {"requests": ["http://blazedemo.com/"]}}) self.obj_prepare() self.assertTrue(self.obj.selenium.called) self.assertTrue(self.obj.runner.selenium.called) self.assertTrue(self.obj.runner.apiritif.called) def test_check_tools_installed_script(self): self.obj.execution.merge({"scenario": {"script": RESOURCES_DIR + "selenium/python/"}}) self.obj_prepare() self.assertTrue(self.obj.selenium.called) self.assertTrue(self.obj.runner.selenium.called) self.assertTrue(self.obj.runner.apiritif.called) class TestApiritifRunner(ExecutorTestCase): EXECUTOR = ApiritifNoseExecutor def obj_prepare(self): tmp_tool = bzt.modules._apiritif.executor.Apiritif try: bzt.modules._apiritif.executor.Apiritif = MockPythonTool self.obj.prepare() finally: bzt.modules._apiritif.executor.Apiritif = tmp_tool def test_new_flow(self): self.configure({ "execution": [{ "test-mode": "apiritif", "iterations": 1, "scenario": { "default-address": "http://blazedemo.com", "requests": [ "/", {"set-variables": {"name1": "val1"}}, { "transaction": "second", "do": [ "/other.html", "/reserve.php", { "transaction": "third", "do": [ "/${name1}" ] } ]}]}}]}) self.obj_prepare() self.assertTrue(os.path.exists(os.path.join(self.obj.engine.artifacts_dir, "test_requests.py"))) try: self.obj.startup() while not self.obj.check(): time.sleep(self.obj.engine.check_interval) finally: self.obj.shutdown() self.obj.post_process() self.assertNotEquals(self.obj.process, None) def test_apiritif_generated_requests(self): self.configure({ "execution": [{ "test-mode": "apiritif", "iterations": 1, "scenario": { "default-address": "http://blazedemo.com", "requests": [ "/", "/reserve.php"]}}]}) self.obj_prepare() self.assertTrue(os.path.exists(os.path.join(self.obj.engine.artifacts_dir, "test_requests.py"))) try: self.obj.startup() while not self.obj.check(): time.sleep(self.obj.engine.check_interval) finally: self.obj.shutdown() self.obj.post_process() self.assertNotEquals(self.obj.process, None) def test_apiritif_transactions(self): self.configure({ "execution": [{ "test-mode": "apiritif", "iterations": 1, "scenario": { "script": RESOURCES_DIR + "apiritif/test_transactions.py" } }] }) self.obj_prepare() try: self.obj.startup() while not self.obj.check(): time.sleep(self.obj.engine.check_interval) finally: self.obj.shutdown() self.obj.post_process() self.assertNotEquals(self.obj.process, None) def test_report_reading(self): reader = FuncSamplesReader(RESOURCES_DIR + "apiritif/transactions.ldjson", self.obj.engine, self.obj.log) items = list(reader.read(last_pass=True)) self.assertEqual(9, len(items)) self.assertEqual(items[0].get_short_name(), 'TestRequests.test_1_single_request') self.assertEqual(items[1].get_short_name(), 'TestRequests.test_2_multiple_requests') self.assertEqual(items[2].get_short_name(), 'test_3_toplevel_transaction.Transaction') self.assertEqual(items[3].get_short_name(), 'test_4_mixed_transaction.Transaction') self.assertEqual(items[4].get_short_name(), 'test_5_multiple_transactions.Transaction 1') self.assertEqual(items[5].get_short_name(), 'test_5_multiple_transactions.Transaction 2') self.assertEqual(items[6].get_short_name(), 'test_6_transaction_obj.Label') self.assertEqual(items[7].get_short_name(), 'test_7_transaction_fail.Label') self.assertEqual(items[8].get_short_name(), 'test_8_transaction_attach.Label') def test_report_transactions_as_failed(self): self.configure({ "execution": [{ "test-mode": "apiritif", "iterations": 1, "scenario": { "default-address": "http://httpbin.org", "requests": [{ "label": "failure by 404", "url": "/status/404", }] } }] }) self.obj.engine.aggregator = FunctionalAggregator() self.obj_prepare() try: self.obj.startup() while not self.obj.check(): time.sleep(self.obj.engine.check_interval) finally: self.obj.shutdown() self.obj.post_process() self.assertNotEquals(self.obj.process, None) reader = LoadSamplesReader(os.path.join(self.obj.engine.artifacts_dir, "apiritif.0.ldjson"), self.obj.log) samples = list(reader._read(last_pass=True)) self.assertEqual(len(samples), 1) tstmp, label, concur, rtm, cnn, ltc, rcd, error, trname, byte_count = samples[0] self.assertIsNotNone(error) def test_status_skipped(self): self.configure({ "execution": [{ "iterations": 1, "scenario": { "script": RESOURCES_DIR + "functional/test_all.py" } }] }) self.obj.engine.aggregator = FunctionalAggregator() self.obj_prepare() try: self.obj.startup() while not self.obj.check(): time.sleep(self.obj.engine.check_interval) finally: self.obj.shutdown() self.obj.post_process() reader = FuncSamplesReader(os.path.join(self.obj.engine.artifacts_dir, "apiritif.0.ldjson"), self.obj.engine, self.obj.log) samples = list(reader.read(last_pass=True)) self.assertEqual(len(samples), 4) self.assertIsNotNone(samples[-1].status) class TestPyTestExecutor(ExecutorTestCase): EXECUTOR = PyTestExecutor CMD_LINE = None def start_subprocess(self, args, **kwargs): self.CMD_LINE = args def obj_prepare(self): tmp_tool = bzt.modules._pytest.PyTest try: bzt.modules._pytest.PyTest = MockPythonTool self.obj.prepare() finally: bzt.modules._pytest.PyTest = tmp_tool def full_run(self, config): self.obj.execution.merge(config) self.obj_prepare() self.obj.engine.start_subprocess = self.start_subprocess self.obj.startup() self.obj.post_process() def test_report_file(self): self.full_run({ "scenario": { "script": RESOURCES_DIR + "selenium/pytest/test_single.py" } }) self.assertTrue('--report-file' in self.CMD_LINE) val = self.CMD_LINE[self.CMD_LINE.index('--report-file') + 1] self.assertTrue(val.endswith("PyTestExecutor.ldjson")) def test_iterations(self): self.full_run({ "iterations": 10, "scenario": { "script": RESOURCES_DIR + "selenium/pytest/test_single.py" } }) self.assertTrue('-i 10' in ' '.join(self.CMD_LINE)) def test_concurrency(self): self.full_run({ "concurrency": 2, "scenario": { "script": RESOURCES_DIR + "selenium/pytest/test_single.py" } }) self.assertTrue('-n 2' in ' '.join(self.CMD_LINE)) def test_concurrency_auto(self): self.full_run({ "concurrency": "auto", "scenario": { "script": RESOURCES_DIR + "selenium/pytest/test_single.py" } }) self.assertTrue('-n auto' in ' '.join(self.CMD_LINE)) def test_hold(self): self.full_run({ "hold-for": "3s", "scenario": { "script": RESOURCES_DIR + "selenium/pytest/test_single.py" } }) self.assertTrue('-d 3.0' in ' '.join(self.CMD_LINE)) def test_script(self): self.full_run({ "scenario": { "script": RESOURCES_DIR + "selenium/pytest/test_single.py" } }) self.assertTrue(self.CMD_LINE[-1].endswith("test_single.py")) def test_blazedemo(self): self.obj.engine.check_interval = 0.1 self.obj.execution.merge({ "scenario": { "script": RESOURCES_DIR + "selenium/pytest/test_blazedemo.py" } }) self.obj_prepare() self.obj.engine.start_subprocess = self.start_subprocess self.obj.startup() self.obj.post_process() def test_package(self): self.obj.engine.check_interval = 0.1 self.obj.execution.merge({ "scenario": { "script": RESOURCES_DIR + "selenium/pytest/" } }) self.obj_prepare() self.obj.engine.start_subprocess = self.start_subprocess self.obj.startup() self.obj.post_process() def test_additional_args(self): additional_args = "--foo --bar" self.obj.runner_path = RESOURCES_DIR + "selenium/pytest/bin/runner.py" self.full_run({ "scenario": { "additional-args": additional_args, "script": RESOURCES_DIR + "selenium/pytest/test_single.py" } }) self.assertTrue(additional_args in " ".join(self.CMD_LINE)) class TestRobotExecutor(ExecutorTestCase): EXECUTOR = RobotExecutor CMD_LINE = None def start_subprocess(self, args, **kwargs): self.CMD_LINE = args def test_full_single_script(self): self.configure({ "execution": [{ "scenario": { "script": RESOURCES_DIR + "selenium/robot/simple/test.robot" } }] }) tmp_tool = bzt.modules.robot.Robot try: bzt.modules.robot.Robot = MockPythonTool self.obj.prepare() self.obj.settings["interpreter"] = RESOURCES_DIR + "selenium/robot/robot-mock" + EXE_SUFFIX self.obj.startup() finally: bzt.modules.robot.Robot = tmp_tool self.obj.shutdown() self.obj.post_process() self.assertFalse(self.obj.has_results()) self.assertNotEquals(self.obj.process, None) lines = open(self.obj.report_file).readlines() self.assertEqual(1, len(lines)) def full_run(self, config): self.configure(config) tmp_tool = bzt.modules.robot.Robot try: bzt.modules.robot.Robot = MockPythonTool self.obj.prepare() finally: bzt.modules.robot.Robot = tmp_tool self.obj.engine.start_subprocess = self.start_subprocess self.obj.startup() self.obj.post_process() def test_hold(self): self.full_run({ "execution": [{ "hold-for": "5s", "iterations": 3, "scenario": { "script": RESOURCES_DIR + "selenium/robot/simple/test.robot" } }] }) self.assertTrue('--duration' in self.CMD_LINE) dur_val = self.CMD_LINE[self.CMD_LINE.index('--duration') + 1] self.assertEqual(dur_val, '5.0') def test_report_file(self): self.full_run({ "execution": [{ "iterations": 1, "scenario": { "script": RESOURCES_DIR + "selenium/robot/simple/test.robot" } }] }) self.assertTrue('--report-file' in self.CMD_LINE) report_file = self.CMD_LINE[self.CMD_LINE.index('--report-file') + 1] self.assertTrue(report_file.endswith("RobotExecutor.ldjson")) def test_iterations(self): self.full_run({ "execution": [{ "iterations": 3, "scenario": { "script": RESOURCES_DIR + "selenium/robot/simple/test.robot" } }] }) self.assertTrue('--iterations' in self.CMD_LINE) iters_val = self.CMD_LINE[self.CMD_LINE.index('--iterations') + 1] self.assertEqual(iters_val, '3') def test_variables(self): self.full_run({ "execution": [{ "iterations": 1, "scenario": { "variables": { "USERNAME": "janedoe", }, "script": RESOURCES_DIR + "selenium/robot/simple/test_novar.robot", } }] }) self.assertTrue('--variablefile' in self.CMD_LINE) var_file = self.CMD_LINE[self.CMD_LINE.index('--variablefile') + 1] self.assertTrue(var_file.endswith("robot-vars.yaml")) self.assertEqual('janedoe', yaml.full_load(open(var_file).read())['USERNAME']) def test_variables_file(self): self.full_run({ "execution": [{ "iterations": 1, "scenario": { "variables": RESOURCES_DIR + "selenium/robot/simple/vars.yaml", "script": RESOURCES_DIR + "selenium/robot/simple/test_novar.robot", } }] }) self.assertTrue('--variablefile' in self.CMD_LINE) var_file = self.CMD_LINE[self.CMD_LINE.index('--variablefile') + 1] self.assertEqual(var_file, os.path.normpath(RESOURCES_DIR + "selenium/robot/simple/vars.yaml")) def test_output_file(self): self.full_run({ "execution": [{ "iterations": 1, "scenario": { "script": RESOURCES_DIR + "selenium/robot/simple/test.robot" } }] }) self.assertTrue('--outputfile' in self.CMD_LINE) out_file = self.CMD_LINE[self.CMD_LINE.index('--outputfile') + 1] self.assertTrue(out_file.endswith("output.xml")) def test_log_file(self): self.full_run({ "execution": [{ "iterations": 1, "scenario": { "script": RESOURCES_DIR + "selenium/robot/simple/test.robot" } }] }) self.assertTrue('--logfile' in self.CMD_LINE) log_file = self.CMD_LINE[self.CMD_LINE.index('--logfile') + 1] self.assertTrue(log_file.endswith("log.html")) def test_single_tag(self): self.full_run({ "execution": [{ "iterations": 1, "scenario": { "tags": "create", "script": RESOURCES_DIR + "selenium/robot/simple/test.robot", } }] }) self.assertTrue('--include' in self.CMD_LINE) tags = self.CMD_LINE[self.CMD_LINE.index('--include') + 1] self.assertEqual(tags, 'create') def test_multiple_tags(self): self.full_run({ "execution": [{ "iterations": 1, "scenario": { "tags": "create,database", "script": RESOURCES_DIR + "selenium/robot/simple/test.robot", } }] }) self.assertTrue('--include' in self.CMD_LINE) tags = self.CMD_LINE[self.CMD_LINE.index('--include') + 1] self.assertEqual(tags, 'create,database')
from .ngender import guess __all__ = ['guess']
# coding=utf-8 import Putil.loger as plog plog.PutilLogConfig.config_handler(plog.stream_method) plog.PutilLogConfig.config_format( "%(filename)s: %(lineno)d: %(levelname)s: %(name)s: %(message)s") from optparse import OptionParser parser = OptionParser(usage='usage %prog [options] arg1 arg2') project_data_root = '../Data/tgs/' train_config_default = 'train_config.json' data_confiog_default = 'data.json' parser.add_option( '--train_config', action='store', dest='TrainConfig', type=str, default=train_config_default, help='specify the train configure file path relative to' 'project_data_root: {0}' 'default: {1}'.format(project_data_root, train_config_default) ) parser.add_option( '--data_config', action='store', dest='DataConfig', type=str, default=data_confiog_default, help='specify the data configure file path relative to ' 'project_data_root: {0}' 'default: {1}'.format(project_data_root, data_confiog_default) ) epoch_default = 100 parser.add_option( '--eppoch', action='store', dest='Epoch', type=int, default=epoch_default, help='specify the epoch to train' 'default: {0}'.format(epoch_default) ) batch_default = 32 parser.add_option( '--batch', action='store', dest='Batch', type=int, default=batch_default, help='specify the batch to train' 'default: {0}'.format(batch_default) ) val_epoch_default = 3 parser.add_option( '--val_epoch', action='store', dest='ValEpoch', type=int, default=val_epoch_default, help='specify the epoch step to val' 'default: {0}'.format(val_epoch_default) ) save_path_symbol_default = 'save' parser.add_option( '--save_path_symbol', action='store', dest='SavePathSymbol', type=str, default=save_path_symbol_default, help='specify the save path symbol,' 'which combine to :project_data_root/symbol/train_config_name-data_config_name-epoch-batch-val_epoch/model]' 'default: {0}'.format(save_path_symbol_default) ) level_default = 'Debug' parser.add_option( '--level', action='store', dest='Level', type=str, default=level_default, help='specify the log level for the app' 'default: {0}'.format(level_default) ) (options, args) = parser.parse_args() plog.PutilLogConfig.config_log_level(stream=plog.LogReflect(options.Level).Level) import Model import os import json import Data import Putil.train_common as ptc logger_main = plog.PutilLogConfig('main').logger() logger_main.setLevel(plog.DEBUG) if __name__ == '__main__': train_config_file_path = os.path.join(project_data_root, options.TrainConfig) with open(train_config_file_path, 'r') as fp: param = json.loads(fp.read()) fp.close() model = Model.Model(param) data_config_file = os.path.join(project_data_root, options.DataConfig) with open(data_config_file, 'r') as fp: param_d = json.loads(fp.read()) fp.close() pass logger_main.info(param) data = Data.DataConfig(param_d) Trainer = ptc.TrainCommon() save_symbol = options.SavePathSymbol save_path = os.path.join(os.path.join(project_data_root, save_symbol), '{0}-{1}-{2}-{3}-{4}'.format( os.path.split(options.TrainConfig)[-1].split('.')[0], os.path.split(options.DataConfig)[-1].split('.')[0], options.Epoch, options.Batch, options.ValEpoch )) if os.path.exists(os.path.split(save_path)[0]): pass else: os.makedirs(os.path.split(save_path)[0]) pass Trainer.model_cv( model, data['cv_gen'], data['i2d'], options.Epoch, options.ValEpoch, options.Batch, save_path) pass
// SCROLL TO TOP =============================================================================== $(function() { $(window).scroll(function() { if($(this).scrollTop() != 0) { $('#toTop').fadeIn(); } else { $('#toTop').fadeOut(); } }); $('#toTop').click(function() { $('body,html').animate({scrollTop:0},500); }); }); if( window.innerWidth < 770 ) { $("button.forward, button.backword").click(function() { $("html, body").animate({ scrollTop: 115 }, "slow"); return false; }); } if( window.innerWidth < 500 ) { $("button.forward, button.backword").click(function() { $("html, body").animate({ scrollTop: 245 }, "slow"); return false; }); } if( window.innerWidth < 340 ) { $("button.forward, button.backword").click(function() { $("html, body").animate({ scrollTop: 280 }, "slow"); return false; }); } // WIZARD =============================================================================== // OHTER =============================================================================== $(document).ready(function(){ //Menu mobile $(".btn-responsive-menu").click(function() { $("#top-nav").slideToggle(400); }); //Radio and check buttons $('input').iCheck({ checkboxClass: 'icheckbox_square-aero', radioClass: 'iradio_square-aero' }); //Pace holder $('input, textarea').placeholder(); //Switch button $('select.example-1').switchify(); }); // WIZARD with branch =============================================================================== jQuery(function($) { // Example 1: Basic wizard with validation $('form#wrapped').attr('action', 'survey_send_1.php'); $("#survey_container").wizard({ stepsWrapper: "#wrapped", submit: ".submit", beforeSelect: function( event, state ) { if ($('input#website').val().length != 0) { return false; } if (!state.isMovingForward) return true; var inputs = $(this).wizard('state').step.find(':input'); return !inputs.length || !!inputs.valid(); } }).validate({ errorPlacement: function(error, element) { if ( element.is(':radio') || element.is(':checkbox') ) { error.insertBefore( element.next() ); } else { error.insertAfter( element ); } } }) // progress bar $("#progressbar").progressbar(); $("#survey_container").wizard({ afterSelect: function( event, state ) { $("#progressbar").progressbar("value", state.percentComplete); } }); }); $("#survey_container").wizard({ transitions: { branchtype: function( $step, action ) { var branch = $step.find("[name=branchtype]:checked").val(); if (!branch) { alert("Please select a value to continue."); } return branch; } } }); /*===================================================================================*/ /* TWITTER FEED */ /*===================================================================================*/ $('.latest-tweets').each(function(){ $(this).tweet({ username: $(this).data('username'), join_text: "auto", avatar_size: 0, count: $(this).data('number'), auto_join_text_default: " we said,", auto_join_text_ed: " we", auto_join_text_ing: " we were", auto_join_text_reply: " we replied to", auto_join_text_url: "", loading_text: " loading tweets...", modpath: "./twitter/" }); }); $('.latest-tweets').find('ul').addClass('slider'); if ( $().bxSlider ) { var $this = $('.latest-tweets'); $('.latest-tweets .slider').bxSlider({ mode : $this.data('mode') != 'undefined' ? $this.data('mode') : "horizontal", speed : $this.data('speed') != 'undefined' ? $this.data('speed') : 2000, controls : $this.data('controls') != 'undefined' != 'undefined' ? $this.data('controls') : true, nextSelector : $this.data('nextselector') != 'undefined' ? $this.data('nextselector') : '', prevSelector : $this.data('prevselector') != 'undefined' ? $this.data('prevselector') : '', pager : $this.data('pager') != 'undefined' ? $this.data('pager') : true, pagerSelector : $this.data('pagerselector') != 'undefined' ? $this.data('pagerselector') : '', pagerCustom : $this.data('pagercustom') != 'undefined' ? $this.data('pagercustom') : '', auto : $this.data('auto') != 'undefined' ? $this.data('auto') : true, autoHover : $this.data('autoHover') != 'undefined' ? $this.data('autoHover') : true, adaptiveHeight : $this.data('adaptiveheight') != 'undefined' ? $this.data('adaptiveheight') : true, useCSS : $this.data('useCSS') != 'undefined' ? $this.data('useCSS') : false, nextText : '<i class="icon-angle-right">', prevText : '<i class="icon-angle-left">', preloadImages : 'all', responsive : true }); }
import {Button, FormControlLabel, MenuItem, Radio, RadioGroup, TextField} from "@material-ui/core"; import React, {useEffect, useState} from "react"; import MUIDataTable from "mui-datatables"; import axios from "axios"; import 'date-fns'; import DateFnsUtils from '@date-io/date-fns'; import { KeyboardDatePicker, MuiPickersUtilsProvider, } from '@material-ui/pickers'; import {getToken} from "../../../context/UserContext"; import {readAllHolidays, readAllLeaveTypes} from "../../../context/LeaveContext/LeaveConfigureContext"; export default function Holidays(props) { let [showForm, setShowForm] = useState(false); let [name, setName] = useState(""); let [check1, setCheck1] = useState(false); let [leaveTypeData, setLeaveTypeData] = useState([]); let [holidayData, setHolidayData] = useState([]); let opp= [ {name:"FullDay",id:"full"}, {name:"HalfDay",id:"half"} ] let [date, setDate] = useState([]); const handleDateChangeCheck = (e) => { if(e.target.value==="true"){ setCheck1(true); } else{ setCheck1(false); } }; const tokenString = localStorage.getItem('id_token'); let showF = () => { setShowForm(!showForm); } const [date_of_birth, setDate_of_birth] = React.useState('2021-05-28'); const handleDateChange = (date) => { let dat = date.getFullYear()+'-' + (date.getMonth()+1) + '-'+date.getDate(); console.log(dat) setDate_of_birth(dat); }; let [dependentsData, setDependentsData] = useState([]); useEffect(() => { readAllLeaveTypes().then(r => setLeaveTypeData(r)) readAllHolidays().then(r=>{ console.log(r) setHolidayData(r) }) }, [showForm]); let details = []; if (holidayData) { holidayData.map(y => { const data = [ y.holidayName, y.holidayDate, y.holidayType, JSON.stringify(y.isRepeatedAnnually), y._id ] details.push(data); }); } const options = { filterType: "checkbox", selectableRowsOnClick: false, onRowsDelete: async (rowsDeleted, dataRows) => { console.log(rowsDeleted) }, onRowClick: async (rowData) => { var answer = window.confirm("Delete the data"); if (answer) { const tokenString = getToken() let x = rowData[4] let id = x console.log(x) return axios.delete('/holidays', { headers: { 'Authorization': `Bearer ${tokenString}`, 'Content-Type': 'application/json', }, data: JSON.stringify({id}) }) .then(function (response) { readAllHolidays().then(r => setHolidayData(r)) }) } else { //some code } }, }; const columns = [ { name: "Name", options: { display: true, } }, { name: "Date", options: { display: true, } }, { name: "Full/Half Day", options: { display: true, } }, { name: "Repeats Annually", options: { display: true, } }, { name: "ID", options: { display: false, onRowClick: (rowData, rowState) => { console.log(rowData, rowState); }, } }, ]; return ( <div > <fieldset> <MuiPickersUtilsProvider utils={DateFnsUtils}> <div container style={{marginTop: "50px",width:"50%",margin:"auto"}}> <form> {!showForm && ( <Button style={{ margin: 'auto', width: "100%", align: 'center', marginTop: '40px', marginBottom: '40px' }} onClick={showF} variant="contained" color="primary"> Add Holiday</Button>)} {showForm && ( <Button style={{ margin: 'auto', width: "100%", align: 'center', marginTop: '40px', marginBottom: '40px' }} onClick={showF} variant="contained" color="primary"> Cancel</Button>)} </form> {showForm && ( <form> <TextField style={{width:"100%"}} id="outlined-search" label="Name" value={name} onChange={e => setName(e.target.value)} type="search" variant="outlined"/> <KeyboardDatePicker style={{marginTop:'25px',width:'100%'}} margin="normal" id="date-picker-dialog" label="Date picker dialog" format="MM/dd/yyyy" value={date_of_birth} onChange={handleDateChange} KeyboardButtonProps={{ 'aria-label': 'change date', }} /> <br/> <br/> <label> Repeats annually: <select value={check1} onChange={handleDateChangeCheck}> <option value="false">No</option> <option value="true">Yes</option> </select> </label> <TextField id="outlined-select-currency-native" value={date} select label="FullDay/HalfDay" onChange={e => setDate(e.target.value)} helperText="Please select FullDay/HalfDay" variant="outlined" style={{marginTop: "20px",width:"100%"}}> {opp.map((option) => ( <MenuItem key={option.name} value={option.id}> {option.name} </MenuItem> ))} </TextField> <br/> <button style={{ margin: 'auto', width: "25%", align: 'center', marginTop: '40px', marginBottom: '40px' }} variant="contained" color="primary" disabled={ name.length === 0 } onClick={() => { const leaveType = { "holidayName": name, "holidayDate": date_of_birth, "isRepeatedAnnually":check1, "holidayType":date } return axios.post('/holidays', leaveType, { headers: { Authorization: `Bearer ${tokenString}`, 'content-type': 'application/json' } }).then(function (response) { setName('') readAllHolidays().then(r => setHolidayData(r)) } ) .catch(function (error) { console.log(error); }) } } > Save</button> </form> )} </div> <MUIDataTable title="Holidays" data={details} columns={columns} options={options} /> </MuiPickersUtilsProvider> </fieldset> </div> ); }
from django.core.urlresolvers import reverse_lazy from django.http import HttpResponse import datetime from communique.views import (CommuniqueCreateView, CommuniqueDetailView, CommuniqueDeleteView, CommuniqueListView, CommuniqueUpdateView, CommuniqueExportFormView, CommuniqueExportListView, DATE_FORMAT_STR, DATE_FORMAT, CommuniqueListAndExportView) from .models import Admission from .forms import AdmissionUpdateForm, AdmissionCreateForm from .utils.utils_views import write_admissions_to_csv class AdmissionCreateView(CommuniqueCreateView): """ A view that handles creation of an admission. """ model = Admission success_message = 'The admission was successfully added' form_class = AdmissionCreateForm template_name = 'admissions/admission_form.html' class AdmissionDetailView(CommuniqueDetailView): """ A view that handles displaying details of an admission. """ model = Admission template_name = 'admissions/admission_view.html' context_object_name = 'admission' class AdmissionUpdateView(CommuniqueUpdateView): """ A view that handles updating of an admission. """ model = Admission success_message = 'The details of the admission were successfully updated' form_class = AdmissionUpdateForm template_name = 'admissions/admission_update_form.html' context_object_name = 'admission' class AdmissionListView(CommuniqueListAndExportView): """ A view that lists the existing admissions. """ model = Admission template_name = 'admissions/admission_list.html' context_object_name = 'admission_list' def csv_export_response(self, context): # generate a csv for exportation today = datetime.date.today() response = HttpResponse(content_type='text/csv') response['Content-Disposition'] = 'attachment; filename="all_admissions_{0}.csv"'.format( today.strftime(DATE_FORMAT)) write_admissions_to_csv(response, context[self.context_object_name], DATE_FORMAT, DATE_FORMAT_STR) return response class AdmissionDeleteView(CommuniqueDeleteView): """ A view that handles deletion of an admission. """ model = Admission success_url = reverse_lazy('admissions_admission_list') success_message = 'The admission was successfully deleted' context_object_name = 'admission' template_name = 'admissions/admission_confirm_delete.html' class AdmissionExportFormView(CommuniqueExportFormView): """ A view that handles the form for picking the creation/modified dates for admissions to be exported """ template_name = 'admissions/admission_export_list.html' def get_success_view_name(self): return 'admissions_admission_export_list' class AdmissionExportListView(CommuniqueExportListView): """ A view that lists admissions to be exported depending on the provided start and end dates """ model = Admission template_name = 'admissions/admission_export_list.html' context_object_name = 'admissions_export_list' def get_queryset(self): # get all the admissions within the provided date range start_date = self.get_export_start_date() end_date = self.get_export_end_date() admissions = Admission.objects.filter(date_last_modified__range=[start_date, end_date]) return admissions def csv_export_response(self, context): # generate an HTTP response with the csv file for the download start_date = self.get_export_start_date() end_date = self.get_export_end_date() response = HttpResponse(content_type='text/csv') response['Content-Disposition'] = 'attachment; filename="admissions_{0}_to_{1}.csv"'.format( start_date.strftime(DATE_FORMAT), end_date.strftime(DATE_FORMAT)) write_admissions_to_csv(response, context[self.context_object_name], DATE_FORMAT, DATE_FORMAT_STR) return response
// Copyright 2018 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Flags: --experimental-wasm-threads load("test/mjsunit/wasm/wasm-module-builder.js"); const kSequenceLength = 8192; const kNumberOfWorkers = 4; const kBitMask = kNumberOfWorkers - 1; const kMemoryAddress = 0; const kSequenceStartAddress = 32; function makeWorkerCodeForOpcode(compareExchangeOpcode, size, functionName, builder) { let loadMemOpcode = kTrapUnreachable; switch (size) { case 64: loadMemOpcode = kExprI64LoadMem; break; case 32: loadMemOpcode = kExprI64LoadMem32U; break; case 16: loadMemOpcode = kExprI64LoadMem16U; break; case 8: loadMemOpcode = kExprI64LoadMem8U; break; default: throw "!"; } const kArgMemoryCell = 0; // target for atomic ops const kArgSequencePtr = 1; // address of sequence const kArgSeqenceLength = 2; // lenght of sequence const kArgWorkerId = 3; // id of this worker const kArgBitMask = 4; // mask to extract worker id from value const kLocalCurrentOffset = 5; // current position in sequence in bytes const kLocalExpectedValue = 6; // the value we are waiting for const kLocalNextValue = 7; // the value to write in the update let body = [ // Turn sequence length to equivalent in bytes. kExprLocalGet, kArgSeqenceLength, kExprI32Const, size / 8, kExprI32Mul, kExprLocalSet, kArgSeqenceLength, // Outer block so we have something to jump for return. ...[kExprBlock, kWasmStmt, // Set counter to 0. kExprI32Const, 0, kExprLocalSet, kLocalCurrentOffset, // Outer loop until maxcount. ...[kExprLoop, kWasmStmt, // Find the next value to wait for. ...[kExprLoop, kWasmStmt, // Check end of sequence. kExprLocalGet, kLocalCurrentOffset, kExprLocalGet, kArgSeqenceLength, kExprI32Eq, kExprBrIf, 2, // return ...[kExprBlock, kWasmStmt, // Load next value. kExprLocalGet, kArgSequencePtr, kExprLocalGet, kLocalCurrentOffset, kExprI32Add, loadMemOpcode, 0, 0, // Mask off bits. kExprLocalGet, kArgBitMask, kExprI64UConvertI32, kExprI64And, // Compare with worker id. kExprLocalGet, kArgWorkerId, kExprI64UConvertI32, kExprI64Eq, kExprBrIf, 0, // Not found, increment position. kExprLocalGet, kLocalCurrentOffset, kExprI32Const, size / 8, kExprI32Add, kExprLocalSet, kLocalCurrentOffset, kExprBr, 1, kExprEnd ], // Found, end loop. kExprEnd ], // Load expected value to local. kExprLocalGet, kArgSequencePtr, kExprLocalGet, kLocalCurrentOffset, kExprI32Add, loadMemOpcode, 0, 0, kExprLocalSet, kLocalExpectedValue, // Load value after expected one. kExprLocalGet, kArgSequencePtr, kExprLocalGet, kLocalCurrentOffset, kExprI32Add, kExprI32Const, size / 8, kExprI32Add, loadMemOpcode, 0, 0, kExprLocalSet, kLocalNextValue, // Hammer on memory until value found. ...[kExprLoop, kWasmStmt, // Load address. kExprLocalGet, kArgMemoryCell, // Load expected value. kExprLocalGet, kLocalExpectedValue, // Load updated value. kExprLocalGet, kLocalNextValue, // Try update. kAtomicPrefix, compareExchangeOpcode, 0, 0, // Load expected value. kExprLocalGet, kLocalExpectedValue, // Spin if not what expected. kExprI64Ne, kExprBrIf, 0, kExprEnd ], // Next iteration of loop. kExprLocalGet, kLocalCurrentOffset, kExprI32Const, size / 8, kExprI32Add, kExprLocalSet, kLocalCurrentOffset, kExprBr, 0, kExprEnd ], // outer loop kExprEnd ], // the block kExprReturn ]; builder.addFunction(functionName, makeSig([kWasmI32, kWasmI32, kWasmI32, kWasmI32, kWasmI32 ], [])) .addLocals(kWasmI32, 1).addLocals(kWasmI64, 2) .addBody(body) .exportAs(functionName); } function generateSequence(typedarray, start, count) { let end = count + start; for (let i = start; i < end; i++) { typedarray[i] = Math.floor(Math.random() * 256); } } function spawnWorker(module, memory, address, sequence) { let workers = []; for (let i = 0; i < kNumberOfWorkers; i++) { let worker = new Worker( `onmessage = function(msg) { this.instance = new WebAssembly.Instance(msg.module, {m: {imported_mem: msg.memory}}); instance.exports.worker(msg.address, msg.sequence, msg.sequenceLength, msg.workerId, msg.bitMask); postMessage({workerId: msg.workerId}); }`, {type: 'string'} ); workers.push(worker); worker.postMessage({ module: module, memory: memory, address: address, sequence: sequence, sequenceLength: kSequenceLength, workerId: i, bitMask: kBitMask }); } return workers; } function waitForWorkers(workers) { for (let worker of workers) { worker.getMessage(); worker.terminate(); } } function testOpcode(opcode, opcodeSize) { print("Testing I64AtomicCompareExchange" + opcodeSize); let builder = new WasmModuleBuilder(); builder.addImportedMemory("m", "imported_mem", 0, 2, "shared"); makeWorkerCodeForOpcode(opcode, opcodeSize, "worker", builder); let memory = new WebAssembly.Memory({ initial: 2, maximum: 2, shared: true }); let memoryView = new Uint8Array(memory.buffer); let numBytes = opcodeSize / 8; generateSequence( memoryView, kSequenceStartAddress, kSequenceLength * numBytes); // Write the first element of the sequence to memory, such that the workers // can start running as soon as they are spawned. memoryView.copyWithin( kMemoryAddress, kSequenceStartAddress, kSequenceStartAddress + numBytes); let module = new WebAssembly.Module(builder.toBuffer()); let workers = spawnWorker(module, memory, kMemoryAddress, kSequenceStartAddress); waitForWorkers(workers); print("DONE"); } testOpcode(kExprI64AtomicCompareExchange, 64); testOpcode(kExprI64AtomicCompareExchange32U, 32); testOpcode(kExprI64AtomicCompareExchange16U, 16); testOpcode(kExprI64AtomicCompareExchange8U, 8);
define([ // Contact form validation 'app/js/jquery-plugins/jqBootstrapValidation', 'app/js/contact/contact_me', 'text!app/components/contact/contact-form/contact-form.html', ], function (Validation, sentMessage, template) { // Create component ContactForm class var ContactForm = { name: 'app-contact-form', template: template, mounted: function () { sentMessage(this.urlForm); }, data: function () { return { urlForm: "./bin/contact_me.php" } } }; return ContactForm; });
var config = require('../config'), _ = require('underscore'), path = require('path'), when = require('when'), api = require('../api'), mailer = require('../mail'), errors = require('../errorHandling'), storage = require('../storage'), adminNavbar, adminControllers, loginSecurity = []; // TODO: combine path/navClass to single "slug(?)" variable with no prefix adminNavbar = { content: { name: 'Content', navClass: 'content', key: 'admin.navbar.content', path: '/' }, add: { name: 'New Post', navClass: 'editor', key: 'admin.navbar.editor', path: '/editor/' }, settings: { name: 'Settings', navClass: 'settings', key: 'admin.navbar.settings', path: '/settings/' } }; // TODO: make this a util or helper function setSelected(list, name) { _.each(list, function (item, key) { item.selected = key === name; }); return list; } adminControllers = { 'uploader': function (req, res) { var type = req.files.uploadimage.type, ext = path.extname(req.files.uploadimage.name).toLowerCase(), store = storage.get_storage(); if ((type !== 'image/jpeg' && type !== 'image/png' && type !== 'image/gif' && type !== 'image/svg+xml') || (ext !== '.jpg' && ext !== '.jpeg' && ext !== '.png' && ext !== '.gif' && ext !== '.svg' && ext !== '.svgz')) { return res.send(415, 'Unsupported Media Type'); } store .save(req.files.uploadimage) .then(function (url) { return res.send(url); }) .otherwise(function (e) { return errors.logError(e); }); }, 'login': function (req, res) { /*jslint unparam:true*/ res.render('login', { bodyClass: 'ghost-login', hideNavbar: true, adminNav: setSelected(adminNavbar, 'login') }); }, 'auth': function (req, res) { var currentTime = process.hrtime()[0], denied = ''; loginSecurity = _.filter(loginSecurity, function (ipTime) { return (ipTime.time + 2 > currentTime); }); denied = _.find(loginSecurity, function (ipTime) { return (ipTime.ip === req.connection.remoteAddress); }); if (!denied) { loginSecurity.push({ip: req.connection.remoteAddress, time: process.hrtime()[0]}); api.users.check({email: req.body.email, pw: req.body.password}).then(function (user) { req.session.regenerate(function (err) { if (!err) { req.session.user = user.id; var redirect = config.paths().webroot + '/ghost/'; if (req.body.redirect) { redirect += decodeURIComponent(req.body.redirect); } res.json(200, {redirect: redirect}); } }); }, function (error) { res.json(401, {error: error.message}); }); } else { res.json(401, {error: 'Slow down, there are way too many login attempts!'}); } }, 'changepw': function (req, res) { return api.users.changePassword({ currentUser: req.session.user, oldpw: req.body.password, newpw: req.body.newpassword, ne2pw: req.body.ne2password }).then(function () { res.json(200, {msg: 'Password changed successfully'}); }, function (error) { res.send(401, {error: error.message}); }); }, 'signup': function (req, res) { /*jslint unparam:true*/ res.render('signup', { bodyClass: 'ghost-signup', hideNavbar: true, adminNav: setSelected(adminNavbar, 'login') }); }, 'doRegister': function (req, res) { var name = req.body.name, email = req.body.email, password = req.body.password; api.users.add({ name: name, email: email, password: password }).then(function (user) { api.settings.edit('email', email).then(function () { req.session.regenerate(function (err) { if (!err) { if (req.session.user === undefined) { req.session.user = user.id; } res.json(200, {redirect: config.paths().webroot + '/ghost/'}); } }); }); }).otherwise(function (error) { res.json(401, {error: error.message}); }); }, 'forgotten': function (req, res) { /*jslint unparam:true*/ res.render('forgotten', { bodyClass: 'ghost-forgotten', hideNavbar: true, adminNav: setSelected(adminNavbar, 'login') }); }, 'generateResetToken': function (req, res) { var email = req.body.email; api.users.generateResetToken(email).then(function (token) { var siteLink = '<a href="' + config().url + '">' + config().url + '</a>', resetUrl = config().url.replace(/\/$/, '') + '/ghost/reset/' + token + '/', resetLink = '<a href="' + resetUrl + '">' + resetUrl + '</a>', message = { to: email, subject: 'Reset Password', html: '<p><strong>Hello!</strong></p>' + '<p>A request has been made to reset the password on the site ' + siteLink + '.</p>' + '<p>Please follow the link below to reset your password:<br><br>' + resetLink + '</p>' + '<p>Ghost</p>' }; return mailer.send(message); }).then(function success() { var notification = { type: 'success', message: 'Check your email for further instructions', status: 'passive', id: 'successresetpw' }; return api.notifications.add(notification).then(function () { res.json(200, {redirect: config.paths().webroot + '/ghost/signin/'}); }); }, function failure(error) { // TODO: This is kind of sketchy, depends on magic string error.message from Bookshelf. // TODO: It's debatable whether we want to just tell the user we sent the email in this case or not, we are giving away sensitive info here. if (error && error.message === 'EmptyResponse') { error.message = "Invalid email address"; } res.json(401, {error: error.message}); }); }, 'reset': function (req, res) { // Validate the request token var token = req.params.token; api.users.validateToken(token).then(function () { // Render the reset form res.render('reset', { bodyClass: 'ghost-reset', hideNavbar: true, adminNav: setSelected(adminNavbar, 'reset') }); }).otherwise(function (err) { // Redirect to forgotten if invalid token var notification = { type: 'error', message: 'Invalid or expired token', status: 'persistent', id: 'errorinvalidtoken' }; errors.logError(err, 'admin.js', "Please check the provided token for validity and expiration."); return api.notifications.add(notification).then(function () { res.redirect(config.paths().webroot + '/ghost/forgotten'); }); }); }, 'resetPassword': function (req, res) { var token = req.params.token, newPassword = req.param('newpassword'), ne2Password = req.param('ne2password'); api.users.resetPassword(token, newPassword, ne2Password).then(function () { var notification = { type: 'success', message: 'Password changed successfully.', status: 'passive', id: 'successresetpw' }; return api.notifications.add(notification).then(function () { res.json(200, {redirect: config.paths().webroot + '/ghost/signin/'}); }); }).otherwise(function (err) { // TODO: Better error message if we can tell whether the passwords didn't match or something res.json(401, {error: err.message}); }); }, 'logout': function (req, res) { req.session.destroy(); var notification = { type: 'success', message: 'You were successfully signed out', status: 'passive', id: 'successlogout' }; return api.notifications.add(notification).then(function () { res.redirect(config.paths().webroot + '/ghost/signin/'); }); }, 'index': function (req, res) { /*jslint unparam:true*/ res.render('content', { bodyClass: 'manage', adminNav: setSelected(adminNavbar, 'content') }); }, 'editor': function (req, res) { if (req.params.id !== undefined) { res.render('editor', { bodyClass: 'editor', adminNav: setSelected(adminNavbar, 'content') }); } else { res.render('editor', { bodyClass: 'editor', adminNav: setSelected(adminNavbar, 'add') }); } }, 'content': function (req, res) { /*jslint unparam:true*/ res.render('content', { bodyClass: 'manage', adminNav: setSelected(adminNavbar, 'content') }); }, 'settings': function (req, res, next) { // TODO: Centralise list/enumeration of settings panes, so we don't // run into trouble in future. var allowedSections = ['', 'general', 'user'], section = req.url.replace(/(^\/ghost\/settings[\/]*|\/$)/ig, ''); if (allowedSections.indexOf(section) < 0) { return next(); } res.render('settings', { bodyClass: 'settings', adminNav: setSelected(adminNavbar, 'settings') }); }, 'debug': { /* ugly temporary stuff for managing the app before it's properly finished */ index: function (req, res) { /*jslint unparam:true*/ res.render('debug', { bodyClass: 'settings', adminNav: setSelected(adminNavbar, 'settings') }); } } }; module.exports = adminControllers;
// // /***************************************************************** // // * // // * Promises // // * // // * Promises are built-in to many libraries and functions like // // * fetch(), but we can also build our own promises. // // * // // * Sitenote: // // * fetch() is similar to jQuery's .get() method. // // * // // ****************************************************************/ // // // Get the current IP address of your machine // // const getIpPromise = fetch('https://api.ipify.org/?format=json') // // // Nothing there? Hmm ... we get a Promise instead of the result // // console.log('Done!') // // console.log(getIpPromise) // // /** // // * We use built-in promises of the fetch() function here: // // * // // * .then() is fired, when the request is successful // // * .catch() is fired, when the request has an error // // */ // // getIpPromise // // .then((response) => response.json()) // // .then((data) => { console.log(data) }) // // .catch((error) => { // // console.error(error) // // }) // // /** // // * Creating our own promise // // * // // * Whenever you call the callback resolve() the promise returns as being successfully // // * resolved and an existing .then() will be fired. // // * // // * Whenever you call the callback reject() the promise returns as not being successfully // // * resolved and an existing .catch() will be fired. // // */ // // const exercisePromiseResolve = new Promise((resolve, reject) => { // // setTimeout(() => { // // resolve('This is our own promise. Yay!') // // }, 1500) // // }) // // exercisePromiseResolve // // .then((data) => { // // console.log(data) // // }) // // const exercisePromiseReject = new Promise((resolve, reject) => { // // setTimeout(() => { // // reject('This is our own failed promise. Oh no!') // // }, 3000) // // }) // // exercisePromiseReject // // .then((data) => { // // console.log(data) // // }) // // .catch((error) => { // // console.log(error) // // }) // // /** // // * Chaining promises, in a waterfall kind of way // // * // // * We're simulating database queries here, that might happen one after another: // // * - First getting a post by id // // * - Second getting the matching author by id // // */ // // const posts = [ // // { title: 'JavaScript is great!', 'author': 2, id: 1 }, // // { title: 'Bootstrap 4 is out!', 'author': 3, id: 2 }, // // { title: 'How to use the Chrome Dev Console', 'author': 1, id: 3 }, // // { title: 'Dead authors are dead', 'author': 4, id: 4 } // // ] // function multiplePromises() { // const ipPromise = fetch("https://api.ipify.org/?format=json"); // const bcPricePromise = fetch( // "https://api.coindesk.com/v1/bpi/currentprice/eur.json" // ); // Promise // // wait for all promises of an array // .all([ipPromise, bcPricePromise]) // .then(responses => { // // wait for all of the .json() calls we need // return Promise.all(responses.map(response => response.json())); // }) // .then(data => { // console.log(data) // const [ip, bitcoin] = data; // console.log("ip and bitcoin"); // console.log(ip); // console.log(bitcoin); // }); // } // multiplePromises() // // const authors = [ // // { name: 'Peter Parker', twitter: '@peterparker', bio: 'Australian Coder', id: 1 }, // // { name: 'Paul Shawn', twitter: '@paulshawn', bio: 'British CSS fanatic', id: 2 }, // // { name: 'Mary Poppins', twitter: '@marrypoppins', bio: 'Nanny of developers', id: 3 } // // ] // // function getPostById(id) { // // // create a new promise // // return new Promise((resolve, reject) => { // // // using setTimeout to mimick a database query delay // // setTimeout(() => { // // // find the post we want // // const post = posts.find((post) => post.id === id) // // if (post) { // // // send the post back // // resolve(post) // // } else { // // reject(Error('No post was found!')) // // } // // }, 3500) // // }) // // } // // function getAuthorByPost(post) { // // // create a new promise // // return new Promise((resolve, reject) => { // // // find the author we want // // const authorDetails = authors.find((person) => person.id === post.author) // // if (authorDetails) { // // // send the details back // // resolve(authorDetails) // // } else { // // reject(Error('No author was found!')) // // } // // }) // // } // // getPostById(4) // // .then((post) => { // // console.log('Found the post!') // // // we return a new promise, to chain another .then() that handles // // // the extended post data // // return new Promise((resolve, reject) => { // // getAuthorByPost(post) // // .then((author) => { // // post.author = author // // resolve(post) // // }) // // .catch((error) => { // // reject(error) // // }) // // }) // // }) // // .then((post) => { // // console.log(' => Found the author!') // // console.log(post) // // }) // // .catch((error) => { // // console.error(error) // // }) // // /** // // * Waiting for multiple promises at the same time // // * // // * We're calling 2 APIs: // // * - First the apify IP address API // // * - Second the current bitcoin price in EUR // // * // // * Sitenote: // // * The call of .json() on the response objects is needed, as their might be // // * different kinds of responsoes and we don't always get JSON. Other response // // * types could for exmaple be blobs, text or formData. // // */ // function multiplePromises() { // const ipPromise = fetch('https://api.ipify.org/?format=json') // const bcPricePromise = fetch('https://api.coindesk.com/v1/bpi/currentprice/eur.json') // Promise // // wait for all promises of an array // .all([ipPromise, bcPricePromise]) // .then((responses) => { // // wait for all of the .json() calls we need // return Promise.all(responses.map((response) => response.json())) // })function multiplePromises() { // const ipPromise = fetch("https://api.ipify.org/?format=json"); // const bcPricePromise = fetch( // "https://api.coindesk.com/v1/bpi/currentprice/eur.json" // ); // Promise // // wait for all promises of an array // .all([ipPromise, bcPricePromise]) // .then(responses => { // // wait for all of the .json() calls we need // return Promise.all(responses.map(response => response.json())); // }) // .then(data => { // console.log(data) // const [ip, bitcoin] = data; // console.log("ip and bitcoin"); // console.log(ip); // console.log(bitcoin); // }); // } // multiplePromises() // console.log(ip) // console.log(bitcoin) // }) // } // // Adding a timeout to wait for the other demos // setTimeout(() => { // multiplePromises() // }, 5000) // function multiplePromises() { // const ipPromise = fetch('https://api.ipify.org/?format=json') // const bcPricePromise = fetch('https://api.coindesk.com/v1/bpi/currentprice/eur.json') // Promise // // wait for all promises of an array // .all([ipPromise, bcPricePromise]) // .then((responses) => { // // wait for all of the .json() calls we need // return Promise.all(responses.map((response) => response.json())) // }) // .then((data) => { // const [ip, bitcoin] = data // console.log('ip and bitcoin') // console.log(ip) // console.log(bitcoin) // }) // } // multiplePromises() async function multiplePromises() { const ipPromise = fetch("https://api.ipify.org/?format=json"); const bcPricePromise = fetch( "https://api.coindesk.com/v1/bpi/currentprice/eur.json" ); const responses = await Promise.all([ipPromise, bcPricePromise]); const data = await Promise.all(responses.map((response) => response.json())); const [ip, bitcoin] = data; console.log(ip); console.log(bitcoin); } multiplePromises();
/* * Globalize Culture es-PY * * http://github.com/jquery/globalize * * Copyright Software Freedom Conservancy, Inc. * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * This file was generated by the Globalize Culture Generator * Translation: bugs found in this file need to be fixed in the generator */ (function (window, undefined) { var Globalize; if (typeof require !== "undefined" && typeof exports !== "undefined" && typeof module !== "undefined") { // Assume CommonJS Globalize = require("globalize"); } else { // Global variable Globalize = window.Globalize; } Globalize.addCultureInfo("es-PY", "default", { name: "es-PY", englishName: "Spanish (Paraguay)", nativeName: "Espaรฑol (Paraguay)", language: "es", numberFormat: { ",": ".", ".": ",", "NaN": "NeuN", negativeInfinity: "-Infinito", positiveInfinity: "Infinito", percent: { ",": ".", ".": "," }, currency: { pattern: ["($ n)", "$ n"], ",": ".", ".": ",", symbol: "Gs" } }, calendars: { standard: { firstDay: 1, days: { names: ["domingo", "lunes", "martes", "miรฉrcoles", "jueves", "viernes", "sรกbado"], namesAbbr: ["dom", "lun", "mar", "miรฉ", "jue", "vie", "sรกb"], namesShort: ["do", "lu", "ma", "mi", "ju", "vi", "sรก"] }, months: { names: ["enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre", ""], namesAbbr: ["ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sep", "oct", "nov", "dic", ""] }, AM: ["a.m.", "a.m.", "A.M."], PM: ["p.m.", "p.m.", "P.M."], eras: [{"name": "d.C.", "start": null, "offset": 0}], patterns: { d: "dd/MM/yyyy", D: "dddd, dd' de 'MMMM' de 'yyyy", t: "hh:mm tt", T: "hh:mm:ss tt", f: "dddd, dd' de 'MMMM' de 'yyyy hh:mm tt", F: "dddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt", M: "dd MMMM", Y: "MMMM' de 'yyyy" } } } }); }(this));
export default { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "MultiPolygon", "coordinates": [[[[-1.4505, 40.1426], [-1.4338, 40.1377], [-1.4204, 40.1403], [-1.4035, 40.1375], [-1.3922, 40.1324], [-1.3744, 40.1381], [-1.3659, 40.1356], [-1.3607, 40.1276], [-1.3516, 40.1295], [-1.3337, 40.1417], [-1.3164, 40.1498], [-1.3161, 40.1613], [-1.3228, 40.1719], [-1.3213, 40.1879], [-1.3131, 40.2024], [-1.3018, 40.2064], [-1.29, 40.1893], [-1.2844, 40.1724], [-1.2741, 40.1597], [-1.2529, 40.1432], [-1.2441, 40.117], [-1.2264, 40.1146], [-1.2121, 40.1099], [-1.1917, 40.1102], [-1.1657, 40.1155], [-1.147, 40.1133], [-1.1323, 40.0983], [-1.1108, 40.0918], [-1.0809, 40.0712], [-1.0705, 40.0504], [-1.0825, 40.037], [-1.1055, 40.0255], [-1.1179, 40.0235], [-1.1313, 40.017], [-1.1429, 40.0171], [-1.1642, 40.0114], [-1.1891, 40.0029], [-1.2217, 40.0009], [-1.2469, 39.9953], [-1.2582, 39.9964], [-1.2836, 40.0072], [-1.3237, 40.0117], [-1.3371, 40.0151], [-1.3594, 40.0107], [-1.3762, 40.0187], [-1.3833, 40.0415], [-1.4018, 40.069], [-1.409, 40.0766], [-1.4173, 40.0925], [-1.4127, 40.1027], [-1.4449, 40.118], [-1.4546, 40.1286], [-1.4505, 40.1426]]], [[[-1.141, 39.9704], [-1.1311, 39.9695], [-1.1265, 39.9623], [-1.1156, 39.9716], [-1.1028, 39.9735], [-1.0917, 39.9675], [-1.0859, 39.9753], [-1.0551, 39.9792], [-1.0247, 39.9735], [-1.0033, 39.9808], [-0.9882, 39.9805], [-0.9689, 39.974], [-0.9327, 39.9564], [-0.9187, 39.9614], [-0.917, 39.9546], [-0.9047, 39.9392], [-0.9043, 39.9276], [-0.9134, 39.9176], [-0.9082, 39.9017], [-0.901, 39.8899], [-0.9086, 39.8855], [-0.9121, 39.8721], [-0.909, 39.8672], [-0.8887, 39.8531], [-0.8665, 39.8472], [-0.8359, 39.8638], [-0.8283, 39.8715], [-0.8134, 39.8744], [-0.7951, 39.8814], [-0.8027, 39.8923], [-0.8279, 39.9081], [-0.8365, 39.9241], [-0.8372, 39.9414], [-0.8431, 39.946], [-0.8351, 39.9573], [-0.8377, 39.9691], [-0.8343, 39.9774], [-0.8149, 39.9824], [-0.7994, 39.9901], [-0.7863, 39.9902], [-0.7662, 40.012], [-0.7618, 40.0413], [-0.7526, 40.0459], [-0.7458, 40.0391], [-0.7303, 40.0423], [-0.7187, 40.0395], [-0.7018, 40.0467], [-0.6814, 40.0443], [-0.6631, 40.0514], [-0.6465, 40.0677], [-0.631, 40.0743], [-0.6147, 40.0706], [-0.6279, 40.1034], [-0.6097, 40.1265], [-0.5971, 40.1318], [-0.5851, 40.1314], [-0.5796, 40.1451], [-0.5705, 40.1557], [-0.573, 40.1707], [-0.5712, 40.1795], [-0.558, 40.2001], [-0.5587, 40.2092], [-0.5485, 40.2443], [-0.5435, 40.2517], [-0.5335, 40.2414], [-0.511, 40.2309], [-0.4872, 40.2328], [-0.4671, 40.2392], [-0.4516, 40.2355], [-0.4268, 40.2436], [-0.3836, 40.2637], [-0.3844, 40.2759], [-0.3896, 40.2863], [-0.4007, 40.2942], [-0.3897, 40.3056], [-0.3759, 40.3049], [-0.356, 40.3149], [-0.3439, 40.3248], [-0.3413, 40.3377], [-0.3326, 40.3408], [-0.3055, 40.3618], [-0.2974, 40.3614], [-0.2811, 40.3692], [-0.2867, 40.3871], [-0.3021, 40.3977], [-0.3119, 40.4128], [-0.3319, 40.4224], [-0.3424, 40.4386], [-0.3393, 40.4524], [-0.3079, 40.4646], [-0.2718, 40.4762], [-0.28, 40.4834], [-0.2763, 40.4988], [-0.2874, 40.5081], [-0.2965, 40.5048], [-0.3002, 40.5144], [-0.2969, 40.532], [-0.2907, 40.5436], [-0.2905, 40.5526], [-0.2962, 40.5609], [-0.2917, 40.6044], [-0.2955, 40.6113], [-0.3115, 40.6115], [-0.3239, 40.6029], [-0.3582, 40.615], [-0.3695, 40.6134], [-0.3788, 40.6229], [-0.3706, 40.6499], [-0.3803, 40.6589], [-0.3791, 40.6657], [-0.3576, 40.6771], [-0.344, 40.6794], [-0.3233, 40.6783], [-0.32, 40.6676], [-0.308, 40.6604], [-0.2948, 40.6735], [-0.2572, 40.6885], [-0.237, 40.691], [-0.2346, 40.7079], [-0.2395, 40.7156], [-0.2328, 40.7275], [-0.231, 40.7406], [-0.2255, 40.7525], [-0.214, 40.7578], [-0.2115, 40.7663], [-0.1967, 40.7836], [-0.1653, 40.7883], [-0.1448, 40.785], [-0.1472, 40.7764], [-0.1438, 40.7677], [-0.1242, 40.7523], [-0.1082, 40.7436], [-0.0975, 40.7418], [-0.0769, 40.7317], [-0.0631, 40.7275], [-0.0503, 40.728], [-0.0328, 40.723], [-0.0232, 40.73], [0.0141, 40.7293], [0.0281, 40.7143], [0.0238, 40.7051], [0.0287, 40.6949], [0.0441, 40.6931], [0.0746, 40.7152], [0.1081, 40.7271], [0.1242, 40.7217], [0.1471, 40.7192], [0.163, 40.7226], [0.1699, 40.7336], [0.1826, 40.7277], [0.1903, 40.7303], [0.1976, 40.7237], [0.2144, 40.7306], [0.2239, 40.7255], [0.2373, 40.7003], [0.2624, 40.7055], [0.2788, 40.6926], [0.2925, 40.685], [0.2819, 40.6724], [0.2744, 40.6688], [0.2682, 40.6583], [0.2662, 40.6447], [0.2786, 40.6308], [0.2909, 40.6244], [0.2979, 40.6257], [0.3157, 40.6149], [0.3396, 40.6081], [0.3722, 40.6061], [0.387, 40.6068], [0.4019, 40.6023], [0.4073, 40.5939], [0.4319, 40.5788], [0.4397, 40.579], [0.4349, 40.5656], [0.4383, 40.5474], [0.4475, 40.5425], [0.4881, 40.5285], [0.5141, 40.5227], [0.5012, 40.4993], [0.491, 40.4883], [0.4847, 40.4747], [0.4661, 40.4599], [0.4593, 40.4487], [0.4487, 40.4391], [0.4362, 40.4164], [0.4184, 40.3998], [0.399, 40.3537], [0.3931, 40.3511], [0.3866, 40.3393], [0.366, 40.3237], [0.3551, 40.312], [0.3486, 40.2964], [0.337, 40.2916], [0.3307, 40.2789], [0.3143, 40.269], [0.3046, 40.259], [0.2878, 40.2528], [0.2807, 40.2441], [0.2667, 40.2083], [0.2571, 40.2028], [0.2321, 40.1977], [0.2022, 40.1799], [0.1836, 40.1601], [0.1607, 40.1218], [0.1471, 40.0887], [0.132, 40.0708], [0.1201, 40.061], [0.1072, 40.0557], [0.0839, 40.0551], [0.0537, 40.0362], [0.0482, 40.0306], [0.0427, 40.0161], [0.0281, 39.9958], [0.0213, 39.9736], [0.0084, 39.9644], [-0.0051, 39.9163], [-0.013, 39.9062], [-0.0232, 39.9009], [-0.0422, 39.8843], [-0.0629, 39.8695], [-0.0672, 39.8628], [-0.0838, 39.8574], [-0.101, 39.8335], [-0.1195, 39.812], [-0.1632, 39.7535], [-0.1763, 39.7404], [-0.1859, 39.7255], [-0.1974, 39.6984], [-0.2026, 39.6724], [-0.2104, 39.6603], [-0.2298, 39.6388], [-0.2497, 39.625], [-0.2666, 39.6022], [-0.2746, 39.5736], [-0.2848, 39.5583], [-0.3066, 39.5343], [-0.3201, 39.5111], [-0.3253, 39.4921], [-0.3238, 39.4586], [-0.3277, 39.4454], [-0.3362, 39.4361], [-0.3318, 39.4057], [-0.3154, 39.3546], [-0.2938, 39.3075], [-0.2857, 39.2979], [-0.2614, 39.2583], [-0.2435, 39.2245], [-0.2209, 39.188], [-0.22, 39.1806], [-0.2339, 39.1789], [-0.2403, 39.1657], [-0.2367, 39.1431], [-0.2175, 39.096], [-0.1992, 39.059], [-0.1818, 39.0322], [-0.1517, 38.9944], [-0.1523, 38.9899], [-0.14, 38.9745], [-0.0994, 38.9352], [-0.0768, 38.9157], [-0.0295, 38.8809], [-0.014, 38.8721], [0.0203, 38.8656], [0.0351, 38.8605], [0.0538, 38.8635], [0.0925, 38.8543], [0.1091, 38.8462], [0.1249, 38.8332], [0.141, 38.8343], [0.1547, 38.8276], [0.1737, 38.8141], [0.1917, 38.808], [0.1982, 38.7997], [0.183, 38.7934], [0.1881, 38.78], [0.2103, 38.7601], [0.2203, 38.7601], [0.2314, 38.7315], [0.2074, 38.732], [0.1969, 38.7285], [0.1742, 38.7123], [0.1687, 38.711], [0.148, 38.6868], [0.1297, 38.6867], [0.1151, 38.6744], [0.0984, 38.673], [0.0776, 38.6525], [0.0707, 38.6387], [0.0451, 38.6412], [0.0342, 38.6358], [0.0296, 38.6258], [0.0104, 38.632], [-0.0156, 38.6269], [-0.0328, 38.6152], [-0.0418, 38.6033], [-0.0577, 38.5892], [-0.064, 38.5709], [-0.0509, 38.5655], [-0.0598, 38.5513], [-0.0768, 38.5373], [-0.0974, 38.5239], [-0.1095, 38.5328], [-0.1362, 38.5364], [-0.1547, 38.5337], [-0.1674, 38.524], [-0.1733, 38.5156], [-0.1924, 38.5155], [-0.2246, 38.5078], [-0.239, 38.4989], [-0.271, 38.4928], [-0.3033, 38.4811], [-0.3179, 38.4732], [-0.3563, 38.4483], [-0.3757, 38.4418], [-0.3903, 38.4257], [-0.3915, 38.4163], [-0.4018, 38.4105], [-0.4087, 38.3833], [-0.4105, 38.3613], [-0.4139, 38.3509], [-0.4341, 38.3545], [-0.4464, 38.3611], [-0.4806, 38.342], [-0.4865, 38.3355], [-0.503, 38.3336], [-0.5083, 38.3274], [-0.517, 38.3023], [-0.5184, 38.2815], [-0.5141, 38.2474], [-0.5059, 38.2159], [-0.5109, 38.1985], [-0.5205, 38.1903], [-0.5357, 38.1876], [-0.56, 38.1907], [-0.5925, 38.1885], [-0.6073, 38.1791], [-0.6335, 38.1437], [-0.6365, 38.1216], [-0.6419, 38.0998], [-0.6482, 38.0529], [-0.6495, 38.0106], [-0.6463, 38.0011], [-0.6533, 37.9966], [-0.6576, 37.9839], [-0.6797, 37.9719], [-0.6879, 37.9752], [-0.6993, 37.9666], [-0.7041, 37.9553], [-0.7057, 37.9405], [-0.7163, 37.9384], [-0.7235, 37.9204], [-0.7307, 37.9128], [-0.742, 37.9085], [-0.7516, 37.8974], [-0.7569, 37.8671], [-0.7632, 37.8605], [-0.7631, 37.8472], [-0.784, 37.8448], [-0.8062, 37.859], [-0.8291, 37.8631], [-0.8398, 37.8693], [-0.8883, 37.9104], [-0.9188, 37.9408], [-0.9293, 37.9587], [-0.9449, 37.979], [-0.9485, 38.0034], [-0.954, 38.0133], [-0.9874, 38.0556], [-0.9963, 38.0598], [-1.0149, 38.0828], [-1.0165, 38.0962], [-1.0213, 38.1017], [-1.0211, 38.1235], [-1.0274, 38.1468], [-1.0131, 38.1587], [-0.998, 38.1766], [-0.9783, 38.2106], [-0.9684, 38.2477], [-0.9564, 38.2682], [-0.9554, 38.2852], [-0.9594, 38.3051], [-0.9738, 38.3245], [-0.9784, 38.3371], [-0.9925, 38.3398], [-1.0172, 38.334], [-1.0321, 38.3395], [-1.0568, 38.345], [-1.0849, 38.3467], [-1.0892, 38.3657], [-1.0879, 38.4043], [-1.0848, 38.4284], [-1.0923, 38.4366], [-1.0686, 38.4482], [-1.0358, 38.4738], [-1.0138, 38.4963], [-1.0254, 38.5229], [-1.0173, 38.5358], [-1.0015, 38.5733], [-1.0123, 38.6059], [-1.0161, 38.6336], [-1.0229, 38.639], [-1.0267, 38.6556], [-1.0072, 38.6574], [-0.99, 38.6544], [-0.9606, 38.6574], [-0.9321, 38.6773], [-0.9152, 38.696], [-0.9274, 38.7072], [-0.9272, 38.7135], [-0.9416, 38.7305], [-0.9533, 38.7529], [-0.9604, 38.7734], [-0.9468, 38.7763], [-0.9282, 38.7845], [-0.9335, 38.7938], [-0.933, 38.8098], [-0.9229, 38.8235], [-0.9315, 38.8303], [-0.9324, 38.8476], [-0.9359, 38.8553], [-0.9329, 38.8746], [-0.9239, 38.8914], [-0.9394, 38.8992], [-0.9484, 38.9097], [-0.9575, 38.9256], [-0.9595, 38.9439], [-0.9756, 38.9416], [-1.0007, 38.9496], [-1.0122, 38.9395], [-1.0329, 38.934], [-1.047, 38.9363], [-1.1078, 38.9286], [-1.1436, 38.9285], [-1.1536, 38.9412], [-1.1596, 38.9541], [-1.1759, 38.9685], [-1.1926, 38.9873], [-1.2013, 38.9928], [-1.2086, 39.0054], [-1.2256, 39.0243], [-1.2629, 39.0459], [-1.2652, 39.0509], [-1.2625, 39.0679], [-1.2641, 39.0763], [-1.2552, 39.0841], [-1.2551, 39.1064], [-1.2396, 39.1144], [-1.2265, 39.1513], [-1.2127, 39.1608], [-1.1975, 39.1756], [-1.1922, 39.194], [-1.1818, 39.21], [-1.1765, 39.2319], [-1.1777, 39.2492], [-1.1749, 39.2781], [-1.1626, 39.3058], [-1.1772, 39.3146], [-1.2005, 39.3153], [-1.208, 39.3251], [-1.2169, 39.3164], [-1.2423, 39.3215], [-1.2678, 39.3289], [-1.2955, 39.3308], [-1.2998, 39.3372], [-1.3115, 39.3425], [-1.3268, 39.3413], [-1.3351, 39.3329], [-1.3502, 39.3394], [-1.3661, 39.3549], [-1.3807, 39.3534], [-1.3829, 39.3654], [-1.4028, 39.3649], [-1.4092, 39.3783], [-1.4199, 39.3816], [-1.4415, 39.3674], [-1.4488, 39.3789], [-1.4617, 39.3794], [-1.4518, 39.3895], [-1.4509, 39.3964], [-1.4589, 39.401], [-1.4649, 39.3912], [-1.4755, 39.3932], [-1.4658, 39.4024], [-1.4881, 39.4025], [-1.4878, 39.416], [-1.4968, 39.4148], [-1.5107, 39.4341], [-1.5212, 39.4398], [-1.5126, 39.4579], [-1.5096, 39.4901], [-1.5012, 39.4926], [-1.4987, 39.5001], [-1.506, 39.5066], [-1.5017, 39.5142], [-1.5056, 39.5203], [-1.5049, 39.5523], [-1.4997, 39.5647], [-1.4747, 39.5695], [-1.4624, 39.5766], [-1.4554, 39.5873], [-1.4393, 39.6234], [-1.4183, 39.6544], [-1.4041, 39.6659], [-1.3698, 39.6882], [-1.3412, 39.6799], [-1.3142, 39.6699], [-1.2916, 39.6719], [-1.279, 39.6782], [-1.2629, 39.6975], [-1.272, 39.7136], [-1.2748, 39.7396], [-1.2517, 39.7692], [-1.2347, 39.7815], [-1.2169, 39.8058], [-1.2108, 39.8368], [-1.2008, 39.8549], [-1.1998, 39.9007], [-1.1965, 39.913], [-1.2109, 39.9328], [-1.2041, 39.9492], [-1.1545, 39.9621], [-1.141, 39.9704]]]] }, "properties": { "name": "Valencia", "id": "ES-VC", "CNTRY": "Spain", "TYPE": "Autonomous Community" }, "id": "ES-VC" }, { "type": "Feature", "geometry": { "type": "MultiPolygon", "coordinates": [[[[-1.7318, 43.2992], [-1.7302, 43.2934], [-1.7465, 43.2923], [-1.765, 43.2857], [-1.78, 43.2867], [-1.7934, 43.2759], [-1.7918, 43.268], [-1.7951, 43.2451], [-1.8217, 43.2356], [-1.8239, 43.2287], [-1.8506, 43.2228], [-1.8546, 43.2165], [-1.8749, 43.2176], [-1.8905, 43.2082], [-1.9131, 43.2152], [-1.9131, 43.2012], [-1.9214, 43.1878], [-1.9227, 43.1765], [-1.9155, 43.1658], [-1.9212, 43.1527], [-1.9062, 43.1449], [-1.9034, 43.1351], [-1.917, 43.1277], [-1.9228, 43.117], [-1.9384, 43.1087], [-1.9483, 43.0973], [-1.9699, 43.095], [-1.9724, 43.0857], [-2.0135, 43.0727], [-2.0225, 43.0654], [-2.0187, 43.0562], [-2.0214, 43.0471], [-2.0317, 43.0342], [-2.0416, 43.0308], [-2.0394, 43.0168], [-2.0281, 42.9975], [-2.0389, 42.9799], [-2.0528, 42.9754], [-2.0864, 42.9747], [-2.0947, 42.97], [-2.1036, 42.9477], [-2.1269, 42.9395], [-2.156, 42.9413], [-2.1648, 42.9353], [-2.1801, 42.9346], [-2.1924, 42.9484], [-2.2094, 42.9489], [-2.2208, 42.9322], [-2.2308, 42.9312], [-2.238, 42.9196], [-2.2375, 42.8959], [-2.242, 42.8861], [-2.24, 42.8649], [-2.232, 42.8433], [-2.2373, 42.8323], [-2.2702, 42.8088], [-2.2688, 42.7938], [-2.2791, 42.7878], [-2.2728, 42.7658], [-2.2657, 42.7526], [-2.2731, 42.7433], [-2.2855, 42.7424], [-2.3043, 42.7353], [-2.3164, 42.7385], [-2.3231, 42.7197], [-2.3132, 42.7084], [-2.3142, 42.7013], [-2.3108, 42.6715], [-2.3043, 42.67], [-2.2935, 42.6771], [-2.2881, 42.6556], [-2.2966, 42.6505], [-2.3099, 42.6527], [-2.3331, 42.6445], [-2.346, 42.6338], [-2.3755, 42.6375], [-2.3728, 42.6438], [-2.3832, 42.6559], [-2.3946, 42.6603], [-2.4149, 42.6618], [-2.4509, 42.6462], [-2.4649, 42.6269], [-2.4708, 42.6262], [-2.4837, 42.6121], [-2.4989, 42.6158], [-2.4901, 42.5863], [-2.4624, 42.5871], [-2.4519, 42.5676], [-2.4416, 42.5764], [-2.4301, 42.5953], [-2.4179, 42.6064], [-2.4075, 42.5984], [-2.3962, 42.5979], [-2.399, 42.5886], [-2.3902, 42.5596], [-2.3907, 42.5484], [-2.4004, 42.538], [-2.3927, 42.522], [-2.3945, 42.5158], [-2.4111, 42.5151], [-2.4227, 42.51], [-2.4218, 42.4892], [-2.4368, 42.4888], [-2.4474, 42.4959], [-2.4725, 42.4917], [-2.4772, 42.486], [-2.5148, 42.49], [-2.519, 42.4942], [-2.5054, 42.513], [-2.5132, 42.5186], [-2.52, 42.5069], [-2.5382, 42.4954], [-2.5315, 42.4834], [-2.5545, 42.4836], [-2.5659, 42.4927], [-2.5779, 42.483], [-2.5884, 42.4831], [-2.5951, 42.4722], [-2.6027, 42.481], [-2.5929, 42.4924], [-2.6054, 42.5028], [-2.6106, 42.4958], [-2.6287, 42.4956], [-2.6396, 42.4843], [-2.6494, 42.4849], [-2.6569, 42.503], [-2.6674, 42.5096], [-2.6794, 42.511], [-2.6873, 42.5201], [-2.7061, 42.5169], [-2.6929, 42.5406], [-2.6878, 42.5591], [-2.6859, 42.5865], [-2.683, 42.5951], [-2.7095, 42.6004], [-2.7216, 42.6072], [-2.7313, 42.6171], [-2.7506, 42.6233], [-2.7648, 42.6221], [-2.7744, 42.6054], [-2.7729, 42.5935], [-2.7799, 42.58], [-2.7995, 42.572], [-2.8153, 42.5686], [-2.8192, 42.5556], [-2.8383, 42.5701], [-2.8414, 42.5811], [-2.8258, 42.5868], [-2.8182, 42.5962], [-2.8241, 42.6019], [-2.8219, 42.6141], [-2.8426, 42.6082], [-2.8484, 42.6161], [-2.8434, 42.6245], [-2.8463, 42.6316], [-2.8583, 42.6378], [-2.8707, 42.6382], [-2.8968, 42.6541], [-2.8998, 42.6673], [-2.8958, 42.6787], [-2.9027, 42.6837], [-2.9027, 42.6928], [-2.9292, 42.6995], [-2.9305, 42.707], [-2.9549, 42.7094], [-2.987, 42.7081], [-2.9893, 42.718], [-3.0063, 42.7222], [-3.0171, 42.7365], [-3.0422, 42.7387], [-3.0496, 42.7499], [-3.0488, 42.7646], [-3.065, 42.7596], [-3.0807, 42.7654], [-3.1017, 42.7663], [-3.116, 42.759], [-3.145, 42.7566], [-3.1376, 42.765], [-3.124, 42.7886], [-3.1335, 42.7904], [-3.1579, 42.804], [-3.1484, 42.8127], [-3.141, 42.8351], [-3.1289, 42.8408], [-3.1137, 42.8612], [-3.1055, 42.8792], [-3.112, 42.8883], [-3.1239, 42.8918], [-3.1496, 42.8604], [-3.1569, 42.857], [-3.1724, 42.8578], [-3.1912, 42.8693], [-3.21, 42.8443], [-3.2214, 42.8389], [-3.206, 42.8277], [-3.2231, 42.828], [-3.2831, 42.8758], [-3.2862, 42.8854], [-3.2771, 42.887], [-3.278, 42.9008], [-3.2497, 42.9125], [-3.2488, 42.921], [-3.2363, 42.9341], [-3.2359, 42.9437], [-3.2272, 42.9494], [-3.1839, 42.9445], [-3.1466, 42.9345], [-3.1493, 42.9191], [-3.1319, 42.9134], [-3.1264, 42.9042], [-3.1089, 42.9063], [-3.0937, 42.8999], [-3.0605, 42.9024], [-3.0202, 42.9086], [-3.0149, 42.9173], [-3.0033, 42.927], [-2.9967, 42.927], [-2.9807, 42.9386], [-2.9927, 42.9507], [-3.013, 42.9525], [-3.0201, 42.9602], [-3.0424, 42.9705], [-3.0377, 42.9812], [-3.0575, 42.9959], [-3.0622, 43.0029], [-3.0767, 43.0076], [-3.0882, 43.0018], [-3.1296, 43.0074], [-3.1458, 43.007], [-3.1735, 43.0184], [-3.17, 43.0283], [-3.1438, 43.0278], [-3.1471, 43.035], [-3.1414, 43.0672], [-3.1568, 43.0719], [-3.1352, 43.0973], [-3.1426, 43.1096], [-3.1533, 43.1043], [-3.1799, 43.1149], [-3.1807, 43.1229], [-3.1623, 43.143], [-3.1611, 43.1549], [-3.1426, 43.1613], [-3.1431, 43.1674], [-3.1569, 43.1779], [-3.1668, 43.1786], [-3.1842, 43.1706], [-3.1971, 43.1723], [-3.2063, 43.1803], [-3.2212, 43.1727], [-3.2378, 43.1898], [-3.2488, 43.198], [-3.2774, 43.1953], [-3.2778, 43.1912], [-3.2952, 43.1839], [-3.3099, 43.1737], [-3.3318, 43.1665], [-3.3389, 43.1682], [-3.3471, 43.1573], [-3.368, 43.1525], [-3.3869, 43.1414], [-3.4164, 43.1348], [-3.4201, 43.1503], [-3.4296, 43.1667], [-3.4328, 43.1818], [-3.4333, 43.2102], [-3.44, 43.2177], [-3.4482, 43.2367], [-3.4365, 43.2358], [-3.4307, 43.2419], [-3.4131, 43.2435], [-3.4107, 43.2507], [-3.3983, 43.2467], [-3.3918, 43.2516], [-3.3885, 43.2631], [-3.3816, 43.2707], [-3.3663, 43.2752], [-3.3592, 43.2729], [-3.338, 43.2785], [-3.3398, 43.2947], [-3.3308, 43.301], [-3.3215, 43.293], [-3.2938, 43.3008], [-3.2886, 43.2905], [-3.2781, 43.2903], [-3.2517, 43.2984], [-3.2454, 43.3049], [-3.2244, 43.3091], [-3.2235, 43.2974], [-3.2176, 43.2875], [-3.2037, 43.291], [-3.1883, 43.2993], [-3.1567, 43.3019], [-3.1512, 43.3074], [-3.1504, 43.3248], [-3.1561, 43.3382], [-3.1486, 43.3483], [-3.1525, 43.354], [-3.132, 43.353], [-3.1186, 43.3479], [-3.106, 43.3648], [-3.0924, 43.3624], [-3.0781, 43.353], [-3.0457, 43.3395], [-3.0186, 43.3263], [-3.0113, 43.3345], [-3.0124, 43.3491], [-3.0167, 43.3586], [-3.032, 43.3683], [-3.0351, 43.3747], [-3.0054, 43.3826], [-2.9729, 43.4049], [-2.9685, 43.4135], [-2.9574, 43.416], [-2.9454, 43.4366], [-2.9026, 43.4389], [-2.8954, 43.4353], [-2.8788, 43.4373], [-2.8657, 43.4314], [-2.8337, 43.432], [-2.8226, 43.4354], [-2.8048, 43.4315], [-2.7868, 43.4447], [-2.7613, 43.45], [-2.7522, 43.4573], [-2.7385, 43.4306], [-2.7205, 43.4274], [-2.7173, 43.4192], [-2.7009, 43.4159], [-2.691, 43.4072], [-2.6776, 43.4125], [-2.6612, 43.4104], [-2.6487, 43.4167], [-2.6356, 43.413], [-2.6342, 43.4029], [-2.617, 43.3926], [-2.6004, 43.3955], [-2.5808, 43.3866], [-2.5617, 43.3917], [-2.5487, 43.3747], [-2.5092, 43.3779], [-2.5007, 43.3648], [-2.4898, 43.3652], [-2.4609, 43.3371], [-2.4349, 43.3347], [-2.4233, 43.3311], [-2.4123, 43.3224], [-2.4008, 43.3232], [-2.3674, 43.3071], [-2.3443, 43.3045], [-2.3277, 43.2985], [-2.3073, 43.2996], [-2.2831, 43.2966], [-2.2491, 43.303], [-2.2405, 43.3098], [-2.2285, 43.3127], [-2.2168, 43.3106], [-2.1929, 43.3005], [-2.1763, 43.2887], [-2.1415, 43.2941], [-2.131, 43.2899], [-2.1083, 43.3026], [-2.0704, 43.3121], [-2.0495, 43.3144], [-2.0229, 43.3227], [-2.0093, 43.3246], [-2.0028, 43.3177], [-1.9876, 43.3182], [-1.9729, 43.3276], [-1.9619, 43.3383], [-1.9443, 43.3345], [-1.9164, 43.3367], [-1.8868, 43.3486], [-1.879, 43.3542], [-1.8702, 43.3687], [-1.8331, 43.3836], [-1.7887, 43.3894], [-1.7923, 43.3702], [-1.7881, 43.3644], [-1.7914, 43.3511], [-1.7694, 43.3422], [-1.7534, 43.3409], [-1.7527, 43.3335], [-1.7375, 43.3304], [-1.7416, 43.3166], [-1.7318, 43.2992]]], [[[-3.2832, 43.1998], [-3.294, 43.2061], [-3.2918, 43.2194], [-3.296, 43.2238], [-3.2915, 43.2399], [-3.3053, 43.254], [-3.3035, 43.2596], [-3.2785, 43.2633], [-3.2652, 43.2676], [-3.248, 43.2606], [-3.2505, 43.2487], [-3.268, 43.2325], [-3.2703, 43.2199], [-3.2644, 43.2079], [-3.2832, 43.1998]]], [[[-2.8331, 42.7937], [-2.8236, 42.7854], [-2.7993, 42.7914], [-2.7396, 42.7918], [-2.7319, 42.7932], [-2.709, 42.7824], [-2.6919, 42.7783], [-2.6783, 42.7791], [-2.6693, 42.7728], [-2.6551, 42.7718], [-2.6513, 42.7666], [-2.6344, 42.7646], [-2.6263, 42.7694], [-2.6037, 42.77], [-2.5924, 42.7583], [-2.5896, 42.7502], [-2.559, 42.7624], [-2.563, 42.7405], [-2.5743, 42.7237], [-2.589, 42.7111], [-2.6002, 42.7149], [-2.6079, 42.707], [-2.6089, 42.6963], [-2.5938, 42.6894], [-2.5793, 42.6735], [-2.5491, 42.6693], [-2.5392, 42.6858], [-2.5227, 42.6836], [-2.524, 42.6671], [-2.5175, 42.6571], [-2.5168, 42.6473], [-2.5382, 42.6396], [-2.5481, 42.6385], [-2.5515, 42.6488], [-2.5646, 42.6443], [-2.5834, 42.6513], [-2.6003, 42.6509], [-2.6142, 42.6471], [-2.6355, 42.6472], [-2.6519, 42.6605], [-2.6546, 42.6699], [-2.6663, 42.6668], [-2.6882, 42.6727], [-2.7041, 42.6736], [-2.7147, 42.6688], [-2.7181, 42.6616], [-2.7362, 42.6621], [-2.7486, 42.6653], [-2.7674, 42.6657], [-2.7697, 42.6748], [-2.7849, 42.6978], [-2.7949, 42.6979], [-2.8123, 42.7062], [-2.8241, 42.7081], [-2.8292, 42.7178], [-2.8437, 42.7236], [-2.8612, 42.7451], [-2.851, 42.7516], [-2.8537, 42.7659], [-2.8388, 42.7809], [-2.8331, 42.7937]]]] }, "properties": { "name": "Paรญs Vasco", "id": "ES-PV", "CNTRY": "Spain", "TYPE": "Autonomous Community" }, "id": "ES-PV" }, { "type": "Feature", "geometry": { "type": "MultiPolygon", "coordinates": [[[[1.5369, 39.1185], [1.5451, 39.1071], [1.559, 39.0946], [1.5826, 39.0991], [1.6057, 39.0905], [1.593, 39.0765], [1.5898, 39.064], [1.5966, 39.053], [1.6194, 39.038], [1.6072, 39.0302], [1.5953, 39.0162], [1.5839, 39.0102], [1.5816, 38.9946], [1.5596, 38.9933], [1.5399, 38.9872], [1.5317, 38.9791], [1.5341, 38.9689], [1.5304, 38.9613], [1.5301, 38.9464], [1.5119, 38.9481], [1.5064, 38.9345], [1.4912, 38.93], [1.4803, 38.9167], [1.4708, 38.9139], [1.4601, 38.9192], [1.4515, 38.9131], [1.4408, 38.9177], [1.4367, 38.9035], [1.4245, 38.9062], [1.4116, 38.8935], [1.4063, 38.8818], [1.4073, 38.8677], [1.4035, 38.8454], [1.386, 38.8438], [1.3818, 38.8357], [1.3697, 38.8365], [1.3713, 38.8454], [1.3615, 38.8622], [1.3456, 38.8717], [1.3299, 38.868], [1.3066, 38.8689], [1.2997, 38.8765], [1.2733, 38.8801], [1.2469, 38.8581], [1.2442, 38.8678], [1.2247, 38.8792], [1.2271, 38.8891], [1.2151, 38.8985], [1.2215, 38.9238], [1.2372, 38.9405], [1.2158, 38.9583], [1.2339, 38.9698], [1.2524, 38.9681], [1.2772, 38.9715], [1.2842, 38.9751], [1.3014, 38.9697], [1.2971, 38.9864], [1.2844, 38.9995], [1.2935, 39.0031], [1.2958, 39.0203], [1.2923, 39.0293], [1.3108, 39.0434], [1.3265, 39.0493], [1.3279, 39.0546], [1.3425, 39.0545], [1.3481, 39.0648], [1.3575, 39.0698], [1.3766, 39.0635], [1.3895, 39.0806], [1.3985, 39.0816], [1.407, 39.0766], [1.4182, 39.079], [1.421, 39.0905], [1.4279, 39.0936], [1.4384, 39.0877], [1.4486, 39.0901], [1.4533, 39.0978], [1.468, 39.1009], [1.4747, 39.106], [1.4983, 39.0994], [1.5097, 39.104], [1.5071, 39.1121], [1.5151, 39.1178], [1.5369, 39.1185]]], [[[1.4405, 38.7488], [1.449, 38.7336], [1.4583, 38.7262], [1.4729, 38.7207], [1.4809, 38.7125], [1.4812, 38.7038], [1.4921, 38.6937], [1.5072, 38.6841], [1.5313, 38.6742], [1.5418, 38.6817], [1.565, 38.6933], [1.5701, 38.6931], [1.5834, 38.6797], [1.5861, 38.6642], [1.5745, 38.6527], [1.5257, 38.6541], [1.5038, 38.6713], [1.4781, 38.6832], [1.4596, 38.6867], [1.4443, 38.6854], [1.4276, 38.6672], [1.4084, 38.6495], [1.396, 38.6421], [1.3852, 38.6486], [1.3884, 38.6694], [1.3823, 38.6939], [1.3913, 38.7013], [1.3879, 38.7228], [1.3974, 38.732], [1.407, 38.7293], [1.4242, 38.7348], [1.4331, 38.7459], [1.4405, 38.7488]]], [[[1.4237, 38.7983], [1.4325, 38.787], [1.4185, 38.7862], [1.4237, 38.7983]]], [[[3.2133, 39.9598], [3.2035, 39.9443], [3.1791, 39.9375], [3.1562, 39.9237], [3.1367, 39.9284], [3.1284, 39.9171], [3.1217, 39.9154], [3.1126, 39.9052], [3.0933, 39.9116], [3.0811, 39.9011], [3.0802, 39.8882], [3.0925, 39.8665], [3.1017, 39.8597], [3.126, 39.8642], [3.1335, 39.8702], [3.1419, 39.8655], [3.1742, 39.8786], [3.1955, 39.8933], [3.202, 39.8874], [3.1863, 39.8716], [3.1882, 39.8638], [3.1976, 39.8612], [3.1808, 39.8422], [3.1473, 39.8349], [3.1345, 39.8419], [3.1239, 39.835], [3.1209, 39.8118], [3.1302, 39.7912], [3.1421, 39.7781], [3.1557, 39.7684], [3.1866, 39.7556], [3.214, 39.7419], [3.2358, 39.7337], [3.2546, 39.7303], [3.2899, 39.7459], [3.302, 39.7489], [3.3082, 39.7551], [3.3259, 39.7589], [3.3365, 39.7705], [3.3361, 39.7849], [3.3474, 39.7903], [3.3617, 39.7797], [3.3709, 39.7769], [3.3758, 39.7691], [3.3867, 39.765], [3.4057, 39.765], [3.4155, 39.7538], [3.4279, 39.7525], [3.4348, 39.7459], [3.452, 39.7446], [3.4628, 39.7394], [3.4535, 39.7294], [3.4548, 39.7229], [3.4765, 39.7213], [3.4713, 39.7134], [3.4575, 39.7056], [3.4544, 39.6555], [3.4425, 39.6576], [3.4355, 39.6337], [3.4063, 39.637], [3.395, 39.6229], [3.3951, 39.6143], [3.3866, 39.6008], [3.3893, 39.5871], [3.3999, 39.584], [3.3975, 39.5767], [3.3798, 39.5765], [3.3762, 39.5612], [3.3672, 39.5512], [3.3413, 39.5408], [3.2976, 39.5002], [3.2946, 39.4861], [3.2853, 39.4707], [3.28, 39.452], [3.2782, 39.4245], [3.2667, 39.4251], [3.2609, 39.418], [3.2645, 39.4093], [3.2548, 39.4008], [3.2559, 39.3953], [3.2492, 39.3828], [3.2349, 39.3639], [3.2262, 39.3572], [3.2169, 39.3582], [3.2047, 39.3512], [3.1939, 39.3518], [3.1874, 39.3355], [3.1729, 39.3273], [3.1426, 39.3264], [3.1438, 39.3223], [3.1312, 39.3143], [3.1193, 39.3131], [3.1114, 39.3035], [3.0756, 39.2711], [3.0549, 39.265], [3.0437, 39.2793], [3.0316, 39.2833], [3.0189, 39.2959], [3.0145, 39.3105], [2.9942, 39.3128], [2.9848, 39.3221], [2.9921, 39.3318], [2.9904, 39.3387], [2.9779, 39.3518], [2.9565, 39.3635], [2.9501, 39.3617], [2.9308, 39.3647], [2.9064, 39.358], [2.8891, 39.3648], [2.8565, 39.3635], [2.8452, 39.3665], [2.8302, 39.3569], [2.8192, 39.3593], [2.808, 39.3677], [2.7885, 39.3634], [2.7736, 39.3817], [2.7545, 39.3932], [2.7396, 39.4129], [2.7478, 39.4377], [2.7407, 39.4549], [2.7305, 39.4638], [2.7226, 39.4771], [2.7355, 39.4859], [2.738, 39.4943], [2.7513, 39.5024], [2.7438, 39.5183], [2.7285, 39.5315], [2.7104, 39.5358], [2.6925, 39.5484], [2.6904, 39.5529], [2.6729, 39.5609], [2.6448, 39.5664], [2.6297, 39.5655], [2.6288, 39.5538], [2.6208, 39.5459], [2.6094, 39.5527], [2.6, 39.5507], [2.5907, 39.5344], [2.5628, 39.5328], [2.5555, 39.5277], [2.5402, 39.5249], [2.541, 39.5103], [2.5373, 39.489], [2.5228, 39.4689], [2.5237, 39.4587], [2.5021, 39.462], [2.501, 39.4683], [2.4848, 39.4724], [2.4768, 39.4843], [2.4599, 39.4999], [2.46, 39.5105], [2.4677, 39.5202], [2.4665, 39.526], [2.4532, 39.5374], [2.4288, 39.5281], [2.4198, 39.5393], [2.4068, 39.5377], [2.4051, 39.527], [2.3911, 39.5226], [2.3845, 39.5427], [2.3729, 39.5449], [2.3536, 39.5649], [2.3506, 39.5796], [2.3454, 39.588], [2.3483, 39.5959], [2.3564, 39.5972], [2.3571, 39.6058], [2.3697, 39.6151], [2.3862, 39.6148], [2.4122, 39.6293], [2.4225, 39.6313], [2.4238, 39.6394], [2.4482, 39.6501], [2.4629, 39.6535], [2.472, 39.6595], [2.4845, 39.6734], [2.5094, 39.6918], [2.5176, 39.6924], [2.5299, 39.7033], [2.5428, 39.7006], [2.5569, 39.7021], [2.5745, 39.7133], [2.5905, 39.7208], [2.6013, 39.7349], [2.6238, 39.7498], [2.6384, 39.767], [2.6469, 39.7638], [2.6672, 39.7778], [2.6703, 39.7944], [2.6803, 39.8006], [2.6912, 39.7958], [2.6964, 39.808], [2.7429, 39.8342], [2.7494, 39.8297], [2.7766, 39.8421], [2.7752, 39.8524], [2.7927, 39.8583], [2.8036, 39.8544], [2.8104, 39.8602], [2.8263, 39.8583], [2.84, 39.8674], [2.8468, 39.8622], [2.8551, 39.875], [2.8759, 39.879], [2.8907, 39.8921], [2.9066, 39.8989], [2.9192, 39.8975], [2.933, 39.9031], [2.9519, 39.9214], [2.9682, 39.9109], [2.9845, 39.9097], [3.0028, 39.925], [3.0321, 39.9361], [3.0456, 39.9312], [3.0629, 39.9338], [3.0575, 39.9238], [3.0748, 39.9236], [3.1003, 39.9369], [3.1208, 39.9328], [3.1326, 39.9395], [3.1336, 39.9453], [3.1518, 39.9561], [3.1792, 39.9623], [3.1821, 39.9525], [3.2133, 39.9598]]], [[[2.9548, 39.1652], [2.9679, 39.1639], [2.9716, 39.1502], [2.9561, 39.1364], [2.9483, 39.126], [2.9263, 39.1332], [2.9257, 39.1397], [2.915, 39.1451], [2.9221, 39.1526], [2.9323, 39.1442], [2.9386, 39.1571], [2.9506, 39.1498], [2.9548, 39.1652]]], [[[4.169, 39.8497], [4.1462, 39.8624], [4.1188, 39.8709], [4.099, 39.8791], [4.0877, 39.8863], [4.08, 39.8964], [4.0271, 39.9208], [4.0141, 39.9206], [3.9792, 39.9318], [3.9497, 39.934], [3.9391, 39.9388], [3.9077, 39.9245], [3.8559, 39.9222], [3.846, 39.9263], [3.8236, 39.9244], [3.8268, 39.9529], [3.8359, 39.9612], [3.8314, 39.9705], [3.8351, 39.98], [3.8313, 39.9941], [3.8137, 39.9967], [3.8087, 40.0012], [3.7966, 40.001], [3.798, 40.0099], [3.7939, 40.0207], [3.81, 40.0263], [3.828, 40.0533], [3.8545, 40.0557], [3.8815, 40.0536], [3.8857, 40.0589], [3.9005, 40.0602], [3.9114, 40.0492], [3.9236, 40.0464], [3.9279, 40.0572], [3.9357, 40.0634], [3.9441, 40.0569], [3.9603, 40.0616], [3.9807, 40.0515], [3.9959, 40.0593], [4.017, 40.0569], [4.0307, 40.0626], [4.0406, 40.062], [4.0509, 40.0527], [4.0611, 40.0592], [4.0781, 40.0597], [4.0862, 40.0746], [4.0981, 40.0684], [4.1046, 40.0458], [4.1124, 40.055], [4.1353, 40.0571], [4.1271, 40.0435], [4.1245, 40.0307], [4.143, 40.0382], [4.1432, 40.0575], [4.1388, 40.0673], [4.1572, 40.0686], [4.17, 40.0612], [4.1659, 40.0561], [4.1743, 40.0248], [4.1949, 40.0241], [4.2043, 40.0193], [4.2213, 39.9973], [4.2332, 39.9995], [4.2532, 39.999], [4.2615, 39.9879], [4.2615, 39.9752], [4.2575, 39.966], [4.2712, 39.9598], [4.2715, 39.952], [4.2819, 39.95], [4.2763, 39.9331], [4.2877, 39.9221], [4.2871, 39.913], [4.2955, 39.9096], [4.3, 39.8975], [4.3068, 39.8976], [4.3098, 39.8803], [4.2872, 39.8915], [4.286, 39.885], [4.2982, 39.8812], [4.3084, 39.8657], [4.3015, 39.84], [4.3042, 39.8356], [4.2973, 39.8235], [4.2821, 39.8121], [4.2736, 39.8095], [4.2387, 39.8164], [4.2222, 39.8265], [4.2081, 39.8293], [4.1845, 39.8391], [4.169, 39.8497]]], [[[2.3321, 39.5882], [2.32, 39.5775], [2.3097, 39.5834], [2.3257, 39.5942], [2.3321, 39.5882]]]] }, "properties": { "name": "Islas Baleares", "id": "ES-IB", "CNTRY": "Spain", "TYPE": "Autonomous Community" }, "id": "ES-IB" }, { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [[[-0.7244, 42.9195], [-0.7413, 42.9183], [-0.7514, 42.9243], [-0.782, 42.9215], [-0.8007, 42.907], [-0.8163, 42.9023], [-0.8153, 42.8761], [-0.8196, 42.8681], [-0.8391, 42.8595], [-0.8475, 42.8484], [-0.856, 42.8468], [-0.8572, 42.8342], [-0.8516, 42.8081], [-0.8603, 42.7991], [-0.8508, 42.7935], [-0.8483, 42.7839], [-0.865, 42.763], [-0.8732, 42.7591], [-0.8927, 42.763], [-0.9006, 42.7607], [-0.9028, 42.7427], [-0.9233, 42.7437], [-0.936, 42.7349], [-0.9494, 42.7117], [-0.9614, 42.7115], [-0.9696, 42.7037], [-1.0038, 42.6995], [-1.0175, 42.7024], [-1.0401, 42.6911], [-1.0339, 42.675], [-1.0406, 42.6635], [-1.0408, 42.6472], [-1.0555, 42.6422], [-1.0704, 42.641], [-1.0847, 42.6465], [-1.1124, 42.6457], [-1.1531, 42.6483], [-1.1557, 42.6412], [-1.1576, 42.6114], [-1.1708, 42.6171], [-1.1789, 42.607], [-1.16, 42.6004], [-1.1966, 42.579], [-1.2048, 42.5722], [-1.2037, 42.5488], [-1.2168, 42.5491], [-1.2299, 42.542], [-1.2653, 42.5565], [-1.2888, 42.5229], [-1.2874, 42.4986], [-1.276, 42.4953], [-1.2738, 42.481], [-1.2817, 42.4644], [-1.2932, 42.4546], [-1.3164, 42.4482], [-1.3412, 42.4236], [-1.3433, 42.4116], [-1.3528, 42.3865], [-1.3591, 42.3767], [-1.3511, 42.3699], [-1.3351, 42.3705], [-1.3301, 42.3601], [-1.3337, 42.3477], [-1.3537, 42.338], [-1.365, 42.3285], [-1.3869, 42.3016], [-1.3994, 42.2895], [-1.3921, 42.2736], [-1.4008, 42.2557], [-1.4013, 42.2431], [-1.4155, 42.2236], [-1.4183, 42.2112], [-1.4143, 42.2012], [-1.3969, 42.1903], [-1.3927, 42.1805], [-1.3985, 42.1584], [-1.3943, 42.1477], [-1.4005, 42.1304], [-1.3983, 42.1242], [-1.3675, 42.106], [-1.3652, 42.091], [-1.3529, 42.0728], [-1.346, 42.0708], [-1.3288, 42.0734], [-1.312, 42.0731], [-1.3128, 42.0636], [-1.3049, 42.0514], [-1.3079, 42.041], [-1.3315, 42.0254], [-1.3634, 41.984], [-1.373, 41.9621], [-1.384, 41.9571], [-1.3804, 41.9435], [-1.3965, 41.9382], [-1.4085, 41.9188], [-1.4169, 41.9135], [-1.455, 41.9158], [-1.4724, 41.9239], [-1.5007, 41.9231], [-1.5045, 41.9165], [-1.5221, 41.9102], [-1.556, 41.9139], [-1.5697, 41.9171], [-1.5958, 41.9268], [-1.6116, 41.9486], [-1.6418, 41.9579], [-1.6547, 41.9643], [-1.6593, 41.96], [-1.674, 41.9657], [-1.6868, 41.9527], [-1.7147, 41.9557], [-1.7328, 41.9622], [-1.7671, 41.9937], [-1.7779, 41.9938], [-1.7944, 41.9883], [-1.8133, 41.9959], [-1.8358, 41.993], [-1.8462, 42.008], [-1.859, 42.0051], [-1.8646, 42.0142], [-1.8719, 42.0136], [-1.8844, 42.0273], [-1.8922, 42.0261], [-1.9015, 42.0323], [-1.9073, 42.0583], [-1.9004, 42.0771], [-1.8938, 42.0849], [-1.8618, 42.1088], [-1.8515, 42.1217], [-1.8393, 42.1297], [-1.8385, 42.1436], [-1.8209, 42.1533], [-1.8024, 42.147], [-1.7968, 42.1408], [-1.7847, 42.1381], [-1.7653, 42.1499], [-1.7447, 42.1504], [-1.7284, 42.144], [-1.719, 42.133], [-1.6815, 42.151], [-1.6943, 42.1584], [-1.7008, 42.1703], [-1.6955, 42.1813], [-1.6813, 42.1882], [-1.685, 42.1938], [-1.7038, 42.1939], [-1.7071, 42.2086], [-1.7324, 42.2144], [-1.7433, 42.213], [-1.7652, 42.2217], [-1.7717, 42.2148], [-1.7823, 42.2262], [-1.8024, 42.224], [-1.8148, 42.228], [-1.8271, 42.244], [-1.8508, 42.2587], [-1.8541, 42.2495], [-1.8722, 42.252], [-1.8761, 42.2595], [-1.8666, 42.2704], [-1.8658, 42.2827], [-1.8946, 42.2905], [-1.9154, 42.3002], [-1.91, 42.3119], [-1.9199, 42.3155], [-1.9193, 42.3271], [-1.9321, 42.3213], [-1.9405, 42.333], [-1.9673, 42.3355], [-1.9649, 42.3431], [-1.9723, 42.3528], [-1.9987, 42.3629], [-2.0085, 42.3618], [-2.0183, 42.3685], [-2.0444, 42.3581], [-2.0516, 42.351], [-2.0689, 42.3429], [-2.0883, 42.3461], [-2.0889, 42.3569], [-2.0793, 42.368], [-2.0928, 42.3756], [-2.0885, 42.3814], [-2.1165, 42.3988], [-2.1048, 42.4144], [-2.1102, 42.4192], [-2.1357, 42.4209], [-2.1583, 42.4102], [-2.1752, 42.4073], [-2.1858, 42.4175], [-2.1961, 42.4183], [-2.2073, 42.414], [-2.2169, 42.4239], [-2.2313, 42.4246], [-2.2413, 42.4297], [-2.239, 42.44], [-2.264, 42.449], [-2.277, 42.4471], [-2.2869, 42.4649], [-2.2945, 42.4587], [-2.3174, 42.461], [-2.3277, 42.468], [-2.3362, 42.4649], [-2.3325, 42.4534], [-2.3482, 42.4521], [-2.3529, 42.4642], [-2.3686, 42.4618], [-2.3771, 42.472], [-2.386, 42.4698], [-2.3998, 42.4725], [-2.4154, 42.4891], [-2.4218, 42.4892], [-2.4227, 42.51], [-2.4111, 42.5151], [-2.3945, 42.5158], [-2.3927, 42.522], [-2.4004, 42.538], [-2.3907, 42.5484], [-2.3902, 42.5596], [-2.399, 42.5886], [-2.3962, 42.5979], [-2.4075, 42.5984], [-2.4179, 42.6064], [-2.4301, 42.5953], [-2.4416, 42.5764], [-2.4519, 42.5676], [-2.4624, 42.5871], [-2.4901, 42.5863], [-2.4989, 42.6158], [-2.4837, 42.6121], [-2.4708, 42.6262], [-2.4649, 42.6269], [-2.4509, 42.6462], [-2.4149, 42.6618], [-2.3946, 42.6603], [-2.3832, 42.6559], [-2.3728, 42.6438], [-2.3755, 42.6375], [-2.346, 42.6338], [-2.3331, 42.6445], [-2.3099, 42.6527], [-2.2966, 42.6505], [-2.2881, 42.6556], [-2.2935, 42.6771], [-2.3043, 42.67], [-2.3108, 42.6715], [-2.3142, 42.7013], [-2.3132, 42.7084], [-2.3231, 42.7197], [-2.3164, 42.7385], [-2.3043, 42.7353], [-2.2855, 42.7424], [-2.2731, 42.7433], [-2.2657, 42.7526], [-2.2728, 42.7658], [-2.2791, 42.7878], [-2.2688, 42.7938], [-2.2702, 42.8088], [-2.2373, 42.8323], [-2.232, 42.8433], [-2.24, 42.8649], [-2.242, 42.8861], [-2.2375, 42.8959], [-2.238, 42.9196], [-2.2308, 42.9312], [-2.2208, 42.9322], [-2.2094, 42.9489], [-2.1924, 42.9484], [-2.1801, 42.9346], [-2.1648, 42.9353], [-2.156, 42.9413], [-2.1269, 42.9395], [-2.1036, 42.9477], [-2.0947, 42.97], [-2.0864, 42.9747], [-2.0528, 42.9754], [-2.0389, 42.9799], [-2.0281, 42.9975], [-2.0394, 43.0168], [-2.0416, 43.0308], [-2.0317, 43.0342], [-2.0214, 43.0471], [-2.0187, 43.0562], [-2.0225, 43.0654], [-2.0135, 43.0727], [-1.9724, 43.0857], [-1.9699, 43.095], [-1.9483, 43.0973], [-1.9384, 43.1087], [-1.9228, 43.117], [-1.917, 43.1277], [-1.9034, 43.1351], [-1.9062, 43.1449], [-1.9212, 43.1527], [-1.9155, 43.1658], [-1.9227, 43.1765], [-1.9214, 43.1878], [-1.9131, 43.2012], [-1.9131, 43.2152], [-1.8905, 43.2082], [-1.8749, 43.2176], [-1.8546, 43.2165], [-1.8506, 43.2228], [-1.8239, 43.2287], [-1.8217, 43.2356], [-1.7951, 43.2451], [-1.7918, 43.268], [-1.7934, 43.2759], [-1.78, 43.2867], [-1.765, 43.2857], [-1.7465, 43.2923], [-1.7302, 43.2934], [-1.7318, 43.2992], [-1.7147, 43.3003], [-1.6943, 43.3126], [-1.6863, 43.3097], [-1.6693, 43.3152], [-1.6563, 43.3133], [-1.6445, 43.3069], [-1.6243, 43.3069], [-1.6225, 43.3018], [-1.6309, 43.2831], [-1.6161, 43.2558], [-1.5763, 43.2496], [-1.5695, 43.2552], [-1.5567, 43.28], [-1.5627, 43.2882], [-1.5351, 43.2938], [-1.5067, 43.293], [-1.4921, 43.28], [-1.4622, 43.2712], [-1.4375, 43.2663], [-1.4042, 43.2688], [-1.3825, 43.2519], [-1.3785, 43.2329], [-1.3848, 43.2216], [-1.3829, 43.1878], [-1.402, 43.1777], [-1.4039, 43.1614], [-1.416, 43.1485], [-1.41, 43.1434], [-1.4146, 43.1277], [-1.4246, 43.1243], [-1.4288, 43.1161], [-1.4427, 43.1112], [-1.4522, 43.1017], [-1.4622, 43.0988], [-1.4734, 43.0884], [-1.4676, 43.0735], [-1.4403, 43.0463], [-1.3542, 43.0286], [-1.3431, 43.0545], [-1.3442, 43.073], [-1.3403, 43.0814], [-1.3462, 43.0912], [-1.333, 43.107], [-1.3199, 43.1133], [-1.2908, 43.1158], [-1.2816, 43.1102], [-1.3001, 43.0924], [-1.31, 43.0696], [-1.2875, 43.0642], [-1.2701, 43.0549], [-1.2638, 43.044], [-1.247, 43.0431], [-1.2301, 43.0555], [-1.2148, 43.0524], [-1.1817, 43.0331], [-1.1737, 43.0379], [-1.1452, 43.0246], [-1.1428, 43.0082], [-1.1235, 43.0154], [-1.1149, 43.0242], [-1.1058, 43.016], [-1.0858, 43.0111], [-1.0861, 43.0029], [-1.0599, 42.9957], [-1.0404, 42.9955], [-1.0259, 42.9919], [-1.0167, 42.9943], [-1.0067, 42.989], [-0.9968, 42.9749], [-0.9848, 42.9719], [-0.9738, 42.9627], [-0.944, 42.9534], [-0.9238, 42.9543], [-0.9145, 42.9634], [-0.8986, 42.9607], [-0.8961, 42.9549], [-0.8836, 42.9556], [-0.86, 42.9507], [-0.8375, 42.9542], [-0.8091, 42.9512], [-0.7968, 42.9608], [-0.7753, 42.9646], [-0.7676, 42.9689], [-0.751, 42.9661], [-0.74, 42.9485], [-0.7305, 42.9454], [-0.7317, 42.9275], [-0.7244, 42.9195]]] }, "properties": { "name": "Navarra", "id": "ES-NC", "CNTRY": "Spain", "TYPE": "Autonomous Community" }, "id": "ES-NC" }, { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [[[-2.3395, 38.0258], [-2.3445, 38.0332], [-2.3306, 38.0599], [-2.3297, 38.0668], [-2.313, 38.0801], [-2.3005, 38.0839], [-2.2872, 38.0931], [-2.273, 38.1066], [-2.2668, 38.1081], [-2.2516, 38.1293], [-2.2524, 38.1377], [-2.2448, 38.1494], [-2.23, 38.163], [-2.2219, 38.1768], [-2.2217, 38.1836], [-2.2124, 38.2035], [-2.1928, 38.2132], [-2.1843, 38.2149], [-2.1712, 38.2245], [-2.14, 38.2305], [-2.1139, 38.2373], [-2.0989, 38.249], [-2.084, 38.2637], [-2.0789, 38.2761], [-2.0657, 38.2951], [-2.0475, 38.3057], [-2.0391, 38.3012], [-2.021, 38.2989], [-2.0064, 38.2865], [-1.9826, 38.2811], [-1.9637, 38.2869], [-1.9467, 38.289], [-1.9094, 38.2972], [-1.8933, 38.3023], [-1.8695, 38.3171], [-1.853, 38.3307], [-1.8399, 38.3349], [-1.8233, 38.3347], [-1.8119, 38.3511], [-1.7955, 38.3521], [-1.788, 38.3668], [-1.7711, 38.3652], [-1.7701, 38.3786], [-1.7611, 38.3773], [-1.7446, 38.3804], [-1.7242, 38.368], [-1.7063, 38.3707], [-1.6916, 38.3674], [-1.6828, 38.3595], [-1.6856, 38.3474], [-1.6922, 38.3443], [-1.6853, 38.3288], [-1.6732, 38.3215], [-1.6692, 38.3113], [-1.6298, 38.3086], [-1.6106, 38.3135], [-1.5897, 38.3107], [-1.5585, 38.3255], [-1.5477, 38.3335], [-1.5416, 38.3433], [-1.4787, 38.3762], [-1.4738, 38.4069], [-1.4773, 38.4233], [-1.4779, 38.4597], [-1.4805, 38.4838], [-1.4977, 38.5361], [-1.4876, 38.5631], [-1.4526, 38.5823], [-1.4491, 38.6153], [-1.4441, 38.6346], [-1.4487, 38.6495], [-1.4242, 38.6723], [-1.4203, 38.6783], [-1.3826, 38.6993], [-1.3668, 38.7034], [-1.3429, 38.6769], [-1.3322, 38.6809], [-1.3086, 38.6964], [-1.287, 38.7044], [-1.2643, 38.728], [-1.2375, 38.7416], [-1.2104, 38.7459], [-1.1821, 38.7539], [-1.14, 38.744], [-1.12, 38.7379], [-1.1164, 38.7106], [-1.0821, 38.6867], [-1.0707, 38.6806], [-1.0533, 38.6668], [-1.0345, 38.656], [-1.0267, 38.6556], [-1.0229, 38.639], [-1.0161, 38.6336], [-1.0123, 38.6059], [-1.0015, 38.5733], [-1.0173, 38.5358], [-1.0254, 38.5229], [-1.0138, 38.4963], [-1.0358, 38.4738], [-1.0686, 38.4482], [-1.0923, 38.4366], [-1.0848, 38.4284], [-1.0879, 38.4043], [-1.0892, 38.3657], [-1.0849, 38.3467], [-1.0568, 38.345], [-1.0321, 38.3395], [-1.0172, 38.334], [-0.9925, 38.3398], [-0.9784, 38.3371], [-0.9738, 38.3245], [-0.9594, 38.3051], [-0.9554, 38.2852], [-0.9564, 38.2682], [-0.9684, 38.2477], [-0.9783, 38.2106], [-0.998, 38.1766], [-1.0131, 38.1587], [-1.0274, 38.1468], [-1.0211, 38.1235], [-1.0213, 38.1017], [-1.0165, 38.0962], [-1.0149, 38.0828], [-0.9963, 38.0598], [-0.9874, 38.0556], [-0.954, 38.0133], [-0.9485, 38.0034], [-0.9449, 37.979], [-0.9293, 37.9587], [-0.9188, 37.9408], [-0.8883, 37.9104], [-0.8398, 37.8693], [-0.8291, 37.8631], [-0.8062, 37.859], [-0.784, 37.8448], [-0.7631, 37.8472], [-0.7631, 37.8376], [-0.7538, 37.8022], [-0.7538, 37.7866], [-0.7757, 37.8172], [-0.7976, 37.8106], [-0.8047, 37.7979], [-0.801, 37.783], [-0.8286, 37.7566], [-0.8417, 37.7533], [-0.8477, 37.7475], [-0.8522, 37.7319], [-0.8609, 37.7269], [-0.8574, 37.7141], [-0.8395, 37.6965], [-0.8277, 37.6784], [-0.801, 37.6572], [-0.7815, 37.6488], [-0.7724, 37.6476], [-0.7384, 37.6306], [-0.7234, 37.6359], [-0.7162, 37.6537], [-0.7013, 37.6334], [-0.7046, 37.6211], [-0.7162, 37.6048], [-0.7301, 37.5988], [-0.7804, 37.5912], [-0.7882, 37.5835], [-0.8015, 37.5817], [-0.8178, 37.5711], [-0.8402, 37.5739], [-0.8427, 37.5811], [-0.8673, 37.5727], [-0.8758, 37.566], [-0.9028, 37.5594], [-0.9166, 37.5499], [-0.936, 37.5555], [-0.9483, 37.5541], [-0.9509, 37.5697], [-0.9723, 37.5723], [-0.9764, 37.5789], [-0.9709, 37.5889], [-0.9742, 37.5936], [-0.9918, 37.5814], [-1.0031, 37.5816], [-1.0129, 37.5697], [-1.0313, 37.575], [-1.0544, 37.5785], [-1.0884, 37.5707], [-1.1001, 37.5627], [-1.107, 37.5641], [-1.1188, 37.5569], [-1.1256, 37.5469], [-1.1156, 37.54], [-1.1246, 37.5343], [-1.1508, 37.5343], [-1.1648, 37.5361], [-1.1742, 37.5451], [-1.1685, 37.5519], [-1.1866, 37.5665], [-1.2026, 37.5736], [-1.2445, 37.5762], [-1.2658, 37.56], [-1.285, 37.558], [-1.3132, 37.5621], [-1.3258, 37.5622], [-1.3311, 37.5565], [-1.3466, 37.554], [-1.3638, 37.5428], [-1.373, 37.531], [-1.3885, 37.5249], [-1.4, 37.5096], [-1.4212, 37.5018], [-1.44, 37.4975], [-1.4586, 37.4861], [-1.4645, 37.4799], [-1.4811, 37.4486], [-1.4836, 37.4352], [-1.4775, 37.4279], [-1.4858, 37.422], [-1.4973, 37.4222], [-1.5021, 37.4311], [-1.5184, 37.4306], [-1.5404, 37.4191], [-1.5472, 37.4109], [-1.5592, 37.411], [-1.5609, 37.4036], [-1.5755, 37.4068], [-1.6033, 37.3945], [-1.6118, 37.384], [-1.6246, 37.3798], [-1.6267, 37.3734], [-1.6618, 37.3976], [-1.7042, 37.4202], [-1.7353, 37.4414], [-1.7802, 37.4477], [-1.7947, 37.452], [-1.8115, 37.4515], [-1.8091, 37.434], [-1.8451, 37.4552], [-1.8617, 37.4825], [-1.871, 37.489], [-1.906, 37.5335], [-1.938, 37.5678], [-1.9561, 37.591], [-1.955, 37.5996], [-1.9658, 37.6043], [-1.978, 37.6198], [-1.9811, 37.6349], [-1.9878, 37.6442], [-2.0018, 37.6538], [-2.0119, 37.6722], [-2.0101, 37.6975], [-2.013, 37.7018], [-2.0076, 37.7197], [-1.9957, 37.7286], [-2.0018, 37.7443], [-2.0037, 37.7584], [-2.0095, 37.774], [-2.0013, 37.8095], [-1.9956, 37.8435], [-1.9918, 37.8499], [-1.9762, 37.861], [-1.9757, 37.8696], [-1.9947, 37.8794], [-2.006, 37.8797], [-2.022, 37.8682], [-2.0541, 37.8804], [-2.0731, 37.883], [-2.0851, 37.8731], [-2.0993, 37.8773], [-2.1223, 37.8996], [-2.1473, 37.8985], [-2.1558, 37.8917], [-2.1724, 37.8886], [-2.189, 37.9057], [-2.2241, 37.9246], [-2.2366, 37.928], [-2.2544, 37.9397], [-2.2592, 37.9496], [-2.2691, 37.9535], [-2.2836, 37.9676], [-2.2985, 37.9898], [-2.2988, 38.0032], [-2.3176, 38.0112], [-2.3395, 38.0258]]] }, "properties": { "name": "Murcia", "id": "ES-MC", "CNTRY": "Spain", "TYPE": "Autonomous Community" }, "id": "ES-MC" }, { "type": "Feature", "geometry": { "type": "MultiPolygon", "coordinates": [[[[-3.5389, 41.1637], [-3.5405, 41.1475], [-3.5293, 41.1387], [-3.5107, 41.1343], [-3.4905, 41.1033], [-3.4914, 41.0954], [-3.4768, 41.093], [-3.4501, 41.0798], [-3.4327, 41.0815], [-3.4257, 41.0724], [-3.4386, 41.0411], [-3.4311, 41.0395], [-3.4207, 41.0228], [-3.4069, 41.0132], [-3.396, 40.9994], [-3.416, 40.9872], [-3.415, 40.9756], [-3.4276, 40.959], [-3.434, 40.9458], [-3.4349, 40.9335], [-3.4466, 40.921], [-3.4509, 40.906], [-3.459, 40.9022], [-3.4396, 40.8906], [-3.4428, 40.8794], [-3.4733, 40.865], [-3.4656, 40.8567], [-3.473, 40.8491], [-3.4674, 40.8428], [-3.4778, 40.8378], [-3.4764, 40.8245], [-3.4915, 40.8083], [-3.4933, 40.798], [-3.5036, 40.7898], [-3.4863, 40.7851], [-3.4646, 40.7845], [-3.4523, 40.7759], [-3.4419, 40.7599], [-3.4469, 40.7331], [-3.4334, 40.7317], [-3.4367, 40.7214], [-3.4537, 40.7091], [-3.4606, 40.6986], [-3.4547, 40.6871], [-3.4408, 40.6748], [-3.4285, 40.6721], [-3.4185, 40.6792], [-3.414, 40.6714], [-3.4049, 40.6696], [-3.3993, 40.6905], [-3.3721, 40.6776], [-3.3673, 40.6478], [-3.3465, 40.6412], [-3.3408, 40.6365], [-3.3229, 40.6417], [-3.3286, 40.6202], [-3.3229, 40.6141], [-3.3295, 40.6072], [-3.3307, 40.5957], [-3.3085, 40.578], [-3.2899, 40.5716], [-3.2837, 40.5622], [-3.2826, 40.5513], [-3.2913, 40.5453], [-3.2967, 40.536], [-3.2717, 40.535], [-3.2576, 40.5415], [-3.2485, 40.5421], [-3.2399, 40.5344], [-3.2279, 40.5363], [-3.224, 40.5263], [-3.2047, 40.5175], [-3.2004, 40.5126], [-3.2039, 40.4982], [-3.1975, 40.4782], [-3.2019, 40.4674], [-3.1986, 40.4423], [-3.1736, 40.4373], [-3.1556, 40.4395], [-3.152, 40.4266], [-3.138, 40.4089], [-3.1308, 40.4051], [-3.1352, 40.3916], [-3.1431, 40.3858], [-3.1407, 40.3748], [-3.1527, 40.3683], [-3.144, 40.3537], [-3.1553, 40.3425], [-3.1521, 40.3343], [-3.1773, 40.316], [-3.1817, 40.3094], [-3.182, 40.2893], [-3.1857, 40.2689], [-3.1981, 40.2572], [-3.1956, 40.2482], [-3.1804, 40.2417], [-3.173, 40.2349], [-3.1602, 40.2534], [-3.1293, 40.2765], [-3.1125, 40.2864], [-3.0992, 40.2754], [-3.0983, 40.2619], [-3.0873, 40.2451], [-3.089, 40.2364], [-3.0809, 40.2295], [-3.0819, 40.2154], [-3.0792, 40.2051], [-3.0854, 40.2005], [-3.0854, 40.1862], [-3.0795, 40.178], [-3.0765, 40.1654], [-3.0892, 40.1627], [-3.0964, 40.1553], [-3.0959, 40.1412], [-3.0882, 40.1402], [-3.0732, 40.1309], [-3.0705, 40.1227], [-3.0535, 40.1056], [-3.0596, 40.094], [-3.0858, 40.0718], [-3.0926, 40.0682], [-3.1212, 40.0617], [-3.1489, 40.0661], [-3.1607, 40.0647], [-3.1669, 40.091], [-3.1787, 40.0915], [-3.1906, 40.0764], [-3.2061, 40.0636], [-3.2346, 40.0547], [-3.2552, 40.0572], [-3.274, 40.0475], [-3.2858, 40.0522], [-3.3017, 40.0529], [-3.3107, 40.067], [-3.3297, 40.0806], [-3.3438, 40.0809], [-3.358, 40.0758], [-3.3768, 40.0744], [-3.3796, 40.0678], [-3.3747, 40.0598], [-3.3772, 40.05], [-3.3928, 40.0461], [-3.3932, 40.0363], [-3.402, 40.0342], [-3.4174, 40.0445], [-3.4297, 40.0388], [-3.445, 40.0369], [-3.4559, 40.046], [-3.47, 40.0405], [-3.473, 40.0458], [-3.5106, 40.0455], [-3.5267, 40.0187], [-3.5525, 40.0183], [-3.5888, 40.0129], [-3.5941, 40.0015], [-3.6084, 39.9934], [-3.6321, 39.9877], [-3.6208, 39.9667], [-3.6502, 39.9644], [-3.6647, 39.9569], [-3.6817, 39.9536], [-3.6915, 39.9473], [-3.7042, 39.9534], [-3.7245, 39.9428], [-3.7391, 39.9391], [-3.7453, 39.9259], [-3.7627, 39.9151], [-3.7873, 39.8952], [-3.7996, 39.8876], [-3.8132, 39.8859], [-3.8336, 39.9001], [-3.8501, 39.9033], [-3.8589, 39.9012], [-3.8752, 39.9104], [-3.8683, 39.9192], [-3.8755, 39.9272], [-3.8557, 39.9392], [-3.838, 39.9425], [-3.8342, 39.9319], [-3.8273, 39.9324], [-3.8231, 39.945], [-3.8053, 39.9552], [-3.7965, 39.9478], [-3.7806, 39.9481], [-3.7738, 39.9577], [-3.7633, 39.9608], [-3.7624, 39.9476], [-3.7483, 39.9515], [-3.7432, 39.9633], [-3.7285, 39.9611], [-3.7358, 39.9806], [-3.7194, 39.988], [-3.712, 40.0099], [-3.6985, 40.0205], [-3.6862, 40.0142], [-3.6673, 40.0268], [-3.6676, 40.0334], [-3.6479, 40.0406], [-3.6388, 40.0404], [-3.6388, 40.05], [-3.63, 40.054], [-3.622, 40.0661], [-3.6225, 40.0723], [-3.6094, 40.0819], [-3.6032, 40.0926], [-3.6156, 40.0958], [-3.6074, 40.1084], [-3.6234, 40.1164], [-3.6393, 40.1188], [-3.6621, 40.13], [-3.6738, 40.141], [-3.6828, 40.133], [-3.6921, 40.133], [-3.7206, 40.1476], [-3.7405, 40.1341], [-3.7504, 40.1335], [-3.771, 40.1393], [-3.7781, 40.1464], [-3.7818, 40.1603], [-3.8069, 40.1776], [-3.8335, 40.1617], [-3.8525, 40.1693], [-3.8517, 40.1781], [-3.8658, 40.1877], [-3.8939, 40.1888], [-3.9143, 40.1913], [-3.9272, 40.2026], [-3.9393, 40.202], [-3.9433, 40.1952], [-3.9557, 40.1991], [-3.9535, 40.2131], [-3.9682, 40.2136], [-3.9863, 40.2088], [-3.9971, 40.2168], [-4.0061, 40.2187], [-4.0258, 40.2358], [-4.024, 40.2492], [-4.051, 40.2512], [-4.0725, 40.2657], [-4.0799, 40.2668], [-4.0877, 40.253], [-4.1025, 40.2424], [-4.1204, 40.244], [-4.1312, 40.2481], [-4.1427, 40.2455], [-4.1487, 40.25], [-4.1444, 40.2648], [-4.1642, 40.2695], [-4.1718, 40.2875], [-4.186, 40.2956], [-4.2052, 40.2864], [-4.217, 40.288], [-4.2281, 40.285], [-4.2331, 40.2745], [-4.244, 40.2744], [-4.259, 40.2579], [-4.2694, 40.2364], [-4.2851, 40.2283], [-4.2955, 40.2188], [-4.3052, 40.2212], [-4.3102, 40.2335], [-4.3204, 40.2247], [-4.3283, 40.2351], [-4.3409, 40.2398], [-4.3454, 40.2534], [-4.3574, 40.2716], [-4.358, 40.2927], [-4.3554, 40.3072], [-4.3774, 40.3177], [-4.3814, 40.3074], [-4.3827, 40.2881], [-4.3981, 40.2832], [-4.4078, 40.2737], [-4.4341, 40.2586], [-4.4335, 40.245], [-4.4367, 40.2371], [-4.452, 40.2325], [-4.4738, 40.2306], [-4.4867, 40.2246], [-4.5145, 40.2162], [-4.5176, 40.2044], [-4.5302, 40.1994], [-4.5448, 40.1995], [-4.5727, 40.2078], [-4.5791, 40.2164], [-4.5669, 40.2174], [-4.5598, 40.2279], [-4.5677, 40.24], [-4.5688, 40.2586], [-4.5568, 40.2648], [-4.5553, 40.278], [-4.5293, 40.2932], [-4.5375, 40.3109], [-4.5404, 40.3297], [-4.5477, 40.3402], [-4.5269, 40.3447], [-4.5144, 40.3285], [-4.5123, 40.321], [-4.502, 40.3156], [-4.4892, 40.321], [-4.4618, 40.3184], [-4.4548, 40.3198], [-4.4533, 40.3338], [-4.458, 40.3442], [-4.439, 40.3504], [-4.4427, 40.3852], [-4.4284, 40.4014], [-4.4142, 40.4114], [-4.4002, 40.4129], [-4.3808, 40.4084], [-4.3679, 40.409], [-4.3528, 40.4141], [-4.335, 40.4104], [-4.3285, 40.4121], [-4.3236, 40.4242], [-4.3398, 40.4298], [-4.3408, 40.4381], [-4.3206, 40.4517], [-4.3239, 40.4616], [-4.3158, 40.467], [-4.3236, 40.4792], [-4.3256, 40.4912], [-4.3224, 40.5039], [-4.3273, 40.5099], [-4.3215, 40.5206], [-4.3205, 40.5326], [-4.327, 40.535], [-4.3216, 40.5515], [-4.3088, 40.5592], [-4.2895, 40.5655], [-4.2827, 40.5973], [-4.2791, 40.6058], [-4.29, 40.609], [-4.2905, 40.6286], [-4.2715, 40.6289], [-4.2659, 40.6108], [-4.2596, 40.605], [-4.2466, 40.6033], [-4.2135, 40.6065], [-4.1617, 40.6238], [-4.1724, 40.6307], [-4.1677, 40.6443], [-4.1694, 40.6629], [-4.175, 40.6671], [-4.173, 40.6777], [-4.1609, 40.689], [-4.1441, 40.695], [-4.1406, 40.7101], [-4.1276, 40.7233], [-4.1141, 40.7422], [-4.097, 40.7487], [-4.0958, 40.7654], [-4.0811, 40.7763], [-4.0772, 40.7879], [-4.0701, 40.7932], [-4.0476, 40.7904], [-4.0419, 40.7842], [-4.0173, 40.7817], [-4.0057, 40.7877], [-3.9876, 40.7854], [-3.9786, 40.7872], [-3.9797, 40.7996], [-3.9662, 40.8123], [-3.9615, 40.8209], [-3.9655, 40.8348], [-3.9468, 40.8679], [-3.9433, 40.8891], [-3.9527, 40.8946], [-3.9383, 40.9149], [-3.9375, 40.9267], [-3.9213, 40.9292], [-3.919, 40.9412], [-3.8945, 40.9655], [-3.8778, 40.9754], [-3.8708, 40.9717], [-3.8605, 40.9783], [-3.8492, 40.9791], [-3.8293, 40.986], [-3.8109, 40.9871], [-3.7857, 41.001], [-3.7798, 41.002], [-3.7618, 41.0252], [-3.753, 41.0316], [-3.7399, 41.0494], [-3.7392, 41.0543], [-3.7129, 41.0712], [-3.6856, 41.0834], [-3.6765, 41.0835], [-3.6508, 41.1053], [-3.6439, 41.1191], [-3.6355, 41.1229], [-3.6313, 41.136], [-3.6114, 41.1479], [-3.5889, 41.1587], [-3.5696, 41.1578], [-3.555, 41.1636], [-3.5389, 41.1637]]], [[[-4.2741, 40.6753], [-4.268, 40.6739], [-4.2564, 40.6625], [-4.2567, 40.6518], [-4.2903, 40.653], [-4.3198, 40.6482], [-4.3241, 40.6588], [-4.3135, 40.6677], [-4.2895, 40.6794], [-4.2741, 40.6753]]]] }, "properties": { "name": "Madrid", "id": "ES-MD", "CNTRY": "Spain", "TYPE": "Autonomous Community" }, "id": "ES-MD" }, { "type": "Feature", "geometry": { "type": "MultiPolygon", "coordinates": [[[[-2.9385, 42.6083], [-2.923, 42.6009], [-2.9384, 42.5938], [-2.9448, 42.6026], [-2.9385, 42.6083]]], [[[-1.8571, 41.9674], [-1.8767, 41.9533], [-1.9055, 41.9452], [-1.9143, 41.9343], [-1.9232, 41.9336], [-1.9383, 41.9257], [-1.9506, 41.9271], [-1.9606, 41.9208], [-1.9824, 41.9189], [-1.9936, 41.9261], [-1.9995, 41.9355], [-2.0095, 41.9387], [-2.0278, 41.9517], [-2.0356, 41.9404], [-2.0442, 41.9492], [-2.057, 41.9527], [-2.0721, 41.9501], [-2.0791, 41.9533], [-2.1066, 41.9563], [-2.1135, 41.9609], [-2.1182, 41.978], [-2.1197, 41.9965], [-2.1087, 42.0033], [-2.1191, 42.0218], [-2.1281, 42.0251], [-2.1436, 42.0395], [-2.1503, 42.0418], [-2.1581, 42.0551], [-2.1599, 42.0665], [-2.1338, 42.0747], [-2.1275, 42.0802], [-2.1283, 42.0971], [-2.1474, 42.1031], [-2.1716, 42.1042], [-2.194, 42.1017], [-2.2114, 42.103], [-2.2189, 42.0983], [-2.2355, 42.1015], [-2.2587, 42.0862], [-2.2685, 42.0876], [-2.282, 42.1074], [-2.28, 42.1226], [-2.2823, 42.1301], [-2.3208, 42.1438], [-2.3485, 42.1448], [-2.4043, 42.1384], [-2.4411, 42.1357], [-2.4491, 42.1228], [-2.4581, 42.115], [-2.4716, 42.1128], [-2.4869, 42.1065], [-2.4935, 42.1118], [-2.5088, 42.1154], [-2.5171, 42.1104], [-2.5189, 42.0918], [-2.5223, 42.0846], [-2.516, 42.069], [-2.5345, 42.054], [-2.5488, 42.0516], [-2.5518, 42.0393], [-2.5579, 42.0316], [-2.5651, 42.014], [-2.5833, 41.9955], [-2.5969, 42.0019], [-2.6251, 42.0059], [-2.6475, 42.0034], [-2.6587, 42.0046], [-2.6739, 41.9964], [-2.6832, 41.9999], [-2.704, 42.0145], [-2.7226, 42.0148], [-2.7455, 42.0086], [-2.755, 42.023], [-2.7567, 42.032], [-2.7395, 42.0476], [-2.727, 42.0683], [-2.7098, 42.0833], [-2.7072, 42.1032], [-2.7291, 42.1224], [-2.7452, 42.1244], [-2.7517, 42.1175], [-2.7684, 42.1243], [-2.777, 42.1219], [-2.7914, 42.1085], [-2.7898, 42.094], [-2.8034, 42.0789], [-2.7952, 42.064], [-2.7982, 42.0467], [-2.8091, 42.0369], [-2.8213, 42.0383], [-2.8532, 42.0304], [-2.8589, 42.0214], [-2.8713, 42.0127], [-2.8836, 42.0089], [-2.8927, 42.0168], [-2.9132, 42.0218], [-2.9154, 42.0399], [-2.9198, 42.0472], [-2.9319, 42.0792], [-2.9416, 42.0888], [-2.9622, 42.084], [-2.9901, 42.0867], [-3.004, 42.0828], [-3.0232, 42.0884], [-3.0331, 42.0863], [-3.0516, 42.1168], [-3.0677, 42.1341], [-3.0859, 42.136], [-3.0908, 42.1485], [-3.0898, 42.1591], [-3.097, 42.1682], [-3.1129, 42.1761], [-3.115, 42.187], [-3.1288, 42.1972], [-3.1038, 42.213], [-3.0982, 42.2232], [-3.1004, 42.2299], [-3.0896, 42.2454], [-3.0965, 42.262], [-3.0902, 42.2724], [-3.0944, 42.2769], [-3.103, 42.3079], [-3.1067, 42.3128], [-3.1011, 42.3284], [-3.1092, 42.3386], [-3.1091, 42.3516], [-3.0859, 42.3528], [-3.0649, 42.356], [-3.0649, 42.365], [-3.0841, 42.3852], [-3.1048, 42.3856], [-3.0954, 42.4035], [-3.1007, 42.4161], [-3.0903, 42.4221], [-3.0783, 42.4156], [-3.0826, 42.3981], [-3.0644, 42.373], [-3.0544, 42.3753], [-3.0635, 42.4033], [-3.0583, 42.4169], [-3.0622, 42.428], [-3.0471, 42.4459], [-3.0729, 42.4758], [-3.0828, 42.4744], [-3.0916, 42.4792], [-3.0925, 42.4926], [-3.0791, 42.4999], [-3.0746, 42.509], [-3.0762, 42.5208], [-3.0724, 42.5268], [-3.0886, 42.5383], [-3.1064, 42.5294], [-3.1236, 42.5331], [-3.1259, 42.5441], [-3.1039, 42.5538], [-3.0988, 42.5619], [-3.0822, 42.5743], [-3.0856, 42.5825], [-3.06, 42.5889], [-3.0716, 42.622], [-3.0796, 42.6261], [-3.0853, 42.6355], [-3.077, 42.6391], [-3.0328, 42.6392], [-3.0203, 42.6327], [-3.0139, 42.6409], [-3.0043, 42.6447], [-2.989, 42.6423], [-2.9861, 42.6363], [-2.9667, 42.6404], [-2.9451, 42.6387], [-2.9339, 42.6341], [-2.9248, 42.622], [-2.9055, 42.6195], [-2.8834, 42.6204], [-2.879, 42.6288], [-2.8646, 42.6323], [-2.8583, 42.6378], [-2.8463, 42.6316], [-2.8434, 42.6245], [-2.8484, 42.6161], [-2.8426, 42.6082], [-2.8219, 42.6141], [-2.8241, 42.6019], [-2.8182, 42.5962], [-2.8258, 42.5868], [-2.8414, 42.5811], [-2.8383, 42.5701], [-2.8192, 42.5556], [-2.8153, 42.5686], [-2.7995, 42.572], [-2.7799, 42.58], [-2.7729, 42.5935], [-2.7744, 42.6054], [-2.7648, 42.6221], [-2.7506, 42.6233], [-2.7313, 42.6171], [-2.7216, 42.6072], [-2.7095, 42.6004], [-2.683, 42.5951], [-2.6859, 42.5865], [-2.6878, 42.5591], [-2.6929, 42.5406], [-2.7061, 42.5169], [-2.6873, 42.5201], [-2.6794, 42.511], [-2.6674, 42.5096], [-2.6569, 42.503], [-2.6494, 42.4849], [-2.6396, 42.4843], [-2.6287, 42.4956], [-2.6106, 42.4958], [-2.6054, 42.5028], [-2.5929, 42.4924], [-2.6027, 42.481], [-2.5951, 42.4722], [-2.5884, 42.4831], [-2.5779, 42.483], [-2.5659, 42.4927], [-2.5545, 42.4836], [-2.5315, 42.4834], [-2.5382, 42.4954], [-2.52, 42.5069], [-2.5132, 42.5186], [-2.5054, 42.513], [-2.519, 42.4942], [-2.5148, 42.49], [-2.4772, 42.486], [-2.4725, 42.4917], [-2.4474, 42.4959], [-2.4368, 42.4888], [-2.4218, 42.4892], [-2.4154, 42.4891], [-2.3998, 42.4725], [-2.386, 42.4698], [-2.3771, 42.472], [-2.3686, 42.4618], [-2.3529, 42.4642], [-2.3482, 42.4521], [-2.3325, 42.4534], [-2.3362, 42.4649], [-2.3277, 42.468], [-2.3174, 42.461], [-2.2945, 42.4587], [-2.2869, 42.4649], [-2.277, 42.4471], [-2.264, 42.449], [-2.239, 42.44], [-2.2413, 42.4297], [-2.2313, 42.4246], [-2.2169, 42.4239], [-2.2073, 42.414], [-2.1961, 42.4183], [-2.1858, 42.4175], [-2.1752, 42.4073], [-2.1583, 42.4102], [-2.1357, 42.4209], [-2.1102, 42.4192], [-2.1048, 42.4144], [-2.1165, 42.3988], [-2.0885, 42.3814], [-2.0928, 42.3756], [-2.0793, 42.368], [-2.0889, 42.3569], [-2.0883, 42.3461], [-2.0689, 42.3429], [-2.0516, 42.351], [-2.0444, 42.3581], [-2.0183, 42.3685], [-2.0085, 42.3618], [-1.9987, 42.3629], [-1.9723, 42.3528], [-1.9649, 42.3431], [-1.9673, 42.3355], [-1.9405, 42.333], [-1.9321, 42.3213], [-1.9193, 42.3271], [-1.9199, 42.3155], [-1.91, 42.3119], [-1.9154, 42.3002], [-1.8946, 42.2905], [-1.8658, 42.2827], [-1.8666, 42.2704], [-1.8761, 42.2595], [-1.8722, 42.252], [-1.8541, 42.2495], [-1.8508, 42.2587], [-1.8271, 42.244], [-1.8148, 42.228], [-1.8024, 42.224], [-1.7823, 42.2262], [-1.7717, 42.2148], [-1.7652, 42.2217], [-1.7433, 42.213], [-1.7324, 42.2144], [-1.7071, 42.2086], [-1.7038, 42.1939], [-1.685, 42.1938], [-1.6813, 42.1882], [-1.6955, 42.1813], [-1.7008, 42.1703], [-1.6943, 42.1584], [-1.6815, 42.151], [-1.719, 42.133], [-1.7284, 42.144], [-1.7447, 42.1504], [-1.7653, 42.1499], [-1.7847, 42.1381], [-1.7968, 42.1408], [-1.8024, 42.147], [-1.8209, 42.1533], [-1.8385, 42.1436], [-1.8393, 42.1297], [-1.8515, 42.1217], [-1.8618, 42.1088], [-1.8938, 42.0849], [-1.9004, 42.0771], [-1.9073, 42.0583], [-1.9015, 42.0323], [-1.8922, 42.0261], [-1.8844, 42.0273], [-1.8719, 42.0136], [-1.8646, 42.0142], [-1.859, 42.0051], [-1.8462, 42.008], [-1.8541, 41.9963], [-1.8473, 41.9861], [-1.8626, 41.9776], [-1.8571, 41.9674]]]] }, "properties": { "name": "La Rioja", "id": "ES-RI", "CNTRY": "Spain", "TYPE": "Autonomous Community" }, "id": "ES-RI" }, { "type": "Feature", "geometry": { "type": "MultiPolygon", "coordinates": [[[[-8.9198, 42.3941], [-8.926, 42.3878], [-8.9356, 42.3562], [-8.9457, 42.3558], [-8.9468, 42.3662], [-8.9396, 42.3706], [-8.9447, 42.3786], [-8.9332, 42.3874], [-8.9311, 42.3975], [-8.9198, 42.3941]]], [[[-9.0129, 42.4833], [-8.9986, 42.4673], [-9.0143, 42.4643], [-9.0188, 42.4736], [-9.0129, 42.4833]]], [[[-8.9164, 42.2513], [-8.9021, 42.2445], [-8.8989, 42.2353], [-8.9055, 42.2143], [-8.9143, 42.2193], [-8.9064, 42.2261], [-8.9062, 42.2389], [-8.9164, 42.2513]]], [[[-7.0555, 43.4724], [-7.063, 43.4737], [-7.0783, 43.4651], [-7.0914, 43.4526], [-7.0919, 43.444], [-7.0987, 43.4384], [-7.1019, 43.4276], [-7.1258, 43.4235], [-7.1422, 43.4303], [-7.1507, 43.4281], [-7.1624, 43.4316], [-7.1733, 43.4296], [-7.17, 43.4219], [-7.1765, 43.4141], [-7.1718, 43.4011], [-7.1793, 43.3969], [-7.175, 43.3867], [-7.1584, 43.3748], [-7.1367, 43.3837], [-7.1276, 43.3717], [-7.1314, 43.3633], [-7.1321, 43.3465], [-7.1298, 43.3306], [-7.1136, 43.3258], [-7.1104, 43.3158], [-7.0997, 43.3034], [-7.0912, 43.2999], [-7.0642, 43.2998], [-7.0639, 43.2894], [-7.07, 43.2688], [-7.0626, 43.2475], [-7.0471, 43.2333], [-7.0333, 43.2285], [-7.021, 43.2153], [-7.0087, 43.2237], [-7.0009, 43.2093], [-6.9863, 43.2033], [-6.9692, 43.2041], [-6.9647, 43.1864], [-6.9728, 43.1795], [-6.9791, 43.166], [-6.973, 43.1523], [-6.9576, 43.1429], [-6.9551, 43.136], [-6.937, 43.1333], [-6.9281, 43.1435], [-6.9186, 43.1416], [-6.9019, 43.1542], [-6.883, 43.1581], [-6.8848, 43.1676], [-6.8556, 43.1726], [-6.8396, 43.1674], [-6.8352, 43.1564], [-6.826, 43.1467], [-6.8248, 43.1362], [-6.8291, 43.1234], [-6.8642, 43.1008], [-6.8701, 43.0921], [-6.8929, 43.0921], [-6.9129, 43.0751], [-6.9219, 43.0824], [-6.9391, 43.0819], [-6.9503, 43.0769], [-6.9498, 43.0685], [-6.9668, 43.0566], [-6.962, 43.0445], [-6.9655, 43.0357], [-6.9908, 43.0313], [-6.9957, 43.0212], [-6.9851, 43.0153], [-6.9824, 43.0052], [-6.9663, 42.9936], [-6.9586, 43.001], [-6.9579, 43.0156], [-6.9616, 43.027], [-6.9538, 43.0367], [-6.9451, 43.0329], [-6.9388, 43.0128], [-6.9188, 43.0006], [-6.9072, 42.9904], [-6.8899, 42.9894], [-6.8795, 42.9919], [-6.8529, 42.9744], [-6.8353, 42.9589], [-6.8339, 42.9418], [-6.8406, 42.9302], [-6.8359, 42.9168], [-6.8234, 42.9152], [-6.8355, 42.904], [-6.8337, 42.8821], [-6.8703, 42.8743], [-6.8589, 42.8481], [-6.8411, 42.8239], [-6.8497, 42.8201], [-6.854, 42.8117], [-6.8684, 42.8024], [-6.8664, 42.788], [-6.8926, 42.7756], [-6.9036, 42.7595], [-6.9348, 42.7413], [-6.947, 42.7425], [-6.9551, 42.7545], [-6.9668, 42.748], [-6.9688, 42.7297], [-6.9821, 42.7196], [-6.9887, 42.7263], [-7.0067, 42.7246], [-7.03, 42.7094], [-7.0441, 42.6952], [-7.0344, 42.6851], [-7.032, 42.6765], [-7.0155, 42.6641], [-7.0095, 42.6497], [-7.0411, 42.6355], [-7.0478, 42.6282], [-7.0461, 42.6197], [-7.0491, 42.5954], [-7.0381, 42.5798], [-7.0546, 42.57], [-7.0567, 42.5587], [-7.0707, 42.5368], [-7.0604, 42.5358], [-7.0599, 42.5283], [-7.0671, 42.5194], [-7.0708, 42.5058], [-7.0479, 42.5075], [-7.0378, 42.5049], [-7.0286, 42.4972], [-7.0015, 42.5035], [-6.9956, 42.4966], [-6.9748, 42.4921], [-6.9636, 42.513], [-6.9546, 42.5177], [-6.9297, 42.5194], [-6.9137, 42.5067], [-6.9065, 42.5069], [-6.8806, 42.4988], [-6.8582, 42.4868], [-6.8407, 42.4872], [-6.8281, 42.4929], [-6.8236, 42.484], [-6.8083, 42.4661], [-6.8215, 42.4541], [-6.8203, 42.4214], [-6.8299, 42.4132], [-6.8291, 42.4071], [-6.8411, 42.4041], [-6.8199, 42.3863], [-6.8038, 42.3862], [-6.7974, 42.3821], [-6.7807, 42.3816], [-6.7662, 42.3666], [-6.7566, 42.3663], [-6.733, 42.3589], [-6.7408, 42.3334], [-6.7345, 42.3111], [-6.7386, 42.2968], [-6.7602, 42.2766], [-6.7652, 42.2578], [-6.7854, 42.2527], [-6.8009, 42.2369], [-6.7867, 42.2152], [-6.7954, 42.2085], [-6.8028, 42.2184], [-6.8418, 42.2278], [-6.87, 42.2231], [-6.8838, 42.2158], [-6.8909, 42.2071], [-6.8875, 42.2011], [-6.9008, 42.19], [-6.9155, 42.1893], [-6.9398, 42.1763], [-6.9392, 42.1657], [-6.9442, 42.148], [-6.9427, 42.1392], [-6.9544, 42.1285], [-6.9865, 42.1233], [-6.9923, 42.099], [-7.0015, 42.0952], [-7.0056, 42.0842], [-7.0202, 42.0827], [-7.0319, 42.0753], [-7.0317, 42.065], [-7.0211, 42.0612], [-7.0082, 42.0515], [-6.9938, 42.0507], [-6.9743, 42.054], [-6.9731, 42.0422], [-6.963, 42.0307], [-6.9689, 42.0141], [-6.977, 42.0021], [-6.9869, 41.9962], [-6.9896, 41.9835], [-6.9823, 41.9729], [-6.9987, 41.9626], [-7.0068, 41.9504], [-7.0367, 41.951], [-7.044, 41.9554], [-7.0522, 41.9483], [-7.0713, 41.9488], [-7.0781, 41.9529], [-7.0884, 41.9733], [-7.1194, 41.9861], [-7.1414, 41.9901], [-7.1516, 41.9855], [-7.1576, 41.9773], [-7.1788, 41.98], [-7.1876, 41.9693], [-7.1857, 41.9505], [-7.1893, 41.9417], [-7.1806, 41.9281], [-7.18, 41.9207], [-7.1868, 41.8942], [-7.1974, 41.8802], [-7.211, 41.8796], [-7.231, 41.8685], [-7.2491, 41.8675], [-7.2718, 41.8597], [-7.2848, 41.852], [-7.3014, 41.8501], [-7.314, 41.8438], [-7.3352, 41.8446], [-7.3557, 41.8416], [-7.3633, 41.8516], [-7.39, 41.8409], [-7.3969, 41.8277], [-7.415, 41.813], [-7.4235, 41.8092], [-7.4301, 41.8244], [-7.4263, 41.8298], [-7.4473, 41.8437], [-7.4478, 41.8584], [-7.4554, 41.8642], [-7.4825, 41.8627], [-7.4926, 41.871], [-7.5111, 41.865], [-7.5074, 41.8499], [-7.5349, 41.8381], [-7.5688, 41.8316], [-7.6145, 41.8325], [-7.6114, 41.8458], [-7.6008, 41.863], [-7.5862, 41.8799], [-7.6087, 41.8792], [-7.6153, 41.883], [-7.6323, 41.8787], [-7.6586, 41.8828], [-7.6668, 41.8898], [-7.6976, 41.9066], [-7.7143, 41.9032], [-7.7376, 41.8923], [-7.7584, 41.8984], [-7.7896, 41.883], [-7.8257, 41.8809], [-7.8446, 41.8744], [-7.8465, 41.863], [-7.8592, 41.8615], [-7.874, 41.8509], [-7.8804, 41.8512], [-7.8904, 41.8612], [-7.8853, 41.878], [-7.8861, 41.8997], [-7.8846, 41.9217], [-7.8899, 41.9259], [-7.9087, 41.9244], [-7.9111, 41.9111], [-7.9209, 41.8781], [-7.948, 41.8713], [-7.9719, 41.8745], [-7.9832, 41.8698], [-7.9959, 41.8529], [-8.004, 41.8484], [-8.0134, 41.8312], [-8.0373, 41.8302], [-8.0576, 41.8163], [-8.0662, 41.8167], [-8.0963, 41.8093], [-8.1156, 41.8122], [-8.1272, 41.8093], [-8.1647, 41.8206], [-8.1621, 41.855], [-8.1702, 41.8754], [-8.1748, 41.8781], [-8.193, 41.8754], [-8.2037, 41.8908], [-8.2144, 41.8986], [-8.2164, 41.9101], [-8.21, 41.9222], [-8.1965, 41.9392], [-8.1756, 41.9549], [-8.1641, 41.9729], [-8.1625, 41.9809], [-8.1378, 41.9947], [-8.1295, 42.0047], [-8.116, 42.0059], [-8.0885, 42.0148], [-8.0844, 42.0236], [-8.0843, 42.0471], [-8.0934, 42.0658], [-8.1071, 42.0768], [-8.1221, 42.0795], [-8.153, 42.0776], [-8.1744, 42.0656], [-8.1834, 42.0677], [-8.1868, 42.1055], [-8.1926, 42.1236], [-8.1887, 42.1374], [-8.197, 42.1535], [-8.2049, 42.1432], [-8.2244, 42.1329], [-8.241, 42.1391], [-8.2536, 42.1355], [-8.2619, 42.1211], [-8.2746, 42.1231], [-8.305, 42.1038], [-8.3194, 42.1031], [-8.327, 42.0883], [-8.3331, 42.0839], [-8.357, 42.0895], [-8.3715, 42.0872], [-8.3786, 42.0787], [-8.3894, 42.0762], [-8.4016, 42.0801], [-8.4255, 42.0718], [-8.4445, 42.0818], [-8.4854, 42.0808], [-8.4996, 42.0788], [-8.5215, 42.0792], [-8.5277, 42.0727], [-8.5265, 42.0627], [-8.5462, 42.0544], [-8.5691, 42.0521], [-8.6007, 42.0554], [-8.6354, 42.0476], [-8.6575, 42.0293], [-8.6601, 42.0093], [-8.6658, 42.0015], [-8.6796, 41.9918], [-8.6995, 41.9839], [-8.7266, 41.9759], [-8.7461, 41.964], [-8.7507, 41.9398], [-8.7656, 41.9285], [-8.7842, 41.918], [-8.8214, 41.9115], [-8.848, 41.8801], [-8.8709, 41.8647], [-8.8825, 41.8834], [-8.878, 41.9103], [-8.885, 41.9169], [-8.8875, 41.9632], [-8.887, 41.988], [-8.8792, 41.9989], [-8.8848, 42.0125], [-8.8854, 42.0509], [-8.8932, 42.0591], [-8.8974, 42.0775], [-8.895, 42.1009], [-8.8995, 42.1142], [-8.8799, 42.1123], [-8.8629, 42.1225], [-8.8483, 42.1224], [-8.8345, 42.114], [-8.8243, 42.1179], [-8.8266, 42.1246], [-8.8181, 42.1349], [-8.8191, 42.1418], [-8.8289, 42.1495], [-8.8481, 42.1506], [-8.8498, 42.1583], [-8.8373, 42.1598], [-8.8339, 42.1547], [-8.8183, 42.1628], [-8.8113, 42.1836], [-8.815, 42.1896], [-8.7778, 42.2074], [-8.7741, 42.224], [-8.741, 42.2276], [-8.7274, 42.2433], [-8.7082, 42.2458], [-8.7032, 42.2605], [-8.6922, 42.2595], [-8.6766, 42.2665], [-8.6607, 42.2859], [-8.6466, 42.2908], [-8.6298, 42.2862], [-8.6146, 42.2972], [-8.6221, 42.3101], [-8.6144, 42.3249], [-8.6109, 42.3442], [-8.6256, 42.346], [-8.6324, 42.354], [-8.6391, 42.3399], [-8.6364, 42.327], [-8.6563, 42.3192], [-8.662, 42.3112], [-8.6521, 42.2985], [-8.6588, 42.292], [-8.6769, 42.2917], [-8.6922, 42.2802], [-8.7006, 42.2834], [-8.7116, 42.2768], [-8.7217, 42.2862], [-8.7328, 42.2866], [-8.7356, 42.2774], [-8.7538, 42.2647], [-8.7641, 42.2602], [-8.7842, 42.2637], [-8.7883, 42.2516], [-8.8039, 42.252], [-8.8149, 42.2607], [-8.8222, 42.2537], [-8.8364, 42.2588], [-8.8566, 42.2621], [-8.8654, 42.2511], [-8.8717, 42.2544], [-8.863, 42.269], [-8.8643, 42.279], [-8.8595, 42.2871], [-8.8554, 42.31], [-8.8468, 42.2975], [-8.8375, 42.2921], [-8.8304, 42.2792], [-8.8197, 42.281], [-8.8224, 42.3032], [-8.8179, 42.3072], [-8.8252, 42.321], [-8.8268, 42.3328], [-8.8222, 42.3378], [-8.8018, 42.3387], [-8.7981, 42.3315], [-8.7861, 42.3278], [-8.7516, 42.3419], [-8.7439, 42.3614], [-8.7353, 42.3749], [-8.7284, 42.3755], [-8.7094, 42.3943], [-8.697, 42.3933], [-8.6664, 42.4188], [-8.6838, 42.423], [-8.6904, 42.4388], [-8.703, 42.4334], [-8.7116, 42.4213], [-8.7181, 42.4218], [-8.7398, 42.413], [-8.7474, 42.4023], [-8.7545, 42.4018], [-8.7625, 42.3926], [-8.7771, 42.3926], [-8.7988, 42.3994], [-8.8134, 42.3999], [-8.823, 42.3954], [-8.8252, 42.3868], [-8.8377, 42.3832], [-8.8476, 42.3954], [-8.8679, 42.4124], [-8.8799, 42.4139], [-8.8714, 42.4323], [-8.875, 42.4463], [-8.8845, 42.4562], [-8.8969, 42.4599], [-8.9136, 42.4606], [-8.9255, 42.4499], [-8.9388, 42.4607], [-8.9359, 42.4769], [-8.9126, 42.4743], [-8.8955, 42.4792], [-8.891, 42.4919], [-8.8823, 42.4978], [-8.8656, 42.4982], [-8.8575, 42.4933], [-8.859, 42.4821], [-8.8546, 42.4716], [-8.8711, 42.4608], [-8.868, 42.447], [-8.8576, 42.4498], [-8.8477, 42.4592], [-8.8413, 42.4546], [-8.8265, 42.456], [-8.8225, 42.468], [-8.8303, 42.4813], [-8.8236, 42.4926], [-8.8073, 42.4931], [-8.8256, 42.5203], [-8.8252, 42.5401], [-8.8356, 42.5505], [-8.8294, 42.5594], [-8.8287, 42.5748], [-8.8235, 42.5777], [-8.8065, 42.5753], [-8.7833, 42.5945], [-8.7717, 42.5929], [-8.7666, 42.6058], [-8.7744, 42.6193], [-8.768, 42.6224], [-8.7529, 42.6408], [-8.7539, 42.6468], [-8.7673, 42.6515], [-8.7725, 42.6447], [-8.7932, 42.6358], [-8.8201, 42.6463], [-8.8123, 42.6597], [-8.8255, 42.6678], [-8.8498, 42.6648], [-8.858, 42.6422], [-8.8372, 42.6342], [-8.8389, 42.6279], [-8.8541, 42.6287], [-8.8676, 42.6074], [-8.885, 42.6158], [-8.8823, 42.6254], [-8.8733, 42.632], [-8.8815, 42.6381], [-8.8937, 42.6403], [-8.903, 42.6315], [-8.9208, 42.621], [-8.9205, 42.6175], [-8.9367, 42.6072], [-8.93, 42.5956], [-8.9194, 42.5927], [-8.9225, 42.5853], [-8.9403, 42.5815], [-8.9562, 42.5811], [-8.9651, 42.5677], [-8.9872, 42.565], [-8.9906, 42.5545], [-8.982, 42.5443], [-8.9883, 42.5346], [-8.9976, 42.5284], [-9.0162, 42.5218], [-9.0229, 42.5158], [-9.042, 42.52], [-9.0407, 42.5354], [-9.0298, 42.5428], [-9.0329, 42.5571], [-9.0508, 42.5738], [-9.0673, 42.5754], [-9.0725, 42.5669], [-9.0868, 42.5699], [-9.088, 42.5773], [-9.0756, 42.5837], [-9.0724, 42.5986], [-9.0605, 42.604], [-9.0557, 42.6189], [-9.0442, 42.6289], [-9.0363, 42.6492], [-9.0409, 42.6524], [-9.0387, 42.6692], [-9.0282, 42.6767], [-9.0263, 42.7009], [-9.0161, 42.709], [-9.0081, 42.71], [-9.006, 42.7249], [-8.9904, 42.7297], [-8.9869, 42.739], [-8.9784, 42.7429], [-8.9618, 42.7413], [-8.9503, 42.7486], [-8.9416, 42.7589], [-8.9361, 42.772], [-8.9203, 42.7859], [-8.9054, 42.7904], [-8.8874, 42.7817], [-8.8872, 42.7892], [-8.8965, 42.8005], [-8.8885, 42.8132], [-8.9004, 42.8174], [-8.9022, 42.8025], [-8.9198, 42.796], [-8.9363, 42.8002], [-8.9474, 42.7811], [-8.9591, 42.7776], [-8.9617, 42.7865], [-8.9697, 42.7901], [-8.9762, 42.7776], [-9.0114, 42.7825], [-9.0062, 42.7946], [-9.0131, 42.8006], [-9.0241, 42.7965], [-9.0361, 42.7864], [-9.0555, 42.7854], [-9.0486, 42.7737], [-9.0531, 42.7586], [-9.0654, 42.7585], [-9.0751, 42.752], [-9.071, 42.7453], [-9.0751, 42.7372], [-9.0848, 42.7377], [-9.0875, 42.7454], [-9.0982, 42.7547], [-9.1074, 42.7523], [-9.1106, 42.7611], [-9.1254, 42.7829], [-9.1458, 42.8028], [-9.1188, 42.8067], [-9.1069, 42.814], [-9.1042, 42.8357], [-9.1165, 42.8467], [-9.1285, 42.8441], [-9.144, 42.861], [-9.1484, 42.873], [-9.132, 42.8981], [-9.125, 42.9057], [-9.1322, 42.9109], [-9.16, 42.9121], [-9.1733, 42.9353], [-9.1756, 42.944], [-9.1945, 42.9464], [-9.184, 42.9309], [-9.1865, 42.9153], [-9.2077, 42.9183], [-9.2201, 42.9318], [-9.2249, 42.943], [-9.2364, 42.9375], [-9.2447, 42.9286], [-9.2623, 42.9227], [-9.2636, 42.894], [-9.268, 42.8837], [-9.2827, 42.8903], [-9.2781, 42.9064], [-9.2871, 42.9198], [-9.3015, 42.9231], [-9.2895, 42.9508], [-9.2816, 42.963], [-9.274, 42.9641], [-9.2677, 42.9727], [-9.2662, 42.997], [-9.2603, 43.0094], [-9.2739, 43.0097], [-9.2824, 43.0231], [-9.2833, 43.0376], [-9.2989, 43.053], [-9.27, 43.0477], [-9.2582, 43.0529], [-9.2497, 43.0732], [-9.2555, 43.093], [-9.2463, 43.0938], [-9.2245, 43.0894], [-9.2199, 43.1043], [-9.1992, 43.1061], [-9.1881, 43.091], [-9.1809, 43.0968], [-9.1829, 43.1045], [-9.1661, 43.1053], [-9.162, 43.1238], [-9.1709, 43.1385], [-9.1919, 43.1226], [-9.2038, 43.1297], [-9.2046, 43.143], [-9.2147, 43.1522], [-9.212, 43.1582], [-9.199, 43.1554], [-9.1803, 43.1669], [-9.1787, 43.1842], [-9.1736, 43.1891], [-9.1564, 43.1838], [-9.1501, 43.1936], [-9.1346, 43.1918], [-9.1258, 43.1963], [-9.1137, 43.1948], [-9.1065, 43.1863], [-9.0985, 43.1925], [-9.08, 43.1826], [-9.073, 43.1884], [-9.0597, 43.1851], [-9.0411, 43.1945], [-9.0341, 43.2026], [-9.0345, 43.2132], [-9.0238, 43.2147], [-9.0142, 43.222], [-9.0136, 43.2332], [-9.0009, 43.2288], [-9.0033, 43.2218], [-8.9916, 43.2176], [-8.9855, 43.2267], [-8.9665, 43.2259], [-8.9658, 43.2301], [-8.944, 43.2266], [-8.9318, 43.2206], [-8.9194, 43.2302], [-8.9367, 43.2344], [-8.9521, 43.2508], [-8.9514, 43.2639], [-8.9755, 43.2627], [-8.9843, 43.2725], [-8.9822, 43.2833], [-8.9621, 43.2879], [-8.9583, 43.294], [-8.9364, 43.2904], [-8.9078, 43.2985], [-8.9106, 43.305], [-8.91, 43.3231], [-8.8723, 43.3228], [-8.8453, 43.3207], [-8.8474, 43.3367], [-8.8393, 43.3464], [-8.8305, 43.3459], [-8.8264, 43.3317], [-8.8004, 43.3146], [-8.7733, 43.3012], [-8.7624, 43.3035], [-8.7469, 43.2955], [-8.7254, 43.2986], [-8.7211, 43.293], [-8.7064, 43.2923], [-8.6783, 43.3015], [-8.6353, 43.3107], [-8.629, 43.3153], [-8.5939, 43.322], [-8.5562, 43.3124], [-8.5338, 43.3171], [-8.5101, 43.3293], [-8.4951, 43.3519], [-8.4599, 43.3627], [-8.456, 43.3714], [-8.4357, 43.385], [-8.4209, 43.3797], [-8.4107, 43.3712], [-8.4073, 43.3895], [-8.3917, 43.3881], [-8.3931, 43.3805], [-8.3872, 43.3709], [-8.3947, 43.3635], [-8.3832, 43.3556], [-8.3855, 43.3378], [-8.367, 43.3446], [-8.36, 43.3431], [-8.3472, 43.3532], [-8.347, 43.366], [-8.3406, 43.3695], [-8.3383, 43.3815], [-8.3486, 43.3872], [-8.3493, 43.3966], [-8.3232, 43.4052], [-8.3063, 43.4071], [-8.2941, 43.3863], [-8.271, 43.3885], [-8.2629, 43.3838], [-8.2565, 43.3708], [-8.2491, 43.3693], [-8.252, 43.3547], [-8.2399, 43.3465], [-8.2283, 43.3447], [-8.2197, 43.3317], [-8.2117, 43.3389], [-8.2085, 43.3517], [-8.2179, 43.3532], [-8.2089, 43.365], [-8.2173, 43.3688], [-8.2169, 43.3792], [-8.2215, 43.3879], [-8.2104, 43.3991], [-8.2052, 43.4112], [-8.1864, 43.4151], [-8.1744, 43.4138], [-8.1716, 43.4212], [-8.1955, 43.4268], [-8.2015, 43.4213], [-8.2149, 43.4184], [-8.224, 43.4288], [-8.2422, 43.4266], [-8.2419, 43.4177], [-8.2603, 43.4241], [-8.2789, 43.4364], [-8.2952, 43.4357], [-8.2999, 43.4403], [-8.3157, 43.4442], [-8.3111, 43.4554], [-8.3008, 43.4555], [-8.2775, 43.4608], [-8.2662, 43.456], [-8.2542, 43.4673], [-8.2301, 43.4575], [-8.2177, 43.4606], [-8.2008, 43.4606], [-8.1887, 43.4718], [-8.1705, 43.4783], [-8.1621, 43.4969], [-8.1704, 43.4989], [-8.1842, 43.4945], [-8.1958, 43.4866], [-8.1971, 43.4787], [-8.2149, 43.485], [-8.223, 43.4731], [-8.231, 43.4813], [-8.248, 43.4783], [-8.2656, 43.4684], [-8.2961, 43.4612], [-8.3076, 43.4687], [-8.3191, 43.4687], [-8.3385, 43.4594], [-8.3471, 43.4643], [-8.3436, 43.4715], [-8.3244, 43.4856], [-8.3181, 43.4983], [-8.3305, 43.5135], [-8.3222, 43.5274], [-8.2984, 43.5305], [-8.2953, 43.5405], [-8.3249, 43.5608], [-8.314, 43.5707], [-8.2934, 43.5574], [-8.2768, 43.5597], [-8.2686, 43.5556], [-8.2594, 43.5587], [-8.2164, 43.5822], [-8.2104, 43.5947], [-8.1927, 43.6038], [-8.1875, 43.6219], [-8.1722, 43.615], [-8.1537, 43.6169], [-8.1339, 43.6378], [-8.1269, 43.6366], [-8.1085, 43.6421], [-8.0937, 43.6588], [-8.0708, 43.6505], [-8.0522, 43.6505], [-8.0545, 43.6591], [-8.0701, 43.6592], [-8.0725, 43.6741], [-8.0705, 43.6852], [-8.0619, 43.6985], [-8.0622, 43.7043], [-8.0447, 43.7141], [-8.015, 43.7137], [-8.0044, 43.7062], [-7.9605, 43.7239], [-7.9456, 43.7347], [-7.9488, 43.7429], [-7.9258, 43.7415], [-7.9026, 43.7703], [-7.8902, 43.7643], [-7.8659, 43.7725], [-7.8578, 43.765], [-7.8598, 43.7489], [-7.8686, 43.7337], [-7.8534, 43.7262], [-7.8506, 43.7105], [-7.8625, 43.7132], [-7.8775, 43.7017], [-7.8787, 43.6899], [-7.8696, 43.6743], [-7.886, 43.6794], [-7.8959, 43.6743], [-7.8836, 43.6643], [-7.8709, 43.6635], [-7.8488, 43.6767], [-7.8659, 43.7], [-7.8532, 43.7061], [-7.8385, 43.7011], [-7.8236, 43.702], [-7.8285, 43.7112], [-7.8168, 43.7136], [-7.7919, 43.7374], [-7.7797, 43.7342], [-7.7617, 43.742], [-7.7533, 43.7425], [-7.722, 43.7526], [-7.7166, 43.7649], [-7.6866, 43.7776], [-7.6858, 43.7864], [-7.6753, 43.7884], [-7.6613, 43.7787], [-7.6739, 43.7709], [-7.6742, 43.763], [-7.6832, 43.7601], [-7.6906, 43.7508], [-7.6861, 43.7438], [-7.6996, 43.7371], [-7.6799, 43.7313], [-7.6715, 43.7478], [-7.6549, 43.7472], [-7.6369, 43.7543], [-7.6311, 43.7507], [-7.627, 43.7233], [-7.6212, 43.7188], [-7.6072, 43.7196], [-7.6127, 43.7058], [-7.6037, 43.7026], [-7.6124, 43.6901], [-7.6113, 43.6763], [-7.5928, 43.6666], [-7.5891, 43.6881], [-7.5757, 43.6942], [-7.5833, 43.7037], [-7.5838, 43.7128], [-7.5571, 43.7112], [-7.55, 43.7203], [-7.5478, 43.7333], [-7.5323, 43.7306], [-7.5193, 43.7355], [-7.5113, 43.7249], [-7.4907, 43.7292], [-7.467, 43.7252], [-7.4757, 43.7091], [-7.4621, 43.7063], [-7.4544, 43.7006], [-7.4369, 43.6982], [-7.4308, 43.6942], [-7.4094, 43.6918], [-7.3948, 43.6811], [-7.3732, 43.6769], [-7.3659, 43.6783], [-7.355, 43.6723], [-7.354, 43.6565], [-7.3305, 43.6279], [-7.3124, 43.6184], [-7.2894, 43.595], [-7.2714, 43.5877], [-7.2614, 43.5803], [-7.2458, 43.5764], [-7.2564, 43.5614], [-7.2436, 43.5544], [-7.2422, 43.568], [-7.2328, 43.5682], [-7.2056, 43.5633], [-7.1774, 43.5633], [-7.1697, 43.5555], [-7.1534, 43.5546], [-7.1378, 43.5572], [-7.1234, 43.5548], [-7.1175, 43.5619], [-7.0892, 43.5553], [-7.0765, 43.5544], [-7.0573, 43.5592], [-7.0369, 43.5521], [-7.036, 43.5365], [-7.0516, 43.5151], [-7.0544, 43.5026], [-7.0532, 43.4854], [-7.0475, 43.4788], [-7.0555, 43.4724]]], [[[-8.8737, 42.5722], [-8.8617, 42.5656], [-8.8564, 42.5568], [-8.8666, 42.5433], [-8.8735, 42.5499], [-8.8683, 42.5551], [-8.8859, 42.5602], [-8.8875, 42.5667], [-8.8737, 42.5722]]]] }, "properties": { "name": "Galicia", "id": "ES-GA", "CNTRY": "Spain", "TYPE": "Autonomous Community" }, "id": "ES-GA" }, { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [[[-6.8656, 40.2673], [-6.848, 40.2541], [-6.8337, 40.2464], [-6.8197, 40.2429], [-6.8007, 40.242], [-6.8018, 40.2486], [-6.7841, 40.2487], [-6.7604, 40.2395], [-6.7426, 40.2549], [-6.7349, 40.2569], [-6.717, 40.2688], [-6.6936, 40.2429], [-6.6791, 40.2496], [-6.6679, 40.2622], [-6.6389, 40.2686], [-6.6324, 40.264], [-6.6145, 40.2651], [-6.5986, 40.2702], [-6.5871, 40.2694], [-6.5569, 40.2898], [-6.5611, 40.2976], [-6.558, 40.3072], [-6.5631, 40.315], [-6.5582, 40.3306], [-6.5456, 40.3408], [-6.5251, 40.3518], [-6.4855, 40.3626], [-6.4763, 40.3684], [-6.4615, 40.3725], [-6.451, 40.3697], [-6.4381, 40.3722], [-6.4352, 40.3834], [-6.4169, 40.3988], [-6.4039, 40.4009], [-6.389, 40.3982], [-6.3742, 40.4003], [-6.3623, 40.4065], [-6.3615, 40.4227], [-6.3475, 40.4337], [-6.3427, 40.4423], [-6.3246, 40.4471], [-6.2922, 40.4523], [-6.2728, 40.4596], [-6.2657, 40.4688], [-6.2547, 40.4698], [-6.2381, 40.4852], [-6.1988, 40.4812], [-6.1823, 40.464], [-6.1573, 40.4568], [-6.1545, 40.4456], [-6.1441, 40.4345], [-6.1196, 40.4409], [-6.1158, 40.4361], [-6.1277, 40.4203], [-6.1169, 40.4143], [-6.1039, 40.4137], [-6.076, 40.4024], [-6.0722, 40.3947], [-6.0759, 40.381], [-6.0835, 40.3797], [-6.0818, 40.3643], [-6.0917, 40.3609], [-6.0968, 40.3534], [-6.059, 40.3465], [-6.0492, 40.3415], [-6.0268, 40.3384], [-6.0163, 40.3395], [-6.0205, 40.3275], [-6.0186, 40.3187], [-6.0067, 40.3053], [-5.9766, 40.2932], [-5.9454, 40.2852], [-5.9382, 40.2809], [-5.9239, 40.2813], [-5.904, 40.2951], [-5.8925, 40.3119], [-5.8938, 40.3201], [-5.8408, 40.3426], [-5.8189, 40.3601], [-5.8065, 40.3587], [-5.7956, 40.3509], [-5.784, 40.3224], [-5.7821, 40.3132], [-5.7923, 40.3006], [-5.8021, 40.297], [-5.7915, 40.2863], [-5.7644, 40.2804], [-5.7377, 40.2938], [-5.6986, 40.2889], [-5.6911, 40.2919], [-5.6745, 40.2785], [-5.6579, 40.2701], [-5.6599, 40.2575], [-5.645, 40.2485], [-5.6261, 40.2475], [-5.6136, 40.235], [-5.6184, 40.2245], [-5.6092, 40.2158], [-5.5954, 40.2164], [-5.5472, 40.197], [-5.5294, 40.1948], [-5.5058, 40.2016], [-5.4972, 40.1995], [-5.4705, 40.2097], [-5.4675, 40.2223], [-5.4453, 40.2304], [-5.4372, 40.2358], [-5.4285, 40.2521], [-5.4152, 40.2543], [-5.3908, 40.2509], [-5.3767, 40.2567], [-5.3675, 40.256], [-5.3555, 40.2639], [-5.3435, 40.2623], [-5.3591, 40.2267], [-5.3696, 40.2176], [-5.3698, 40.2089], [-5.3644, 40.1796], [-5.3681, 40.1611], [-5.3614, 40.1573], [-5.3454, 40.1281], [-5.3376, 40.1229], [-5.3361, 40.1144], [-5.3579, 40.1074], [-5.3694, 40.0987], [-5.3702, 40.0712], [-5.3744, 40.0612], [-5.3647, 40.0307], [-5.3632, 40.0107], [-5.3656, 39.9831], [-5.3738, 39.9678], [-5.3834, 39.9407], [-5.3964, 39.9145], [-5.401, 39.8862], [-5.3949, 39.8789], [-5.3636, 39.889], [-5.3257, 39.892], [-5.3167, 39.8897], [-5.3109, 39.8802], [-5.2947, 39.8736], [-5.2836, 39.8566], [-5.3112, 39.8277], [-5.311, 39.8106], [-5.3159, 39.7954], [-5.312, 39.785], [-5.3162, 39.7704], [-5.3094, 39.7607], [-5.2966, 39.7608], [-5.2652, 39.752], [-5.253, 39.7524], [-5.2439, 39.7661], [-5.2318, 39.7743], [-5.2181, 39.7878], [-5.2021, 39.7985], [-5.1736, 39.7983], [-5.1677, 39.7923], [-5.1594, 39.7601], [-5.1729, 39.7555], [-5.1665, 39.7431], [-5.1553, 39.738], [-5.1394, 39.7183], [-5.1527, 39.6951], [-5.1566, 39.6736], [-5.1491, 39.6664], [-5.151, 39.659], [-5.1605, 39.6514], [-5.1601, 39.6419], [-5.1711, 39.6341], [-5.1772, 39.6226], [-5.1936, 39.607], [-5.205, 39.5995], [-5.2026, 39.5916], [-5.1764, 39.5702], [-5.1595, 39.5586], [-5.1382, 39.5379], [-5.1232, 39.5188], [-5.0964, 39.5009], [-5.0822, 39.4863], [-5.0597, 39.4858], [-5.0302, 39.4558], [-5.029, 39.4505], [-4.9977, 39.4239], [-4.9812, 39.4145], [-4.9508, 39.3913], [-4.9339, 39.3933], [-4.9307, 39.3857], [-4.922, 39.3861], [-4.91, 39.3774], [-4.887, 39.369], [-4.8702, 39.3673], [-4.8594, 39.3785], [-4.8442, 39.3788], [-4.8322, 39.3881], [-4.8108, 39.3956], [-4.7887, 39.3978], [-4.7751, 39.3966], [-4.7671, 39.4013], [-4.7567, 39.4144], [-4.7125, 39.4334], [-4.6913, 39.4491], [-4.6685, 39.4233], [-4.6742, 39.4066], [-4.6873, 39.3912], [-4.6868, 39.3852], [-4.702, 39.3662], [-4.7083, 39.3507], [-4.706, 39.3277], [-4.7508, 39.3228], [-4.7592, 39.3193], [-4.7518, 39.3087], [-4.7312, 39.2564], [-4.7253, 39.2456], [-4.7139, 39.2431], [-4.7052, 39.2148], [-4.7066, 39.2082], [-4.692, 39.2028], [-4.6824, 39.1918], [-4.6649, 39.1831], [-4.6602, 39.175], [-4.6509, 39.171], [-4.6509, 39.1617], [-4.6783, 39.1679], [-4.7121, 39.1842], [-4.7382, 39.1913], [-4.7644, 39.1871], [-4.7815, 39.189], [-4.8077, 39.197], [-4.8211, 39.1786], [-4.8318, 39.174], [-4.8325, 39.1625], [-4.8393, 39.1625], [-4.8546, 39.1492], [-4.8531, 39.1396], [-4.8589, 39.12], [-4.8704, 39.1105], [-4.8739, 39.0956], [-4.8574, 39.0751], [-4.8268, 39.0611], [-4.8331, 39.0452], [-4.8496, 39.0422], [-4.86, 39.0323], [-4.8778, 39.0315], [-4.8931, 39.0363], [-4.912, 39.0463], [-4.9357, 39.0554], [-4.9621, 39.057], [-4.9605, 39.0488], [-4.9486, 39.0249], [-4.9356, 38.9906], [-4.9321, 38.9728], [-4.9185, 38.9563], [-4.9046, 38.9623], [-4.8915, 38.9575], [-4.8892, 38.9522], [-4.844, 38.9451], [-4.8342, 38.9403], [-4.8456, 38.908], [-4.8434, 38.8957], [-4.848, 38.8828], [-4.8782, 38.8876], [-4.9013, 38.8888], [-4.9141, 38.8867], [-4.9281, 38.8679], [-4.9419, 38.8535], [-4.9526, 38.8301], [-4.9577, 38.8139], [-4.9602, 38.7919], [-4.9726, 38.76], [-4.9882, 38.7417], [-5.0032, 38.7336], [-5.0091, 38.7359], [-5.0361, 38.7342], [-5.0458, 38.7294], [-5.06, 38.7245], [-5.0659, 38.718], [-5.1006, 38.7071], [-5.1195, 38.7157], [-5.1365, 38.7131], [-5.1519, 38.716], [-5.1664, 38.7107], [-5.1796, 38.7114], [-5.1679, 38.6766], [-5.1836, 38.6759], [-5.1783, 38.6652], [-5.1847, 38.6597], [-5.1932, 38.6638], [-5.2024, 38.6593], [-5.2088, 38.6682], [-5.2167, 38.6506], [-5.2483, 38.638], [-5.2551, 38.6265], [-5.2713, 38.6209], [-5.2776, 38.6127], [-5.2914, 38.6114], [-5.3106, 38.5908], [-5.3046, 38.584], [-5.3134, 38.5774], [-5.3243, 38.5809], [-5.3349, 38.5788], [-5.3565, 38.5855], [-5.3694, 38.5834], [-5.374, 38.5684], [-5.3848, 38.5665], [-5.3921, 38.5503], [-5.4075, 38.5428], [-5.4039, 38.5362], [-5.4154, 38.5275], [-5.4114, 38.5201], [-5.4198, 38.5125], [-5.431, 38.5118], [-5.4331, 38.5051], [-5.4453, 38.503], [-5.4685, 38.485], [-5.4794, 38.4839], [-5.4806, 38.4725], [-5.4955, 38.4589], [-5.507, 38.4572], [-5.5196, 38.4632], [-5.5308, 38.4538], [-5.5461, 38.4499], [-5.5722, 38.4275], [-5.5718, 38.4209], [-5.5832, 38.402], [-5.5842, 38.386], [-5.5652, 38.3771], [-5.5612, 38.3715], [-5.5671, 38.3455], [-5.5731, 38.3284], [-5.5552, 38.3178], [-5.544, 38.2944], [-5.5434, 38.2819], [-5.5254, 38.2625], [-5.5212, 38.2373], [-5.5229, 38.2235], [-5.5203, 38.2077], [-5.5382, 38.1994], [-5.5369, 38.191], [-5.5412, 38.1759], [-5.5378, 38.1617], [-5.5497, 38.1608], [-5.5595, 38.1495], [-5.5756, 38.1489], [-5.5877, 38.1322], [-5.6277, 38.1379], [-5.6395, 38.1347], [-5.657, 38.1153], [-5.666, 38.1093], [-5.6714, 38.0985], [-5.6924, 38.0841], [-5.7084, 38.0806], [-5.7341, 38.0875], [-5.7338, 38.1092], [-5.7411, 38.1261], [-5.735, 38.1367], [-5.7145, 38.1348], [-5.7088, 38.1423], [-5.6956, 38.1506], [-5.7058, 38.1636], [-5.6881, 38.1755], [-5.694, 38.1851], [-5.714, 38.1859], [-5.7254, 38.196], [-5.7387, 38.1949], [-5.7583, 38.181], [-5.7817, 38.1858], [-5.7998, 38.1747], [-5.8173, 38.1772], [-5.8256, 38.1708], [-5.8383, 38.1753], [-5.8549, 38.1696], [-5.8572, 38.1616], [-5.8747, 38.1583], [-5.8801, 38.1463], [-5.8808, 38.1327], [-5.894, 38.1309], [-5.914, 38.1211], [-5.9297, 38.0957], [-5.9285, 38.0879], [-5.9116, 38.0782], [-5.9082, 38.0678], [-5.9181, 38.0564], [-5.9285, 38.0501], [-5.9375, 38.0401], [-5.9334, 38.0306], [-5.9466, 38.0025], [-5.9578, 37.9988], [-5.9743, 37.9999], [-5.9941, 37.9974], [-6.003, 37.9924], [-6.0185, 37.9908], [-6.0336, 37.9972], [-6.053, 37.9968], [-6.0612, 37.9912], [-6.0956, 37.9831], [-6.1156, 37.9842], [-6.138, 37.972], [-6.154, 37.957], [-6.1681, 37.9559], [-6.1813, 37.9416], [-6.1957, 37.948], [-6.1945, 37.9534], [-6.2035, 37.9619], [-6.2392, 37.959], [-6.2527, 37.9709], [-6.3018, 37.9775], [-6.3269, 37.9964], [-6.3495, 38.0045], [-6.3589, 38.0162], [-6.3586, 38.0322], [-6.3621, 38.0426], [-6.37, 38.0499], [-6.3886, 38.0487], [-6.4146, 38.0589], [-6.4343, 38.0578], [-6.4451, 38.0598], [-6.4523, 38.0561], [-6.4433, 38.0469], [-6.465, 38.0356], [-6.4729, 38.0251], [-6.4703, 38.0117], [-6.4753, 38.0086], [-6.4912, 38.0091], [-6.4943, 38.0185], [-6.5244, 38.0218], [-6.5394, 38.0273], [-6.5592, 38.0281], [-6.5834, 38.0224], [-6.5821, 38.0525], [-6.5878, 38.0612], [-6.6228, 38.0961], [-6.6528, 38.0958], [-6.6612, 38.0919], [-6.6902, 38.0993], [-6.6945, 38.0935], [-6.7072, 38.0958], [-6.7157, 38.0923], [-6.7291, 38.0992], [-6.7355, 38.0936], [-6.7474, 38.0908], [-6.7589, 38.0923], [-6.7703, 38.1099], [-6.7808, 38.1084], [-6.8072, 38.11], [-6.816, 38.1205], [-6.809, 38.1341], [-6.8009, 38.1418], [-6.7996, 38.1537], [-6.7937, 38.1643], [-6.7941, 38.177], [-6.82, 38.1734], [-6.8335, 38.174], [-6.8553, 38.1784], [-6.9023, 38.201], [-6.9209, 38.2005], [-6.9299, 38.206], [-6.9366, 38.2094], [-6.9354, 38.22], [-6.9559, 38.2182], [-6.97, 38.2055], [-6.9805, 38.2118], [-6.9968, 38.2051], [-7.0096, 38.2057], [-7.0216, 38.1906], [-7.0295, 38.1847], [-7.0437, 38.1881], [-7.0672, 38.1875], [-7.0681, 38.18], [-7.084, 38.1727], [-7.1124, 38.1942], [-7.1211, 38.2111], [-7.1373, 38.2306], [-7.1439, 38.2495], [-7.1467, 38.2688], [-7.1562, 38.28], [-7.1703, 38.282], [-7.195, 38.3141], [-7.2019, 38.3287], [-7.2445, 38.3657], [-7.2646, 38.3865], [-7.2747, 38.3998], [-7.2786, 38.4218], [-7.2974, 38.4282], [-7.3151, 38.4414], [-7.3142, 38.4593], [-7.3022, 38.4647], [-7.296, 38.4756], [-7.3042, 38.4826], [-7.3118, 38.4745], [-7.3219, 38.4786], [-7.3163, 38.4962], [-7.3154, 38.5125], [-7.3044, 38.5204], [-7.3013, 38.53], [-7.303, 38.5431], [-7.2925, 38.5532], [-7.2825, 38.5757], [-7.2752, 38.5748], [-7.2629, 38.5909], [-7.2583, 38.6108], [-7.2433, 38.6233], [-7.2491, 38.6279], [-7.2675, 38.6293], [-7.2714, 38.6379], [-7.2686, 38.67], [-7.2657, 38.6818], [-7.2661, 38.6992], [-7.2576, 38.7125], [-7.259, 38.7233], [-7.2408, 38.7347], [-7.2283, 38.7359], [-7.2033, 38.7501], [-7.1898, 38.7682], [-7.1663, 38.7774], [-7.1559, 38.7919], [-7.1372, 38.8078], [-7.1244, 38.8153], [-7.1039, 38.8167], [-7.0901, 38.82], [-7.0782, 38.8397], [-7.0593, 38.8556], [-7.0352, 38.8634], [-7.029, 38.8752], [-7.0356, 38.8941], [-7.0471, 38.9071], [-7.031, 38.919], [-7.0206, 38.9385], [-7.0104, 38.9517], [-6.9839, 38.9792], [-6.9634, 39.0121], [-6.9513, 39.0242], [-6.9612, 39.0435], [-6.9604, 39.0536], [-6.978, 39.0833], [-6.9872, 39.093], [-7.0315, 39.1161], [-7.0511, 39.1175], [-7.0807, 39.1078], [-7.0998, 39.1047], [-7.1063, 39.0985], [-7.1252, 39.1034], [-7.1424, 39.1108], [-7.1392, 39.1383], [-7.1331, 39.1451], [-7.1377, 39.1505], [-7.1305, 39.1621], [-7.1369, 39.1718], [-7.1617, 39.1802], [-7.1787, 39.1828], [-7.192, 39.1885], [-7.2006, 39.1875], [-7.2145, 39.1923], [-7.2274, 39.205], [-7.2405, 39.2121], [-7.2452, 39.2283], [-7.2428, 39.2407], [-7.2484, 39.2509], [-7.2323, 39.2781], [-7.27, 39.3027], [-7.2697, 39.3085], [-7.2916, 39.3273], [-7.3008, 39.3303], [-7.3093, 39.3389], [-7.3063, 39.3536], [-7.3112, 39.3695], [-7.323, 39.38], [-7.3136, 39.3966], [-7.3074, 39.3987], [-7.2995, 39.4145], [-7.3027, 39.4275], [-7.3012, 39.4471], [-7.2929, 39.455], [-7.2999, 39.4645], [-7.3215, 39.4754], [-7.3423, 39.4797], [-7.3473, 39.4882], [-7.3639, 39.4819], [-7.3782, 39.4901], [-7.3769, 39.4962], [-7.3882, 39.5065], [-7.3857, 39.5218], [-7.3894, 39.5306], [-7.3978, 39.5342], [-7.4155, 39.5322], [-7.4285, 39.5351], [-7.4429, 39.5472], [-7.4497, 39.5625], [-7.4656, 39.5778], [-7.4767, 39.5795], [-7.4922, 39.5869], [-7.505, 39.6068], [-7.5062, 39.6143], [-7.5242, 39.6344], [-7.5249, 39.6563], [-7.5313, 39.6674], [-7.5176, 39.6656], [-7.4869, 39.6652], [-7.4772, 39.6625], [-7.4554, 39.6621], [-7.4377, 39.6577], [-7.43, 39.6527], [-7.4022, 39.6461], [-7.3752, 39.6507], [-7.3299, 39.6414], [-7.3184, 39.6485], [-7.2941, 39.655], [-7.2853, 39.6613], [-7.2502, 39.6668], [-7.2164, 39.6601], [-7.2013, 39.662], [-7.1707, 39.656], [-7.147, 39.6532], [-7.1244, 39.6635], [-7.091, 39.6631], [-7.0731, 39.6582], [-7.0532, 39.6599], [-7.0144, 39.6711], [-7.0045, 39.699], [-6.9914, 39.7231], [-6.99, 39.7439], [-6.9855, 39.7633], [-6.9752, 39.7715], [-6.9754, 39.7767], [-6.988, 39.7965], [-6.9835, 39.8125], [-6.9778, 39.8194], [-6.9657, 39.8244], [-6.951, 39.8239], [-6.935, 39.8385], [-6.929, 39.852], [-6.9076, 39.8635], [-6.9028, 39.8748], [-6.9038, 39.892], [-6.8984, 39.8988], [-6.8979, 39.9109], [-6.905, 39.9195], [-6.9033, 39.9262], [-6.8879, 39.9349], [-6.8836, 39.9503], [-6.8869, 39.9615], [-6.8823, 39.9693], [-6.883, 39.9798], [-6.8629, 40.0098], [-6.8735, 40.0235], [-6.8807, 40.0414], [-6.8949, 40.0514], [-6.8938, 40.0621], [-6.9039, 40.0622], [-6.9156, 40.0694], [-6.9206, 40.0871], [-6.9383, 40.1084], [-6.9508, 40.1141], [-6.9749, 40.1195], [-6.9985, 40.1177], [-7.0137, 40.1365], [-7.017, 40.146], [-7.0143, 40.1595], [-7.0196, 40.1684], [-7.0172, 40.1767], [-7.029, 40.1847], [-7.0202, 40.1975], [-7.0103, 40.2261], [-7, 40.2327], [-6.9786, 40.2398], [-6.9648, 40.237], [-6.9519, 40.257], [-6.926, 40.2572], [-6.9096, 40.2537], [-6.8957, 40.2583], [-6.8784, 40.2592], [-6.8656, 40.2673]]] }, "properties": { "name": "Extremadura", "id": "ES-EX", "CNTRY": "Spain", "TYPE": "Autonomous Community" }, "id": "ES-EX" }, { "type": "Feature", "geometry": { "type": "MultiPolygon", "coordinates": [[[[0.5141, 40.5227], [0.4881, 40.5285], [0.4475, 40.5425], [0.4383, 40.5474], [0.4349, 40.5656], [0.4397, 40.579], [0.4319, 40.5788], [0.4073, 40.5939], [0.4019, 40.6023], [0.387, 40.6068], [0.3722, 40.6061], [0.3396, 40.6081], [0.3157, 40.6149], [0.2979, 40.6257], [0.2909, 40.6244], [0.2786, 40.6308], [0.2662, 40.6447], [0.2682, 40.6583], [0.2744, 40.6688], [0.2819, 40.6724], [0.2925, 40.685], [0.2788, 40.6926], [0.2624, 40.7055], [0.2373, 40.7003], [0.2239, 40.7255], [0.2144, 40.7306], [0.1976, 40.7237], [0.1903, 40.7303], [0.1826, 40.7277], [0.1699, 40.7336], [0.165, 40.7434], [0.177, 40.7544], [0.189, 40.7507], [0.2127, 40.767], [0.2235, 40.7655], [0.2349, 40.7757], [0.2347, 40.7861], [0.2506, 40.7972], [0.2576, 40.7984], [0.2647, 40.8115], [0.2776, 40.8212], [0.2597, 40.8381], [0.2517, 40.8549], [0.2551, 40.8729], [0.2419, 40.8808], [0.2498, 40.8953], [0.2491, 40.9073], [0.2612, 40.927], [0.2732, 40.9334], [0.2714, 40.9429], [0.2805, 40.9502], [0.2864, 40.9639], [0.281, 40.9745], [0.2825, 40.9821], [0.2693, 40.9966], [0.2728, 41.0091], [0.2632, 41.0116], [0.2638, 41.0263], [0.2495, 41.0384], [0.2322, 41.0355], [0.2353, 41.0445], [0.2298, 41.058], [0.2199, 41.0652], [0.2219, 41.0791], [0.2153, 41.0839], [0.2018, 41.0853], [0.2016, 41.1036], [0.2086, 41.1162], [0.2048, 41.1273], [0.2197, 41.1309], [0.2469, 41.1287], [0.2551, 41.1412], [0.2553, 41.1487], [0.2724, 41.147], [0.2944, 41.1558], [0.3028, 41.1623], [0.3093, 41.1875], [0.3208, 41.2216], [0.3316, 41.2208], [0.3384, 41.2282], [0.3627, 41.2232], [0.3648, 41.2362], [0.3791, 41.2348], [0.3737, 41.2465], [0.377, 41.2598], [0.3868, 41.2768], [0.365, 41.3028], [0.3706, 41.3142], [0.3662, 41.3196], [0.3481, 41.329], [0.3607, 41.3417], [0.3674, 41.3426], [0.3739, 41.3539], [0.3608, 41.3712], [0.3545, 41.3735], [0.3208, 41.3955], [0.3424, 41.4147], [0.3492, 41.4257], [0.3485, 41.4415], [0.3553, 41.4545], [0.3456, 41.4627], [0.342, 41.4806], [0.3475, 41.4878], [0.3737, 41.4845], [0.3983, 41.4905], [0.4107, 41.5037], [0.4195, 41.5172], [0.429, 41.5233], [0.4465, 41.549], [0.4325, 41.5654], [0.4318, 41.578], [0.4362, 41.5857], [0.4291, 41.6018], [0.4028, 41.5927], [0.3831, 41.5963], [0.3508, 41.5992], [0.347, 41.621], [0.3585, 41.6303], [0.3468, 41.6389], [0.3338, 41.6574], [0.3264, 41.6601], [0.328, 41.6789], [0.3442, 41.697], [0.3692, 41.7137], [0.3861, 41.7398], [0.3969, 41.7394], [0.4006, 41.7573], [0.4397, 41.7611], [0.4499, 41.7644], [0.4648, 41.7631], [0.4718, 41.7666], [0.4758, 41.7864], [0.4846, 41.7996], [0.5004, 41.8059], [0.5037, 41.8135], [0.5151, 41.8207], [0.5451, 41.82], [0.5559, 41.8347], [0.5559, 41.8501], [0.5603, 41.8532], [0.5815, 41.8508], [0.5822, 41.8623], [0.6085, 41.8708], [0.6092, 41.8773], [0.595, 41.8837], [0.6021, 41.906], [0.5971, 41.914], [0.6005, 41.922], [0.5649, 41.9314], [0.564, 41.9361], [0.5793, 41.9551], [0.5931, 41.9664], [0.6051, 41.9595], [0.613, 41.9733], [0.6261, 41.9897], [0.6465, 41.9917], [0.6551, 41.9964], [0.6623, 42.014], [0.6511, 42.0232], [0.6562, 42.039], [0.6662, 42.0409], [0.6736, 42.0678], [0.6798, 42.0748], [0.6856, 42.0925], [0.6985, 42.1036], [0.702, 42.1205], [0.6965, 42.129], [0.6934, 42.15], [0.7143, 42.1632], [0.6975, 42.1719], [0.703, 42.1903], [0.7092, 42.196], [0.7138, 42.2093], [0.7139, 42.2218], [0.7243, 42.2356], [0.7255, 42.2426], [0.7358, 42.2527], [0.7449, 42.2996], [0.7563, 42.3101], [0.7636, 42.3217], [0.746, 42.3267], [0.7418, 42.3334], [0.7542, 42.3472], [0.7695, 42.3505], [0.7646, 42.3564], [0.7446, 42.3575], [0.7311, 42.3619], [0.7343, 42.3712], [0.7454, 42.3847], [0.7381, 42.398], [0.7309, 42.4009], [0.7354, 42.4147], [0.7267, 42.4246], [0.7109, 42.4355], [0.7062, 42.4489], [0.7068, 42.4626], [0.6972, 42.4719], [0.6976, 42.4846], [0.7018, 42.4941], [0.7144, 42.4869], [0.7324, 42.5028], [0.7213, 42.5267], [0.7489, 42.5523], [0.7578, 42.5691], [0.7606, 42.5913], [0.7668, 42.6105], [0.7376, 42.6111], [0.7099, 42.6192], [0.6982, 42.6286], [0.7007, 42.6325], [0.6951, 42.6582], [0.6866, 42.6605], [0.6756, 42.6717], [0.6725, 42.6805], [0.6605, 42.6913], [0.6756, 42.6919], [0.6736, 42.6992], [0.6805, 42.7062], [0.6728, 42.718], [0.679, 42.7233], [0.6692, 42.7313], [0.6599, 42.7524], [0.6467, 42.7521], [0.6527, 42.7674], [0.666, 42.7755], [0.6493, 42.7788], [0.6587, 42.7987], [0.6688, 42.8026], [0.6643, 42.8142], [0.6692, 42.822], [0.6581, 42.8383], [0.6777, 42.8487], [0.6772, 42.855], [0.691, 42.8552], [0.708, 42.8616], [0.7336, 42.8549], [0.7377, 42.849], [0.7785, 42.836], [0.7956, 42.8396], [0.8115, 42.8383], [0.8328, 42.8282], [0.856, 42.8263], [0.8699, 42.8161], [0.8831, 42.8137], [0.9075, 42.7968], [0.9327, 42.7889], [0.9475, 42.8012], [0.9645, 42.8045], [0.9839, 42.7864], [1.0054, 42.7907], [1.0105, 42.788], [1.0383, 42.7865], [1.046, 42.7806], [1.0733, 42.7825], [1.0781, 42.788], [1.0922, 42.7759], [1.1076, 42.7721], [1.1325, 42.7497], [1.1301, 42.7406], [1.1338, 42.7282], [1.1486, 42.7218], [1.1653, 42.7097], [1.1744, 42.7089], [1.1897, 42.7176], [1.2157, 42.7201], [1.228, 42.7273], [1.2471, 42.7227], [1.2534, 42.7149], [1.2748, 42.7186], [1.2819, 42.7149], [1.2947, 42.7195], [1.3097, 42.718], [1.3255, 42.7243], [1.3384, 42.7185], [1.351, 42.7201], [1.3509, 42.7032], [1.3645, 42.695], [1.3764, 42.6954], [1.3897, 42.6865], [1.3897, 42.668], [1.3964, 42.6679], [1.4048, 42.6571], [1.4115, 42.656], [1.4152, 42.6374], [1.4264, 42.621], [1.4292, 42.6117], [1.4404, 42.5937], [1.4269, 42.5823], [1.4442, 42.5667], [1.4248, 42.5566], [1.4151, 42.5353], [1.4434, 42.543], [1.4533, 42.5325], [1.4682, 42.511], [1.4438, 42.4952], [1.4267, 42.4925], [1.4203, 42.4825], [1.432, 42.4823], [1.4413, 42.4753], [1.4407, 42.4645], [1.4486, 42.4376], [1.4578, 42.4346], [1.4732, 42.4352], [1.4965, 42.4324], [1.5155, 42.4279], [1.5508, 42.4324], [1.5537, 42.442], [1.5686, 42.4569], [1.5802, 42.4486], [1.5914, 42.4626], [1.5992, 42.4669], [1.609, 42.4632], [1.6579, 42.4667], [1.6639, 42.4725], [1.664, 42.4915], [1.6717, 42.5036], [1.6788, 42.4947], [1.7065, 42.4901], [1.7256, 42.5014], [1.7324, 42.4938], [1.7454, 42.4966], [1.7644, 42.4867], [1.7924, 42.4862], [1.8035, 42.4908], [1.8146, 42.4836], [1.823, 42.4868], [1.839, 42.4819], [1.857, 42.4645], [1.8783, 42.4601], [1.8808, 42.4489], [1.9164, 42.4457], [1.9315, 42.4534], [1.9408, 42.4405], [1.9398, 42.4286], [1.9542, 42.4261], [1.9553, 42.41], [1.9602, 42.4036], [1.9588, 42.3925], [1.9703, 42.3739], [1.9984, 42.3534], [2.0127, 42.3516], [2.0341, 42.3576], [2.06, 42.3586], [2.0774, 42.3654], [2.0855, 42.3619], [2.0934, 42.3772], [2.1168, 42.3838], [2.114, 42.3908], [2.1214, 42.3984], [2.1252, 42.4097], [2.1556, 42.4232], [2.1742, 42.4202], [2.1819, 42.4162], [2.2015, 42.4153], [2.2238, 42.4249], [2.245, 42.428], [2.2569, 42.4376], [2.2709, 42.433], [2.2902, 42.4229], [2.3058, 42.4269], [2.3171, 42.4256], [2.3263, 42.4156], [2.3431, 42.4158], [2.3528, 42.4046], [2.3867, 42.3997], [2.394, 42.395], [2.4143, 42.3909], [2.4288, 42.3937], [2.4351, 42.3907], [2.4347, 42.3753], [2.4549, 42.3683], [2.4656, 42.3606], [2.4822, 42.3398], [2.4999, 42.3421], [2.5264, 42.3327], [2.5414, 42.3331], [2.5624, 42.3567], [2.5881, 42.3569], [2.6086, 42.3472], [2.6553, 42.3408], [2.672, 42.3403], [2.6764, 42.3447], [2.6745, 42.3588], [2.6609, 42.3659], [2.6613, 42.377], [2.6548, 42.3886], [2.6705, 42.3869], [2.6747, 42.4045], [2.6916, 42.4058], [2.7166, 42.4201], [2.7335, 42.4239], [2.7555, 42.4253], [2.7708, 42.4111], [2.7842, 42.4167], [2.7988, 42.418], [2.804, 42.4293], [2.8165, 42.4392], [2.8273, 42.4389], [2.8397, 42.4586], [2.857, 42.454], [2.8723, 42.4671], [2.8821, 42.4603], [2.9035, 42.4571], [2.9245, 42.4588], [2.9313, 42.4735], [2.9461, 42.4806], [2.9594, 42.4738], [2.9672, 42.4652], [2.9807, 42.4678], [2.9884, 42.4739], [3.0016, 42.4723], [3.0135, 42.466], [3.0329, 42.4747], [3.0426, 42.4706], [3.0477, 42.4566], [3.0713, 42.4353], [3.0863, 42.4253], [3.0992, 42.4248], [3.1095, 42.4348], [3.1488, 42.4337], [3.1643, 42.4357], [3.1616, 42.4271], [3.1671, 42.4152], [3.1549, 42.4076], [3.1626, 42.4014], [3.1515, 42.3944], [3.1579, 42.3894], [3.1536, 42.3804], [3.165, 42.3688], [3.1614, 42.3606], [3.1861, 42.35], [3.184, 42.343], [3.1926, 42.3358], [3.202, 42.3394], [3.2015, 42.3467], [3.2134, 42.3497], [3.2367, 42.3488], [3.2354, 42.343], [3.2506, 42.3314], [3.2598, 42.3408], [3.2785, 42.3363], [3.3214, 42.3202], [3.3182, 42.315], [3.3021, 42.3117], [3.3002, 42.306], [3.287, 42.3029], [3.2908, 42.2926], [3.2802, 42.2889], [3.277, 42.2804], [3.2871, 42.2666], [3.2782, 42.2542], [3.2552, 42.2537], [3.2312, 42.2505], [3.2281, 42.2414], [3.2176, 42.2328], [3.207, 42.2407], [3.1905, 42.2463], [3.1793, 42.247], [3.1799, 42.2586], [3.1686, 42.2657], [3.149, 42.2606], [3.127, 42.2398], [3.1159, 42.2188], [3.1129, 42.2066], [3.1122, 42.1837], [3.114, 42.1605], [3.1249, 42.1277], [3.1351, 42.1271], [3.1421, 42.1154], [3.1499, 42.1203], [3.1759, 42.1118], [3.208, 42.0702], [3.2104, 42.0557], [3.2, 42.0529], [3.1966, 42.0457], [3.1941, 42.0261], [3.2002, 41.9949], [3.2136, 41.9748], [3.2314, 41.9694], [3.234, 41.9505], [3.2184, 41.9426], [3.2199, 41.9264], [3.2092, 41.9137], [3.2111, 41.9058], [3.2039, 41.8919], [3.1854, 41.8887], [3.1762, 41.8663], [3.1474, 41.8592], [3.1464, 41.8503], [3.1343, 41.847], [3.111, 41.8479], [3.1038, 41.8455], [3.0706, 41.8159], [3.0616, 41.7913], [3.0482, 41.7894], [3.0456, 41.7789], [3.0321, 41.7741], [3.0083, 41.7705], [2.9993, 41.7631], [2.9853, 41.7602], [2.9723, 41.753], [2.9595, 41.7404], [2.9596, 41.7355], [2.9357, 41.7201], [2.9358, 41.7153], [2.8887, 41.7014], [2.8846, 41.7036], [2.8657, 41.6979], [2.8534, 41.6995], [2.8413, 41.6928], [2.8309, 41.6928], [2.8175, 41.6877], [2.805, 41.6764], [2.7876, 41.6687], [2.7801, 41.6493], [2.7754, 41.6465], [2.7481, 41.6427], [2.716, 41.6272], [2.6693, 41.6134], [2.5697, 41.5801], [2.5615, 41.5783], [2.5211, 41.5634], [2.4955, 41.5506], [2.4747, 41.5456], [2.4605, 41.5394], [2.4435, 41.5277], [2.4112, 41.5084], [2.3849, 41.495], [2.3523, 41.4836], [2.313, 41.4744], [2.2946, 41.4686], [2.2676, 41.456], [2.251, 41.4428], [2.2313, 41.4157], [2.2066, 41.3925], [2.1923, 41.3744], [2.1826, 41.3748], [2.1676, 41.3537], [2.151, 41.3192], [2.1398, 41.3057], [2.127, 41.2956], [2.109, 41.2871], [2.046, 41.27], [2.016, 41.265], [1.9856, 41.2638], [1.9572, 41.2645], [1.9286, 41.2616], [1.9027, 41.2538], [1.8933, 41.2486], [1.87, 41.2432], [1.853, 41.2345], [1.814, 41.2361], [1.7959, 41.2303], [1.788, 41.2248], [1.7616, 41.2194], [1.7535, 41.2204], [1.7274, 41.2154], [1.7077, 41.2085], [1.6849, 41.204], [1.6747, 41.1989], [1.6495, 41.1971], [1.6275, 41.1925], [1.54, 41.1839], [1.5094, 41.1786], [1.463, 41.1649], [1.4067, 41.1401], [1.3914, 41.1313], [1.3836, 41.1342], [1.3481, 41.1274], [1.3074, 41.1283], [1.2979, 41.1267], [1.2666, 41.1117], [1.2363, 41.1054], [1.2237, 41.1064], [1.2012, 41.0947], [1.1889, 41.083], [1.1801, 41.0698], [1.1813, 41.0635], [1.1715, 41.0546], [1.1614, 41.0556], [1.1576, 41.0636], [1.1445, 41.0712], [1.1312, 41.0744], [1.1041, 41.0704], [1.0831, 41.0633], [1.0708, 41.0666], [1.0504, 41.0641], [1.0041, 41.0433], [0.9906, 41.0424], [0.9592, 41.0232], [0.9393, 41.0048], [0.9314, 40.9927], [0.9196, 40.9899], [0.8957, 40.974], [0.8747, 40.9526], [0.8606, 40.9464], [0.8571, 40.9354], [0.8254, 40.9066], [0.8257, 40.903], [0.8009, 40.8818], [0.7954, 40.87], [0.7808, 40.86], [0.7692, 40.8574], [0.7615, 40.846], [0.751, 40.8457], [0.7439, 40.8374], [0.7406, 40.8225], [0.7064, 40.8091], [0.6999, 40.8035], [0.7123, 40.7823], [0.7305, 40.768], [0.746, 40.7629], [0.7688, 40.7625], [0.7794, 40.7675], [0.7822, 40.7746], [0.7707, 40.7799], [0.7486, 40.7859], [0.7497, 40.7914], [0.7641, 40.7915], [0.7761, 40.7876], [0.7847, 40.7806], [0.7978, 40.7642], [0.8089, 40.7552], [0.8326, 40.7315], [0.863, 40.7207], [0.8678, 40.7294], [0.8966, 40.7243], [0.8929, 40.7168], [0.8698, 40.6938], [0.8483, 40.6781], [0.8318, 40.6703], [0.8092, 40.6654], [0.774, 40.6505], [0.7591, 40.6423], [0.7466, 40.6309], [0.7132, 40.5879], [0.6878, 40.5669], [0.661, 40.5571], [0.643, 40.555], [0.6272, 40.5561], [0.6153, 40.56], [0.6044, 40.5689], [0.6157, 40.58], [0.6154, 40.5883], [0.6493, 40.5695], [0.6653, 40.5738], [0.652, 40.5833], [0.6604, 40.592], [0.6723, 40.593], [0.6898, 40.5889], [0.714, 40.5926], [0.7306, 40.613], [0.7457, 40.6359], [0.7254, 40.6394], [0.6915, 40.6371], [0.6632, 40.6264], [0.6321, 40.6225], [0.6068, 40.623], [0.5931, 40.6163], [0.5816, 40.6035], [0.5601, 40.5843], [0.5388, 40.5676], [0.5339, 40.5558], [0.5229, 40.5446], [0.5141, 40.5227]]], [[[2.0036, 42.4522], [2.001, 42.4482], [1.9666, 42.4511], [1.9476, 42.4587], [1.9518, 42.4743], [1.969, 42.479], [1.9801, 42.4941], [1.9881, 42.494], [1.981, 42.4741], [1.9853, 42.466], [2.0036, 42.4522]]]] }, "properties": { "name": "Cataluรฑa", "id": "ES-CT", "CNTRY": "Spain", "TYPE": "Autonomous Community" }, "id": "ES-CT" }, { "type": "Feature", "geometry": { "type": "MultiPolygon", "coordinates": [[[[-16.7625, 28.3759], [-16.7511, 28.3712], [-16.7417, 28.3796], [-16.7263, 28.3801], [-16.7207, 28.3874], [-16.7092, 28.3839], [-16.6952, 28.3879], [-16.6954, 28.3947], [-16.681, 28.3916], [-16.6742, 28.4023], [-16.6606, 28.4016], [-16.6535, 28.3962], [-16.6446, 28.399], [-16.6368, 28.3948], [-16.6272, 28.3966], [-16.6035, 28.3945], [-16.598, 28.4008], [-16.589, 28.3983], [-16.5633, 28.4112], [-16.5549, 28.4183], [-16.5389, 28.4168], [-16.5109, 28.4206], [-16.5031, 28.4258], [-16.497, 28.4388], [-16.4765, 28.4416], [-16.4659, 28.46], [-16.4554, 28.4611], [-16.4541, 28.4704], [-16.43, 28.4879], [-16.426, 28.4957], [-16.4209, 28.5178], [-16.3988, 28.5337], [-16.3975, 28.538], [-16.384, 28.5454], [-16.3545, 28.5497], [-16.3438, 28.5564], [-16.3365, 28.5562], [-16.3292, 28.5766], [-16.3186, 28.578], [-16.2966, 28.5692], [-16.2779, 28.572], [-16.2722, 28.5779], [-16.2569, 28.5699], [-16.2436, 28.5719], [-16.2231, 28.5656], [-16.1914, 28.5738], [-16.1711, 28.5848], [-16.158, 28.5882], [-16.1382, 28.5834], [-16.1268, 28.5714], [-16.1195, 28.5523], [-16.1267, 28.5476], [-16.1291, 28.5361], [-16.1387, 28.531], [-16.143, 28.5207], [-16.1512, 28.523], [-16.1672, 28.5184], [-16.1875, 28.5084], [-16.1952, 28.4988], [-16.2019, 28.4986], [-16.2372, 28.4849], [-16.2449, 28.4748], [-16.2522, 28.4548], [-16.2691, 28.448], [-16.2805, 28.4335], [-16.2941, 28.4207], [-16.3197, 28.4014], [-16.3342, 28.4], [-16.348, 28.3861], [-16.3607, 28.3792], [-16.3614, 28.37], [-16.3693, 28.3554], [-16.3671, 28.3404], [-16.3593, 28.319], [-16.3607, 28.3065], [-16.3836, 28.284], [-16.3825, 28.2759], [-16.3875, 28.2634], [-16.4067, 28.235], [-16.409, 28.2244], [-16.4173, 28.2153], [-16.4245, 28.2006], [-16.4222, 28.1939], [-16.4346, 28.1552], [-16.4257, 28.1514], [-16.4346, 28.1412], [-16.4398, 28.1427], [-16.4491, 28.1295], [-16.4639, 28.1182], [-16.4842, 28.0934], [-16.4901, 28.0903], [-16.4927, 28.0791], [-16.5038, 28.0769], [-16.5072, 28.0683], [-16.5223, 28.0584], [-16.5236, 28.0524], [-16.5415, 28.0421], [-16.5417, 28.0293], [-16.5469, 28.0252], [-16.5571, 28.0317], [-16.5669, 28.0293], [-16.5959, 28.0293], [-16.6072, 28.0228], [-16.6254, 28.0182], [-16.633, 28.0087], [-16.6441, 28.0039], [-16.6609, 28.0091], [-16.6715, 28.0053], [-16.6782, 27.9987], [-16.6856, 27.9985], [-16.7016, 28.0044], [-16.7076, 28.0111], [-16.705, 28.0282], [-16.7103, 28.0356], [-16.7115, 28.0467], [-16.7253, 28.0536], [-16.736, 28.0543], [-16.7334, 28.0728], [-16.7408, 28.09], [-16.7561, 28.0988], [-16.7581, 28.1055], [-16.7689, 28.1101], [-16.7929, 28.1394], [-16.8061, 28.1628], [-16.8051, 28.1701], [-16.8134, 28.18], [-16.8196, 28.1803], [-16.8365, 28.2104], [-16.8381, 28.2239], [-16.8452, 28.2376], [-16.8379, 28.2546], [-16.8413, 28.2643], [-16.8591, 28.2744], [-16.8617, 28.2856], [-16.8716, 28.2996], [-16.8812, 28.3039], [-16.8813, 28.3133], [-16.895, 28.323], [-16.8966, 28.3311], [-16.9051, 28.3384], [-16.9214, 28.3433], [-16.9231, 28.3555], [-16.9177, 28.3611], [-16.9048, 28.3652], [-16.8978, 28.363], [-16.862, 28.3757], [-16.8489, 28.3878], [-16.8331, 28.3931], [-16.8087, 28.3767], [-16.795, 28.3774], [-16.7742, 28.3748], [-16.7625, 28.3759]]], [[[-17.9251, 27.8495], [-17.9075, 27.8432], [-17.8938, 27.8294], [-17.8946, 27.8235], [-17.8838, 27.8129], [-17.883, 27.8047], [-17.8958, 27.7873], [-17.9019, 27.7861], [-17.9099, 27.7727], [-17.9099, 27.7651], [-17.9191, 27.7542], [-17.9255, 27.7418], [-17.927, 27.7314], [-17.9366, 27.7269], [-17.9489, 27.7281], [-17.9569, 27.7188], [-17.9581, 27.6952], [-17.9645, 27.689], [-17.9662, 27.6792], [-17.9719, 27.6718], [-17.9706, 27.6475], [-17.9778, 27.6389], [-17.9861, 27.6375], [-17.9977, 27.6453], [-18.0095, 27.6489], [-18.0281, 27.6715], [-18.0289, 27.6782], [-18.0503, 27.6919], [-18.0739, 27.6966], [-18.0829, 27.6962], [-18.0976, 27.7002], [-18.1237, 27.7042], [-18.1452, 27.7027], [-18.1611, 27.7156], [-18.1603, 27.7251], [-18.1523, 27.7319], [-18.1535, 27.7566], [-18.1401, 27.7632], [-18.1318, 27.771], [-18.122, 27.7682], [-18.1187, 27.762], [-18.105, 27.7561], [-18.0719, 27.7524], [-18.0396, 27.762], [-18.0188, 27.7748], [-18.0152, 27.7815], [-17.9982, 27.7906], [-17.9886, 27.8002], [-17.9899, 27.8176], [-17.9827, 27.825], [-17.9748, 27.8258], [-17.9557, 27.8419], [-17.948, 27.8402], [-17.9338, 27.8485], [-17.9251, 27.8495]]], [[[-13.505, 29.4156], [-13.4952, 29.4099], [-13.4906, 29.4012], [-13.4952, 29.3936], [-13.5069, 29.3845], [-13.5227, 29.3822], [-13.5306, 29.3856], [-13.5325, 29.3971], [-13.523, 29.4113], [-13.505, 29.4156]]], [[[-17.2735, 28.2152], [-17.2613, 28.2174], [-17.243, 28.2006], [-17.2341, 28.2036], [-17.2078, 28.198], [-17.1936, 28.1978], [-17.1842, 28.1866], [-17.1828, 28.1799], [-17.166, 28.1786], [-17.1654, 28.1726], [-17.1384, 28.1601], [-17.1103, 28.1404], [-17.1045, 28.1298], [-17.1055, 28.1111], [-17.1008, 28.0922], [-17.1136, 28.0853], [-17.1137, 28.08], [-17.124, 28.0715], [-17.1286, 28.0726], [-17.1611, 28.0473], [-17.1677, 28.0364], [-17.1816, 28.0366], [-17.1863, 28.029], [-17.1994, 28.0236], [-17.2278, 28.0267], [-17.2451, 28.0197], [-17.2513, 28.0251], [-17.2706, 28.0255], [-17.2735, 28.0363], [-17.2896, 28.0384], [-17.2987, 28.0499], [-17.3112, 28.0524], [-17.3198, 28.0591], [-17.3187, 28.0692], [-17.3248, 28.0805], [-17.3398, 28.0871], [-17.3472, 28.1021], [-17.3473, 28.1196], [-17.3421, 28.1285], [-17.3461, 28.1439], [-17.3417, 28.1571], [-17.3342, 28.164], [-17.3359, 28.1758], [-17.3271, 28.1891], [-17.3212, 28.1922], [-17.3166, 28.2049], [-17.3076, 28.2032], [-17.2992, 28.2085], [-17.2735, 28.2152]]], [[[-17.9106, 28.8568], [-17.905, 28.8479], [-17.8881, 28.8398], [-17.858, 28.8324], [-17.8144, 28.839], [-17.8071, 28.843], [-17.7784, 28.8393], [-17.7745, 28.8248], [-17.7592, 28.8033], [-17.7575, 28.7859], [-17.7505, 28.7719], [-17.7416, 28.7605], [-17.735, 28.7574], [-17.7293, 28.7438], [-17.7237, 28.7381], [-17.7364, 28.7161], [-17.7516, 28.7062], [-17.759, 28.6964], [-17.7592, 28.6872], [-17.7704, 28.676], [-17.7616, 28.6537], [-17.7563, 28.6488], [-17.7579, 28.64], [-17.7501, 28.6201], [-17.7562, 28.6119], [-17.7552, 28.5924], [-17.7608, 28.5772], [-17.7595, 28.5703], [-17.7706, 28.556], [-17.7859, 28.5441], [-17.7961, 28.5183], [-17.8005, 28.5173], [-17.8072, 28.5041], [-17.817, 28.4954], [-17.8241, 28.4761], [-17.8335, 28.4566], [-17.8412, 28.4525], [-17.8684, 28.4728], [-17.8689, 28.4825], [-17.8769, 28.4997], [-17.8748, 28.509], [-17.8792, 28.524], [-17.8806, 28.5399], [-17.8937, 28.5563], [-17.8994, 28.5713], [-17.9073, 28.5756], [-17.9108, 28.5855], [-17.9262, 28.596], [-17.9231, 28.6076], [-17.9333, 28.6247], [-17.9395, 28.6402], [-17.9465, 28.6502], [-17.9645, 28.6671], [-17.9629, 28.674], [-17.9667, 28.6876], [-17.9747, 28.7022], [-17.9747, 28.7103], [-17.9815, 28.7176], [-17.9811, 28.7259], [-17.9903, 28.733], [-17.9951, 28.7434], [-18.0076, 28.7574], [-18.0057, 28.7842], [-17.9799, 28.8028], [-17.964, 28.8265], [-17.9507, 28.835], [-17.9474, 28.8423], [-17.9392, 28.841], [-17.9234, 28.8496], [-17.9203, 28.8572], [-17.9106, 28.8568]]], [[[-15.4193, 28.1805], [-15.4065, 28.1779], [-15.4034, 28.1724], [-15.4101, 28.1504], [-15.4173, 28.146], [-15.4276, 28.1462], [-15.4288, 28.1284], [-15.4141, 28.1104], [-15.4105, 28.0989], [-15.416, 28.0835], [-15.4133, 28.0757], [-15.4194, 28.0616], [-15.4129, 28.0522], [-15.4157, 28.0475], [-15.4041, 28.0362], [-15.388, 28.0292], [-15.3846, 28.0162], [-15.3772, 28.0094], [-15.3703, 27.9933], [-15.3832, 27.972], [-15.3812, 27.9573], [-15.3691, 27.9387], [-15.3587, 27.9339], [-15.3615, 27.9284], [-15.3749, 27.935], [-15.3846, 27.9254], [-15.3864, 27.9024], [-15.3935, 27.8912], [-15.3899, 27.8801], [-15.3809, 27.8758], [-15.3868, 27.8662], [-15.3852, 27.8577], [-15.398, 27.8565], [-15.405, 27.8475], [-15.4116, 27.8474], [-15.4226, 27.8309], [-15.4225, 27.8108], [-15.4308, 27.8033], [-15.4429, 27.7991], [-15.4736, 27.7935], [-15.4896, 27.7924], [-15.5085, 27.7803], [-15.516, 27.7813], [-15.5272, 27.7764], [-15.5344, 27.7695], [-15.5507, 27.7662], [-15.5651, 27.7571], [-15.5689, 27.7389], [-15.5799, 27.7334], [-15.5999, 27.7337], [-15.6197, 27.7478], [-15.6301, 27.7445], [-15.6595, 27.7562], [-15.67, 27.7536], [-15.6807, 27.7558], [-15.6924, 27.7723], [-15.6988, 27.771], [-15.7129, 27.7821], [-15.7229, 27.787], [-15.7307, 27.7979], [-15.7413, 27.8005], [-15.7532, 27.814], [-15.7683, 27.8179], [-15.7786, 27.8299], [-15.7867, 27.8335], [-15.792, 27.8468], [-15.8177, 27.8923], [-15.8344, 27.9147], [-15.8296, 27.9308], [-15.8279, 27.9489], [-15.8332, 27.9591], [-15.8344, 27.9699], [-15.8229, 27.9881], [-15.8177, 28.0037], [-15.8228, 28.0131], [-15.7907, 28.0185], [-15.7811, 28.024], [-15.7614, 28.0443], [-15.7376, 28.0541], [-15.7338, 28.0634], [-15.7206, 28.0694], [-15.7112, 28.0825], [-15.708, 28.0947], [-15.7132, 28.1017], [-15.7075, 28.1071], [-15.7049, 28.1301], [-15.6994, 28.1351], [-15.7042, 28.142], [-15.6975, 28.1519], [-15.7067, 28.1568], [-15.6914, 28.1684], [-15.6831, 28.1698], [-15.6705, 28.1581], [-15.6538, 28.1653], [-15.6464, 28.1649], [-15.6379, 28.1716], [-15.6313, 28.1691], [-15.6254, 28.1588], [-15.5978, 28.144], [-15.5883, 28.1471], [-15.5805, 28.1438], [-15.5593, 28.1464], [-15.5459, 28.1461], [-15.5296, 28.1545], [-15.5172, 28.147], [-15.4957, 28.1444], [-15.4796, 28.1363], [-15.4689, 28.1263], [-15.4457, 28.1307], [-15.4312, 28.1453], [-15.4329, 28.1569], [-15.4411, 28.1618], [-15.4395, 28.1686], [-15.4303, 28.1718], [-15.4193, 28.1805]]], [[[-13.81, 28.7665], [-13.8098, 28.7557], [-13.8137, 28.7416], [-13.8195, 28.7364], [-13.8359, 28.7512], [-13.8248, 28.757], [-13.8218, 28.767], [-13.81, 28.7665]]], [[[-13.5082, 29.2903], [-13.4936, 29.2791], [-13.4854, 29.2798], [-13.4745, 29.271], [-13.4732, 29.2636], [-13.4838, 29.2592], [-13.4898, 29.244], [-13.5052, 29.2245], [-13.5144, 29.2256], [-13.5234, 29.2183], [-13.5453, 29.2207], [-13.5454, 29.2323], [-13.5273, 29.2419], [-13.527, 29.2511], [-13.5212, 29.2578], [-13.5224, 29.2693], [-13.517, 29.2813], [-13.5082, 29.2903]]], [[[-13.8937, 28.7571], [-13.8807, 28.7536], [-13.8668, 28.7345], [-13.8529, 28.7275], [-13.8431, 28.7268], [-13.8367, 28.7122], [-13.8367, 28.7045], [-13.8309, 28.6942], [-13.8337, 28.6752], [-13.8305, 28.6566], [-13.8303, 28.6386], [-13.8236, 28.6117], [-13.828, 28.6064], [-13.8226, 28.593], [-13.8303, 28.5757], [-13.8266, 28.554], [-13.8387, 28.5376], [-13.8351, 28.5263], [-13.8434, 28.5123], [-13.8435, 28.5043], [-13.8596, 28.4982], [-13.8679, 28.4808], [-13.8575, 28.4611], [-13.8627, 28.4394], [-13.8582, 28.4252], [-13.8517, 28.4229], [-13.8489, 28.4101], [-13.8532, 28.403], [-13.8539, 28.3916], [-13.8638, 28.384], [-13.8691, 28.3656], [-13.8778, 28.3553], [-13.8783, 28.3409], [-13.894, 28.3249], [-13.8937, 28.3141], [-13.8991, 28.3112], [-13.9028, 28.2971], [-13.898, 28.2931], [-13.8999, 28.2804], [-13.9103, 28.274], [-13.9174, 28.2521], [-13.9356, 28.2346], [-13.9485, 28.2278], [-13.9797, 28.2292], [-13.9886, 28.2275], [-13.9955, 28.2181], [-14.0121, 28.2077], [-14.0192, 28.2111], [-14.0418, 28.2026], [-14.0754, 28.2011], [-14.0945, 28.1927], [-14.112, 28.1885], [-14.1157, 28.1914], [-14.1363, 28.1871], [-14.1585, 28.1759], [-14.2007, 28.1725], [-14.2123, 28.1641], [-14.2237, 28.1618], [-14.2307, 28.1487], [-14.2497, 28.1278], [-14.2727, 28.0987], [-14.2867, 28.0842], [-14.3016, 28.0738], [-14.321, 28.0503], [-14.3361, 28.044], [-14.3687, 28.0542], [-14.3781, 28.0523], [-14.4004, 28.0582], [-14.4076, 28.0582], [-14.4521, 28.0732], [-14.4812, 28.0777], [-14.5034, 28.0717], [-14.5025, 28.0799], [-14.4937, 28.0835], [-14.4951, 28.1037], [-14.4824, 28.1003], [-14.4733, 28.1038], [-14.452, 28.1006], [-14.4264, 28.1027], [-14.3839, 28.1133], [-14.3687, 28.1183], [-14.3547, 28.1259], [-14.3268, 28.137], [-14.307, 28.1486], [-14.2968, 28.1595], [-14.273, 28.1737], [-14.2454, 28.1942], [-14.2409, 28.2015], [-14.2244, 28.2122], [-14.2145, 28.227], [-14.2131, 28.2467], [-14.2078, 28.2593], [-14.2078, 28.271], [-14.2125, 28.2879], [-14.2062, 28.3016], [-14.2086, 28.3103], [-14.1989, 28.3329], [-14.1767, 28.3457], [-14.171, 28.3618], [-14.1621, 28.3686], [-14.1612, 28.3919], [-14.1546, 28.3956], [-14.1583, 28.4071], [-14.1521, 28.4206], [-14.1467, 28.4391], [-14.1278, 28.4568], [-14.1121, 28.4667], [-14.0986, 28.4802], [-14.083, 28.5139], [-14.0748, 28.5241], [-14.0669, 28.5512], [-14.0593, 28.5561], [-14.0566, 28.5656], [-14.049, 28.5717], [-14.0338, 28.5948], [-14.0393, 28.6156], [-14.0321, 28.6261], [-14.0271, 28.6415], [-14.0091, 28.6756], [-14.0192, 28.7075], [-14.017, 28.7152], [-14.0053, 28.7114], [-13.9991, 28.7222], [-13.9884, 28.7247], [-13.9779, 28.7339], [-13.956, 28.736], [-13.9418, 28.7463], [-13.9244, 28.7531], [-13.9193, 28.7476], [-13.9081, 28.7475], [-13.9011, 28.7556], [-13.8937, 28.7571]]], [[[-13.4662, 29.2266], [-13.4546, 29.2259], [-13.4242, 29.2083], [-13.4201, 29.1973], [-13.4223, 29.1764], [-13.4262, 29.1726], [-13.4276, 29.1579], [-13.447, 29.1461], [-13.4648, 29.1279], [-13.4641, 29.1155], [-13.4552, 29.1034], [-13.45, 29.1018], [-13.4481, 29.0876], [-13.4611, 29.0591], [-13.4665, 29.0558], [-13.4637, 29.0453], [-13.4693, 29.0331], [-13.4637, 29.0242], [-13.4677, 29.0154], [-13.4766, 29.0137], [-13.4771, 29.0051], [-13.4863, 28.9927], [-13.4964, 28.992], [-13.5089, 28.9852], [-13.5165, 28.9774], [-13.5372, 28.969], [-13.5436, 28.9606], [-13.5969, 28.9485], [-13.6151, 28.9312], [-13.635, 28.9252], [-13.6429, 28.9189], [-13.6677, 28.9184], [-13.6756, 28.9215], [-13.7104, 28.9155], [-13.7293, 28.9057], [-13.7354, 28.9067], [-13.7431, 28.8951], [-13.7524, 28.8741], [-13.7713, 28.8562], [-13.7786, 28.8432], [-13.7886, 28.8398], [-13.7939, 28.8535], [-13.8024, 28.8586], [-13.8101, 28.8562], [-13.8234, 28.8624], [-13.8344, 28.8602], [-13.8627, 28.8607], [-13.8697, 28.8549], [-13.8769, 28.8593], [-13.8748, 28.8734], [-13.8815, 28.8863], [-13.8729, 28.8939], [-13.8604, 28.8957], [-13.847, 28.9154], [-13.8295, 28.9285], [-13.8336, 28.9391], [-13.8306, 28.9603], [-13.8335, 28.9642], [-13.8294, 28.9765], [-13.8335, 28.9891], [-13.8293, 29.0085], [-13.8151, 29.0335], [-13.8089, 29.0348], [-13.7929, 29.0521], [-13.779, 29.0627], [-13.7625, 29.0668], [-13.7575, 29.076], [-13.7212, 29.0847], [-13.7097, 29.0794], [-13.7005, 29.0894], [-13.6932, 29.089], [-13.6775, 29.1027], [-13.6541, 29.1138], [-13.6523, 29.1219], [-13.6455, 29.1242], [-13.6397, 29.1164], [-13.6304, 29.1166], [-13.6202, 29.1273], [-13.6123, 29.1279], [-13.6038, 29.1351], [-13.5839, 29.1326], [-13.5615, 29.1161], [-13.5476, 29.1185], [-13.5382, 29.1249], [-13.525, 29.1416], [-13.522, 29.169], [-13.5125, 29.1812], [-13.5043, 29.2039], [-13.4979, 29.2075], [-13.4966, 29.2189], [-13.4826, 29.2252], [-13.469, 29.2359], [-13.4662, 29.2266]]]] }, "properties": { "name": "Islas Canarias", "id": "ES-CN", "CNTRY": "Spain", "TYPE": "Autonomous Community" }, "id": "ES-CN" }, { "type": "Feature", "geometry": { "type": "MultiPolygon", "coordinates": [[[[-4.2741, 40.6753], [-4.2715, 40.681], [-4.2519, 40.6883], [-4.2368, 40.688], [-4.1842, 40.6978], [-4.1609, 40.689], [-4.173, 40.6777], [-4.175, 40.6671], [-4.1694, 40.6629], [-4.1677, 40.6443], [-4.1724, 40.6307], [-4.1617, 40.6238], [-4.2135, 40.6065], [-4.2466, 40.6033], [-4.2596, 40.605], [-4.2659, 40.6108], [-4.2715, 40.6289], [-4.2905, 40.6286], [-4.305, 40.6378], [-4.3338, 40.6377], [-4.3266, 40.648], [-4.3198, 40.6482], [-4.2903, 40.653], [-4.2567, 40.6518], [-4.2564, 40.6625], [-4.268, 40.6739], [-4.2741, 40.6753]]], [[[-3.5389, 41.1637], [-3.516, 41.1607], [-3.4926, 41.175], [-3.4738, 41.181], [-3.4586, 41.19], [-3.4425, 41.2129], [-3.417, 41.2144], [-3.4026, 41.2112], [-3.4009, 41.2236], [-3.4045, 41.2356], [-3.3985, 41.2399], [-3.4, 41.2526], [-3.3911, 41.2557], [-3.3672, 41.2582], [-3.3363, 41.2514], [-3.3243, 41.2605], [-3.2914, 41.2572], [-3.2881, 41.2648], [-3.2733, 41.2752], [-3.2591, 41.2678], [-3.2553, 41.2576], [-3.2406, 41.281], [-3.2394, 41.288], [-3.2288, 41.2971], [-3.2072, 41.3033], [-3.1914, 41.3024], [-3.1586, 41.2945], [-3.1113, 41.2885], [-3.1004, 41.2814], [-3.0936, 41.2851], [-3.0621, 41.275], [-3.0268, 41.2854], [-3.0192, 41.2899], [-3.0067, 41.2855], [-2.9635, 41.2934], [-2.9513, 41.2936], [-2.9424, 41.3012], [-2.9419, 41.3133], [-2.9271, 41.3196], [-2.9164, 41.3195], [-2.9073, 41.328], [-2.8919, 41.3257], [-2.8696, 41.3175], [-2.8735, 41.2988], [-2.8638, 41.2879], [-2.8656, 41.2742], [-2.8313, 41.2646], [-2.8185, 41.2573], [-2.7773, 41.2543], [-2.7675, 41.2689], [-2.7612, 41.2731], [-2.733, 41.2725], [-2.7176, 41.274], [-2.7087, 41.2522], [-2.689, 41.2434], [-2.6717, 41.2395], [-2.6463, 41.2407], [-2.634, 41.2325], [-2.635, 41.2228], [-2.6218, 41.2209], [-2.5902, 41.2255], [-2.5878, 41.2132], [-2.5937, 41.2002], [-2.6014, 41.1952], [-2.616, 41.1952], [-2.6194, 41.1845], [-2.5977, 41.1862], [-2.5826, 41.1822], [-2.5792, 41.1761], [-2.585, 41.1617], [-2.595, 41.1517], [-2.574, 41.1411], [-2.566, 41.1466], [-2.5447, 41.1529], [-2.5364, 41.1635], [-2.519, 41.1527], [-2.5162, 41.1386], [-2.5083, 41.1225], [-2.4845, 41.1202], [-2.4682, 41.0937], [-2.4673, 41.0808], [-2.4493, 41.0795], [-2.4167, 41.061], [-2.401, 41.0639], [-2.3767, 41.0793], [-2.355, 41.0891], [-2.343, 41.0765], [-2.3286, 41.0694], [-2.3216, 41.0602], [-2.2908, 41.0741], [-2.2811, 41.0677], [-2.2611, 41.0707], [-2.2326, 41.0983], [-2.2179, 41.0937], [-2.1786, 41.0857], [-2.1705, 41.0981], [-2.1435, 41.1067], [-2.138, 41.1188], [-2.1317, 41.1192], [-2.1145, 41.1013], [-2.0976, 41.0926], [-2.0864, 41.0906], [-2.0772, 41.0843], [-2.0757, 41.0761], [-2.0596, 41.0696], [-2.0503, 41.0788], [-2.0608, 41.0869], [-2.0671, 41.0983], [-2.0639, 41.1195], [-2.0561, 41.1261], [-2.0553, 41.1478], [-2.0375, 41.1561], [-2.0072, 41.1563], [-1.9664, 41.1706], [-1.9495, 41.1668], [-1.9391, 41.1466], [-1.9285, 41.1367], [-1.913, 41.1327], [-1.9005, 41.1354], [-1.8896, 41.1325], [-1.8765, 41.1196], [-1.8703, 41.1096], [-1.8535, 41.1016], [-1.8164, 41.0947], [-1.8021, 41.0886], [-1.792, 41.0751], [-1.7721, 41.0678], [-1.7565, 41.0547], [-1.7578, 41.0464], [-1.7452, 41.0341], [-1.7329, 41.0291], [-1.6927, 40.995], [-1.6775, 40.9882], [-1.6603, 40.9771], [-1.6573, 40.9692], [-1.6284, 40.9468], [-1.6114, 40.9366], [-1.6082, 40.9198], [-1.6238, 40.8936], [-1.6205, 40.8784], [-1.6136, 40.8697], [-1.5927, 40.8518], [-1.5727, 40.8308], [-1.5562, 40.8283], [-1.5425, 40.8127], [-1.5386, 40.7936], [-1.5435, 40.7721], [-1.5412, 40.7585], [-1.556, 40.7481], [-1.5611, 40.7376], [-1.559, 40.7196], [-1.5533, 40.7038], [-1.5467, 40.7], [-1.5368, 40.686], [-1.5396, 40.6761], [-1.5396, 40.6582], [-1.55, 40.6444], [-1.5549, 40.6274], [-1.5643, 40.614], [-1.5467, 40.5961], [-1.5561, 40.5855], [-1.5803, 40.5694], [-1.5988, 40.5621], [-1.6352, 40.5793], [-1.6661, 40.5823], [-1.6738, 40.5915], [-1.6931, 40.5758], [-1.6905, 40.5635], [-1.7002, 40.5447], [-1.7021, 40.5353], [-1.6947, 40.5119], [-1.6928, 40.4884], [-1.7354, 40.4728], [-1.7535, 40.4584], [-1.7686, 40.4382], [-1.7792, 40.4272], [-1.8006, 40.413], [-1.8029, 40.3988], [-1.7881, 40.397], [-1.7674, 40.3827], [-1.7528, 40.3616], [-1.7377, 40.348], [-1.7211, 40.3407], [-1.7069, 40.3268], [-1.6981, 40.322], [-1.7073, 40.3146], [-1.7195, 40.318], [-1.7287, 40.3019], [-1.7277, 40.2911], [-1.7199, 40.2776], [-1.7101, 40.2809], [-1.7103, 40.2904], [-1.7015, 40.305], [-1.6898, 40.3103], [-1.6834, 40.3031], [-1.6666, 40.2947], [-1.6594, 40.283], [-1.6465, 40.2735], [-1.6116, 40.2436], [-1.5945, 40.2361], [-1.5726, 40.2143], [-1.5606, 40.2071], [-1.5417, 40.19], [-1.5337, 40.1898], [-1.5204, 40.2], [-1.5098, 40.2026], [-1.4749, 40.1845], [-1.4396, 40.1961], [-1.4427, 40.1526], [-1.4505, 40.1426], [-1.4546, 40.1286], [-1.4449, 40.118], [-1.4127, 40.1027], [-1.4173, 40.0925], [-1.409, 40.0766], [-1.4018, 40.069], [-1.3833, 40.0415], [-1.3762, 40.0187], [-1.3594, 40.0107], [-1.3371, 40.0151], [-1.3237, 40.0117], [-1.2836, 40.0072], [-1.2582, 39.9964], [-1.2469, 39.9953], [-1.2217, 40.0009], [-1.1891, 40.0029], [-1.1642, 40.0114], [-1.1626, 39.9997], [-1.1451, 39.9837], [-1.141, 39.9704], [-1.1545, 39.9621], [-1.2041, 39.9492], [-1.2109, 39.9328], [-1.1965, 39.913], [-1.1998, 39.9007], [-1.2008, 39.8549], [-1.2108, 39.8368], [-1.2169, 39.8058], [-1.2347, 39.7815], [-1.2517, 39.7692], [-1.2748, 39.7396], [-1.272, 39.7136], [-1.2629, 39.6975], [-1.279, 39.6782], [-1.2916, 39.6719], [-1.3142, 39.6699], [-1.3412, 39.6799], [-1.3698, 39.6882], [-1.4041, 39.6659], [-1.4183, 39.6544], [-1.4393, 39.6234], [-1.4554, 39.5873], [-1.4624, 39.5766], [-1.4747, 39.5695], [-1.4997, 39.5647], [-1.5049, 39.5523], [-1.5056, 39.5203], [-1.5017, 39.5142], [-1.506, 39.5066], [-1.4987, 39.5001], [-1.5012, 39.4926], [-1.5096, 39.4901], [-1.5126, 39.4579], [-1.5212, 39.4398], [-1.5107, 39.4341], [-1.4968, 39.4148], [-1.4878, 39.416], [-1.4881, 39.4025], [-1.4658, 39.4024], [-1.4755, 39.3932], [-1.4649, 39.3912], [-1.4589, 39.401], [-1.4509, 39.3964], [-1.4518, 39.3895], [-1.4617, 39.3794], [-1.4488, 39.3789], [-1.4415, 39.3674], [-1.4199, 39.3816], [-1.4092, 39.3783], [-1.4028, 39.3649], [-1.3829, 39.3654], [-1.3807, 39.3534], [-1.3661, 39.3549], [-1.3502, 39.3394], [-1.3351, 39.3329], [-1.3268, 39.3413], [-1.3115, 39.3425], [-1.2998, 39.3372], [-1.2955, 39.3308], [-1.2678, 39.3289], [-1.2423, 39.3215], [-1.2169, 39.3164], [-1.208, 39.3251], [-1.2005, 39.3153], [-1.1772, 39.3146], [-1.1626, 39.3058], [-1.1749, 39.2781], [-1.1777, 39.2492], [-1.1765, 39.2319], [-1.1818, 39.21], [-1.1922, 39.194], [-1.1975, 39.1756], [-1.2127, 39.1608], [-1.2265, 39.1513], [-1.2396, 39.1144], [-1.2551, 39.1064], [-1.2552, 39.0841], [-1.2641, 39.0763], [-1.2625, 39.0679], [-1.2652, 39.0509], [-1.2629, 39.0459], [-1.2256, 39.0243], [-1.2086, 39.0054], [-1.2013, 38.9928], [-1.1926, 38.9873], [-1.1759, 38.9685], [-1.1596, 38.9541], [-1.1536, 38.9412], [-1.1436, 38.9285], [-1.1078, 38.9286], [-1.047, 38.9363], [-1.0329, 38.934], [-1.0122, 38.9395], [-1.0007, 38.9496], [-0.9756, 38.9416], [-0.9595, 38.9439], [-0.9575, 38.9256], [-0.9484, 38.9097], [-0.9394, 38.8992], [-0.9239, 38.8914], [-0.9329, 38.8746], [-0.9359, 38.8553], [-0.9324, 38.8476], [-0.9315, 38.8303], [-0.9229, 38.8235], [-0.933, 38.8098], [-0.9335, 38.7938], [-0.9282, 38.7845], [-0.9468, 38.7763], [-0.9604, 38.7734], [-0.9533, 38.7529], [-0.9416, 38.7305], [-0.9272, 38.7135], [-0.9274, 38.7072], [-0.9152, 38.696], [-0.9321, 38.6773], [-0.9606, 38.6574], [-0.99, 38.6544], [-1.0072, 38.6574], [-1.0267, 38.6556], [-1.0345, 38.656], [-1.0533, 38.6668], [-1.0707, 38.6806], [-1.0821, 38.6867], [-1.1164, 38.7106], [-1.12, 38.7379], [-1.14, 38.744], [-1.1821, 38.7539], [-1.2104, 38.7459], [-1.2375, 38.7416], [-1.2643, 38.728], [-1.287, 38.7044], [-1.3086, 38.6964], [-1.3322, 38.6809], [-1.3429, 38.6769], [-1.3668, 38.7034], [-1.3826, 38.6993], [-1.4203, 38.6783], [-1.4242, 38.6723], [-1.4487, 38.6495], [-1.4441, 38.6346], [-1.4491, 38.6153], [-1.4526, 38.5823], [-1.4876, 38.5631], [-1.4977, 38.5361], [-1.4805, 38.4838], [-1.4779, 38.4597], [-1.4773, 38.4233], [-1.4738, 38.4069], [-1.4787, 38.3762], [-1.5416, 38.3433], [-1.5477, 38.3335], [-1.5585, 38.3255], [-1.5897, 38.3107], [-1.6106, 38.3135], [-1.6298, 38.3086], [-1.6692, 38.3113], [-1.6732, 38.3215], [-1.6853, 38.3288], [-1.6922, 38.3443], [-1.6856, 38.3474], [-1.6828, 38.3595], [-1.6916, 38.3674], [-1.7063, 38.3707], [-1.7242, 38.368], [-1.7446, 38.3804], [-1.7611, 38.3773], [-1.7701, 38.3786], [-1.7711, 38.3652], [-1.788, 38.3668], [-1.7955, 38.3521], [-1.8119, 38.3511], [-1.8233, 38.3347], [-1.8399, 38.3349], [-1.853, 38.3307], [-1.8695, 38.3171], [-1.8933, 38.3023], [-1.9094, 38.2972], [-1.9467, 38.289], [-1.9637, 38.2869], [-1.9826, 38.2811], [-2.0064, 38.2865], [-2.021, 38.2989], [-2.0391, 38.3012], [-2.0475, 38.3057], [-2.0657, 38.2951], [-2.0789, 38.2761], [-2.084, 38.2637], [-2.0989, 38.249], [-2.1139, 38.2373], [-2.14, 38.2305], [-2.1712, 38.2245], [-2.1843, 38.2149], [-2.1928, 38.2132], [-2.2124, 38.2035], [-2.2217, 38.1836], [-2.2219, 38.1768], [-2.23, 38.163], [-2.2448, 38.1494], [-2.2524, 38.1377], [-2.2516, 38.1293], [-2.2668, 38.1081], [-2.273, 38.1066], [-2.2872, 38.0931], [-2.3005, 38.0839], [-2.313, 38.0801], [-2.3297, 38.0668], [-2.3306, 38.0599], [-2.3445, 38.0332], [-2.3395, 38.0258], [-2.3561, 38.0215], [-2.3719, 38.0235], [-2.3986, 38.0332], [-2.4163, 38.0313], [-2.426, 38.0337], [-2.4337, 38.0424], [-2.443, 38.0461], [-2.4794, 38.0534], [-2.4917, 38.0583], [-2.5039, 38.068], [-2.5255, 38.0699], [-2.5406, 38.0752], [-2.553, 38.0828], [-2.5345, 38.1005], [-2.5225, 38.1071], [-2.5092, 38.1285], [-2.4984, 38.1314], [-2.4867, 38.1491], [-2.4762, 38.1555], [-2.4631, 38.1731], [-2.4462, 38.1853], [-2.4455, 38.2052], [-2.4535, 38.2165], [-2.4412, 38.2318], [-2.4434, 38.2509], [-2.4353, 38.2652], [-2.441, 38.286], [-2.4802, 38.2952], [-2.4849, 38.3018], [-2.4847, 38.3176], [-2.4806, 38.3266], [-2.48, 38.3487], [-2.4869, 38.3528], [-2.4919, 38.3706], [-2.4825, 38.3912], [-2.4841, 38.3974], [-2.5158, 38.3988], [-2.5234, 38.4052], [-2.5573, 38.4056], [-2.5634, 38.4131], [-2.5722, 38.4146], [-2.5773, 38.4263], [-2.5722, 38.4394], [-2.5678, 38.4603], [-2.5772, 38.4752], [-2.5704, 38.4942], [-2.5801, 38.5034], [-2.5996, 38.5134], [-2.617, 38.5134], [-2.6406, 38.509], [-2.6748, 38.4957], [-2.703, 38.5017], [-2.7106, 38.5066], [-2.7327, 38.5135], [-2.7395, 38.521], [-2.7647, 38.5317], [-2.7792, 38.512], [-2.8056, 38.5033], [-2.8085, 38.496], [-2.8255, 38.4868], [-2.8605, 38.4758], [-2.8696, 38.4656], [-2.8904, 38.4566], [-2.9047, 38.469], [-2.914, 38.4687], [-2.9375, 38.4736], [-2.9554, 38.4682], [-2.9624, 38.4698], [-2.9771, 38.4545], [-2.9933, 38.4512], [-2.996, 38.444], [-2.9921, 38.4287], [-2.9957, 38.4192], [-3.0047, 38.414], [-3.024, 38.4359], [-3.0658, 38.4774], [-3.0703, 38.4765], [-3.1282, 38.4396], [-3.1517, 38.4399], [-3.1798, 38.4506], [-3.2305, 38.4526], [-3.2629, 38.4582], [-3.2764, 38.4577], [-3.2886, 38.4675], [-3.3074, 38.4782], [-3.3262, 38.481], [-3.3505, 38.4761], [-3.3748, 38.474], [-3.3808, 38.447], [-3.3768, 38.4402], [-3.4042, 38.4238], [-3.4115, 38.4232], [-3.4226, 38.4119], [-3.4515, 38.4003], [-3.4715, 38.3974], [-3.4828, 38.4029], [-3.5291, 38.4084], [-3.5363, 38.4213], [-3.5346, 38.4381], [-3.5453, 38.4458], [-3.5678, 38.4499], [-3.5819, 38.4478], [-3.5859, 38.4309], [-3.5868, 38.4069], [-3.5994, 38.3976], [-3.6199, 38.3934], [-3.6478, 38.403], [-3.6974, 38.4108], [-3.7102, 38.4141], [-3.7294, 38.424], [-3.7393, 38.4138], [-3.7621, 38.4225], [-3.7811, 38.425], [-3.7996, 38.4205], [-3.8077, 38.4213], [-3.8242, 38.4146], [-3.8303, 38.4042], [-3.8312, 38.3917], [-3.8477, 38.3781], [-3.8577, 38.3731], [-3.873, 38.3765], [-3.8928, 38.371], [-3.915, 38.3678], [-3.9369, 38.368], [-3.9596, 38.3659], [-3.9832, 38.3696], [-4.0041, 38.3679], [-4.0158, 38.3723], [-4.0434, 38.3779], [-4.0677, 38.3798], [-4.085, 38.3772], [-4.0931, 38.3813], [-4.1306, 38.3788], [-4.1459, 38.3854], [-4.1557, 38.3815], [-4.1687, 38.3826], [-4.226, 38.3975], [-4.2474, 38.3966], [-4.2642, 38.3997], [-4.2745, 38.3942], [-4.2778, 38.3797], [-4.2711, 38.3654], [-4.2685, 38.3469], [-4.2888, 38.3476], [-4.3084, 38.3534], [-4.3208, 38.3622], [-4.3579, 38.3732], [-4.366, 38.3778], [-4.3959, 38.3864], [-4.4063, 38.3825], [-4.4176, 38.3951], [-4.4278, 38.3958], [-4.4347, 38.4016], [-4.4515, 38.4009], [-4.4633, 38.4132], [-4.4719, 38.4268], [-4.482, 38.4327], [-4.4874, 38.4414], [-4.5005, 38.4464], [-4.5043, 38.4567], [-4.5122, 38.4632], [-4.5234, 38.4626], [-4.5351, 38.4697], [-4.5434, 38.4821], [-4.5571, 38.4768], [-4.5663, 38.4916], [-4.5851, 38.4941], [-4.5867, 38.4877], [-4.6004, 38.4925], [-4.6162, 38.5058], [-4.6225, 38.5239], [-4.6537, 38.5368], [-4.6635, 38.5486], [-4.682, 38.5479], [-4.6969, 38.5517], [-4.7021, 38.5575], [-4.7054, 38.5729], [-4.7282, 38.5747], [-4.7505, 38.585], [-4.7691, 38.5877], [-4.7859, 38.5965], [-4.8115, 38.5951], [-4.8219, 38.5985], [-4.8332, 38.6082], [-4.856, 38.6135], [-4.862, 38.6173], [-4.8643, 38.6314], [-4.8605, 38.6412], [-4.8688, 38.6808], [-4.8833, 38.6865], [-4.8903, 38.6842], [-4.9115, 38.686], [-4.9296, 38.6812], [-4.9535, 38.6829], [-5.0016, 38.6943], [-5.0014, 38.7074], [-5.0094, 38.7169], [-5.0237, 38.7261], [-5.0458, 38.7294], [-5.0361, 38.7342], [-5.0091, 38.7359], [-5.0032, 38.7336], [-4.9882, 38.7417], [-4.9726, 38.76], [-4.9602, 38.7919], [-4.9577, 38.8139], [-4.9526, 38.8301], [-4.9419, 38.8535], [-4.9281, 38.8679], [-4.9141, 38.8867], [-4.9013, 38.8888], [-4.8782, 38.8876], [-4.848, 38.8828], [-4.8434, 38.8957], [-4.8456, 38.908], [-4.8342, 38.9403], [-4.844, 38.9451], [-4.8892, 38.9522], [-4.8915, 38.9575], [-4.9046, 38.9623], [-4.9185, 38.9563], [-4.9321, 38.9728], [-4.9356, 38.9906], [-4.9486, 39.0249], [-4.9605, 39.0488], [-4.9621, 39.057], [-4.9357, 39.0554], [-4.912, 39.0463], [-4.8931, 39.0363], [-4.8778, 39.0315], [-4.86, 39.0323], [-4.8496, 39.0422], [-4.8331, 39.0452], [-4.8268, 39.0611], [-4.8574, 39.0751], [-4.8739, 39.0956], [-4.8704, 39.1105], [-4.8589, 39.12], [-4.8531, 39.1396], [-4.8546, 39.1492], [-4.8393, 39.1625], [-4.8325, 39.1625], [-4.8318, 39.174], [-4.8211, 39.1786], [-4.8077, 39.197], [-4.7815, 39.189], [-4.7644, 39.1871], [-4.7382, 39.1913], [-4.7121, 39.1842], [-4.6783, 39.1679], [-4.6509, 39.1617], [-4.6509, 39.171], [-4.6602, 39.175], [-4.6649, 39.1831], [-4.6824, 39.1918], [-4.692, 39.2028], [-4.7066, 39.2082], [-4.7052, 39.2148], [-4.7139, 39.2431], [-4.7253, 39.2456], [-4.7312, 39.2564], [-4.7518, 39.3087], [-4.7592, 39.3193], [-4.7508, 39.3228], [-4.706, 39.3277], [-4.7083, 39.3507], [-4.702, 39.3662], [-4.6868, 39.3852], [-4.6873, 39.3912], [-4.6742, 39.4066], [-4.6685, 39.4233], [-4.6913, 39.4491], [-4.7125, 39.4334], [-4.7567, 39.4144], [-4.7671, 39.4013], [-4.7751, 39.3966], [-4.7887, 39.3978], [-4.8108, 39.3956], [-4.8322, 39.3881], [-4.8442, 39.3788], [-4.8594, 39.3785], [-4.8702, 39.3673], [-4.887, 39.369], [-4.91, 39.3774], [-4.922, 39.3861], [-4.9307, 39.3857], [-4.9339, 39.3933], [-4.9508, 39.3913], [-4.9812, 39.4145], [-4.9977, 39.4239], [-5.029, 39.4505], [-5.0302, 39.4558], [-5.0597, 39.4858], [-5.0822, 39.4863], [-5.0964, 39.5009], [-5.1232, 39.5188], [-5.1382, 39.5379], [-5.1595, 39.5586], [-5.1764, 39.5702], [-5.2026, 39.5916], [-5.205, 39.5995], [-5.1936, 39.607], [-5.1772, 39.6226], [-5.1711, 39.6341], [-5.1601, 39.6419], [-5.1605, 39.6514], [-5.151, 39.659], [-5.1491, 39.6664], [-5.1566, 39.6736], [-5.1527, 39.6951], [-5.1394, 39.7183], [-5.1553, 39.738], [-5.1665, 39.7431], [-5.1729, 39.7555], [-5.1594, 39.7601], [-5.1677, 39.7923], [-5.1736, 39.7983], [-5.2021, 39.7985], [-5.2181, 39.7878], [-5.2318, 39.7743], [-5.2439, 39.7661], [-5.253, 39.7524], [-5.2652, 39.752], [-5.2966, 39.7608], [-5.3094, 39.7607], [-5.3162, 39.7704], [-5.312, 39.785], [-5.3159, 39.7954], [-5.311, 39.8106], [-5.3112, 39.8277], [-5.2836, 39.8566], [-5.2947, 39.8736], [-5.3109, 39.8802], [-5.3167, 39.8897], [-5.3257, 39.892], [-5.3636, 39.889], [-5.3949, 39.8789], [-5.401, 39.8862], [-5.3964, 39.9145], [-5.3834, 39.9407], [-5.3738, 39.9678], [-5.3656, 39.9831], [-5.3632, 40.0107], [-5.3647, 40.0307], [-5.3744, 40.0612], [-5.3702, 40.0712], [-5.3694, 40.0987], [-5.3579, 40.1074], [-5.3361, 40.1144], [-5.3199, 40.1073], [-5.2972, 40.1093], [-5.2621, 40.109], [-5.2116, 40.1055], [-5.2109, 40.091], [-5.2063, 40.0841], [-5.1932, 40.0823], [-5.1829, 40.0887], [-5.1704, 40.0853], [-5.1548, 40.0925], [-5.1409, 40.0913], [-5.1397, 40.0968], [-5.1272, 40.1019], [-5.1095, 40.1143], [-5.0998, 40.1265], [-5.0912, 40.123], [-5.0859, 40.1344], [-5.0703, 40.1484], [-5.062, 40.1509], [-5.0432, 40.1502], [-5.0291, 40.1573], [-5.0188, 40.158], [-5.0169, 40.1455], [-5.0075, 40.1309], [-5.0075, 40.109], [-4.9892, 40.1153], [-4.9662, 40.1188], [-4.954, 40.1331], [-4.9288, 40.1347], [-4.9181, 40.1522], [-4.9233, 40.1694], [-4.9073, 40.1764], [-4.895, 40.1853], [-4.8761, 40.1943], [-4.8731, 40.1993], [-4.8546, 40.2075], [-4.8394, 40.2103], [-4.8252, 40.2183], [-4.8224, 40.2291], [-4.8075, 40.2345], [-4.8175, 40.2546], [-4.804, 40.2764], [-4.7868, 40.2708], [-4.7631, 40.2602], [-4.7425, 40.2738], [-4.7283, 40.2717], [-4.7133, 40.2755], [-4.7127, 40.2802], [-4.698, 40.282], [-4.6952, 40.2663], [-4.7019, 40.257], [-4.6879, 40.2494], [-4.693, 40.2426], [-4.687, 40.2361], [-4.6905, 40.2298], [-4.6866, 40.2112], [-4.6738, 40.2099], [-4.6553, 40.199], [-4.6426, 40.1974], [-4.6305, 40.2017], [-4.6166, 40.2001], [-4.6046, 40.2078], [-4.5791, 40.2164], [-4.5727, 40.2078], [-4.5448, 40.1995], [-4.5302, 40.1994], [-4.5176, 40.2044], [-4.5145, 40.2162], [-4.4867, 40.2246], [-4.4738, 40.2306], [-4.452, 40.2325], [-4.4367, 40.2371], [-4.4335, 40.245], [-4.4341, 40.2586], [-4.4078, 40.2737], [-4.3981, 40.2832], [-4.3827, 40.2881], [-4.3814, 40.3074], [-4.3774, 40.3177], [-4.3554, 40.3072], [-4.358, 40.2927], [-4.3574, 40.2716], [-4.3454, 40.2534], [-4.3409, 40.2398], [-4.3283, 40.2351], [-4.3204, 40.2247], [-4.3102, 40.2335], [-4.3052, 40.2212], [-4.2955, 40.2188], [-4.2851, 40.2283], [-4.2694, 40.2364], [-4.259, 40.2579], [-4.244, 40.2744], [-4.2331, 40.2745], [-4.2281, 40.285], [-4.217, 40.288], [-4.2052, 40.2864], [-4.186, 40.2956], [-4.1718, 40.2875], [-4.1642, 40.2695], [-4.1444, 40.2648], [-4.1487, 40.25], [-4.1427, 40.2455], [-4.1312, 40.2481], [-4.1204, 40.244], [-4.1025, 40.2424], [-4.0877, 40.253], [-4.0799, 40.2668], [-4.0725, 40.2657], [-4.051, 40.2512], [-4.024, 40.2492], [-4.0258, 40.2358], [-4.0061, 40.2187], [-3.9971, 40.2168], [-3.9863, 40.2088], [-3.9682, 40.2136], [-3.9535, 40.2131], [-3.9557, 40.1991], [-3.9433, 40.1952], [-3.9393, 40.202], [-3.9272, 40.2026], [-3.9143, 40.1913], [-3.8939, 40.1888], [-3.8658, 40.1877], [-3.8517, 40.1781], [-3.8525, 40.1693], [-3.8335, 40.1617], [-3.8069, 40.1776], [-3.7818, 40.1603], [-3.7781, 40.1464], [-3.771, 40.1393], [-3.7504, 40.1335], [-3.7405, 40.1341], [-3.7206, 40.1476], [-3.6921, 40.133], [-3.6828, 40.133], [-3.6738, 40.141], [-3.6621, 40.13], [-3.6393, 40.1188], [-3.6234, 40.1164], [-3.6074, 40.1084], [-3.6156, 40.0958], [-3.6032, 40.0926], [-3.6094, 40.0819], [-3.6225, 40.0723], [-3.622, 40.0661], [-3.63, 40.054], [-3.6388, 40.05], [-3.6388, 40.0404], [-3.6479, 40.0406], [-3.6676, 40.0334], [-3.6673, 40.0268], [-3.6862, 40.0142], [-3.6985, 40.0205], [-3.712, 40.0099], [-3.7194, 39.988], [-3.7358, 39.9806], [-3.7285, 39.9611], [-3.7432, 39.9633], [-3.7483, 39.9515], [-3.7624, 39.9476], [-3.7633, 39.9608], [-3.7738, 39.9577], [-3.7806, 39.9481], [-3.7965, 39.9478], [-3.8053, 39.9552], [-3.8231, 39.945], [-3.8273, 39.9324], [-3.8342, 39.9319], [-3.838, 39.9425], [-3.8557, 39.9392], [-3.8755, 39.9272], [-3.8683, 39.9192], [-3.8752, 39.9104], [-3.8589, 39.9012], [-3.8501, 39.9033], [-3.8336, 39.9001], [-3.8132, 39.8859], [-3.7996, 39.8876], [-3.7873, 39.8952], [-3.7627, 39.9151], [-3.7453, 39.9259], [-3.7391, 39.9391], [-3.7245, 39.9428], [-3.7042, 39.9534], [-3.6915, 39.9473], [-3.6817, 39.9536], [-3.6647, 39.9569], [-3.6502, 39.9644], [-3.6208, 39.9667], [-3.6321, 39.9877], [-3.6084, 39.9934], [-3.5941, 40.0015], [-3.5888, 40.0129], [-3.5525, 40.0183], [-3.5267, 40.0187], [-3.5106, 40.0455], [-3.473, 40.0458], [-3.47, 40.0405], [-3.4559, 40.046], [-3.445, 40.0369], [-3.4297, 40.0388], [-3.4174, 40.0445], [-3.402, 40.0342], [-3.3932, 40.0363], [-3.3928, 40.0461], [-3.3772, 40.05], [-3.3747, 40.0598], [-3.3796, 40.0678], [-3.3768, 40.0744], [-3.358, 40.0758], [-3.3438, 40.0809], [-3.3297, 40.0806], [-3.3107, 40.067], [-3.3017, 40.0529], [-3.2858, 40.0522], [-3.274, 40.0475], [-3.2552, 40.0572], [-3.2346, 40.0547], [-3.2061, 40.0636], [-3.1906, 40.0764], [-3.1787, 40.0915], [-3.1669, 40.091], [-3.1607, 40.0647], [-3.1489, 40.0661], [-3.1212, 40.0617], [-3.0926, 40.0682], [-3.0858, 40.0718], [-3.0596, 40.094], [-3.0535, 40.1056], [-3.0705, 40.1227], [-3.0732, 40.1309], [-3.0882, 40.1402], [-3.0959, 40.1412], [-3.0964, 40.1553], [-3.0892, 40.1627], [-3.0765, 40.1654], [-3.0795, 40.178], [-3.0854, 40.1862], [-3.0854, 40.2005], [-3.0792, 40.2051], [-3.0819, 40.2154], [-3.0809, 40.2295], [-3.089, 40.2364], [-3.0873, 40.2451], [-3.0983, 40.2619], [-3.0992, 40.2754], [-3.1125, 40.2864], [-3.1293, 40.2765], [-3.1602, 40.2534], [-3.173, 40.2349], [-3.1804, 40.2417], [-3.1956, 40.2482], [-3.1981, 40.2572], [-3.1857, 40.2689], [-3.182, 40.2893], [-3.1817, 40.3094], [-3.1773, 40.316], [-3.1521, 40.3343], [-3.1553, 40.3425], [-3.144, 40.3537], [-3.1527, 40.3683], [-3.1407, 40.3748], [-3.1431, 40.3858], [-3.1352, 40.3916], [-3.1308, 40.4051], [-3.138, 40.4089], [-3.152, 40.4266], [-3.1556, 40.4395], [-3.1736, 40.4373], [-3.1986, 40.4423], [-3.2019, 40.4674], [-3.1975, 40.4782], [-3.2039, 40.4982], [-3.2004, 40.5126], [-3.2047, 40.5175], [-3.224, 40.5263], [-3.2279, 40.5363], [-3.2399, 40.5344], [-3.2485, 40.5421], [-3.2576, 40.5415], [-3.2717, 40.535], [-3.2967, 40.536], [-3.2913, 40.5453], [-3.2826, 40.5513], [-3.2837, 40.5622], [-3.2899, 40.5716], [-3.3085, 40.578], [-3.3307, 40.5957], [-3.3295, 40.6072], [-3.3229, 40.6141], [-3.3286, 40.6202], [-3.3229, 40.6417], [-3.3408, 40.6365], [-3.3465, 40.6412], [-3.3673, 40.6478], [-3.3721, 40.6776], [-3.3993, 40.6905], [-3.4049, 40.6696], [-3.414, 40.6714], [-3.4185, 40.6792], [-3.4285, 40.6721], [-3.4408, 40.6748], [-3.4547, 40.6871], [-3.4606, 40.6986], [-3.4537, 40.7091], [-3.4367, 40.7214], [-3.4334, 40.7317], [-3.4469, 40.7331], [-3.4419, 40.7599], [-3.4523, 40.7759], [-3.4646, 40.7845], [-3.4863, 40.7851], [-3.5036, 40.7898], [-3.4933, 40.798], [-3.4915, 40.8083], [-3.4764, 40.8245], [-3.4778, 40.8378], [-3.4674, 40.8428], [-3.473, 40.8491], [-3.4656, 40.8567], [-3.4733, 40.865], [-3.4428, 40.8794], [-3.4396, 40.8906], [-3.459, 40.9022], [-3.4509, 40.906], [-3.4466, 40.921], [-3.4349, 40.9335], [-3.434, 40.9458], [-3.4276, 40.959], [-3.415, 40.9756], [-3.416, 40.9872], [-3.396, 40.9994], [-3.4069, 41.0132], [-3.4207, 41.0228], [-3.4311, 41.0395], [-3.4386, 41.0411], [-3.4257, 41.0724], [-3.4327, 41.0815], [-3.4501, 41.0798], [-3.4768, 41.093], [-3.4914, 41.0954], [-3.4905, 41.1033], [-3.5107, 41.1343], [-3.5293, 41.1387], [-3.5405, 41.1475], [-3.5389, 41.1637]]]] }, "properties": { "name": "Castilla-La Mancha", "id": "ES-CM", "CNTRY": "Spain", "TYPE": "Autonomous Community" }, "id": "ES-CM" }, { "type": "Feature", "geometry": { "type": "MultiPolygon", "coordinates": [[[[-2.9385, 42.6083], [-2.923, 42.6009], [-2.9384, 42.5938], [-2.9448, 42.6026], [-2.9385, 42.6083]]], [[[-6.8234, 42.9152], [-6.8029, 42.9109], [-6.7722, 42.8995], [-6.7676, 42.8919], [-6.7724, 42.8822], [-6.7565, 42.8831], [-6.7504, 42.8926], [-6.7232, 42.9172], [-6.7117, 42.9156], [-6.6915, 42.922], [-6.6545, 42.9258], [-6.6363, 42.9263], [-6.6254, 42.9208], [-6.6101, 42.9244], [-6.6038, 42.9171], [-6.5746, 42.9191], [-6.5658, 42.9158], [-6.5436, 42.9134], [-6.5288, 42.9245], [-6.5113, 42.9283], [-6.4897, 42.9201], [-6.4767, 42.9339], [-6.4495, 42.936], [-6.4356, 42.943], [-6.4411, 42.9487], [-6.434, 42.9635], [-6.4625, 42.9682], [-6.4724, 42.9671], [-6.4782, 42.9805], [-6.4773, 42.9921], [-6.4449, 42.9825], [-6.4361, 42.9937], [-6.4222, 42.9893], [-6.4097, 43.0018], [-6.4114, 43.0146], [-6.3936, 43.0189], [-6.3903, 43.028], [-6.3944, 43.0404], [-6.3722, 43.0427], [-6.358, 43.0605], [-6.3457, 43.0508], [-6.3321, 43.0474], [-6.3281, 43.0343], [-6.2985, 43.0294], [-6.2846, 43.037], [-6.2644, 43.0178], [-6.2386, 43.0152], [-6.2273, 43.0108], [-6.2234, 43.0179], [-6.2143, 43.0478], [-6.1944, 43.0443], [-6.1764, 43.0482], [-6.1651, 43.0418], [-6.1613, 43.0342], [-6.1467, 43.0355], [-6.1366, 43.0208], [-6.1204, 43.0246], [-6.1117, 43.0305], [-6.0971, 43.0327], [-6.0904, 43.0395], [-6.0925, 43.0559], [-6.0886, 43.0659], [-6.0809, 43.0704], [-6.0663, 43.0668], [-6.052, 43.0684], [-6.0335, 43.0626], [-6.0266, 43.0572], [-6.0102, 43.0567], [-5.994, 43.0607], [-5.9857, 43.069], [-5.9652, 43.0577], [-5.967, 43.0406], [-5.9594, 43.0344], [-5.956, 43.0208], [-5.938, 43.0148], [-5.9119, 42.9978], [-5.9128, 42.9935], [-5.891, 42.9899], [-5.8892, 42.981], [-5.8612, 42.9815], [-5.8445, 42.9648], [-5.8228, 42.9683], [-5.8052, 42.9647], [-5.7687, 42.969], [-5.7615, 42.9762], [-5.7655, 42.9877], [-5.7562, 43.001], [-5.748, 43.0068], [-5.7473, 43.0162], [-5.736, 43.0242], [-5.7332, 43.0347], [-5.7249, 43.0441], [-5.7009, 43.0522], [-5.6889, 43.0587], [-5.6481, 43.0457], [-5.6335, 43.0354], [-5.6024, 43.0373], [-5.5726, 43.0327], [-5.5671, 43.0235], [-5.5379, 43.0205], [-5.5246, 43.0277], [-5.5083, 43.0296], [-5.4915, 43.0275], [-5.4786, 43.0423], [-5.4779, 43.056], [-5.4638, 43.0519], [-5.4461, 43.0565], [-5.4185, 43.0543], [-5.3973, 43.049], [-5.3866, 43.0551], [-5.3823, 43.0875], [-5.3625, 43.0967], [-5.3421, 43.0954], [-5.3391, 43.085], [-5.3229, 43.0798], [-5.3119, 43.0859], [-5.2989, 43.0816], [-5.2795, 43.0796], [-5.2749, 43.086], [-5.2527, 43.0913], [-5.2193, 43.0853], [-5.1985, 43.0926], [-5.1869, 43.1006], [-5.1731, 43.1014], [-5.1591, 43.1115], [-5.1455, 43.1157], [-5.1378, 43.1043], [-5.1204, 43.1018], [-5.0994, 43.1033], [-5.0936, 43.1087], [-5.0962, 43.1174], [-5.0877, 43.1317], [-5.0921, 43.1437], [-5.0854, 43.1484], [-5.0736, 43.1692], [-5.0729, 43.182], [-5.0528, 43.1805], [-5.041, 43.1848], [-5.0191, 43.1856], [-4.9944, 43.1747], [-4.9933, 43.1858], [-4.9774, 43.2005], [-4.969, 43.2029], [-4.9626, 43.212], [-4.9507, 43.2157], [-4.9399, 43.2252], [-4.917, 43.2293], [-4.9098, 43.238], [-4.8923, 43.2386], [-4.8674, 43.2274], [-4.8594, 43.2202], [-4.8585, 43.2064], [-4.8377, 43.1916], [-4.8368, 43.1832], [-4.8479, 43.1738], [-4.8357, 43.169], [-4.8324, 43.1585], [-4.8401, 43.1379], [-4.8477, 43.1288], [-4.8338, 43.117], [-4.8296, 43.1029], [-4.8143, 43.0944], [-4.782, 43.0849], [-4.7637, 43.0759], [-4.7634, 43.0567], [-4.7418, 43.0572], [-4.7322, 43.0485], [-4.7408, 43.0286], [-4.7349, 43.0217], [-4.7198, 43.019], [-4.703, 43.0269], [-4.6818, 43.0272], [-4.6703, 43.0219], [-4.6529, 43.0214], [-4.6394, 43.018], [-4.6275, 43.0253], [-4.6107, 43.0314], [-4.605, 43.0369], [-4.5901, 43.0269], [-4.5721, 43.0275], [-4.558, 43.0204], [-4.5201, 43.0477], [-4.4974, 43.04], [-4.4776, 43.0406], [-4.4773, 43.0461], [-4.4645, 43.0626], [-4.4499, 43.0603], [-4.4358, 43.047], [-4.4059, 43.039], [-4.3931, 43.026], [-4.3895, 43.0158], [-4.3626, 42.9871], [-4.3466, 42.9741], [-4.3139, 42.9703], [-4.3019, 42.9673], [-4.2904, 42.9691], [-4.2548, 42.9638], [-4.2354, 42.9547], [-4.2382, 42.9386], [-4.2346, 42.9149], [-4.2228, 42.9114], [-4.2294, 42.9046], [-4.226, 42.8892], [-4.2239, 42.8568], [-4.2098, 42.8457], [-4.1975, 42.8456], [-4.1819, 42.8587], [-4.1659, 42.8597], [-4.1482, 42.8653], [-4.1382, 42.8587], [-4.1272, 42.8572], [-4.129, 42.8457], [-4.1418, 42.8293], [-4.1597, 42.8379], [-4.1635, 42.8292], [-4.1845, 42.8213], [-4.1832, 42.81], [-4.1737, 42.8081], [-4.1497, 42.7893], [-4.12, 42.7946], [-4.0996, 42.7912], [-4.0945, 42.7739], [-4.0863, 42.7714], [-4.0819, 42.7617], [-4.0694, 42.761], [-4.0467, 42.7661], [-4.0504, 42.7801], [-4.0398, 42.7907], [-4.0289, 42.7897], [-4.0335, 42.801], [-4.0166, 42.8073], [-4.0217, 42.8195], [-4.0131, 42.8297], [-4.0022, 42.8295], [-4.0015, 42.8093], [-3.997, 42.7984], [-4.0002, 42.7691], [-3.9896, 42.7714], [-3.9817, 42.7672], [-3.9789, 42.7587], [-3.9478, 42.7616], [-3.9442, 42.7703], [-3.9319, 42.7739], [-3.926, 42.7694], [-3.9115, 42.7683], [-3.9087, 42.7868], [-3.8998, 42.7899], [-3.8937, 42.8048], [-3.8798, 42.7937], [-3.8636, 42.7869], [-3.8522, 42.7883], [-3.8225, 42.7993], [-3.8158, 42.8102], [-3.8184, 42.8379], [-3.8333, 42.8521], [-3.8255, 42.8674], [-3.8376, 42.8786], [-3.8626, 42.8892], [-3.8736, 42.8766], [-3.8734, 42.852], [-3.8883, 42.8567], [-3.897, 42.8555], [-3.9126, 42.8667], [-3.8978, 42.8788], [-3.9036, 42.8851], [-3.8928, 42.8892], [-3.8966, 42.9027], [-3.8822, 42.9036], [-3.8655, 42.8988], [-3.8581, 42.9034], [-3.8542, 42.9159], [-3.8329, 42.9192], [-3.83, 42.9283], [-3.8405, 42.9398], [-3.8646, 42.9548], [-3.8759, 42.9478], [-3.8853, 42.9488], [-3.8907, 42.9251], [-3.9109, 42.924], [-3.9232, 42.9154], [-3.9255, 42.9036], [-3.9321, 42.8993], [-3.9426, 42.9095], [-3.9725, 42.9111], [-3.9895, 42.9307], [-3.9867, 42.9411], [-3.9732, 42.9694], [-3.9613, 42.9904], [-3.947, 43.0066], [-3.9172, 43.0154], [-3.8982, 43.0315], [-3.8928, 43.0418], [-3.87, 43.0446], [-3.8548, 43.0403], [-3.8498, 43.0493], [-3.8585, 43.0732], [-3.8584, 43.087], [-3.82, 43.0818], [-3.8097, 43.0873], [-3.7881, 43.0791], [-3.7732, 43.0831], [-3.7646, 43.0815], [-3.7554, 43.0867], [-3.7524, 43.1016], [-3.7326, 43.1039], [-3.7038, 43.1169], [-3.683, 43.1394], [-3.6744, 43.1558], [-3.6665, 43.1586], [-3.6486, 43.1814], [-3.6105, 43.1696], [-3.6021, 43.1513], [-3.5847, 43.1553], [-3.5592, 43.1501], [-3.5401, 43.1483], [-3.5283, 43.1431], [-3.4856, 43.1344], [-3.4567, 43.1367], [-3.4425, 43.1326], [-3.4164, 43.1348], [-3.3869, 43.1414], [-3.368, 43.1525], [-3.3471, 43.1573], [-3.3389, 43.1682], [-3.3318, 43.1665], [-3.3099, 43.1737], [-3.2952, 43.1839], [-3.2778, 43.1912], [-3.2774, 43.1953], [-3.2488, 43.198], [-3.2378, 43.1898], [-3.2212, 43.1727], [-3.2063, 43.1803], [-3.1971, 43.1723], [-3.1842, 43.1706], [-3.1668, 43.1786], [-3.1569, 43.1779], [-3.1431, 43.1674], [-3.1426, 43.1613], [-3.1611, 43.1549], [-3.1623, 43.143], [-3.1807, 43.1229], [-3.1799, 43.1149], [-3.1533, 43.1043], [-3.1426, 43.1096], [-3.1352, 43.0973], [-3.1568, 43.0719], [-3.1414, 43.0672], [-3.1471, 43.035], [-3.1438, 43.0278], [-3.17, 43.0283], [-3.1735, 43.0184], [-3.1458, 43.007], [-3.1296, 43.0074], [-3.0882, 43.0018], [-3.0767, 43.0076], [-3.0622, 43.0029], [-3.0575, 42.9959], [-3.0377, 42.9812], [-3.0424, 42.9705], [-3.0201, 42.9602], [-3.013, 42.9525], [-2.9927, 42.9507], [-2.9807, 42.9386], [-2.9967, 42.927], [-3.0033, 42.927], [-3.0149, 42.9173], [-3.0202, 42.9086], [-3.0605, 42.9024], [-3.0937, 42.8999], [-3.1089, 42.9063], [-3.1264, 42.9042], [-3.1319, 42.9134], [-3.1493, 42.9191], [-3.1466, 42.9345], [-3.1839, 42.9445], [-3.2272, 42.9494], [-3.2359, 42.9437], [-3.2363, 42.9341], [-3.2488, 42.921], [-3.2497, 42.9125], [-3.278, 42.9008], [-3.2771, 42.887], [-3.2862, 42.8854], [-3.2831, 42.8758], [-3.2231, 42.828], [-3.206, 42.8277], [-3.2214, 42.8389], [-3.21, 42.8443], [-3.1912, 42.8693], [-3.1724, 42.8578], [-3.1569, 42.857], [-3.1496, 42.8604], [-3.1239, 42.8918], [-3.112, 42.8883], [-3.1055, 42.8792], [-3.1137, 42.8612], [-3.1289, 42.8408], [-3.141, 42.8351], [-3.1484, 42.8127], [-3.1579, 42.804], [-3.1335, 42.7904], [-3.124, 42.7886], [-3.1376, 42.765], [-3.145, 42.7566], [-3.116, 42.759], [-3.1017, 42.7663], [-3.0807, 42.7654], [-3.065, 42.7596], [-3.0488, 42.7646], [-3.0496, 42.7499], [-3.0422, 42.7387], [-3.0171, 42.7365], [-3.0063, 42.7222], [-2.9893, 42.718], [-2.987, 42.7081], [-2.9549, 42.7094], [-2.9305, 42.707], [-2.9292, 42.6995], [-2.9027, 42.6928], [-2.9027, 42.6837], [-2.8958, 42.6787], [-2.8998, 42.6673], [-2.8968, 42.6541], [-2.8707, 42.6382], [-2.8583, 42.6378], [-2.8646, 42.6323], [-2.879, 42.6288], [-2.8834, 42.6204], [-2.9055, 42.6195], [-2.9248, 42.622], [-2.9339, 42.6341], [-2.9451, 42.6387], [-2.9667, 42.6404], [-2.9861, 42.6363], [-2.989, 42.6423], [-3.0043, 42.6447], [-3.0139, 42.6409], [-3.0203, 42.6327], [-3.0328, 42.6392], [-3.077, 42.6391], [-3.0853, 42.6355], [-3.0796, 42.6261], [-3.0716, 42.622], [-3.06, 42.5889], [-3.0856, 42.5825], [-3.0822, 42.5743], [-3.0988, 42.5619], [-3.1039, 42.5538], [-3.1259, 42.5441], [-3.1236, 42.5331], [-3.1064, 42.5294], [-3.0886, 42.5383], [-3.0724, 42.5268], [-3.0762, 42.5208], [-3.0746, 42.509], [-3.0791, 42.4999], [-3.0925, 42.4926], [-3.0916, 42.4792], [-3.0828, 42.4744], [-3.0729, 42.4758], [-3.0471, 42.4459], [-3.0622, 42.428], [-3.0583, 42.4169], [-3.0635, 42.4033], [-3.0544, 42.3753], [-3.0644, 42.373], [-3.0826, 42.3981], [-3.0783, 42.4156], [-3.0903, 42.4221], [-3.1007, 42.4161], [-3.0954, 42.4035], [-3.1048, 42.3856], [-3.0841, 42.3852], [-3.0649, 42.365], [-3.0649, 42.356], [-3.0859, 42.3528], [-3.1091, 42.3516], [-3.1092, 42.3386], [-3.1011, 42.3284], [-3.1067, 42.3128], [-3.103, 42.3079], [-3.0944, 42.2769], [-3.0902, 42.2724], [-3.0965, 42.262], [-3.0896, 42.2454], [-3.1004, 42.2299], [-3.0982, 42.2232], [-3.1038, 42.213], [-3.1288, 42.1972], [-3.115, 42.187], [-3.1129, 42.1761], [-3.097, 42.1682], [-3.0898, 42.1591], [-3.0908, 42.1485], [-3.0859, 42.136], [-3.0677, 42.1341], [-3.0516, 42.1168], [-3.0331, 42.0863], [-3.0232, 42.0884], [-3.004, 42.0828], [-2.9901, 42.0867], [-2.9622, 42.084], [-2.9416, 42.0888], [-2.9319, 42.0792], [-2.9198, 42.0472], [-2.9154, 42.0399], [-2.9132, 42.0218], [-2.8927, 42.0168], [-2.8836, 42.0089], [-2.8713, 42.0127], [-2.8589, 42.0214], [-2.8532, 42.0304], [-2.8213, 42.0383], [-2.8091, 42.0369], [-2.7982, 42.0467], [-2.7952, 42.064], [-2.8034, 42.0789], [-2.7898, 42.094], [-2.7914, 42.1085], [-2.777, 42.1219], [-2.7684, 42.1243], [-2.7517, 42.1175], [-2.7452, 42.1244], [-2.7291, 42.1224], [-2.7072, 42.1032], [-2.7098, 42.0833], [-2.727, 42.0683], [-2.7395, 42.0476], [-2.7567, 42.032], [-2.755, 42.023], [-2.7455, 42.0086], [-2.7226, 42.0148], [-2.704, 42.0145], [-2.6832, 41.9999], [-2.6739, 41.9964], [-2.6587, 42.0046], [-2.6475, 42.0034], [-2.6251, 42.0059], [-2.5969, 42.0019], [-2.5833, 41.9955], [-2.5651, 42.014], [-2.5579, 42.0316], [-2.5518, 42.0393], [-2.5488, 42.0516], [-2.5345, 42.054], [-2.516, 42.069], [-2.5223, 42.0846], [-2.5189, 42.0918], [-2.5171, 42.1104], [-2.5088, 42.1154], [-2.4935, 42.1118], [-2.4869, 42.1065], [-2.4716, 42.1128], [-2.4581, 42.115], [-2.4491, 42.1228], [-2.4411, 42.1357], [-2.4043, 42.1384], [-2.3485, 42.1448], [-2.3208, 42.1438], [-2.2823, 42.1301], [-2.28, 42.1226], [-2.282, 42.1074], [-2.2685, 42.0876], [-2.2587, 42.0862], [-2.2355, 42.1015], [-2.2189, 42.0983], [-2.2114, 42.103], [-2.194, 42.1017], [-2.1716, 42.1042], [-2.1474, 42.1031], [-2.1283, 42.0971], [-2.1275, 42.0802], [-2.1338, 42.0747], [-2.1599, 42.0665], [-2.1581, 42.0551], [-2.1503, 42.0418], [-2.1436, 42.0395], [-2.1281, 42.0251], [-2.1191, 42.0218], [-2.1087, 42.0033], [-2.1197, 41.9965], [-2.1182, 41.978], [-2.1135, 41.9609], [-2.1066, 41.9563], [-2.0791, 41.9533], [-2.0721, 41.9501], [-2.057, 41.9527], [-2.0442, 41.9492], [-2.0356, 41.9404], [-2.0278, 41.9517], [-2.0095, 41.9387], [-1.9995, 41.9355], [-1.9936, 41.9261], [-1.9824, 41.9189], [-1.9606, 41.9208], [-1.9506, 41.9271], [-1.9383, 41.9257], [-1.9232, 41.9336], [-1.9143, 41.9343], [-1.9055, 41.9452], [-1.8767, 41.9533], [-1.8571, 41.9674], [-1.8567, 41.939], [-1.8593, 41.9172], [-1.8555, 41.9045], [-1.8398, 41.8881], [-1.841, 41.8748], [-1.8184, 41.8534], [-1.8192, 41.8326], [-1.826, 41.818], [-1.847, 41.8022], [-1.8533, 41.7917], [-1.8392, 41.7862], [-1.8259, 41.7773], [-1.822, 41.7668], [-1.8036, 41.7538], [-1.808, 41.7367], [-1.7962, 41.7327], [-1.7866, 41.7342], [-1.7746, 41.7247], [-1.784, 41.7172], [-1.7877, 41.7004], [-1.8021, 41.6952], [-1.8081, 41.6832], [-1.8063, 41.6663], [-1.813, 41.661], [-1.823, 41.6624], [-1.8585, 41.6613], [-1.8744, 41.638], [-1.8806, 41.6408], [-1.8967, 41.6336], [-1.8996, 41.6258], [-1.9134, 41.6175], [-1.9134, 41.6105], [-1.9239, 41.5986], [-1.9682, 41.6056], [-1.9846, 41.6058], [-1.9925, 41.5994], [-1.9945, 41.5824], [-1.9796, 41.5609], [-1.9677, 41.5526], [-1.9665, 41.5451], [-1.9781, 41.5265], [-1.9747, 41.517], [-1.9798, 41.5048], [-1.9805, 41.4858], [-1.967, 41.4778], [-1.9531, 41.461], [-1.9536, 41.4451], [-1.9499, 41.4289], [-1.9548, 41.4238], [-1.9406, 41.4183], [-1.939, 41.4066], [-1.9547, 41.408], [-1.9705, 41.4009], [-1.9825, 41.4018], [-1.9871, 41.3967], [-2.0016, 41.394], [-2.0095, 41.3861], [-2.029, 41.3838], [-2.0417, 41.3888], [-2.0437, 41.3956], [-2.034, 41.405], [-2.0356, 41.4271], [-2.0483, 41.4347], [-2.1005, 41.4452], [-2.1155, 41.4248], [-2.1159, 41.4068], [-2.124, 41.3708], [-2.1498, 41.356], [-2.1621, 41.3548], [-2.1567, 41.3323], [-2.1707, 41.3226], [-2.1704, 41.303], [-2.1766, 41.2899], [-2.1658, 41.2821], [-2.1537, 41.2312], [-2.1476, 41.1849], [-2.0825, 41.1727], [-2.0784, 41.1644], [-2.0553, 41.1478], [-2.0561, 41.1261], [-2.0639, 41.1195], [-2.0671, 41.0983], [-2.0608, 41.0869], [-2.0503, 41.0788], [-2.0596, 41.0696], [-2.0757, 41.0761], [-2.0772, 41.0843], [-2.0864, 41.0906], [-2.0976, 41.0926], [-2.1145, 41.1013], [-2.1317, 41.1192], [-2.138, 41.1188], [-2.1435, 41.1067], [-2.1705, 41.0981], [-2.1786, 41.0857], [-2.2179, 41.0937], [-2.2326, 41.0983], [-2.2611, 41.0707], [-2.2811, 41.0677], [-2.2908, 41.0741], [-2.3216, 41.0602], [-2.3286, 41.0694], [-2.343, 41.0765], [-2.355, 41.0891], [-2.3767, 41.0793], [-2.401, 41.0639], [-2.4167, 41.061], [-2.4493, 41.0795], [-2.4673, 41.0808], [-2.4682, 41.0937], [-2.4845, 41.1202], [-2.5083, 41.1225], [-2.5162, 41.1386], [-2.519, 41.1527], [-2.5364, 41.1635], [-2.5447, 41.1529], [-2.566, 41.1466], [-2.574, 41.1411], [-2.595, 41.1517], [-2.585, 41.1617], [-2.5792, 41.1761], [-2.5826, 41.1822], [-2.5977, 41.1862], [-2.6194, 41.1845], [-2.616, 41.1952], [-2.6014, 41.1952], [-2.5937, 41.2002], [-2.5878, 41.2132], [-2.5902, 41.2255], [-2.6218, 41.2209], [-2.635, 41.2228], [-2.634, 41.2325], [-2.6463, 41.2407], [-2.6717, 41.2395], [-2.689, 41.2434], [-2.7087, 41.2522], [-2.7176, 41.274], [-2.733, 41.2725], [-2.7612, 41.2731], [-2.7675, 41.2689], [-2.7773, 41.2543], [-2.8185, 41.2573], [-2.8313, 41.2646], [-2.8656, 41.2742], [-2.8638, 41.2879], [-2.8735, 41.2988], [-2.8696, 41.3175], [-2.8919, 41.3257], [-2.9073, 41.328], [-2.9164, 41.3195], [-2.9271, 41.3196], [-2.9419, 41.3133], [-2.9424, 41.3012], [-2.9513, 41.2936], [-2.9635, 41.2934], [-3.0067, 41.2855], [-3.0192, 41.2899], [-3.0268, 41.2854], [-3.0621, 41.275], [-3.0936, 41.2851], [-3.1004, 41.2814], [-3.1113, 41.2885], [-3.1586, 41.2945], [-3.1914, 41.3024], [-3.2072, 41.3033], [-3.2288, 41.2971], [-3.2394, 41.288], [-3.2406, 41.281], [-3.2553, 41.2576], [-3.2591, 41.2678], [-3.2733, 41.2752], [-3.2881, 41.2648], [-3.2914, 41.2572], [-3.3243, 41.2605], [-3.3363, 41.2514], [-3.3672, 41.2582], [-3.3911, 41.2557], [-3.4, 41.2526], [-3.3985, 41.2399], [-3.4045, 41.2356], [-3.4009, 41.2236], [-3.4026, 41.2112], [-3.417, 41.2144], [-3.4425, 41.2129], [-3.4586, 41.19], [-3.4738, 41.181], [-3.4926, 41.175], [-3.516, 41.1607], [-3.5389, 41.1637], [-3.555, 41.1636], [-3.5696, 41.1578], [-3.5889, 41.1587], [-3.6114, 41.1479], [-3.6313, 41.136], [-3.6355, 41.1229], [-3.6439, 41.1191], [-3.6508, 41.1053], [-3.6765, 41.0835], [-3.6856, 41.0834], [-3.7129, 41.0712], [-3.7392, 41.0543], [-3.7399, 41.0494], [-3.753, 41.0316], [-3.7618, 41.0252], [-3.7798, 41.002], [-3.7857, 41.001], [-3.8109, 40.9871], [-3.8293, 40.986], [-3.8492, 40.9791], [-3.8605, 40.9783], [-3.8708, 40.9717], [-3.8778, 40.9754], [-3.8945, 40.9655], [-3.919, 40.9412], [-3.9213, 40.9292], [-3.9375, 40.9267], [-3.9383, 40.9149], [-3.9527, 40.8946], [-3.9433, 40.8891], [-3.9468, 40.8679], [-3.9655, 40.8348], [-3.9615, 40.8209], [-3.9662, 40.8123], [-3.9797, 40.7996], [-3.9786, 40.7872], [-3.9876, 40.7854], [-4.0057, 40.7877], [-4.0173, 40.7817], [-4.0419, 40.7842], [-4.0476, 40.7904], [-4.0701, 40.7932], [-4.0772, 40.7879], [-4.0811, 40.7763], [-4.0958, 40.7654], [-4.097, 40.7487], [-4.1141, 40.7422], [-4.1276, 40.7233], [-4.1406, 40.7101], [-4.1441, 40.695], [-4.1609, 40.689], [-4.1842, 40.6978], [-4.2368, 40.688], [-4.2519, 40.6883], [-4.2715, 40.681], [-4.2741, 40.6753], [-4.2895, 40.6794], [-4.3135, 40.6677], [-4.3241, 40.6588], [-4.3198, 40.6482], [-4.3266, 40.648], [-4.3338, 40.6377], [-4.305, 40.6378], [-4.2905, 40.6286], [-4.29, 40.609], [-4.2791, 40.6058], [-4.2827, 40.5973], [-4.2895, 40.5655], [-4.3088, 40.5592], [-4.3216, 40.5515], [-4.327, 40.535], [-4.3205, 40.5326], [-4.3215, 40.5206], [-4.3273, 40.5099], [-4.3224, 40.5039], [-4.3256, 40.4912], [-4.3236, 40.4792], [-4.3158, 40.467], [-4.3239, 40.4616], [-4.3206, 40.4517], [-4.3408, 40.4381], [-4.3398, 40.4298], [-4.3236, 40.4242], [-4.3285, 40.4121], [-4.335, 40.4104], [-4.3528, 40.4141], [-4.3679, 40.409], [-4.3808, 40.4084], [-4.4002, 40.4129], [-4.4142, 40.4114], [-4.4284, 40.4014], [-4.4427, 40.3852], [-4.439, 40.3504], [-4.458, 40.3442], [-4.4533, 40.3338], [-4.4548, 40.3198], [-4.4618, 40.3184], [-4.4892, 40.321], [-4.502, 40.3156], [-4.5123, 40.321], [-4.5144, 40.3285], [-4.5269, 40.3447], [-4.5477, 40.3402], [-4.5404, 40.3297], [-4.5375, 40.3109], [-4.5293, 40.2932], [-4.5553, 40.278], [-4.5568, 40.2648], [-4.5688, 40.2586], [-4.5677, 40.24], [-4.5598, 40.2279], [-4.5669, 40.2174], [-4.5791, 40.2164], [-4.6046, 40.2078], [-4.6166, 40.2001], [-4.6305, 40.2017], [-4.6426, 40.1974], [-4.6553, 40.199], [-4.6738, 40.2099], [-4.6866, 40.2112], [-4.6905, 40.2298], [-4.687, 40.2361], [-4.693, 40.2426], [-4.6879, 40.2494], [-4.7019, 40.257], [-4.6952, 40.2663], [-4.698, 40.282], [-4.7127, 40.2802], [-4.7133, 40.2755], [-4.7283, 40.2717], [-4.7425, 40.2738], [-4.7631, 40.2602], [-4.7868, 40.2708], [-4.804, 40.2764], [-4.8175, 40.2546], [-4.8075, 40.2345], [-4.8224, 40.2291], [-4.8252, 40.2183], [-4.8394, 40.2103], [-4.8546, 40.2075], [-4.8731, 40.1993], [-4.8761, 40.1943], [-4.895, 40.1853], [-4.9073, 40.1764], [-4.9233, 40.1694], [-4.9181, 40.1522], [-4.9288, 40.1347], [-4.954, 40.1331], [-4.9662, 40.1188], [-4.9892, 40.1153], [-5.0075, 40.109], [-5.0075, 40.1309], [-5.0169, 40.1455], [-5.0188, 40.158], [-5.0291, 40.1573], [-5.0432, 40.1502], [-5.062, 40.1509], [-5.0703, 40.1484], [-5.0859, 40.1344], [-5.0912, 40.123], [-5.0998, 40.1265], [-5.1095, 40.1143], [-5.1272, 40.1019], [-5.1397, 40.0968], [-5.1409, 40.0913], [-5.1548, 40.0925], [-5.1704, 40.0853], [-5.1829, 40.0887], [-5.1932, 40.0823], [-5.2063, 40.0841], [-5.2109, 40.091], [-5.2116, 40.1055], [-5.2621, 40.109], [-5.2972, 40.1093], [-5.3199, 40.1073], [-5.3361, 40.1144], [-5.3376, 40.1229], [-5.3454, 40.1281], [-5.3614, 40.1573], [-5.3681, 40.1611], [-5.3644, 40.1796], [-5.3698, 40.2089], [-5.3696, 40.2176], [-5.3591, 40.2267], [-5.3435, 40.2623], [-5.3555, 40.2639], [-5.3675, 40.256], [-5.3767, 40.2567], [-5.3908, 40.2509], [-5.4152, 40.2543], [-5.4285, 40.2521], [-5.4372, 40.2358], [-5.4453, 40.2304], [-5.4675, 40.2223], [-5.4705, 40.2097], [-5.4972, 40.1995], [-5.5058, 40.2016], [-5.5294, 40.1948], [-5.5472, 40.197], [-5.5954, 40.2164], [-5.6092, 40.2158], [-5.6184, 40.2245], [-5.6136, 40.235], [-5.6261, 40.2475], [-5.645, 40.2485], [-5.6599, 40.2575], [-5.6579, 40.2701], [-5.6745, 40.2785], [-5.6911, 40.2919], [-5.6986, 40.2889], [-5.7377, 40.2938], [-5.7644, 40.2804], [-5.7915, 40.2863], [-5.8021, 40.297], [-5.7923, 40.3006], [-5.7821, 40.3132], [-5.784, 40.3224], [-5.7956, 40.3509], [-5.8065, 40.3587], [-5.8189, 40.3601], [-5.8408, 40.3426], [-5.8938, 40.3201], [-5.8925, 40.3119], [-5.904, 40.2951], [-5.9239, 40.2813], [-5.9382, 40.2809], [-5.9454, 40.2852], [-5.9766, 40.2932], [-6.0067, 40.3053], [-6.0186, 40.3187], [-6.0205, 40.3275], [-6.0163, 40.3395], [-6.0268, 40.3384], [-6.0492, 40.3415], [-6.059, 40.3465], [-6.0968, 40.3534], [-6.0917, 40.3609], [-6.0818, 40.3643], [-6.0835, 40.3797], [-6.0759, 40.381], [-6.0722, 40.3947], [-6.076, 40.4024], [-6.1039, 40.4137], [-6.1169, 40.4143], [-6.1277, 40.4203], [-6.1158, 40.4361], [-6.1196, 40.4409], [-6.1441, 40.4345], [-6.1545, 40.4456], [-6.1573, 40.4568], [-6.1823, 40.464], [-6.1988, 40.4812], [-6.2381, 40.4852], [-6.2547, 40.4698], [-6.2657, 40.4688], [-6.2728, 40.4596], [-6.2922, 40.4523], [-6.3246, 40.4471], [-6.3427, 40.4423], [-6.3475, 40.4337], [-6.3615, 40.4227], [-6.3623, 40.4065], [-6.3742, 40.4003], [-6.389, 40.3982], [-6.4039, 40.4009], [-6.4169, 40.3988], [-6.4352, 40.3834], [-6.4381, 40.3722], [-6.451, 40.3697], [-6.4615, 40.3725], [-6.4763, 40.3684], [-6.4855, 40.3626], [-6.5251, 40.3518], [-6.5456, 40.3408], [-6.5582, 40.3306], [-6.5631, 40.315], [-6.558, 40.3072], [-6.5611, 40.2976], [-6.5569, 40.2898], [-6.5871, 40.2694], [-6.5986, 40.2702], [-6.6145, 40.2651], [-6.6324, 40.264], [-6.6389, 40.2686], [-6.6679, 40.2622], [-6.6791, 40.2496], [-6.6936, 40.2429], [-6.717, 40.2688], [-6.7349, 40.2569], [-6.7426, 40.2549], [-6.7604, 40.2395], [-6.7841, 40.2487], [-6.8018, 40.2486], [-6.8007, 40.242], [-6.8197, 40.2429], [-6.8337, 40.2464], [-6.848, 40.2541], [-6.8656, 40.2673], [-6.8632, 40.2769], [-6.8643, 40.2936], [-6.8591, 40.3004], [-6.8393, 40.3126], [-6.8145, 40.3239], [-6.8016, 40.3245], [-6.7908, 40.3327], [-6.7936, 40.353], [-6.7816, 40.3664], [-6.7943, 40.3726], [-6.8123, 40.39], [-6.8266, 40.3997], [-6.836, 40.4101], [-6.8415, 40.422], [-6.847, 40.4457], [-6.8463, 40.4577], [-6.8337, 40.4765], [-6.8183, 40.49], [-6.8119, 40.503], [-6.797, 40.5105], [-6.797, 40.5193], [-6.8051, 40.5382], [-6.8012, 40.5507], [-6.8429, 40.5691], [-6.8362, 40.5841], [-6.837, 40.593], [-6.8265, 40.6036], [-6.81, 40.627], [-6.7949, 40.6604], [-6.8047, 40.6688], [-6.8021, 40.6793], [-6.8064, 40.6968], [-6.8117, 40.7038], [-6.811, 40.7176], [-6.824, 40.7304], [-6.8296, 40.7424], [-6.8302, 40.7531], [-6.8263, 40.7739], [-6.8178, 40.7947], [-6.816, 40.806], [-6.8225, 40.8164], [-6.8242, 40.8441], [-6.8154, 40.8414], [-6.8021, 40.846], [-6.8042, 40.8674], [-6.8086, 40.8835], [-6.8293, 40.8862], [-6.8472, 40.9025], [-6.8474, 40.9252], [-6.8582, 40.9509], [-6.8741, 40.9609], [-6.9107, 41.0002], [-6.9206, 41.0031], [-6.9287, 41.0149], [-6.9311, 41.0291], [-6.9145, 41.0383], [-6.8748, 41.0274], [-6.8354, 41.0283], [-6.8083, 41.0366], [-6.8074, 41.046], [-6.7965, 41.0522], [-6.7772, 41.0728], [-6.7672, 41.089], [-6.7561, 41.101], [-6.7711, 41.1252], [-6.7692, 41.1326], [-6.7511, 41.1414], [-6.7297, 41.162], [-6.7113, 41.1707], [-6.6989, 41.182], [-6.6886, 41.2003], [-6.6916, 41.2071], [-6.6631, 41.2316], [-6.653, 41.2355], [-6.6452, 41.2483], [-6.6292, 41.2428], [-6.6192, 41.2473], [-6.5869, 41.2526], [-6.5859, 41.244], [-6.5781, 41.2387], [-6.5532, 41.2449], [-6.5475, 41.2569], [-6.5175, 41.2748], [-6.5091, 41.2644], [-6.4821, 41.2735], [-6.481, 41.2789], [-6.4907, 41.2878], [-6.4677, 41.3008], [-6.4465, 41.3], [-6.4374, 41.3062], [-6.4395, 41.3119], [-6.4328, 41.3206], [-6.4188, 41.3268], [-6.4267, 41.3343], [-6.4149, 41.3476], [-6.3921, 41.3502], [-6.3772, 41.3589], [-6.3935, 41.3704], [-6.3901, 41.3844], [-6.3685, 41.3929], [-6.3623, 41.3835], [-6.3448, 41.3789], [-6.3162, 41.3899], [-6.321, 41.4005], [-6.3325, 41.4052], [-6.3276, 41.4155], [-6.3091, 41.4201], [-6.2957, 41.4373], [-6.3055, 41.4498], [-6.2851, 41.4674], [-6.2826, 41.4793], [-6.2637, 41.4867], [-6.2657, 41.4947], [-6.2513, 41.4978], [-6.2562, 41.5117], [-6.2358, 41.5215], [-6.2178, 41.5413], [-6.216, 41.5498], [-6.2071, 41.5618], [-6.1913, 41.5739], [-6.1996, 41.5918], [-6.2072, 41.5978], [-6.2232, 41.6013], [-6.2369, 41.6087], [-6.2568, 41.6346], [-6.2964, 41.659], [-6.3485, 41.6747], [-6.3741, 41.6739], [-6.4063, 41.6805], [-6.4152, 41.6785], [-6.4514, 41.6816], [-6.4546, 41.6714], [-6.4875, 41.658], [-6.5113, 41.661], [-6.5277, 41.6747], [-6.5414, 41.6803], [-6.5528, 41.6925], [-6.5418, 41.7037], [-6.5531, 41.7197], [-6.5568, 41.7316], [-6.5541, 41.7372], [-6.567, 41.7457], [-6.5554, 41.7542], [-6.5521, 41.7687], [-6.544, 41.7784], [-6.5436, 41.7955], [-6.5366, 41.8108], [-6.5279, 41.819], [-6.5301, 41.8357], [-6.5218, 41.8522], [-6.5232, 41.86], [-6.5153, 41.8684], [-6.5198, 41.875], [-6.5538, 41.8794], [-6.5696, 41.8848], [-6.5595, 41.9004], [-6.556, 41.9129], [-6.5445, 41.9326], [-6.5501, 41.9444], [-6.5878, 41.9665], [-6.5999, 41.9476], [-6.6078, 41.9477], [-6.6181, 41.9406], [-6.635, 41.9416], [-6.6969, 41.9332], [-6.7151, 41.9381], [-6.7286, 41.9376], [-6.7487, 41.9423], [-6.7536, 41.9478], [-6.7721, 41.9847], [-6.7793, 41.9874], [-6.8053, 41.9901], [-6.811, 41.9804], [-6.8116, 41.9673], [-6.8226, 41.9466], [-6.8299, 41.9435], [-6.8487, 41.9425], [-6.8666, 41.9473], [-6.892, 41.9395], [-6.9327, 41.946], [-6.944, 41.9442], [-6.9556, 41.9645], [-6.9619, 41.9695], [-6.9823, 41.9729], [-6.9896, 41.9835], [-6.9869, 41.9962], [-6.977, 42.0021], [-6.9689, 42.0141], [-6.963, 42.0307], [-6.9731, 42.0422], [-6.9743, 42.054], [-6.9938, 42.0507], [-7.0082, 42.0515], [-7.0211, 42.0612], [-7.0317, 42.065], [-7.0319, 42.0753], [-7.0202, 42.0827], [-7.0056, 42.0842], [-7.0015, 42.0952], [-6.9923, 42.099], [-6.9865, 42.1233], [-6.9544, 42.1285], [-6.9427, 42.1392], [-6.9442, 42.148], [-6.9392, 42.1657], [-6.9398, 42.1763], [-6.9155, 42.1893], [-6.9008, 42.19], [-6.8875, 42.2011], [-6.8909, 42.2071], [-6.8838, 42.2158], [-6.87, 42.2231], [-6.8418, 42.2278], [-6.8028, 42.2184], [-6.7954, 42.2085], [-6.7867, 42.2152], [-6.8009, 42.2369], [-6.7854, 42.2527], [-6.7652, 42.2578], [-6.7602, 42.2766], [-6.7386, 42.2968], [-6.7345, 42.3111], [-6.7408, 42.3334], [-6.733, 42.3589], [-6.7566, 42.3663], [-6.7662, 42.3666], [-6.7807, 42.3816], [-6.7974, 42.3821], [-6.8038, 42.3862], [-6.8199, 42.3863], [-6.8411, 42.4041], [-6.8291, 42.4071], [-6.8299, 42.4132], [-6.8203, 42.4214], [-6.8215, 42.4541], [-6.8083, 42.4661], [-6.8236, 42.484], [-6.8281, 42.4929], [-6.8407, 42.4872], [-6.8582, 42.4868], [-6.8806, 42.4988], [-6.9065, 42.5069], [-6.9137, 42.5067], [-6.9297, 42.5194], [-6.9546, 42.5177], [-6.9636, 42.513], [-6.9748, 42.4921], [-6.9956, 42.4966], [-7.0015, 42.5035], [-7.0286, 42.4972], [-7.0378, 42.5049], [-7.0479, 42.5075], [-7.0708, 42.5058], [-7.0671, 42.5194], [-7.0599, 42.5283], [-7.0604, 42.5358], [-7.0707, 42.5368], [-7.0567, 42.5587], [-7.0546, 42.57], [-7.0381, 42.5798], [-7.0491, 42.5954], [-7.0461, 42.6197], [-7.0478, 42.6282], [-7.0411, 42.6355], [-7.0095, 42.6497], [-7.0155, 42.6641], [-7.032, 42.6765], [-7.0344, 42.6851], [-7.0441, 42.6952], [-7.03, 42.7094], [-7.0067, 42.7246], [-6.9887, 42.7263], [-6.9821, 42.7196], [-6.9688, 42.7297], [-6.9668, 42.748], [-6.9551, 42.7545], [-6.947, 42.7425], [-6.9348, 42.7413], [-6.9036, 42.7595], [-6.8926, 42.7756], [-6.8664, 42.788], [-6.8684, 42.8024], [-6.854, 42.8117], [-6.8497, 42.8201], [-6.8411, 42.8239], [-6.8589, 42.8481], [-6.8703, 42.8743], [-6.8337, 42.8821], [-6.8355, 42.904], [-6.8234, 42.9152]]], [[[-2.8331, 42.7937], [-2.8236, 42.7854], [-2.7993, 42.7914], [-2.7396, 42.7918], [-2.7319, 42.7932], [-2.709, 42.7824], [-2.6919, 42.7783], [-2.6783, 42.7791], [-2.6693, 42.7728], [-2.6551, 42.7718], [-2.6513, 42.7666], [-2.6344, 42.7646], [-2.6263, 42.7694], [-2.6037, 42.77], [-2.5924, 42.7583], [-2.5896, 42.7502], [-2.559, 42.7624], [-2.563, 42.7405], [-2.5743, 42.7237], [-2.589, 42.7111], [-2.6002, 42.7149], [-2.6079, 42.707], [-2.6089, 42.6963], [-2.5938, 42.6894], [-2.5793, 42.6735], [-2.5491, 42.6693], [-2.5392, 42.6858], [-2.5227, 42.6836], [-2.524, 42.6671], [-2.5175, 42.6571], [-2.5168, 42.6473], [-2.5382, 42.6396], [-2.5481, 42.6385], [-2.5515, 42.6488], [-2.5646, 42.6443], [-2.5834, 42.6513], [-2.6003, 42.6509], [-2.6142, 42.6471], [-2.6355, 42.6472], [-2.6519, 42.6605], [-2.6546, 42.6699], [-2.6663, 42.6668], [-2.6882, 42.6727], [-2.7041, 42.6736], [-2.7147, 42.6688], [-2.7181, 42.6616], [-2.7362, 42.6621], [-2.7486, 42.6653], [-2.7674, 42.6657], [-2.7697, 42.6748], [-2.7849, 42.6978], [-2.7949, 42.6979], [-2.8123, 42.7062], [-2.8241, 42.7081], [-2.8292, 42.7178], [-2.8437, 42.7236], [-2.8612, 42.7451], [-2.851, 42.7516], [-2.8537, 42.7659], [-2.8388, 42.7809], [-2.8331, 42.7937]]], [[[-4.166, 42.8218], [-4.1614, 42.8128], [-4.1723, 42.8096], [-4.1793, 42.8167], [-4.166, 42.8218]]], [[[-4.0933, 42.8215], [-4.089, 42.8183], [-4.0891, 42.8005], [-4.1017, 42.794], [-4.1082, 42.8021], [-4.1058, 42.809], [-4.1118, 42.8161], [-4.1075, 42.8264], [-4.0933, 42.8215]]]] }, "properties": { "name": "Castilla y Leรณn", "id": "ES-CL", "CNTRY": "Spain", "TYPE": "Autonomous Community" }, "id": "ES-CL" }, { "type": "Feature", "geometry": { "type": "MultiPolygon", "coordinates": [[[[-3.1525, 43.354], [-3.1486, 43.3483], [-3.1561, 43.3382], [-3.1504, 43.3248], [-3.1512, 43.3074], [-3.1567, 43.3019], [-3.1883, 43.2993], [-3.2037, 43.291], [-3.2176, 43.2875], [-3.2235, 43.2974], [-3.2244, 43.3091], [-3.2454, 43.3049], [-3.2517, 43.2984], [-3.2781, 43.2903], [-3.2886, 43.2905], [-3.2938, 43.3008], [-3.3215, 43.293], [-3.3308, 43.301], [-3.3398, 43.2947], [-3.338, 43.2785], [-3.3592, 43.2729], [-3.3663, 43.2752], [-3.3816, 43.2707], [-3.3885, 43.2631], [-3.3918, 43.2516], [-3.3983, 43.2467], [-3.4107, 43.2507], [-3.4131, 43.2435], [-3.4307, 43.2419], [-3.4365, 43.2358], [-3.4482, 43.2367], [-3.44, 43.2177], [-3.4333, 43.2102], [-3.4328, 43.1818], [-3.4296, 43.1667], [-3.4201, 43.1503], [-3.4164, 43.1348], [-3.4425, 43.1326], [-3.4567, 43.1367], [-3.4856, 43.1344], [-3.5283, 43.1431], [-3.5401, 43.1483], [-3.5592, 43.1501], [-3.5847, 43.1553], [-3.6021, 43.1513], [-3.6105, 43.1696], [-3.6486, 43.1814], [-3.6665, 43.1586], [-3.6744, 43.1558], [-3.683, 43.1394], [-3.7038, 43.1169], [-3.7326, 43.1039], [-3.7524, 43.1016], [-3.7554, 43.0867], [-3.7646, 43.0815], [-3.7732, 43.0831], [-3.7881, 43.0791], [-3.8097, 43.0873], [-3.82, 43.0818], [-3.8584, 43.087], [-3.8585, 43.0732], [-3.8498, 43.0493], [-3.8548, 43.0403], [-3.87, 43.0446], [-3.8928, 43.0418], [-3.8982, 43.0315], [-3.9172, 43.0154], [-3.947, 43.0066], [-3.9613, 42.9904], [-3.9732, 42.9694], [-3.9867, 42.9411], [-3.9895, 42.9307], [-3.9725, 42.9111], [-3.9426, 42.9095], [-3.9321, 42.8993], [-3.9255, 42.9036], [-3.9232, 42.9154], [-3.9109, 42.924], [-3.8907, 42.9251], [-3.8853, 42.9488], [-3.8759, 42.9478], [-3.8646, 42.9548], [-3.8405, 42.9398], [-3.83, 42.9283], [-3.8329, 42.9192], [-3.8542, 42.9159], [-3.8581, 42.9034], [-3.8655, 42.8988], [-3.8822, 42.9036], [-3.8966, 42.9027], [-3.8928, 42.8892], [-3.9036, 42.8851], [-3.8978, 42.8788], [-3.9126, 42.8667], [-3.897, 42.8555], [-3.8883, 42.8567], [-3.8734, 42.852], [-3.8736, 42.8766], [-3.8626, 42.8892], [-3.8376, 42.8786], [-3.8255, 42.8674], [-3.8333, 42.8521], [-3.8184, 42.8379], [-3.8158, 42.8102], [-3.8225, 42.7993], [-3.8522, 42.7883], [-3.8636, 42.7869], [-3.8798, 42.7937], [-3.8937, 42.8048], [-3.8998, 42.7899], [-3.9087, 42.7868], [-3.9115, 42.7683], [-3.926, 42.7694], [-3.9319, 42.7739], [-3.9442, 42.7703], [-3.9478, 42.7616], [-3.9789, 42.7587], [-3.9817, 42.7672], [-3.9896, 42.7714], [-4.0002, 42.7691], [-3.997, 42.7984], [-4.0015, 42.8093], [-4.0022, 42.8295], [-4.0131, 42.8297], [-4.0217, 42.8195], [-4.0166, 42.8073], [-4.0335, 42.801], [-4.0289, 42.7897], [-4.0398, 42.7907], [-4.0504, 42.7801], [-4.0467, 42.7661], [-4.0694, 42.761], [-4.0819, 42.7617], [-4.0863, 42.7714], [-4.0945, 42.7739], [-4.0996, 42.7912], [-4.12, 42.7946], [-4.1497, 42.7893], [-4.1737, 42.8081], [-4.1832, 42.81], [-4.1845, 42.8213], [-4.1635, 42.8292], [-4.1597, 42.8379], [-4.1418, 42.8293], [-4.129, 42.8457], [-4.1272, 42.8572], [-4.1382, 42.8587], [-4.1482, 42.8653], [-4.1659, 42.8597], [-4.1819, 42.8587], [-4.1975, 42.8456], [-4.2098, 42.8457], [-4.2239, 42.8568], [-4.226, 42.8892], [-4.2294, 42.9046], [-4.2228, 42.9114], [-4.2346, 42.9149], [-4.2382, 42.9386], [-4.2354, 42.9547], [-4.2548, 42.9638], [-4.2904, 42.9691], [-4.3019, 42.9673], [-4.3139, 42.9703], [-4.3466, 42.9741], [-4.3626, 42.9871], [-4.3895, 43.0158], [-4.3931, 43.026], [-4.4059, 43.039], [-4.4358, 43.047], [-4.4499, 43.0603], [-4.4645, 43.0626], [-4.4773, 43.0461], [-4.4776, 43.0406], [-4.4974, 43.04], [-4.5201, 43.0477], [-4.558, 43.0204], [-4.5721, 43.0275], [-4.5901, 43.0269], [-4.605, 43.0369], [-4.6107, 43.0314], [-4.6275, 43.0253], [-4.6394, 43.018], [-4.6529, 43.0214], [-4.6703, 43.0219], [-4.6818, 43.0272], [-4.703, 43.0269], [-4.7198, 43.019], [-4.7349, 43.0217], [-4.7408, 43.0286], [-4.7322, 43.0485], [-4.7418, 43.0572], [-4.7634, 43.0567], [-4.7637, 43.0759], [-4.782, 43.0849], [-4.8143, 43.0944], [-4.8296, 43.1029], [-4.8338, 43.117], [-4.8477, 43.1288], [-4.8401, 43.1379], [-4.8324, 43.1585], [-4.8357, 43.169], [-4.8479, 43.1738], [-4.8368, 43.1832], [-4.8196, 43.1809], [-4.7888, 43.187], [-4.7766, 43.1936], [-4.7533, 43.1927], [-4.7424, 43.1857], [-4.7315, 43.1946], [-4.7338, 43.2102], [-4.7268, 43.2173], [-4.719, 43.2396], [-4.7288, 43.2573], [-4.7104, 43.2623], [-4.7045, 43.267], [-4.6756, 43.2685], [-4.6571, 43.2649], [-4.6486, 43.269], [-4.6321, 43.2684], [-4.6352, 43.2766], [-4.607, 43.2962], [-4.5998, 43.2989], [-4.5786, 43.2902], [-4.569, 43.2918], [-4.5531, 43.2871], [-4.5528, 43.2724], [-4.5374, 43.2697], [-4.5226, 43.2789], [-4.5167, 43.2931], [-4.5173, 43.3129], [-4.5272, 43.326], [-4.5262, 43.3398], [-4.5371, 43.3473], [-4.5334, 43.3674], [-4.5225, 43.3714], [-4.5116, 43.3807], [-4.5126, 43.3937], [-4.4954, 43.3977], [-4.4879, 43.3935], [-4.4588, 43.3943], [-4.4201, 43.3985], [-4.4022, 43.3978], [-4.3875, 43.391], [-4.3719, 43.3925], [-4.3542, 43.4032], [-4.3376, 43.4057], [-4.3367, 43.399], [-4.3215, 43.3897], [-4.2905, 43.3935], [-4.279, 43.3887], [-4.2555, 43.3974], [-4.2473, 43.3964], [-4.2309, 43.4007], [-4.2217, 43.3979], [-4.2076, 43.4015], [-4.1984, 43.3997], [-4.1826, 43.4041], [-4.174, 43.4019], [-4.1424, 43.4145], [-4.1148, 43.4185], [-4.0947, 43.4276], [-4.0809, 43.4392], [-4.0742, 43.4315], [-4.0537, 43.4344], [-4.0465, 43.4399], [-4.0344, 43.4363], [-4.0174, 43.4492], [-3.998, 43.4409], [-3.9601, 43.4543], [-3.9409, 43.4706], [-3.8772, 43.479], [-3.8609, 43.4774], [-3.8099, 43.4964], [-3.784, 43.4924], [-3.786, 43.4813], [-3.7742, 43.4706], [-3.7797, 43.4644], [-3.8007, 43.4625], [-3.8129, 43.4507], [-3.8337, 43.4435], [-3.8341, 43.4329], [-3.8177, 43.4321], [-3.808, 43.4211], [-3.8188, 43.4154], [-3.8143, 43.404], [-3.7897, 43.4198], [-3.7883, 43.43], [-3.7769, 43.4345], [-3.7686, 43.4503], [-3.7624, 43.4456], [-3.7392, 43.4587], [-3.7285, 43.4618], [-3.7268, 43.4703], [-3.7038, 43.4798], [-3.6907, 43.4761], [-3.6791, 43.479], [-3.6741, 43.4859], [-3.6434, 43.4997], [-3.6105, 43.4991], [-3.5954, 43.5133], [-3.5794, 43.5089], [-3.5451, 43.5086], [-3.539, 43.5041], [-3.5376, 43.4931], [-3.519, 43.4961], [-3.513, 43.4916], [-3.5117, 43.4784], [-3.4888, 43.4718], [-3.4743, 43.4711], [-3.4675, 43.4668], [-3.4325, 43.4659], [-3.4248, 43.4588], [-3.4235, 43.4461], [-3.4279, 43.4418], [-3.4465, 43.4361], [-3.4327, 43.4163], [-3.4194, 43.4124], [-3.4129, 43.4188], [-3.373, 43.4172], [-3.3638, 43.4129], [-3.3415, 43.4178], [-3.3308, 43.4176], [-3.3166, 43.4021], [-3.3089, 43.4104], [-3.2961, 43.4097], [-3.2753, 43.4035], [-3.2563, 43.4039], [-3.22, 43.3947], [-3.2214, 43.3859], [-3.2104, 43.3762], [-3.1934, 43.3724], [-3.1925, 43.3646], [-3.1525, 43.354]]], [[[-4.166, 42.8218], [-4.1614, 42.8128], [-4.1723, 42.8096], [-4.1793, 42.8167], [-4.166, 42.8218]]], [[[-4.0933, 42.8215], [-4.089, 42.8183], [-4.0891, 42.8005], [-4.1017, 42.794], [-4.1082, 42.8021], [-4.1058, 42.809], [-4.1118, 42.8161], [-4.1075, 42.8264], [-4.0933, 42.8215]]], [[[-3.2832, 43.1998], [-3.294, 43.2061], [-3.2918, 43.2194], [-3.296, 43.2238], [-3.2915, 43.2399], [-3.3053, 43.254], [-3.3035, 43.2596], [-3.2785, 43.2633], [-3.2652, 43.2676], [-3.248, 43.2606], [-3.2505, 43.2487], [-3.268, 43.2325], [-3.2703, 43.2199], [-3.2644, 43.2079], [-3.2832, 43.1998]]]] }, "properties": { "name": "Cantabria", "id": "ES-CB", "CNTRY": "Spain", "TYPE": "Autonomous Community" }, "id": "ES-CB" }, { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [[[-4.5126, 43.3937], [-4.5116, 43.3807], [-4.5225, 43.3714], [-4.5334, 43.3674], [-4.5371, 43.3473], [-4.5262, 43.3398], [-4.5272, 43.326], [-4.5173, 43.3129], [-4.5167, 43.2931], [-4.5226, 43.2789], [-4.5374, 43.2697], [-4.5528, 43.2724], [-4.5531, 43.2871], [-4.569, 43.2918], [-4.5786, 43.2902], [-4.5998, 43.2989], [-4.607, 43.2962], [-4.6352, 43.2766], [-4.6321, 43.2684], [-4.6486, 43.269], [-4.6571, 43.2649], [-4.6756, 43.2685], [-4.7045, 43.267], [-4.7104, 43.2623], [-4.7288, 43.2573], [-4.719, 43.2396], [-4.7268, 43.2173], [-4.7338, 43.2102], [-4.7315, 43.1946], [-4.7424, 43.1857], [-4.7533, 43.1927], [-4.7766, 43.1936], [-4.7888, 43.187], [-4.8196, 43.1809], [-4.8368, 43.1832], [-4.8377, 43.1916], [-4.8585, 43.2064], [-4.8594, 43.2202], [-4.8674, 43.2274], [-4.8923, 43.2386], [-4.9098, 43.238], [-4.917, 43.2293], [-4.9399, 43.2252], [-4.9507, 43.2157], [-4.9626, 43.212], [-4.969, 43.2029], [-4.9774, 43.2005], [-4.9933, 43.1858], [-4.9944, 43.1747], [-5.0191, 43.1856], [-5.041, 43.1848], [-5.0528, 43.1805], [-5.0729, 43.182], [-5.0736, 43.1692], [-5.0854, 43.1484], [-5.0921, 43.1437], [-5.0877, 43.1317], [-5.0962, 43.1174], [-5.0936, 43.1087], [-5.0994, 43.1033], [-5.1204, 43.1018], [-5.1378, 43.1043], [-5.1455, 43.1157], [-5.1591, 43.1115], [-5.1731, 43.1014], [-5.1869, 43.1006], [-5.1985, 43.0926], [-5.2193, 43.0853], [-5.2527, 43.0913], [-5.2749, 43.086], [-5.2795, 43.0796], [-5.2989, 43.0816], [-5.3119, 43.0859], [-5.3229, 43.0798], [-5.3391, 43.085], [-5.3421, 43.0954], [-5.3625, 43.0967], [-5.3823, 43.0875], [-5.3866, 43.0551], [-5.3973, 43.049], [-5.4185, 43.0543], [-5.4461, 43.0565], [-5.4638, 43.0519], [-5.4779, 43.056], [-5.4786, 43.0423], [-5.4915, 43.0275], [-5.5083, 43.0296], [-5.5246, 43.0277], [-5.5379, 43.0205], [-5.5671, 43.0235], [-5.5726, 43.0327], [-5.6024, 43.0373], [-5.6335, 43.0354], [-5.6481, 43.0457], [-5.6889, 43.0587], [-5.7009, 43.0522], [-5.7249, 43.0441], [-5.7332, 43.0347], [-5.736, 43.0242], [-5.7473, 43.0162], [-5.748, 43.0068], [-5.7562, 43.001], [-5.7655, 42.9877], [-5.7615, 42.9762], [-5.7687, 42.969], [-5.8052, 42.9647], [-5.8228, 42.9683], [-5.8445, 42.9648], [-5.8612, 42.9815], [-5.8892, 42.981], [-5.891, 42.9899], [-5.9128, 42.9935], [-5.9119, 42.9978], [-5.938, 43.0148], [-5.956, 43.0208], [-5.9594, 43.0344], [-5.967, 43.0406], [-5.9652, 43.0577], [-5.9857, 43.069], [-5.994, 43.0607], [-6.0102, 43.0567], [-6.0266, 43.0572], [-6.0335, 43.0626], [-6.052, 43.0684], [-6.0663, 43.0668], [-6.0809, 43.0704], [-6.0886, 43.0659], [-6.0925, 43.0559], [-6.0904, 43.0395], [-6.0971, 43.0327], [-6.1117, 43.0305], [-6.1204, 43.0246], [-6.1366, 43.0208], [-6.1467, 43.0355], [-6.1613, 43.0342], [-6.1651, 43.0418], [-6.1764, 43.0482], [-6.1944, 43.0443], [-6.2143, 43.0478], [-6.2234, 43.0179], [-6.2273, 43.0108], [-6.2386, 43.0152], [-6.2644, 43.0178], [-6.2846, 43.037], [-6.2985, 43.0294], [-6.3281, 43.0343], [-6.3321, 43.0474], [-6.3457, 43.0508], [-6.358, 43.0605], [-6.3722, 43.0427], [-6.3944, 43.0404], [-6.3903, 43.028], [-6.3936, 43.0189], [-6.4114, 43.0146], [-6.4097, 43.0018], [-6.4222, 42.9893], [-6.4361, 42.9937], [-6.4449, 42.9825], [-6.4773, 42.9921], [-6.4782, 42.9805], [-6.4724, 42.9671], [-6.4625, 42.9682], [-6.434, 42.9635], [-6.4411, 42.9487], [-6.4356, 42.943], [-6.4495, 42.936], [-6.4767, 42.9339], [-6.4897, 42.9201], [-6.5113, 42.9283], [-6.5288, 42.9245], [-6.5436, 42.9134], [-6.5658, 42.9158], [-6.5746, 42.9191], [-6.6038, 42.9171], [-6.6101, 42.9244], [-6.6254, 42.9208], [-6.6363, 42.9263], [-6.6545, 42.9258], [-6.6915, 42.922], [-6.7117, 42.9156], [-6.7232, 42.9172], [-6.7504, 42.8926], [-6.7565, 42.8831], [-6.7724, 42.8822], [-6.7676, 42.8919], [-6.7722, 42.8995], [-6.8029, 42.9109], [-6.8234, 42.9152], [-6.8359, 42.9168], [-6.8406, 42.9302], [-6.8339, 42.9418], [-6.8353, 42.9589], [-6.8529, 42.9744], [-6.8795, 42.9919], [-6.8899, 42.9894], [-6.9072, 42.9904], [-6.9188, 43.0006], [-6.9388, 43.0128], [-6.9451, 43.0329], [-6.9538, 43.0367], [-6.9616, 43.027], [-6.9579, 43.0156], [-6.9586, 43.001], [-6.9663, 42.9936], [-6.9824, 43.0052], [-6.9851, 43.0153], [-6.9957, 43.0212], [-6.9908, 43.0313], [-6.9655, 43.0357], [-6.962, 43.0445], [-6.9668, 43.0566], [-6.9498, 43.0685], [-6.9503, 43.0769], [-6.9391, 43.0819], [-6.9219, 43.0824], [-6.9129, 43.0751], [-6.8929, 43.0921], [-6.8701, 43.0921], [-6.8642, 43.1008], [-6.8291, 43.1234], [-6.8248, 43.1362], [-6.826, 43.1467], [-6.8352, 43.1564], [-6.8396, 43.1674], [-6.8556, 43.1726], [-6.8848, 43.1676], [-6.883, 43.1581], [-6.9019, 43.1542], [-6.9186, 43.1416], [-6.9281, 43.1435], [-6.937, 43.1333], [-6.9551, 43.136], [-6.9576, 43.1429], [-6.973, 43.1523], [-6.9791, 43.166], [-6.9728, 43.1795], [-6.9647, 43.1864], [-6.9692, 43.2041], [-6.9863, 43.2033], [-7.0009, 43.2093], [-7.0087, 43.2237], [-7.021, 43.2153], [-7.0333, 43.2285], [-7.0471, 43.2333], [-7.0626, 43.2475], [-7.07, 43.2688], [-7.0639, 43.2894], [-7.0642, 43.2998], [-7.0912, 43.2999], [-7.0997, 43.3034], [-7.1104, 43.3158], [-7.1136, 43.3258], [-7.1298, 43.3306], [-7.1321, 43.3465], [-7.1314, 43.3633], [-7.1276, 43.3717], [-7.1367, 43.3837], [-7.1584, 43.3748], [-7.175, 43.3867], [-7.1793, 43.3969], [-7.1718, 43.4011], [-7.1765, 43.4141], [-7.17, 43.4219], [-7.1733, 43.4296], [-7.1624, 43.4316], [-7.1507, 43.4281], [-7.1422, 43.4303], [-7.1258, 43.4235], [-7.1019, 43.4276], [-7.0987, 43.4384], [-7.0919, 43.444], [-7.0914, 43.4526], [-7.0783, 43.4651], [-7.063, 43.4737], [-7.0555, 43.4724], [-7.046, 43.478], [-7.0425, 43.4937], [-7.0432, 43.5075], [-7.0265, 43.5257], [-7.0138, 43.5247], [-7.0304, 43.5447], [-7.0217, 43.5489], [-7.0232, 43.5594], [-6.9962, 43.5513], [-6.9822, 43.5583], [-6.975, 43.5556], [-6.9478, 43.5652], [-6.9382, 43.5706], [-6.9151, 43.5729], [-6.8706, 43.5673], [-6.8542, 43.5684], [-6.8485, 43.5645], [-6.8355, 43.5673], [-6.8244, 43.565], [-6.81, 43.5546], [-6.8034, 43.5586], [-6.7839, 43.5561], [-6.7736, 43.5678], [-6.7577, 43.562], [-6.7448, 43.5664], [-6.7402, 43.5615], [-6.7205, 43.5568], [-6.7095, 43.5631], [-6.6848, 43.5587], [-6.6744, 43.5597], [-6.6654, 43.566], [-6.624, 43.5716], [-6.6181, 43.5618], [-6.5909, 43.553], [-6.5804, 43.5573], [-6.5582, 43.5533], [-6.5427, 43.5552], [-6.5371, 43.546], [-6.5252, 43.5508], [-6.5124, 43.5471], [-6.5065, 43.5509], [-6.4879, 43.5488], [-6.4751, 43.5605], [-6.4707, 43.57], [-6.4593, 43.5635], [-6.439, 43.559], [-6.4286, 43.552], [-6.4145, 43.558], [-6.3972, 43.5592], [-6.3733, 43.5548], [-6.3699, 43.5503], [-6.3544, 43.5502], [-6.3273, 43.5611], [-6.3063, 43.5619], [-6.284, 43.5689], [-6.267, 43.5771], [-6.2597, 43.5758], [-6.2455, 43.5827], [-6.2383, 43.5921], [-6.2271, 43.5878], [-6.2177, 43.5781], [-6.2078, 43.5835], [-6.2031, 43.5724], [-6.1878, 43.5772], [-6.1917, 43.566], [-6.1833, 43.5627], [-6.1613, 43.5684], [-6.1357, 43.564], [-6.1162, 43.5542], [-6.103, 43.5599], [-6.0918, 43.5573], [-6.0809, 43.5648], [-6.0663, 43.5646], [-6.0369, 43.5771], [-6.0382, 43.582], [-6.018, 43.5873], [-6.0176, 43.5816], [-5.9996, 43.578], [-5.987, 43.5795], [-5.9575, 43.5785], [-5.9421, 43.5882], [-5.9354, 43.6009], [-5.9274, 43.598], [-5.9161, 43.6062], [-5.9174, 43.6198], [-5.8964, 43.6265], [-5.8893, 43.623], [-5.8678, 43.6313], [-5.8597, 43.6407], [-5.859, 43.6555], [-5.8415, 43.6589], [-5.8354, 43.6481], [-5.8204, 43.6442], [-5.807, 43.6345], [-5.7798, 43.6262], [-5.7882, 43.6137], [-5.7702, 43.6076], [-5.7706, 43.6015], [-5.7554, 43.5829], [-5.7474, 43.585], [-5.7304, 43.5728], [-5.7071, 43.5701], [-5.6998, 43.5613], [-5.6918, 43.543], [-5.68, 43.5449], [-5.6719, 43.5413], [-5.6594, 43.5445], [-5.6463, 43.5423], [-5.6435, 43.5491], [-5.6237, 43.5534], [-5.618, 43.5581], [-5.6072, 43.5504], [-5.5926, 43.548], [-5.5688, 43.5519], [-5.5276, 43.5461], [-5.5173, 43.5529], [-5.4918, 43.5463], [-5.4733, 43.551], [-5.4334, 43.551], [-5.4135, 43.5554], [-5.3997, 43.5525], [-5.3981, 43.5433], [-5.389, 43.5402], [-5.3892, 43.5316], [-5.3471, 43.5355], [-5.3331, 43.533], [-5.2946, 43.5354], [-5.2662, 43.519], [-5.2679, 43.5074], [-5.2503, 43.501], [-5.2427, 43.4938], [-5.2237, 43.4828], [-5.2151, 43.4738], [-5.1767, 43.4757], [-5.1475, 43.4788], [-5.1273, 43.4844], [-5.113, 43.4762], [-5.0977, 43.4773], [-5.082, 43.4746], [-5.0721, 43.4667], [-5.0564, 43.4687], [-5.0523, 43.4635], [-5.0129, 43.458], [-4.9791, 43.4577], [-4.9696, 43.4604], [-4.9293, 43.4616], [-4.9141, 43.4536], [-4.8837, 43.448], [-4.8714, 43.4423], [-4.8614, 43.4454], [-4.8384, 43.4457], [-4.8363, 43.4398], [-4.8241, 43.4353], [-4.8134, 43.4373], [-4.8058, 43.4316], [-4.7912, 43.4319], [-4.7653, 43.4288], [-4.7351, 43.4155], [-4.6976, 43.412], [-4.6908, 43.4072], [-4.6655, 43.4061], [-4.6568, 43.4015], [-4.6409, 43.4022], [-4.6274, 43.3971], [-4.5952, 43.3969], [-4.5821, 43.3994], [-4.5605, 43.3928], [-4.5542, 43.3981], [-4.5335, 43.3992], [-4.5126, 43.3937]]] }, "properties": { "name": "Asturias", "id": "ES-AS", "CNTRY": "Spain", "TYPE": "Autonomous Community" }, "id": "ES-AS" }, { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [[[-1.8462, 42.008], [-1.8358, 41.993], [-1.8133, 41.9959], [-1.7944, 41.9883], [-1.7779, 41.9938], [-1.7671, 41.9937], [-1.7328, 41.9622], [-1.7147, 41.9557], [-1.6868, 41.9527], [-1.674, 41.9657], [-1.6593, 41.96], [-1.6547, 41.9643], [-1.6418, 41.9579], [-1.6116, 41.9486], [-1.5958, 41.9268], [-1.5697, 41.9171], [-1.556, 41.9139], [-1.5221, 41.9102], [-1.5045, 41.9165], [-1.5007, 41.9231], [-1.4724, 41.9239], [-1.455, 41.9158], [-1.4169, 41.9135], [-1.4085, 41.9188], [-1.3965, 41.9382], [-1.3804, 41.9435], [-1.384, 41.9571], [-1.373, 41.9621], [-1.3634, 41.984], [-1.3315, 42.0254], [-1.3079, 42.041], [-1.3049, 42.0514], [-1.3128, 42.0636], [-1.312, 42.0731], [-1.3288, 42.0734], [-1.346, 42.0708], [-1.3529, 42.0728], [-1.3652, 42.091], [-1.3675, 42.106], [-1.3983, 42.1242], [-1.4005, 42.1304], [-1.3943, 42.1477], [-1.3985, 42.1584], [-1.3927, 42.1805], [-1.3969, 42.1903], [-1.4143, 42.2012], [-1.4183, 42.2112], [-1.4155, 42.2236], [-1.4013, 42.2431], [-1.4008, 42.2557], [-1.3921, 42.2736], [-1.3994, 42.2895], [-1.3869, 42.3016], [-1.365, 42.3285], [-1.3537, 42.338], [-1.3337, 42.3477], [-1.3301, 42.3601], [-1.3351, 42.3705], [-1.3511, 42.3699], [-1.3591, 42.3767], [-1.3528, 42.3865], [-1.3433, 42.4116], [-1.3412, 42.4236], [-1.3164, 42.4482], [-1.2932, 42.4546], [-1.2817, 42.4644], [-1.2738, 42.481], [-1.276, 42.4953], [-1.2874, 42.4986], [-1.2888, 42.5229], [-1.2653, 42.5565], [-1.2299, 42.542], [-1.2168, 42.5491], [-1.2037, 42.5488], [-1.2048, 42.5722], [-1.1966, 42.579], [-1.16, 42.6004], [-1.1789, 42.607], [-1.1708, 42.6171], [-1.1576, 42.6114], [-1.1557, 42.6412], [-1.1531, 42.6483], [-1.1124, 42.6457], [-1.0847, 42.6465], [-1.0704, 42.641], [-1.0555, 42.6422], [-1.0408, 42.6472], [-1.0406, 42.6635], [-1.0339, 42.675], [-1.0401, 42.6911], [-1.0175, 42.7024], [-1.0038, 42.6995], [-0.9696, 42.7037], [-0.9614, 42.7115], [-0.9494, 42.7117], [-0.936, 42.7349], [-0.9233, 42.7437], [-0.9028, 42.7427], [-0.9006, 42.7607], [-0.8927, 42.763], [-0.8732, 42.7591], [-0.865, 42.763], [-0.8483, 42.7839], [-0.8508, 42.7935], [-0.8603, 42.7991], [-0.8516, 42.8081], [-0.8572, 42.8342], [-0.856, 42.8468], [-0.8475, 42.8484], [-0.8391, 42.8595], [-0.8196, 42.8681], [-0.8153, 42.8761], [-0.8163, 42.9023], [-0.8007, 42.907], [-0.782, 42.9215], [-0.7514, 42.9243], [-0.7413, 42.9183], [-0.7244, 42.9195], [-0.735, 42.9137], [-0.7295, 42.8963], [-0.7183, 42.887], [-0.7054, 42.8846], [-0.6974, 42.879], [-0.6789, 42.8848], [-0.6674, 42.8756], [-0.6621, 42.8638], [-0.65, 42.8556], [-0.6377, 42.8532], [-0.6197, 42.8378], [-0.6037, 42.8317], [-0.5975, 42.804], [-0.5781, 42.8091], [-0.5693, 42.8069], [-0.5659, 42.799], [-0.5719, 42.7901], [-0.5679, 42.7821], [-0.5525, 42.7778], [-0.5441, 42.7929], [-0.5314, 42.7924], [-0.5228, 42.7991], [-0.5261, 42.8111], [-0.5086, 42.8264], [-0.5007, 42.8268], [-0.4921, 42.8172], [-0.4782, 42.8092], [-0.4544, 42.8037], [-0.4419, 42.795], [-0.4192, 42.8056], [-0.4106, 42.8072], [-0.3951, 42.7988], [-0.3834, 42.8074], [-0.3668, 42.8148], [-0.3565, 42.8299], [-0.3449, 42.8373], [-0.3245, 42.8348], [-0.3125, 42.8491], [-0.3074, 42.8417], [-0.2839, 42.8374], [-0.275, 42.8283], [-0.2542, 42.8192], [-0.2438, 42.8228], [-0.2393, 42.8083], [-0.2174, 42.7975], [-0.1983, 42.7955], [-0.1886, 42.7868], [-0.1781, 42.7853], [-0.1611, 42.7978], [-0.155, 42.7919], [-0.1499, 42.7689], [-0.1383, 42.7659], [-0.11, 42.7339], [-0.1069, 42.7203], [-0.0887, 42.7209], [-0.0682, 42.7165], [-0.0628, 42.6949], [-0.0496, 42.6942], [-0.0166, 42.6849], [-0.003, 42.6848], [0.0133, 42.6942], [0.0135, 42.7011], [0.0258, 42.7022], [0.0399, 42.6971], [0.0592, 42.698], [0.0708, 42.7054], [0.0765, 42.7145], [0.09, 42.7169], [0.1052, 42.7104], [0.131, 42.7152], [0.1347, 42.7221], [0.1529, 42.7246], [0.1752, 42.7369], [0.2049, 42.7292], [0.2256, 42.7175], [0.2586, 42.7158], [0.2597, 42.7085], [0.2714, 42.6901], [0.2934, 42.6735], [0.3133, 42.6842], [0.3198, 42.6833], [0.3241, 42.7048], [0.3442, 42.711], [0.358, 42.7206], [0.374, 42.7143], [0.3922, 42.7129], [0.3945, 42.6995], [0.4215, 42.6909], [0.4456, 42.6915], [0.4838, 42.6986], [0.4933, 42.6929], [0.5163, 42.6918], [0.5271, 42.703], [0.5887, 42.6958], [0.5964, 42.7058], [0.6047, 42.6996], [0.6392, 42.6931], [0.6605, 42.6913], [0.6725, 42.6805], [0.6756, 42.6717], [0.6866, 42.6605], [0.6951, 42.6582], [0.7007, 42.6325], [0.6982, 42.6286], [0.7099, 42.6192], [0.7376, 42.6111], [0.7668, 42.6105], [0.7606, 42.5913], [0.7578, 42.5691], [0.7489, 42.5523], [0.7213, 42.5267], [0.7324, 42.5028], [0.7144, 42.4869], [0.7018, 42.4941], [0.6976, 42.4846], [0.6972, 42.4719], [0.7068, 42.4626], [0.7062, 42.4489], [0.7109, 42.4355], [0.7267, 42.4246], [0.7354, 42.4147], [0.7309, 42.4009], [0.7381, 42.398], [0.7454, 42.3847], [0.7343, 42.3712], [0.7311, 42.3619], [0.7446, 42.3575], [0.7646, 42.3564], [0.7695, 42.3505], [0.7542, 42.3472], [0.7418, 42.3334], [0.746, 42.3267], [0.7636, 42.3217], [0.7563, 42.3101], [0.7449, 42.2996], [0.7358, 42.2527], [0.7255, 42.2426], [0.7243, 42.2356], [0.7139, 42.2218], [0.7138, 42.2093], [0.7092, 42.196], [0.703, 42.1903], [0.6975, 42.1719], [0.7143, 42.1632], [0.6934, 42.15], [0.6965, 42.129], [0.702, 42.1205], [0.6985, 42.1036], [0.6856, 42.0925], [0.6798, 42.0748], [0.6736, 42.0678], [0.6662, 42.0409], [0.6562, 42.039], [0.6511, 42.0232], [0.6623, 42.014], [0.6551, 41.9964], [0.6465, 41.9917], [0.6261, 41.9897], [0.613, 41.9733], [0.6051, 41.9595], [0.5931, 41.9664], [0.5793, 41.9551], [0.564, 41.9361], [0.5649, 41.9314], [0.6005, 41.922], [0.5971, 41.914], [0.6021, 41.906], [0.595, 41.8837], [0.6092, 41.8773], [0.6085, 41.8708], [0.5822, 41.8623], [0.5815, 41.8508], [0.5603, 41.8532], [0.5559, 41.8501], [0.5559, 41.8347], [0.5451, 41.82], [0.5151, 41.8207], [0.5037, 41.8135], [0.5004, 41.8059], [0.4846, 41.7996], [0.4758, 41.7864], [0.4718, 41.7666], [0.4648, 41.7631], [0.4499, 41.7644], [0.4397, 41.7611], [0.4006, 41.7573], [0.3969, 41.7394], [0.3861, 41.7398], [0.3692, 41.7137], [0.3442, 41.697], [0.328, 41.6789], [0.3264, 41.6601], [0.3338, 41.6574], [0.3468, 41.6389], [0.3585, 41.6303], [0.347, 41.621], [0.3508, 41.5992], [0.3831, 41.5963], [0.4028, 41.5927], [0.4291, 41.6018], [0.4362, 41.5857], [0.4318, 41.578], [0.4325, 41.5654], [0.4465, 41.549], [0.429, 41.5233], [0.4195, 41.5172], [0.4107, 41.5037], [0.3983, 41.4905], [0.3737, 41.4845], [0.3475, 41.4878], [0.342, 41.4806], [0.3456, 41.4627], [0.3553, 41.4545], [0.3485, 41.4415], [0.3492, 41.4257], [0.3424, 41.4147], [0.3208, 41.3955], [0.3545, 41.3735], [0.3608, 41.3712], [0.3739, 41.3539], [0.3674, 41.3426], [0.3607, 41.3417], [0.3481, 41.329], [0.3662, 41.3196], [0.3706, 41.3142], [0.365, 41.3028], [0.3868, 41.2768], [0.377, 41.2598], [0.3737, 41.2465], [0.3791, 41.2348], [0.3648, 41.2362], [0.3627, 41.2232], [0.3384, 41.2282], [0.3316, 41.2208], [0.3208, 41.2216], [0.3093, 41.1875], [0.3028, 41.1623], [0.2944, 41.1558], [0.2724, 41.147], [0.2553, 41.1487], [0.2551, 41.1412], [0.2469, 41.1287], [0.2197, 41.1309], [0.2048, 41.1273], [0.2086, 41.1162], [0.2016, 41.1036], [0.2018, 41.0853], [0.2153, 41.0839], [0.2219, 41.0791], [0.2199, 41.0652], [0.2298, 41.058], [0.2353, 41.0445], [0.2322, 41.0355], [0.2495, 41.0384], [0.2638, 41.0263], [0.2632, 41.0116], [0.2728, 41.0091], [0.2693, 40.9966], [0.2825, 40.9821], [0.281, 40.9745], [0.2864, 40.9639], [0.2805, 40.9502], [0.2714, 40.9429], [0.2732, 40.9334], [0.2612, 40.927], [0.2491, 40.9073], [0.2498, 40.8953], [0.2419, 40.8808], [0.2551, 40.8729], [0.2517, 40.8549], [0.2597, 40.8381], [0.2776, 40.8212], [0.2647, 40.8115], [0.2576, 40.7984], [0.2506, 40.7972], [0.2347, 40.7861], [0.2349, 40.7757], [0.2235, 40.7655], [0.2127, 40.767], [0.189, 40.7507], [0.177, 40.7544], [0.165, 40.7434], [0.1699, 40.7336], [0.163, 40.7226], [0.1471, 40.7192], [0.1242, 40.7217], [0.1081, 40.7271], [0.0746, 40.7152], [0.0441, 40.6931], [0.0287, 40.6949], [0.0238, 40.7051], [0.0281, 40.7143], [0.0141, 40.7293], [-0.0232, 40.73], [-0.0328, 40.723], [-0.0503, 40.728], [-0.0631, 40.7275], [-0.0769, 40.7317], [-0.0975, 40.7418], [-0.1082, 40.7436], [-0.1242, 40.7523], [-0.1438, 40.7677], [-0.1472, 40.7764], [-0.1448, 40.785], [-0.1653, 40.7883], [-0.1967, 40.7836], [-0.2115, 40.7663], [-0.214, 40.7578], [-0.2255, 40.7525], [-0.231, 40.7406], [-0.2328, 40.7275], [-0.2395, 40.7156], [-0.2346, 40.7079], [-0.237, 40.691], [-0.2572, 40.6885], [-0.2948, 40.6735], [-0.308, 40.6604], [-0.32, 40.6676], [-0.3233, 40.6783], [-0.344, 40.6794], [-0.3576, 40.6771], [-0.3791, 40.6657], [-0.3803, 40.6589], [-0.3706, 40.6499], [-0.3788, 40.6229], [-0.3695, 40.6134], [-0.3582, 40.615], [-0.3239, 40.6029], [-0.3115, 40.6115], [-0.2955, 40.6113], [-0.2917, 40.6044], [-0.2962, 40.5609], [-0.2905, 40.5526], [-0.2907, 40.5436], [-0.2969, 40.532], [-0.3002, 40.5144], [-0.2965, 40.5048], [-0.2874, 40.5081], [-0.2763, 40.4988], [-0.28, 40.4834], [-0.2718, 40.4762], [-0.3079, 40.4646], [-0.3393, 40.4524], [-0.3424, 40.4386], [-0.3319, 40.4224], [-0.3119, 40.4128], [-0.3021, 40.3977], [-0.2867, 40.3871], [-0.2811, 40.3692], [-0.2974, 40.3614], [-0.3055, 40.3618], [-0.3326, 40.3408], [-0.3413, 40.3377], [-0.3439, 40.3248], [-0.356, 40.3149], [-0.3759, 40.3049], [-0.3897, 40.3056], [-0.4007, 40.2942], [-0.3896, 40.2863], [-0.3844, 40.2759], [-0.3836, 40.2637], [-0.4268, 40.2436], [-0.4516, 40.2355], [-0.4671, 40.2392], [-0.4872, 40.2328], [-0.511, 40.2309], [-0.5335, 40.2414], [-0.5435, 40.2517], [-0.5485, 40.2443], [-0.5587, 40.2092], [-0.558, 40.2001], [-0.5712, 40.1795], [-0.573, 40.1707], [-0.5705, 40.1557], [-0.5796, 40.1451], [-0.5851, 40.1314], [-0.5971, 40.1318], [-0.6097, 40.1265], [-0.6279, 40.1034], [-0.6147, 40.0706], [-0.631, 40.0743], [-0.6465, 40.0677], [-0.6631, 40.0514], [-0.6814, 40.0443], [-0.7018, 40.0467], [-0.7187, 40.0395], [-0.7303, 40.0423], [-0.7458, 40.0391], [-0.7526, 40.0459], [-0.7618, 40.0413], [-0.7662, 40.012], [-0.7863, 39.9902], [-0.7994, 39.9901], [-0.8149, 39.9824], [-0.8343, 39.9774], [-0.8377, 39.9691], [-0.8351, 39.9573], [-0.8431, 39.946], [-0.8372, 39.9414], [-0.8365, 39.9241], [-0.8279, 39.9081], [-0.8027, 39.8923], [-0.7951, 39.8814], [-0.8134, 39.8744], [-0.8283, 39.8715], [-0.8359, 39.8638], [-0.8665, 39.8472], [-0.8887, 39.8531], [-0.909, 39.8672], [-0.9121, 39.8721], [-0.9086, 39.8855], [-0.901, 39.8899], [-0.9082, 39.9017], [-0.9134, 39.9176], [-0.9043, 39.9276], [-0.9047, 39.9392], [-0.917, 39.9546], [-0.9187, 39.9614], [-0.9327, 39.9564], [-0.9689, 39.974], [-0.9882, 39.9805], [-1.0033, 39.9808], [-1.0247, 39.9735], [-1.0551, 39.9792], [-1.0859, 39.9753], [-1.0917, 39.9675], [-1.1028, 39.9735], [-1.1156, 39.9716], [-1.1265, 39.9623], [-1.1311, 39.9695], [-1.141, 39.9704], [-1.1451, 39.9837], [-1.1626, 39.9997], [-1.1642, 40.0114], [-1.1429, 40.0171], [-1.1313, 40.017], [-1.1179, 40.0235], [-1.1055, 40.0255], [-1.0825, 40.037], [-1.0705, 40.0504], [-1.0809, 40.0712], [-1.1108, 40.0918], [-1.1323, 40.0983], [-1.147, 40.1133], [-1.1657, 40.1155], [-1.1917, 40.1102], [-1.2121, 40.1099], [-1.2264, 40.1146], [-1.2441, 40.117], [-1.2529, 40.1432], [-1.2741, 40.1597], [-1.2844, 40.1724], [-1.29, 40.1893], [-1.3018, 40.2064], [-1.3131, 40.2024], [-1.3213, 40.1879], [-1.3228, 40.1719], [-1.3161, 40.1613], [-1.3164, 40.1498], [-1.3337, 40.1417], [-1.3516, 40.1295], [-1.3607, 40.1276], [-1.3659, 40.1356], [-1.3744, 40.1381], [-1.3922, 40.1324], [-1.4035, 40.1375], [-1.4204, 40.1403], [-1.4338, 40.1377], [-1.4505, 40.1426], [-1.4427, 40.1526], [-1.4396, 40.1961], [-1.4749, 40.1845], [-1.5098, 40.2026], [-1.5204, 40.2], [-1.5337, 40.1898], [-1.5417, 40.19], [-1.5606, 40.2071], [-1.5726, 40.2143], [-1.5945, 40.2361], [-1.6116, 40.2436], [-1.6465, 40.2735], [-1.6594, 40.283], [-1.6666, 40.2947], [-1.6834, 40.3031], [-1.6898, 40.3103], [-1.7015, 40.305], [-1.7103, 40.2904], [-1.7101, 40.2809], [-1.7199, 40.2776], [-1.7277, 40.2911], [-1.7287, 40.3019], [-1.7195, 40.318], [-1.7073, 40.3146], [-1.6981, 40.322], [-1.7069, 40.3268], [-1.7211, 40.3407], [-1.7377, 40.348], [-1.7528, 40.3616], [-1.7674, 40.3827], [-1.7881, 40.397], [-1.8029, 40.3988], [-1.8006, 40.413], [-1.7792, 40.4272], [-1.7686, 40.4382], [-1.7535, 40.4584], [-1.7354, 40.4728], [-1.6928, 40.4884], [-1.6947, 40.5119], [-1.7021, 40.5353], [-1.7002, 40.5447], [-1.6905, 40.5635], [-1.6931, 40.5758], [-1.6738, 40.5915], [-1.6661, 40.5823], [-1.6352, 40.5793], [-1.5988, 40.5621], [-1.5803, 40.5694], [-1.5561, 40.5855], [-1.5467, 40.5961], [-1.5643, 40.614], [-1.5549, 40.6274], [-1.55, 40.6444], [-1.5396, 40.6582], [-1.5396, 40.6761], [-1.5368, 40.686], [-1.5467, 40.7], [-1.5533, 40.7038], [-1.559, 40.7196], [-1.5611, 40.7376], [-1.556, 40.7481], [-1.5412, 40.7585], [-1.5435, 40.7721], [-1.5386, 40.7936], [-1.5425, 40.8127], [-1.5562, 40.8283], [-1.5727, 40.8308], [-1.5927, 40.8518], [-1.6136, 40.8697], [-1.6205, 40.8784], [-1.6238, 40.8936], [-1.6082, 40.9198], [-1.6114, 40.9366], [-1.6284, 40.9468], [-1.6573, 40.9692], [-1.6603, 40.9771], [-1.6775, 40.9882], [-1.6927, 40.995], [-1.7329, 41.0291], [-1.7452, 41.0341], [-1.7578, 41.0464], [-1.7565, 41.0547], [-1.7721, 41.0678], [-1.792, 41.0751], [-1.8021, 41.0886], [-1.8164, 41.0947], [-1.8535, 41.1016], [-1.8703, 41.1096], [-1.8765, 41.1196], [-1.8896, 41.1325], [-1.9005, 41.1354], [-1.913, 41.1327], [-1.9285, 41.1367], [-1.9391, 41.1466], [-1.9495, 41.1668], [-1.9664, 41.1706], [-2.0072, 41.1563], [-2.0375, 41.1561], [-2.0553, 41.1478], [-2.0784, 41.1644], [-2.0825, 41.1727], [-2.1476, 41.1849], [-2.1537, 41.2312], [-2.1658, 41.2821], [-2.1766, 41.2899], [-2.1704, 41.303], [-2.1707, 41.3226], [-2.1567, 41.3323], [-2.1621, 41.3548], [-2.1498, 41.356], [-2.124, 41.3708], [-2.1159, 41.4068], [-2.1155, 41.4248], [-2.1005, 41.4452], [-2.0483, 41.4347], [-2.0356, 41.4271], [-2.034, 41.405], [-2.0437, 41.3956], [-2.0417, 41.3888], [-2.029, 41.3838], [-2.0095, 41.3861], [-2.0016, 41.394], [-1.9871, 41.3967], [-1.9825, 41.4018], [-1.9705, 41.4009], [-1.9547, 41.408], [-1.939, 41.4066], [-1.9406, 41.4183], [-1.9548, 41.4238], [-1.9499, 41.4289], [-1.9536, 41.4451], [-1.9531, 41.461], [-1.967, 41.4778], [-1.9805, 41.4858], [-1.9798, 41.5048], [-1.9747, 41.517], [-1.9781, 41.5265], [-1.9665, 41.5451], [-1.9677, 41.5526], [-1.9796, 41.5609], [-1.9945, 41.5824], [-1.9925, 41.5994], [-1.9846, 41.6058], [-1.9682, 41.6056], [-1.9239, 41.5986], [-1.9134, 41.6105], [-1.9134, 41.6175], [-1.8996, 41.6258], [-1.8967, 41.6336], [-1.8806, 41.6408], [-1.8744, 41.638], [-1.8585, 41.6613], [-1.823, 41.6624], [-1.813, 41.661], [-1.8063, 41.6663], [-1.8081, 41.6832], [-1.8021, 41.6952], [-1.7877, 41.7004], [-1.784, 41.7172], [-1.7746, 41.7247], [-1.7866, 41.7342], [-1.7962, 41.7327], [-1.808, 41.7367], [-1.8036, 41.7538], [-1.822, 41.7668], [-1.8259, 41.7773], [-1.8392, 41.7862], [-1.8533, 41.7917], [-1.847, 41.8022], [-1.826, 41.818], [-1.8192, 41.8326], [-1.8184, 41.8534], [-1.841, 41.8748], [-1.8398, 41.8881], [-1.8555, 41.9045], [-1.8593, 41.9172], [-1.8567, 41.939], [-1.8571, 41.9674], [-1.8626, 41.9776], [-1.8473, 41.9861], [-1.8541, 41.9963], [-1.8462, 42.008]]] }, "properties": { "name": "Aragรณn", "id": "ES-AR", "CNTRY": "Spain", "TYPE": "Autonomous Community" }, "id": "ES-AR" }, { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [[[-6.9299, 38.206], [-6.9209, 38.2005], [-6.9023, 38.201], [-6.8553, 38.1784], [-6.8335, 38.174], [-6.82, 38.1734], [-6.7941, 38.177], [-6.7937, 38.1643], [-6.7996, 38.1537], [-6.8009, 38.1418], [-6.809, 38.1341], [-6.816, 38.1205], [-6.8072, 38.11], [-6.7808, 38.1084], [-6.7703, 38.1099], [-6.7589, 38.0923], [-6.7474, 38.0908], [-6.7355, 38.0936], [-6.7291, 38.0992], [-6.7157, 38.0923], [-6.7072, 38.0958], [-6.6945, 38.0935], [-6.6902, 38.0993], [-6.6612, 38.0919], [-6.6528, 38.0958], [-6.6228, 38.0961], [-6.5878, 38.0612], [-6.5821, 38.0525], [-6.5834, 38.0224], [-6.5592, 38.0281], [-6.5394, 38.0273], [-6.5244, 38.0218], [-6.4943, 38.0185], [-6.4912, 38.0091], [-6.4753, 38.0086], [-6.4703, 38.0117], [-6.4729, 38.0251], [-6.465, 38.0356], [-6.4433, 38.0469], [-6.4523, 38.0561], [-6.4451, 38.0598], [-6.4343, 38.0578], [-6.4146, 38.0589], [-6.3886, 38.0487], [-6.37, 38.0499], [-6.3621, 38.0426], [-6.3586, 38.0322], [-6.3589, 38.0162], [-6.3495, 38.0045], [-6.3269, 37.9964], [-6.3018, 37.9775], [-6.2527, 37.9709], [-6.2392, 37.959], [-6.2035, 37.9619], [-6.1945, 37.9534], [-6.1957, 37.948], [-6.1813, 37.9416], [-6.1681, 37.9559], [-6.154, 37.957], [-6.138, 37.972], [-6.1156, 37.9842], [-6.0956, 37.9831], [-6.0612, 37.9912], [-6.053, 37.9968], [-6.0336, 37.9972], [-6.0185, 37.9908], [-6.003, 37.9924], [-5.9941, 37.9974], [-5.9743, 37.9999], [-5.9578, 37.9988], [-5.9466, 38.0025], [-5.9334, 38.0306], [-5.9375, 38.0401], [-5.9285, 38.0501], [-5.9181, 38.0564], [-5.9082, 38.0678], [-5.9116, 38.0782], [-5.9285, 38.0879], [-5.9297, 38.0957], [-5.914, 38.1211], [-5.894, 38.1309], [-5.8808, 38.1327], [-5.8801, 38.1463], [-5.8747, 38.1583], [-5.8572, 38.1616], [-5.8549, 38.1696], [-5.8383, 38.1753], [-5.8256, 38.1708], [-5.8173, 38.1772], [-5.7998, 38.1747], [-5.7817, 38.1858], [-5.7583, 38.181], [-5.7387, 38.1949], [-5.7254, 38.196], [-5.714, 38.1859], [-5.694, 38.1851], [-5.6881, 38.1755], [-5.7058, 38.1636], [-5.6956, 38.1506], [-5.7088, 38.1423], [-5.7145, 38.1348], [-5.735, 38.1367], [-5.7411, 38.1261], [-5.7338, 38.1092], [-5.7341, 38.0875], [-5.7084, 38.0806], [-5.6924, 38.0841], [-5.6714, 38.0985], [-5.666, 38.1093], [-5.657, 38.1153], [-5.6395, 38.1347], [-5.6277, 38.1379], [-5.5877, 38.1322], [-5.5756, 38.1489], [-5.5595, 38.1495], [-5.5497, 38.1608], [-5.5378, 38.1617], [-5.5412, 38.1759], [-5.5369, 38.191], [-5.5382, 38.1994], [-5.5203, 38.2077], [-5.5229, 38.2235], [-5.5212, 38.2373], [-5.5254, 38.2625], [-5.5434, 38.2819], [-5.544, 38.2944], [-5.5552, 38.3178], [-5.5731, 38.3284], [-5.5671, 38.3455], [-5.5612, 38.3715], [-5.5652, 38.3771], [-5.5842, 38.386], [-5.5832, 38.402], [-5.5718, 38.4209], [-5.5722, 38.4275], [-5.5461, 38.4499], [-5.5308, 38.4538], [-5.5196, 38.4632], [-5.507, 38.4572], [-5.4955, 38.4589], [-5.4806, 38.4725], [-5.4794, 38.4839], [-5.4685, 38.485], [-5.4453, 38.503], [-5.4331, 38.5051], [-5.431, 38.5118], [-5.4198, 38.5125], [-5.4114, 38.5201], [-5.4154, 38.5275], [-5.4039, 38.5362], [-5.4075, 38.5428], [-5.3921, 38.5503], [-5.3848, 38.5665], [-5.374, 38.5684], [-5.3694, 38.5834], [-5.3565, 38.5855], [-5.3349, 38.5788], [-5.3243, 38.5809], [-5.3134, 38.5774], [-5.3046, 38.584], [-5.3106, 38.5908], [-5.2914, 38.6114], [-5.2776, 38.6127], [-5.2713, 38.6209], [-5.2551, 38.6265], [-5.2483, 38.638], [-5.2167, 38.6506], [-5.2088, 38.6682], [-5.2024, 38.6593], [-5.1932, 38.6638], [-5.1847, 38.6597], [-5.1783, 38.6652], [-5.1836, 38.6759], [-5.1679, 38.6766], [-5.1796, 38.7114], [-5.1664, 38.7107], [-5.1519, 38.716], [-5.1365, 38.7131], [-5.1195, 38.7157], [-5.1006, 38.7071], [-5.0659, 38.718], [-5.06, 38.7245], [-5.0458, 38.7294], [-5.0237, 38.7261], [-5.0094, 38.7169], [-5.0014, 38.7074], [-5.0016, 38.6943], [-4.9535, 38.6829], [-4.9296, 38.6812], [-4.9115, 38.686], [-4.8903, 38.6842], [-4.8833, 38.6865], [-4.8688, 38.6808], [-4.8605, 38.6412], [-4.8643, 38.6314], [-4.862, 38.6173], [-4.856, 38.6135], [-4.8332, 38.6082], [-4.8219, 38.5985], [-4.8115, 38.5951], [-4.7859, 38.5965], [-4.7691, 38.5877], [-4.7505, 38.585], [-4.7282, 38.5747], [-4.7054, 38.5729], [-4.7021, 38.5575], [-4.6969, 38.5517], [-4.682, 38.5479], [-4.6635, 38.5486], [-4.6537, 38.5368], [-4.6225, 38.5239], [-4.6162, 38.5058], [-4.6004, 38.4925], [-4.5867, 38.4877], [-4.5851, 38.4941], [-4.5663, 38.4916], [-4.5571, 38.4768], [-4.5434, 38.4821], [-4.5351, 38.4697], [-4.5234, 38.4626], [-4.5122, 38.4632], [-4.5043, 38.4567], [-4.5005, 38.4464], [-4.4874, 38.4414], [-4.482, 38.4327], [-4.4719, 38.4268], [-4.4633, 38.4132], [-4.4515, 38.4009], [-4.4347, 38.4016], [-4.4278, 38.3958], [-4.4176, 38.3951], [-4.4063, 38.3825], [-4.3959, 38.3864], [-4.366, 38.3778], [-4.3579, 38.3732], [-4.3208, 38.3622], [-4.3084, 38.3534], [-4.2888, 38.3476], [-4.2685, 38.3469], [-4.2711, 38.3654], [-4.2778, 38.3797], [-4.2745, 38.3942], [-4.2642, 38.3997], [-4.2474, 38.3966], [-4.226, 38.3975], [-4.1687, 38.3826], [-4.1557, 38.3815], [-4.1459, 38.3854], [-4.1306, 38.3788], [-4.0931, 38.3813], [-4.085, 38.3772], [-4.0677, 38.3798], [-4.0434, 38.3779], [-4.0158, 38.3723], [-4.0041, 38.3679], [-3.9832, 38.3696], [-3.9596, 38.3659], [-3.9369, 38.368], [-3.915, 38.3678], [-3.8928, 38.371], [-3.873, 38.3765], [-3.8577, 38.3731], [-3.8477, 38.3781], [-3.8312, 38.3917], [-3.8303, 38.4042], [-3.8242, 38.4146], [-3.8077, 38.4213], [-3.7996, 38.4205], [-3.7811, 38.425], [-3.7621, 38.4225], [-3.7393, 38.4138], [-3.7294, 38.424], [-3.7102, 38.4141], [-3.6974, 38.4108], [-3.6478, 38.403], [-3.6199, 38.3934], [-3.5994, 38.3976], [-3.5868, 38.4069], [-3.5859, 38.4309], [-3.5819, 38.4478], [-3.5678, 38.4499], [-3.5453, 38.4458], [-3.5346, 38.4381], [-3.5363, 38.4213], [-3.5291, 38.4084], [-3.4828, 38.4029], [-3.4715, 38.3974], [-3.4515, 38.4003], [-3.4226, 38.4119], [-3.4115, 38.4232], [-3.4042, 38.4238], [-3.3768, 38.4402], [-3.3808, 38.447], [-3.3748, 38.474], [-3.3505, 38.4761], [-3.3262, 38.481], [-3.3074, 38.4782], [-3.2886, 38.4675], [-3.2764, 38.4577], [-3.2629, 38.4582], [-3.2305, 38.4526], [-3.1798, 38.4506], [-3.1517, 38.4399], [-3.1282, 38.4396], [-3.0703, 38.4765], [-3.0658, 38.4774], [-3.024, 38.4359], [-3.0047, 38.414], [-2.9957, 38.4192], [-2.9921, 38.4287], [-2.996, 38.444], [-2.9933, 38.4512], [-2.9771, 38.4545], [-2.9624, 38.4698], [-2.9554, 38.4682], [-2.9375, 38.4736], [-2.914, 38.4687], [-2.9047, 38.469], [-2.8904, 38.4566], [-2.8696, 38.4656], [-2.8605, 38.4758], [-2.8255, 38.4868], [-2.8085, 38.496], [-2.8056, 38.5033], [-2.7792, 38.512], [-2.7647, 38.5317], [-2.7395, 38.521], [-2.7327, 38.5135], [-2.7106, 38.5066], [-2.703, 38.5017], [-2.6748, 38.4957], [-2.6406, 38.509], [-2.617, 38.5134], [-2.5996, 38.5134], [-2.5801, 38.5034], [-2.5704, 38.4942], [-2.5772, 38.4752], [-2.5678, 38.4603], [-2.5722, 38.4394], [-2.5773, 38.4263], [-2.5722, 38.4146], [-2.5634, 38.4131], [-2.5573, 38.4056], [-2.5234, 38.4052], [-2.5158, 38.3988], [-2.4841, 38.3974], [-2.4825, 38.3912], [-2.4919, 38.3706], [-2.4869, 38.3528], [-2.48, 38.3487], [-2.4806, 38.3266], [-2.4847, 38.3176], [-2.4849, 38.3018], [-2.4802, 38.2952], [-2.441, 38.286], [-2.4353, 38.2652], [-2.4434, 38.2509], [-2.4412, 38.2318], [-2.4535, 38.2165], [-2.4455, 38.2052], [-2.4462, 38.1853], [-2.4631, 38.1731], [-2.4762, 38.1555], [-2.4867, 38.1491], [-2.4984, 38.1314], [-2.5092, 38.1285], [-2.5225, 38.1071], [-2.5345, 38.1005], [-2.553, 38.0828], [-2.5406, 38.0752], [-2.5255, 38.0699], [-2.5039, 38.068], [-2.4917, 38.0583], [-2.4794, 38.0534], [-2.443, 38.0461], [-2.4337, 38.0424], [-2.426, 38.0337], [-2.4163, 38.0313], [-2.3986, 38.0332], [-2.3719, 38.0235], [-2.3561, 38.0215], [-2.3395, 38.0258], [-2.3176, 38.0112], [-2.2988, 38.0032], [-2.2985, 37.9898], [-2.2836, 37.9676], [-2.2691, 37.9535], [-2.2592, 37.9496], [-2.2544, 37.9397], [-2.2366, 37.928], [-2.2241, 37.9246], [-2.189, 37.9057], [-2.1724, 37.8886], [-2.1558, 37.8917], [-2.1473, 37.8985], [-2.1223, 37.8996], [-2.0993, 37.8773], [-2.0851, 37.8731], [-2.0731, 37.883], [-2.0541, 37.8804], [-2.022, 37.8682], [-2.006, 37.8797], [-1.9947, 37.8794], [-1.9757, 37.8696], [-1.9762, 37.861], [-1.9918, 37.8499], [-1.9956, 37.8435], [-2.0013, 37.8095], [-2.0095, 37.774], [-2.0037, 37.7584], [-2.0018, 37.7443], [-1.9957, 37.7286], [-2.0076, 37.7197], [-2.013, 37.7018], [-2.0101, 37.6975], [-2.0119, 37.6722], [-2.0018, 37.6538], [-1.9878, 37.6442], [-1.9811, 37.6349], [-1.978, 37.6198], [-1.9658, 37.6043], [-1.955, 37.5996], [-1.9561, 37.591], [-1.938, 37.5678], [-1.906, 37.5335], [-1.871, 37.489], [-1.8617, 37.4825], [-1.8451, 37.4552], [-1.8091, 37.434], [-1.8115, 37.4515], [-1.7947, 37.452], [-1.7802, 37.4477], [-1.7353, 37.4414], [-1.7042, 37.4202], [-1.6618, 37.3976], [-1.6267, 37.3734], [-1.6344, 37.3747], [-1.6449, 37.3695], [-1.6503, 37.3565], [-1.6694, 37.357], [-1.6821, 37.3471], [-1.6943, 37.3315], [-1.7067, 37.3067], [-1.7216, 37.2958], [-1.7343, 37.2818], [-1.7568, 37.2646], [-1.7728, 37.2453], [-1.7737, 37.2402], [-1.7951, 37.2305], [-1.8076, 37.2123], [-1.8242, 37.1688], [-1.8236, 37.1513], [-1.8336, 37.1192], [-1.8461, 37.1057], [-1.8502, 37.0906], [-1.8499, 37.0713], [-1.8632, 37.0448], [-1.8753, 37.0362], [-1.8796, 37.0239], [-1.8785, 37.0143], [-1.8896, 37.004], [-1.8907, 36.9953], [-1.9008, 36.9888], [-1.9018, 36.9777], [-1.8988, 36.9473], [-1.9042, 36.9373], [-1.916, 36.9339], [-1.9322, 36.9387], [-1.9404, 36.9361], [-1.9537, 36.9234], [-1.967, 36.8988], [-1.9808, 36.9027], [-2.0032, 36.8813], [-2.0011, 36.873], [-2.0049, 36.86], [-1.9982, 36.8565], [-1.9993, 36.8403], [-2.0086, 36.8341], [-2.025, 36.8316], [-2.0387, 36.8252], [-2.0411, 36.8196], [-2.0549, 36.813], [-2.0617, 36.806], [-2.062, 36.7772], [-2.0748, 36.7688], [-2.0902, 36.7628], [-2.1053, 36.7627], [-2.1124, 36.7484], [-2.1196, 36.7483], [-2.1215, 36.7329], [-2.1411, 36.7288], [-2.1523, 36.7309], [-2.1673, 36.7218], [-2.1788, 36.724], [-2.1846, 36.7194], [-2.1999, 36.727], [-2.2078, 36.7376], [-2.2444, 36.7796], [-2.2649, 36.7991], [-2.2919, 36.8197], [-2.3193, 36.8336], [-2.357, 36.841], [-2.3681, 36.8408], [-2.4052, 36.8249], [-2.4247, 36.8107], [-2.4314, 36.811], [-2.4562, 36.83], [-2.4777, 36.8367], [-2.4901, 36.8281], [-2.5018, 36.8241], [-2.5244, 36.8254], [-2.5338, 36.8192], [-2.5637, 36.8164], [-2.5782, 36.8023], [-2.6003, 36.7751], [-2.611, 36.7422], [-2.6196, 36.7272], [-2.6504, 36.6993], [-2.674, 36.6948], [-2.7004, 36.683], [-2.7263, 36.6847], [-2.7736, 36.6805], [-2.7972, 36.6985], [-2.8167, 36.7046], [-2.8365, 36.7016], [-2.8516, 36.6942], [-2.8595, 36.6983], [-2.8765, 36.7168], [-2.8993, 36.7385], [-2.9255, 36.7515], [-2.9411, 36.7516], [-2.9766, 36.7375], [-2.995, 36.7425], [-3.0094, 36.7407], [-3.0212, 36.7463], [-3.0713, 36.7451], [-3.1152, 36.7507], [-3.1345, 36.7506], [-3.1464, 36.7449], [-3.1583, 36.7476], [-3.1676, 36.7447], [-3.1765, 36.7494], [-3.202, 36.7501], [-3.2104, 36.7454], [-3.2443, 36.7538], [-3.2619, 36.7522], [-3.2845, 36.7431], [-3.3054, 36.7377], [-3.3178, 36.7415], [-3.3389, 36.738], [-3.3482, 36.7323], [-3.3623, 36.7163], [-3.3725, 36.7123], [-3.3879, 36.711], [-3.3979, 36.7053], [-3.4126, 36.702], [-3.4259, 36.6956], [-3.4686, 36.6936], [-3.4806, 36.697], [-3.5149, 36.7215], [-3.5268, 36.725], [-3.5474, 36.7152], [-3.5558, 36.7147], [-3.5794, 36.7232], [-3.6021, 36.7439], [-3.6255, 36.741], [-3.6467, 36.7424], [-3.6571, 36.7465], [-3.6772, 36.7294], [-3.7036, 36.7333], [-3.7263, 36.7282], [-3.7534, 36.7378], [-3.767, 36.7291], [-3.7765, 36.7374], [-3.7905, 36.7447], [-3.7999, 36.7448], [-3.817, 36.7514], [-3.8343, 36.7538], [-3.8481, 36.7501], [-3.862, 36.751], [-3.8834, 36.7406], [-3.9036, 36.7429], [-3.9198, 36.7404], [-3.9563, 36.7256], [-3.9727, 36.7295], [-3.9956, 36.7381], [-4.0207, 36.7433], [-4.05, 36.7433], [-4.0684, 36.7478], [-4.0872, 36.7419], [-4.1047, 36.7235], [-4.1317, 36.7232], [-4.1773, 36.7148], [-4.2467, 36.7096], [-4.2896, 36.714], [-4.3386, 36.7118], [-4.3491, 36.7163], [-4.3947, 36.7223], [-4.4145, 36.7181], [-4.4312, 36.7053], [-4.4383, 36.6954], [-4.4535, 36.667], [-4.4825, 36.6423], [-4.4989, 36.6209], [-4.5131, 36.5995], [-4.52, 36.5962], [-4.5352, 36.5813], [-4.5588, 36.5801], [-4.5832, 36.5739], [-4.6057, 36.5609], [-4.6115, 36.5539], [-4.6309, 36.5165], [-4.6386, 36.507], [-4.6616, 36.5066], [-4.6768, 36.5028], [-4.6912, 36.4919], [-4.7118, 36.4872], [-4.7428, 36.4841], [-4.7747, 36.489], [-4.8104, 36.4978], [-4.8681, 36.5073], [-4.9138, 36.5046], [-4.9256, 36.4994], [-4.9348, 36.4993], [-4.9478, 36.4897], [-4.9706, 36.4781], [-4.9783, 36.4764], [-5.0054, 36.4589], [-5.0145, 36.4611], [-5.0343, 36.4606], [-5.051, 36.4521], [-5.0661, 36.4495], [-5.0737, 36.4517], [-5.0861, 36.4479], [-5.1076, 36.4335], [-5.121, 36.4279], [-5.1406, 36.4259], [-5.1546, 36.415], [-5.1745, 36.415], [-5.1834, 36.4086], [-5.2104, 36.3807], [-5.2164, 36.3791], [-5.2242, 36.3679], [-5.2333, 36.3475], [-5.2416, 36.3203], [-5.2473, 36.3098], [-5.2574, 36.3085], [-5.2677, 36.2986], [-5.2767, 36.2792], [-5.2836, 36.2701], [-5.295, 36.2475], [-5.3052, 36.2428], [-5.3154, 36.2312], [-5.3223, 36.2154], [-5.3322, 36.186], [-5.3383, 36.1563], [-5.3522, 36.1563], [-5.3628, 36.1653], [-5.3781, 36.1717], [-5.3811, 36.177], [-5.3925, 36.1799], [-5.4193, 36.1784], [-5.4326, 36.17], [-5.446, 36.152], [-5.4469, 36.1381], [-5.4363, 36.1149], [-5.4436, 36.0893], [-5.4294, 36.0842], [-5.4254, 36.0767], [-5.4302, 36.07], [-5.4463, 36.061], [-5.449, 36.0557], [-5.4639, 36.0495], [-5.4857, 36.0534], [-5.517, 36.0365], [-5.5302, 36.0334], [-5.5747, 36.0143], [-5.608, 36.0107], [-5.6322, 36.0393], [-5.6433, 36.0482], [-5.6653, 36.0557], [-5.6861, 36.0666], [-5.6966, 36.0655], [-5.7082, 36.0589], [-5.7226, 36.0602], [-5.7336, 36.0666], [-5.7497, 36.0706], [-5.7663, 36.0839], [-5.7783, 36.088], [-5.7953, 36.0776], [-5.8179, 36.1003], [-5.8251, 36.1034], [-5.8458, 36.1313], [-5.8764, 36.1584], [-5.9035, 36.1768], [-5.917, 36.184], [-5.9431, 36.1865], [-5.9529, 36.182], [-5.9837, 36.176], [-6.0209, 36.185], [-6.0362, 36.1817], [-6.0472, 36.1974], [-6.0609, 36.2093], [-6.0652, 36.2186], [-6.0826, 36.2436], [-6.088, 36.2596], [-6.1054, 36.2839], [-6.1194, 36.2935], [-6.1427, 36.2961], [-6.1532, 36.3085], [-6.1634, 36.3314], [-6.1669, 36.3446], [-6.18, 36.3664], [-6.1866, 36.373], [-6.1981, 36.3771], [-6.2095, 36.3852], [-6.2179, 36.3954], [-6.2185, 36.4018], [-6.2337, 36.4347], [-6.2491, 36.4493], [-6.2606, 36.4752], [-6.2876, 36.5202], [-6.306, 36.5365], [-6.2899, 36.5375], [-6.2763, 36.5251], [-6.269, 36.5082], [-6.262, 36.5066], [-6.2623, 36.497], [-6.2426, 36.5097], [-6.2504, 36.5205], [-6.2368, 36.5241], [-6.2388, 36.5317], [-6.226, 36.5482], [-6.2229, 36.5663], [-6.2267, 36.5781], [-6.2384, 36.5857], [-6.2654, 36.5791], [-6.2763, 36.599], [-6.2875, 36.6107], [-6.2991, 36.6168], [-6.3105, 36.6162], [-6.3257, 36.6237], [-6.3363, 36.6198], [-6.3443, 36.6252], [-6.3645, 36.6197], [-6.3858, 36.6273], [-6.3943, 36.6335], [-6.3928, 36.6415], [-6.3987, 36.6578], [-6.4061, 36.6636], [-6.4128, 36.6775], [-6.4321, 36.7064], [-6.4397, 36.721], [-6.443, 36.7377], [-6.4215, 36.7454], [-6.4053, 36.7611], [-6.3896, 36.7663], [-6.3677, 36.7785], [-6.3577, 36.7873], [-6.3616, 36.7958], [-6.378, 36.8017], [-6.3865, 36.8018], [-6.3985, 36.8115], [-6.4233, 36.8632], [-6.4389, 36.8923], [-6.4611, 36.9228], [-6.5069, 36.9656], [-6.5284, 36.9823], [-6.5983, 37.0242], [-6.7209, 37.0864], [-6.7623, 37.1069], [-6.7933, 37.1208], [-6.8182, 37.1276], [-6.8411, 37.1374], [-6.8645, 37.1446], [-6.8911, 37.1605], [-6.9046, 37.1656], [-6.9304, 37.1838], [-6.9587, 37.1861], [-6.9538, 37.1729], [-6.9707, 37.1772], [-7.0045, 37.1936], [-7.0322, 37.2039], [-7.0489, 37.2084], [-7.0785, 37.211], [-7.0883, 37.2077], [-7.1193, 37.2066], [-7.1471, 37.2071], [-7.1963, 37.205], [-7.2341, 37.2024], [-7.2653, 37.2016], [-7.2882, 37.1995], [-7.3073, 37.194], [-7.3327, 37.1938], [-7.3362, 37.184], [-7.369, 37.1705], [-7.3956, 37.174], [-7.402, 37.178], [-7.4086, 37.1916], [-7.4137, 37.2143], [-7.4132, 37.2243], [-7.4207, 37.2404], [-7.4306, 37.2454], [-7.4325, 37.2581], [-7.4221, 37.2738], [-7.4337, 37.2876], [-7.4426, 37.3105], [-7.44, 37.3266], [-7.446, 37.3481], [-7.4379, 37.3596], [-7.4414, 37.39], [-7.4517, 37.4026], [-7.4612, 37.4063], [-7.4616, 37.4132], [-7.4499, 37.4148], [-7.447, 37.4211], [-7.4578, 37.429], [-7.4598, 37.4384], [-7.4571, 37.4522], [-7.47, 37.4693], [-7.4657, 37.4893], [-7.4848, 37.4976], [-7.4916, 37.5092], [-7.4954, 37.5231], [-7.5122, 37.5239], [-7.5138, 37.539], [-7.5245, 37.5545], [-7.5108, 37.5587], [-7.513, 37.5734], [-7.5033, 37.5801], [-7.4983, 37.5915], [-7.5055, 37.6056], [-7.4936, 37.6091], [-7.4849, 37.6257], [-7.4748, 37.6275], [-7.4674, 37.6387], [-7.4658, 37.6474], [-7.4556, 37.649], [-7.4544, 37.662], [-7.447, 37.6663], [-7.4505, 37.6769], [-7.4458, 37.6897], [-7.4466, 37.6977], [-7.4273, 37.7335], [-7.423, 37.7552], [-7.4069, 37.7664], [-7.3943, 37.7649], [-7.3769, 37.7821], [-7.3696, 37.7854], [-7.3476, 37.8025], [-7.3234, 37.8145], [-7.3097, 37.8337], [-7.3024, 37.8382], [-7.2976, 37.8541], [-7.2884, 37.8606], [-7.2806, 37.8764], [-7.2813, 37.8959], [-7.274, 37.901], [-7.2552, 37.9253], [-7.2562, 37.9351], [-7.2511, 37.9411], [-7.2498, 37.9642], [-7.2586, 37.9807], [-7.2444, 37.9886], [-7.2244, 37.9887], [-7.2016, 38.001], [-7.1747, 37.9957], [-7.1621, 37.9954], [-7.1335, 38.0004], [-7.1232, 38.0061], [-7.1268, 38.0182], [-7.1251, 38.0273], [-7.0979, 38.0412], [-7.0819, 38.0333], [-7.0707, 38.0313], [-7.0601, 38.0169], [-7.0474, 38.0162], [-7.0213, 38.0232], [-7.006, 38.0207], [-7.0003, 38.0322], [-6.9983, 38.0494], [-6.9907, 38.0557], [-6.9863, 38.073], [-6.9861, 38.095], [-6.9822, 38.1052], [-6.9706, 38.1105], [-6.9693, 38.1195], [-6.9606, 38.1309], [-6.9551, 38.1482], [-6.9637, 38.1572], [-6.9662, 38.1661], [-6.9589, 38.1795], [-6.9432, 38.1918], [-6.9299, 38.206]]] }, "properties": { "name": "Andalucรญa", "id": "ES-AN", "CNTRY": "Spain", "TYPE": "Autonomous Community" }, "id": "ES-AN" } ] };
#!/usr/bin/env python __version__ = '0.1' __license__ = 'BSD2' __version_info__ = (0, 1) __author__ = 'Matthew Morrow <[email protected]>' """ Sudoku solver via the exact set cover problem, which is solved with 0/1-integer programming. > def sudoku(givens, n=3): > ... > D = build_digits() > R, C, B = build_rows_cols_blocks() > RD = intersections(R, D) > CD = intersections(C, D) > BD = intersections(B, D) > Cells = build_cells() > Knowns = build_knowns() > A = np.vstack((RD.T, CD.T, BD.T, Cells.T, Knowns)) > b = ones((A.shape[0],1)) > c = zeros((A.shape[1],1)) > G = zeros((1,A.shape[1])) > h = zeros((1,1)) > integer = set([]) > binary = set(range(A.shape[1])) > _, x = milp(c, G, h, A=A, b=b, I=integer, B=binary) > if x: > x = np.squeeze(x).astype(dtype) > x = from_indicator(x, nvals) > return x The key technique to highlight here is that of computing the set of interesections of all pairs of sets in two set covers (which are not required to cover the entire element set), where the result and input set covers are represented as incidence matrices (where columns correspond to the sets and rows correspond to the elements). Note that I don't bother to remove columns of zeros (i.e. empty interesections) from the result because in the case of sudoku this never occurs. The function is repoduced here: > def intersections(I, J): > '''I, J incidence matrices.''' > assert(I.shape[0] == J.shape[0]) > return np.array([u * v for u, v in itertools.product(I.T, J.T)]).T NOTE[glpk]: Some versions of glpk have a bug (which has been reported) where you can't prevent it from printing "Long-step dual simplex will be used" to stdout. So, if your glpk also has this bug and you want to make use of the stdout of this program, you need to do '... | ./sudoku.py | grep -vE "^Long"' or equivalent. This is another reminder of one of the questions of the ages: Why do scientist-type programmers so love printing RANDOM TRASH to the terminal AS THE DEFAULT BEHAVIOR????? We simply may never know. :) """ import sys import itertools import numpy as np import cvxopt import cvxopt.glpk ############################################################################# TEST_PROBLEMS=""" 013000002200000480000700019000900800700000020000300000002630900409070600001490008 500070600410053007067120008840000010000010306000700020000000065000000870030000000 000000000008004010004070000800300069007100004095000000400510703070800900500006080 060050030001020050700003400426038000003000000057401200000007000000810007000060001 000600409008000000003009000001705000800000001040300000030000056100000030094008007 046000580718000006500040000100006750080000010020005804000007400069000070200001000 600000001000630000082410009000005010040000000209008005004000080000020460500000000 002805007090027400000010009080000731300000000400071000000000004010900000000000253 400007910000400000200500036503000020000070100070129000000903000305000060000060000 000000004901060500008000090800403706000010000540007180000039007000040050000700810 """ TEST_SOLUTIONS=""" 913584762257169483648723519136942857795816324824357196572638941489271635361495278 529478631418653297367129458846532719275914386193786524982347165654291873731865942 712983645938654217654271398841327569267195834395468172486519723173842956529736481 264159738381724956795683412426538179913276584857491263138947625642815397579362841 512673489978142563463859712321795648859426371746381295237914856185267934694538127 946712583718359246532648197193486752485273619627195834351967428869524371274831965 697852341451639278382417659873265914145973826269148735714396582938521467526784193 142895367893627415756413829685249731371568942429371586238756194514932678967184253 456237918931486572287591436513648729629375184874129653762953841395814267148762395 756981234921364578438572691819453726673218945542697183285139467197846352364725819 """ def test(): for x in filter(lambda x:x, TEST_PROBLEMS.split("\n")): print(show_sudoku(sudoku(read_sudoku(x))[0])) ############################################################################# def main(): if sys.argv[-1] == "--test": test() else: for x in read_sudoku_lines(sys.stdin): print(show_sudoku(sudoku(x)[0])) def read_sudoku(string): return np.array(map(int, string)) def show_sudoku(board): if type(board) != np.ndarray: return "" return "".join(map(str, board)) def read_sudoku_lines(lines): def go(line): return [read_sudoku(x) for x in line.rstrip()] return (go(x) for x in lines) ############################################################################# def sudoku(givens, n=3): dtype = np.int64 def ones(shape): return np.ones(shape, dtype=dtype) def zeros(shape): return np.zeros(shape, dtype=dtype) nvals = n * n ncells = nvals * nvals allvalsmask = ones(nvals) givens = np.array(givens, dtype=dtype).flatten() def build_digits(): icells = np.arange(ncells) def go(i): return ( i * ones(ncells), i + nvals * icells) digs = zeros((nvals, nvals * ncells)) digs[zip(*map(go, range(nvals)))] = 1 D = digs.T return D def build_rows_cols_blocks(): I = np.arange(n) J = np.hstack([I] * n) K = np.arange(n * n) Z = np.zeros_like(K) dims = [nvals, nvals] rows = np.array([np.ravel_multi_index((i + Z, K), dims) for i in K]) cols = np.array([np.ravel_multi_index((K, j + Z), dims) for j in K]) blks = np.array([ np.ravel_multi_index(zip(*itertools.product(i*n+I, j*n+I)), dims) for i, j in itertools.product(I,I)]) def go(X): Y = np.array([indices_to_indicator(x, ncells) for x in X]) return np.array([x * allvalsmask for x in Y.flatten()]).reshape( (Y.shape[0], nvals * Y.shape[1])) R = go(rows).T C = go(cols).T B = go(blks).T return R, C, B def build_cells(): X = zeros((ncells, nvals * ncells)) for i in range(ncells): j = i * nvals X[i,j:j+nvals] = 1 return X.T def build_knowns(): I = to_indicator(givens, nvals) dim = I.shape[0] return np.array([indices_to_indicator([x], dim) for x in np.nonzero(I)[0]]) D = build_digits() R, C, B = build_rows_cols_blocks() RD = intersections(R, D) CD = intersections(C, D) BD = intersections(B, D) Cells = build_cells() Knowns = build_knowns() A = np.vstack((RD.T, CD.T, BD.T, Cells.T, Knowns)) b = ones((A.shape[0],1)) c = zeros((A.shape[1],1)) G = zeros((1,A.shape[1])) h = zeros((1,1)) integer = set([]) binary = set(range(A.shape[1])) status, x = milp(c, G, h, A=A, b=b, I=integer, B=binary) DEBUG = (status, c, G, h, A, b, B) if x: x = np.squeeze(x).astype(dtype) x = from_indicator(x, nvals) return x, DEBUG ############################################################################# def indicator_to_indices(x): return np.nonzero(x)[0] def indices_to_indicator(I, n, dtype=np.int64): x = np.zeros(n, dtype=dtype) x[I] = 1 return x def from_indicator(a, n): return np.array([ (list(1+indicator_to_indices(x))+[0])[0] for x in a.flatten().reshape((a.flatten().shape[0]/n,n))]) def to_indicator(a, n): return np.array([indices_to_indicator([x], n + 1)[1:] for x in a.flatten()]).flatten() def intersections(I, J): """I, J incidence matrices.""" assert(I.shape[0] == J.shape[0]) return np.array([u * v for u, v in itertools.product(I.T, J.T)]).T ############################################################################# #STATUS = ( #'optimal', #'feasible', #'undefined', #'invalid formulation', #'infeasible problem', #'LP relaxation is primal infeasible', #'LP relaxation is dual infeasible', #'unknown',) def milp(c, G, h, A=None, b=None, I=None, B=None): c, G, h = map(lambda x:cvxopt.matrix(x, x.shape, 'd'), (c, G, h)) A = A if type(A) == type(None) else cvxopt.matrix(A, A.shape, 'd') b = b if type(b) == type(None) else cvxopt.matrix(b, b.shape, 'd') return cvxopt.glpk.ilp( c, G, h, A=A, b=b, I=I, B=B, options={'msg_lev':'GLP_MSG_OFF'}) ############################################################################# if __name__ == '__main__': main() #############################################################################
/* Template Name: Stexo - Responsive Bootstrap 4 Admin Dashboard Author: Themesdesign Website: www.themesdesign.in File: C3 Chart init js */ !function($) { "use strict"; var ChartC3 = function() {}; ChartC3.prototype.init = function () { //generating chart c3.generate({ bindto: '#chart', data: { columns: [ ['Desktop', 150, 100, 90, 152, 250, 95], ['Mobile', 230, 150, 120, 240, 180, 150], ['Tablet', 300, 200, 250, 350, 150, 250] ], type: 'bar', colors: { Desktop: '#fcbe2d', Mobile: '#02c58d', Tablet: '#30419b' } } }); //combined chart c3.generate({ bindto: '#combine-chart', data: { columns: [ ['SonyVaio', 80, 20, 120, 80, 40, 90], ['iMacs', 200, 130, 90, 200, 130, 220], ['Tablets', 300, 200, 160, 300, 300, 230], ['iPhones', 250, 160, 80, 180, 250, 120], ['Macbooks', 160, 120, 160, 140, 80, 130] ], types: { SonyVaio: 'bar', iMacs: 'bar', Tablets: 'spline', iPhones: 'line', Macbooks: 'bar' }, colors: { SonyVaio: '#02c58d', iMacs: '#30419b', Tablets: '#fcbe2d', iPhones: '#fc5454', Macbooks: '#59c6fb' }, groups: [ ['SonyVaio','iMacs'] ] }, axis: { x: { type: 'categorized' } } }); //roated chart c3.generate({ bindto: '#roated-chart', data: { columns: [ ['Revenue', 60, 120, 180, 300, 90, 180], ['Pageview', 40, 30, 10, 20, 50, 30] ], types: { Revenue: 'bar' }, colors: { Revenue: '#02c58d', Pageview: '#30419b' } }, axis: { rotated: true, x: { type: 'categorized' } } }); //stacked chart c3.generate({ bindto: '#chart-stacked', data: { columns: [ ['Revenue', 130, 120, 150, 120, 160, 150, 250, 120, 180, 140, 160, 150], ['Pageview', 10, 150, 90, 240, 130, 220, 200, 130, 90, 240, 130, 220] ], types: { Revenue: 'area-spline', Pageview: 'area-spline' // 'line', 'spline', 'step', 'area', 'area-step' are also available to stack }, colors: { Revenue: '#f0f4f7', Pageview: '#30419b' } } }); //Donut Chart c3.generate({ bindto: '#donut-chart', data: { columns: [ ['Desktops', 80], ['Smart Phones', 55], ['Mobiles', 40], ['Tablets', 55] ], type : 'donut' }, donut: { title: "Candidates", width: 30, label: { show:false } }, color: { pattern: ['#30419b', "#f0f4f7", '#02c58d', '#fcbe2d'] } }); //Pie Chart c3.generate({ bindto: '#pie-chart', data: { columns: [ ['Desktops', 38], ['Smart Phones', 55], ['Mobiles', 40], ['Tablets', 25] ], type : 'pie' }, color: { pattern: ["#30419b", "#f0f4f7","#fcbe2d","#02c58d"] }, pie: { label: { show: false } } }); }, $.ChartC3 = new ChartC3, $.ChartC3.Constructor = ChartC3 }(window.jQuery), //initializing function($) { "use strict"; $.ChartC3.init() }(window.jQuery);
const express = require('express') class Static{ constructor(route,path,headers){ this.route = route this.path = path this.headers = headers } get router(){ return this.valid ? express.static(this.path,this.headers):null } use(app){ let values = this.values if(values.length) app.use(...values) return app } get valid(){ return this.path !== null } get values(){ return [this.route,this.router].filter(item=>item !== null) } } //exports module.exports = Static
const Buffer = require('safe-buffer').Buffer const tape = require('tape') const swarmhash = require('../index.js') const blobs = [ [ 0, '011b4d03dd8c01f1049143cf9c4c817e4b167f1d1b83e5c6f0f10d89ba1e7bce' ], [ 0x1000 - 1, '32f0faabc4265ac238cd945087133ce3d7e9bb2e536053a812b5373c54043adb' ], [ 0x1000, '411dd45de7246e94589ff5888362c41e85bd3e582a92d0fda8f0e90b76439bec' ], [ 0x1000 + 1, '69754a0098432bbc2e84fe1205276870748a61a065ab6ef44d6a2e7b13ce044d' ], [ 0x2000 - 1, '69ad3c581043404f775ffa8d6f1b25ad4a9ee812971190e90209c0966116a321' ], [ 0x2000, 'f00222373ff82d0a178dc6271c78953e9c88f74130a52d401f5ec51475f63c43' ], [ 0x2000 + 1, '86d6773e79e02fd8145ee1aedba89ace0c15f2566db1249654000039a9a134bf' ], [ 0x80000, 'cc0854fe2c6b98e920d5c14b1a88e6d4223e55b8f78883f60939aa2485e361bf' ], [ 0x80020, 'ee9ffca246e70d3704740ba4df450fa6988d14a1c2439c7e734c7a77a4eb6fd3' ], [ 0x800020, '78b90b20c90559fb904535181a7c28929ea2f30a2329dbc25232de579709f12f' ], [ 2095104, 'a9958184589fc11b4027a4c233e777ebe2e99c66f96b74aef2a0638a94dd5439' ] ] for (var i = 0; i < blobs.length; i++) { var blob = blobs[i] tape('hashing ' + blob[0] + ' zeroes', function (t) { t.plan(1) t.equal(swarmhash(Buffer.alloc(blob[0])).toString('hex'), blob[1]) }) } tape('swmarhash() cannot take numbers', function (t) { t.plan(1) t.throws(function () { swarmhash(1) }) }) tape('swmarhash() cannot take strings', function (t) { t.plan(1) t.throws(function () { swarmhash('test') }) })
const EventEmitter = require('events'); const IORedis = require('ioredis'); const isPlainObject = require('lodash/isPlainObject'); const RedisEvents = [ 'connect', 'ready', 'error', 'close', 'reconnecting', 'end', ]; class Database extends EventEmitter { constructor(redisConfig) { super(); if (isPlainObject(redisConfig) === false) { throw Error('Database : Parameter "redisConfig" must be a plain object.'); } const connection = new IORedis(redisConfig); for (let i = 0, l = RedisEvents.length; i < l; i += 1) { connection.on(RedisEvents[i], (...args) => this.emit(RedisEvents[i], ...args)); } this.connection = connection; } } // { port: 6379, host: 'navigante.xyz', family: 4, db: 0 } module.exports = Database;
var fs = require('fs'); var pos = require('pos'); var nlp = require('nlp_compromise'); var ent = require('html-entities').AllHtmlEntities; var GRAMMAR = require('./grammar.json'); module.exports = hulkify; function fixList(list) { var replacement = Array(); for (var i = 0; i < list.length; i++) { replacement.push(list[i]); if (list[i].indexOf("'") >= 0) { replacement.push(list[i].replace("'", "โ€™")); } } return replacement; } function fixDict(dict) { var replacement = {}; for (var key in dict) { replacement[key] = dict[key]; if (key.indexOf("'") >= 0) { replacement[key.replace("'", "โ€™")] = dict[key]; } } return replacement; } GRAMMAR.PERSONAL_PRONOUNS = fixList(GRAMMAR.PERSONAL_PRONOUNS); GRAMMAR.PERSONAL_POSSESSIVE_PRONOUNS = fixList(GRAMMAR.PERSONAL_POSSESSIVE_PRONOUNS); GRAMMAR.CONTRACTION_MAPPING = fixDict(GRAMMAR.CONTRACTION_MAPPING); GRAMMAR.LINKING_VERBS = fixList(GRAMMAR.LINKING_VERBS); GRAMMAR.ARTICLES = fixList(GRAMMAR.ARTICLES); GRAMMAR.DIMINUTIVE_ADJECTIVES = fixList(GRAMMAR.DIMINUTIVE_ADJECTIVES); function hulkify(bannerText, maxLength) { var entProc = new ent(); bannerText = entProc.decode(bannerText); var hulkText = bannerText; function removeWordFromMatch(match, g1, g2, g3) { var before = g1.length > 0; var after = g3.length > 0; if (!before && !after) { return g2; } if (before && after) { return g1; } if (before) { return g3; } if (after) { return g1; } } function changeTextUnlessOverrun(oldText, newText, maximum) { if (maximum === undefined) { return newText; } if (newText.length > maximum) { return oldText; } return newText; } // Change contractions to their main word. ("can't" -> "not") for (var con in GRAMMAR.CONTRACTION_MAPPING) { var main = GRAMMAR.CONTRACTION_MAPPING[con]; var re = new RegExp("(\\s?|^)(\\b" + con + "\\b)(\\s?|$)", "gi"); hulkText = hulkText.replace(re, "$1" + main + "$3"); } // Drop all linking verbs ("am" or "to be") for (var i=0; i < GRAMMAR.LINKING_VERBS.length; i++) { var lv = GRAMMAR.LINKING_VERBS[i]; var re = new RegExp("(\\s?|^)(\\b" + lv + "\\b)(\\s?|$)", "gi"); hulkText = hulkText.replace(re, removeWordFromMatch); } // Remove articles. for (var i=0; i < GRAMMAR.ARTICLES.length; i++) { var a = GRAMMAR.ARTICLES[i]; var re = new RegExp("(\\s?|^)(\\b" + a + "\\b)(\\s?|$)", "gi"); hulkText = hulkText.replace(re, removeWordFromMatch); } // // everything above here only removes content; after this we have to consider length // Replace all personal pronouns (I/me/I've/I'm/etc) with "Hulk" for (var i = 0; i < GRAMMAR.PERSONAL_PRONOUNS.length; i++) { var pp = GRAMMAR.PERSONAL_PRONOUNS[i]; var re = new RegExp("(\\s?|^)(\\b" + pp + "\\b)(\\s?|$)", "gi"); hulkText = changeTextUnlessOverrun( hulkText, hulkText.replace(re, "$1Hulk$3"), maxLength ); } for (var i = 0; i < GRAMMAR.PERSONAL_POSSESSIVE_PRONOUNS.length; i++) { var ppp = GRAMMAR.PERSONAL_POSSESSIVE_PRONOUNS[i]; var re = new RegExp("(\\s?|^)(\\b" + ppp + "\\b)(\\s?|$)", "gi"); if (ppp.indexOf("โ€™") >= 0) { hulkText = changeTextUnlessOverrun( hulkText, hulkText.replace(re, "$1Hulkโ€™s$3"), maxLength ); } else { hulkText = changeTextUnlessOverrun( hulkText, hulkText.replace(re, "$1Hulk's$3"), maxLength ); } } var words = new pos.Lexer().lex(hulkText); var parsed = new pos.Tagger().tag(words); for (var i = 0; i < parsed.length; i++) { var wordData = parsed[i]; if (wordData[1][0] == 'V' && wordData[1] != 'VBG') { var re = new RegExp("\\b" + wordData[0] + "\\b", "gi"); hulkText = changeTextUnlessOverrun( hulkText, hulkText.replace(re, nlp.verb(wordData[0]).conjugate().infinitive), maxLength ); } } // Replace any diminutive adjective with "puny." for (var i = 0; i < parsed.length; i++) { var wordData = parsed[i]; if (wordData[1].substring(0,2) == 'JJ') { if (GRAMMAR.DIMINUTIVE_ADJECTIVES.indexOf(wordData[0]) >= 0) { var re = new RegExp("\\b" + wordData[0] + "\\b", "gi"); hulkText = changeTextUnlessOverrun( hulkText, hulkText.replace(re, "puny"), maxLength ); } } } // Exclamation points function exclaim (match, g0, g1) { var punct = g0; if ( (punct.indexOf('.') >= 0) && ((punct.match(/!/g) || []).length == 0) ) { // change out periods most of the time if (Math.random() < 0.7) { punct = '!'; } } // if we're already at the max, don't intensify if ( (maxLength !== undefined) && (hulkText.length >= maxLength) ) { return punct; } // 30% chance of intensifying if ( (punct.indexOf('.') < 0) && (Math.random() < 0.3) ) { punct += '!'; // slight chance of double intensifying if (Math.random() < 0.45) { punct += '!'; if (punct.indexOf('?') >= 0) { punct += '?!'; } } } return punct + g1; } hulkText = hulkText.replace(/([.?!]+)(\s|$)/gi, exclaim); // Easter egg at mention of "strong" var strongest = ' Hulk is the strongest there is!'; var strongRe = new RegExp('\\bstrong\\b', 'gi'); if (strongRe.test(hulkText)) { if ( (maxLength === undefined) || (hulkText.length + strongest.length <= maxLength) ) { hulkText += strongest; } } // Convert the whole thing to uppercase. hulkText = hulkText.toUpperCase(); return hulkText; } var main = function(){ var corpusString = fs.readFileSync('./test_corpus.txt').toString(); corpusString = corpusString.replace(/\r/g, ''); var corpus = corpusString.split("\n"); for (var i=0; i < corpus.length; i++) { if (corpus[i].length === 0) { continue; } var val = hulkify(corpus[i], 140); console.log(val); } } if (require.main === module) { main(); }
import { NotImplementedError } from "../extensions/index.js"; /** * Implement class VigenereCipheringMachine that allows us to create * direct and reverse ciphering machines according to task description * * @example * * const directMachine = new VigenereCipheringMachine(); * * const reverseMachine = new VigenereCipheringMachine(false); * * directMachine.encrypt('attack at dawn!', 'alphonse') => 'AEIHQX SX DLLU!' * * directMachine.decrypt('AEIHQX SX DLLU!', 'alphonse') => 'ATTACK AT DAWN!' * * reverseMachine.encrypt('attack at dawn!', 'alphonse') => '!ULLD XS XQHIEA' * * reverseMachine.decrypt('AEIHQX SX DLLU!', 'alphonse') => '!NWAD TA KCATTA' * */ export default class VigenereCipheringMachine { constructor(direct = true) { this.direct = direct; } encrypt(str, key) { return this.crypt(str, key, "encrypt"); } decrypt(str, key) { return this.crypt(str, key, "decrypt"); } crypt(str, key, mode) { if (!str || !key || !mode) throw Error("Incorrect arguments!"); str = str.toUpperCase(); key = key.toUpperCase(); const res = []; for (let i = 0, j = 0; i < str.length; i++) { if (str[i].match(/[A-Z]/)) { if (mode == "decrypt") { res.push( String.fromCharCode( ((str[i].charCodeAt(0) - "A".charCodeAt(0) + (26 - (key[j % key.length].charCodeAt(0) - "A".charCodeAt(0)))) % 26) + "A".charCodeAt(0) ) ); } else { res.push( String.fromCharCode( ((str[i].charCodeAt(0) - "A".charCodeAt(0) + (key[j % key.length].charCodeAt(0) - "A".charCodeAt(0))) % 26) + "A".charCodeAt(0) ) ); } j++; } else { res.push(str[i]); } } return this.direct ? res.join("") : res.reverse().join(""); } }
export default function () { let savedState = {} try { const serialized = window.localStorage.getItem('cryptoDash') if (serialized) { savedState = JSON.parse(serialized) } } catch (reason) { console.error('::: Load state from the local storage failed with reason:', reason) } return savedState }
'use strict'; const fs = require('fs'); const changes = []; const display = files => { console.log('\x1Bc'); while (changes.length > 10) { changes.shift(); } console.log('Changes:'); for (const item of changes) { console.log(item.date.toISOString(), item.event, ':', item.file); } console.log('\nFiles:'); for (const file of files) { console.log(file); } }; const ls = path => { fs.readdir(path, (err, files) => { if (err) return; display(files); }); }; const watch = path => { fs.watch(path, (event, file) => { console.log('\x1Bc'); changes.push({ date: new Date(), event, file }); ls(path); }); }; const path = './'; ls(path); watch(path);
import boto3 from botocore import exceptions import time client = boto3.Session(region_name='eu-west-1').client('dynamodb', aws_access_key_id='', aws_secret_access_key='', endpoint_url='http://localhost:4567') try: response = client.put_item( TableName='gamescores', Item={ 'event': {'S': 'gaming_nationals_zaf'}, 'timestamp': {'S': '2019-02-08T14:53'}, 'score': {'N': '11885'}, 'name': {'S': 'will'}, 'gamerid': {'S': 'wilson9335'}, 'game': {'S': 'counter strike'}, 'age': {'N': '27'}, 'rank': {'S': 'professional'}, 'location': {'S': 'sweden'} }, ConditionExpression='attribute_not_exists(gamerid)' ) print(response) except exceptions.ClientError as e: if e.response['Error']['Code'] == 'ConditionalCheckFailedException': print('ConditionalCheckFailedException')
from .hungarian_matcher import * from .det_criterion import *
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. class OSFException(Exception): """Base Exception class""" class OSFError(OSFException): """Base Error class""" class PowerManagementError(OSFError): """Base Error class for Power Management API""" class CloudManagementError(OSFError): """Base Error class for Cloud Management API""" class ServiceError(OSFError): """Base Error class for Service API""" class NodeCollectionError(OSFError): """Base Error class for NodeCollection API""" class OSFDriverNotFound(OSFError): """Driver Not Found by os-faults registry""" class OSFDriverWithSuchNameExists(OSFError): """Driver with such name already exists in os-faults registry"""
const signupFormHandler = async (event) => { event.preventDefault(); console.log('click') const username = document.querySelector('#username-signup').value.trim(); const email = document.querySelector('#email-signup').value.trim(); const password = document.querySelector('#password-signup').value.trim(); if (username && email && password) { const response = await fetch('/api/signup', { method: 'POST', body: JSON.stringify({ username, email, password }), headers: { 'Content-Type': 'application/json' }, }); if (response.ok) { document.location.replace('/'); } else { alert('Failed to sign up.'); } } }; document .querySelector('.signup-form') .addEventListener('submit', signupFormHandler);
// methods should throw errors when arguments are invalid const lwip = require('../../'), imgs = require('../imgs'); describe('batch.resize arguments validation', () => { let batch; before(done => { lwip.open(imgs.jpg.rgb, (err, img) => { batch = img.batch(); done(err); }); }); describe('invalid interpolation', () => { it('should throw an error', () => { batch.resize.bind(batch, 100, 100, 'foo').should.throwError(); }); }); });
/** * Auto-generated action file for "EventGridManagementClient" API. * * Generated at: 2019-05-07T14:38:08.508Z * Mass generator version: 1.1.0 * * flowground :- Telekom iPaaS / azure-com-eventgrid-event-grid-connector * Copyright ยฉ 2019, Deutsche Telekom AG * contact: [email protected] * * All files of this connector are licensed under the Apache 2.0 License. For details * see the file LICENSE on the toplevel directory. * * * Operation: 'EventSubscriptions_ListRegionalBySubscriptionForTopicType' * Endpoint Path: '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions' * Method: 'get' * */ const Swagger = require('swagger-client'); const processWrapper = require('../services/process-wrapper'); const spec = require('../spec.json'); // this wrapers offers a simplified emitData(data) function module.exports.process = processWrapper(processAction); // parameter names for this call const PARAMETERS = [ "subscriptionId", "location", "topicTypeName", "api-version" ]; // mappings from connector field names to API field names const FIELD_MAP = { "subscriptionId": "subscriptionId", "location": "location", "topicTypeName": "topicTypeName", "api_version": "api-version" }; function processAction(msg, cfg) { var isVerbose = process.env.debug || cfg.verbose; if (isVerbose) { console.log(`---MSG: ${JSON.stringify(msg)}`); console.log(`---CFG: ${JSON.stringify(cfg)}`); console.log(`---ENV: ${JSON.stringify(process.env)}`); } const contentType = undefined; const body = msg.body; mapFieldNames(body); let parameters = {}; for(let param of PARAMETERS) { parameters[param] = body[param]; } // credentials for this operation let securities = {}; securities['azure_auth'] = {token: cfg['azure_auth']}; let callParams = { spec: spec, operationId: 'EventSubscriptions_ListRegionalBySubscriptionForTopicType', pathName: '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions', method: 'get', parameters: parameters, requestContentType: contentType, requestBody: body.requestBody, securities: {authorized: securities}, server: spec.servers[cfg.server] || cfg.otherServer, }; if (isVerbose) { let out = Object.assign({}, callParams); out.spec = '[omitted]'; console.log(`--SWAGGER CALL: ${JSON.stringify(out)}`); } // Call operation via Swagger client return Swagger.execute(callParams).then(data => { // emit a single message with data this.emitData(data); // if the response contains an array of entities, you can emit them one by one: // data.obj.someItems.forEach((item) => { // this.emitData(item); // } }); } function mapFieldNames(obj) { if(Array.isArray(obj)) { obj.forEach(mapFieldNames); } else if(typeof obj === 'object' && obj) { Object.keys(obj).forEach(key => { mapFieldNames(obj[key]); let goodKey = FIELD_MAP[key]; if(goodKey && goodKey !== key) { obj[goodKey] = obj[key]; delete obj[key]; } }); } }
import classic from 'ember-classic-decorator'; import Component from '@ember/component'; @classic export default class EventIsPromoted extends Component {}
const ChronoTimer = require('../timer'); const style = require('./style.css'); const template = require('./template'); class ChronoTimerBrief extends ChronoTimer { constructor() { super(); this.removeTimer = this.removeTimer.bind(this); this.onView = this.onView.bind(this); } initShadowRoot() { this.shadowRoot.innerHTML = ` <style> ${style()} </style> <template> ${template()} </template> `; } connectedCallback() { super.connectedCallback(); const formRemove = this.shadowRoot.querySelector('form#remove'); formRemove.addEventListener('submit', this.removeTimer); formRemove.addEventListener('chrono:buttonclick', this.removeTimer); const buttonView = this.shadowRoot.querySelector('#view'); buttonView.addEventListener('click', this.onView); } disconnectedCallback() { super.disconnectedCallback(); const formRemove = this.shadowRoot.querySelector('form#remove'); formRemove.removeEventListener('submit', this.removeTimer); formRemove.removeEventListener('chrono:buttonclick', this.removeTimer); const buttonView = this.shadowRoot.querySelector('#view'); buttonView.removeEventListener('click', this.onView); } removeTimer(event) { event.preventDefault(); this.dispatchEvent(new CustomEvent('state:timerremove', { detail: { id: this.state.id, }, bubbles: true, composed: true, })); } onView(event) { event.preventDefault(); this.dispatchEvent(new CustomEvent('route:change', { detail: { id: 'home', params: { id: this.state.id, }, }, bubbles: true, composed: true, })); } } window.customElements.define('chrono-timerbrief', ChronoTimerBrief); module.exports = ChronoTimerBrief;
/** * Copyright 2019, the AMP HTML authors * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ 'use strict'; const knex = require('knex'); const {dbConfig} = require('./db-config.js'); exports.dbConnect = () => { return knex(dbConfig); };
import assert from 'assert'; import configureMockStore from 'redux-mock-store'; import thunk from 'redux-thunk'; import ConfirmTransactionReducer, * as actions from '../confirm-transaction.duck.js'; const initialState = { txData: {}, tokenData: {}, methodData: {}, tokenProps: { tokenDecimals: '', tokenSymbol: '', }, fiatTransactionAmount: '', fiatTransactionFee: '', fiatTransactionTotal: '', ethTransactionAmount: '', ethTransactionFee: '', ethTransactionTotal: '', hexGasTotal: '', nonce: '', fetchingMethodData: false, }; const UPDATE_TX_DATA = 'auramask/confirm-transaction/UPDATE_TX_DATA'; const CLEAR_TX_DATA = 'auramask/confirm-transaction/CLEAR_TX_DATA'; const UPDATE_TOKEN_DATA = 'auramask/confirm-transaction/UPDATE_TOKEN_DATA'; const CLEAR_TOKEN_DATA = 'auramask/confirm-transaction/CLEAR_TOKEN_DATA'; const UPDATE_METHOD_DATA = 'auramask/confirm-transaction/UPDATE_METHOD_DATA'; const CLEAR_METHOD_DATA = 'auramask/confirm-transaction/CLEAR_METHOD_DATA'; const UPDATE_TRANSACTION_AMOUNTS = 'auramask/confirm-transaction/UPDATE_TRANSACTION_AMOUNTS'; const UPDATE_TRANSACTION_FEES = 'auramask/confirm-transaction/UPDATE_TRANSACTION_FEES'; const UPDATE_TRANSACTION_TOTALS = 'auramask/confirm-transaction/UPDATE_TRANSACTION_TOTALS'; const UPDATE_HEX_GAS_TOTAL = 'auramask/confirm-transaction/UPDATE_HEX_GAS_TOTAL'; const UPDATE_TOKEN_PROPS = 'auramask/confirm-transaction/UPDATE_TOKEN_PROPS'; const UPDATE_NONCE = 'auramask/confirm-transaction/UPDATE_NONCE'; const FETCH_METHOD_DATA_START = 'auramask/confirm-transaction/FETCH_METHOD_DATA_START'; const FETCH_METHOD_DATA_END = 'auramask/confirm-transaction/FETCH_METHOD_DATA_END'; const CLEAR_CONFIRM_TRANSACTION = 'auramask/confirm-transaction/CLEAR_CONFIRM_TRANSACTION'; describe('Confirm Transaction Duck', () => { describe('State changes', () => { const mockState = { confirmTransaction: { txData: { id: 1, }, tokenData: { name: 'abcToken', }, methodData: { name: 'approve', }, tokenProps: { tokenDecimals: '3', tokenSymbol: 'ABC', }, fiatTransactionAmount: '469.26', fiatTransactionFee: '0.01', fiatTransactionTotal: '1.000021', ircTransactionAmount: '1', ircTransactionFee: '0.000021', ircTransactionTotal: '469.27', hexGasTotal: '0x1319718a5000', nonce: '0x0', fetchingMethodData: false, }, }; it('should initialize state', () => { assert.deepEqual( ConfirmTransactionReducer({}), initialState ); }); it('should return state unchanged if it does not match a dispatched actions type', () => { assert.deepEqual( ConfirmTransactionReducer(mockState, { type: 'someOtherAction', value: 'someValue', }), { ...mockState.confirmTransaction }, ); }); it('should set txData when receiving a UPDATE_TX_DATA action', () => { assert.deepEqual( ConfirmTransactionReducer(mockState, { type: UPDATE_TX_DATA, payload: { id: 2, }, }), { ...mockState.confirmTransaction, txData: { ...mockState.confirmTransaction.txData, id: 2, }, } ); }); it('should clear txData when receiving a CLEAR_TX_DATA action', () => { assert.deepEqual( ConfirmTransactionReducer(mockState, { type: CLEAR_TX_DATA, }), { ...mockState.confirmTransaction, txData: {}, } ); }); it('should set tokenData when receiving a UPDATE_TOKEN_DATA action', () => { assert.deepEqual( ConfirmTransactionReducer(mockState, { type: UPDATE_TOKEN_DATA, payload: { name: 'defToken', }, }), { ...mockState.confirmTransaction, tokenData: { ...mockState.confirmTransaction.tokenData, name: 'defToken', }, } ); }); it('should clear tokenData when receiving a CLEAR_TOKEN_DATA action', () => { assert.deepEqual( ConfirmTransactionReducer(mockState, { type: CLEAR_TOKEN_DATA, }), { ...mockState.confirmTransaction, tokenData: {}, } ); }); it('should set methodData when receiving a UPDATE_METHOD_DATA action', () => { assert.deepEqual( ConfirmTransactionReducer(mockState, { type: UPDATE_METHOD_DATA, payload: { name: 'transferFrom', }, }), { ...mockState.confirmTransaction, methodData: { ...mockState.confirmTransaction.methodData, name: 'transferFrom', }, } ); }); it('should clear methodData when receiving a CLEAR_METHOD_DATA action', () => { assert.deepEqual( ConfirmTransactionReducer(mockState, { type: CLEAR_METHOD_DATA, }), { ...mockState.confirmTransaction, methodData: {}, } ); }); it('should update transaction amounts when receiving an UPDATE_TRANSACTION_AMOUNTS action', () => { assert.deepEqual( ConfirmTransactionReducer(mockState, { type: UPDATE_TRANSACTION_AMOUNTS, payload: { fiatTransactionAmount: '123.45', ircTransactionAmount: '.5', }, }), { ...mockState.confirmTransaction, fiatTransactionAmount: '123.45', ircTransactionAmount: '.5', } ); }); it('should update transaction fees when receiving an UPDATE_TRANSACTION_FEES action', () => { assert.deepEqual( ConfirmTransactionReducer(mockState, { type: UPDATE_TRANSACTION_FEES, payload: { fiatTransactionFee: '123.45', ircTransactionFee: '.5', }, }), { ...mockState.confirmTransaction, fiatTransactionFee: '123.45', ircTransactionFee: '.5', } ); }); it('should update transaction totals when receiving an UPDATE_TRANSACTION_TOTALS action', () => { assert.deepEqual( ConfirmTransactionReducer(mockState, { type: UPDATE_TRANSACTION_TOTALS, payload: { fiatTransactionTotal: '123.45', ircTransactionTotal: '.5', }, }), { ...mockState.confirmTransaction, fiatTransactionTotal: '123.45', ircTransactionTotal: '.5', } ); }); it('should update hexGasTotal when receiving an UPDATE_HEX_GAS_TOTAL action', () => { assert.deepEqual( ConfirmTransactionReducer(mockState, { type: UPDATE_HEX_GAS_TOTAL, payload: '0x0', }), { ...mockState.confirmTransaction, hexGasTotal: '0x0', } ); }); it('should update tokenProps when receiving an UPDATE_TOKEN_PROPS action', () => { assert.deepEqual( ConfirmTransactionReducer(mockState, { type: UPDATE_TOKEN_PROPS, payload: { tokenSymbol: 'DEF', tokenDecimals: '1', }, }), { ...mockState.confirmTransaction, tokenProps: { tokenSymbol: 'DEF', tokenDecimals: '1', }, } ); }); it('should update nonce when receiving an UPDATE_NONCE action', () => { assert.deepEqual( ConfirmTransactionReducer(mockState, { type: UPDATE_NONCE, payload: '0x1', }), { ...mockState.confirmTransaction, nonce: '0x1', } ); }); it('should set fetchingMethodData to true when receiving a FETCH_METHOD_DATA_START action', () => { assert.deepEqual( ConfirmTransactionReducer(mockState, { type: FETCH_METHOD_DATA_START, }), { ...mockState.confirmTransaction, fetchingMethodData: true, } ); }); it('should set fetchingMethodData to false when receiving a FETCH_METHOD_DATA_END action', () => { assert.deepEqual( ConfirmTransactionReducer({ confirmTransaction: { fetchingMethodData: true } }, { type: FETCH_METHOD_DATA_END, }), { fetchingMethodData: false, } ); }); it('should clear confirmTransaction when receiving a FETCH_METHOD_DATA_END action', () => { assert.deepEqual( ConfirmTransactionReducer(mockState, { type: CLEAR_CONFIRM_TRANSACTION, }), { ...initialState, } ); }); }); describe('Single actions', () => { it('should create an action to update txData', () => { const txData = { test: 123 }; const expectedAction = { type: UPDATE_TX_DATA, payload: txData, }; assert.deepEqual( actions.updateTxData(txData), expectedAction ); }); it('should create an action to clear txData', () => { const expectedAction = { type: CLEAR_TX_DATA, }; assert.deepEqual( actions.clearTxData(), expectedAction ); }); it('should create an action to update tokenData', () => { const tokenData = { test: 123 }; const expectedAction = { type: UPDATE_TOKEN_DATA, payload: tokenData, }; assert.deepEqual( actions.updateTokenData(tokenData), expectedAction ); }); it('should create an action to clear tokenData', () => { const expectedAction = { type: CLEAR_TOKEN_DATA, }; assert.deepEqual( actions.clearTokenData(), expectedAction ); }); it('should create an action to update methodData', () => { const methodData = { test: 123 }; const expectedAction = { type: UPDATE_METHOD_DATA, payload: methodData, }; assert.deepEqual( actions.updateMethodData(methodData), expectedAction ); }); it('should create an action to clear methodData', () => { const expectedAction = { type: CLEAR_METHOD_DATA, }; assert.deepEqual( actions.clearMethodData(), expectedAction ); }); it('should create an action to update transaction amounts', () => { const transactionAmounts = { test: 123 }; const expectedAction = { type: UPDATE_TRANSACTION_AMOUNTS, payload: transactionAmounts, }; assert.deepEqual( actions.updateTransactionAmounts(transactionAmounts), expectedAction ); }); it('should create an action to update transaction fees', () => { const transactionFees = { test: 123 }; const expectedAction = { type: UPDATE_TRANSACTION_FEES, payload: transactionFees, }; assert.deepEqual( actions.updateTransactionFees(transactionFees), expectedAction ); }); it('should create an action to update transaction totals', () => { const transactionTotals = { test: 123 }; const expectedAction = { type: UPDATE_TRANSACTION_TOTALS, payload: transactionTotals, }; assert.deepEqual( actions.updateTransactionTotals(transactionTotals), expectedAction ); }); it('should create an action to update hexGasTotal', () => { const hexGasTotal = '0x0'; const expectedAction = { type: UPDATE_HEX_GAS_TOTAL, payload: hexGasTotal, }; assert.deepEqual( actions.updateHexGasTotal(hexGasTotal), expectedAction ); }); it('should create an action to update tokenProps', () => { const tokenProps = { tokenDecimals: '1', tokenSymbol: 'abc', }; const expectedAction = { type: UPDATE_TOKEN_PROPS, payload: tokenProps, }; assert.deepEqual( actions.updateTokenProps(tokenProps), expectedAction ); }); it('should create an action to update nonce', () => { const nonce = '0x1'; const expectedAction = { type: UPDATE_NONCE, payload: nonce, }; assert.deepEqual( actions.updateNonce(nonce), expectedAction ); }); it('should create an action to set fetchingMethodData to true', () => { const expectedAction = { type: FETCH_METHOD_DATA_START, }; assert.deepEqual( actions.setFetchingMethodData(true), expectedAction ); }); it('should create an action to set fetchingMethodData to false', () => { const expectedAction = { type: FETCH_METHOD_DATA_END, }; assert.deepEqual( actions.setFetchingMethodData(false), expectedAction ); }); it('should create an action to clear confirmTransaction', () => { const expectedAction = { type: CLEAR_CONFIRM_TRANSACTION, }; assert.deepEqual( actions.clearConfirmTransaction(), expectedAction ); }); }); describe('Thunk actions', done => { it('updates txData and gas on an existing transaction in confirmTransaction', () => { const mockState = { auramask: { conversionRate: 468.58, currentCurrency: 'usd', }, confirmTransaction: { ircTransactionAmount: '1', ircTransactionFee: '0.000021', ircTransactionTotal: '1.000021', fetchingMethodData: false, fiatTransactionAmount: '469.26', fiatTransactionFee: '0.01', fiatTransactionTotal: '469.27', hexGasTotal: '0x1319718a5000', methodData: {}, nonce: '', tokenData: {}, tokenProps: { tokenDecimals: '', tokenSymbol: '', }, txData: { estimatedGas: '0x5208', gasLimitSpecified: false, gasPriceSpecified: false, history: [], id: 2603411941761054, loadingDefaults: false, auramaskNetworkId: '3', origin: 'faucet.auramask.io', simpleSend: true, status: 'unapproved', time: 1530838113716, }, }, }; const middlewares = [thunk]; const mockStore = configureMockStore(middlewares); const store = mockStore(mockState); const expectedActions = [ 'auramask/confirm-transaction/UPDATE_TX_DATA', 'auramask/confirm-transaction/UPDATE_TRANSACTION_AMOUNTS', 'auramask/confirm-transaction/UPDATE_HEX_GAS_TOTAL', 'auramask/confirm-transaction/UPDATE_TRANSACTION_FEES', 'auramask/confirm-transaction/UPDATE_TRANSACTION_TOTALS', ]; store.dispatch(actions.updateGasAndCalculate({ gasLimit: '0x2', gasPrice: '0x25' })); const storeActions = store.getActions(); assert.equal(storeActions.length, expectedActions.length); storeActions.forEach((action, index) => assert.equal(action.type, expectedActions[index])); }); it('updates txData and updates gas values in confirmTransaction', () => { const txData = { estimatedGas: '0x5208', gasLimitSpecified: false, gasPriceSpecified: false, history: [], id: 2603411941761054, loadingDefaults: false, auramaskNetworkId: '3', origin: 'faucet.auramask.io', simpleSend: true, status: 'unapproved', time: 1530838113716, txParams: { from: '0xc5ae6383e126f901dcb06131d97a88745bfa88d6', gas: '0x33450', gasPrice: '0x2540be400', to: '0x81b7e08f65bdf5648606c89998a9cc8164397647', value: '0xde0b6b3a7640000', }, }; const mockState = { auramask: { conversionRate: 468.58, currentCurrency: 'usd', }, confirmTransaction: { ircTransactionAmount: '1', ircTransactionFee: '0.000021', ircTransactionTotal: '1.000021', fetchingMethodData: false, fiatTransactionAmount: '469.26', fiatTransactionFee: '0.01', fiatTransactionTotal: '469.27', hexGasTotal: '0x1319718a5000', methodData: {}, nonce: '', tokenData: {}, tokenProps: { tokenDecimals: '', tokenSymbol: '', }, txData: { ...txData, txParams: { ...txData.txParams, }, }, }, }; const middlewares = [thunk]; const mockStore = configureMockStore(middlewares); const store = mockStore(mockState); const expectedActions = [ 'auramask/confirm-transaction/UPDATE_TX_DATA', 'auramask/confirm-transaction/UPDATE_TRANSACTION_AMOUNTS', 'auramask/confirm-transaction/UPDATE_HEX_GAS_TOTAL', 'auramask/confirm-transaction/UPDATE_TRANSACTION_FEES', 'auramask/confirm-transaction/UPDATE_TRANSACTION_TOTALS', ]; store.dispatch(actions.updateTxDataAndCalculate(txData)); const storeActions = store.getActions(); assert.equal(storeActions.length, expectedActions.length); storeActions.forEach((action, index) => assert.equal(action.type, expectedActions[index])); }); it('updates confirmTransaction transaction', done => { const mockState = { auramask: { conversionRate: 468.58, currentCurrency: 'usd', network: '3', unapprovedTxs: { 2603411941761054: { estimatedGas: '0x5208', gasLimitSpecified: false, gasPriceSpecified: false, history: [], id: 2603411941761054, loadingDefaults: false, auramaskNetworkId: '3', origin: 'faucet.auramask.io', simpleSend: true, status: 'unapproved', time: 1530838113716, txParams: { from: '0xc5ae6383e126f901dcb06131d97a88745bfa88d6', gas: '0x33450', gasPrice: '0x2540be400', to: '0x81b7e08f65bdf5648606c89998a9cc8164397647', value: '0xde0b6b3a7640000', }, }, }, }, confirmTransaction: {}, }; const middlewares = [thunk]; const mockStore = configureMockStore(middlewares); const store = mockStore(mockState); const expectedActions = [ 'auramask/confirm-transaction/UPDATE_TX_DATA', 'auramask/confirm-transaction/UPDATE_TRANSACTION_AMOUNTS', 'auramask/confirm-transaction/UPDATE_HEX_GAS_TOTAL', 'auramask/confirm-transaction/UPDATE_TRANSACTION_FEES', 'auramask/confirm-transaction/UPDATE_TRANSACTION_TOTALS', ]; store.dispatch(actions.setTransactionToConfirm(2603411941761054)) .then(() => { const storeActions = store.getActions(); assert.equal(storeActions.length, expectedActions.length); storeActions.forEach((action, index) => assert.equal(action.type, expectedActions[index])); done(); }); }); }); });
import * as React from 'react' import { Link } from 'gatsby' const partlyActive = className => ({ isPartiallyCurrent }) => ({ className: className + (isPartiallyCurrent ? ` active` : ``), }) const PartialNavLink = ({ className, ...props }) => ( <Link getProps={partlyActive(className)} {...props} /> ) export default PartialNavLink
# Lint as: python2, python3 # Copyright 2019 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """TFX ml metadata library.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import copy import hashlib import itertools import os import random import time import types from typing import Any, Dict, List, Optional, Set, Text, Tuple, Type, Union import absl import six import tensorflow as tf from ml_metadata.metadata_store import metadata_store from ml_metadata.proto import metadata_store_pb2 from ml_metadata.proto import metadata_store_service_pb2 from tensorflow.python.lib.io import file_io # pylint: disable=g-direct-tensorflow-import from tfx.orchestration import data_types from tfx.types import artifact_utils from tfx.types.artifact import Artifact from tfx.types.artifact import ArtifactState # Number of times to retry initialization of connection. _MAX_INIT_RETRY = 10 # Maximum number of executions we look at for previous result. MAX_EXECUTIONS_FOR_CACHE = 100 # Execution state constant. We should replace this with MLMD enum once that is # ready. EXECUTION_STATE_CACHED = 'cached' EXECUTION_STATE_COMPLETE = 'complete' EXECUTION_STATE_NEW = 'new' FINAL_EXECUTION_STATES = frozenset( (EXECUTION_STATE_CACHED, EXECUTION_STATE_COMPLETE)) # Context type, the following three types of contexts are supported: # - pipeline level context is shared within one pipeline, across multiple # pipeline runs. # - pipeline run level context is shared within one pipeline run, across # all component executions in that pipeline run. # - component run level context is shared within one component run. _CONTEXT_TYPE_PIPELINE = 'pipeline' _CONTEXT_TYPE_PIPELINE_RUN = 'run' _CONTEXT_TYPE_COMPONENT_RUN = 'component_run' # Keys of context type properties. _CONTEXT_TYPE_KEY_COMPONENT_ID = 'component_id' _CONTEXT_TYPE_KEY_PIPELINE_NAME = 'pipeline_name' _CONTEXT_TYPE_KEY_RUN_ID = 'run_id' # Keys of execution type properties. _EXECUTION_TYPE_KEY_CHECKSUM = 'checksum_md5' _EXECUTION_TYPE_KEY_COMPONENT_ID = 'component_id' _EXECUTION_TYPE_KEY_PIPELINE_NAME = 'pipeline_name' _EXECUTION_TYPE_KEY_PIPELINE_ROOT = 'pipeline_root' _EXECUTION_TYPE_KEY_RUN_ID = 'run_id' _EXECUTION_TYPE_KEY_STATE = 'state' _EXECUTION_TYPE_RESERVED_KEYS = frozenset( (_EXECUTION_TYPE_KEY_CHECKSUM, _EXECUTION_TYPE_KEY_PIPELINE_NAME, _EXECUTION_TYPE_KEY_PIPELINE_ROOT, _EXECUTION_TYPE_KEY_RUN_ID, _EXECUTION_TYPE_KEY_COMPONENT_ID, _EXECUTION_TYPE_KEY_STATE)) # Keys for artifact properties. _ARTIFACT_TYPE_KEY_STATE = 'state' def sqlite_metadata_connection_config( metadata_db_uri: Text) -> metadata_store_pb2.ConnectionConfig: """Convenience function to create file based metadata connection config. Args: metadata_db_uri: uri to metadata db. Returns: A metadata_store_pb2.ConnectionConfig based on given metadata db uri. """ tf.io.gfile.makedirs(os.path.dirname(metadata_db_uri)) connection_config = metadata_store_pb2.ConnectionConfig() connection_config.sqlite.filename_uri = metadata_db_uri connection_config.sqlite.connection_mode = \ metadata_store_pb2.SqliteMetadataSourceConfig.READWRITE_OPENCREATE return connection_config def mysql_metadata_connection_config( host: Text, port: int, database: Text, username: Text, password: Text) -> metadata_store_pb2.ConnectionConfig: """Convenience function to create mysql-based metadata connection config. Args: host: The name or network address of the instance of MySQL to connect to. port: The port MySQL is using to listen for connections. database: The name of the database to use. username: The MySQL login account being used. password: The password for the MySQL account being used. Returns: A metadata_store_pb2.ConnectionConfig based on given metadata db uri. """ return metadata_store_pb2.ConnectionConfig( mysql=metadata_store_pb2.MySQLDatabaseConfig( host=host, port=port, database=database, user=username, password=password)) # TODO(ruoyu): Figure out the story mutable UDFs. We should not reuse previous # run when having different UDFs. class Metadata(object): """Helper class to handle metadata I/O.""" def __init__( self, connection_config: Union[metadata_store_pb2.ConnectionConfig, metadata_store_pb2.MetadataStoreClientConfig] ) -> None: self._connection_config = connection_config self._store = None def __enter__(self) -> 'Metadata': # TODO(ruoyu): Establishing a connection pool instead of newing # a connection every time. Until then, check self._store before usage # in every method. connection_error = None for _ in range(_MAX_INIT_RETRY): try: self._store = metadata_store.MetadataStore(self._connection_config) except RuntimeError as err: # MetadataStore could raise Aborted error if multiple concurrent # connections try to execute initialization DDL in database. # This is safe to retry. connection_error = err time.sleep(random.random()) continue else: return self raise RuntimeError( 'Failed to establish connection to Metadata storage with error: %s' % connection_error) def __exit__(self, exc_type: Optional[Type[Exception]], exc_value: Optional[Exception], exc_tb: Optional[types.TracebackType]) -> None: self._store = None @property def store(self) -> metadata_store.MetadataStore: """Returns underlying MetadataStore. Raises: RuntimeError: if this instance is not in enter state. """ if self._store is None: raise RuntimeError('Metadata object is not in enter state') return self._store def _prepare_artifact_type( self, artifact_type: metadata_store_pb2.ArtifactType ) -> metadata_store_pb2.ArtifactType: if artifact_type.id: return artifact_type type_id = self.store.put_artifact_type( artifact_type=artifact_type, can_add_fields=True) artifact_type.id = type_id return artifact_type def update_artifact_state(self, artifact: metadata_store_pb2.Artifact, new_state: Text) -> None: """Update the state of a given artifact.""" if not artifact.id: raise ValueError('Artifact id missing for %s' % artifact) # TODO(b/146936257): unify artifact access logic by wrapping raw MLMD # artifact protos into tfx.types.Artifact objects at a lower level. if _ARTIFACT_TYPE_KEY_STATE in artifact.properties: artifact.properties[_ARTIFACT_TYPE_KEY_STATE].string_value = new_state else: artifact.custom_properties[ _ARTIFACT_TYPE_KEY_STATE].string_value = new_state self.store.put_artifacts([artifact]) def _upsert_artifacts(self, tfx_artifact_list: List[Artifact], state: Text) -> None: """Updates or inserts a list of artifacts. This call will also update original tfx artifact list to contain the artifact type info and artifact id. Args: tfx_artifact_list: A list of tfx.types.Artifact. This will be updated with MLMD artifact type info and MLMD artifact id. state: the artifact state to set. """ for raw_artifact in tfx_artifact_list: if not raw_artifact.type_id: artifact_type = self._prepare_artifact_type(raw_artifact.artifact_type) raw_artifact.set_mlmd_artifact_type(artifact_type) raw_artifact.state = state artifact_ids = self.store.put_artifacts( [x.mlmd_artifact for x in tfx_artifact_list]) for a, aid in zip(tfx_artifact_list, artifact_ids): a.id = aid def publish_artifacts(self, tfx_artifact_list: List[Artifact]) -> None: """Publishes artifacts to MLMD. This call will also update original tfx artifact list to contain the artifact type info and artifact id. Args: tfx_artifact_list: A list of tfx.types.Artifact which will be updated """ self._upsert_artifacts(tfx_artifact_list, ArtifactState.PUBLISHED) def get_artifacts_by_uri(self, uri: Text) -> List[metadata_store_pb2.Artifact]: """Fetches artifacts given uri.""" return self.store.get_artifacts_by_uri(uri) def get_artifacts_by_type( self, type_name: Text) -> List[metadata_store_pb2.Artifact]: """Fetches artifacts given artifact type name.""" return self.store.get_artifacts_by_type(type_name) # TODO(b/145751019): Remove this once migrated to use MLMD built-in states. def _get_artifact_state( self, artifact: metadata_store_pb2.Artifact) -> Optional[Text]: """Gets artifact state string if available.""" if _ARTIFACT_TYPE_KEY_STATE in artifact.properties: return artifact.properties[_ARTIFACT_TYPE_KEY_STATE].string_value elif _ARTIFACT_TYPE_KEY_STATE in artifact.custom_properties: return artifact.custom_properties[_ARTIFACT_TYPE_KEY_STATE].string_value else: return None def get_published_artifacts_by_type_within_context( self, type_names: List[Text], context_id: int) -> Dict[Text, List[metadata_store_pb2.Artifact]]: """Fetches artifacts given artifact type name and context id.""" result = dict((type_name, []) for type_name in type_names) all_artifacts_in_context = self.store.get_artifacts_by_context(context_id) for type_name in type_names: try: artifact_type = self.store.get_artifact_type(type_name) if artifact_type is None: raise tf.errors.NotFoundError(None, None, 'No type found.') except tf.errors.NotFoundError: absl.logging.warning('Artifact type %s not registered' % type_name) continue result[type_name] = [ a for a in all_artifacts_in_context if a.type_id == artifact_type.id and self._get_artifact_state(a) == ArtifactState.PUBLISHED ] return result def get_qualified_artifacts( self, contexts: List[metadata_store_pb2.Context], type_name: Text, producer_component_id: Optional[Text] = None, output_key: Optional[Text] = None, ) -> List[metadata_store_service_pb2.ArtifactAndType]: """Gets qualified artifacts that have the right producer info. Args: contexts: context constraints to filter artifacts type_name: type constraint to filter artifacts producer_component_id: producer constraint to filter artifacts output_key: output key constraint to filter artifacts Returns: A list of ArtifactAndType, containing qualified artifacts. """ def _match_producer_component_id(execution, component_id): if component_id: return execution.properties[ _EXECUTION_TYPE_KEY_COMPONENT_ID].string_value == component_id else: return True def _match_output_key(event, key): if key: assert len(event.path.steps) == 2, 'Event must have two path steps.' return (event.type == metadata_store_pb2.Event.OUTPUT and event.path.steps[0].key == key) else: return event.type == metadata_store_pb2.Event.OUTPUT try: artifact_type = self.store.get_artifact_type(type_name) if not artifact_type: raise tf.errors.NotFoundError( None, None, 'No artifact type found for %s.' % type_name) except tf.errors.NotFoundError: return [] # Gets the executions that are associated with all contexts. assert contexts, 'Must have at least one context.' executions_dict = {} for context in contexts: executions = self.store.get_executions_by_context(context.id) executions_dict.update(dict((e.id, e) for e in executions)) executions_within_context = executions_dict.values() # Filters the executions to match producer component id. qualified_producer_executions = [ e.id for e in executions_within_context if _match_producer_component_id(e, producer_component_id) ] # Gets the output events that have the matched output key. qualified_output_events = [ ev for ev in self.store.get_events_by_execution_ids( qualified_producer_executions) if _match_output_key(ev, output_key) ] # Gets the candidate artifacts from output events. candidate_artifacts = self.store.get_artifacts_by_id( list(set(ev.artifact_id for ev in qualified_output_events))) # Filters the artifacts that have the right artifact type and state. qualified_artifacts = [ a for a in candidate_artifacts if a.type_id == artifact_type.id and self._get_artifact_state(a) == ArtifactState.PUBLISHED ] return [ metadata_store_service_pb2.ArtifactAndType( artifact=a, type=artifact_type) for a in qualified_artifacts ] def _prepare_event(self, event_type: metadata_store_pb2.Event.Type, execution_id: Optional[int] = None, artifact_id: Optional[int] = None, key: Optional[Text] = None, index: Optional[int] = None) -> metadata_store_pb2.Event: """Commits a single event to the repository.""" event = metadata_store_pb2.Event() event.type = event_type if execution_id: event.execution_id = execution_id if artifact_id: event.artifact_id = artifact_id if key is not None: step = event.path.steps.add() step.key = key if index is not None: step = event.path.steps.add() step.index = index return event # TODO(b/143081379): We might need to revisit schema evolution story. def _prepare_execution_type(self, type_name: Text, exec_properties: Dict[Text, Any]) -> int: """Gets execution type given execution type name and properties. Uses existing type if schema is superset of what is needed. Otherwise tries to register new execution type. Args: type_name: the name of the execution type exec_properties: the execution properties included by the execution Returns: execution type id Raises: ValueError if new execution type conflicts with existing schema in MLMD. """ try: existing_execution_type = self.store.get_execution_type(type_name) if existing_execution_type is None: raise RuntimeError('Execution type is None for %s.' % type_name) if all(k in existing_execution_type.properties for k in exec_properties.keys()): return existing_execution_type.id else: raise tf.errors.NotFoundError(None, None, 'No qualified execution type found.') except tf.errors.NotFoundError: execution_type = metadata_store_pb2.ExecutionType(name=type_name) execution_type.properties[ _EXECUTION_TYPE_KEY_STATE] = metadata_store_pb2.STRING # If exec_properties contains new entries, execution type schema will be # updated in MLMD. for k in exec_properties.keys(): assert k not in _EXECUTION_TYPE_RESERVED_KEYS, ( 'execution properties with reserved key %s') % k execution_type.properties[k] = metadata_store_pb2.STRING # TODO(ruoyu): Find a better place / solution to the checksum logic. if 'module_file' in exec_properties: execution_type.properties[ _EXECUTION_TYPE_KEY_CHECKSUM] = metadata_store_pb2.STRING execution_type.properties[ _EXECUTION_TYPE_KEY_PIPELINE_NAME] = metadata_store_pb2.STRING execution_type.properties[ _EXECUTION_TYPE_KEY_PIPELINE_ROOT] = metadata_store_pb2.STRING execution_type.properties[ _EXECUTION_TYPE_KEY_RUN_ID] = metadata_store_pb2.STRING execution_type.properties[ _EXECUTION_TYPE_KEY_COMPONENT_ID] = metadata_store_pb2.STRING try: execution_type_id = self.store.put_execution_type( execution_type=execution_type, can_add_fields=True) absl.logging.debug('Registering a new execution type with id %s.' % execution_type_id) return execution_type_id except tf.errors.AlreadyExistsError: warning_str = ( 'missing or modified key in exec_properties comparing with ' 'existing execution type with the same type name. Existing type: ' '%s, New type: %s') % (existing_execution_type, execution_type) absl.logging.warning(warning_str) raise ValueError(warning_str) def _update_execution_proto( self, execution: metadata_store_pb2.Execution, pipeline_info: Optional[data_types.PipelineInfo] = None, component_info: Optional[data_types.ComponentInfo] = None, state: Optional[Text] = None, exec_properties: Optional[Dict[Text, Any]] = None, ) -> metadata_store_pb2.Execution: """Updates the execution proto with given type and state.""" if state is not None: execution.properties[ _EXECUTION_TYPE_KEY_STATE].string_value = tf.compat.as_text(state) exec_properties = exec_properties or {} # TODO(ruoyu): Enforce a formal rule for execution schema change. for k, v in exec_properties.items(): # We always convert execution properties to unicode. execution.properties[k].string_value = tf.compat.as_text( tf.compat.as_str_any(v)) # We also need to checksum UDF file to identify different binary being # used. Do we have a better way to checksum a file than hashlib.md5? # TODO(ruoyu): Find a better place / solution to the checksum logic. # TODO(ruoyu): SHA instead of MD5. if 'module_file' in exec_properties and exec_properties[ 'module_file'] and tf.io.gfile.exists(exec_properties['module_file']): contents = file_io.read_file_to_string(exec_properties['module_file']) execution.properties['checksum_md5'].string_value = tf.compat.as_text( tf.compat.as_str_any( hashlib.md5(tf.compat.as_bytes(contents)).hexdigest())) if pipeline_info: execution.properties[ 'pipeline_name'].string_value = pipeline_info.pipeline_name execution.properties[ 'pipeline_root'].string_value = pipeline_info.pipeline_root if pipeline_info.run_id: execution.properties['run_id'].string_value = pipeline_info.run_id if component_info: execution.properties[ 'component_id'].string_value = component_info.component_id return execution def _prepare_execution( self, state: Text, exec_properties: Dict[Text, Any], pipeline_info: data_types.PipelineInfo, component_info: data_types.ComponentInfo, ) -> metadata_store_pb2.Execution: """Creates an execution proto based on the information provided.""" execution = metadata_store_pb2.Execution() execution.type_id = self._prepare_execution_type( component_info.component_type, exec_properties) self._update_execution_proto( execution=execution, pipeline_info=pipeline_info, component_info=component_info, exec_properties=exec_properties, state=state) absl.logging.debug('Prepared EXECUTION:\n %s', execution) return execution def _artifact_and_event_pairs( self, artifact_dict: Dict[Text, List[Artifact]], event_type: metadata_store_pb2.Event.Type, new_state: Optional[Text] = None, registered_artifacts_ids: Optional[Set[int]] = None ) -> List[Tuple[metadata_store_pb2.Artifact, Optional[metadata_store_pb2.Event]]]: """Creates a list of [Artifact, [Optional]Event] tuples. The result of this function will be used in a MLMD put_execution() call. The artifacts will be linked to certain contexts. If an artifact is attached with an event, it will be linked with the execution through the event created. When the id of an artifact is in the registered_artifacts_ids, no event is attached to it. Otherwise, an event with given type will be attached to the artifact. Args: artifact_dict: the source of artifacts to work on. For each artifact in the dict, creates a tuple for that event_type: the event type of the event to be attached to the artifact new_state: new state of the artifacts registered_artifacts_ids: artifact ids to bypass event creation since they are regarded already registered Returns: A list of [Artifact, [Optional]Event] tuples """ registered_artifacts_ids = registered_artifacts_ids or {} result = [] for key, a_list in artifact_dict.items(): for index, a in enumerate(a_list): if new_state: a.state = new_state if a.id and a.id in registered_artifacts_ids: result.append(tuple([a.mlmd_artifact])) else: a.set_mlmd_artifact_type(self._prepare_artifact_type(a.artifact_type)) result.append( (a.mlmd_artifact, self._prepare_event(event_type=event_type, key=key, index=index))) return result def update_execution( self, execution: metadata_store_pb2.Execution, component_info: data_types.ComponentInfo, input_artifacts: Optional[Dict[Text, List[Artifact]]] = None, output_artifacts: Optional[Dict[Text, List[Artifact]]] = None, exec_properties: Optional[Dict[Text, Any]] = None, execution_state: Optional[Text] = None, artifact_state: Optional[Text] = None, contexts: Optional[List[metadata_store_pb2.Context]] = None) -> None: """Updates the given execution in MLMD based on given information. All artifacts provided will be registered if not already. Registered id will be reflected inline. Args: execution: the execution to be updated. It is required that the execution passed in has an id. component_info: the information of the current running component input_artifacts: artifacts to be declared as inputs of the execution output_artifacts: artifacts to be declared as outputs of the execution exec_properties: execution properties of the execution execution_state: state the execution to be updated to artifact_state: state the artifacts to be updated to contexts: a list of contexts the execution and artifacts to be linked to Raises: RuntimeError: if the execution to be updated has no id. """ if not execution.id: raise RuntimeError('No id attached to the execution to be updated.') events = self.store.get_events_by_execution_ids([execution.id]) registered_input_artifact_ids = set( e.artifact_id for e in events if e.type == metadata_store_pb2.Event.INPUT) registered_output_artifact_ids = set( e.artifact_id for e in events if e.type == metadata_store_pb2.Event.OUTPUT) artifacts_and_events = [] if input_artifacts: artifacts_and_events.extend( self._artifact_and_event_pairs( artifact_dict=input_artifacts, event_type=metadata_store_pb2.Event.INPUT, new_state=artifact_state, registered_artifacts_ids=registered_input_artifact_ids)) if output_artifacts: artifacts_and_events.extend( self._artifact_and_event_pairs( artifact_dict=output_artifacts, event_type=metadata_store_pb2.Event.OUTPUT, new_state=artifact_state, registered_artifacts_ids=registered_output_artifact_ids)) # If execution properties change, we need to potentially update execution # schema. if exec_properties: execution.type_id = self._prepare_execution_type( component_info.component_type, exec_properties) if exec_properties or execution_state: self._update_execution_proto( execution=execution, exec_properties=exec_properties, state=execution_state, pipeline_info=component_info.pipeline_info, component_info=component_info) _, a_ids, _ = self.store.put_execution(execution, artifacts_and_events, contexts or []) for artifact_and_event, a_id in zip(artifacts_and_events, a_ids): artifact_and_event[0].id = a_id def register_execution( self, pipeline_info: data_types.PipelineInfo, component_info: data_types.ComponentInfo, contexts: List[metadata_store_pb2.Context], exec_properties: Optional[Dict[Text, Any]] = None, input_artifacts: Optional[Dict[Text, List[Artifact]]] = None ) -> metadata_store_pb2.Execution: """Registers a new execution in metadata. Args: pipeline_info: optional pipeline info of the execution. component_info: optional component info of the execution. contexts: contexts for current run, all contexts will be linked to the execution. In addition, a component run context will be added to the contexts list. exec_properties: the execution properties of the execution. input_artifacts: input artifacts of the execution. Returns: execution id of the new execution. """ input_artifacts = input_artifacts or {} exec_properties = exec_properties or {} execution = self._prepare_execution(EXECUTION_STATE_NEW, exec_properties, pipeline_info, component_info) artifacts_and_events = self._artifact_and_event_pairs( artifact_dict=input_artifacts, event_type=metadata_store_pb2.Event.INPUT) component_run_context = self._prepare_context( context_type_name=_CONTEXT_TYPE_COMPONENT_RUN, context_name=component_info.component_run_context_name, properties={ _CONTEXT_TYPE_KEY_PIPELINE_NAME: pipeline_info.pipeline_name, _CONTEXT_TYPE_KEY_RUN_ID: pipeline_info.run_id, _CONTEXT_TYPE_KEY_COMPONENT_ID: component_info.component_id }) # Tries to register the execution along with a component run context. If the # context already exists, reuse the context and update the existing # execution. try: execution_id, a_ids, context_ids = self.store.put_execution( execution=execution, artifact_and_events=artifacts_and_events, contexts=contexts + [component_run_context]) execution.id = execution_id component_run_context.id = context_ids[-1] except tf.errors.AlreadyExistsError: component_run_context = self.get_component_run_context(component_info) absl.logging.debug( 'Component run context already exists. Reusing the context %s.', component_run_context.name) [previous_execution] = self.store.get_executions_by_context( context_id=component_run_context.id) execution.id = previous_execution.id _, a_ids, _ = self.store.put_execution( execution=execution, artifact_and_events=artifacts_and_events, contexts=contexts + [component_run_context]) contexts.append(component_run_context) for artifact_and_event, a_id in zip(artifacts_and_events, a_ids): artifact_and_event[0].id = a_id return execution def publish_execution( self, component_info: data_types.ComponentInfo, output_artifacts: Optional[Dict[Text, List[Artifact]]] = None, exec_properties: Optional[Dict[Text, Any]] = None) -> None: """Publishes an execution with input and output artifacts info. This method will publish any execution with non-final states. It will register unseen artifacts and publish events for them. Args: component_info: component information. output_artifacts: output artifacts produced by the execution. exec_properties: execution properties for the execution to be published. """ component_run_context = self.get_component_run_context(component_info) [execution] = self.store.get_executions_by_context(component_run_context.id) contexts = [ component_run_context, self.get_pipeline_run_context(component_info.pipeline_info), self.get_pipeline_context(component_info.pipeline_info) ] contexts = [ctx for ctx in contexts if ctx is not None] # If execution state is already in final state, skips publishing. if execution.properties[ _EXECUTION_TYPE_KEY_STATE].string_value in FINAL_EXECUTION_STATES: return self.update_execution( execution=execution, component_info=component_info, output_artifacts=output_artifacts, exec_properties=exec_properties, execution_state=EXECUTION_STATE_COMPLETE, artifact_state=ArtifactState.PUBLISHED, contexts=contexts) def _is_eligible_previous_execution( self, current_execution: metadata_store_pb2.Execution, target_execution: metadata_store_pb2.Execution) -> bool: """Compare if the previous execution is same as current execution. This method will ignore ID and time related fields. Args: current_execution: the current execution. target_execution: the previous execution to be compared with. Returns: whether the previous and current executions are the same. """ current_execution.properties['run_id'].string_value = '' target_execution.properties['run_id'].string_value = '' current_execution.id = target_execution.id # Skip comparing time sensitive fields. # The execution might not have the create_time_since_epoch or # create_time_since_epoch field if the execution is created by an old # version before this field is introduced. if hasattr(current_execution, 'create_time_since_epoch'): current_execution.ClearField('create_time_since_epoch') if hasattr(target_execution, 'create_time_since_epoch'): target_execution.ClearField('create_time_since_epoch') if hasattr(current_execution, 'last_update_time_since_epoch'): current_execution.ClearField('last_update_time_since_epoch') if hasattr(target_execution, 'last_update_time_since_epoch'): target_execution.ClearField('last_update_time_since_epoch') return current_execution == target_execution def get_cached_outputs( self, input_artifacts: Dict[Text, List[Artifact]], exec_properties: Dict[Text, Any], pipeline_info: data_types.PipelineInfo, component_info: data_types.ComponentInfo ) -> Optional[Dict[Text, List[Artifact]]]: """Fetches cached output artifacts if any. Returns the output artifacts of a cached execution if any. An eligible cached execution should take the same input artifacts, execution properties and is associated with the same pipeline context. Args: input_artifacts: inputs used by the run. exec_properties: execution properties used by the run. pipeline_info: info of the current pipeline run. component_info: info of the current component. Returns: Dict of cached output artifacts if eligible cached execution is found. Otherwise, return None. """ absl.logging.debug( ('Trying to fetch cached output artifacts with the following info: \n' 'input_artifacts: %s \n' 'exec_properties: %s \n' 'component_info %s') % (input_artifacts, exec_properties, component_info)) # Step 0: Finds the context of the pipeline. No context means no valid cache # results. context = self.get_pipeline_context(pipeline_info) if context is None: absl.logging.warning('Pipeline context not available for %s' % pipeline_info) return None # Step 1: Finds historical executions related to the context in step 0. historical_executions = dict( (e.id, e) for e in self._store.get_executions_by_context(context.id)) # Step 2: Filters historical executions to find those that used all the # given inputs as input artifacts. The result of this step is a set of # reversely sorted execution ids. input_ids = collections.defaultdict(set) for key, input_list in input_artifacts.items(): for single_input in input_list: input_ids[key].add(single_input.mlmd_artifact.id) artifact_to_executions = collections.defaultdict(set) for event in self.store.get_events_by_artifact_ids( list(set(itertools.chain.from_iterable(input_ids.values())))): if event.type == metadata_store_pb2.Event.INPUT: artifact_to_executions[event.artifact_id].add(event.execution_id) common_execution_ids = sorted( set.intersection( set(historical_executions.keys()), *(artifact_to_executions.values())), reverse=True) # Step 3: Filters candidate executions further based on the followings: # - Shares the given properties # - Is in complete state # The maximum number of candidates is capped by MAX_EXECUTIONS_FOR_CACHE. expected_previous_execution = self._prepare_execution( EXECUTION_STATE_COMPLETE, exec_properties, pipeline_info=pipeline_info, component_info=component_info) candidate_execution_ids = [ e_id for e_id in common_execution_ids # pylint: disable=g-complex-comprehension if self._is_eligible_previous_execution( copy.deepcopy(expected_previous_execution), copy.deepcopy(historical_executions[e_id])) ] candidate_execution_ids = candidate_execution_ids[ 0:min(len(candidate_execution_ids), MAX_EXECUTIONS_FOR_CACHE)] # Step 4: Traverse all candidates, if the input artifacts of a candidate # match given input artifacts, return the output artifacts of that execution # as result. Note that this is necessary since a candidate execution might # use more than the given artifacts. candidate_execution_to_events = collections.defaultdict(list) for event in self.store.get_events_by_execution_ids( candidate_execution_ids): candidate_execution_to_events[event.execution_id].append(event) for execution_id, events in candidate_execution_to_events.items(): # Creates the {key -> artifact id set} for the candidate execution. current_input_ids = collections.defaultdict(set) for event in events: if event.type == metadata_store_pb2.Event.INPUT: current_input_ids[event.path.steps[0].key].add(event.artifact_id) # If all inputs match, tries to get the outputs of the execution and uses # as the cached outputs of the current execution. if current_input_ids == input_ids: cached_outputs = self._get_outputs_of_execution( execution_id=execution_id, events=events) if cached_outputs is not None: return cached_outputs return None def _get_outputs_of_execution( self, execution_id: int, events: List[metadata_store_pb2.Event] ) -> Optional[Dict[Text, List[Artifact]]]: """Fetches outputs produced by a historical execution. Args: execution_id: the id of the execution that produced the outputs. events: events related to the execution id. Returns: A dict of key -> List[Artifact] as the result """ absl.logging.debug('Execution %s matches all inputs' % execution_id) result = collections.defaultdict(list) output_events = [ event for event in events if event.type in [metadata_store_pb2.Event.OUTPUT] ] output_events.sort(key=lambda e: e.path.steps[1].index) cached_output_artifacts = self.store.get_artifacts_by_id( [e.artifact_id for e in output_events]) artifact_types = self.store.get_artifact_types_by_id( [a.type_id for a in cached_output_artifacts]) for event, mlmd_artifact, artifact_type in zip(output_events, cached_output_artifacts, artifact_types): key = event.path.steps[0].key tfx_artifact = artifact_utils.deserialize_artifact( artifact_type, mlmd_artifact) result[key].append(tfx_artifact) return result def search_artifacts(self, artifact_name: Text, pipeline_info: data_types.PipelineInfo, producer_component_id: Text) -> List[Artifact]: """Search artifacts that matches given info. Args: artifact_name: the name of the artifact that set by producer component. The name is logged both in artifacts and the events when the execution being published. pipeline_info: the information of the current pipeline producer_component_id: the id of the component that produces the artifact Returns: A list of Artifacts that matches the given info Raises: RuntimeError: when no matching execution is found given producer info. """ producer_execution = None matching_artifact_ids = set() # TODO(ruoyu): We need to revisit this when adding support for async # execution. context = self.get_pipeline_run_context(pipeline_info) if context is None: raise RuntimeError('Pipeline run context for %s does not exist' % pipeline_info) for execution in self.store.get_executions_by_context(context.id): if execution.properties[ 'component_id'].string_value == producer_component_id: producer_execution = execution break if not producer_execution: raise RuntimeError('Cannot find matching execution with pipeline name %s,' 'run id %s and component id %s' % (pipeline_info.pipeline_name, pipeline_info.run_id, producer_component_id)) for event in self.store.get_events_by_execution_ids([producer_execution.id ]): if (event.type == metadata_store_pb2.Event.OUTPUT and event.path.steps[0].key == artifact_name): matching_artifact_ids.add(event.artifact_id) # Get relevant artifacts along with their types. artifacts_by_id = self.store.get_artifacts_by_id( list(matching_artifact_ids)) matching_artifact_type_ids = list(set(a.type_id for a in artifacts_by_id)) matching_artifact_types = self.store.get_artifact_types_by_id( matching_artifact_type_ids) artifact_types = dict( zip(matching_artifact_type_ids, matching_artifact_types)) result_artifacts = [] for a in artifacts_by_id: tfx_artifact = artifact_utils.deserialize_artifact( artifact_types[a.type_id], a) result_artifacts.append(tfx_artifact) return result_artifacts def _register_context_type_if_not_exist( self, context_type_name: Text, properties: Dict[Text, 'metadata_store_pb2.PropertyType']) -> int: """Registers a context type if not exist, otherwise returns existing one. Args: context_type_name: the name of the context. properties: properties of the context. Returns: id of the desired context type. """ context_type = metadata_store_pb2.ContextType(name=context_type_name) for k, t in properties.items(): context_type.properties[k] = t context_type_id = self.store.put_context_type( context_type, can_add_fields=True) return context_type_id def _prepare_context( self, context_type_name: Text, context_name: Text, properties: Optional[Dict[Text, Union[int, float, Text]]] = None ) -> metadata_store_pb2.Context: """Prepares a context proto.""" # TODO(ruoyu): Centralize the type definition / mapping along with Artifact # property types. properties = properties or {} property_type_mapping = { int: metadata_store_pb2.INT, six.binary_type: metadata_store_pb2.STRING, six.text_type: metadata_store_pb2.STRING, float: metadata_store_pb2.DOUBLE } context_type_id = self._register_context_type_if_not_exist( context_type_name, dict( (k, property_type_mapping[type(v)]) for k, v in properties.items())) context = metadata_store_pb2.Context( type_id=context_type_id, name=context_name) for k, v in properties.items(): if isinstance(v, int): context.properties[k].int_value = v elif isinstance(v, six.string_types): context.properties[k].string_value = v elif isinstance(v, float): context.properties[k].double_value = v else: raise RuntimeError('Unexpected property type: %s' % type(v)) return context def _register_context_if_not_exist( self, context_type_name: Text, context_name: Text, properties: Dict[Text, Union[int, float, Text]] ) -> metadata_store_pb2.Context: """Registers a context if not exist, otherwise returns the existing one. Args: context_type_name: the name of the context type desired. context_name: the name of the context. properties: properties to set in the context. Returns: id of the desired context Raises: RuntimeError: when meeting unexpected property type. """ context = self._prepare_context( context_type_name=context_type_name, context_name=context_name, properties=properties) try: [context_id] = self.store.put_contexts([context]) context.id = context_id except tf.errors.AlreadyExistsError: absl.logging.debug('Run context %s already exists.', context_name) context = self.store.get_context_by_type_and_name(context_type_name, context_name) assert context is not None, 'Run context is missing for %s.' % ( context_name) absl.logging.debug('ID of run context %s is %s.', context_name, context.id) return context def get_component_run_context( self, component_info: data_types.ComponentInfo ) -> Optional[metadata_store_pb2.Context]: """Gets the context for the component run. Args: component_info: component information for the current component run. Returns: a matched context or None """ return self.store.get_context_by_type_and_name( _CONTEXT_TYPE_COMPONENT_RUN, component_info.component_run_context_name) def get_pipeline_context( self, pipeline_info: data_types.PipelineInfo ) -> Optional[metadata_store_pb2.Context]: """Gets the context for the pipeline run. Args: pipeline_info: pipeline information for the current pipeline run. Returns: a matched context or None """ return self.store.get_context_by_type_and_name( _CONTEXT_TYPE_PIPELINE, pipeline_info.pipeline_context_name) def get_pipeline_run_context( self, pipeline_info: data_types.PipelineInfo ) -> Optional[metadata_store_pb2.Context]: """Gets the context for the pipeline run. Args: pipeline_info: pipeline information for the current pipeline run. Returns: a matched context or None """ if pipeline_info.run_id: return self.store.get_context_by_type_and_name( _CONTEXT_TYPE_PIPELINE_RUN, pipeline_info.pipeline_run_context_name) else: return None def register_pipeline_contexts_if_not_exists( self, pipeline_info: data_types.PipelineInfo, ) -> List[metadata_store_pb2.Context]: """Creates or fetches the pipeline contexts needed for the run. There are two potential contexts: - Context for the pipeline. - Context for the current pipeline run. This is optional, only available when run_id is specified. Args: pipeline_info: pipeline information for current run. Returns: a list (of size one or two) of context. """ # Gets the pipeline level context. result = [] pipeline_context = self._register_context_if_not_exist( context_type_name=_CONTEXT_TYPE_PIPELINE, context_name=pipeline_info.pipeline_context_name, properties={ _CONTEXT_TYPE_KEY_PIPELINE_NAME: pipeline_info.pipeline_name }) result.append(pipeline_context) absl.logging.debug('Pipeline context [%s : %s]', pipeline_info.pipeline_context_name, pipeline_context.id) # If run id exists, gets the pipeline run level context. if pipeline_info.run_id: pipeline_run_context = self._register_context_if_not_exist( context_type_name=_CONTEXT_TYPE_PIPELINE_RUN, context_name=pipeline_info.pipeline_run_context_name, properties={ _CONTEXT_TYPE_KEY_PIPELINE_NAME: pipeline_info.pipeline_name, _CONTEXT_TYPE_KEY_RUN_ID: pipeline_info.run_id }) result.append(pipeline_run_context) absl.logging.debug('Pipeline run context [%s : %s]', pipeline_info.pipeline_run_context_name, pipeline_run_context.id) return result
import React from "react"; import { inject, observer } from "mobx-react"; import { TELEOP_WS } from "store/websocket"; import AudioControl from "components/TeleopMonitor/AudioControl"; import MonitorSection from "components/TeleopMonitor/MonitorSection"; import itemIcon from "assets/images/icons/teleop_item.png"; @inject("store") @observer export default class CarTeleOp extends React.Component { componentDidMount() { TELEOP_WS.initialize(); } componentWillUnmount() { TELEOP_WS.close(); } render() { const { teleop } = this.props.store; return ( <div className="monitor teleop"> <div className="monitor-header"> <div className="title">Car Teleop Controls</div> </div> <div className="monitor-content"> <AudioControl id='car' audioEnabled={teleop.audioEnabled} micEnabled={teleop.micEnabled} toggleAudio={() => { TELEOP_WS.executeCommand('ToggleAudio'); teleop.toggleAudio(); }} toggleMic={() => { teleop.toggleMic(); TELEOP_WS.executeCommand('ToggleMic'); }} /> <MonitorSection title="Signal" icon={itemIcon}> {teleop.modemInfo.entries().map(([name, value]) => ( <div className="section-content-row" key={name}> <span className="field">{name}</span> <span className="field">{value}</span> </div> )) } </MonitorSection> </div> </div > ); } }
$(function () { function t(t) { var e = 0; return $(t).each(function () { e += $(this).outerWidth(!0) }), e } function e(e) { var a = t($(e).prevAll()), i = t($(e).nextAll()), n = t($(".content-tabs").children().not(".J_menuTabs")), s = $(".content-tabs").outerWidth(!0) - n, r = 0; if ($(".page-tabs-content").outerWidth() < s) r = 0; else if (i <= s - $(e).outerWidth(!0) - $(e).next().outerWidth(!0)) { if (s - $(e).next().outerWidth(!0) > i) { r = a; for (var o = e; r - $(o).outerWidth() > $(".page-tabs-content").outerWidth() - s;) r -= $(o).prev().outerWidth(), o = $(o).prev() } } else a > s - $(e).outerWidth(!0) - $(e).prev().outerWidth(!0) && (r = a - $(e).prev().outerWidth(!0)); $(".page-tabs-content").animate({ marginLeft: 0 - r + "px" }, "fast") } function a() { var e = Math.abs(parseInt($(".page-tabs-content").css("margin-left"))), a = t($(".content-tabs").children().not(".J_menuTabs")), i = $(".content-tabs").outerWidth(!0) - a, n = 0; if ($(".page-tabs-content").width() < i) return !1; for (var s = $(".J_menuTab:first"), r = 0; r + $(s).outerWidth(!0) <= e;) r += $(s).outerWidth(!0), s = $(s).next(); if (r = 0, t($(s).prevAll()) > i) { for (; r + $(s).outerWidth(!0) < i && s.length > 0;) r += $(s).outerWidth(!0), s = $(s).prev(); n = t($(s).prevAll()) } $(".page-tabs-content").animate({ marginLeft: 0 - n + "px" }, "fast") } function i() { var e = Math.abs(parseInt($(".page-tabs-content").css("margin-left"))), a = t($(".content-tabs").children().not(".J_menuTabs")), i = $(".content-tabs").outerWidth(!0) - a, n = 0; if ($(".page-tabs-content").width() < i) return !1; for (var s = $(".J_menuTab:first"), r = 0; r + $(s).outerWidth(!0) <= e;) r += $(s).outerWidth(!0), s = $(s).next(); for (r = 0; r + $(s).outerWidth(!0) < i && s.length > 0;) r += $(s).outerWidth(!0), s = $(s).next(); n = t($(s).prevAll()), n > 0 && $(".page-tabs-content").animate({ marginLeft: 0 - n + "px" }, "fast") } function n() { var t = $(this).attr("href"), a = $(this).data("index"), i = $.trim($(this).text()), n = !0; if (void 0 == t || 0 == $.trim(t).length) return !1; if ($(".J_menuTab").each(function () { return $(this).data("id") == t ? ($(this).hasClass("active") || ($(this).addClass("active").siblings(".J_menuTab").removeClass("active"),$("#iframe"+a).attr('src', $("#iframe"+a).attr('src')) , e(this), $(".J_mainContent .J_iframe").each(function () { return $(this).data("id") == t ? ($(this).show().siblings(".J_iframe").hide(), !1) : void 0 })), n = !1, !1) : void 0 }), n) { var s = '<a href="javascript:;" class="active J_menuTab" data-id="' + t + '">' + i + ' <i class="fa fa-times-circle"></i></a>'; $(".J_menuTab").removeClass("active"); var r = '<iframe class="J_iframe" id="iframe'+a+'" name="iframe' + a + '" width="100%" height="100%" src="' + t + '?v=4.0" frameborder="0" data-id="' + t + '" seamless></iframe>'; $(".J_mainContent").find("iframe.J_iframe").hide().parents(".J_mainContent").append(r); var o = layer.load(); $(".J_mainContent iframe:visible").load(function () { layer.close(o) }), $(".J_menuTabs .page-tabs-content").append(s), e($(".J_menuTab.active")) } return !1 } function s() { var t = $(this).parents(".J_menuTab").data("id"), a = $(this).parents(".J_menuTab").width(); if ($(this).parents(".J_menuTab").hasClass("active")) { if ($(this).parents(".J_menuTab").next(".J_menuTab").size()) { var i = $(this).parents(".J_menuTab").next(".J_menuTab:eq(0)").data("id"); $(this).parents(".J_menuTab").next(".J_menuTab:eq(0)").addClass("active"), $(".J_mainContent .J_iframe").each(function () { return $(this).data("id") == i ? ($(this).show().siblings(".J_iframe").hide(), !1) : void 0 }); var n = parseInt($(".page-tabs-content").css("margin-left")); 0 > n && $(".page-tabs-content").animate({ marginLeft: n + a + "px" }, "fast"), $(this).parents(".J_menuTab").remove(), $(".J_mainContent .J_iframe").each(function () { return $(this).data("id") == t ? ($(this).remove(), !1) : void 0 }) } if ($(this).parents(".J_menuTab").prev(".J_menuTab").size()) { var i = $(this).parents(".J_menuTab").prev(".J_menuTab:last").data("id"); $(this).parents(".J_menuTab").prev(".J_menuTab:last").addClass("active"), $(".J_mainContent .J_iframe").each(function () { return $(this).data("id") == i ? ($(this).show().siblings(".J_iframe").hide(), !1) : void 0 }), $(this).parents(".J_menuTab").remove(), $(".J_mainContent .J_iframe").each(function () { return $(this).data("id") == t ? ($(this).remove(), !1) : void 0 }) } } else $(this).parents(".J_menuTab").remove(), $(".J_mainContent .J_iframe").each(function () { return $(this).data("id") == t ? ($(this).remove(), !1) : void 0 }), e($(".J_menuTab.active")); return !1 } function r() { $(".page-tabs-content").children("[data-id]").not(":first").not(".active").each(function () { $('.J_iframe[data-id="' + $(this).data("id") + '"]').remove(), $(this).remove() }), $(".page-tabs-content").css("margin-left", "0") } function o() { e($(".J_menuTab.active")) } function d() { if (!$(this).hasClass("active")) { var t = $(this).data("id"); $(".J_mainContent .J_iframe").each(function () { return $(this).data("id") == t ? ($(this).show().siblings(".J_iframe").hide(), $(this).attr('src', $(this).attr('src')),!1) : void 0 }), $(this).addClass("active").siblings(".J_menuTab").removeClass("active"), e(this) } } function c() { var t = $('.J_iframe[data-id="' + $(this).data("id") + '"]'), e = t.attr("src"), a = layer.load(); t.attr("src", e).load(function () { layer.close(a) }) } $(".J_menuItem").each(function (t) { $(this).attr("data-index") || $(this).attr("data-index", t) }), $(".J_menuItem").on("click", n), $(".J_menuTabs").on("click", ".J_menuTab i", s), $(".J_tabCloseOther").on("click", r), $(".J_tabShowActive").on("click", o), $(".J_menuTabs").on("click", ".J_menuTab", d), $(".J_menuTabs").on("dblclick", ".J_menuTab", c), $(".J_tabLeft").on("click", a), $(".J_tabRight").on("click", i), $(".J_tabCloseAll").on("click", function () { $(".page-tabs-content").children("[data-id]").not(":first").each(function () { $('.J_iframe[data-id="' + $(this).data("id") + '"]').remove(), $(this).remove() }), $(".page-tabs-content").children("[data-id]:first").each(function () { $('.J_iframe[data-id="' + $(this).data("id") + '"]').show(), $(this).addClass("active") }), $(".page-tabs-content").css("margin-left", "0") }) });
#!/usr/bin/python3 from amazonia.classes.block_devices import Bdm from amazonia.classes.block_devices_config import BlockDevicesConfig from nose.tools import * def test_block_device_mappings(): title = 'StackAsg' block_devices_config = [ BlockDevicesConfig(device_name='/dev/xvda', ebs_volume_size='15', ebs_volume_type='gp2', ebs_encrypted=False, ebs_snapshot_id=None, virtual_name=False), BlockDevicesConfig(device_name='/dev/xvda2', ebs_volume_size='15', ebs_volume_type='gp2', ebs_encrypted=False, ebs_snapshot_id='snapshot_123', virtual_name=False), BlockDevicesConfig(device_name='/dev/sda1', ebs_volume_size=None, ebs_volume_type=None, ebs_encrypted=True, ebs_snapshot_id=None, virtual_name=True), BlockDevicesConfig(device_name='/dev/sda2', ebs_volume_size='15', ebs_volume_type='gp2', ebs_encrypted=False, ebs_snapshot_id=None, virtual_name=False) ] test_bdm = Bdm(title, block_devices_config) assert_equals(type(test_bdm), Bdm)
import { swap, compare } from './array-operations'; export default (array, actions) => { actions.beginSorting(); let swapped = false; do { swapped = false; for (let i = 1; i < array.length; i++) { if (compare(array, i - 1, i, actions.compare) > 0) { swap(array, i - 1, i, actions.swap); swapped = true; } } } while (swapped); actions.endSorting(); }; export const Info = { id: 'BubbleSort', name: 'Bubble Sort', description: 'Bubble sort, sometimes referred to as sinking sort, ' + 'is a simple sorting algorithm that repeatedly steps through ' + 'the list to be sorted, compares each pair of adjacent items ' + 'and swaps them if they are in the wrong order. The pass through ' + 'the list is repeated until no swaps are needed, which indicates ' + 'that the list is sorted.', link: 'https://en.wikipedia.org/wiki/Bubble_sort', linkSource: 'Wikipedia', pseudocode: '' + `function bubbleSort(array) { let swapped; do { swapped = false; for (let i = 1; i < array.length; i++) { if (array[i - 1] > array[i]) { swap(array[i - 1], array[i]); swapped = true; } } } while (swapped); }` };
/** * Framework7 6.0.11 * Full featured mobile HTML framework for building iOS & Android apps * https://framework7.io/ * * Copyright 2014-2021 Vladimir Kharlampidi * * Released under the MIT License * * Released on: February 24, 2021 */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Framework7=t()}(this,(function(){"use strict";function e(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function t(r,a){void 0===r&&(r={}),void 0===a&&(a={}),Object.keys(a).forEach((function(n){void 0===r[n]?r[n]=a[n]:e(a[n])&&e(r[n])&&Object.keys(a[n]).length>0&&t(r[n],a[n])}))}var r={body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},createElementNS:function(){return{}},importNode:function(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function a(){var e="undefined"!=typeof document?document:{};return t(e,r),e}var n={document:r,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState:function(){},pushState:function(){},go:function(){},back:function(){}},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){},matchMedia:function(){return{}},requestAnimationFrame:function(e){return"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0)},cancelAnimationFrame:function(e){"undefined"!=typeof setTimeout&&clearTimeout(e)}};function o(){var e="undefined"!=typeof window?window:{};return t(e,n),e}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function u(e,t,r){return(u=l()?Reflect.construct:function(e,t,r){var a=[null];a.push.apply(a,t);var n=new(Function.bind.apply(e,a));return r&&s(n,r.prototype),n}).apply(null,arguments)}function c(e){var t="function"==typeof Map?new Map:void 0;return(c=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return u(e,arguments,i(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),s(a,e)})(e)}var p=function(e){var t,r;function a(t){var r,a,n;return r=e.call.apply(e,[this].concat(t))||this,a=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r),n=a.__proto__,Object.defineProperty(a,"__proto__",{get:function(){return n},set:function(e){n.__proto__=e}}),r}return r=e,(t=a).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,a}(c(Array));function f(e){void 0===e&&(e=[]);var t=[];return e.forEach((function(e){Array.isArray(e)?t.push.apply(t,f(e)):t.push(e)})),t}function d(e,t){return Array.prototype.filter.call(e,t)}function h(e,t){var r=o(),n=a(),i=[];if(!t&&e instanceof p)return e;if(!e)return new p(i);if("string"==typeof e){var s=e.trim();if(s.indexOf("<")>=0&&s.indexOf(">")>=0){var l="div";0===s.indexOf("<li")&&(l="ul"),0===s.indexOf("<tr")&&(l="tbody"),0!==s.indexOf("<td")&&0!==s.indexOf("<th")||(l="tr"),0===s.indexOf("<tbody")&&(l="table"),0===s.indexOf("<option")&&(l="select");var u=n.createElement(l);u.innerHTML=s;for(var c=0;c<u.childNodes.length;c+=1)i.push(u.childNodes[c])}else i=function(e,t){if("string"!=typeof e)return[e];for(var r=[],a=t.querySelectorAll(e),n=0;n<a.length;n+=1)r.push(a[n]);return r}(e.trim(),t||n)}else if(e.nodeType||e===r||e===n)i.push(e);else if(Array.isArray(e)){if(e instanceof p)return e;i=e}return new p(function(e){for(var t=[],r=0;r<e.length;r+=1)-1===t.indexOf(e[r])&&t.push(e[r]);return t}(i))}h.fn=p.prototype;var v="resize scroll".split(" ");function m(e){return function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];if(void 0===r[0]){for(var n=0;n<this.length;n+=1)v.indexOf(e)<0&&(e in this[n]?this[n][e]():h(this[n]).trigger(e));return this}return this.on.apply(this,[e].concat(r))}}var g=m("click"),b=m("blur"),y=m("focus"),w=m("focusin"),C=m("focusout"),k=m("keyup"),E=m("keydown"),x=m("keypress"),P=m("submit"),O=m("change"),R=m("mousedown"),T=m("mousemove"),S=m("mouseup"),A=m("mouseenter"),$=m("mouseleave"),L=m("mouseout"),M=m("mouseover"),N=m("touchstart"),B=m("touchend"),_=m("touchmove"),H=m("resize"),D=m("scroll"),j=Object.freeze({__proto__:null,default:h,$:h,add:function(){for(var e,t,r=this,a=arguments.length,n=new Array(a),o=0;o<a;o++)n[o]=arguments[o];for(e=0;e<n.length;e+=1){var i=h(n[e]);for(t=0;t<i.length;t+=1)r.push(i[t])}return r},addClass:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=f(t.map((function(e){return e.split(" ")})));return this.forEach((function(e){var t;(t=e.classList).add.apply(t,a)})),this},animate:function(e,t){var r,a=o(),n=this,i={props:Object.assign({},e),params:Object.assign({duration:300,easing:"swing"},t),elements:n,animating:!1,que:[],easingProgress:function(e,t){return"swing"===e?.5-Math.cos(t*Math.PI)/2:"function"==typeof e?e(t):t},stop:function(){i.frameId&&a.cancelAnimationFrame(i.frameId),i.animating=!1,i.elements.each((function(e){delete e.dom7AnimateInstance})),i.que=[]},done:function(e){if(i.animating=!1,i.elements.each((function(e){delete e.dom7AnimateInstance})),e&&e(n),i.que.length>0){var t=i.que.shift();i.animate(t[0],t[1])}},animate:function(e,t){if(i.animating)return i.que.push([e,t]),i;var r=[];i.elements.each((function(t,n){var o,s,l,u,c;t.dom7AnimateInstance||(i.elements[n].dom7AnimateInstance=i),r[n]={container:t},Object.keys(e).forEach((function(i){o=a.getComputedStyle(t,null).getPropertyValue(i).replace(",","."),s=parseFloat(o),l=o.replace(s,""),u=parseFloat(e[i]),c=e[i]+l,r[n][i]={initialFullValue:o,initialValue:s,unit:l,finalValue:u,finalFullValue:c,currentValue:s}}))}));var o,s,l=null,u=0,c=0,p=!1;return i.animating=!0,i.frameId=a.requestAnimationFrame((function f(){var d,h;o=(new Date).getTime(),p||(p=!0,t.begin&&t.begin(n)),null===l&&(l=o),t.progress&&t.progress(n,Math.max(Math.min((o-l)/t.duration,1),0),l+t.duration-o<0?0:l+t.duration-o,l),r.forEach((function(a){var n=a;s||n.done||Object.keys(e).forEach((function(a){if(!s&&!n.done){d=Math.max(Math.min((o-l)/t.duration,1),0),h=i.easingProgress(t.easing,d);var p=n[a],f=p.initialValue,v=p.finalValue,m=p.unit;n[a].currentValue=f+h*(v-f);var g=n[a].currentValue;(v>f&&g>=v||v<f&&g<=v)&&(n.container.style[a]=v+m,(c+=1)===Object.keys(e).length&&(n.done=!0,u+=1),u===r.length&&(s=!0)),s?i.done(t.complete):n.container.style[a]=g+m}}))})),s||(i.frameId=a.requestAnimationFrame(f))})),i}};if(0===i.elements.length)return n;for(var s=0;s<i.elements.length;s+=1)i.elements[s].dom7AnimateInstance?r=i.elements[s].dom7AnimateInstance:i.elements[s].dom7AnimateInstance=i;return r||(r=i),"stop"===e?r.stop():r.animate(i.props,i.params),n},animationEnd:function(e){var t=this;return e&&t.on("animationend",(function r(a){a.target===this&&(e.call(this,a),t.off("animationend",r))})),this},append:function(){for(var e,t=a(),r=0;r<arguments.length;r+=1){e=r<0||arguments.length<=r?void 0:arguments[r];for(var n=0;n<this.length;n+=1)if("string"==typeof e){var o=t.createElement("div");for(o.innerHTML=e;o.firstChild;)this[n].appendChild(o.firstChild)}else if(e instanceof p)for(var i=0;i<e.length;i+=1)this[n].appendChild(e[i]);else this[n].appendChild(e)}return this},appendTo:function(e){return h(e).append(this),this},attr:function(e,t){if(1===arguments.length&&"string"==typeof e)return this[0]?this[0].getAttribute(e):void 0;for(var r=0;r<this.length;r+=1)if(2===arguments.length)this[r].setAttribute(e,t);else for(var a in e)this[r][a]=e[a],this[r].setAttribute(a,e[a]);return this},blur:b,change:O,children:function(e){for(var t=[],r=0;r<this.length;r+=1)for(var a=this[r].children,n=0;n<a.length;n+=1)e&&!h(a[n]).is(e)||t.push(a[n]);return h(t)},click:g,closest:function(e){var t=this;return void 0===e?h([]):(t.is(e)||(t=t.parents(e).eq(0)),t)},css:function(e,t){var r,a=o();if(1===arguments.length){if("string"!=typeof e){for(r=0;r<this.length;r+=1)for(var n in e)this[r].style[n]=e[n];return this}if(this[0])return a.getComputedStyle(this[0],null).getPropertyValue(e)}if(2===arguments.length&&"string"==typeof e){for(r=0;r<this.length;r+=1)this[r].style[e]=t;return this}return this},data:function(e,t){var r;if(void 0===t){if(!(r=this[0]))return;if(r.dom7ElementDataStorage&&e in r.dom7ElementDataStorage)return r.dom7ElementDataStorage[e];var a=r.getAttribute("data-"+e);return a||void 0}for(var n=0;n<this.length;n+=1)(r=this[n]).dom7ElementDataStorage||(r.dom7ElementDataStorage={}),r.dom7ElementDataStorage[e]=t;return this},dataset:function(){var e=this[0];if(e){var t,r={};if(e.dataset)for(var a in e.dataset)r[a]=e.dataset[a];else for(var n=0;n<e.attributes.length;n+=1){var o=e.attributes[n];o.name.indexOf("data-")>=0&&(r[(t=o.name.split("data-")[1],t.toLowerCase().replace(/-(.)/g,(function(e,t){return t.toUpperCase()})))]=o.value)}for(var i in r)"false"===r[i]?r[i]=!1:"true"===r[i]?r[i]=!0:parseFloat(r[i])===1*r[i]&&(r[i]*=1);return r}},detach:function(){return this.remove()},each:function(e){return e?(this.forEach((function(t,r){e.apply(t,[t,r])})),this):this},empty:function(){for(var e=0;e<this.length;e+=1){var t=this[e];if(1===t.nodeType){for(var r=0;r<t.childNodes.length;r+=1)t.childNodes[r].parentNode&&t.childNodes[r].parentNode.removeChild(t.childNodes[r]);t.textContent=""}}return this},eq:function(e){if(void 0===e)return this;var t=this.length;if(e>t-1)return h([]);if(e<0){var r=t+e;return h(r<0?[]:[this[r]])}return h([this[e]])},filter:function(e){return h(d(this,e))},find:function(e){for(var t=[],r=0;r<this.length;r+=1)for(var a=this[r].querySelectorAll(e),n=0;n<a.length;n+=1)t.push(a[n]);return h(t)},focus:y,focusin:w,focusout:C,hasClass:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=f(t.map((function(e){return e.split(" ")})));return d(this,(function(e){return a.filter((function(t){return e.classList.contains(t)})).length>0})).length>0},height:function(){var e=o();return this[0]===e?e.innerHeight:this.length>0?parseFloat(this.css("height")):null},hide:function(){for(var e=0;e<this.length;e+=1)this[e].style.display="none";return this},html:function(e){if(void 0===e)return this[0]?this[0].innerHTML:null;for(var t=0;t<this.length;t+=1)this[t].innerHTML=e;return this},index:function(){var e,t=this[0];if(t){for(e=0;null!==(t=t.previousSibling);)1===t.nodeType&&(e+=1);return e}},insertAfter:function(e){for(var t=h(e),r=0;r<this.length;r+=1)if(1===t.length)t[0].parentNode.insertBefore(this[r],t[0].nextSibling);else if(t.length>1)for(var a=0;a<t.length;a+=1)t[a].parentNode.insertBefore(this[r].cloneNode(!0),t[a].nextSibling)},insertBefore:function(e){for(var t=h(e),r=0;r<this.length;r+=1)if(1===t.length)t[0].parentNode.insertBefore(this[r],t[0]);else if(t.length>1)for(var a=0;a<t.length;a+=1)t[a].parentNode.insertBefore(this[r].cloneNode(!0),t[a])},is:function(e){var t,r,n=o(),i=a(),s=this[0];if(!s||void 0===e)return!1;if("string"==typeof e){if(s.matches)return s.matches(e);if(s.webkitMatchesSelector)return s.webkitMatchesSelector(e);if(s.msMatchesSelector)return s.msMatchesSelector(e);for(t=h(e),r=0;r<t.length;r+=1)if(t[r]===s)return!0;return!1}if(e===i)return s===i;if(e===n)return s===n;if(e.nodeType||e instanceof p){for(t=e.nodeType?[e]:e,r=0;r<t.length;r+=1)if(t[r]===s)return!0;return!1}return!1},keydown:E,keypress:x,keyup:k,mousedown:R,mouseenter:A,mouseleave:$,mousemove:T,mouseout:L,mouseover:M,mouseup:S,next:function(e){return this.length>0?e?this[0].nextElementSibling&&h(this[0].nextElementSibling).is(e)?h([this[0].nextElementSibling]):h([]):this[0].nextElementSibling?h([this[0].nextElementSibling]):h([]):h([])},nextAll:function(e){var t=[],r=this[0];if(!r)return h([]);for(;r.nextElementSibling;){var a=r.nextElementSibling;e?h(a).is(e)&&t.push(a):t.push(a),r=a}return h(t)},off:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=t[0],n=t[1],o=t[2],i=t[3];"function"==typeof t[1]&&(a=t[0],o=t[1],i=t[2],n=void 0),i||(i=!1);for(var s=a.split(" "),l=0;l<s.length;l+=1)for(var u=s[l],c=0;c<this.length;c+=1){var p=this[c],f=void 0;if(!n&&p.dom7Listeners?f=p.dom7Listeners[u]:n&&p.dom7LiveListeners&&(f=p.dom7LiveListeners[u]),f&&f.length)for(var d=f.length-1;d>=0;d-=1){var h=f[d];o&&h.listener===o||o&&h.listener&&h.listener.dom7proxy&&h.listener.dom7proxy===o?(p.removeEventListener(u,h.proxyListener,i),f.splice(d,1)):o||(p.removeEventListener(u,h.proxyListener,i),f.splice(d,1))}}return this},offset:function(){if(this.length>0){var e=o(),t=a(),r=this[0],n=r.getBoundingClientRect(),i=t.body,s=r.clientTop||i.clientTop||0,l=r.clientLeft||i.clientLeft||0,u=r===e?e.scrollY:r.scrollTop,c=r===e?e.scrollX:r.scrollLeft;return{top:n.top+u-s,left:n.left+c-l}}return null},on:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=t[0],n=t[1],o=t[2],i=t[3];function s(e){var t=e.target;if(t){var r=e.target.dom7EventData||[];if(r.indexOf(e)<0&&r.unshift(e),h(t).is(n))o.apply(t,r);else for(var a=h(t).parents(),i=0;i<a.length;i+=1)h(a[i]).is(n)&&o.apply(a[i],r)}}function l(e){var t=e&&e.target&&e.target.dom7EventData||[];t.indexOf(e)<0&&t.unshift(e),o.apply(this,t)}"function"==typeof t[1]&&(a=t[0],o=t[1],i=t[2],n=void 0),i||(i=!1);for(var u,c=a.split(" "),p=0;p<this.length;p+=1){var f=this[p];if(n)for(u=0;u<c.length;u+=1){var d=c[u];f.dom7LiveListeners||(f.dom7LiveListeners={}),f.dom7LiveListeners[d]||(f.dom7LiveListeners[d]=[]),f.dom7LiveListeners[d].push({listener:o,proxyListener:s}),f.addEventListener(d,s,i)}else for(u=0;u<c.length;u+=1){var v=c[u];f.dom7Listeners||(f.dom7Listeners={}),f.dom7Listeners[v]||(f.dom7Listeners[v]=[]),f.dom7Listeners[v].push({listener:o,proxyListener:l}),f.addEventListener(v,l,i)}}return this},once:function(){for(var e=this,t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];var n=r[0],o=r[1],i=r[2],s=r[3];function l(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];i.apply(this,r),e.off(n,o,l,s),l.dom7proxy&&delete l.dom7proxy}return"function"==typeof r[1]&&(n=r[0],i=r[1],s=r[2],o=void 0),l.dom7proxy=i,e.on(n,o,l,s)},outerHeight:function(e){if(this.length>0){if(e){var t=this.styles();return this[0].offsetHeight+parseFloat(t.getPropertyValue("margin-top"))+parseFloat(t.getPropertyValue("margin-bottom"))}return this[0].offsetHeight}return null},outerWidth:function(e){if(this.length>0){if(e){var t=this.styles();return this[0].offsetWidth+parseFloat(t.getPropertyValue("margin-right"))+parseFloat(t.getPropertyValue("margin-left"))}return this[0].offsetWidth}return null},parent:function(e){for(var t=[],r=0;r<this.length;r+=1)null!==this[r].parentNode&&(e?h(this[r].parentNode).is(e)&&t.push(this[r].parentNode):t.push(this[r].parentNode));return h(t)},parents:function(e){for(var t=[],r=0;r<this.length;r+=1)for(var a=this[r].parentNode;a;)e?h(a).is(e)&&t.push(a):t.push(a),a=a.parentNode;return h(t)},prepend:function(e){var t,r,n=a();for(t=0;t<this.length;t+=1)if("string"==typeof e){var o=n.createElement("div");for(o.innerHTML=e,r=o.childNodes.length-1;r>=0;r-=1)this[t].insertBefore(o.childNodes[r],this[t].childNodes[0])}else if(e instanceof p)for(r=0;r<e.length;r+=1)this[t].insertBefore(e[r],this[t].childNodes[0]);else this[t].insertBefore(e,this[t].childNodes[0]);return this},prependTo:function(e){return h(e).prepend(this),this},prev:function(e){if(this.length>0){var t=this[0];return e?t.previousElementSibling&&h(t.previousElementSibling).is(e)?h([t.previousElementSibling]):h([]):t.previousElementSibling?h([t.previousElementSibling]):h([])}return h([])},prevAll:function(e){var t=[],r=this[0];if(!r)return h([]);for(;r.previousElementSibling;){var a=r.previousElementSibling;e?h(a).is(e)&&t.push(a):t.push(a),r=a}return h(t)},prop:function(e,t){if(1!==arguments.length||"string"!=typeof e){for(var r=0;r<this.length;r+=1)if(2===arguments.length)this[r][e]=t;else for(var a in e)this[r][a]=e[a];return this}return this[0]?this[0][e]:this},remove:function(){for(var e=0;e<this.length;e+=1)this[e].parentNode&&this[e].parentNode.removeChild(this[e]);return this},removeAttr:function(e){for(var t=0;t<this.length;t+=1)this[t].removeAttribute(e);return this},removeClass:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=f(t.map((function(e){return e.split(" ")})));return this.forEach((function(e){var t;(t=e.classList).remove.apply(t,a)})),this},removeData:function(e){for(var t=0;t<this.length;t+=1){var r=this[t];r.dom7ElementDataStorage&&r.dom7ElementDataStorage[e]&&(r.dom7ElementDataStorage[e]=null,delete r.dom7ElementDataStorage[e])}},resize:H,scroll:D,scrollLeft:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=t[0],n=t[1],o=t[2],i=t[3];3===t.length&&"function"==typeof o&&(a=t[0],n=t[1],i=t[2],o=t[3]);var s=this;return void 0===a?s.length>0?s[0].scrollLeft:null:s.scrollTo(a,void 0,n,o,i)},scrollTo:function(){for(var e=o(),t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];var n=r[0],i=r[1],s=r[2],l=r[3],u=r[4];return 4===r.length&&"function"==typeof l&&(u=l,n=r[0],i=r[1],s=r[2],u=r[3],l=r[4]),void 0===l&&(l="swing"),this.each((function(){var t,r,a,o,c,p,f,d,h=this,v=i>0||0===i,m=n>0||0===n;if(void 0===l&&(l="swing"),v&&(t=h.scrollTop,s||(h.scrollTop=i)),m&&(r=h.scrollLeft,s||(h.scrollLeft=n)),s){v&&(a=h.scrollHeight-h.offsetHeight,c=Math.max(Math.min(i,a),0)),m&&(o=h.scrollWidth-h.offsetWidth,p=Math.max(Math.min(n,o),0));var g=null;v&&c===t&&(v=!1),m&&p===r&&(m=!1),e.requestAnimationFrame((function a(n){void 0===n&&(n=(new Date).getTime()),null===g&&(g=n);var o,i=Math.max(Math.min((n-g)/s,1),0),b="linear"===l?i:.5-Math.cos(i*Math.PI)/2;v&&(f=t+b*(c-t)),m&&(d=r+b*(p-r)),v&&c>t&&f>=c&&(h.scrollTop=c,o=!0),v&&c<t&&f<=c&&(h.scrollTop=c,o=!0),m&&p>r&&d>=p&&(h.scrollLeft=p,o=!0),m&&p<r&&d<=p&&(h.scrollLeft=p,o=!0),o?u&&u():(v&&(h.scrollTop=f),m&&(h.scrollLeft=d),e.requestAnimationFrame(a))}))}}))},scrollTop:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=t[0],n=t[1],o=t[2],i=t[3];3===t.length&&"function"==typeof o&&(a=t[0],n=t[1],i=t[2],o=t[3]);var s=this;return void 0===a?s.length>0?s[0].scrollTop:null:s.scrollTo(void 0,a,n,o,i)},show:function(){for(var e=o(),t=0;t<this.length;t+=1){var r=this[t];"none"===r.style.display&&(r.style.display=""),"none"===e.getComputedStyle(r,null).getPropertyValue("display")&&(r.style.display="block")}return this},siblings:function(e){return this.nextAll(e).add(this.prevAll(e))},stop:function(){for(var e=this,t=0;t<e.length;t+=1)e[t].dom7AnimateInstance&&e[t].dom7AnimateInstance.stop()},styles:function(){var e=o();return this[0]?e.getComputedStyle(this[0],null):{}},submit:P,text:function(e){if(void 0===e)return this[0]?this[0].textContent.trim():null;for(var t=0;t<this.length;t+=1)this[t].textContent=e;return this},toggleClass:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=f(t.map((function(e){return e.split(" ")})));this.forEach((function(e){a.forEach((function(t){e.classList.toggle(t)}))}))},touchend:B,touchmove:_,touchstart:N,transform:function(e){for(var t=0;t<this.length;t+=1)this[t].style.transform=e;return this},transition:function(e){for(var t=0;t<this.length;t+=1)this[t].style.transitionDuration="string"!=typeof e?e+"ms":e;return this},transitionEnd:function(e){var t=this;return e&&t.on("transitionend",(function r(a){a.target===this&&(e.call(this,a),t.off("transitionend",r))})),this},trigger:function(){for(var e=o(),t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];for(var n=r[0].split(" "),i=r[1],s=0;s<n.length;s+=1)for(var l=n[s],u=0;u<this.length;u+=1){var c=this[u];if(e.CustomEvent){var p=new e.CustomEvent(l,{detail:i,bubbles:!0,cancelable:!0});c.dom7EventData=r.filter((function(e,t){return t>0})),c.dispatchEvent(p),c.dom7EventData=[],delete c.dom7EventData}}return this},val:function(e){if(void 0===e){var t=this[0];if(!t)return;if(t.multiple&&"select"===t.nodeName.toLowerCase()){for(var r=[],a=0;a<t.selectedOptions.length;a+=1)r.push(t.selectedOptions[a].value);return r}return t.value}for(var n=0;n<this.length;n+=1){var o=this[n];if(Array.isArray(e)&&o.multiple&&"select"===o.nodeName.toLowerCase())for(var i=0;i<o.options.length;i+=1)o.options[i].selected=e.indexOf(o.options[i].value)>=0;else o.value=e}return this},value:function(e){return this.val(e)},width:function(){var e=o();return this[0]===e?e.innerWidth:this.length>0?parseFloat(this.css("width")):null}});Object.keys(j).forEach((function(e){"$"!==e&&(h.fn[e]=j[e])}));var q=h;function I(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function U(e,t,r){return t&&I(e.prototype,t),r&&I(e,r),e}function V(){return(V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}function z(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function W(e){return(W=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function F(e,t){return(F=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function X(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function Q(e,t,r){return(Q=X()?Reflect.construct:function(e,t,r){var a=[null];a.push.apply(a,t);var n=new(Function.bind.apply(e,a));return r&&F(n,r.prototype),n}).apply(null,arguments)}function Y(e){var t="function"==typeof Map?new Map:void 0;return(Y=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return Q(e,arguments,W(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),F(a,e)})(e)}function J(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var G=0;function K(e,t){void 0===e&&(e="xxxxxxxxxx"),void 0===t&&(t="0123456789abcdef");var r=t.length;return e.replace(/x/g,(function(){return t[Math.floor(Math.random()*r)]}))}var Z='\n <span class="preloader-inner">\n <svg viewBox="0 0 36 36">\n <circle cx="18" cy="18" r="16"></circle>\n </svg>\n </span>\n'.trim(),ee=('\n <span class="preloader-inner">\n '+[0,1,2,3,4,5,6,7].map((function(){return'<span class="preloader-inner-line"></span>'})).join("")+"\n </span>\n").trim();function te(e){var t;return e.split("").map((function(e,r){return e.match(/[A-Z]/)&&0!==r&&!t?(t=!0,":"+e.toLowerCase()):e.toLowerCase()})).join("")}function re(e){var t=e;Object.keys(t).forEach((function(e){try{t[e]=null}catch(e){}try{delete t[e]}catch(e){}}))}function ae(e){return o().requestAnimationFrame(e)}function ne(e,t){return void 0===t&&(t=0),setTimeout(e,t)}function oe(e){return ae((function(){ae(e)}))}function ie(){return Date.now()}function se(e){var t,r,a,n,i=o(),s={},l=e||i.location.href;if("string"==typeof l&&l.length)for(n=(r=(l=l.indexOf("?")>-1?l.replace(/\S*\?/,""):"").split("&").filter((function(e){return""!==e}))).length,t=0;t<n;t+=1)a=r[t].replace(/#\S+/g,"").split("="),s[decodeURIComponent(a[0])]=void 0===a[1]?void 0:decodeURIComponent(a.slice(1).join("="))||"";return s}function le(e,t){if(void 0===t&&(t=[]),"string"==typeof e)return e;var r,a=[];function n(e){if(t.length>0){for(var r="",a=0;a<t.length;a+=1)r+=0===a?t[a]:"["+encodeURIComponent(t[a])+"]";return r+"["+encodeURIComponent(e)+"]"}return encodeURIComponent(e)}function o(e){return encodeURIComponent(e)}return Object.keys(e).forEach((function(i){var s;if(Array.isArray(e[i])){s=[];for(var l=0;l<e[i].length;l+=1)Array.isArray(e[i][l])||"object"!=typeof e[i][l]?s.push(n(i)+"[]="+o(e[i][l])):((r=t.slice()).push(i),r.push(String(l)),s.push(le(e[i][l],r)));s.length>0&&a.push(s.join("&"))}else null===e[i]||""===e[i]?a.push(n(i)+"="):"object"==typeof e[i]?((r=t.slice()).push(i),""!==(s=le(e[i],r))&&a.push(s)):void 0!==e[i]&&""!==e[i]?a.push(n(i)+"="+o(e[i])):""===e[i]&&a.push(n(i))})),a.join("&")}function ue(e){return"object"==typeof e&&null!==e&&e.constructor&&e.constructor===Object}function ce(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=t[0];t.splice(0,1);for(var n=t,o=0;o<n.length;o+=1){var i=t[o];if(null!=i)for(var s=Object.keys(Object(i)),l=0,u=s.length;l<u;l+=1){var c=s[l],p=Object.getOwnPropertyDescriptor(i,c);void 0!==p&&p.enumerable&&(a[c]=i[c])}}return a}function pe(){for(var e,t,r=!0,a=arguments.length,n=new Array(a),o=0;o<a;o++)n[o]=arguments[o];"boolean"==typeof n[0]?(r=n[0],e=n[1],n.splice(0,2),t=n):(e=n[0],n.splice(0,1),t=n);for(var i=0;i<t.length;i+=1){var s=n[i];if(null!=s)for(var l=Object.keys(Object(s)),u=0,c=l.length;u<c;u+=1){var p=l[u],f=Object.getOwnPropertyDescriptor(s,p);void 0!==f&&f.enumerable&&(r?ue(e[p])&&ue(s[p])?pe(e[p],s[p]):!ue(e[p])&&ue(s[p])?(e[p]={},pe(e[p],s[p])):e[p]=s[p]:e[p]=s[p])}}return e}function fe(e){var t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,r,a){return t+t+r+r+a+a})),r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return r?r.slice(1).map((function(e){return parseInt(e,16)})):null}function de(e,t,r){return"#"+[e,t,r].map((function(e){var t=e.toString(16);return 1===t.length?"0"+t:t})).join("")}function he(e,t,r){e/=255,t/=255,r/=255;var a,n=Math.max(e,t,r),o=Math.min(e,t,r),i=n-o;0===i?a=0:n===e?a=(t-r)/i%6:n===t?a=(r-e)/i+2:n===r&&(a=(e-t)/i+4);var s=(o+n)/2;return a<0&&(a=6+a),[60*a,0===i?0:i/(1-Math.abs(2*s-1)),s]}function ve(e,t,r){var a,n=(1-Math.abs(2*r-1))*t,o=e/60,i=n*(1-Math.abs(o%2-1));Number.isNaN(e)||void 0===e?a=[0,0,0]:o<=1?a=[n,i,0]:o<=2?a=[i,n,0]:o<=3?a=[0,n,i]:o<=4?a=[0,i,n]:o<=5?a=[i,0,n]:o<=6&&(a=[n,0,i]);var s=r-n/2;return a.map((function(e){return Math.max(0,Math.min(255,Math.round(255*(e+s))))}))}function me(e,t){Object.keys(t).forEach((function(r){ue(t[r])&&Object.keys(t[r]).forEach((function(a){"function"==typeof t[r][a]&&(t[r][a]=t[r][a].bind(e))})),e[r]=t[r]}))}function ge(){for(var e=[],t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return r.forEach((function(t){Array.isArray(t)?e.push.apply(e,ge.apply(void 0,t)):e.push(t)})),e}var be,ye,we=Object.freeze({__proto__:null,uniqueNumber:function(){return G+=1},id:K,mdPreloaderContent:Z,iosPreloaderContent:ee,auroraPreloaderContent:'\n <span class="preloader-inner">\n <span class="preloader-inner-circle"></span>\n </span>\n',eventNameToColonCase:te,deleteProps:re,requestAnimationFrame:ae,cancelAnimationFrame:function(e){return o().cancelAnimationFrame(e)},nextTick:ne,nextFrame:oe,now:ie,parseUrlQuery:se,getTranslate:function(e,t){void 0===t&&(t="x");var r,a,n,i=o(),s=i.getComputedStyle(e,null);return i.WebKitCSSMatrix?((a=s.transform||s.webkitTransform).split(",").length>6&&(a=a.split(", ").map((function(e){return e.replace(",",".")})).join(", ")),n=new i.WebKitCSSMatrix("none"===a?"":a)):r=(n=s.MozTransform||s.OTransform||s.MsTransform||s.msTransform||s.transform||s.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,")).toString().split(","),"x"===t&&(a=i.WebKitCSSMatrix?n.m41:16===r.length?parseFloat(r[12]):parseFloat(r[4])),"y"===t&&(a=i.WebKitCSSMatrix?n.m42:16===r.length?parseFloat(r[13]):parseFloat(r[5])),a||0},serializeObject:le,isObject:ue,merge:ce,extend:pe,colorHexToRgb:fe,colorRgbToHex:de,colorRgbToHsl:he,colorHslToRgb:ve,colorHsbToHsl:function(e,t,r){var a={h:e,s:0,l:0},n=t,o=r;return a.l=(2-n)*o/2,a.s=a.l&&a.l<1?n*o/(a.l<.5?2*a.l:2-2*a.l):a.s,[a.h,a.s,a.l]},colorHslToHsb:function(e,t,r){var a={h:e,s:0,b:0},n=r,o=t*(n<.5?n:1-n);return a.b=n+o,a.s=n>0?2*o/a.b:a.s,[a.h,a.s,a.b]},colorThemeCSSProperties:function(){for(var e,t,r=arguments.length,a=new Array(r),n=0;n<r;n++)a[n]=arguments[n];if(1===a.length?t=fe(e=a[0]):3===a.length&&(t=a,e=de.apply(void 0,t)),!t)return{};var o=he.apply(void 0,t),i=[o[0],o[1],Math.max(0,o[2]-.08)],s=[o[0],o[1],Math.max(0,o[2]+.08)],l=de.apply(void 0,ve.apply(void 0,i)),u=de.apply(void 0,ve.apply(void 0,s));return{"--f7-theme-color":e,"--f7-theme-color-rgb":t.join(", "),"--f7-theme-color-shade":l,"--f7-theme-color-tint":u}},bindMethods:me,flattenArray:ge});function Ce(){return be||(be=function(){var e=o(),t=a();return{touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch),pointerEvents:!!e.PointerEvent&&"maxTouchPoints"in e.navigator&&e.navigator.maxTouchPoints>=0,passiveListener:function(){var t=!1;try{var r=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassiveListener",null,r)}catch(e){}return t}(),intersectionObserver:"IntersectionObserver"in e}}()),be}function ke(e,t){return void 0===e&&(e={}),ye&&!t||(ye=function(e){var t=(void 0===e?{}:e).userAgent,r=Ce(),a=o(),n=a.navigator.platform,i=t||a.navigator.userAgent,s={ios:!1,android:!1,androidChrome:!1,desktop:!1,iphone:!1,ipod:!1,ipad:!1,edge:!1,ie:!1,firefox:!1,macos:!1,windows:!1,cordova:!(!a.cordova&&!a.phonegap),phonegap:!(!a.cordova&&!a.phonegap),electron:!1,capacitor:!!a.Capacitor,nwjs:!1},l=a.screen.width,u=a.screen.height,c=i.match(/(Android);?[\s\/]+([\d.]+)?/),p=i.match(/(iPad).*OS\s([\d_]+)/),f=i.match(/(iPod)(.*OS\s([\d_]+))?/),d=!p&&i.match(/(iPhone\sOS|iOS)\s([\d_]+)/),h=i.indexOf("MSIE ")>=0||i.indexOf("Trident/")>=0,v=i.indexOf("Edge/")>=0,m=i.indexOf("Gecko/")>=0&&i.indexOf("Firefox/")>=0,g="Win32"===n,b=i.toLowerCase().indexOf("electron")>=0,y="undefined"!=typeof nw&&"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.nw,w="MacIntel"===n;return!p&&w&&r.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(l+"x"+u)>=0&&((p=i.match(/(Version)\/([\d.]+)/))||(p=[0,1,"13_0_0"]),w=!1),s.ie=h,s.edge=v,s.firefox=m,c&&!g&&(s.os="android",s.osVersion=c[2],s.android=!0,s.androidChrome=i.toLowerCase().indexOf("chrome")>=0),(p||d||f)&&(s.os="ios",s.ios=!0),d&&!f&&(s.osVersion=d[2].replace(/_/g,"."),s.iphone=!0),p&&(s.osVersion=p[2].replace(/_/g,"."),s.ipad=!0),f&&(s.osVersion=f[3]?f[3].replace(/_/g,"."):null,s.ipod=!0),s.ios&&s.osVersion&&i.indexOf("Version/")>=0&&"10"===s.osVersion.split(".")[0]&&(s.osVersion=i.toLowerCase().split("version/")[1].split(" ")[0]),s.webView=!(!(d||p||f)||!i.match(/.*AppleWebKit(?!.*Safari)/i)&&!a.navigator.standalone)||a.matchMedia&&a.matchMedia("(display-mode: standalone)").matches,s.webview=s.webView,s.standalone=s.webView,s.desktop=!(s.ios||s.android)||b||y,s.desktop&&(s.electron=b,s.nwjs=y,s.macos=w,s.windows=g,s.macos&&(s.os="macos"),s.windows&&(s.os="windows")),s.pixelRatio=a.devicePixelRatio||1,s.prefersColorScheme=function(){var e;return a.matchMedia&&a.matchMedia("(prefers-color-scheme: light)").matches&&(e="light"),a.matchMedia&&a.matchMedia("(prefers-color-scheme: dark)").matches&&(e="dark"),e},s}(e)),ye}var Ee=function(){function e(e){void 0===e&&(e=[]);this.eventsParents=e,this.eventsListeners={}}var t=e.prototype;return t.on=function(e,t,r){var a=this;if("function"!=typeof t)return a;var n=r?"unshift":"push";return e.split(" ").forEach((function(e){a.eventsListeners[e]||(a.eventsListeners[e]=[]),a.eventsListeners[e][n](t)})),a},t.once=function(e,t,r){var a=this;if("function"!=typeof t)return a;function n(){a.off(e,n),n.f7proxy&&delete n.f7proxy;for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];t.apply(a,o)}return n.f7proxy=t,a.on(e,n,r)},t.off=function(e,t){var r=this;return r.eventsListeners?(e.split(" ").forEach((function(e){void 0===t?r.eventsListeners[e]=[]:r.eventsListeners[e]&&r.eventsListeners[e].forEach((function(a,n){(a===t||a.f7proxy&&a.f7proxy===t)&&r.eventsListeners[e].splice(n,1)}))})),r):r},t.emit=function(){var e,t,r,a,n=this;if(!n.eventsListeners)return n;for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];"string"==typeof i[0]||Array.isArray(i[0])?(e=i[0],t=i.slice(1,i.length),r=n,a=n.eventsParents):(e=i[0].events,t=i[0].data,r=i[0].context||n,a=i[0].local?[]:i[0].parents||n.eventsParents);var l=Array.isArray(e)?e:e.split(" "),u=l.map((function(e){return e.replace("local::","")})),c=l.filter((function(e){return e.indexOf("local::")<0}));return u.forEach((function(e){if(n.eventsListeners&&n.eventsListeners[e]){var a=[];n.eventsListeners[e].forEach((function(e){a.push(e)})),a.forEach((function(e){e.apply(r,t)}))}})),a&&a.length>0&&a.forEach((function(e){e.emit.apply(e,[c].concat(t))})),n},e}(),xe=function(e){function t(t,r){var a;void 0===t&&(t={}),void 0===r&&(r=[]);var n=J(a=e.call(this,r)||this);return n.params=t,n.params&&n.params.on&&Object.keys(n.params.on).forEach((function(e){n.on(e,n.params.on[e])})),a}z(t,e);var r=t.prototype;return r.useModuleParams=function(e,t){if(e.params){var r={};Object.keys(e.params).forEach((function(e){void 0!==t[e]&&(r[e]=pe({},t[e]))})),pe(t,e.params),Object.keys(r).forEach((function(e){pe(t[e],r[e])}))}},r.useModulesParams=function(e){var t=this;t.modules&&Object.keys(t.modules).forEach((function(r){var a=t.modules[r];a.params&&pe(e,a.params)}))},r.useModule=function(e,t){void 0===e&&(e=""),void 0===t&&(t={});var r=this;if(r.modules){var a="string"==typeof e?r.modules[e]:e;a&&(a.instance&&Object.keys(a.instance).forEach((function(e){var t=a.instance[e];r[e]="function"==typeof t?t.bind(r):t})),a.on&&r.on&&Object.keys(a.on).forEach((function(e){r.on(e,a.on[e])})),a.vnode&&(r.vnodeHooks||(r.vnodeHooks={}),Object.keys(a.vnode).forEach((function(e){Object.keys(a.vnode[e]).forEach((function(t){var n=a.vnode[e][t];r.vnodeHooks[t]||(r.vnodeHooks[t]={}),r.vnodeHooks[t][e]||(r.vnodeHooks[t][e]=[]),r.vnodeHooks[t][e].push(n.bind(r))}))}))),a.create&&a.create.bind(r)(t))}},r.useModules=function(e){void 0===e&&(e={});var t=this;t.modules&&Object.keys(t.modules).forEach((function(r){var a=e[r]||{};t.useModule(r,a)}))},t.installModule=function(e){var t=this;t.prototype.modules||(t.prototype.modules={});var r=e.name||Object.keys(t.prototype.modules).length+"_"+ie();if(t.prototype.modules[r]=e,e.proto&&Object.keys(e.proto).forEach((function(r){t.prototype[r]=e.proto[r]})),e.static&&Object.keys(e.static).forEach((function(r){t[r]=e.static[r]})),e.install){for(var a=arguments.length,n=new Array(a>1?a-1:0),o=1;o<a;o++)n[o-1]=arguments[o];e.install.apply(t,n)}return t},t.use=function(e){var t=this;if(Array.isArray(e))return e.forEach((function(e){return t.installModule(e)})),t;for(var r=arguments.length,a=new Array(r>1?r-1:0),n=1;n<r;n++)a[n-1]=arguments[n];return t.installModule.apply(t,[e].concat(a))},U(t,null,[{key:"components",set:function(e){this.use&&this.use(e)}}]),t}(Ee);function Pe(e){void 0===e&&(e={});var t=e,r=t.defaultSelector,a=t.constructor,n=t.domProp,o=t.app,i=t.addMethods,s={create:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Q(a,o?[o].concat(t):t)},get:function(e){if(void 0===e&&(e=r),e instanceof a)return e;var t=q(e);return 0!==t.length?t[0][n]:void 0},destroy:function(e){var t=s.get(e);if(t&&t.destroy)return t.destroy()}};return i&&Array.isArray(i)&&i.forEach((function(e){s[e]=function(t){void 0===t&&(t=r);for(var a=s.get(t),n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];if(a&&a[e])return a[e].apply(a,o)}})),s}var Oe=[];var Re=function(e){function t(r){var n;if(void 0===r&&(r={}),n=e.call(this,r)||this,t.instance&&"undefined"!=typeof window)throw new Error("Framework7 is already initialized and can't be initialized more than once");var i=ke({userAgent:r.userAgent||void 0}),s=Ce(),l=pe({},r),u=J(n);u.device=i,u.support=s;var c=o(),p=a();t.instance=u;var f={version:"1.0.0",id:"io.framework7.myapp",el:"body",theme:"auto",language:c.navigator.language,routes:[],name:"Framework7",lazyModulesPath:null,initOnDeviceReady:!0,init:!0,autoDarkTheme:!1,iosTranslucentBars:!0,iosTranslucentModals:!0,component:void 0,componentUrl:void 0,userAgent:null,url:null};return u.useModulesParams(f),u.params=pe(f,r),pe(u,{id:u.params.id,name:u.params.name,version:u.params.version,routes:u.params.routes,language:u.params.language,theme:"auto"===u.params.theme?i.ios?"ios":i.desktop&&i.electron?"aurora":"md":u.params.theme,passedParams:l,online:c.navigator.onLine}),r.store&&(u.params.store=r.store),u.$el&&u.$el[0]&&(u.$el[0].f7=u),u.useModules(),u.initStore(),u.params.init&&(i.cordova&&u.params.initOnDeviceReady?q(p).on("deviceready",(function(){u.init()})):u.init()),u||J(n)}z(t,e);var r=t.prototype;return r.mount=function(e){var t=this,r=o(),n=a(),i=q(e||t.params.el).eq(0);t.$el=i,t.$el&&t.$el[0]&&(t.el=t.$el[0],t.el.f7=t,t.rtl="rtl"===i.css("direction"));var s="(prefers-color-scheme: dark)",l="(prefers-color-scheme: light)";t.mq={},r.matchMedia&&(t.mq.dark=r.matchMedia(s),t.mq.light=r.matchMedia(l)),t.colorSchemeListener=function(e){var r=e.matches,a=e.media;if(r){var o=n.querySelector("html");a===s?(o.classList.add("theme-dark"),t.darkTheme=!0,t.emit("darkThemeChange",!0)):a===l&&(o.classList.remove("theme-dark"),t.darkTheme=!1,t.emit("darkThemeChange",!1))}},t.emit("mount")},r.initStore=function(){var e=this;void 0!==e.params.store&&e.params.store.__store?e.store=e.params.store:e.store=e.createStore(e.params.store)},r.enableAutoDarkTheme=function(){var e=o(),t=a();if(e.matchMedia){var r=this,n=t.querySelector("html");r.mq.dark&&r.mq.light&&(r.mq.dark.addListener(r.colorSchemeListener),r.mq.light.addListener(r.colorSchemeListener)),r.mq.dark&&r.mq.dark.matches?(n.classList.add("theme-dark"),r.darkTheme=!0,r.emit("darkThemeChange",!0)):r.mq.light&&r.mq.light.matches&&(n.classList.remove("theme-dark"),r.darkTheme=!1,r.emit("darkThemeChange",!1))}},r.disableAutoDarkTheme=function(){if(o().matchMedia){var e=this;e.mq.dark&&e.mq.dark.removeListener(e.colorSchemeListener),e.mq.light&&e.mq.light.removeListener(e.colorSchemeListener)}},r.initAppComponent=function(e){var t=this;t.router.componentLoader(t.params.component,t.params.componentUrl,{componentOptions:{el:t.$el[0]}},(function(r){t.$el=q(r),t.$el[0].f7=t,t.$elComponent=r.f7Component,t.el=t.$el[0],e&&e()}),(function(){}))},r.init=function(e){var t=this;t.mount(e);var r=function(){if(!t.initialized){t.$el.addClass("framework7-initializing"),t.rtl&&q("html").attr("dir","rtl"),t.params.autoDarkTheme&&t.enableAutoDarkTheme();var e=o();e.addEventListener("offline",(function(){t.online=!1,t.emit("offline"),t.emit("connection",!1)})),e.addEventListener("online",(function(){t.online=!0,t.emit("online"),t.emit("connection",!0)})),t.$el.addClass("framework7-root"),q("html").removeClass("ios md aurora").addClass(t.theme);var r=t.device;t.params.iosTranslucentBars&&"ios"===t.theme&&r.ios&&q("html").addClass("ios-translucent-bars"),t.params.iosTranslucentModals&&"ios"===t.theme&&r.ios&&q("html").addClass("ios-translucent-modals"),oe((function(){t.$el.removeClass("framework7-initializing")})),t.initialized=!0,t.emit("init")}};return t.params.component||t.params.componentUrl?t.initAppComponent((function(){r()})):r(),t},r.loadModule=function(){return t.loadModule.apply(t,arguments)},r.loadModules=function(){return t.loadModules.apply(t,arguments)},r.getVnodeHooks=function(e,t){var r=this;return r.vnodeHooks&&r.vnodeHooks[e]&&r.vnodeHooks[e][t]||[]},U(t,[{key:"$",get:function(){return q}}],[{key:"Dom7",get:function(){return q}},{key:"$",get:function(){return q}},{key:"device",get:function(){return ke()}},{key:"support",get:function(){return Ce()}},{key:"Class",get:function(){return xe}},{key:"Events",get:function(){return Ee}}]),t}(xe);Re.ModalMethods=function(e){void 0===e&&(e={});var t=e,r=t.defaultSelector,a=t.constructor,n=t.app;return pe(Pe({defaultSelector:r,constructor:a,app:n,domProp:"f7Modal"}),{open:function(e,t,r){var o=q(e);if(o.length>1&&r){var i=q(r).parents(".page");i.length&&o.each((function(e){var t=q(e);t.parents(i)[0]===i[0]&&(o=t)}))}if(o.length>1&&(o=o.eq(o.length-1)),o.length){var s=o[0].f7Modal;if(!s){var l=o.dataset();s=new a(n,V({el:o},l))}return s.open(t)}},close:function(e,t,o){void 0===e&&(e=r);var i=q(e);if(i.length){if(i.length>1){var s;if(o){var l=q(o);l.length&&(s=l.parents(i))}i=s&&s.length>0?s:i.eq(i.length-1)}var u=i[0].f7Modal;if(!u){var c=i.dataset();u=new a(n,V({el:i},c))}return u.close(t)}}})},Re.ConstructorMethods=Pe,Re.loadModule=function(e){var t=this,r=o(),n=a();return new Promise((function(a,o){var i,s,l,u=t.instance;if(e){if("string"==typeof e){var c=e.match(/([a-z0-9-]*)/i);if(e.indexOf(".")<0&&c&&c[0].length===e.length){if(!u||u&&!u.params.lazyModulesPath)return void o(new Error('Framework7: "lazyModulesPath" app parameter must be specified to fetch module by name'));i=u.params.lazyModulesPath+"/"+e+"/"+e+".js"}else i=e}else"function"==typeof e?l=e:s=e;if(l){var p=l(t,!1);if(!p)return void o(new Error("Framework7: Can't find Framework7 component in specified component function"));if(t.prototype.modules&&t.prototype.modules[p.name])return void a();v(p),a()}if(s){var f=s;if(!f)return void o(new Error("Framework7: Can't find Framework7 component in specified component"));if(t.prototype.modules&&t.prototype.modules[f.name])return void a();v(f),a()}if(i){if(Oe.indexOf(i)>=0)return void a();Oe.push(i);var d=new Promise((function(e,a){t.request.get(i,(function(o){var s="f7_component_loader_callback_"+K(),l=n.createElement("script");l.innerHTML="window."+s+" = function (Framework7, Framework7AutoInstallComponent) {return "+o.trim()+"}",q("head").append(l);var u=r[s];delete r[s],q(l).remove();var c=u(t,!1);c?(t.prototype.modules&&t.prototype.modules[c.name]||v(c),e()):a(new Error("Framework7: Can't find Framework7 component in "+i+" file"))}),(function(e,t){a(e,t)}))})),h=new Promise((function(e){t.request.get(i.replace(".js",u.rtl?".rtl.css":".css"),(function(t){var r=n.createElement("style");r.innerHTML=t,q("head").append(r),e()}),(function(){e()}))}));Promise.all([d,h]).then((function(){a()})).catch((function(e){o(e)}))}}else o(new Error("Framework7: Lazy module must be specified"));function v(e){t.use(e),u&&(u.useModuleParams(e,u.params),u.useModule(e))}}))},Re.loadModules=function(e){return Promise.all(e.map((function(e){return Re.loadModule(e)})))};var Te={name:"device",static:{getDevice:ke},on:{init:function(){var e=a(),t=ke(),r=[],n=e.querySelector("html"),o=e.querySelector('meta[name="apple-mobile-web-app-status-bar-style"]');n&&(t.standalone&&t.ios&&o&&"black-translucent"===o.content&&r.push("device-full-viewport"),r.push("device-pixel-ratio-"+Math.floor(t.pixelRatio)),t.os&&!t.desktop?r.push("device-"+t.os):t.desktop&&(r.push("device-desktop"),t.os&&r.push("device-"+t.os)),(t.cordova||t.phonegap)&&r.push("device-cordova"),t.capacitor&&r.push("device-capacitor"),r.forEach((function(e){n.classList.add(e)})))}}},Se={name:"support",static:{getSupport:Ce}},Ae={name:"utils",proto:{utils:we},static:{utils:we}},$e={name:"resize",create:function(){var e=this;e.getSize=function(){if(!e.el)return{width:0,height:0,left:0,top:0};var t=e.$el.offset(),r=[e.el.offsetWidth,e.el.offsetHeight,t.left,t.top],a=r[0],n=r[1],o=r[2],i=r[3];return e.width=a,e.height=n,e.left=o,e.top=i,{width:a,height:n,left:o,top:i}}},on:{init:function(){var e=this,t=o();e.getSize(),t.addEventListener("resize",(function(){e.emit("resize")}),!1),t.addEventListener("orientationchange",(function(){e.emit("orientationchange")}))},orientationchange:function(){var e=a();ke().ipad&&(e.body.scrollLeft=0,setTimeout((function(){e.body.scrollLeft=0}),0))},resize:function(){this.getSize()}}},Le={},Me=0,Ne=function(e){Object.assign(this,e)},Be=function(e){function t(t){var r;return r=e.call(this)||this,Object.assign(J(r),t),r}return z(t,e),t}(Y(Error)),_e=function(e){return new Promise((function(t,r){var n=o(),i=a(),s=pe({},Le);"beforeCreate beforeOpen beforeSend error complete success statusCode".split(" ").forEach((function(e){delete s[e]}));var l=pe({url:n.location.toString(),method:"GET",data:!1,async:!0,cache:!0,user:"",password:"",headers:{},xhrFields:{},statusCode:{},processData:!0,dataType:"text",contentType:"application/x-www-form-urlencoded",timeout:0},s),u=pe({},l,e);if(e.abortController&&(u.abortController=e.abortController),u.abortController&&u.abortController.canceled)r(new Be({options:u,status:"canceled",message:"canceled"}));else if(!1!==O("beforeCreate",u)){u.type&&(u.method=u.type);var c,p=u.url.indexOf("?")>=0?"&":"?",f=u.method.toUpperCase();if(("GET"===f||"HEAD"===f||"OPTIONS"===f||"DELETE"===f)&&u.data)(c="string"==typeof u.data?u.data.indexOf("?")>=0?u.data.split("?")[1]:u.data:le(u.data)).length&&(u.url+=p+c,"?"===p&&(p="&"));if("json"===u.dataType&&u.url.indexOf("callback=")>=0){var d,h="f7jsonp_"+(Date.now()+(Me+=1)),v=u.url.split("callback="),m=v[0]+"callback="+h;if(v[1].indexOf("&")>=0){var g=v[1].split("&").filter((function(e){return e.indexOf("=")>0})).join("&");g.length>0&&(m+="&"+g)}var b=i.createElement("script");return b.type="text/javascript",b.onerror=function(){clearTimeout(d),O("error",null,"scripterror","scripterror"),r(new Be({options:u,status:"scripterror",message:"scripterror"})),O("complete",null,"scripterror")},b.src=m,n[h]=function(e){clearTimeout(d),O("success",e),b.parentNode.removeChild(b),b=null,delete n[h],t(new Ne({options:u,data:e}))},i.querySelector("head").appendChild(b),void(u.timeout>0&&(d=setTimeout((function(){b.parentNode.removeChild(b),b=null,O("error",null,"timeout","timeout"),r(new Be({options:u,status:"timeout",message:"timeout"}))}),u.timeout)))}"GET"!==f&&"HEAD"!==f&&"OPTIONS"!==f&&"DELETE"!==f||!1===u.cache&&(u.url+=p+"_nocache"+Date.now());var y=new XMLHttpRequest;if(u.abortController){var w=!1;u.abortController.onAbort=function(){w||(w=!0,y.abort(),r(new Be({options:u,xhr:y,status:"canceled",message:"canceled"})))}}if(y.requestUrl=u.url,y.requestParameters=u,!1!==O("beforeOpen",y,u)){y.open(f,u.url,u.async,u.user,u.password);var C=null;if(("POST"===f||"PUT"===f||"PATCH"===f)&&u.data)if(u.processData)if([ArrayBuffer,Blob,Document,FormData].indexOf(u.data.constructor)>=0)C=u.data;else{var k="---------------------------"+Date.now().toString(16);"multipart/form-data"===u.contentType?y.setRequestHeader("Content-Type","multipart/form-data; boundary="+k):y.setRequestHeader("Content-Type",u.contentType),C="";var E=le(u.data);if("multipart/form-data"===u.contentType){E=E.split("&");for(var x=[],P=0;P<E.length;P+=1)x.push('Content-Disposition: form-data; name="'+E[P].split("=")[0]+'"\r\n\r\n'+E[P].split("=")[1]+"\r\n");C="--"+k+"\r\n"+x.join("--"+k+"\r\n")+"--"+k+"--\r\n"}else C="application/json"===u.contentType?JSON.stringify(u.data):E}else C=u.data,y.setRequestHeader("Content-Type",u.contentType);"json"!==u.dataType||u.headers&&u.headers.Accept||y.setRequestHeader("Accept","application/json"),u.headers&&Object.keys(u.headers).forEach((function(e){void 0!==u.headers[e]&&y.setRequestHeader(e,u.headers[e])})),void 0===u.crossDomain&&(u.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(u.url)&&RegExp.$2!==n.location.host),u.crossDomain||y.setRequestHeader("X-Requested-With","XMLHttpRequest"),u.xhrFields&&pe(y,u.xhrFields),y.onload=function(){var e;if(y.status>=200&&y.status<300||0===y.status)if("json"===u.dataType){var a;try{e=JSON.parse(y.responseText)}catch(e){a=!0}a?(O("error",y,"parseerror","parseerror"),r(new Be({options:u,xhr:y,status:"parseerror",message:"parseerror"}))):(O("success",e,y.status,y),t(new Ne({options:u,data:e,status:y.status,xhr:y})))}else O("success",e="text"===y.responseType||""===y.responseType?y.responseText:y.response,y.status,y),t(new Ne({options:u,data:e,status:y.status,xhr:y}));else O("error",y,y.status,y.statusText),r(new Be({options:u,xhr:y,status:y.status,message:y.statusText}));u.statusCode&&(Le.statusCode&&Le.statusCode[y.status]&&Le.statusCode[y.status](y),u.statusCode[y.status]&&u.statusCode[y.status](y)),O("complete",y,y.status)},y.onerror=function(){O("error",y,y.status,y.status),r(new Be({options:u,xhr:y,status:y.status,message:y.statusText})),O("complete",y,"error")},u.timeout>0&&(y.timeout=u.timeout,y.ontimeout=function(){O("error",y,"timeout","timeout"),r(new Be({options:u,xhr:y,status:"timeout",message:"timeout"})),O("complete",y,"timeout")}),!1!==O("beforeSend",y,u)?y.send(C):r(new Be({options:u,xhr:y,status:"canceled",message:"canceled"}))}else r(new Be({options:u,xhr:y,status:"canceled",message:"canceled"}))}else r(new Be({options:u,status:"canceled",message:"canceled"}));function O(e){for(var t,r,a=arguments.length,n=new Array(a>1?a-1:0),o=1;o<a;o++)n[o-1]=arguments[o];return Le[e]&&(t=Le[e].apply(Le,n)),u[e]&&(r=u[e].apply(u,n)),"boolean"!=typeof t&&(t=!0),"boolean"!=typeof r&&(r=!0),(!u.abortController||!u.abortController.canceled||"beforeCreate"!==e&&"beforeOpen"!==e&&"beforeSend"!==e)&&(t&&r)}}))};function He(e){for(var t=[],r=t[0],a=t[1],n=t[2],o=t[3],i=t[4],s=arguments.length,l=new Array(s>1?s-1:0),u=1;u<s;u++)l[u-1]=arguments[u];"function"==typeof l[1]?(r=l[0],n=l[1],o=l[2],i=l[3]):(r=l[0],a=l[1],n=l[2],o=l[3],i=l[4]),[n,o].forEach((function(e){"string"==typeof e&&(i=e,e===n?n=void 0:o=void 0)}));var c={url:r,method:"post"===e||"postJSON"===e?"POST":"GET",data:a,success:n,error:o,dataType:i=i||("json"===e||"postJSON"===e?"json":void 0)};return"postJSON"===e&&pe(c,{contentType:"application/json",processData:!1,crossDomain:!0,data:"string"==typeof a?a:JSON.stringify(a)}),_e(c)}Object.assign(_e,{get:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return He.apply(void 0,["get"].concat(t))},post:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return He.apply(void 0,["post"].concat(t))},json:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return He.apply(void 0,["json"].concat(t))},getJSON:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return He.apply(void 0,["json"].concat(t))},postJSON:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return He.apply(void 0,["postJSON"].concat(t))}}),_e.abortController=function(){var e={canceled:!1,onAbort:null,abort:function(){e.canceled=!0,e.onAbort&&e.onAbort()}};return e},_e.setup=function(e){e.type&&!e.method&&pe(e,{method:e.type}),pe(Le,e)};var De={name:"request",proto:{request:_e},static:{request:_e}};var je={name:"touch",params:{touch:{touchClicksDistanceThreshold:5,disableContextMenu:!1,tapHold:!1,tapHoldDelay:750,tapHoldPreventClicks:!0,activeState:!0,activeStateElements:"a, button, label, span, .actions-button, .stepper-button, .stepper-button-plus, .stepper-button-minus, .card-expandable, .menu-item, .link, .item-link, .accordion-item-toggle",activeStateOnMouseMove:!1,mdTouchRipple:!0,iosTouchRipple:!1,auroraTouchRipple:!1,touchRippleElements:".ripple, .link, .item-link, .list-button, .links-list a, .button, button, .input-clear-button, .dialog-button, .tab-link, .item-radio, .item-checkbox, .actions-button, .searchbar-disable-button, .fab a, .checkbox, .radio, .data-table .sortable-cell:not(.input-cell), .notification-close-button, .stepper-button, .stepper-button-minus, .stepper-button-plus, .menu-item-content, .list.accordion-list .accordion-item-toggle",touchRippleInsetElements:".ripple-inset, .icon-only, .searchbar-disable-button, .input-clear-button, .notification-close-button, .md .navbar .link.back"}},create:function(){var e=Ce();pe(this,{touchEvents:{start:e.touch?"touchstart":e.pointerEvents?"pointerdown":"mousedown",move:e.touch?"touchmove":e.pointerEvents?"pointermove":"mousemove",end:e.touch?"touchend":e.pointerEvents?"pointerup":"mouseup"}})},on:{init:function(){var e,t,r,n,i,s,l,u,c,p,f,d,h=this,v=ke(),m=Ce(),g=o(),b=a(),y=h.params.touch,w=y[h.theme+"TouchRipple"];function C(e){var t,r=q(e),a=r.parents(y.activeStateElements);if(r.closest(".no-active-state").length)return null;if(r.is(y.activeStateElements)&&(t=r),a.length>0&&(t=t?t.add(a):a),t&&t.length>1){for(var n,o=[],i=0;i<t.length;i+=1)n||(o.push(t[i]),(t.eq(i).hasClass("prevent-active-state-propagation")||t.eq(i).hasClass("no-active-state-propagation"))&&(n=!0));t=q(o)}return t||r}function k(e){return e.parents(".page-content").length>0}function E(){u&&u.addClass("active-state")}function x(){u&&(u.removeClass("active-state"),u=null)}function P(e,t,r){e&&(p=h.touchRipple.create(h,e,t,r))}function O(){p&&(p.remove(),p=void 0,f=void 0)}function R(r){(f=function(e){var t=y.touchRippleElements,r=q(e);if(r.is(t))return!r.hasClass("no-ripple")&&r;if(r.parents(t).length>0){var a=r.parents(t).eq(0);return!a.hasClass("no-ripple")&&a}return!1}(r))&&0!==f.length?k(f)?(clearTimeout(d),d=setTimeout((function(){O(),P(f,e,t)}),80)):(O(),P(f,e,t)):f=void 0}function T(){clearTimeout(d),O()}function S(){p||!f||n?O():(clearTimeout(d),P(f,e,t),setTimeout(O,0))}function A(){q(".active-state").removeClass("active-state"),w&&S()}function $(e,t){h.emit({events:e,data:[t]})}function L(e){$("touchstart touchstart:active",e)}function M(e){$("touchmove touchmove:active",e)}function N(e){$("touchend touchend:active",e)}function B(e){$("touchstart:passive",e)}function _(e){$("touchmove:passive",e)}function H(e){$("touchend:passive",e)}v.ios&&v.webView&&g.addEventListener("touchstart",(function(){}));var D=!!m.passiveListener&&{passive:!0},j=!m.passiveListener||{passive:!0,capture:!0},I=!!m.passiveListener&&{passive:!1},U=!m.passiveListener||{passive:!1,capture:!0};b.addEventListener("click",(function(e){$("click",e)}),!0),m.passiveListener?(b.addEventListener(h.touchEvents.start,L,U),b.addEventListener(h.touchEvents.move,M,I),b.addEventListener(h.touchEvents.end,N,I),b.addEventListener(h.touchEvents.start,B,j),b.addEventListener(h.touchEvents.move,_,D),b.addEventListener(h.touchEvents.end,H,D)):(b.addEventListener(h.touchEvents.start,(function(e){L(e),B(e)}),!0),b.addEventListener(h.touchEvents.move,(function(e){M(e),_(e)}),!1),b.addEventListener(h.touchEvents.end,(function(e){N(e),H(e)}),!1)),m.touch?(h.on("click",(function(e){var t=e&&e.detail&&"f7Overswipe"===e.detail,a=l;return r&&e.target!==r&&(a=!t),y.tapHold&&y.tapHoldPreventClicks&&i&&(a=!0),a&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault()),y.tapHold&&(s=setTimeout((function(){i=!1}),v.ios||v.androidChrome?100:400)),l=!1,r=null,!a})),h.on("touchstart",(function(a){return n=!1,i=!1,l=!1,a.targetTouches.length>1?(u&&x(),!0):(a.touches.length>1&&u&&x(),y.tapHold&&(s&&clearTimeout(s),s=setTimeout((function(){a&&a.touches&&a.touches.length>1||(i=!0,a.preventDefault(),l=!0,q(a.target).trigger("taphold",a),h.emit("taphold",a))}),y.tapHoldDelay)),r=a.target,e=a.targetTouches[0].pageX,t=a.targetTouches[0].pageY,y.activeState&&((u=C(r))&&!k(u)?E():u&&(c=setTimeout(E,80))),w&&R(r),!0)})),h.on("touchmove",(function(r){var a,o;if("touchmove"===r.type&&(a=r.targetTouches[0],o=y.touchClicksDistanceThreshold),o&&a){var i=a.pageX,u=a.pageY;(Math.abs(i-e)>o||Math.abs(u-t)>o)&&(n=!0)}else n=!0;n&&(l=!0,y.tapHold&&clearTimeout(s),y.activeState&&(clearTimeout(c),x()),w&&T())})),h.on("touchend",(function(e){return clearTimeout(c),clearTimeout(s),b.activeElement===e.target?(y.activeState&&x(),w&&S(),!0):(y.activeState&&(E(),setTimeout(x,0)),w&&S(),!(y.tapHoldPreventClicks&&i||l)||(e.cancelable&&e.preventDefault(),l=!0,!1))})),b.addEventListener("touchcancel",(function(){r=null,clearTimeout(c),clearTimeout(s),y.activeState&&x(),w&&S()}),{passive:!0})):y.activeState&&(h.on("touchstart",(function(r){var a=C(r.target);a&&(a.addClass("active-state"),"which"in r&&3===r.which&&setTimeout((function(){q(".active-state").removeClass("active-state")}),0)),w&&(e=r.pageX,t=r.pageY,R(r.target,r.pageX,r.pageY))})),h.on("touchmove",(function(){y.activeStateOnMouseMove||q(".active-state").removeClass("active-state"),w&&T()})),h.on("touchend",A),b.addEventListener("pointercancel",A,{passive:!0})),b.addEventListener("contextmenu",(function(e){y.disableContextMenu&&(v.ios||v.android||v.cordova||g.Capacitor&&g.Capacitor.isNative)&&e.preventDefault(),w&&(u&&x(),S())}))}}};function qe(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r<e.length;){var a=e[r];if("*"!==a&&"+"!==a&&"?"!==a)if("\\"!==a)if("{"!==a)if("}"!==a)if(":"!==a)if("("!==a)t.push({type:"CHAR",index:r,value:e[r++]});else{var n=1,o="";if("?"===e[s=r+1])throw new TypeError('Pattern cannot start with "?" at '+s);for(;s<e.length;)if("\\"!==e[s]){if(")"===e[s]){if(0==--n){s++;break}}else if("("===e[s]&&(n++,"?"!==e[s+1]))throw new TypeError("Capturing groups are not allowed at "+s);o+=e[s++]}else o+=e[s++]+e[s++];if(n)throw new TypeError("Unbalanced pattern at "+r);if(!o)throw new TypeError("Missing pattern at "+r);t.push({type:"PATTERN",index:r,value:o}),r=s}else{for(var i="",s=r+1;s<e.length;){var l=e.charCodeAt(s);if(!(l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||95===l))break;i+=e[s++]}if(!i)throw new TypeError("Missing parameter name at "+r);t.push({type:"NAME",index:r,value:i}),r=s}else t.push({type:"CLOSE",index:r,value:e[r++]});else t.push({type:"OPEN",index:r,value:e[r++]});else t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});else t.push({type:"MODIFIER",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}(e),a=t.prefixes,n=void 0===a?"./":a,o="[^"+Ue(t.delimiter||"/#?")+"]+?",i=[],s=0,l=0,u="",c=function(e){if(l<r.length&&r[l].type===e)return r[l++].value},p=function(e){var t=c(e);if(void 0!==t)return t;var a=r[l],n=a.type,o=a.index;throw new TypeError("Unexpected "+n+" at "+o+", expected "+e)},f=function(){for(var e,t="";e=c("CHAR")||c("ESCAPED_CHAR");)t+=e;return t};l<r.length;){var d=c("CHAR"),h=c("NAME"),v=c("PATTERN");if(h||v){var m=d||"";-1===n.indexOf(m)&&(u+=m,m=""),u&&(i.push(u),u=""),i.push({name:h||s++,prefix:m,suffix:"",pattern:v||o,modifier:c("MODIFIER")||""})}else{var g=d||c("ESCAPED_CHAR");if(g)u+=g;else if(u&&(i.push(u),u=""),c("OPEN")){m=f();var b=c("NAME")||"",y=c("PATTERN")||"",w=f();p("CLOSE"),i.push({name:b||(y?s++:""),pattern:b&&!y?o:y,prefix:m,suffix:w,modifier:c("MODIFIER")||""})}else p("END")}}return i}function Ie(e,t){return function(e,t){void 0===t&&(t={});var r=Ve(t),a=t.encode,n=void 0===a?function(e){return e}:a,o=t.validate,i=void 0===o||o,s=e.map((function(e){if("object"==typeof e)return new RegExp("^(?:"+e.pattern+")$",r)}));return function(t){for(var r="",a=0;a<e.length;a++){var o=e[a];if("string"!=typeof o){var l=t?t[o.name]:void 0,u="?"===o.modifier||"*"===o.modifier,c="*"===o.modifier||"+"===o.modifier;if(Array.isArray(l)){if(!c)throw new TypeError('Expected "'+o.name+'" to not repeat, but got an array');if(0===l.length){if(u)continue;throw new TypeError('Expected "'+o.name+'" to not be empty')}for(var p=0;p<l.length;p++){var f=n(l[p],o);if(i&&!s[a].test(f))throw new TypeError('Expected all "'+o.name+'" to match "'+o.pattern+'", but got "'+f+'"');r+=o.prefix+f+o.suffix}}else if("string"!=typeof l&&"number"!=typeof l){if(!u){var d=c?"an array":"a string";throw new TypeError('Expected "'+o.name+'" to be '+d)}}else{f=n(String(l),o);if(i&&!s[a].test(f))throw new TypeError('Expected "'+o.name+'" to match "'+o.pattern+'", but got "'+f+'"');r+=o.prefix+f+o.suffix}}else r+=o}return r}}(qe(e,t),t)}function Ue(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Ve(e){return e&&e.sensitive?"":"i"}function ze(e,t,r){return function(e,t,r){void 0===r&&(r={});for(var a=r.strict,n=void 0!==a&&a,o=r.start,i=void 0===o||o,s=r.end,l=void 0===s||s,u=r.encode,c=void 0===u?function(e){return e}:u,p="["+Ue(r.endsWith||"")+"]|$",f="["+Ue(r.delimiter||"/#?")+"]",d=i?"^":"",h=0,v=e;h<v.length;h++){var m=v[h];if("string"==typeof m)d+=Ue(c(m));else{var g=Ue(c(m.prefix)),b=Ue(c(m.suffix));if(m.pattern)if(t&&t.push(m),g||b)if("+"===m.modifier||"*"===m.modifier){var y="*"===m.modifier?"?":"";d+="(?:"+g+"((?:"+m.pattern+")(?:"+b+g+"(?:"+m.pattern+"))*)"+b+")"+y}else d+="(?:"+g+"("+m.pattern+")"+b+")"+m.modifier;else d+="("+m.pattern+")"+m.modifier;else d+="(?:"+g+b+")"+m.modifier}}if(l)n||(d+=f+"?"),d+=r.endsWith?"(?="+p+")":"$";else{var w=e[e.length-1],C="string"==typeof w?f.indexOf(w[w.length-1])>-1:void 0===w;n||(d+="(?:"+f+"(?="+p+"))?"),C||(d+="(?="+f+"|"+p+")")}return new RegExp(d,Ve(r))}(qe(e,r),t,r)}function We(e,t,r){return e instanceof RegExp?function(e,t){if(!t)return e;for(var r=/\((?:\?<(.*?)>)?(?!\?)/g,a=0,n=r.exec(e.source);n;)t.push({name:n[1]||a++,prefix:"",suffix:"",modifier:"",pattern:""}),n=r.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,r){var a=e.map((function(e){return We(e,t,r).source}));return new RegExp("(?:"+a.join("|")+")",Ve(r))}(e,t,r):ze(e,t,r)}var Fe={queue:[],clearQueue:function(){0!==Fe.queue.length&&Fe.queue.shift()()},routerQueue:[],clearRouterQueue:function(){if(0!==Fe.routerQueue.length){var e=Fe.routerQueue.pop(),t=e.router,r=e.stateUrl,a=e.action,n=t.params.animate;!1===t.params.browserHistoryAnimate&&(n=!1),"back"===a&&t.back({animate:n,browserHistory:!1}),"load"===a&&t.navigate(r,{animate:n,browserHistory:!1})}},handle:function(e){if(!Fe.blockPopstate){var t=e.state;Fe.previousState=Fe.state,Fe.state=t,Fe.allowChange=!0,Fe.clearQueue(),(t=Fe.state)||(t={}),this.views.forEach((function(e){var r=e.router,a=t[e.id];if(!a&&e.params.browserHistory&&(a={url:e.router.history[0]}),a){var n=a.url||void 0,o=r.params.animate;!1===r.params.browserHistoryAnimate&&(o=!1),n!==r.url&&(r.history.indexOf(n)>=0?r.allowPageChange?r.back({animate:o,browserHistory:!1}):Fe.routerQueue.push({action:"back",router:r}):r.allowPageChange?r.navigate(n,{animate:o,browserHistory:!1}):Fe.routerQueue.unshift({action:"load",stateUrl:n,router:r}))}}))}},initViewState:function(e,t){var r,a=o(),n=pe({},Fe.state||{},((r={})[e]=t,r));Fe.state=n,a.history.replaceState(n,"")},push:function(e,t,r){var a,n=o();if("#!/"===r.substr(-3)&&(r=r.replace("#!/","")),Fe.allowChange){Fe.previousState=Fe.state;var i=pe({},Fe.previousState||{},((a={})[e]=t,a));Fe.state=i,n.history.pushState(i,"",r)}else Fe.queue.push((function(){Fe.push(e,t,r)}))},replace:function(e,t,r){var a,n=o();if("#!/"===r.substr(-3)&&(r=r.replace("#!/","")),Fe.allowChange){Fe.previousState=Fe.state;var i=pe({},Fe.previousState||{},((a={})[e]=t,a));Fe.state=i,n.history.replaceState(i,"",r)}else Fe.queue.push((function(){Fe.replace(e,t,r)}))},go:function(e){var t=o();Fe.allowChange=!1,t.history.go(e)},back:function(){var e=o();Fe.allowChange=!1,e.history.back()},allowChange:!0,previousState:{},state:{},blockPopstate:!0,init:function(e){var t=o(),r=a();Fe.state=t.history.state,q(t).on("load",(function(){setTimeout((function(){Fe.blockPopstate=!1}),0)})),r.readyState&&"complete"===r.readyState&&(Fe.blockPopstate=!1),q(t).on("popstate",Fe.handle.bind(e))}};function Xe(e){var t,r,a,n,o,i,s,l,u,c=e,p=c.$el,f=c.$navbarsEl,d=c.app,h=c.params,v=Ce(),m=ke(),g=!1,b=!1,y={},w=[],C=[],k=!0,E=[],x=[],P=h[d.theme+"SwipeBackAnimateShadow"],O=h[d.theme+"SwipeBackAnimateOpacity"],R=h[d.theme+"SwipeBackActiveArea"],T=h[d.theme+"SwipeBackThreshold"],S=d.rtl?"right center":"left center",A=d.rtl?"calc(100% - var(--f7-navbar-large-title-padding-left) - var(--f7-safe-area-left)) center":"calc(var(--f7-navbar-large-title-padding-left) + var(--f7-safe-area-left)) center";function $(e){var t=void 0===e?{}:e,r=t.progress,a=t.reset,n=t.transition,o=t.reflow,i=["overflow","transform","transform-origin","opacity"];if(!0===n||!1===n)for(var s=0;s<l.length;s+=1){var u=l[s];u&&u.el&&(!0===n&&u.el.classList.add("navbar-page-transitioning"),!1===n&&u.el.classList.remove("navbar-page-transitioning"))}o&&l.length&&l[0]&&l[0].el&&(l[0].el._clientLeft=l[0].el.clientLeft);for(var c=0;c<l.length;c+=1){var p=l[c];if(p&&p.el){!p.className||p.classNameSet||a||(p.el.classList.add(p.className),p.classNameSet=!0),p.className&&a&&p.el.classList.remove(p.className);for(var f=0;f<i.length;f+=1){var d=i[f];p[d]&&(a?p.el.style[d]="":"function"==typeof p[d]?p.el.style[d]=p[d](r):p.el.style[d]=p[d])}}}}function L(e){var r=h[d.theme+"SwipeBack"];!k||!r||g||d.swipeout&&d.swipeout.el||!c.allowPageChange||q(e.target).closest(".range-slider, .calendar-months").length>0||q(e.target).closest(".page-master, .page-master-detail").length>0&&h.masterDetailBreakpoint>0&&d.width>=h.masterDetailBreakpoint||(b=!1,g=!0,t=void 0,y.x="touchstart"===e.type?e.targetTouches[0].pageX:e.pageX,y.y="touchstart"===e.type?e.targetTouches[0].pageY:e.pageY,n=ie(),o=c.dynamicNavbar)}function M(e){if(g){var n="touchmove"===e.type?e.targetTouches[0].pageX:e.pageX,u="touchmove"===e.type?e.targetTouches[0].pageY:e.pageY;if(void 0===t&&(t=!!(t||Math.abs(u-y.y)>Math.abs(n-y.x))||n<y.x&&!d.rtl||n>y.x&&d.rtl),t||e.f7PreventSwipeBack||d.preventSwipeBack)g=!1;else{if(!b){var v=!1,k=q(e.target),L=k.closest(".swipeout");L.length>0&&(!d.rtl&&L.find(".swipeout-actions-left").length>0&&(v=!0),d.rtl&&L.find(".swipeout-actions-right").length>0&&(v=!0)),((w=k.closest(".page")).hasClass("no-swipeback")||k.closest(".no-swipeback, .card-opened").length>0)&&(v=!0),(C=p.find(".page-previous:not(.stacked)")).length>1&&(C=C.eq(C.length-1));y.x,p.offset().left;if(r=p.width(),(d.rtl?y.x<p.offset().left-p[0].scrollLeft+(r-R):y.x-p.offset().left>R)&&(v=!0),0!==C.length&&0!==w.length||(v=!0),v)return void(g=!1);P&&0===(i=w.find(".page-shadow-effect")).length&&(i=q('<div class="page-shadow-effect"></div>'),w.append(i)),O&&0===(s=C.find(".page-opacity-effect")).length&&(s=q('<div class="page-opacity-effect"></div>'),C.append(s)),o&&(E=f.find(".navbar-current:not(.stacked)"),(x=f.find(".navbar-previous:not(.stacked)")).length>1&&(x=x.eq(x.length-1)),l=function(){var e,t,r=[],a=d.rtl?-1:1,n=E.hasClass("navbar-transparent")&&!E.hasClass("navbar-large")&&!E.hasClass("navbar-transparent-visible"),o=E.hasClass("navbar-large"),i=E.hasClass("navbar-large-collapsed"),s=E.hasClass("navbar-large-transparent")||E.hasClass("navbar-large")&&E.hasClass("navbar-transparent"),l=x.hasClass("navbar-transparent")&&!x.hasClass("navbar-large")&&!x.hasClass("navbar-transparent-visible"),u=x.hasClass("navbar-large"),c=x.hasClass("navbar-large-collapsed"),p=x.hasClass("navbar-large-transparent")||x.hasClass("navbar-large")&&x.hasClass("navbar-transparent"),f=o&&!i,v=u&&!c,g=E.find(".left, .title, .right, .subnavbar, .fading, .title-large, .navbar-bg"),b=x.find(".left, .title, .right, .subnavbar, .fading, .title-large, .navbar-bg");return h.iosAnimateNavbarBackIcon&&(e=E.hasClass("sliding")||E.find(".navbar-inner.sliding").length?E.find(".left").find(".back .icon + span").eq(0):E.find(".left.sliding").find(".back .icon + span").eq(0),t=x.hasClass("sliding")||x.find(".navbar-inner.sliding").length?x.find(".left").find(".back .icon + span").eq(0):x.find(".left.sliding").find(".back .icon + span").eq(0),e.length&&b.each((function(t){q(t).hasClass("title")&&(t.f7NavbarLeftOffset+=e.prev(".icon")[0].offsetWidth)}))),g.each((function(t){var l=q(t),u=l.hasClass("subnavbar"),c=l.hasClass("left"),p=l.hasClass("title"),d=l.hasClass("navbar-bg");if((!p&&!d||!n)&&(f||!l.hasClass(".title-large"))){var g={el:t};if(f){if(p)return;if(l.hasClass("title-large"))return r.indexOf(g)<0&&r.push(g),g.overflow="visible",void l.find(".title-large-text").each((function(e){r.push({el:e,transform:function(e){return"translateX("+100*e*a+"%)"}})}))}if(v&&(f||l.hasClass("title-large")&&(r.indexOf(g)<0&&r.push(g),g.opacity=0),c))return r.indexOf(g)<0&&r.push(g),g.opacity=function(e){return 1-Math.pow(e,.33)},void l.find(".back span").each((function(e){r.push({el:e,"transform-origin":S,transform:function(e){return"translateX(calc("+e+" * (var(--f7-navbarTitleLargeOffset) - var(--f7-navbarLeftTextOffset)))) translateY(calc("+e+" * (var(--f7-navbar-large-title-height) - var(--f7-navbar-large-title-padding-vertical) / 2))) scale("+(1+1*e)+")"}})}));if(d)return r.indexOf(g)<0&&r.push(g),f||v||(i?(s&&(g.className="ios-swipeback-navbar-bg-large"),g.transform=function(e){return"translateX("+100*e*a+"%) translateY(calc(-1 * var(--f7-navbar-large-title-height)))"}):g.transform=function(e){return"translateX("+100*e*a+"%)"}),!f&&v&&(g.className="ios-swipeback-navbar-bg-large",g.transform=function(e){return"translateX("+100*e*a+"%) translateY(calc(-1 * "+(1-e)+" * var(--f7-navbar-large-title-height)))"}),f&&v&&(g.transform=function(e){return"translateX("+100*e*a+"%)"}),void(f&&!v&&(g.transform=function(e){return"translateX("+100*e*a+"%) translateY(calc(-"+e+" * var(--f7-navbar-large-title-height)))"}));if(!l.hasClass("title-large")){var b=l.hasClass("sliding")||l.parents(".navbar-inner.sliding").length;if(r.indexOf(g)<0&&r.push(g),(!u||u&&!b)&&(g.opacity=function(e){return 1-Math.pow(e,.33)}),b){var y=g;if(c&&e.length&&h.iosAnimateNavbarBackIcon){var w={el:e[0]};y=w,r.push(w)}y.transform=function(e){var t=e*y.el.f7NavbarRightOffset;return 1===m.pixelRatio&&(t=Math.round(t)),u&&o?"translate3d("+t+"px, calc(-1 * var(--f7-navbar-large-collapse-progress) * var(--f7-navbar-large-title-height)), 0)":"translate3d("+t+"px,0,0)"}}}}})),b.each((function(e){var n=q(e),o=n.hasClass("subnavbar"),i=n.hasClass("left"),s=n.hasClass("title"),d=n.hasClass("navbar-bg");if(!s&&!d||!l){var g={el:e};if(v){if(s)return;if(r.indexOf(g)<0&&r.push(g),n.hasClass("title-large"))return g.opacity=1,g.overflow="visible",void n.find(".title-large-text").each((function(e){r.push({el:e,"transform-origin":A,opacity:function(e){return Math.pow(e,3)},transform:function(e){return"translateX(calc("+(1-e)+" * (var(--f7-navbarLeftTextOffset) - var(--f7-navbarTitleLargeOffset)))) translateY(calc("+(e-1)+" * var(--f7-navbar-large-title-height) + "+(1-e)+" * var(--f7-navbar-large-title-padding-vertical))) scale("+(.5+.5*e)+")"}})}))}if(d)return r.indexOf(g)<0&&r.push(g),f||v||(c?(p&&(g.className="ios-swipeback-navbar-bg-large"),g.transform=function(e){return"translateX("+(100*e-100)*a+"%) translateY(calc(-1 * var(--f7-navbar-large-title-height)))"}):g.transform=function(e){return"translateX("+(100*e-100)*a+"%)"}),!f&&v&&(g.transform=function(e){return"translateX("+(100*e-100)*a+"%) translateY(calc(-1 * "+(1-e)+" * var(--f7-navbar-large-title-height)))"}),f&&!v&&(g.className="ios-swipeback-navbar-bg-large",g.transform=function(e){return"translateX("+(100*e-100)*a+"%) translateY(calc(-"+e+" * var(--f7-navbar-large-title-height)))"}),void(f&&v&&(g.transform=function(e){return"translateX("+(100*e-100)*a+"%)"}));if(!n.hasClass("title-large")){var b=n.hasClass("sliding")||x.children(".navbar-inner.sliding").length;if(r.indexOf(g)<0&&r.push(g),(!o||o&&!b)&&(g.opacity=function(e){return Math.pow(e,3)}),b){var y=g;if(i&&t.length&&h.iosAnimateNavbarBackIcon){var w={el:t[0]};y=w,r.push(w)}y.transform=function(e){var t=y.el.f7NavbarLeftOffset*(1-e);return 1===m.pixelRatio&&(t=Math.round(t)),o&&u?"translate3d("+t+"px, calc(-1 * var(--f7-navbar-large-collapse-progress) * var(--f7-navbar-large-title-height)), 0)":"translate3d("+t+"px,0,0)"}}}}})),r}()),q(".sheet.modal-in").length>0&&d.sheet&&d.sheet.close(q(".sheet.modal-in"))}e.f7PreventSwipePanel=!0,b=!0,d.preventSwipePanelBySwipeBack=!0,e.preventDefault();var M=d.rtl?-1:1;(a=(n-y.x-T)*M)<0&&(a=0);var N=Math.min(Math.max(a/r,0),1),B={percentage:N,progress:N,currentPageEl:w[0],previousPageEl:C[0],currentNavbarEl:E[0],previousNavbarEl:x[0]};p.trigger("swipeback:move",B),c.emit("swipebackMove",B);var _=a*M,H=(a/5-r/5)*M;d.rtl?(_=Math.max(_,-r),H=Math.max(H,0)):(_=Math.min(_,r),H=Math.min(H,0)),1===m.pixelRatio&&(_=Math.round(_),H=Math.round(H)),c.swipeBackActive=!0,q([w[0],C[0]]).addClass("page-swipeback-active"),w.transform("translate3d("+_+"px,0,0)"),P&&(i[0].style.opacity=1-1*N),"ios"===d.theme&&C.transform("translate3d("+H+"px,0,0)"),O&&(s[0].style.opacity=1-1*N),o&&$({progress:N})}}}function N(){if(d.preventSwipePanelBySwipeBack=!1,!g||!b)return g=!1,void(b=!1);g=!1,b=!1,c.swipeBackActive=!1;var e=q([w[0],C[0]]);if(e.removeClass("page-swipeback-active"),0===a)return e.transform(""),i&&i.length>0&&i.remove(),s&&s.length>0&&s.remove(),void(o&&$({reset:!0}));var t=ie()-n,l=!1;(t<300&&a>10||t>=300&&a>r/2)&&(w.removeClass("page-current").addClass("page-next"+("ios"!==d.theme?" page-next-on-right":"")),C.removeClass("page-previous").addClass("page-current").removeAttr("aria-hidden"),i&&(i[0].style.opacity=""),s&&(s[0].style.opacity=""),o&&(c.setNavbarPosition(E,"next"),c.setNavbarPosition(x,"current",!1)),l=!0),e.addClass("page-transitioning page-transitioning-swipeback"),m.ios&&(w[0]._clientLeft=w[0].clientLeft),e.transform(""),o&&$({progress:l?1:0,transition:!0,reflow:!!m.ios}),k=!1,c.allowPageChange=!1;var u={currentPageEl:w[0],previousPageEl:C[0],currentNavbarEl:E[0],previousNavbarEl:x[0]};l?(c.currentRoute=C[0].f7Page.route,c.currentPage=C[0],c.pageCallback("beforeOut",w,E,"current","next",{route:w[0].f7Page.route,swipeBack:!0}),c.pageCallback("beforeIn",C,x,"previous","current",{route:C[0].f7Page.route,swipeBack:!0},w[0]),p.trigger("swipeback:beforechange",u),c.emit("swipebackBeforeChange",u)):(p.trigger("swipeback:beforereset",u),c.emit("swipebackBeforeReset",u)),w.transitionEnd((function(){e.removeClass("page-transitioning page-transitioning-swipeback"),o&&$({reset:!0,transition:!1}),k=!0,c.allowPageChange=!0,l?(1===c.history.length&&c.history.unshift(c.url),c.history.pop(),c.saveHistory(),h.browserHistory&&Fe.back(),c.pageCallback("afterOut",w,E,"current","next",{route:w[0].f7Page.route,swipeBack:!0}),c.pageCallback("afterIn",C,x,"previous","current",{route:C[0].f7Page.route,swipeBack:!0}),h.stackPages&&c.initialPages.indexOf(w[0])>=0?(w.addClass("stacked"),o&&E.addClass("stacked")):(c.pageCallback("beforeRemove",w,E,"next",{swipeBack:!0}),c.removePage(w),o&&c.removeNavbar(E)),p.trigger("swipeback:afterchange",u),c.emit("swipebackAfterChange",u),c.emit("routeChanged",c.currentRoute,c.previousRoute,c),h.preloadPreviousPage&&c.back(c.history[c.history.length-2],{preload:!0})):(p.trigger("swipeback:afterreset",u),c.emit("swipebackAfterReset",u)),i&&i.length>0&&i.remove(),s&&s.length>0&&s.remove()}))}u=!("touchstart"!==d.touchEvents.start||!v.passiveListener)&&{passive:!0,capture:!1},p.on(d.touchEvents.start,L,u),d.on("touchmove:active",M),d.on("touchend:passive",N),c.on("routerDestroy",(function(){var e=!("touchstart"!==d.touchEvents.start||!v.passiveListener)&&{passive:!0,capture:!1};p.off(d.touchEvents.start,L,e),d.off("touchmove:active",M),d.off("touchend:passive",N)}))}function Qe(e,t,r){var a=this,n=t.route.redirect,o="forward"===e?"navigate":"back";if(r.initial&&a.params.browserHistory&&(r.replaceState=!0,r.history=!0),"function"==typeof n){a.allowPageChange=!1;var i=n.call(a,{router:a,to:t,resolve:function(e,t){void 0===t&&(t={}),a.allowPageChange=!0,a[o](e,pe({},r,t))},reject:function(){a.allowPageChange=!0},direction:e,app:a.app});return i&&"string"==typeof i?(a.allowPageChange=!0,a[o](i,r)):a}return a[o](n,r)}function Ye(e,t,r,a,n,o,i,s){var l=[];Array.isArray(r)?l.push.apply(l,r):r&&"function"==typeof r&&l.push(r),t&&(Array.isArray(t)?l.push.apply(l,t):l.push(t)),function t(){0!==l.length?l.shift().call(e,{router:e,to:a,from:n,resolve:function(){t()},reject:function(){i()},direction:s,app:e.app}):o()}()}function Je(e,t,r,a,n){var o=this;function i(){e&&e.route&&(o.params.routesBeforeEnter||e.route.beforeEnter)?(o.allowPageChange=!1,Ye(o,o.params.routesBeforeEnter,e.route.beforeEnter,e,t,(function(){o.allowPageChange=!0,r()}),(function(){a()}),n)):r()}t&&t.route&&(o.params.routesBeforeLeave||t.route.beforeLeave)?(o.allowPageChange=!1,Ye(o,o.params.routesBeforeLeave,t.route.beforeLeave,e,t,(function(){o.allowPageChange=!0,i()}),(function(){a()}),n)):i()}function Ge(e,t){if(!e.view)throw new Error("Framework7: it is not allowed to use router methods on global app router. Use router methods only on related View, e.g. app.views.main.router."+t+"(...)")}function Ke(e,t,r,a){function n(e){e.then((function(e){r({component:e.default||e._default||e})})).catch((function(e){throw a(),new Error(e)}))}if(t instanceof Promise)n(t);else{var o=t.call(e);o instanceof Promise?n(o):r({component:o})}}function Ze(e,t,r){void 0===r&&(r={});var n,o,i,s=a(),l=q(t),u=e.app,c=e.view,p=pe(!1,{animate:e.params.animate,browserHistory:!0,replaceState:!1,history:!0,reloadCurrent:e.params.reloadPages,reloadPrevious:!1,reloadAll:!1,clearPreviousHistory:!1,reloadDetail:e.params.reloadDetail,on:{}},r),f=e.params.masterDetailBreakpoint>0,d=f&&p.route&&p.route.route&&(!0===p.route.route.master||"function"==typeof p.route.route.master&&p.route.route.master(u,e)),h=0,v=e.currentRoute.modal;if(v||"popup popover sheet loginScreen actions customModal panel".split(" ").forEach((function(t){e.currentRoute&&e.currentRoute.route&&e.currentRoute.route[t]&&(v=!0,i=t)})),v){var m=e.currentRoute.modal||e.currentRoute.route.modalInstance||u[i].get(),g=e.history[e.history.length-2],b=e.findMatchingRoute(g);!b&&g&&(b={url:g,path:g.split("?")[0],query:se(g),route:{path:g.split("?")[0],url:g}}),e.modalRemove(m)}var y,w,C,k,E=e.dynamicNavbar,x=e.$el,P=l,O=p.reloadPrevious||p.reloadCurrent||p.reloadAll;if(e.allowPageChange=!1,0===P.length)return e.allowPageChange=!0,e;P.length&&e.removeThemeElements(P),E&&(C=P.children(".navbar"),w=e.$navbarsEl,0===C.length&&P[0]&&P[0].f7Page&&(C=P[0].f7Page.$navbarEl)),p.route&&p.route.route&&p.route.route.keepAlive&&!p.route.route.keepAliveData&&(p.route.route.keepAliveData={pageEl:l[0]});var R,T,S,A,$=x.children(".page:not(.stacked)").filter((function(e){return e!==P[0]}));if(E&&(R=w.children(".navbar:not(.stacked)").filter((function(e){return e!==C[0]}))),p.reloadPrevious&&$.length<2)return e.allowPageChange=!0,e;if(f&&!p.reloadAll){for(var L=0;L<$.length;L+=1)n||!$[L].classList.contains("page-master")||(n=$[L]);if((T=!d&&n)&&n)for(var M=0;M<$.length;M+=1)$[M].classList.contains("page-master-detail")&&(o=$[M]);S=T&&p.reloadDetail&&u.width>=e.params.masterDetailBreakpoint&&n}T&&(A=!o||S||p.reloadAll||p.reloadCurrent);var N="next";if(p.reloadCurrent||p.reloadAll||S?N="current":p.reloadPrevious&&(N="previous"),P.removeClass("page-previous page-current page-next").addClass("page-"+N+(d?" page-master":"")+(T?" page-master-detail":"")+(A?" page-master-detail-root":"")).removeClass("stacked").trigger("page:unstack").trigger("page:position",{position:N}),e.emit("pageUnstack",P[0]),e.emit("pagePosition",P[0],N),(d||T)&&(P.trigger("page:role",{role:d?"master":"detail",root:!!A}),e.emit("pageRole",P[0],{role:d?"master":"detail",detailRoot:!!A})),E&&C.length&&(C.removeClass("navbar-previous navbar-current navbar-next").addClass("navbar-"+N+(d?" navbar-master":"")+(T?" navbar-master-detail":"")+(A?" navbar-master-detail-root":"")).removeClass("stacked"),C.trigger("navbar:position",{position:N}),e.emit("navbarPosition",C[0],N),(d||T)&&e.emit("navbarRole",C[0],{role:d?"master":"detail",detailRoot:!!A})),p.reloadCurrent||S)S?(y=$.filter((function(e){return!e.classList.contains("page-master")})),E&&(k=q(y.map((function(e){return u.navbar.getElByPage(e)})))),y.length>1&&n&&(h=y.length-1,q(n).removeClass("page-master-stacked").trigger("page:masterunstack"),e.emit("pageMasterUnstack",n),E&&(q(u.navbar.getElByPage(n)).removeClass("navbar-master-stacked"),e.emit("navbarMasterUnstack",u.navbar.getElByPage(n))))):(y=$.eq($.length-1),E&&(k=q(u.navbar.getElByPage(y))));else if(p.reloadPrevious)y=$.eq($.length-2),E&&(k=q(u.navbar.getElByPage(y)));else if(p.reloadAll)y=$.filter((function(e){return e!==P[0]})),E&&(k=R.filter((function(e){return e!==C[0]})));else{var B=[],_=[];if($.length>1){var H=0;for(H=0;H<$.length-1;H+=1)if(n&&$[H]===n)$.eq(H).addClass("page-master-stacked"),$.eq(H).trigger("page:masterstack"),e.emit("pageMasterStack",$[H]),E&&(q(u.navbar.getElByPage(n)).addClass("navbar-master-stacked"),e.emit("navbarMasterStack",u.navbar.getElByPage(n)));else{var D=u.navbar.getElByPage($.eq(H));e.params.stackPages?($.eq(H).addClass("stacked"),$.eq(H).trigger("page:stack"),e.emit("pageStack",$[H]),E&&q(D).addClass("stacked")):(B.push($[H]),e.pageCallback("beforeRemove",$[H],R&&R[H],"previous",void 0,p),e.removePage($[H]),E&&D&&(_.push(D),e.removeNavbar(D)))}}y=x.children(".page:not(.stacked)").filter((function(e){return e!==P[0]&&B.indexOf(e)<0})),E&&(k=w.children(".navbar:not(.stacked)").filter((function(e){return e!==C[0]&&_.indexOf(_)<0}))),B=[],_=[]}if(T&&!p.reloadAll&&((y.length>1||S)&&(y=y.filter((function(e){return!e.classList.contains("page-master")}))),k&&(k.length>1||S)&&(k=k.filter((function(e){return!e.classList.contains("navbar-master")})))),e.params.browserHistory&&(p.browserHistory||p.replaceState)&&!p.reloadPrevious){var j=e.params.browserHistoryRoot||"";Fe[p.reloadCurrent||S&&o||p.reloadAll||p.replaceState?"replace":"push"](c.id,{url:p.route.url},j+e.params.browserHistorySeparator+p.route.url)}p.reloadPrevious||(e.currentPageEl=P[0],E&&C.length?e.currentNavbarEl=C[0]:delete e.currentNavbarEl,e.currentRoute=p.route);var I=p.route.url;p.history&&(((p.reloadCurrent||S&&o)&&e.history.length)>0||p.replaceState?(S&&h>0&&(e.history=e.history.slice(0,e.history.length-h)),e.history[e.history.length-(p.reloadPrevious?2:1)]=I):p.reloadPrevious?e.history[e.history.length-2]=I:p.reloadAll?e.history=[I]:e.history.push(I)),e.saveHistory();var U=P.parents(s).length>0,V=P[0].f7Component;if(p.reloadPrevious?(V&&!U?V.mount((function(e){q(e).insertBefore(y)})):P.insertBefore(y),E&&C.length&&(C.find(".title-large").length&&C.addClass("navbar-large"),k.length?C.insertBefore(k):(e.$navbarsEl.parents(s).length||e.$el.prepend(e.$navbarsEl),w.append(C)))):(y.next(".page")[0]!==P[0]&&(V&&!U?V.mount((function(e){x.append(e)})):x.append(P[0])),E&&C.length&&(C.find(".title-large").length&&C.addClass("navbar-large"),e.$navbarsEl.parents(s).length||e.$el.prepend(e.$navbarsEl),w.append(C[0]))),U?p.route&&p.route.route&&p.route.route.keepAlive&&!P[0].f7PageMounted&&(P[0].f7PageMounted=!0,e.pageCallback("mounted",P,C,N,O?N:"current",p,y)):e.pageCallback("mounted",P,C,N,O?N:"current",p,y),(p.reloadCurrent||S)&&y.length>0?e.params.stackPages&&e.initialPages.indexOf(y[0])>=0?(y.addClass("stacked"),y.trigger("page:stack"),e.emit("pageStack",y[0]),E&&k.addClass("stacked")):(e.pageCallback("beforeOut",y,k,"current",void 0,p),e.pageCallback("afterOut",y,k,"current",void 0,p),e.pageCallback("beforeRemove",y,k,"current",void 0,p),e.removePage(y),E&&k&&k.length&&e.removeNavbar(k)):p.reloadAll?y.each((function(t,r){var a=q(t),n=q(u.navbar.getElByPage(a));e.params.stackPages&&e.initialPages.indexOf(a[0])>=0?(a.addClass("stacked"),a.trigger("page:stack"),e.emit("pageStack",a[0]),E&&n.addClass("stacked")):(a.hasClass("page-current")&&(e.pageCallback("beforeOut",y,k,"current",void 0,p),e.pageCallback("afterOut",y,k,"current",void 0,p)),e.pageCallback("beforeRemove",a,k&&k.eq(r),"previous",void 0,p),e.removePage(a),E&&n.length&&e.removeNavbar(n))})):p.reloadPrevious&&(e.params.stackPages&&e.initialPages.indexOf(y[0])>=0?(y.addClass("stacked"),y.trigger("page:stack"),e.emit("pageStack",y[0]),E&&k.addClass("stacked")):(e.pageCallback("beforeRemove",y,k,"previous",void 0,p),e.removePage(y),E&&k&&k.length&&e.removeNavbar(k))),p.route.route.tab&&e.tabLoad(p.route.route.tab,pe({},p,{history:!1,browserHistory:!1})),f&&c.checkMasterDetailBreakpoint(),e.pageCallback("init",P,C,N,O?N:"current",p,y),p.reloadCurrent||p.reloadAll||S)return e.allowPageChange=!0,e.pageCallback("beforeIn",P,C,N,"current",p),P.removeAttr("aria-hidden"),E&&C&&C.removeAttr("aria-hidden"),e.pageCallback("afterIn",P,C,N,"current",p),p.reloadCurrent&&p.clearPreviousHistory&&e.clearPreviousHistory(),S&&(e.setPagePosition(q(n),"previous"),n.f7Page&&n.f7Page.navbarEl&&e.setNavbarPosition(q(n.f7Page.navbarEl),"previous")),e;if(p.reloadPrevious)return e.allowPageChange=!0,e;function z(){e.setPagePosition(P,"current",!1),e.setPagePosition(y,"previous",!y.hasClass("page-master")),E&&(e.setNavbarPosition(C,"current",!1),e.setNavbarPosition(k,"previous",!k.hasClass("navbar-master"))),e.allowPageChange=!0,e.pageCallback("afterOut",y,k,"current","previous",p),e.pageCallback("afterIn",P,C,"next","current",p);var t=(e.params.preloadPreviousPage||e.params[u.theme+"SwipeBack"])&&!d;t||(P.hasClass("smart-select-page")||P.hasClass("photo-browser-page")||P.hasClass("autocomplete-page")||P.hasClass("color-picker-page"))&&(t=!0),t||(e.params.stackPages?(y.addClass("stacked"),y.trigger("page:stack"),e.emit("pageStack",y[0]),E&&k.addClass("stacked")):P.attr("data-name")&&"smart-select-page"===P.attr("data-name")||(e.pageCallback("beforeRemove",y,k,"previous",void 0,p),e.removePage(y),E&&k.length&&e.removeNavbar(k))),p.clearPreviousHistory&&e.clearPreviousHistory(),e.emit("routeChanged",e.currentRoute,e.previousRoute,e),e.params.browserHistory&&Fe.clearRouterQueue()}function W(){e.setPagePosition(y,"current",!1),e.setPagePosition(P,"next",!1),E&&(e.setNavbarPosition(k,"current",!1),e.setNavbarPosition(C,"next",!1))}if(e.pageCallback("beforeOut",y,k,"current","previous",p),e.pageCallback("beforeIn",P,C,"next","current",p),!p.animate||d&&u.width>=e.params.masterDetailBreakpoint)z();else{var F=e.params[e.app.theme+"PageLoadDelay"],X=e.params.transition;p.transition&&(X=p.transition),!X&&e.currentRoute&&e.currentRoute.route&&(X=e.currentRoute.route.transition),!X&&e.currentRoute&&e.currentRoute.route.options&&(X=e.currentRoute.route.options.transition),X&&(P[0].f7PageTransition=X),F?setTimeout((function(){W(),e.animate(y,P,k,C,"forward",X,(function(){z()}))}),F):(W(),e.animate(y,P,k,C,"forward",X,(function(){z()})))}return e}function et(e,t,r,a){if(void 0===t&&(t={}),void 0===r&&(r={}),!e.allowPageChange&&!a)return e;var n=t,o=r,i=n.url,s=n.content,l=n.el,u=n.pageName,c=n.component,p=n.componentUrl;if(!o.reloadCurrent&&o.route&&o.route.route&&o.route.route.parentPath&&e.currentRoute.route&&e.currentRoute.route.parentPath===o.route.route.parentPath){if(o.route.url===e.url)return e.allowPageChange=!0,!1;var f=Object.keys(o.route.params).length===Object.keys(e.currentRoute.params).length;if(f&&Object.keys(o.route.params).forEach((function(t){t in e.currentRoute.params&&e.currentRoute.params[t]===o.route.params[t]||(f=!1)})),f)return!!o.route.route.tab&&e.tabLoad(o.route.route.tab,o);if(!f&&o.route.route.tab&&e.currentRoute.route.tab&&e.currentRoute.parentPath===o.route.parentPath)return e.tabLoad(o.route.route.tab,o)}if(o.route&&o.route.url&&e.url===o.route.url&&!o.reloadCurrent&&!o.reloadPrevious&&!e.params.allowDuplicateUrls)return e.allowPageChange=!0,!1;if(!o.route&&i&&(o.route=e.parseRouteUrl(i),pe(o.route,{route:{url:i,path:i}})),(i||p||c)&&(e.allowPageChange=!1),s)Ze(e,e.getPageEl(s),o);else if(l)Ze(e,e.getPageEl(l),o);else if(u)Ze(e,e.$el.children('.page[data-name="'+u+'"]').eq(0),o);else if(c||p)try{e.pageComponentLoader({routerEl:e.el,component:c,componentUrl:p,options:o,resolve:function(t,r){return Ze(e,t,pe(o,r))},reject:function(){return e.allowPageChange=!0,e}})}catch(t){throw e.allowPageChange=!0,t}else i&&(e.xhrAbortController&&(e.xhrAbortController.abort(),e.xhrAbortController=!1),e.xhrRequest(i,o).then((function(t){Ze(e,e.getPageEl(t),o)})).catch((function(){e.allowPageChange=!0})));return e}function tt(e,t,r){var n,o,i,s,l,u,c,p,f=ke(),d=a(),h=q(t),v=e.app,m=e.view,g=pe({animate:e.params.animate,browserHistory:!0,replaceState:!1},r),b=e.params.masterDetailBreakpoint>0,y=b&&g.route&&g.route.route&&(!0===g.route.route.master||"function"==typeof g.route.route.master&&g.route.route.master(v,e)),w=e.dynamicNavbar,C=h,k=e.$el.children(".page-current"),E=0===k.length&&g.preload,x=b&&k.hasClass("page-master");if(C.length&&e.removeThemeElements(C),w&&(s=C.children(".navbar"),i=e.$navbarsEl,0===s.length&&C[0]&&C[0].f7Page&&(s=C[0].f7Page.$navbarEl),l=i.find(".navbar-current")),e.allowPageChange=!1,0===C.length||0===k.length&&!g.preload)return e.allowPageChange=!0,e;if(e.removeThemeElements(C),g.route&&g.route.route&&g.route.route.keepAlive&&!g.route.route.keepAliveData&&(g.route.route.keepAliveData={pageEl:h[0]}),b){for(var P=e.$el.children(".page:not(.stacked)").filter((function(e){return e!==C[0]})),O=0;O<P.length;O+=1)n||!P[O].classList.contains("page-master")||(n=P[O]);!(u=!y&&n&&e.history.indexOf(g.route.url)>e.history.indexOf(n.f7Page.route.url))&&!y&&n&&n.f7Page&&g.route.route.masterRoute&&(u=g.route.route.masterRoute.path===n.f7Page.route.route.path)}if(u&&n&&n.f7Page&&(c=e.history.indexOf(g.route.url)-e.history.indexOf(n.f7Page.route.url)==1),C.addClass("page-"+(E?"current":"previous")+(y?" page-master":"")+(u?" page-master-detail":"")+(c?" page-master-detail-root":"")).removeClass("stacked").removeAttr("aria-hidden").trigger("page:unstack").trigger("page:position",{position:E?"current":"previous"}),e.emit("pageUnstack",C[0]),e.emit("pagePosition",C[0],E?"current":"previous"),(y||u)&&(C.trigger("page:role",{role:y?"master":"detail",root:!!c}),e.emit("pageRole",C[0],{role:y?"master":"detail",detailRoot:!!c})),w&&s.length>0&&(s.addClass("navbar-"+(E?"current":"previous")+(y?" navbar-master":"")+(u?" navbar-master-detail":"")+(c?" navbar-master-detail-root":"")).removeClass("stacked").removeAttr("aria-hidden"),s.trigger("navbar:position",{position:E?"current":"previous"}),e.emit("navbarPosition",s[0],E?"current":"previous"),(y||c)&&e.emit("navbarRole",s[0],{role:y?"master":"detail",detailRoot:!!c})),g.force&&(k.prev(".page-previous:not(.stacked)").length>0||0===k.prev(".page-previous").length))if(e.history.indexOf(g.route.url)>=0?(p=e.history.length-e.history.indexOf(g.route.url)-1,e.history=e.history.slice(0,e.history.indexOf(g.route.url)+2),m.history=e.history):e.history[[e.history.length-2]]?e.history[e.history.length-2]=g.route.url:e.history.unshift(e.url),p&&e.params.stackPages)k.prevAll(".page-previous").each((function(t){var r,a=q(t);w&&(r=q(v.navbar.getElByPage(a))),a[0]!==C[0]&&a.index()>C.index()&&(e.initialPages.indexOf(a[0])>=0?(a.addClass("stacked"),a.trigger("page:stack"),e.emit("pageStack",a[0]),w&&r.addClass("stacked")):(e.pageCallback("beforeRemove",a,r,"previous",void 0,g),a[0]===n&&(o=!0),e.removePage(a),w&&r.length>0&&e.removeNavbar(r)))}));else{var R,T=k.prev(".page-previous:not(.stacked)");w&&(R=q(v.navbar.getElByPage(T))),e.params.stackPages&&e.initialPages.indexOf(T[0])>=0?(T.addClass("stacked"),T.trigger("page:stack"),e.emit("pageStack",T[0]),R.addClass("stacked")):T.length>0&&(e.pageCallback("beforeRemove",T,R,"previous",void 0,g),T[0]===n&&(o=!0),e.removePage(T),w&&R.length&&e.removeNavbar(R))}var S=C.parents(d).length>0,A=C[0].f7Component;function $(){E&&(!S&&A?A.mount((function(t){e.$el.append(t)})):e.$el.append(C)),0===C.next(k).length&&(!S&&A?A.mount((function(e){q(e).insertBefore(k)})):C.insertBefore(k)),w&&s.length&&(s.find(".title-large").length&&s.addClass("navbar-large"),s.insertBefore(l),l.length>0?s.insertBefore(l):(e.$navbarsEl.parents(d).length||e.$el.prepend(e.$navbarsEl),i.append(s))),S?g.route&&g.route.route&&g.route.route.keepAlive&&!C[0].f7PageMounted&&(C[0].f7PageMounted=!0,e.pageCallback("mounted",C,s,"previous","current",g,k)):e.pageCallback("mounted",C,s,"previous","current",g,k)}if(g.preload){$(),g.route.route.tab&&e.tabLoad(g.route.route.tab,pe({},g,{history:!1,browserHistory:!1,preload:!0})),y&&(C.removeClass("page-master-stacked").trigger("page:masterunstack"),e.emit("pageMasterUnstack",C[0]),w&&(q(v.navbar.getElByPage(C)).removeClass("navbar-master-stacked"),e.emit("navbarMasterUnstack",v.navbar.getElByPage(C)))),e.pageCallback("init",C,s,"previous","current",g,k),E&&(e.pageCallback("beforeIn",C,s,"current",void 0,g),e.pageCallback("afterIn",C,s,"current",void 0,g));var L=C.prevAll(".page-previous:not(.stacked):not(.page-master)");return L.length>0&&L.each((function(t){var r,a=q(t);w&&(r=q(v.navbar.getElByPage(a))),e.params.stackPages&&e.initialPages.indexOf(t)>=0?(a.addClass("stacked"),a.trigger("page:stack"),e.emit("pageStack",a[0]),w&&r.addClass("stacked")):(e.pageCallback("beforeRemove",a,r,"previous",void 0),e.removePage(a),w&&r.length&&e.removeNavbar(r))})),e.allowPageChange=!0,e}if(!(f.ie||f.edge||f.firefox&&!f.ios)&&e.params.browserHistory&&g.browserHistory)if(g.replaceState){var M=e.params.browserHistoryRoot||"";Fe.replace(m.id,{url:g.route.url},M+e.params.browserHistorySeparator+g.route.url)}else p?Fe.go(-p):Fe.back();if(g.replaceState?e.history[e.history.length-1]=g.route.url:(1===e.history.length&&e.history.unshift(e.url),e.history.pop()),e.saveHistory(),e.currentPageEl=C[0],w&&s.length?e.currentNavbarEl=s[0]:delete e.currentNavbarEl,e.currentRoute=g.route,(f.ie||f.edge||f.firefox&&!f.ios)&&e.params.browserHistory&&g.browserHistory)if(g.replaceState){var N=e.params.browserHistoryRoot||"";Fe.replace(m.id,{url:g.route.url},N+e.params.browserHistorySeparator+g.route.url)}else p?Fe.go(-p):Fe.back();function B(){e.setPagePosition(C,"current",!1),e.setPagePosition(k,"next",!0),w&&(e.setNavbarPosition(s,"current",!1),e.setNavbarPosition(l,"next",!0)),e.pageCallback("afterOut",k,l,"current","next",g),e.pageCallback("afterIn",C,s,"previous","current",g),e.params.stackPages&&e.initialPages.indexOf(k[0])>=0?(k.addClass("stacked"),k.trigger("page:stack"),e.emit("pageStack",k[0]),w&&l.addClass("stacked")):(e.pageCallback("beforeRemove",k,l,"next",void 0,g),e.removePage(k),w&&l.length&&e.removeNavbar(l)),e.allowPageChange=!0,e.emit("routeChanged",e.currentRoute,e.previousRoute,e),(e.params.preloadPreviousPage||e.params[v.theme+"SwipeBack"])&&e.history[e.history.length-2]&&!y&&e.back(e.history[e.history.length-2],{preload:!0}),e.params.browserHistory&&Fe.clearRouterQueue()}if($(),g.route.route.tab&&e.tabLoad(g.route.route.tab,pe({},g,{history:!1,browserHistory:!1})),b&&(x||o)&&m.checkMasterDetailBreakpoint(!1),e.pageCallback("init",C,s,"previous","current",g,k),e.pageCallback("beforeOut",k,l,"current","next",g),e.pageCallback("beforeIn",C,s,"previous","current",g),!g.animate||x&&v.width>=e.params.masterDetailBreakpoint)B();else{var _=e.params.transition;k[0]&&k[0].f7PageTransition&&(_=k[0].f7PageTransition,delete k[0].f7PageTransition),g.transition&&(_=g.transition),!_&&e.previousRoute&&e.previousRoute.route&&(_=e.previousRoute.route.transition),!_&&e.previousRoute&&e.previousRoute.route&&e.previousRoute.route.options&&(_=e.previousRoute.route.options.transition),e.setPagePosition(k,"current"),e.setPagePosition(C,"previous",!1),w&&(e.setNavbarPosition(l,"current"),e.setNavbarPosition(s,"previous",!1)),e.animate(k,C,l,s,"backward",_,(function(){B()}))}return e}function rt(e,t,r,a){if(!e.allowPageChange&&!a)return e;var n=t,o=r,i=n.url,s=n.content,l=n.el,u=n.pageName,c=n.component,p=n.componentUrl;if(o.route.url&&e.url===o.route.url&&!o.reloadCurrent&&!o.reloadPrevious&&!e.params.allowDuplicateUrls)return!1;if(!o.route&&i&&(o.route=e.parseRouteUrl(i)),(i||p||c)&&(e.allowPageChange=!1),s)tt(e,e.getPageEl(s),o);else if(l)tt(e,e.getPageEl(l),o);else if(u)tt(e,e.$el.children('.page[data-name="'+u+'"]').eq(0),o);else if(c||p)try{e.pageComponentLoader({routerEl:e.el,component:c,componentUrl:p,options:o,resolve:function(t,r){return tt(e,t,pe(o,r))},reject:function(){return e.allowPageChange=!0,e}})}catch(t){throw e.allowPageChange=!0,t}else i&&(e.xhrAbortController&&(e.xhrAbortController.abort(),e.xhrAbortController=!1),e.xhrRequest(i,o).then((function(t){tt(e,e.getPageEl(t),o)})).catch((function(){e.allowPageChange=!0})));return e}var at=function(e){function t(t,r){var a,n=J(a=e.call(this,{},[void 0===r?t:r])||this);n.isAppRouter=void 0===r,n.isAppRouter?pe(!1,n,{app:t,params:t.params.view,routes:t.routes||[],cache:t.cache}):pe(!1,n,{app:t,view:r,viewId:r.id,id:r.params.routerId,params:r.params,routes:r.routes,history:r.history,scrollHistory:r.scrollHistory,cache:t.cache,dynamicNavbar:"ios"===t.theme&&r.params.iosDynamicNavbar,initialPages:[],initialNavbars:[]}),n.useModules(),n.allowPageChange=!0;var o={},i={};return Object.defineProperty(n,"currentRoute",{enumerable:!0,configurable:!0,set:function(e){void 0===e&&(e={}),i=pe({},o),(o=e)&&(n.url=o.url,n.emit("routeChange",e,i,n))},get:function(){return o}}),Object.defineProperty(n,"previousRoute",{enumerable:!0,configurable:!0,get:function(){return i},set:function(e){i=e}}),n||J(a)}z(t,e);var r=t.prototype;return r.mount=function(){var e=this,t=e.view;pe(!1,e,{tempDom:a().createElement("div"),$el:t.$el,el:t.el,$navbarsEl:t.$navbarsEl,navbarsEl:t.navbarsEl}),e.emit("local::mount routerMount",e)},r.animatableNavElements=function(e,t,r,a,n){var o,i,s=this,l=s.dynamicNavbar,u=s.params.iosAnimateNavbarBackIcon;function c(e,t){var r,a=e.hasClass("sliding")||t.hasClass("sliding"),n=e.hasClass("subnavbar"),o=!a||!n,i=e.find(".back .icon");return a&&u&&e.hasClass("left")&&i.length>0&&i.next("span").length&&(e=i.next("span"),r=!0),{$el:e,isIconLabel:r,leftOffset:e[0].f7NavbarLeftOffset,rightOffset:e[0].f7NavbarRightOffset,isSliding:a,isSubnavbar:n,needsOpacityTransition:o}}return l&&(o=[],i=[],e.children(".navbar-inner").children(".left, .right, .title, .subnavbar").each((function(t){var i=q(t);i.hasClass("left")&&a&&"forward"===n||i.hasClass("title")&&r||o.push(c(i,e.children(".navbar-inner")))})),t.hasClass("navbar-master")&&s.params.masterDetailBreakpoint>0&&s.app.width>=s.params.masterDetailBreakpoint||t.children(".navbar-inner").children(".left, .right, .title, .subnavbar").each((function(e){var o=q(e);o.hasClass("left")&&r&&!a&&"forward"===n||o.hasClass("left")&&r&&"backward"===n||o.hasClass("title")&&a||i.push(c(o,t.children(".navbar-inner")))})),[i,o].forEach((function(e){e.forEach((function(t){var r=t,a=t.isSliding,n=t.$el,s=e===i?o:i;a&&n.hasClass("title")&&s&&s.forEach((function(e){if(e.isIconLabel){var t=e.$el[0];r.leftOffset+=t&&t.offsetLeft||0}}))}))}))),{newNavEls:o,oldNavEls:i}},r.animate=function(e,t,r,a,n,o,i){var s=this;if(s.params.animateCustom)s.params.animateCustom.apply(s,[e,t,r,a,n,i]);else{var l=s.dynamicNavbar,u="ios"===s.app.theme;if(o){var c="router-transition-custom router-transition-"+o+"-"+n;return("forward"===n?t:e).animationEnd((function(){s.$el.removeClass(c),l&&s.$navbarsEl.length&&(a&&s.$navbarsEl.prepend(a),r&&s.$navbarsEl.prepend(r)),i&&i()})),l&&(a&&t&&(s.setNavbarPosition(a,""),a.removeClass("navbar-next navbar-previous navbar-current"),t.prepend(a)),r&&e&&(s.setNavbarPosition(r,""),r.removeClass("navbar-next navbar-previous navbar-current"),e.prepend(r))),void s.$el.addClass(c)}var p,f,d,h,v,m,g,b="router-transition-"+n+" router-transition";if(u&&l){s.params.masterDetailBreakpoint>0&&s.app.width>=s.params.masterDetailBreakpoint&&(r.hasClass("navbar-master")&&a.hasClass("navbar-master-detail")||r.hasClass("navbar-master-detail")&&a.hasClass("navbar-master"))||(m=r&&r.hasClass("navbar-large"),g=a&&a.hasClass("navbar-large"),d=m&&!r.hasClass("navbar-large-collapsed"),h=g&&!a.hasClass("navbar-large-collapsed"),v=d&&!h||h&&!d);var y=s.animatableNavElements(a,r,h,d,n);p=y.newNavEls,f=y.oldNavEls}("forward"===n?t:e).animationEnd((function(){s.dynamicNavbar&&(a&&(a.removeClass("router-navbar-transition-to-large router-navbar-transition-from-large"),a.addClass("navbar-no-title-large-transition"),oe((function(){a.removeClass("navbar-no-title-large-transition")}))),r&&r.removeClass("router-navbar-transition-to-large router-navbar-transition-from-large"),a.hasClass("sliding")||a.children(".navbar-inner.sliding").length?a.find(".title, .left, .right, .left .icon, .subnavbar").transform(""):a.find(".sliding").transform(""),r.hasClass("sliding")||r.children(".navbar-inner.sliding").length?r.find(".title, .left, .right, .left .icon, .subnavbar").transform(""):r.find(".sliding").transform("")),s.$el.removeClass(b),i&&i()})),l?(w(0),oe((function(){s.$el.addClass(b),v&&(s.el._clientLeft=s.el.clientLeft),w(1)}))):s.$el.addClass(b)}function w(e){u&&l&&(1===e&&(h&&(a.addClass("router-navbar-transition-to-large"),r.addClass("router-navbar-transition-to-large")),d&&(a.addClass("router-navbar-transition-from-large"),r.addClass("router-navbar-transition-from-large"))),p.forEach((function(t){var r=t.$el,a="forward"===n?t.rightOffset:t.leftOffset;t.isSliding&&(t.isSubnavbar&&g?r[0].style.setProperty("transform","translate3d("+a*(1-e)+"px, calc(-1 * var(--f7-navbar-large-collapse-progress) * var(--f7-navbar-large-title-height)), 0)","important"):r.transform("translate3d("+a*(1-e)+"px,0,0)"))})),f.forEach((function(t){var r=t.$el,a="forward"===n?t.leftOffset:t.rightOffset;t.isSliding&&(t.isSubnavbar&&m?r.transform("translate3d("+a*e+"px, calc(-1 * var(--f7-navbar-large-collapse-progress) * var(--f7-navbar-large-title-height)), 0)"):r.transform("translate3d("+a*e+"px,0,0)"))})))}},r.removeModal=function(e){this.removeEl(e)},r.removeTabContent=function(e){q(e).html("")},r.removeNavbar=function(e){this.removeEl(e)},r.removePage=function(e){var t=q(e),r=t&&t[0]&&t[0].f7Page;r&&r.route&&r.route.route&&r.route.route.keepAlive?t.remove():this.removeEl(e)},r.removeEl=function(e){if(e){var t=this,r=q(e);0!==r.length&&(r.find(".tab").each((function(e){q(e).children().each((function(e){e.f7Component&&(q(e).trigger("tab:beforeremove"),e.f7Component.destroy())}))})),r[0].f7Component&&r[0].f7Component.destroy&&r[0].f7Component.destroy(),t.params.removeElements&&(t.params.removeElementsWithTimeout?setTimeout((function(){r.remove()}),t.params.removeElementsTimeout):r.remove()))}},r.getPageEl=function(e){var t=this;if("string"==typeof e)t.tempDom.innerHTML=e;else{if(q(e).hasClass("page"))return e;t.tempDom.innerHTML="",q(t.tempDom).append(e)}return t.findElement(".page",t.tempDom)},r.findElement=function(e,t,r){var a=this,n=a.view,o=a.app,i=q(t),s=e;r&&(s+=":not(.stacked)");var l=i.find(s).filter((function(e){return 0===q(e).parents(".popup, .dialog, .popover, .actions-modal, .sheet-modal, .login-screen, .page").length}));return l.length>1&&("string"==typeof n.selector&&(l=i.find(n.selector+" "+s)),l.length>1&&(l=i.find("."+o.params.viewMainClass+" "+s))),1===l.length?l:(r||(l=a.findElement(s,i,!0)),l&&1===l.length?l:l&&l.length>1?q(l[0]):void 0)},r.flattenRoutes=function(e){void 0===e&&(e=this.routes);var t=this,r=[];return e.forEach((function(e){var a=!1;if("tabs"in e&&e.tabs){var n=e.tabs.map((function(t){var r=pe({},e,{path:(e.path+"/"+t.path).replace("///","/").replace("//","/"),parentPath:e.path,tab:t});return delete r.tabs,delete r.routes,r}));a=!0,r=r.concat(t.flattenRoutes(n))}if("detailRoutes"in e){var o=e.detailRoutes.map((function(t){var r=pe({},t);return r.masterRoute=e,r.masterRoutePath=e.path,r}));r=r.concat(e,t.flattenRoutes(o))}if("routes"in e){var i=e.routes.map((function(t){var r=pe({},t);return r.path=(e.path+"/"+r.path).replace("///","/").replace("//","/"),r}));r=a?r.concat(t.flattenRoutes(i)):r.concat(e,t.flattenRoutes(i))}"routes"in e||"tabs"in e&&e.tabs||"detailRoutes"in e||r.push(e)})),r},r.parseRouteUrl=function(e){if(!e)return{};var t=se(e),r=e.split("#")[1],a=e.split("#")[0].split("?")[0];return{query:t,hash:r,params:{},url:e,path:a}},r.generateUrl=function(e){if(void 0===e&&(e={}),"string"==typeof e)return e;var t=e,r=t.name,a=t.path,n=t.params,o=t.query;if(!r&&!a)throw new Error('Framework7: "name" or "path" parameter is required');var i=this,s=r?i.findRouteByKey("name",r):i.findRouteByKey("path",a);if(!s)throw r?new Error('Framework7: route with name "'+r+'" not found'):new Error('Framework7: route with path "'+a+'" not found');var l=i.constructRouteUrl(s,{params:n,query:o});if(!l)throw new Error("Framework7: can't construct URL for route with name \""+r+'"');return l},r.constructRouteUrl=function(e,t){var r,a=void 0===t?{}:t,n=a.params,o=a.query,i=e.path,s=Ie(i);try{r=s(n||{})}catch(e){throw new Error("Framework7: error constructing route URL from passed params:\nRoute: "+i+"\n"+e.toString())}return o&&(r+="string"==typeof o?"?"+o:"?"+le(o)),r},r.findTabRoute=function(e){var t,r=this,a=q(e),n=r.currentRoute.route.parentPath,o=a.attr("id");return r.flattenRoutes(r.routes).forEach((function(e){e.parentPath===n&&e.tab&&e.tab.id===o&&(t=e)})),t},r.findRouteByKey=function(e,t){var r,a=this.routes;return this.flattenRoutes(a).forEach((function(a){r||a[e]===t&&(r=a)})),r},r.findMatchingRoute=function(e){if(e){var t,r=this,a=r.routes,n=r.flattenRoutes(a),o=r.parseRouteUrl(e),i=o.path,s=o.query,l=o.hash,u=o.params;return n.forEach((function(r){if(!t){var a,n,o=[],c=[r.path];if(r.alias&&("string"==typeof r.alias?c.push(r.alias):Array.isArray(r.alias)&&r.alias.forEach((function(e){c.push(e)}))),c.forEach((function(e){a||(a=We(e,o).exec(i))})),a)o.forEach((function(e,t){if("number"!=typeof e.name){var r=a[t+1];u[e.name]=null==r?r:decodeURIComponent(r)}})),r.parentPath&&(n=i.split("/").slice(0,r.parentPath.split("/").length-1).join("/")),t={query:s,hash:l,params:u,url:e,path:i,parentPath:n,route:r,name:r.name}}})),t}},r.replaceRequestUrlParams=function(e,t){void 0===e&&(e=""),void 0===t&&(t={});var r=e;return"string"==typeof r&&r.indexOf("{{")>=0&&t&&t.route&&t.route.params&&Object.keys(t.route.params).length&&Object.keys(t.route.params).forEach((function(e){var a=new RegExp("{{"+e+"}}","g");r=r.replace(a,t.route.params[e]||"")})),r},r.removeFromXhrCache=function(e){for(var t=this.cache.xhr,r=!1,a=0;a<t.length;a+=1)t[a].url===e&&(r=a);!1!==r&&t.splice(r,1)},r.xhrRequest=function(e,t){var r=this,a=r.params,n=t.ignoreCache,o=e,i=o.indexOf("?")>=0;return a.passRouteQueryToRequest&&t&&t.route&&t.route.query&&Object.keys(t.route.query).length&&(o+=(i?"&":"?")+le(t.route.query),i=!0),a.passRouteParamsToRequest&&t&&t.route&&t.route.params&&Object.keys(t.route.params).length&&(o+=(i?"&":"?")+le(t.route.params),i=!0),o.indexOf("{{")>=0&&(o=r.replaceRequestUrlParams(o,t)),a.xhrCacheIgnoreGetParameters&&o.indexOf("?")>=0&&(o=o.split("?")[0]),new Promise((function(e,i){if(a.xhrCache&&!n&&o.indexOf("nocache")<0&&a.xhrCacheIgnore.indexOf(o)<0)for(var s=0;s<r.cache.xhr.length;s+=1){var l=r.cache.xhr[s];if(l.url===o&&ie()-l.time<a.xhrCacheDuration)return void e(l.content)}r.xhrAbortController=r.app.request.abortController(),r.app.request({abortController:r.xhrAbortController,url:o,method:"GET",beforeSend:function(e){r.emit("routerAjaxStart",e,t)},complete:function(n,s){r.emit("routerAjaxComplete",n),"error"!==s&&"timeout"!==s&&n.status>=200&&n.status<300||0===n.status?(a.xhrCache&&""!==n.responseText&&(r.removeFromXhrCache(o),r.cache.xhr.push({url:o,time:ie(),content:n.responseText})),r.emit("routerAjaxSuccess",n,t),e(n.responseText)):(r.emit("routerAjaxError",n,t),i(n))},error:function(e){r.emit("routerAjaxError",e,t),i(e)}})}))},r.setNavbarPosition=function(e,t,r){e.removeClass("navbar-previous navbar-current navbar-next"),t&&e.addClass("navbar-"+t),!1===r?e.removeAttr("aria-hidden"):!0===r&&e.attr("aria-hidden","true"),e.trigger("navbar:position",{position:t}),this.emit("navbarPosition",e[0],t)},r.setPagePosition=function(e,t,r){e.removeClass("page-previous page-current page-next"),e.addClass("page-"+t),!1===r?e.removeAttr("aria-hidden"):!0===r&&e.attr("aria-hidden","true"),e.trigger("page:position",{position:t}),this.emit("pagePosition",e[0],t)},r.removeThemeElements=function(e){var t,r=this.app.theme;"ios"===r?t=".md-only, .aurora-only, .if-md, .if-aurora, .if-not-ios, .not-ios":"md"===r?t=".ios-only, .aurora-only, .if-ios, .if-aurora, .if-not-md, .not-md":"aurora"===r&&(t=".ios-only, .md-only, .if-ios, .if-md, .if-not-aurora, .not-aurora"),q(e).find(t).remove()},r.getPageData=function(e,t,r,a,n,o){void 0===n&&(n={});var i,s,l=this,u=q(e).eq(0),c=q(t).eq(0),p=u[0].f7Page||{};if(("next"===r&&"current"===a||"current"===r&&"previous"===a)&&(i="forward"),("current"===r&&"next"===a||"previous"===r&&"current"===a)&&(i="backward"),p&&!p.fromPage){var f=q(o);f.length&&(s=f[0].f7Page)}(s=p.pageFrom||s)&&s.pageFrom&&(s.pageFrom=null);var d={app:l.app,view:l.view,router:l,$el:u,el:u[0],$pageEl:u,pageEl:u[0],$navbarEl:c,navbarEl:c[0],name:u.attr("data-name"),position:r,from:r,to:a,direction:i,route:p.route?p.route:n,pageFrom:s};return u[0].f7Page=d,d},r.pageCallback=function(e,t,r,a,n,o,i){if(void 0===o&&(o={}),t){var s=this,l=q(t);if(l.length){var u=q(r),c=o.route,p=s.params.restoreScrollTopOnBack&&!(s.params.masterDetailBreakpoint>0&&l.hasClass("page-master")&&s.app.width>=s.params.masterDetailBreakpoint),f=l[0].f7Page&&l[0].f7Page.route&&l[0].f7Page.route.route&&l[0].f7Page.route.route.keepAlive;"beforeRemove"===e&&f&&(e="beforeUnmount");var d="page"+(e[0].toUpperCase()+e.slice(1,e.length)),h="page:"+e.toLowerCase(),v={};(v="beforeRemove"===e&&l[0].f7Page?pe(l[0].f7Page,{from:a,to:n,position:a}):s.getPageData(l[0],u[0],a,n,c,i)).swipeBack=!!o.swipeBack;var m=o.route?o.route.route:{},g=m.on,b=void 0===g?{}:g,y=m.once,w=void 0===y?{}:y;if(o.on&&pe(b,o.on),o.once&&pe(w,o.once),"mounted"===e&&E(),"init"===e){if(p&&("previous"===a||!a)&&"current"===n&&s.scrollHistory[v.route.url]&&!l.hasClass("no-restore-scroll")){var C=l.find(".page-content");C.length>0&&(C=C.filter((function(e){return 0===q(e).parents(".tab:not(.tab-active)").length&&!q(e).is(".tab:not(.tab-active)")}))),C.scrollTop(s.scrollHistory[v.route.url])}if(E(),l[0].f7PageInitialized)return l.trigger("page:reinit",v),void s.emit("pageReinit",v);l[0].f7PageInitialized=!0}if(p&&"beforeOut"===e&&"current"===a&&"previous"===n){var k=l.find(".page-content");k.length>0&&(k=k.filter((function(e){return 0===q(e).parents(".tab:not(.tab-active)").length&&!q(e).is(".tab:not(.tab-active)")}))),s.scrollHistory[v.route.url]=k.scrollTop()}p&&"beforeOut"===e&&"current"===a&&"next"===n&&delete s.scrollHistory[v.route.url],l.trigger(h,v),s.emit(d,v),"beforeRemove"!==e&&"beforeUnmount"!==e||(l[0].f7RouteEventsAttached&&(l[0].f7RouteEventsOn&&Object.keys(l[0].f7RouteEventsOn).forEach((function(e){l.off(te(e),l[0].f7RouteEventsOn[e])})),l[0].f7RouteEventsOnce&&Object.keys(l[0].f7RouteEventsOnce).forEach((function(e){l.off(te(e),l[0].f7RouteEventsOnce[e])})),l[0].f7RouteEventsAttached=null,l[0].f7RouteEventsOn=null,l[0].f7RouteEventsOnce=null,delete l[0].f7RouteEventsAttached,delete l[0].f7RouteEventsOn,delete l[0].f7RouteEventsOnce),f||(l[0].f7Page&&l[0].f7Page.navbarEl&&delete l[0].f7Page.navbarEl.f7Page,l[0].f7Page=null))}}function E(){l[0].f7RouteEventsAttached||(l[0].f7RouteEventsAttached=!0,b&&Object.keys(b).length>0&&(l[0].f7RouteEventsOn=b,Object.keys(b).forEach((function(e){b[e]=b[e].bind(s),l.on(te(e),b[e])}))),w&&Object.keys(w).length>0&&(l[0].f7RouteEventsOnce=w,Object.keys(w).forEach((function(e){w[e]=w[e].bind(s),l.once(te(e),w[e])}))))}},r.saveHistory=function(){var e=this,t=o();e.view.history=e.history,e.params.browserHistory&&e.params.browserHistoryStoreHistory&&t.localStorage&&(t.localStorage["f7router-"+e.view.id+"-history"]=JSON.stringify(e.history))},r.restoreHistory=function(){var e=this,t=o();e.params.browserHistory&&e.params.browserHistoryStoreHistory&&t.localStorage&&t.localStorage["f7router-"+e.view.id+"-history"]&&(e.history=JSON.parse(t.localStorage["f7router-"+e.view.id+"-history"]),e.view.history=e.history)},r.clearHistory=function(){var e=this;e.history=[],e.view&&(e.view.history=[]),e.saveHistory()},r.updateCurrentUrl=function(e){var t=this;Ge(t,"updateCurrentUrl"),t.history.length?t.history[t.history.length-1]=e:t.history.push(e);var r=t.parseRouteUrl(e),a=r.query,n=r.hash,o=r.params,i=r.url,s=r.path;if(t.currentRoute&&pe(t.currentRoute,{query:a,hash:n,params:o,url:i,path:s}),t.params.browserHistory){var l=t.params.browserHistoryRoot||"";Fe.replace(t.view.id,{url:e},l+t.params.browserHistorySeparator+e)}t.saveHistory(),t.emit("routeUrlUpdate",t.currentRoute,t)},r.getInitialUrl=function(){var e=this;if(e.initialUrl)return{initialUrl:e.initialUrl,historyRestored:e.historyRestored};var t,r=e.app,n=e.view,i=a(),s=o(),l=r.params.url&&"string"==typeof r.params.url&&"undefined"!=typeof URL?new URL(r.params.url):i.location,u=e.params.url,c=l.href.split(l.origin)[1],p=e.params,f=p.browserHistory,d=p.browserHistoryOnLoad,h=p.browserHistorySeparator,v=e.params.browserHistoryRoot;return(s.cordova||s.Capacitor&&s.Capacitor.isNative)&&f&&!h&&!v&&l.pathname.indexOf("index.html")&&(console.warn("Framework7: wrong or not complete browserHistory configuration, trying to guess browserHistoryRoot"),v=l.pathname.split("index.html")[0]),f&&d?(v&&c.indexOf(v)>=0&&""===(c=c.split(v)[1])&&(c="/"),u=h.length>0&&c.indexOf(h)>=0?c.split(h)[1]:c,e.restoreHistory(),e.history.indexOf(u)>=0?e.history=e.history.slice(0,e.history.indexOf(u)+1):e.params.url===u?e.history=[u]:Fe.state&&Fe.state[n.id]&&Fe.state[n.id].url===e.history[e.history.length-1]?u=e.history[e.history.length-1]:e.history=[c.split(h)[0]||"/",u],e.history.length>1?t=!0:e.history=[],e.saveHistory()):(u||(u=c),l.search&&u.indexOf("?")<0&&(u+=l.search),l.hash&&u.indexOf("#")<0&&(u+=l.hash)),e.initialUrl=u,e.historyRestored=t,{initialUrl:u,historyRestored:t}},r.init=function(){var e=this,t=e.app,r=e.view,n=a();e.mount();var o=e.getInitialUrl(),i=o.initialUrl,s=o.historyRestored;(r&&e.params.iosSwipeBack&&"ios"===t.theme||r&&e.params.mdSwipeBack&&"md"===t.theme||r&&e.params.auroraSwipeBack&&"aurora"===t.theme)&&Xe(e);var l,u=e.params,c=u.browserHistory,p=u.browserHistoryOnLoad,f=u.browserHistoryAnimateOnLoad,d=u.browserHistoryInitialMatch;if(e.history.length>1){var h=d?i:e.history[0];(l=e.findMatchingRoute(h))||(l=pe(e.parseRouteUrl(h),{route:{url:h,path:h.split("?")[0]}}))}else(l=e.findMatchingRoute(i))||(l=pe(e.parseRouteUrl(i),{route:{url:i,path:i.split("?")[0]}}));if(e.params.stackPages&&e.$el.children(".page").each((function(t){var r=q(t);e.initialPages.push(r[0]),e.dynamicNavbar&&r.children(".navbar").length>0&&e.initialNavbars.push(r.children(".navbar")[0])})),0===e.$el.children(".page:not(.stacked)").length&&i&&e.params.loadInitialPage)e.navigate(i,{initial:!0,reloadCurrent:!0,browserHistory:!1,animate:!1,once:{modalOpen:function(){s&&((e.params.preloadPreviousPage||e.params[t.theme+"SwipeBack"])&&e.history.length>1&&e.back({preload:!0}))},pageAfterIn:function(){s&&((e.params.preloadPreviousPage||e.params[t.theme+"SwipeBack"])&&e.history.length>1&&e.back({preload:!0}))}}});else if(e.$el.children(".page:not(.stacked)").length){var v;if(e.currentRoute=l,e.$el.children(".page:not(.stacked)").each((function(a){var o,i=q(a);e.setPagePosition(i,"current"),e.dynamicNavbar&&((o=i.children(".navbar")).length>0?(e.$navbarsEl.parents(n).length||e.$el.prepend(e.$navbarsEl),e.setNavbarPosition(o,"current"),e.$navbarsEl.append(o),o.children(".title-large").length&&o.addClass("navbar-large"),i.children(".navbar").remove()):(e.$navbarsEl.addClass("navbar-hidden"),o.children(".title-large").length&&e.$navbarsEl.addClass("navbar-hidden navbar-large-hidden"))),e.currentRoute&&e.currentRoute.route&&(!0===e.currentRoute.route.master||"function"==typeof e.currentRoute.route.master&&e.currentRoute.route.master(t,e))&&e.params.masterDetailBreakpoint>0&&(i.addClass("page-master"),i.trigger("page:role",{role:"master"}),o&&o.length&&o.addClass("navbar-master"),r.checkMasterDetailBreakpoint());var s={route:e.currentRoute};e.currentRoute&&e.currentRoute.route&&e.currentRoute.route.options&&pe(s,e.currentRoute.route.options),e.currentPageEl=i[0],e.dynamicNavbar&&o.length&&(e.currentNavbarEl=o[0]),e.removeThemeElements(i),e.dynamicNavbar&&o.length&&e.removeThemeElements(o),s.route.route.tab&&(v=!0,e.tabLoad(s.route.route.tab,pe({},s))),e.pageCallback("init",i,o,"current",void 0,s),e.pageCallback("beforeIn",i,o,"current",void 0,s),e.pageCallback("afterIn",i,o,"current",void 0,s)})),s)if(d)(e.params.preloadPreviousPage||e.params[t.theme+"SwipeBack"])&&e.history.length>1&&e.back({preload:!0});else e.navigate(i,{initial:!0,browserHistory:!1,history:!1,animate:f,once:{pageAfterIn:function(){(e.params.preloadPreviousPage||e.params[t.theme+"SwipeBack"])&&e.history.length>2&&e.back({preload:!0})}}});s||v||(e.history.push(i),e.saveHistory())}!(i&&c&&p)||Fe.state&&Fe.state[r.id]||Fe.initViewState(r.id,{url:i}),e.emit("local::init routerInit",e)},r.destroy=function(){var e=this;e.emit("local::destroy routerDestroy",e),Object.keys(e).forEach((function(t){e[t]=null,delete e[t]})),e=null},t}(xe);at.prototype.navigate=function(e,t){void 0===t&&(t={});var r,a,n,o,i,s,l,u=this;if(u.swipeBackActive)return u;if("string"==typeof e?r=e:(r=e.url,a=e.route,n=e.name,o=e.path,i=e.query,s=e.params),n||o)return(r=u.generateUrl({path:o,name:n,params:s,query:i}))?u.navigate(r,t):u;var c=u.app;if(Ge(u,"navigate"),"#"===r||""===r)return u;var p=r.replace("./","");if("/"!==p[0]&&0!==p.indexOf("#")){var f=u.currentRoute.parentPath||u.currentRoute.path;p=((f?f+"/":"/")+p).replace("///","/").replace("//","/")}if(!(l=a?pe(u.parseRouteUrl(p),{route:pe({},a)}):u.findMatchingRoute(p)))return u;if(l.route&&l.route.viewName){var d=l.route.viewName,h=c.views[d];if(!h)throw new Error('Framework7: There is no View with "'+d+'" name that was specified in this route');if(h!==u.view)return h.router.navigate(e,t)}if(l.route.redirect)return Qe.call(u,"forward",l,t);var v={};if(l.route.options?pe(v,l.route.options,t):pe(v,t),v.openIn&&(!u.params.ignoreOpenIn||u.params.ignoreOpenIn&&u.history.length>0))return function(e,t,r){var a={url:t,route:{path:t,options:V({},r,{openIn:void 0})}},n=V({},r);if("popup"===r.openIn&&(n.content='<div class="popup popup-router-open-in" data-url="'+t+'"><div class="view view-init" data-links-view="'+e.view.selector+'" data-url="'+t+'" data-ignore-open-in="true"></div></div>',a.route.popup=n),"loginScreen"===r.openIn&&(n.content='<div class="login-screen login-screen-router-open-in" data-url="'+t+'"><div class="view view-init" data-links-view="'+e.view.selector+'" data-url="'+t+'" data-ignore-open-in="true"></div></div>',a.route.loginScreen=n),"sheet"===r.openIn&&(n.content='<div class="sheet-modal sheet-modal-router-open-in" data-url="'+t+'"><div class="sheet-modal-inner"><div class="view view-init" data-links-view="'+e.view.selector+'" data-url="'+t+'" data-ignore-open-in="true"></div></div></div>',a.route.sheet=n),"popover"===r.openIn&&(n.targetEl=r.clickedEl||r.targetEl,n.content='<div class="popover popover-router-open-in" data-url="'+t+'"><div class="popover-inner"><div class="view view-init" data-links-view="'+e.view.selector+'" data-url="'+t+'" data-ignore-open-in="true"></div></div></div>',a.route.popover=n),r.openIn.indexOf("panel")>=0){var o=r.openIn.split(":"),i=o[1]||"left",s=o[2]||"cover";n.targetEl=r.clickedEl||r.targetEl,n.content='<div class="panel panel-router-open-in panel-'+i+" panel-"+s+'" data-url="'+t+'"><div class="view view-init" data-links-view="'+e.view.selector+'" data-url="'+t+'" data-ignore-open-in="true"></div></div>',a.route.panel=n}return e.navigate(a)}(u,p,v);function m(){var e=!1;function t(e,t){u.allowPageChange=!1;var r=!1;"popup popover sheet loginScreen actions customModal panel".split(" ").forEach((function(a){if(e[a]){r=!0;var n=pe({},l,{route:e});u.allowPageChange=!0,u.modalLoad(a,n,pe(v,t),"forward")}})),r||et(u,e,pe(v,t),!0)}function r(){u.allowPageChange=!0}"popup popover sheet loginScreen actions customModal panel".split(" ").forEach((function(t){l.route[t]&&!e&&(e=!0,u.modalLoad(t,l,v,"forward"))})),l.route.keepAlive&&l.route.keepAliveData&&(et(u,{el:l.route.keepAliveData.pageEl},v,!1),e=!0),"url content component pageName el componentUrl".split(" ").forEach((function(t){var r;l.route[t]&&!e&&(e=!0,et(u,((r={})[t]=l.route[t],r),v,!1))})),e||(l.route.async&&(u.allowPageChange=!1,l.route.async.call(u,{router:u,to:v.route,from:u.currentRoute,resolve:t,reject:r,direction:"forward",app:c})),l.route.asyncComponent&&Ke(u,l.route.asyncComponent,t,r))}function g(){u.allowPageChange=!0}if(v.route=l,u.params.masterDetailBreakpoint>0&&l.route.masterRoute){var b=!0,y=!1;if(u.currentRoute&&u.currentRoute.route&&(!(!0===u.currentRoute.route.master||"function"==typeof u.currentRoute.route.master&&u.currentRoute.route.master(c,u))||u.currentRoute.route!==l.route.masterRoute&&u.currentRoute.route.path!==l.route.masterRoute.path||(b=!1),!u.currentRoute.route.masterRoute||u.currentRoute.route.masterRoute!==l.route.masterRoute&&u.currentRoute.route.masterRoute.path!==l.route.masterRoute.path||(b=!1,y=!0)),b||y&&t.reloadAll)return u.navigate({path:l.route.masterRoute.path,params:l.params||{}},{animate:!1,reloadAll:t.reloadAll,reloadCurrent:t.reloadCurrent,reloadPrevious:t.reloadPrevious,browserHistory:!t.initial,history:!t.initial,once:{pageAfterIn:function(){u.navigate(e,pe({},t,{animate:!1,reloadAll:!1,reloadCurrent:!1,reloadPrevious:!1,history:!t.initial,browserHistory:!t.initial}))}}}),u}return Je.call(u,l,u.currentRoute,(function(){l.route.modules?c.loadModules(Array.isArray(l.route.modules)?l.route.modules:[l.route.modules]).then((function(){m()})).catch((function(){g()})):m()}),(function(){g()}),"forward"),u},at.prototype.refreshPage=function(){var e=this;return Ge(e,"refreshPage"),e.navigate(e.currentRoute.url,{ignoreCache:!0,reloadCurrent:!0})},at.prototype.tabLoad=function(e,t){void 0===t&&(t={});var r,a,n=this,o=pe({animate:n.params.animate,browserHistory:!0,history:!0,parentPageEl:null,preload:!1,on:{}},t);o.route&&(o.preload||o.route===n.currentRoute||(a=n.previousRoute,n.currentRoute=o.route),o.preload?(r=o.route,a=n.currentRoute):(r=n.currentRoute,a||(a=n.previousRoute)),n.params.browserHistory&&o.browserHistory&&!o.reloadPrevious&&Fe.replace(n.view.id,{url:o.route.url},(n.params.browserHistoryRoot||"")+n.params.browserHistorySeparator+o.route.url),o.history&&(n.history[Math.max(n.history.length-1,0)]=o.route.url,n.saveHistory()));var i,s=q(o.parentPageEl||n.currentPageEl);i=s.length&&s.find("#"+e.id).length?s.find("#"+e.id).eq(0):n.view.selector?n.view.selector+" #"+e.id:"#"+e.id;var l,u=n.app.tab.show({tabEl:i,animate:o.animate,tabRoute:o.route}),c=u.$newTabEl,p=u.$oldTabEl,f=u.animated,d=u.onTabsChanged;if(c&&c.parents(".page").length>0&&o.route){var h=c.parents(".page")[0].f7Page;h&&o.route&&(h.route=o.route)}if(c[0].f7RouterTabLoaded)return p&&p.length?(f?d((function(){n.emit("routeChanged",n.currentRoute,n.previousRoute,n)})):n.emit("routeChanged",n.currentRoute,n.previousRoute,n),n):n;function v(t,r){var a=t.url,o=t.content,i=t.el,s=t.component,l=t.componentUrl;function u(t){n.allowPageChange=!0,t&&("string"==typeof t?c.html(t):(c.html(""),t.f7Component?t.f7Component.mount((function(e){c.append(e)})):c.append(t)),c[0].f7RouterTabLoaded=!0,function(t){n.removeThemeElements(c);var r=c;"string"!=typeof t&&(r=q(t)),r.trigger("tab:init tab:mounted",e),n.emit("tabInit tabMounted",c[0],e),p&&p.length&&(f?d((function(){n.emit("routeChanged",n.currentRoute,n.previousRoute,n),n.params.unloadTabContent&&n.tabRemove(p,c,e)})):(n.emit("routeChanged",n.currentRoute,n.previousRoute,n),n.params.unloadTabContent&&n.tabRemove(p,c,e)))}(t))}if(o)u(o);else if(i)u(i);else if(s||l)try{n.tabComponentLoader({tabEl:c[0],component:s,componentUrl:l,options:r,resolve:u,reject:function(){return n.allowPageChange=!0,n}})}catch(e){throw n.allowPageChange=!0,e}else a&&(n.xhrAbortController&&(n.xhrAbortController.abort(),n.xhrAbortController=!1),n.xhrRequest(a,r).then((function(e){u(e)})).catch((function(){n.allowPageChange=!0})))}function m(e,t){v(e,pe(o,t))}function g(){n.allowPageChange=!0}return"url content component el componentUrl".split(" ").forEach((function(t){var r;e[t]&&(l=!0,v(((r={})[t]=e[t],r),o))})),e.async?e.async.call(n,{router:n,to:r,from:a,resolve:m,reject:g,app:n.app}):e.asyncComponent?Ke(n,e.asyncComponent,m,g):l||(n.allowPageChange=!0),n},at.prototype.tabRemove=function(e,t,r){var a;e[0]&&(e[0].f7RouterTabLoaded=!1,delete e[0].f7RouterTabLoaded),e.children().each((function(e){e.f7Component&&(a=!0,q(e).trigger("tab:beforeremove",r),e.f7Component.destroy())})),a||e.trigger("tab:beforeremove",r),this.emit("tabBeforeRemove",e[0],t[0],r),this.removeTabContent(e[0],r)},at.prototype.modalLoad=function(e,t,r,a){void 0===r&&(r={});var n,o=this,i=o.app,s="panel"===e,l=s?"panel":"modal",u=pe({animate:o.params.animate,browserHistory:!0,history:!0,on:{},once:{}},r),c=pe({},t.route[e]),p=t.route,f=function(e,t){var r,a=u.on,n=u.once;"open"===t&&(r=a.modalOpen||n.modalOpen||a.panelOpen||n.panelOpen),"close"===t&&(r=a.modalClose||n.modalClose||a.panelClose||n.panelClose),"closed"===t&&(r=a.modalClosed||n.modalClosed||a.panelClosed||n.panelClosed),r&&r(e)};function d(){var r=i[e].create(c);p.modalInstance=r;var a=r.el;function n(){r.close()}r.on(l+"Open",(function(){a||(o.removeThemeElements(r.el),r.$el.trigger(e.toLowerCase()+":init "+e.toLowerCase()+":mounted",t,r),o.emit((s?"":"modalInit")+" "+e+"Init "+e+"Mounted",r.el,t,r)),o.once("swipeBackMove",n),f(r,"open")})),r.on(l+"Close",(function(){o.off("swipeBackMove",n),r.closeByRouter||o.back(),f(r,"close")})),r.on(l+"Closed",(function(){r.$el.trigger(e.toLowerCase()+":beforeremove",t,r),r.emit((s?"":"modalBeforeRemove ")+e+"BeforeRemove",r.el,t,r);var a=r.el.f7Component;f(r,"closed"),a&&a.destroy(),ne((function(){(a||c.component)&&o.removeModal(r.el),r.destroy(),delete r.route,delete p.modalInstance}))})),u.route&&(o.params.browserHistory&&u.browserHistory&&Fe.push(o.view.id,{url:u.route.url,modal:e},(o.params.browserHistoryRoot||"")+o.params.browserHistorySeparator+u.route.url),u.route!==o.currentRoute&&(r.route=pe(u.route,{modal:r}),o.currentRoute=r.route),u.history&&!u.reloadCurrent&&(o.history.push(u.route.url),o.saveHistory())),a&&(o.removeThemeElements(r.el),r.$el.trigger(e.toLowerCase()+":init "+e.toLowerCase()+":mounted",t,r),o.emit(l+"Init "+e+"Init "+e+"Mounted",r.el,t,r)),r.open(!1===u.animate||!0===u.animate?u.animate:void 0)}function h(e,t){var r=e.url,a=e.content,n=e.component,s=e.componentUrl;function l(e){e&&("string"==typeof e?c.content=e:e.f7Component?e.f7Component.mount((function(e){c.el=e,i.$el.append(e)})):c.el=e,d())}if(a)l(a);else if(n||s)try{o.modalComponentLoader({rootEl:i.el,component:n,componentUrl:s,options:t,resolve:l,reject:function(){return o.allowPageChange=!0,o}})}catch(e){throw o.allowPageChange=!0,e}else r?(o.xhrAbortController&&(o.xhrAbortController.abort(),o.xhrAbortController=!1),o.xhrRequest(r,t).then((function(e){c.content=e,d()})).catch((function(){o.allowPageChange=!0}))):d()}function v(e,t){h(e,pe(u,t))}function m(){o.allowPageChange=!0}return"url content component el componentUrl template".split(" ").forEach((function(e){var t;c[e]&&!n&&(n=!0,h(((t={})[e]=c[e],t),u))})),n||"actions"!==e||d(),c.async&&c.async.call(o,{router:o,to:u.route,from:o.currentRoute,resolve:v,reject:m,direction:a,app:i}),c.asyncComponent&&Ke(o,c.asyncComponent,v,m),o},at.prototype.modalRemove=function(e){pe(e,{closeByRouter:!0}),e.close()},at.prototype.back=function(){var e,t,r,a=this,n=ke();if(a.swipeBackActive)return a;"object"==typeof(arguments.length<=0?void 0:arguments[0])?t=(arguments.length<=0?void 0:arguments[0])||{}:(e=arguments.length<=0?void 0:arguments[0],t=(arguments.length<=1?void 0:arguments[1])||{});var o=t,i=o.name,s=o.params,l=o.query;if(i)return(e=a.generateUrl({name:i,params:s,query:l}))?a.back(e,pe({},t,{name:null,params:null,query:null})):a;var u=a.app;Ge(a,"back");var c,p=a.currentRoute.modal;if(p||"popup popover sheet loginScreen actions customModal panel".split(" ").forEach((function(e){a.currentRoute.route[e]&&(p=!0,c=e)})),p&&!t.preload){var f,d=a.currentRoute.modal||a.currentRoute.route.modalInstance||u[c].get(),h=a.history[a.history.length-2];if(d&&d.$el){var v=d.$el.prevAll(".modal-in");if(v.length&&v[0].f7Modal){var m=v[0];a.$el.parents(m).length||(f=m.f7Modal.route)}}if(f||(f=a.findMatchingRoute(h)),!f&&h&&(f={url:h,path:h.split("?")[0],query:se(h),route:{path:h.split("?")[0],url:h}}),!(e&&0!==e.replace(/[# ]/g,"").trim().length||f&&d))return a;var g=t.force&&f&&e;if(f&&d){var b=n.ie||n.edge||n.firefox&&!n.ios,y=a.params.browserHistory&&!1!==t.browserHistory,w=a.currentRoute&&a.currentRoute.route&&a.currentRoute.route.options&&!1===a.currentRoute.route.options.browserHistory;!y||b||w||Fe.back(),a.currentRoute=f,a.history.pop(),a.saveHistory(),y&&b&&!w&&Fe.back(),a.modalRemove(d),g&&a.navigate(e,{reloadCurrent:!0})}else d&&(a.modalRemove(d),e&&a.navigate(e,{reloadCurrent:!0}));return a}var C,k=a.$el.children(".page-current").prevAll(".page-previous:not(.page-master)").eq(0);if(a.params.masterDetailBreakpoint>0){var E=[];a.$el.children(".page").each((function(e){E.push(e.className)}));var x=a.$el.children(".page-current").prevAll(".page-master").eq(0);if(x.length){var P=a.history[a.history.length-2],O=a.findMatchingRoute(P);O&&x[0].f7Page&&O.route===x[0].f7Page.route.route&&(k=x,t.preload||(C=u.width>=a.params.masterDetailBreakpoint))}}if(!t.force&&k.length&&!C){if(a.params.browserHistory&&k[0].f7Page&&a.history[a.history.length-2]!==k[0].f7Page.route.url)return a.back(a.history[a.history.length-2],pe(t,{force:!0})),a;var R=k[0].f7Page.route;return Je.call(a,R,a.currentRoute,(function(){rt(a,{el:k},pe(t,{route:R}))}),(function(){}),"backward"),a}if("#"===e&&(e=void 0),e&&"/"!==e[0]&&0!==e.indexOf("#")&&(e=((a.path||"/")+e).replace("//","/")),!e&&a.history.length>1&&(e=a.history[a.history.length-2]),C&&!t.force&&a.history[a.history.length-3])return a.back(a.history[a.history.length-3],pe({},t||{},{force:!0,animate:!1}));if(C&&!t.force)return a;if((r=a.findMatchingRoute(e))||e&&(r={url:e,path:e.split("?")[0],query:se(e),route:{path:e.split("?")[0],url:e}}),!r)return a;if(r.route.redirect)return Qe.call(a,"backward",r,t);var T,S={};if(r.route.options?pe(S,r.route.options,t):pe(S,t),S.route=r,S.force&&a.params.stackPages&&(a.$el.children(".page-previous.stacked").each((function(e){e.f7Page&&e.f7Page.route&&e.f7Page.route.url===r.url&&(T=!0,rt(a,{el:e},S))})),T))return a;function A(){var e=!1;function t(e,t){a.allowPageChange=!1,rt(a,e,pe(S,t),!0)}function n(){a.allowPageChange=!0}r.route.keepAlive&&r.route.keepAliveData&&(rt(a,{el:r.route.keepAliveData.pageEl},S),e=!0),"url content component pageName el componentUrl".split(" ").forEach((function(t){var n;r.route[t]&&!e&&(e=!0,rt(a,((n={})[t]=r.route[t],n),S))})),e||(r.route.async&&(a.allowPageChange=!1,r.route.async.call(a,{router:a,to:r,from:a.currentRoute,resolve:t,reject:n,direction:"backward",app:u})),r.route.asyncComponent&&Ke(a,r.route.asyncComponent,t,n))}function $(){a.allowPageChange=!0}return S.preload?A():Je.call(a,r,a.currentRoute,(function(){r.route.modules?u.loadModules(Array.isArray(r.route.modules)?r.route.modules:[r.route.modules]).then((function(){A()})).catch((function(){$()})):A()}),(function(){$()}),"backward"),a},at.prototype.clearPreviousHistory=function(){var e=this;Ge(e,"clearPreviousHistory");var t=e.history[e.history.length-1];!function(e){Ge(e,"clearPreviousPages");var t=e.app,r=e.dynamicNavbar;e.$el.children(".page").filter((function(t){return!(!e.currentRoute||!e.currentRoute.modal&&!e.currentRoute.panel)||t!==e.currentPageEl})).each((function(a){var n=q(a),o=q(t.navbar.getElByPage(n));e.params.stackPages&&e.initialPages.indexOf(n[0])>=0?(n.addClass("stacked"),r&&o.addClass("stacked")):(e.pageCallback("beforeRemove",n,o,"previous",void 0,{}),e.removePage(n),r&&o.length&&e.removeNavbar(o))}))}(e),e.history=[t],e.view.history=[t],e.saveHistory()};var nt={name:"router",static:{Router:at},instance:{cache:{xhr:[],templates:[],components:[]}},create:function(){var e=this;e.app?e.params.router&&(e.router=new at(e.app,e)):e.router=new at(e)}};function ot(e){var t=e.app,r=Ce();if(!e.resizableInitialized){pe(e,{resizable:!0,resizableWidth:null,resizableInitialized:!0});var a=q("html"),n=e.$el;if(n){var o,i,s,l,u,c,p,f={};(o=e.$el.children(".view-resize-handler")).length||(e.$el.append('<div class="view-resize-handler"></div>'),o=e.$el.children(".view-resize-handler")),e.$resizeHandlerEl=o,n.addClass("view-resizable");var d=!!r.passiveListener&&{passive:!0};e.$el.on(t.touchEvents.start,".view-resize-handler",v,d),t.on("touchmove:active",m),t.on("touchend:passive",g),t.on("resize",b),e.on("beforeOpen",b),e.once("viewDestroy",(function(){n.removeClass("view-resizable"),e.$resizeHandlerEl.remove(),e.$el.off(t.touchEvents.start,".view-resize-handler",v,d),t.off("touchmove:active",m),t.off("touchend:passive",g),t.off("resize",b),e.off("beforeOpen",b)}))}}function h(e){if(!e)return null;if(e.indexOf("%")>=0||e.indexOf("vw")>=0)return parseInt(e,10)/100*t.width;var r=parseInt(e,10);return Number.isNaN(r)?null:r}function v(t){if(e.resizable&&n.hasClass("view-resizable")&&n.hasClass("view-master-detail")){f.x="touchstart"===t.type?t.targetTouches[0].pageX:t.pageX,f.y="touchstart"===t.type?t.targetTouches[0].pageY:t.pageY,s=!1,i=!0;var r=n.children(".page-master");c=h(r.css("min-width")),p=h(r.css("max-width"))}}function m(r){if(i){r.f7PreventSwipePanel=!0;var d="touchmove"===r.type?r.targetTouches[0].pageX:r.pageX;s||(u=o[0].offsetLeft+o[0].offsetWidth,n.addClass("view-resizing"),a.css("cursor","col-resize")),s=!0,r.preventDefault(),l=d-f.x;var h=u+l;c&&!Number.isNaN(c)&&(h=Math.max(h,c)),p&&!Number.isNaN(p)&&(h=Math.min(h,p)),h=Math.min(Math.max(h,0),t.width),e.resizableWidth=h,a[0].style.setProperty("--f7-page-master-width",h+"px"),n.trigger("view:resize",h),e.emit("local::resize viewResize",e,h)}}function g(){if(q("html").css("cursor",""),!i||!s)return i=!1,void(s=!1);i=!1,s=!1,a[0].style.setProperty("--f7-page-master-width",e.resizableWidth+"px"),n.removeClass("view-resizing")}function b(){e.resizableWidth&&(c=h(o.css("min-width")),p=h(o.css("max-width")),c&&!Number.isNaN(c)&&e.resizableWidth<c&&(e.resizableWidth=Math.max(e.resizableWidth,c)),p&&!Number.isNaN(p)&&e.resizableWidth>p&&(e.resizableWidth=Math.min(e.resizableWidth,p)),e.resizableWidth=Math.min(Math.max(e.resizableWidth,0),t.width),a[0].style.setProperty("--f7-page-master-width",e.resizableWidth+"px"))}}var it=function(e){function t(t,r,a){var n;void 0===a&&(a={});var o,i=J(n=e.call(this,a,[t])||this);if(!i.params.routerId&&!q(r).length){var s="Framework7: can't create a View instance because ";throw new Error(s+="string"==typeof r?'the selector "'+r+"\" didn't match any element":"el must be an HTMLElement or Dom7 object")}return i.params=pe({el:r},{routes:[],routesAdd:[]},t.params.view,a),i.params.routes.length>0?i.routes=i.params.routes:i.routes=[].concat(t.routes,i.params.routesAdd),pe(!1,i,{app:t,name:i.params.name,main:i.params.main,history:[],scrollHistory:{}}),i.useModules(),t.views.push(i),i.main&&(t.views.main=i),i.name&&(t.views[i.name]=i),i.index=t.views.indexOf(i),o=i.name?"view_"+i.name:i.main?"view_main":"view_"+i.index,i.id=o,i.params.init?(t.initialized?i.init():t.on("init",(function(){i.init()})),i||J(n)):i||J(n)}z(t,e);var r=t.prototype;return r.destroy=function(){var e=this,t=e.app;e.$el.trigger("view:beforedestroy"),e.emit("local::beforeDestroy viewBeforeDestroy",e),t.off("resize",e.checkMasterDetailBreakpoint),e.main?(t.views.main=null,delete t.views.main):e.name&&(t.views[e.name]=null,delete t.views[e.name]),e.$el[0].f7View=null,delete e.$el[0].f7View,t.views.splice(t.views.indexOf(e),1),e.params.router&&e.router&&e.router.destroy(),e.emit("local::destroy viewDestroy",e),Object.keys(e).forEach((function(t){e[t]=null,delete e[t]})),e=null},r.checkMasterDetailBreakpoint=function(e){var t=this,r=t.app,a=t.$el.hasClass("view-master-detail"),n=r.width>=t.params.masterDetailBreakpoint&&t.$el.children(".page-master").length;void 0===e&&n||!0===e?(t.$el.addClass("view-master-detail"),a||(t.emit("local::masterDetailBreakpoint viewMasterDetailBreakpoint",t),t.$el.trigger("view:masterDetailBreakpoint"))):(t.$el.removeClass("view-master-detail"),a&&(t.emit("local::masterDetailBreakpoint viewMasterDetailBreakpoint",t),t.$el.trigger("view:masterDetailBreakpoint")))},r.initMasterDetail=function(){var e=this,t=e.app;e.checkMasterDetailBreakpoint=e.checkMasterDetailBreakpoint.bind(e),e.checkMasterDetailBreakpoint(),e.params.masterDetailResizable&&ot(e),t.on("resize",e.checkMasterDetailBreakpoint)},r.mount=function(e){var t,r,a=this,n=a.app,o=a.params.el||e,i=q(o);t="string"==typeof o?o:(i.attr("id")?"#"+i.attr("id"):"")+(i.attr("class")?"."+i.attr("class").replace(/ /g,".").replace(".active",""):""),"ios"===n.theme&&a.params.iosDynamicNavbar&&0===(r=i.children(".navbars").eq(0)).length&&(r=q('<div class="navbars"></div>')),pe(a,{$el:i,el:i[0],main:a.main||i.hasClass("view-main"),$navbarsEl:r,navbarsEl:r?r[0]:void 0,selector:t}),a.main&&(n.views.main=a),i&&i[0]&&(i[0].f7View=a),a.emit("local::mount viewMount",a)},r.init=function(e){var t=this;t.mount(e),t.params.router&&(t.params.masterDetailBreakpoint>0&&t.initMasterDetail(),t.router.init(),t.$el.trigger("view:init"),t.emit("local::init viewInit",t))},t}(xe);it.use(nt);var st={name:"clicks",params:{clicks:{externalLinks:".external"}},on:{init:function(){!function(e){e.on("click",(function(t){var r=o(),a=q(t.target),n=a.closest("a"),i=n.length>0,s=i&&n.attr("href");if(i&&(n.is(e.params.clicks.externalLinks)||s&&s.indexOf("javascript:")>=0)){var l=n.attr("target");s&&r.cordova&&r.cordova.InAppBrowser&&("_system"===l||"_blank"===l)?(t.preventDefault(),r.cordova.InAppBrowser.open(s,l)):s&&r.Capacitor&&r.Capacitor.Plugins&&r.Capacitor.Plugins.Browser&&("_system"===l||"_blank"===l)&&(t.preventDefault(),r.Capacitor.Plugins.Browser.open({url:s}))}else{Object.keys(e.modules).forEach((function(r){var n=e.modules[r].clicks;n&&(t.preventF7Router||Object.keys(n).forEach((function(r){var o=a.closest(r).eq(0);o.length>0&&n[r].call(e,o,o.dataset(),t)})))}));var u={};if(i&&(t.preventDefault(),u=n.dataset()),u.clickedEl=n[0],!t.preventF7Router&&!n.hasClass("prevent-router")&&!n.hasClass("router-prevent")&&(s&&s.length>0&&"#"!==s[0]||n.hasClass("back"))){var c;if(u.view&&"current"===u.view?c=e.views.current:u.view?c=q(u.view)[0].f7View:(c=a.parents(".view")[0]&&a.parents(".view")[0].f7View,!n.hasClass("back")&&c&&c.params.linksView&&("string"==typeof c.params.linksView?c=q(c.params.linksView)[0].f7View:c.params.linksView instanceof it&&(c=c.params.linksView))),c||e.views.main&&(c=e.views.main),!c||!c.router)return;n[0].f7RouteProps&&(u.props=n[0].f7RouteProps),n.hasClass("back")?c.router.back(s,u):c.router.navigate(s,u)}}}))}(this)}}},lt={name:"routerComponentLoader",proto:{componentLoader:function(e,t,r,a,n){void 0===r&&(r={});var o,i=this,s=i.app,l="string"==typeof e?e:t,u=i.replaceRequestUrlParams(l,r);function c(e){var t=r.context||{};if("function"==typeof t)t=t.call(i);else if("string"==typeof t)try{t=JSON.parse(t)}catch(e){throw n(e),e}var o,l,u=ce({},t,{f7route:r.route,f7router:i}),c=ce(r.route&&r.route.params||{},r.props||{},r.routeProps||{});r.componentOptions&&r.componentOptions.el&&(o=r.componentOptions.el),r.componentOptions&&r.componentOptions.root&&(l=r.componentOptions.root),s.component.create(e,c,{context:u,el:o,root:l}).then((function(e){a(e.el)})).catch((function(e){throw n(e),new Error(e)}))}u&&i.params.componentCache&&i.cache.components.forEach((function(e){e.url===u&&(o=e.component)})),u&&o?c(o):u&&!o?(i.xhrAbortController&&(i.xhrAbortController.abort(),i.xhrAbortController=!1),i.xhrRequest(l,r).then((function(e){var t=s.component.parse(e);i.params.componentCache&&i.cache.components.push({url:u,component:t}),c(t)})).catch((function(e){throw n(),e}))):c(e)},modalComponentLoader:function(e){var t=void 0===e?{}:e,r=t.component,a=t.componentUrl,n=t.options,o=t.resolve,i=t.reject;this.componentLoader(r,a,n,(function(e){o(e)}),i)},tabComponentLoader:function(e){var t=void 0===e?{}:e,r=t.component,a=t.componentUrl,n=t.options,o=t.resolve,i=t.reject;this.componentLoader(r,a,n,(function(e){o(e)}),i)},pageComponentLoader:function(e){var t=void 0===e?{}:e,r=t.component,a=t.componentUrl,n=t.options,o=t.resolve,i=t.reject;this.componentLoader(r,a,n,(function(e,t){void 0===t&&(t={}),o(e,t)}),i)}}},ut=function e(t,r,a,n){var o;r[0]=0;for(var i=1;i<r.length;i++){var s=r[i++],l=r[i]?(r[0]|=s?1:2,a[r[i++]]):r[++i];3===s?n[0]=l:4===s?n[1]=Object.assign(n[1]||{},l):5===s?(n[1]=n[1]||{})[r[++i]]=l:6===s?n[1][r[++i]]+=l+"":s?(o=t.apply(l,e(t,l,a,["",null])),n.push(o),l[0]?r[0]|=2:(r[i-2]=0,r[i]=o)):n.push(l)}return n},ct=new Map;var pt=[!1,null,"",void 0],ft=function(e){var t=ct.get(this);return t||(t=new Map,ct.set(this,t)),(t=ut(this,t.get(e)||(t.set(e,t=function(e){for(var t,r,a=1,n="",o="",i=[0],s=function(e){1===a&&(e||(n=n.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?i.push(0,e,n):3===a&&(e||n)?(i.push(3,e,n),a=2):2===a&&"..."===n&&e?i.push(4,e,0):2===a&&n&&!e?i.push(5,0,!0,n):a>=5&&((n||!e&&5===a)&&(i.push(a,0,n,r),a=6),e&&(i.push(a,e,0,r),a=6)),n=""},l=0;l<e.length;l++){l&&(1===a&&s(),s(l));for(var u=0;u<e[l].length;u++)t=e[l][u],1===a?"<"===t?(s(),i=[i],a=3):n+=t:4===a?"--"===n&&">"===t?(a=1,n=""):n=t+n[0]:o?t===o?o="":n+=t:'"'===t||"'"===t?o=t:">"===t?(s(),a=1):a&&("="===t?(a=5,r=n,n=""):"/"===t&&(a<5||">"===e[l][u+1])?(s(),3===a&&(i=i[0]),a=i,(i=i[0]).push(2,0,a),a=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(s(),a=2):n+=t),3===a&&"!--"===n&&(a=4,i=i[0])}return s(),i}(e)),t),arguments,[])).length>1?t:t[0]}.bind((function(e,t){for(var r=arguments.length,a=new Array(r>2?r-2:0),n=2;n<r;n++)a[n-2]=arguments[n];return{type:e,props:t||{},children:ge(a.filter((function(e){return pt.indexOf(e)<0})))}}));function dt(e,t,r,a,n){return{sel:e,data:t,children:r,text:a,elm:n,key:void 0===t?void 0:t.key}}var ht=Array.isArray;function vt(e){return"string"==typeof e||"number"==typeof e}function mt(e,t,r){if(e.ns="http://www.w3.org/2000/svg","foreignObject"!==r&&void 0!==t)for(var a=0;a<t.length;++a){var n=t[a].data;void 0!==n&&mt(n,t[a].children,t[a].sel)}}function gt(e,t,r){var a,n,o,i={};if(void 0!==r?(i=t,ht(r)?a=r:vt(r)?n=r:r&&r.sel&&(a=[r])):void 0!==t&&(ht(t)?a=t:vt(t)?n=t:t&&t.sel?a=[t]:i=t),ht(a))for(o=0;o<a.length;++o)vt(a[o])&&(a[o]=dt(void 0,void 0,void 0,a[o],void 0));return"s"!==e[0]||"v"!==e[1]||"g"!==e[2]||3!==e.length&&"."!==e[3]&&"#"!==e[3]||mt(i,a,e),dt(e,i,a,n,void 0)}var bt={},yt="area base br col command embed hr img input keygen link menuitem meta param source track wbr".split(" "),wt="hidden checked disabled readonly selected autofocus autoplay required multiple value indeterminate routeProps innerHTML".split(" "),Ct="hidden checked disabled readonly selected autofocus autoplay required multiple readOnly indeterminate".split(" "),kt=function(e){return"function"==typeof e.type?e.type.name||"CustomComponent":e.type},Et=function(e){return e.split("-").map((function(e,t){return 0===t?e.toLowerCase():e[0].toUpperCase()+e.substr(1)})).join("")},xt=function(){for(var e={},t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return r.forEach((function(t){void 0===t&&(t={}),Object.keys(t).forEach((function(r){e[Et(r)]=t[r]}))})),e},Pt=function(e){return"function"==typeof e||e&&e.indexOf("-")>0&&bt[e]};function Ot(e,t,r,a,n){var o={},i=[],s=[],l=[],u=[],c=!1,p=kt(e);t&&t.attrs&&t.attrs.component&&(function(e){throw new Error('"'+e+'" is read-only')}("tagName"),p=t.attrs.component,delete t.attrs.component,c=!0);var f=Pt(e.type);if(f&&(i.push((function(a){(a.sel===p||c)&&function(e){var t=e.f7,r=e.treeNode,a=e.vnode,n=e.data,o="function"==typeof r.type?r.type:bt[r.type];t.component.create(o,xt(n.attrs||{},n.props||{}),{el:a.elm,children:r.children}).then((function(e){a.data&&a.data.on&&e&&e.$el&&Object.keys(a.data.on).forEach((function(t){e.$el.on(t,a.data.on[t])})),a.elm.__component__=e}))}({f7:r,treeNode:e,vnode:a,data:t})})),s.push((function(e){!function(e){var t=e&&e.elm&&e.elm.__component__;if(t){var r=t.el,a=t.$el;e.data&&e.data.on&&a&&Object.keys(e.data.on).forEach((function(t){a.off(t,e.data.on[t])})),t.destroy&&t.destroy(),r&&r.parentNode&&r.parentNode.removeChild(r),delete e.elm.__component__}}(e)})),l.push((function(e,t){!function(e){var t=e&&e.elm&&e.elm.__component__;if(t){var r=xt(e.data.attrs||{},e.data.props||{});t.children=e.data.treeNode.children,Object.assign(t.props,r),t.update()}}(t)}))),!f){if(!t||!t.attrs||!t.attrs.class)return o;t.attrs.class.split(" ").forEach((function(e){a||i.push.apply(i,r.getVnodeHooks("insert",e)),s.push.apply(s,r.getVnodeHooks("destroy",e)),l.push.apply(l,r.getVnodeHooks("update",e)),u.push.apply(u,r.getVnodeHooks("postpatch",e))}))}return n&&!a&&u.push((function(e,t){var r=t||e;r&&r.data&&r.data.component&&r.data.component.hook("onUpdated")})),0===i.length&&0===s.length&&0===l.length&&0===u.length||(i.length&&(o.insert=function(e){i.forEach((function(t){return t(e)}))}),s.length&&(o.destroy=function(e){s.forEach((function(t){return t(e)}))}),l.length&&(o.update=function(e,t){l.forEach((function(r){return r(e,t)}))}),u.length&&(o.postpatch=function(e,t){u.forEach((function(r){return r(e,t)}))})),o}var Rt=function(e,t,r,a){if(e&&e.type&&yt.indexOf(e.type)>=0)return[];for(var n=[],o=e.children,i=0;i<o.length;i+=1){var s=o[i],l=St(s,t,r,a,!1);Array.isArray(l)?n.push.apply(n,l):l&&n.push(l)}return n},Tt=function(e,t,r,a){var n=e.props.name||"default",o=(t.children||[]).filter((function(e){var t="default";return e.props&&(t=e.props.slot||"default"),t===n}));return 0===o.length?Rt(e,t,r,a):o.map((function(e){return St(e,t,r,a)}))},St=function(e,t,r,a,n){if(!function(e){return ue(e)&&"props"in e&&"type"in e&&"children"in e}(e))return String(e);if("slot"===e.type)return Tt(e,t,r,a);var o=function(e,t,r,a,n){var o={component:t,treeNode:e},i=kt(e);Object.keys(e.props).forEach((function(t){var r=e.props[t];if(void 0!==r)if(wt.indexOf(t)>=0)o.props||(o.props={}),"readonly"===t&&(t="readOnly"),"routeProps"===t&&(t="f7RouteProps"),"option"===i&&"value"===t&&(o.attrs||(o.attrs={}),o.attrs.value=r),Ct.indexOf(t)>=0?o.props[t]=!1!==r:o.props[t]=r;else if("key"===t)o.key=r;else if(0===t.indexOf("@")||0===t.indexOf("on")&&t.length>2){o.on||(o.on={});var a=0===t.indexOf("@")?t.substr(1):te(t.substr(2)),s=!1,l=!1,u=!1;a.indexOf(".")>=0&&a.split(".").forEach((function(e,t){0===t?a=e:("stop"===e&&(s=!0),"prevent"===e&&(l=!0),"once"===e&&(u=!0))})),o.on[a]=function(e,t){var r=void 0===t?{}:t,a=r.stop,n=r.prevent,o=r.once,i=!1;return function(){var t=arguments.length<=0?void 0:arguments[0];o&&i||(a&&t.stopPropagation(),n&&t.preventDefault(),i=!0,e.apply(void 0,arguments))}}(r,{stop:s,prevent:l,once:u})}else"style"===t?"string"!=typeof r?o.style=r:(o.attrs||(o.attrs={}),o.attrs.style=r):(o.attrs||(o.attrs={}),o.attrs[t]=r,"id"!==t||o.key||n||(o.key=r))}));var s=Ot(e,o,r,a,n);return s.prepatch=function(e,t){e&&t&&e&&e.data&&e.data.props&&Object.keys(e.data.props).forEach((function(r){Ct.indexOf(r)<0||(t.data||(t.data={}),t.data.props||(t.data.props={}),!0!==e.data.props[r]||r in t.data.props||(t.data.props[r]=!1))}))},o.hook=s,o}(e,t,r,a,n),i=Pt(e.type)?[]:Rt(e,t,r,a);return gt(kt(e),o,i)};function At(e,t,r){return void 0===e&&(e={}),St(e,t,t.f7,r,!0)}var $t={createElement:function(e){return document.createElement(e)},createElementNS:function(e,t){return document.createElementNS(e,t)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,r){r&&r.parentNode!==e&&r.__component__&&(r=r.__component__.el),e.insertBefore(t,r)},removeChild:function(e,t){e&&e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},getTextContent:function(e){return e.textContent},isElement:function(e){return 1===e.nodeType},isText:function(e){return 3===e.nodeType},isComment:function(e){return 8===e.nodeType}};function Lt(e){return void 0===e}function Mt(e){return void 0!==e}var Nt=dt("",{},[],void 0,void 0);function Bt(e,t){return e.key===t.key&&e.sel===t.sel}function _t(e,t,r){var a,n,o,i={};for(a=t;a<=r;++a)null!=(o=e[a])&&void 0!==(n=o.key)&&(i[n]=a);return i}var Ht=["create","update","remove","destroy","pre","post"];function Dt(e,t){var r,a=t.elm,n=e.data.attrs,o=t.data.attrs;if((n||o)&&n!==o){for(r in n=n||{},o=o||{}){var i=o[r];n[r]!==i&&(!0===i?a.setAttribute(r,""):!1===i?a.removeAttribute(r):120!==r.charCodeAt(0)?a.setAttribute(r,i):58===r.charCodeAt(3)?a.setAttributeNS("http://www.w3.org/XML/1998/namespace",r,i):58===r.charCodeAt(5)?a.setAttributeNS("http://www.w3.org/1999/xlink",r,i):a.setAttribute(r,i))}for(r in n)r in o||a.removeAttribute(r)}}var jt={create:Dt,update:Dt};function qt(e,t){var r,a,n=t.elm,o=e.data.props,i=t.data.props;if((o||i)&&o!==i){for(r in i=i||{},o=o||{})i[r]||delete n[r];for(r in i)a=i[r],o[r]===a||"value"===r&&n[r]===a||(n[r]=a)}}var It={create:qt,update:qt},Ut="undefined"!=typeof window&&window.requestAnimationFrame||setTimeout;function Vt(e,t,r){var a;a=function(){e[t]=r},Ut((function(){Ut(a)}))}function zt(e,t){var r,a,n=t.elm,o=e.data.style,i=t.data.style;if((o||i)&&o!==i){i=i||{};var s="delayed"in(o=o||{});for(a in o)i[a]||("-"===a[0]&&"-"===a[1]?n.style.removeProperty(a):n.style[a]="");for(a in i)if(r=i[a],"delayed"===a&&i.delayed)for(var l in i.delayed)r=i.delayed[l],s&&r===o.delayed[l]||Vt(n.style,l,r);else"remove"!==a&&r!==o[a]&&("-"===a[0]&&"-"===a[1]?n.style.setProperty(a,r):n.style[a]=r)}}function Wt(e,t,r){var a=e.type,n=r.data.on;n&&n[a]&&function(e,t,r){"function"==typeof e&&e.apply(void 0,[t].concat(r))}(n[a],e,t)}function Ft(e,t){var r=e.data.on,a=e.listener,n=e.elm,o=t&&t.data.on,i=t&&t.elm;if(r!==o&&(r&&a&&(o?Object.keys(r).forEach((function(e){o[e]||q(n).off(e,a)})):Object.keys(r).forEach((function(e){q(n).off(e,a)}))),o)){var s=e.listener||function e(t){for(var r=arguments.length,a=new Array(r>1?r-1:0),n=1;n<r;n++)a[n-1]=arguments[n];Wt(t,a,e.vnode)};t.listener=s,s.vnode=t,r?Object.keys(o).forEach((function(e){r[e]||q(i).on(e,s)})):Object.keys(o).forEach((function(e){q(i).on(e,s)}))}}var Xt=function(e,t){var r,a,n={},o=void 0!==t?t:$t;for(r=0;r<Ht.length;++r)for(n[Ht[r]]=[],a=0;a<e.length;++a){var i=e[a][Ht[r]];void 0!==i&&n[Ht[r]].push(i)}function s(e){var t=e.id?"#"+e.id:"",r=e.className?"."+e.className.split(" ").join("."):"";return dt(o.tagName(e).toLowerCase()+t+r,{},[],void 0,e)}function l(e,t){return function(){if(0==--t){var r=o.parentNode(e);o.removeChild(r,e)}}}function u(e,t){var r,a=e.data;void 0!==a&&Mt(r=a.hook)&&Mt(r=r.init)&&(r(e),a=e.data);var i=e.children,s=e.sel;if("!"===s)Lt(e.text)&&(e.text=""),e.elm=o.createComment(e.text);else if(void 0!==s){var l=s.indexOf("#"),c=s.indexOf(".",l),p=l>0?l:s.length,f=c>0?c:s.length,d=-1!==l||-1!==c?s.slice(0,Math.min(p,f)):s,h=e.elm=Mt(a)&&Mt(r=a.ns)?o.createElementNS(r,d):o.createElement(d);for(p<f&&h.setAttribute("id",s.slice(p+1,f)),c>0&&h.setAttribute("class",s.slice(f+1).replace(/\./g," ")),r=0;r<n.create.length;++r)n.create[r](Nt,e);if(ht(i))for(r=0;r<i.length;++r){var v=i[r];null!=v&&o.appendChild(h,u(v,t))}else vt(e.text)&&o.appendChild(h,o.createTextNode(e.text));Mt(r=e.data.hook)&&(r.create&&r.create(Nt,e),r.insert&&t.push(e))}else e.elm=o.createTextNode(e.text);return e.elm}function c(e,t,r,a,n,i){for(;a<=n;++a){var s=r[a];null!=s&&o.insertBefore(e,u(s,i),t)}}function p(e){var t,r,a=e.data;if(void 0!==a){for(Mt(t=a.hook)&&Mt(t=t.destroy)&&t(e),t=0;t<n.destroy.length;++t)n.destroy[t](e);if(void 0!==e.children)for(r=0;r<e.children.length;++r)null!=(t=e.children[r])&&"string"!=typeof t&&p(t)}}function f(e,t,r,a){for(;r<=a;++r){var i=void 0,s=void 0,u=void 0,c=t[r];if(null!=c)if(Mt(c.sel)){for(p(c),s=n.remove.length+1,u=l(c.elm,s),i=0;i<n.remove.length;++i)n.remove[i](c,u);Mt(i=c.data)&&Mt(i=i.hook)&&Mt(i=i.remove)?i(c,u):u()}else o.removeChild(e,c.elm)}}function d(e,t,r){var a,i;Mt(a=t.data)&&Mt(i=a.hook)&&Mt(a=i.prepatch)&&a(e,t);var s=t.elm=e.elm,l=e.children,p=t.children;if(e!==t){if(void 0!==t.data){for(a=0;a<n.update.length;++a)n.update[a](e,t);Mt(a=t.data.hook)&&Mt(a=a.update)&&a(e,t)}Lt(t.text)?Mt(l)&&Mt(p)?l!==p&&function(e,t,r,a){for(var n,i,s,l=0,p=0,h=t.length-1,v=t[0],m=t[h],g=r.length-1,b=r[0],y=r[g];l<=h&&p<=g;)null==v?v=t[++l]:null==m?m=t[--h]:null==b?b=r[++p]:null==y?y=r[--g]:Bt(v,b)?(d(v,b,a),v=t[++l],b=r[++p]):Bt(m,y)?(d(m,y,a),m=t[--h],y=r[--g]):Bt(v,y)?(d(v,y,a),o.insertBefore(e,v.elm,o.nextSibling(m.elm)),v=t[++l],y=r[--g]):Bt(m,b)?(d(m,b,a),o.insertBefore(e,m.elm,v.elm),m=t[--h],b=r[++p]):(void 0===n&&(n=_t(t,l,h)),Lt(i=n[b.key])?(o.insertBefore(e,u(b,a),v.elm),b=r[++p]):((s=t[i]).sel!==b.sel?o.insertBefore(e,u(b,a),v.elm):(d(s,b,a),t[i]=void 0,o.insertBefore(e,s.elm,v.elm)),b=r[++p]));(l<=h||p<=g)&&(l>h?c(e,null==r[g+1]?null:r[g+1].elm,r,p,g,a):f(e,t,l,h))}(s,l,p,r):Mt(p)?(Mt(e.text)&&o.setTextContent(s,""),c(s,null,p,0,p.length-1,r)):Mt(l)?f(s,l,0,l.length-1):Mt(e.text)&&o.setTextContent(s,""):e.text!==t.text&&o.setTextContent(s,t.text),Mt(i)&&Mt(a=i.postpatch)&&a(e,t)}}return function(e,t){var r,a,i,l=[];for(r=0;r<n.pre.length;++r)n.pre[r]();for(function(e){return void 0!==e.sel}(e)||(e=s(e)),Bt(e,t)?d(e,t,l):(a=e.elm,i=o.parentNode(a),u(t,l),null!==i&&(o.insertBefore(i,t.elm,o.nextSibling(a)),f(i,[e],0,0))),r=0;r<l.length;++r)l[r].data.hook.insert(l[r]);for(r=0;r<n.post.length;++r)n.post[r]();return t}}([jt,It,{create:zt,update:zt,destroy:function(e){var t,r,a=e.elm,n=e.data.style;if(n&&(t=n.destroy))for(r in t)a.style[r]=t[r]},remove:function(e,t){var r=e.data.style;if(r&&r.remove){var a,n=e.elm,o=0,i=r.remove,s=0,l=[];for(a in i)l.push(a),n.style[a]=i[a];for(var u=getComputedStyle(n)["transition-property"].split(", ");o<u.length;++o)-1!==l.indexOf(u[o])&&s++;n.addEventListener("transitionend",(function(e){e.target===n&&--s,0===s&&t()}))}else t()}},{create:Ft,update:Ft,destroy:Ft}]),Qt=function(){function e(e,t,r,n){var o=this;void 0===r&&(r={});var i=void 0===n?{}:n,s=i.el,l=i.context,u=i.children,c=a();ce(this,{f7:e,props:r||{},context:l||{},id:t.id||K(),children:u||[],theme:{ios:"ios"===e.theme,md:"md"===e.theme,aurora:"aurora"===e.theme},style:t.style,__storeCallbacks:[],__updateQueue:[],__eventHandlers:[],__onceEventHandlers:[],__onBeforeMount:[],__onMounted:[],__onBeforeUpdate:[],__onUpdated:[],__onBeforeUnmount:[],__onUnmounted:[]});return new Promise((function(e,r){(function(e){return new Promise((function(t,r){"function"==typeof e?t(e):e instanceof Promise?e.then((function(e){t(e)})).catch((function(e){r(e)})):r(new Error('Framework7: Component render function is not a "function" type. Didn\'t you forget to "return $render"?'))}))})(t(o.props,o.getComponentContext(!0))).then((function(t){o.renderFunction=t;var r=o.render();if(s)return o.vnode=At(r,o,!0),o.style&&(o.styleEl=c.createElement("style"),o.styleEl.innerHTML=o.style),o.el=s,Xt(o.el,o.vnode),o.el=o.vnode.elm,o.$el=q(o.el),o.attachEvents(),o.el.f7Component=o,o.mount(),void e(o);r&&(o.vnode=At(r,o,!0),o.el=c.createElement(o.vnode.sel||"div"),Xt(o.el,o.vnode),o.$el=q(o.el)),o.style&&(o.styleEl=c.createElement("style"),o.styleEl.innerHTML=o.style),o.attachEvents(),o.el&&(o.el.f7Component=o),e(o)})).catch((function(e){r(e)}))}))}var t=e.prototype;return t.on=function(e,t){this.__eventHandlers&&this.__eventHandlers.push({eventName:e,handler:t})},t.once=function(e,t){this.__eventHandlers&&this.__onceEventHandlers.push({eventName:e,handler:t})},t.getComponentStore=function(){var e=this,t=this.f7.store,r=t.state,a=t.getters,n={state:r,dispatch:t.dispatch};return n.getters=new Proxy(a,{get:function(t,r){var a=t[r],n=function(){e.update()};return a.onUpdated(n),e.__storeCallbacks.push(n,a.__callback),a}}),n},t.getComponentContext=function(e){var t=this,r={$f7route:this.context.f7route,$f7router:this.context.f7router,$h:ft,$:q,$id:this.id,$f7:this.f7,$f7ready:this.f7ready.bind(this),$theme:this.theme,$tick:this.tick.bind(this),$update:this.update.bind(this),$emit:this.emit.bind(this),$store:this.getComponentStore(),$el:{}};return Object.defineProperty(r.$el,"value",{get:function(){return t.$el}}),e&&Object.assign(r,{$on:this.on.bind(this),$once:this.once.bind(this),$onBeforeMount:function(e){return t.__onBeforeMount.push(e)},$onMounted:function(e){return t.__onMounted.push(e)},$onBeforeUpdate:function(e){return t.__onBeforeUpdate.push(e)},$onUpdated:function(e){return t.__onUpdated.push(e)},$onBeforeUnmount:function(e){return t.__onBeforeUnmount.push(e)},$onUnmounted:function(e){return t.__onUnmounted.push(e)}}),r},t.render=function(){return this.renderFunction(this.getComponentContext())},t.emit=function(e,t){this.el&&this.$el.trigger(e,t)},t.attachEvents=function(){var e=this.$el;this.__eventHandlers&&(this.__eventHandlers.forEach((function(t){var r=t.eventName,a=t.handler;e.on(te(r),a)})),this.__onceEventHandlers.forEach((function(t){var r=t.eventName,a=t.handler;e.once(te(r),a)})))},t.detachEvents=function(){var e=this.$el;this.__eventHandlers&&(this.__eventHandlers.forEach((function(t){var r=t.eventName,a=t.handler;e.on(te(r),a)})),this.__onceEventHandlers.forEach((function(t){var r=t.eventName,a=t.handler;e.once(te(r),a)})))},t.startUpdateQueue=function(){var e=this,t=o();if(!this.__requestAnimationFrameId){this.__requestAnimationFrameId=t.requestAnimationFrame((function(){e.__updateIsPending&&function(){e.hook("onBeforeUpdate");var t=e.render();if(t){var r=At(t,e,!1);e.vnode=Xt(e.vnode,r)}}();var r=[].concat(e.__updateQueue);e.__updateQueue=[],e.__updateIsPending=!1,t.cancelAnimationFrame(e.__requestAnimationFrameId),delete e.__requestAnimationFrameId,delete e.__updateIsPending,r.forEach((function(e){return e()})),r=[]}))}},t.tick=function(e){var t=this;return new Promise((function(r){t.__updateQueue.push((function(){r(),e&&e()})),t.startUpdateQueue()}))},t.update=function(e){var t=this;return this.__destroyed?new Promise((function(){})):new Promise((function(r){t.__updateIsPending=!0,t.__updateQueue.push((function(){r(),e&&e()})),t.startUpdateQueue()}))},t.setState=function(e){return this.update(e)},t.f7ready=function(e){var t=this;this.f7.initialized?e(this.f7):this.f7.once("init",(function(){e(t.f7)}))},t.mount=function(e){this.hook("onBeforeMount",this.$el),this.styleEl&&q("head").append(this.styleEl),e&&e(this.el),this.hook("onMounted",this.$el)},t.destroy=function(){var e=this;if(!this.__destroyed){var t=o();this.hook("onBeforeUnmount"),this.styleEl&&q(this.styleEl).remove(),this.detachEvents(),this.hook("onUnmounted"),this.el&&this.el.f7Component&&(this.el.f7Component=null,delete this.el.f7Component),this.vnode&&(this.vnode=Xt(this.vnode,{sel:this.vnode.sel,data:{}})),t.cancelAnimationFrame(this.__requestAnimationFrameId),this.__storeCallbacks.forEach((function(t){e.f7.store.__removeCallback(t)})),this.__storeCallbacks=[],this.__updateQueue=[],this.__eventHandlers=[],this.__onceEventHandlers=[],this.__onBeforeMount=[],this.__onMounted=[],this.__onBeforeUpdate=[],this.__onUpdated=[],this.__onBeforeUnmount=[],this.__onUnmounted=[],re(this),this.__destroyed=!0}},t.hook=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];this.__destroyed||this["__"+e].forEach((function(e){e.apply(void 0,r)}))},e}();function Yt(e,t){bt[e]=t}function Jt(e){delete bt[e]}var Gt={name:"component",static:{Component:Qt,registerComponent:Yt,unregisterComponent:Jt},create:function(){var e=this;e.component={registerComponent:Yt,unregisterComponent:Jt,parse:function(e){return function(e){var t,r=o(),n=a(),i=K(),s="f7_component_create_callback_"+i;e.match(/<template([ ]?)([a-z0-9-]*)>/)&&(t=e.split(/<template[ ]?[a-z0-9-]*>/).filter((function(e,t){return t>0})).join("<template>").split("</template>").filter((function(e,t,r){return t<r.length-1})).join("</template>").replace(/{{#raw}}([ \n]*)<template/g,"{{#raw}}<template").replace(/\/template>([ \n]*){{\/raw}}/g,"/template>{{/raw}}").replace(/([ \n])<template/g,"$1{{#raw}}<template").replace(/\/template>([ \n])/g,"/template>{{/raw}}$1"));var l,u=null;if(e.indexOf("<style>")>=0&&(u=e.split("<style>")[1].split("</style>")[0]),e.indexOf("<style scoped>")>=0&&(u=e.split("<style scoped>")[1].split("</style>")[0]),e.indexOf("<script>")>=0){var c=e.split("<script>");l=c[c.length-1].split("<\/script>")[0].trim()}else l="return () => {return $render}";l&&l.trim()||(l="return () => {return $render}"),t&&(l=l.replace("$render","function ($$ctx) {\n var $ = $$ctx.$$;\n var $h = $$ctx.$h;\n var $root = $$ctx.$root;\n var $f7 = $$ctx.$f7;\n var $f7route = $$ctx.$f7route;\n var $f7router = $$ctx.$f7router;\n var $theme = $$ctx.$theme;\n var $update = $$ctx.$update;\n var $store = $$ctx.$store;\n\n return $h`"+t+"`\n }\n ").replace(/export default/g,"return")),l="window."+s+" = function () {"+l+"}";var p=n.createElement("script");p.innerHTML=l,q("head").append(p);var f=r[s]();return q(p).remove(),r[s]=null,delete r[s],u&&(f.style=u),f.id=i,f}(e)},create:function(t,r,a){var n=a.root,o=a.el,i=a.context,s=a.children;return new Qt(e,t,r,{root:n,el:o,context:i,children:s})}}}},Kt={name:"history",static:{history:Fe},on:{init:function(){Fe.init(this)}}},Zt={registrations:[],register:function(e,t){var r=this;return"serviceWorker"in o().navigator&&r.serviceWorker.container?new Promise((function(a,n){r.serviceWorker.container.register(e,t?{scope:t}:{}).then((function(e){Zt.registrations.push(e),r.emit("serviceWorkerRegisterSuccess",e),a(e)})).catch((function(e){r.emit("serviceWorkerRegisterError",e),n(e)}))})):new Promise((function(e,t){t(new Error("Service worker is not supported"))}))},unregister:function(e){var t,r=this;return"serviceWorker"in o().navigator&&r.serviceWorker.container?(t=e?Array.isArray(e)?e:[e]:Zt.registrations,Promise.all(t.map((function(e){return new Promise((function(t,a){e.unregister().then((function(){Zt.registrations.indexOf(e)>=0&&Zt.registrations.splice(Zt.registrations.indexOf(e),1),r.emit("serviceWorkerUnregisterSuccess",e),t()})).catch((function(t){r.emit("serviceWorkerUnregisterError",e,t),a(t)}))}))})))):new Promise((function(e,t){t(new Error("Service worker is not supported"))}))}},er={name:"sw",params:{serviceWorker:{path:void 0,scope:void 0}},create:function(){var e=this,t=o();pe(e,{serviceWorker:{container:"serviceWorker"in t.navigator?t.navigator.serviceWorker:void 0,registrations:Zt.registrations,register:Zt.register.bind(e),unregister:Zt.unregister.bind(e)}})},on:{init:function(){var e=o();if("serviceWorker"in e.navigator){var t=this;if(!(t.device.cordova||e.Capacitor&&e.Capacitor.isNative)&&t.serviceWorker.container){var r=t.params.serviceWorker.path,a=t.params.serviceWorker.scope;if(r&&(!Array.isArray(r)||r.length))(Array.isArray(r)?r:[r]).forEach((function(e){t.serviceWorker.register(e,a)}))}}}}};function tr(e){void 0===e&&(e={});var t={__store:!0},r=V({},e.state||{}),a=V({},e.actions||{}),n=V({},e.getters||{}),o=pe({},r),i=[],s={},l={};Object.keys(n).forEach((function(e){s[e]=[],l[e]=[]}));var u=function(e){return n[e]({state:t.state})},c=function(e,t){l[e]||(l[e]=[]),l[e].push(t)};t.__removeCallback=function(e){!function(e){Object.keys(l).forEach((function(t){var r=l[t];r.indexOf(e)>=0&&r.splice(r.indexOf(e),1)}))}(e)};var p=function(e){if("constructor"!==e){i=[];var t=u(e);!function(e,t){s[e]||(s[e]=[]),t.forEach((function(t){s[e].indexOf(t)<0&&s[e].push(t)}))}(e,i);var r={value:t,onUpdated:function(t){c(e,t)}},a=function(e){r.value=e};return r.__callback=a,c(e,a),r}};return t.state=new Proxy(o,{set:function(e,t,r){var a;return e[t]=r,a=t,Object.keys(s).filter((function(e){return s[e].indexOf(a)>=0})).forEach((function(e){l[e]&&l[e].length&&l[e].forEach((function(t){t(u(e))}))})),!0},get:function(e,t){return i.push(t),e[t]}}),t.getters=new Proxy(n,{set:function(){return!1},get:function(e,t){if(e[t])return p(t)}}),t.dispatch=function(e,r){return new Promise((function(n,o){if(!a[e])throw o(),new Error('Framework7: Store action "'+e+'" is not found');n(a[e]({state:t.state,dispatch:t.dispatch},r))}))},t}var rr={name:"store",static:{createStore:tr},proto:{createStore:tr}},ar=function(){var e=o();return e.Capacitor&&e.Capacitor.isNative&&e.Capacitor.Plugins&&e.Capacitor.Plugins.StatusBar},nr={hide:function(){var e=o();ke().cordova&&e.StatusBar&&e.StatusBar.hide(),ar()&&e.Capacitor.Plugins.StatusBar.hide()},show:function(){var e=o();ke().cordova&&e.StatusBar&&e.StatusBar.show(),ar()&&e.Capacitor.Plugins.StatusBar.show()},onClick:function(){var e;(e=q(".popup.modal-in").length>0?q(".popup.modal-in").find(".page:not(.page-previous):not(.page-next):not(.cached)").find(".page-content"):q(".panel.panel-in").length>0?q(".panel.panel-in").find(".page:not(.page-previous):not(.page-next):not(.cached)").find(".page-content"):q(".views > .view.tab-active").length>0?q(".views > .view.tab-active").find(".page:not(.page-previous):not(.page-next):not(.cached)").find(".page-content"):q(".views").length>0?q(".views").find(".page:not(.page-previous):not(.page-next):not(.cached)").find(".page-content"):this.$el.children(".view").find(".page:not(.page-previous):not(.page-next):not(.cached)").find(".page-content"))&&e.length>0&&(e.hasClass("tab")&&(e=e.parent(".tabs").children(".page-content.tab-active")),e.length>0&&e.scrollTop(0,300))},setTextColor:function(e){var t=o();ke().cordova&&t.StatusBar&&("white"===e?t.StatusBar.styleLightContent():t.StatusBar.styleDefault()),ar()&&("white"===e?t.Capacitor.Plugins.StatusBar.setStyle({style:"DARK"}):t.Capacitor.Plugins.StatusBar.setStyle({style:"LIGHT"}))},setBackgroundColor:function(e){var t=o();ke().cordova&&t.StatusBar&&t.StatusBar.backgroundColorByHexString(e),ar()&&t.Capacitor.Plugins.StatusBar.setBackgroundColor({color:e})},isVisible:function(){var e=o(),t=ke();return new Promise((function(r){t.cordova&&e.StatusBar&&r(e.StatusBar.isVisible),ar()&&e.Capacitor.Plugins.StatusBar.getInfo().then((function(e){r(e.visible)})),r(!1)}))},overlaysWebView:function(e){void 0===e&&(e=!0);var t=o();ke().cordova&&t.StatusBar&&t.StatusBar.overlaysWebView(e),ar()&&t.Capacitor.Plugins.StatusBar.setOverlaysWebView({overlay:e})},init:function(){var e=o(),t=ke(),r=this.params.statusbar;if(r.enabled){var a=t.cordova&&e.StatusBar,n=ar();(a||n)&&(r.scrollTopOnClick&&q(e).on("statusTap",nr.onClick.bind(this)),t.ios&&(r.iosOverlaysWebView?nr.overlaysWebView(!0):nr.overlaysWebView(!1),"white"===r.iosTextColor?nr.setTextColor("white"):nr.setTextColor("black")),t.android&&(r.androidOverlaysWebView?nr.overlaysWebView(!0):nr.overlaysWebView(!1),"white"===r.androidTextColor?nr.setTextColor("white"):nr.setTextColor("black"))),r.iosBackgroundColor&&t.ios&&nr.setBackgroundColor(r.iosBackgroundColor),r.androidBackgroundColor&&t.android&&nr.setBackgroundColor(r.androidBackgroundColor)}}},or={name:"statusbar",params:{statusbar:{enabled:!0,scrollTopOnClick:!0,iosOverlaysWebView:!0,iosTextColor:"black",iosBackgroundColor:null,androidOverlaysWebView:!1,androidTextColor:"black",androidBackgroundColor:null}},create:function(){me(this,{statusbar:nr})},on:{init:function(){nr.init.call(this)}}};var ir={name:"view",params:{view:{init:!0,name:void 0,main:!1,router:!0,linksView:null,stackPages:!1,xhrCache:!0,xhrCacheIgnore:[],xhrCacheIgnoreGetParameters:!1,xhrCacheDuration:6e5,componentCache:!0,preloadPreviousPage:!0,allowDuplicateUrls:!1,reloadPages:!1,reloadDetail:!1,masterDetailBreakpoint:0,masterDetailResizable:!1,removeElements:!0,removeElementsWithTimeout:!1,removeElementsTimeout:0,restoreScrollTopOnBack:!0,unloadTabContent:!0,passRouteQueryToRequest:!0,passRouteParamsToRequest:!1,loadInitialPage:!0,iosSwipeBack:!0,iosSwipeBackAnimateShadow:!0,iosSwipeBackAnimateOpacity:!0,iosSwipeBackActiveArea:30,iosSwipeBackThreshold:0,mdSwipeBack:!1,mdSwipeBackAnimateShadow:!0,mdSwipeBackAnimateOpacity:!1,mdSwipeBackActiveArea:30,mdSwipeBackThreshold:0,auroraSwipeBack:!1,auroraSwipeBackAnimateShadow:!1,auroraSwipeBackAnimateOpacity:!0,auroraSwipeBackActiveArea:30,auroraSwipeBackThreshold:0,browserHistory:!1,browserHistoryRoot:void 0,browserHistoryAnimate:!0,browserHistoryAnimateOnLoad:!1,browserHistorySeparator:"#!",browserHistoryOnLoad:!0,browserHistoryInitialMatch:!1,browserHistoryStoreHistory:!0,animate:!0,iosDynamicNavbar:!0,iosAnimateNavbarBackIcon:!0,iosPageLoadDelay:0,mdPageLoadDelay:0,auroraPageLoadDelay:0,routesBeforeEnter:null,routesBeforeLeave:null}},static:{View:it},create:function(){var e=this;pe(e,{views:pe([],{create:function(t,r){return new it(e,t,r)},get:function(e){var t=q(e);if(t.length&&t[0].f7View)return t[0].f7View}})}),Object.defineProperty(e.views,"current",{enumerable:!0,configurable:!0,get:function(){return function(e){var t=q(".popover.modal-in .view"),r=q(".popup.modal-in .view"),a=q(".panel.panel-in .view"),n=q(".views");0===n.length&&(n=e.$el);var o=n.children(".view");if(0===o.length&&(o=n.children(".tabs").children(".view")),o.length>1&&o.hasClass("tab")&&0===(o=n.children(".view.tab-active")).length&&(o=n.children(".tabs").children(".view.tab-active")),t.length>0&&t[0].f7View)return t[0].f7View;if(r.length>0&&r[0].f7View)return r[0].f7View;if(a.length>0&&a[0].f7View)return a[0].f7View;if(o.length>0){if(1===o.length&&o[0].f7View)return o[0].f7View;if(o.length>1)return e.views.main}}(e)}}),e.view=e.views},on:{init:function(){var e=this;q(".view-init").each((function(t){if(!t.f7View){var r=q(t).dataset();e.views.create(t,r)}}))},"modalOpen panelOpen":function(e){var t=this;e.$el.find(".view-init").each((function(e){if(!e.f7View){var r=q(e).dataset();t.views.create(e,r)}}))},"modalBeforeDestroy panelBeforeDestroy":function(e){e&&e.$el&&e.$el.find(".view-init").each((function(e){var t=e.f7View;t&&t.destroy()}))}},vnode:{"view-init":{insert:function(e){var t=e.elm;if(!t.f7View){var r=q(t).dataset();this.views.create(t,r)}},destroy:function(e){var t=e.elm.f7View;t&&t.destroy()}}}},sr={size:function(e){var t=this,r=q(e);if(r.hasClass("navbars"))r=r.children(".navbar").each((function(e){t.navbar.size(e)}));else{var a=r.children(".navbar-inner");if(a.length){var n=a.hasClass("navbar-inner-centered-title")||t.params.navbar[t.theme+"CenterTitle"],o="ios"===t.theme&&!t.params.navbar[t.theme+"CenterTitle"];if((n||o)&&!(r.hasClass("stacked")||r.parents(".stacked").length>0||r.parents(".tab:not(.tab-active)").length>0||r.parents(".popup:not(.modal-in)").length>0)){"ios"!==t.theme&&t.params.navbar[t.theme+"CenterTitle"]&&a.addClass("navbar-inner-centered-title"),"ios"!==t.theme||t.params.navbar.iosCenterTitle||a.addClass("navbar-inner-left-title");var i,s,l,u,c=r.parents(".view").eq(0),p=t.rtl?a.children(".right"):a.children(".left"),f=t.rtl?a.children(".left"):a.children(".right"),d=a.children(".title"),h=a.children(".subnavbar"),v=0===p.length,m=0===f.length,g=v?0:p.outerWidth(!0),b=m?0:f.outerWidth(!0),y=d.outerWidth(!0),w=a.styles(),C=a[0].offsetWidth-parseInt(w.paddingLeft,10)-parseInt(w.paddingRight,10),k=r.hasClass("navbar-previous"),E=a.hasClass("sliding");c.length>0&&c[0].f7View&&(s=(i=c[0].f7View.router)&&i.dynamicNavbar),m&&(l=C-y),v&&(l=0),v||m||(l=(C-b-y+g)/2);var x=(C-y)/2;C-g-b>y?(x<g&&(x=g),x+y>C-b&&(x=C-b-y),u=x-l):u=0;var P=t.rtl?-1:1;if(s&&"ios"===t.theme){if(d.hasClass("sliding")||d.length>0&&E){var O=-(l+u)*P,R=(C-l-u-y)*P;if(k&&i&&i.params.iosAnimateNavbarBackIcon){var T=r.parent().find(".navbar-current").children(".left.sliding").find(".back .icon ~ span");T.length>0&&(O+=T[0].offsetLeft)}d[0].f7NavbarLeftOffset=O,d[0].f7NavbarRightOffset=R}if(!v&&(p.hasClass("sliding")||E))if(t.rtl)p[0].f7NavbarLeftOffset=-(C-p[0].offsetWidth)/2*P,p[0].f7NavbarRightOffset=g*P;else if(p[0].f7NavbarLeftOffset=-g,p[0].f7NavbarRightOffset=(C-p[0].offsetWidth)/2,i&&i.params.iosAnimateNavbarBackIcon&&p.find(".back .icon").length>0&&p.find(".back .icon ~ span").length){var S=p[0].f7NavbarLeftOffset,A=p[0].f7NavbarRightOffset;p[0].f7NavbarLeftOffset=0,p[0].f7NavbarRightOffset=0,p.find(".back .icon ~ span")[0].f7NavbarLeftOffset=S,p.find(".back .icon ~ span")[0].f7NavbarRightOffset=A-p.find(".back .icon")[0].offsetWidth}m||!f.hasClass("sliding")&&!E||(t.rtl?(f[0].f7NavbarLeftOffset=-b*P,f[0].f7NavbarRightOffset=(C-f[0].offsetWidth)/2*P):(f[0].f7NavbarLeftOffset=-(C-f[0].offsetWidth)/2,f[0].f7NavbarRightOffset=b)),h.length&&(h.hasClass("sliding")||E)&&(h[0].f7NavbarLeftOffset=t.rtl?h[0].offsetWidth:-h[0].offsetWidth,h[0].f7NavbarRightOffset=-h[0].f7NavbarLeftOffset)}if(n){var $=u;t.rtl&&v&&m&&d.length>0&&($=-$),d.css({left:$+"px"})}}}}},hide:function(e,t,r,a){void 0===t&&(t=!0),void 0===r&&(r=!1),void 0===a&&(a=!1);var n=this,o=q(e),i=o.hasClass("navbar")&&o.parent(".navbars").length&&!a;if(i&&(o=o.parents(".navbars")),o.length&&!o.hasClass("navbar-hidden")){var s="navbar-hidden"+(t?" navbar-transitioning":"");(i?o.find(".navbar-current .title-large").length:o.find(".title-large").length)&&(s+=" navbar-large-hidden"),r&&(s+=" navbar-hidden-statusbar"),o.transitionEnd((function(){o.removeClass("navbar-transitioning")})),o.addClass(s),i?o.children(".navbar").each((function(e){q(e).trigger("navbar:hide"),n.emit("navbarHide",e)})):(o.trigger("navbar:hide"),n.emit("navbarHide",o[0]))}},show:function(e,t,r){void 0===e&&(e=".navbar-hidden"),void 0===t&&(t=!0),void 0===r&&(r=!1);var a=this,n=q(e),o=n.hasClass("navbar")&&n.parent(".navbars").length&&!r;o&&(n=n.parents(".navbars")),n.length&&n.hasClass("navbar-hidden")&&(t&&(n.addClass("navbar-transitioning"),n.transitionEnd((function(){n.removeClass("navbar-transitioning")}))),n.removeClass("navbar-hidden navbar-large-hidden navbar-hidden-statusbar"),o?n.children(".navbar").each((function(e){q(e).trigger("navbar:show"),a.emit("navbarShow",e)})):(n.trigger("navbar:show"),a.emit("navbarShow",n[0])))},getElByPage:function(e){var t,r,a;if(e.$navbarEl||e.$el?(a=e,t=e.$el):(t=q(e)).length>0&&(a=t[0].f7Page),a&&a.$navbarEl&&a.$navbarEl.length>0?r=a.$navbarEl:t&&(r=t.children(".navbar")),r&&(!r||0!==r.length))return r[0]},getPageByEl:function(e){var t,r=q(e);return r.parents(".page").length?r.parents(".page")[0]:(r.parents(".view").find(".page").each((function(e){e&&e.f7Page&&e.f7Page.navbarEl&&r[0]===e.f7Page.navbarEl&&(t=e)})),t)},collapseLargeTitle:function(e){var t=this,r=q(e);if(!(r.hasClass("navbars")&&((r=r.find(".navbar")).length>1&&(r=q(e).find(".navbar-large.navbar-current")),r.length>1||!r.length))){var a=q(t.navbar.getPageByEl(r));r.addClass("navbar-large-collapsed"),a.eq(0).addClass("page-with-navbar-large-collapsed").trigger("page:navbarlargecollapsed"),t.emit("pageNavbarLargeCollapsed",a[0]),r.trigger("navbar:collapse"),t.emit("navbarCollapse",r[0])}},expandLargeTitle:function(e){var t=this,r=q(e);if(!(r.hasClass("navbars")&&((r=r.find(".navbar-large")).length>1&&(r=q(e).find(".navbar-large.navbar-current")),r.length>1||!r.length))){var a=q(t.navbar.getPageByEl(r));r.removeClass("navbar-large-collapsed"),a.eq(0).removeClass("page-with-navbar-large-collapsed").trigger("page:navbarlargeexpanded"),t.emit("pageNavbarLargeExpanded",a[0]),r.trigger("navbar:expand"),t.emit("navbarExpand",r[0])}},toggleLargeTitle:function(e){var t=q(e);t.hasClass("navbars")&&((t=t.find(".navbar-large")).length>1&&(t=q(e).find(".navbar-large.navbar-current")),t.length>1||!t.length)||(t.hasClass("navbar-large-collapsed")?this.navbar.expandLargeTitle(t):this.navbar.collapseLargeTitle(t))},initNavbarOnScroll:function(e,t,r,a,n){var o,i,s,l,u,c,p,f,d,h,v,m,g,b,y=this,w=Ce(),C=q(e),k=q(t),E=k.find(".title-large"),x=E.length||k.hasClass(".navbar-large"),P=44,O=y.params.navbar.snapPageScrollToLargeTitle,R=y.params.navbar.snapPageScrollToTransparentNavbar;(a||r&&x)&&((d=k.css("--f7-navbar-large-title-height"))&&d.indexOf("px")>=0?(d=parseInt(d,10),Number.isNaN(d)&&E.length?d=E[0].offsetHeight:Number.isNaN(d)&&("ios"===y.theme?d=52:"md"===y.theme?d=48:"aurora"===y.theme&&(d=38))):E.length?d=E[0].offsetHeight:"ios"===y.theme?d=52:"md"===y.theme?d=48:"aurora"===y.theme&&(d=38)),r&&x&&(P+=d);function T(){k.hasClass("with-searchbar-expandable-enabled")||!m||i<0||(i>=d/2&&i<d?q(m).scrollTop(d,100):i<d&&q(m).scrollTop(0,200))}function S(){k.hasClass("with-searchbar-expandable-enabled")||!m||i<0||(i>=h/2&&i<h?q(m).scrollTop(h,100):i<h&&q(m).scrollTop(0,200))}var A=null,$=null;function L(e){m=this,e&&e.target&&e.target!==m||(i=m.scrollTop,v=i,a?function(){if(!k.hasClass("navbar-hidden")&&!k.parent(".navbars").hasClass("navbar-hidden")){var e=k.hasClass("navbar-large-transparent")||k.hasClass("navbar-large")&&k.hasClass("navbar-transparent");A=$,$=Math.min(Math.max(i/d,0),1);var t=A>0&&A<1;k.hasClass("with-searchbar-expandable-enabled")||(f=k.hasClass("navbar-large-collapsed"),0===$&&f?y.navbar.expandLargeTitle(k[0]):1!==$||f||y.navbar.collapseLargeTitle(k[0]),0===$&&f||0===$&&t||1===$&&!f||1===$&&t?("md"===y.theme&&k.find(".navbar-inner").css("overflow",""),k.find(".title").css("opacity",""),k.find(".title-large-text, .subnavbar").css("transform",""),e?k.find(".navbar-bg").css("opacity",""):k.find(".navbar-bg").css("transform","")):$>0&&$<1&&("md"===y.theme&&k.find(".navbar-inner").css("overflow","visible"),k.find(".title").css("opacity",$),k.find(".title-large-text, .subnavbar").css("transform","translate3d(0px, "+-1*$*d+"px, 0)"),e?k.find(".navbar-bg").css("opacity",$):k.find(".navbar-bg").css("transform","translate3d(0px, "+-1*$*d+"px, 0)")),O&&(w.touch?b&&(clearTimeout(b),b=null,b=setTimeout((function(){T(),clearTimeout(b),b=null}),70)):(clearTimeout(g),g=setTimeout((function(){T()}),300))))}}():n&&function(){var e=k.hasClass("navbar-hidden")||k.parent(".navbars").hasClass("navbar-hidden");if(!k.hasClass("with-searchbar-expandable-enabled")&&!e){h||(h=t.offsetHeight);var r=i/h,a=k.hasClass("navbar-transparent-visible");if(r=Math.max(Math.min(r,1),0),a&&1===r||!a&&0===r)k.find(".navbar-bg, .title").css("opacity","");else{if(a&&0===r)return k.trigger("navbar:transparenthide"),y.emit("navbarTransparentHide",k[0]),k.removeClass("navbar-transparent-visible"),void k.find(".navbar-bg, .title").css("opacity","");if(!a&&1===r)return k.trigger("navbar:transparentshow"),y.emit("navbarTransparentShow",k[0]),k.addClass("navbar-transparent-visible"),void k.find(".navbar-bg, .title").css("opacity","");k.find(".navbar-bg, .title").css("opacity",r),R&&(w.touch?b&&(clearTimeout(b),b=null,b=setTimeout((function(){S(),clearTimeout(b),b=null}),70)):(clearTimeout(g),g=setTimeout((function(){S()}),300)))}}}(),C.hasClass("page-previous")||r&&(C.hasClass("page-with-card-opened")||(s=m.scrollHeight,l=m.offsetHeight,u=i+l>=s,p=k.hasClass("navbar-hidden")||k.parent(".navbars").hasClass("navbar-hidden"),u?y.params.navbar.showOnPageScrollEnd&&(c="show"):c=o>i?y.params.navbar.showOnPageScrollTop||i<=P?"show":"hide":i>P?"hide":"show","show"===c&&p?(y.navbar.show(k,!0,!0),p=!1):"hide"!==c||p||(y.navbar.hide(k,!0,!1,!0),p=!0),o=i)))}function M(){v=!1}function N(){clearTimeout(b),b=null,b=setTimeout((function(){!1!==v&&(n&&!a?S():T(),clearTimeout(b),b=null)}),70)}C.on("scroll",".page-content",L,!0),w.touch&&(a&&O||n&&R)&&(y.on("touchstart:passive",M),y.on("touchend:passive",N)),(a||n)&&C.find(".page-content").each((function(e){e.scrollTop>0&&L.call(e)})),C[0].f7DetachNavbarScrollHandlers=function(){delete C[0].f7DetachNavbarScrollHandlers,C.off("scroll",".page-content",L,!0),w.touch&&(a&&O||n&&R)&&(y.off("touchstart:passive",M),y.off("touchend:passive",N))}}},lr={name:"navbar",create:function(){me(this,{navbar:sr})},params:{navbar:{scrollTopOnTitleClick:!0,iosCenterTitle:!0,mdCenterTitle:!1,auroraCenterTitle:!0,hideOnPageScroll:!1,showOnPageScrollEnd:!0,showOnPageScrollTop:!0,collapseLargeTitleOnScroll:!0,snapPageScrollToLargeTitle:!0,snapPageScrollToTransparentNavbar:!0}},on:{"panelBreakpoint panelCollapsedBreakpoint panelResize viewResize resize viewMasterDetailBreakpoint":function(){var e=this;q(".navbar").each((function(t){e.navbar.size(t)}))},pageBeforeRemove:function(e){e.$el[0].f7DetachNavbarScrollHandlers&&e.$el[0].f7DetachNavbarScrollHandlers()},pageBeforeIn:function(e){var t=this;if("ios"===t.theme){var r,a=e.$el.parents(".view")[0].f7View,n=t.navbar.getElByPage(e);if(r=n?q(n).parents(".navbars"):e.$el.parents(".view").children(".navbars"),e.$el.hasClass("no-navbar")||a.router.dynamicNavbar&&!n){var o=!!(e.pageFrom&&e.router.history.length>0);t.navbar.hide(r,o)}else t.navbar.show(r)}},pageReinit:function(e){var t=q(this.navbar.getElByPage(e));t&&0!==t.length&&this.navbar.size(t)},pageInit:function(e){var t,r,a,n=this,o=q(n.navbar.getElByPage(e));o&&0!==o.length&&(n.navbar.size(o),o.find(".title-large").length>0&&o.addClass("navbar-large"),o.hasClass("navbar-large")&&(n.params.navbar.collapseLargeTitleOnScroll&&(t=!0),e.$el.addClass("page-with-navbar-large")),!t&&o.hasClass("navbar-transparent")&&(r=!0),(n.params.navbar.hideOnPageScroll||e.$el.find(".hide-navbar-on-scroll").length||e.$el.hasClass("hide-navbar-on-scroll")||e.$el.find(".hide-bars-on-scroll").length||e.$el.hasClass("hide-bars-on-scroll"))&&(a=!(e.$el.find(".keep-navbar-on-scroll").length||e.$el.hasClass("keep-navbar-on-scroll")||e.$el.find(".keep-bars-on-scroll").length||e.$el.hasClass("keep-bars-on-scroll"))),(t||a||r)&&n.navbar.initNavbarOnScroll(e.el,o[0],a,t,r))},"panelOpen panelSwipeOpen modalOpen":function(e){var t=this;e.$el.find(".navbar:not(.navbar-previous):not(.stacked)").each((function(e){t.navbar.size(e)}))},tabShow:function(e){var t=this;q(e).find(".navbar:not(.navbar-previous):not(.stacked)").each((function(e){t.navbar.size(e)}))}},clicks:{".navbar .title":function(e){if(this.params.navbar.scrollTopOnTitleClick&&!(e.closest("a").length>0)){var t,r=e.parents(".navbar"),a=r.parents(".navbars");0===(t=r.parents(".page-content")).length&&(r.parents(".page").length>0&&(t=r.parents(".page").find(".page-content")),0===t.length&&a.length&&a.nextAll(".page-current:not(.stacked)").length>0&&(t=a.nextAll(".page-current:not(.stacked)").find(".page-content")),0===t.length&&r.nextAll(".page-current:not(.stacked)").length>0&&(t=r.nextAll(".page-current:not(.stacked)").find(".page-content"))),t&&t.length>0&&(t.hasClass("tab")&&(t=t.parent(".tabs").children(".page-content.tab-active")),t.length>0&&t.scrollTop(0,300))}}},vnode:{navbar:{postpatch:function(e){this.navbar.size(e.elm)}}}},ur={setHighlight:function(e){if("ios"!==this.theme){var t=q(e);if(0!==t.length&&(t.hasClass("tabbar")||t.hasClass("tabbar-labels"))){var r=t.find(".tab-link-highlight"),a=t.find(".tab-link").length;if(0!==a){0===r.length?(t.children(".toolbar-inner").append('<span class="tab-link-highlight"></span>'),r=t.find(".tab-link-highlight")):r.next().length&&t.children(".toolbar-inner").append(r);var n,o,i=t.find(".tab-link-active");if(t.hasClass("tabbar-scrollable")&&i&&i[0])n=i[0].offsetWidth+"px",o=i[0].offsetLeft+"px";else{var s=i.index();n=100/a+"%",o=100*(this.rtl?-s:s)+"%"}oe((function(){r.css("width",n).transform("translate3d("+o+",0,0)")}))}else r.remove()}}},init:function(e){this.toolbar.setHighlight(e)},hide:function(e,t){void 0===t&&(t=!0);var r=q(e);if(!r.hasClass("toolbar-hidden")){var a="toolbar-hidden"+(t?" toolbar-transitioning":"");r.transitionEnd((function(){r.removeClass("toolbar-transitioning")})),r.addClass(a),r.trigger("toolbar:hide"),this.emit("toolbarHide",r[0])}},show:function(e,t){void 0===t&&(t=!0);var r=q(e);r.hasClass("toolbar-hidden")&&(t&&(r.addClass("toolbar-transitioning"),r.transitionEnd((function(){r.removeClass("toolbar-transitioning")}))),r.removeClass("toolbar-hidden"),r.trigger("toolbar:show"),this.emit("toolbarShow",r[0]))},initToolbarOnScroll:function(e){var t,r,a,n,o,i,s,l=this,u=q(e),c=u.parents(".view").children(".toolbar");(0===c.length&&(c=u.find(".toolbar")),0===c.length&&(c=u.parents(".views").children(".tabbar, .tabbar-labels")),0!==c.length)&&(u.on("scroll",".page-content",p,!0),u[0].f7ScrollToolbarHandler=p);function p(e){if(!u.hasClass("page-with-card-opened")&&!u.hasClass("page-previous")){var p=this;e&&e.target&&e.target!==p||(r=p.scrollTop,a=p.scrollHeight,n=p.offsetHeight,o=r+n>=a,s=c.hasClass("toolbar-hidden"),o?l.params.toolbar.showOnPageScrollEnd&&(i="show"):i=t>r?l.params.toolbar.showOnPageScrollTop||r<=44?"show":"hide":r>44?"hide":"show","show"===i&&s?(l.toolbar.show(c),s=!1):"hide"!==i||s||(l.toolbar.hide(c),s=!0),t=r)}}}},cr={name:"toolbar",create:function(){me(this,{toolbar:ur})},params:{toolbar:{hideOnPageScroll:!1,showOnPageScrollEnd:!0,showOnPageScrollTop:!0}},on:{pageBeforeRemove:function(e){e.$el[0].f7ScrollToolbarHandler&&e.$el.off("scroll",".page-content",e.$el[0].f7ScrollToolbarHandler,!0)},pageBeforeIn:function(e){var t=e.$el.parents(".view").children(".toolbar");0===t.length&&(t=e.$el.parents(".views").children(".tabbar, .tabbar-labels")),0===t.length&&(t=e.$el.find(".toolbar")),0!==t.length&&(e.$el.hasClass("no-toolbar")?this.toolbar.hide(t):this.toolbar.show(t))},pageInit:function(e){var t=this;if(e.$el.find(".tabbar, .tabbar-labels").each((function(e){t.toolbar.init(e)})),t.params.toolbar.hideOnPageScroll||e.$el.find(".hide-toolbar-on-scroll").length||e.$el.hasClass("hide-toolbar-on-scroll")||e.$el.find(".hide-bars-on-scroll").length||e.$el.hasClass("hide-bars-on-scroll")){if(e.$el.find(".keep-toolbar-on-scroll").length||e.$el.hasClass("keep-toolbar-on-scroll")||e.$el.find(".keep-bars-on-scroll").length||e.$el.hasClass("keep-bars-on-scroll"))return;t.toolbar.initToolbarOnScroll(e.el)}},init:function(){var e=this;e.$el.find(".tabbar, .tabbar-labels").each((function(t){e.toolbar.init(t)}))}},vnode:{tabbar:{insert:function(e){this.toolbar.init(e.elm)}}}},pr={name:"subnavbar",on:{pageInit:function(e){e.$navbarEl&&e.$navbarEl.length&&e.$navbarEl.find(".subnavbar").length&&e.$el.addClass("page-with-subnavbar"),e.$el.find(".subnavbar").filter((function(t){return q(t).parents(".page")[0]===e.$el[0]})).length&&e.$el.addClass("page-with-subnavbar")}}},fr=function(){function e(e,t,r,a){var n=this;if(t){var o=t[0].getBoundingClientRect(),i=o.left,s=o.top,l=o.width,u=o.height,c=r-i,p=a-s,f=Math.max(Math.pow(Math.pow(u,2)+Math.pow(l,2),.5),48),d=!1,h=e.params.touch.touchRippleInsetElements||"";if(h&&t.is(h)&&(d=!0),d&&(f=Math.max(Math.min(l,u),48)),d||"hidden"!==t.css("overflow"))n.rippleTransform="translate3d("+(l/2-c)+"px, "+(u/2-p)+"px, 0) scale(1)";else{var v=(f/2+Math.pow(Math.pow(c-l/2,2)+Math.pow(p-u/2,2),.5))/(f/2);n.rippleTransform="translate3d(0px, 0px, 0) scale("+v+")"}return d&&t.addClass("ripple-inset"),n.$rippleWaveEl=q('<div class="ripple-wave" style="width: '+f+"px; height: "+f+"px; margin-top:-"+f/2+"px; margin-left:-"+f/2+"px; left:"+c+"px; top:"+p+"px; --f7-ripple-transform: "+n.rippleTransform+'"></div>'),t.prepend(n.$rippleWaveEl),n.$rippleWaveEl.animationEnd((function(){n.$rippleWaveEl&&(n.$rippleWaveEl.hasClass("ripple-wave-out")||(n.$rippleWaveEl.addClass("ripple-wave-in"),n.shouldBeRemoved&&n.out()))})),n}}var t=e.prototype;return t.destroy=function(){var e=this;e.$rippleWaveEl&&e.$rippleWaveEl.remove(),Object.keys(e).forEach((function(t){e[t]=null,delete e[t]})),e=null},t.out=function(){var e=this,t=this.$rippleWaveEl;clearTimeout(e.removeTimeout),t.addClass("ripple-wave-out"),e.removeTimeout=setTimeout((function(){e.destroy()}),300),t.animationEnd((function(){clearTimeout(e.removeTimeout),e.destroy()}))},t.remove=function(){var e=this;e.shouldBeRemoved||(e.removeTimeout=setTimeout((function(){e.destroy()}),400),e.shouldBeRemoved=!0,e.$rippleWaveEl.hasClass("ripple-wave-in")&&e.out())},e}(),dr={name:"touch-ripple",static:{TouchRipple:fr},create:function(){this.touchRipple={create:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Q(fr,t)}}}},hr=[],vr=[];var mr=function(e){function t(t,r){var a,n=J(a=e.call(this,r,[t])||this),o={};n.useModulesParams(o),n.params=pe(o,r),n.opened=!1;var i=n.params.containerEl?q(n.params.containerEl).eq(0):t.$el;return i.length||(i=t.$el),n.$containerEl=i,n.containerEl=i[0],n.useModules(),J(a)||J(a)}z(t,e);var r=t.prototype;return r.onOpen=function(){var e=this;e.opened=!0,hr.push(e),q("html").addClass("with-modal-"+e.type.toLowerCase()),e.$el.trigger("modal:open "+e.type.toLowerCase()+":open"),e.emit("local::open modalOpen "+e.type+"Open",e)},r.onOpened=function(){var e=this;e.$el.trigger("modal:opened "+e.type.toLowerCase()+":opened"),e.emit("local::opened modalOpened "+e.type+"Opened",e)},r.onClose=function(){var e=this;e.opened=!1,e.type&&e.$el&&(hr.splice(hr.indexOf(e),1),q("html").removeClass("with-modal-"+e.type.toLowerCase()),e.$el.trigger("modal:close "+e.type.toLowerCase()+":close"),e.emit("local::close modalClose "+e.type+"Close",e))},r.onClosed=function(){var e=this;e.type&&e.$el&&(e.$el.removeClass("modal-out"),e.$el.hide(),e.$el.trigger("modal:closed "+e.type.toLowerCase()+":closed"),e.emit("local::closed modalClosed "+e.type+"Closed",e))},r.open=function(e){var t,r=this,n=a(),o=r.app,i=r.$el,s=r.$backdropEl,l=r.type,u=!0;if(void 0!==e?u=e:void 0!==r.params.animate&&(u=r.params.animate),!i||i.hasClass("modal-in"))return r;if("dialog"===l&&o.params.modal.queueDialogs&&(q(".dialog.modal-in").length>0?t=!0:hr.length>0&&hr.forEach((function(e){"dialog"===e.type&&(t=!0)})),t))return vr.push(r),r;var c=i.parent(),p=i.parents(n).length>0;function f(){i.hasClass("modal-out")?r.onClosed():i.hasClass("modal-in")&&r.onOpened()}return c.is(r.$containerEl)||(r.$containerEl.append(i),r.once(l+"Closed",(function(){p?c.append(i):i.remove()}))),i.show(),r._clientLeft=i[0].clientLeft,u?(s&&(s.removeClass("not-animated"),s.addClass("backdrop-in")),i.animationEnd((function(){f()})),i.transitionEnd((function(){f()})),i.removeClass("modal-out not-animated").addClass("modal-in"),r.onOpen()):(s&&s.addClass("backdrop-in not-animated"),i.removeClass("modal-out").addClass("modal-in not-animated"),r.onOpen(),r.onOpened()),r},r.close=function(e){var t=this,r=t.$el,a=t.$backdropEl,n=!0;if(void 0!==e?n=e:void 0!==t.params.animate&&(n=t.params.animate),!r||!r.hasClass("modal-in"))return vr.indexOf(t)>=0&&vr.splice(vr.indexOf(t),1),t;if(a){var o=!0;"popup"===t.type&&t.$el.prevAll(".popup.modal-in").add(t.$el.nextAll(".popup.modal-in")).each((function(e){var r=e.f7Modal;r&&r.params.closeByBackdropClick&&r.params.backdrop&&r.backdropEl===t.backdropEl&&(o=!1)})),o&&(a[n?"removeClass":"addClass"]("not-animated"),a.removeClass("backdrop-in"))}function i(){r.hasClass("modal-out")?t.onClosed():r.hasClass("modal-in")&&t.onOpened()}return r[n?"removeClass":"addClass"]("not-animated"),n?(r.animationEnd((function(){i()})),r.transitionEnd((function(){i()})),r.removeClass("modal-in").addClass("modal-out"),t.onClose()):(r.addClass("not-animated").removeClass("modal-in").addClass("modal-out"),t.onClose(),t.onClosed()),"dialog"===t.type&&0!==vr.length&&vr.shift().open(),t},r.destroy=function(){var e=this;e.destroyed||(e.emit("local::beforeDestroy modalBeforeDestroy "+e.type+"BeforeDestroy",e),e.$el&&(e.$el.trigger("modal:beforedestroy "+e.type.toLowerCase()+":beforedestroy"),e.$el.length&&e.$el[0].f7Modal&&delete e.$el[0].f7Modal),re(e),e.destroyed=!0)},t}(xe),gr=function(e){function t(t,r){var a,n,o,i=pe({backdrop:!0,closeByBackdropClick:!0,on:{}},r),s=J(a=e.call(this,t,i)||this);if(s.params=i,(n=s.params.el?q(s.params.el):q(s.params.content))&&n.length>0&&n[0].f7Modal)return n[0].f7Modal||J(a);if(0===n.length)return s.destroy()||J(a);function l(e){s&&!s.destroyed&&o&&e.target===o[0]&&s.close()}return s.params.backdrop&&0===(o=t.$el.children(".custom-modal-backdrop")).length&&(o=q('<div class="custom-modal-backdrop"></div>'),t.$el.append(o)),s.on("customModalOpened",(function(){s.params.closeByBackdropClick&&s.params.backdrop&&t.on("click",l)})),s.on("customModalClose",(function(){s.params.closeByBackdropClick&&s.params.backdrop&&t.off("click",l)})),pe(s,{app:t,$el:n,el:n[0],$backdropEl:o,backdropEl:o&&o[0],type:"customModal"}),n[0].f7Modal=s,s||J(a)}return z(t,e),t}(mr),br={name:"modal",static:{Modal:mr,CustomModal:gr},create:function(){var e=this;e.customModal={create:function(t){return new gr(e,t)}}},params:{modal:{queueDialogs:!0}}};return"undefined"!=typeof window&&(window.Dom7||(window.Dom7=q)),at.use([lt]),Re.use([Te,Se,Ae,$e,De,je,st,nt,Kt,Gt,er,rr,or,ir,lr,cr,pr,dr,br]),Re})); //# sourceMappingURL=framework7.min.js.map
/******************************************* * MORSE CODE TRANSLATOR * * Original Code by JinH (https://jinh.kr) * *******************************************/ var v; var hangulToJaso = function(text) { var ChoSeong = new Array( 0x3131, 0x3132, 0x3134, 0x3137, 0x3138, 0x3139, 0x3141, 0x3142, 0x3143, 0x3145, 0x3146, 0x3147, 0x3148, 0x3149, 0x314a, 0x314b, 0x314c, 0x314d, 0x314e ); var JungSeong = new Array( 0x314f, 0x3150, 0x3151, 0x3152, 0x3153, 0x3154, 0x3155, 0x3156, 0x3157, 0x3158, 0x3159, 0x315a, 0x315b, 0x315c, 0x315d, 0x315e, 0x315f, 0x3160, 0x3161, 0x3162, 0x3163 ); var JongSeong = new Array( 0x0000, 0x3131, 0x3132, 0x3133, 0x3134, 0x3135, 0x3136, 0x3137, 0x3139, 0x313a, 0x313b, 0x313c, 0x313d, 0x313e, 0x313f, 0x3140, 0x3141, 0x3142, 0x3144, 0x3145, 0x3146, 0x3147, 0x3148, 0x314a, 0x314b, 0x314c, 0x314d, 0x314e ); var chars = new Array(); /*var*/ v = new Array(); //์ „์—ญ ํ•จ์ˆ˜๋กœ ๋งŒ๋“ค์–ด ๋ฒ„๋ฆฝ์‹œ๋‹น. ์•„ ๋‚˜๋„ ๋นจ๋ฆฌ ์ „์—ญํ•˜๊ณ  ์‹ถ๋‹น ใ… ใ…  for (var i = 0; i < text.length; i++) { chars[i] = text.charCodeAt(i); if (chars[i] >= 0xAC00 && chars[i] <= 0xD7A3) { var i1, i2, i3; i3 = chars[i] - 0xAC00; i1 = i3 / (21 * 28); i3 = i3 % (21 * 28); i2 = i3 / 28; i3 = i3 % 28; v.push(String.fromCharCode(ChoSeong[parseInt(i1)])); v.push(String.fromCharCode(JungSeong[parseInt(i2)])); if (i3 != 0x0000) v.push(String.fromCharCode(JongSeong[parseInt(i3)])); } else { v.push(String.fromCharCode(chars[i])); } } return v; }; //////////////////////////////////////////// // ํ•œ๊ธ€ ๋ฐ ๋กœ๋งˆ์ž ๊ทธ๋ฆฌ๊ณ  ๊ธฐํƒ€๋“ฑ๋“ฑ ๋ชจ์Šค๋ถ€ํ˜ธ ๋ณ€ํ™˜ // // Orignal Code by JinH(jinh.tistory.com) // //////////////////////////////////////////// function translate(dit, dah) { var input = hangulToJaso($('#input_textarea').val()); /* var input = new Array(); for (i=0; i<$('#input_textarea').value.length; i++) { input[i] = $('#input_textarea').value.charAt(i); } */ //ํ•œ๊ธ€ ์ž…๋ ฅ ์ฝ”๋“œ for (var i = 0; i < v.length; i++) { if (input[i].charCodeAt() >= 0xFF01 && input[i].charCodeAt() <= 0xFF5E) { // "FF01:๏ผ" ~ "FF5E:๏ฝž"์— ์†ํ•œ ๊ธ€์ž๋ฉด ๋ฐ˜๊ฐ๊ธฐํ˜ธ๋กœ input[i] = String.fromCharCode(input[i].charCodeAt() - 0xFEE0); } else if (input[i].charCodeAt() >= 0x0041 && input[i].charCodeAt() <= 0x005D) { // "FF41:A" ~ "005D:]"์— ์†ํ•œ ๊ธ€์ž๋ฉด ์†Œ๋ฌธ์ž๋กœ input[i] = String.fromCharCode(input[i].charCodeAt() + 0x0020); } else if (input[i].charCodeAt() >= 0x3041 && input[i].charCodeAt() <= 0x3096) { // "3041:ใ" ~ "3096:ใ‚–"์— ์†ํ•œ ๊ธ€์ž๋ฉด ๊ฐ€ํƒ€์นด๋‚˜๋กœ input[i] = String.fromCharCode(input[i].charCodeAt() + 0x0060); } for (var j = 0; j < tranlyze_list.length; j++) { for (var k = 0; k < tranlyze_list[j].length; k++) { if (input[i] == tranlyze_list[j][k][0]) { input[i] = tranlyze_list[j][k][1]; break; } } } } var output = ''; for (i = 0; i < v.length; i++) { output = output + input[i] + 'ใ€€'; } output = output.split("ยท").join(dit + " "); output = output.split("โ€“").join(dah + " "); //$('#output').text(output);//for div element $('#output_textarea').text(output); //for textarea element }
import React, {Component} from 'react'; import {Grid, Typography, Button, withStyles} from "@material-ui/core"; import Head from 'next/head'; import classNames from 'classnames'; import Star from '@material-ui/icons/StarRate'; import Check from '@material-ui/icons/Check'; import {Query} from 'react-apollo'; import gql from 'graphql-tag'; import BreadCrumbs from "./BreadCrumbs"; import Black from "./Buttons/Black"; import Description from "./Description"; import Loading from "./Loading"; export const SINGLE_ITEMS_QUERY = gql` query SINGLE_ITEMS_QUERY($id : ID!) { item(where:{ id: $id}) { id name price description image largeImage } } `; const styles = theme => ({ root: { width: '100%', padding: theme.spacing.unit * 2, }, margin: { marginTop: theme.spacing.unit * 2, marginBottom: theme.spacing.unit * 2, }, imgWrap: { position: 'relative', }, image: { width: '100%' }, productDetailsContent: { marginLeft: theme.spacing.unit * 4, [theme.breakpoints.down('xs')]: { marginTop: 0, marginLeft: 0 }, }, productName: { ...theme.decorativeFont, }, colorButton: { height: theme.spacing.unit * 4, width: theme.spacing.unit * 5, '&:hover': { borderRight: '3.5px solid white', borderLeft: '3.5px solid white', } }, sizeButton: { ...theme.decorativeFont, marginRight: theme.spacing.unit * 2, '&:hover': { ...theme.palette.midNight, } }, }); class SingleProduct extends Component { componentDidMount() { let windowWidth = window.innerWidth; if (windowWidth > 600) { window.addEventListener('scroll', this.handleScroll); } }; componentWillUnmount() { let windowWidth = window.innerWidth; if (windowWidth > 600) { window.removeEventListener('scroll', this.handleScroll); } }; handleScroll = async () => { let imageSection = document.getElementById('imageSection'); let imageSectionHeight = await imageSection.offsetHeight; let textSection = document.getElementById('textSection'); let textSectionHeight = textSection.offsetHeight; let pageYOffset = window.pageYOffset; let windowWidth = window.innerWidth; if (((imageSectionHeight - textSectionHeight) > pageYOffset) && (pageYOffset > 200) && (windowWidth > 600)) { textSection.removeAttribute("style"); textSection.style.position = 'fixed'; textSection.style.top = '0px'; textSection.style.width = '50vw'; } else if (pageYOffset < 220) { textSection.removeAttribute("style"); textSection.style.position = 'relative'; } else { textSection.removeAttribute("style"); textSection.style.position = 'relative'; textSection.style.transform = `translate3d(0px, ${Math.abs(imageSectionHeight - (textSectionHeight + 30))}px, 0px)`; } }; render() { const {classes} = this.props; return ( <Query query={SINGLE_ITEMS_QUERY} variables={{id: this.props.id}}> {({data, error, loading}) => { if (error) return <p>Error!</p>; if (loading) return <Loading/>; if (!data.item) return <p>Product not Found</p>; return <> <Head> <title>Yerish Fits | {data.item.name}</title> </Head> <Grid className={classes.root} container justify="space-between" onScroll={(e) => this.handleScroll(e)}> <BreadCrumbs/> <Grid id="imageSection" item sm={6}> <div className={classNames(classes.imgWrap, classes.margin)}> <img className={classes.image} src={data.item.image} alt={data.item.name}/> </div> </Grid> <Grid item sm={6}> <div id="textSection" className={classNames(classes.productDetailsContent, classes.margin)}> <Grid container alignItems="center"> <Grid item xs={8}> <Typography className={classes.productName} variant="h3">{data.item.name}</Typography> </Grid> <Grid item xs={4}> <Typography variant="h6">{`$${data.item.price}/-`}</Typography> </Grid> </Grid> <Grid container className={classes.margin}> <Grid item> <Star/> <Star/> <Star/> <Star/> <Star/> </Grid> </Grid> <Grid container className={classes.margin}> <Grid item className={classes.colorButton} style={{backgroundColor: 'red'}}> <Check style={{color: 'white', margin: 5}}/> </Grid> <Grid item className={classes.colorButton} style={{backgroundColor: 'yellow'}}/> <Grid item className={classes.colorButton} style={{backgroundColor: 'blue'}}/> <Grid item className={classes.colorButton} style={{backgroundColor: 'pink'}}/> <Grid item className={classes.colorButton} style={{backgroundColor: 'green'}}/> <Grid item className={classes.colorButton} style={{backgroundColor: 'black'}}/> </Grid> <Grid container className={classes.margin}> <Grid item> <Typography variant="body2"> Calculate Size</Typography> </Grid> </Grid> <Grid container className={classes.margin}> <Button className={classes.sizeButton} variant="outlined" size="large"> XL </Button> <Button className={classes.sizeButton} variant="outlined" size="large"> XL </Button> <Button className={classes.sizeButton} variant="outlined" size="large"> XL </Button> <Button className={classes.sizeButton} variant="outlined" size="large"> XL </Button> <Button className={classes.sizeButton} variant="outlined" size="large"> XL </Button> </Grid> <Grid container className={classes.margin}> <Grid item> <Black>Add to Cart</Black> </Grid> </Grid> <Grid container className={classes.margin}> <Typography> Free shipping on all domestic orders </Typography> </Grid> </div> </Grid> </Grid> <Grid className={classes.root} container> <Description/> </Grid> </> }} </Query> ); } } export default withStyles(styles)(SingleProduct);
import { SpaceProps, ColorProps } from "@rajasegar/styled-web-components"; export class FWHeading extends HTMLElement { static get observedAttributes() { return ["level"]; } constructor() { super(); this.attachShadow({ mode: "open" }); this.render(); } render() { this.shadowRoot.innerHTML = ""; const template = document.createElement("template"); this.level = this.getAttribute("level"); const heading = "h" + this.getAttribute("level"); template.innerHTML = ` <style> :host { display: block } </style> <${heading}><slot></slot></${heading}> `; this.shadowRoot.appendChild(template.content.cloneNode(true)); this.heading = this.shadowRoot.querySelector(heading); this.applyStyles(); } attributeChangedCallback(attr) { if (attr === "level") { this.render(); } if (attr === "color") { this.applyStyles(); } } applyStyles() { this.heading.style.color = this.getAttribute("color"); } } customElements.define("fw-heading", SpaceProps(ColorProps(FWHeading)));
"use strict"; const request = require("request"); // https://github.com/request/request const httpRequest = require("http").request; const parseUrl = require("url").parse; const multiparty = require("multiparty"); const PassThrough = require("stream").PassThrough; const config = require("./configuration"); const errors = require("./error-codes"); module.exports = { "create": handleCreateRequest }; const monitorApiUrl = config.executor.monitor.url + "executions"; function handleCreateRequest(req, res) { const contentType = req.headers["content-type"]; if (contentType === undefined || contentType.toLowerCase().indexOf("multipart/form-data") === -1) { createFromNonMultipartRequest(req, res); } else { createFromMultipartRequest(req, res); } } function createFromNonMultipartRequest(req, res) { if (req.query["pipeline"] === undefined) { res.status(400).json({ "error": { "type": errors.INVALID_REQUEST, "message": "Pipeline not specified pipeline.", "source": "FRONTEND" } }); return; } // We have the pipeline IRI in the URL. The content of the body is // considered to be a configuration. const pipeline = { "iri": req.query["pipeline"] }; let configuration = ""; req.on("data", (chunk) => configuration += chunk); req.on("end", () => { unpackPipeline(pipeline, configuration, (error, body) => { if (error) { console.error("Can't unpack pipeline from url:", pipeline.iri, "\n", error); res.status(500).json(error); return; } // Post execution. const formData = { "format": "application/ld+json", "pipeline": { "value": body, "options": { "contentType": "application/octet-stream", "filename": "options.jsonld" } } }; console.time("[POST] /executions"); const options = { "url": monitorApiUrl, "formData": formData, "headers": { "Accept": "application/ld+json" } }; request.post(options) .on("error", (error) => handleConnectionError(res, error)) .on("response", () => console.timeEnd("[POST] /executions")) .pipe(res); }); }); } function handleConnectionError(res, error) { console.error("Request failed:\n", error); console.trace(); res.status(503).json({ "error": { "type": errors.CONNECTION, "source": "FRONTEND" } }); } function unpackPipeline(pipeline, optionsAsString, callback) { if (optionsAsString === undefined || optionsAsString === "") { optionsAsString = "{}"; } const formData = { "options": { "value": optionsAsString, "options": { "contentType": "application/ld+json", "filename": "options.jsonld" } } }; const headers = { "Accept": "application/ld+json" }; let url = config.storage.url + "/api/v1/pipelines/unpack"; if (pipeline.iri) { url += "?iri=" + encodeURIComponent(pipeline.iri); } if (pipeline.body) { formData["pipeline"] = { "value": pipeline.body, "options": { "contentType": "application/ld+json", "filename": "pipeline.jsonld" } } } // console.time("[POST] /unpack"); request.post({"url": url, "formData": formData, "headers": headers}, (error, httpResponse, body) => { console.timeEnd("[POST] /unpack"); if (error) { // Connection error. callback({ "error": { "type": errors.ERROR, "source": "FRONTEND", "message": JSON.stringify(error) } }, undefined); } else if (httpResponse.statusCode !== 200) { callback(JSON.parse(body), undefined); } else { callback(undefined, body); } }); } function createFromMultipartRequest(req, res) { console.log("Creating execution from multipart request"); // We will stream resources to the executor-monitor, once we find // a pipeline we will unpack it and then pipe it. const postUrl = parseUrl(monitorApiUrl); const boundaryString = "------------------------a76d7ee9b9b2b7ef"; const postOptions = { "host": postUrl.postname, "port": postUrl.port, "path": postUrl.path, "method": "POST", "headers": { "Content-Type": "multipart/form-data; boundary=" + boundaryString, "Transfer-Encoding": "chunked", "Accept": "application/json", "Connection": "keep-alive" } }; let pipePostRequestResponse = true; const postRequest = httpRequest(postOptions, (executorMonitorRes) => { // Pipe result back to caller if pipePost is true. if (pipePostRequestResponse) { executorMonitorRes.pipe(res); } }); const postStream = new StreamCombiner(postRequest); const form = new multiparty.Form(); let isFirstBoundary = true; let configurationAsString = ""; // Default is empty configuration. let pipelineAsString = ""; const shouldUnpackPipeline = !req.query["unpacked_pipeline"]; form.on("part", (part) => { if (part.name === "configuration") { part.on("data", (chunk) => configurationAsString += chunk); return; } if (part.name === "pipeline" && shouldUnpackPipeline) { part.on("data", chunk => pipelineAsString += chunk); return; } // Pipe all the rest to executor-monitor server. const textStream = new PassThrough(); if (isFirstBoundary) { isFirstBoundary = false; } else { textStream.write("\r\n"); } createFormInfoEntry(textStream, boundaryString, part); textStream.end(); postStream.append(textStream); postStream.append(part); }); form.on("close", () => { const pipeline = {}; if (req.query["pipeline"] !== undefined) { pipeline.iri = req.query["pipeline"]; } else if (shouldUnpackPipeline) { // Pipeline (frontend format) form the POST request. pipeline.body = pipelineAsString; } else { // Unpacked pipeline was send as a part of request, // so we just need to close the request. const textStream = new PassThrough(); createCloseEntry(textStream, boundaryString); textStream.end(); postStream.append(textStream); postStream.end(); return; } unpackPipeline(pipeline, configurationAsString, (error, result) => { if (error) { console.error("Can't unpack pipeline.", error, result); if (error.error) { res.status(500).json(error.error); } else { res.status(500).json({ "error": { "type": errors.ERROR, "source": "FRONTEND", "message": error.message } }); } pipePostRequestResponse = false; postStream.end(); return; } // Pipe pipeline into the stream. const textStream = new PassThrough(); if (!isFirstBoundary) { textStream.write("\r\n"); } createPipelineEntry(textStream, boundaryString, result); textStream.end(); postStream.append(textStream); postStream.end(); console.log("createFromMultipartRequest ... done") }); }); form.on("error", (error) => { console.error("Can't create pipeline from multipart request.", error); res.status(500).json({ "error": { "type": errors.ERROR, "source": "FRONTEND", "message": "Can't create pipeline from multipart request.", "cause": error.message } }); pipePostRequestResponse = false; postStream.end(); }); form.parse(req); } function createFormInfoEntry(textStream, boundaryString, part) { textStream.write("--" + boundaryString + "\r\n"); textStream.write("Content-Disposition:" + part.headers["content-disposition"] + "\r\n"); textStream.write("Content-Type: " + part.headers["content-type"] + "\r\n\r\n"); } function createCloseEntry(textStream, boundaryString) { textStream.write("\r\n--" + boundaryString + "--\r\n"); } function createPipelineEntry(textStream, boundaryString, pipeline) { textStream.write("--" + boundaryString + "\r\n"); textStream.write( "Content-Disposition: form-data; name=\"pipeline\"; " + "filename=\"pipeline.jsonld\"\r\n"); textStream.write("Content-Type: application/octet-stream\r\n\r\n"); textStream.write(pipeline); createCloseEntry(textStream, boundaryString) } /** * Append multiple streams into one. * Implementation rely on a single thread execution (normal in NodeJS). */ function StreamCombiner(stream) { // Wrapped stream. this.target = stream; // Input streams to combine. this.sources = []; // Index of currently streaming stream. this.index = -1; // If true then close once there are no streams. this.closeOnEnd = false; this.streaming = false; // If true stream on this.index ended and was closed. this.currentClosed = false; const _this = this; // Append given stream to the wrapped stream. this.append = function (stream) { _this.sources.push(stream); if (!_this.streaming) { pipeNext(); } }; this.end = function () { // Close after the last stream is processed. _this.closeOnEnd = true; if (!_this.streaming) { pipeNext(); } }; // Look for next stream and pipe it. function pipeNext() { _this.streaming = true; closeCurrent(); if (_this.index + 1 < _this.sources.length) { // Send new stream. _this.index += 1; const stream = _this.sources[_this.index]; stream.on("end", pipeNext); stream.pipe(_this.target, {"end": false}); _this.currentClosed = false; } else { // Nothing more to stream. if (_this.closeOnEnd) { _this.target.end(); } else { } // Wait for next stream. _this.streaming = false; } } function closeCurrent() { if (_this.index > -1 && !_this.currentClosed) { // Close stream under this.index. const oldStream = _this.sources[_this.index]; oldStream.unpipe(_this.target); _this.currentClosed = true; } } }
'use strict'; const Base = require('./Base'); const IntegrationApplication = require('./IntegrationApplication'); const { Error } = require('../errors'); const { Endpoints } = require('../util/Constants'); const Permissions = require('../util/Permissions'); /** * Represents an invitation to a guild channel. * <warn>The only guaranteed properties are `code`, `channel`, and `url`. Other properties can be missing.</warn> * @extends {Base} */ class Invite extends Base { constructor(client, data) { super(client); this._patch(data); } _patch(data) { /** * The guild the invite is for * @type {?Guild} */ this.guild = data.guild ? this.client.guilds.add(data.guild, false) : null; /** * The code for this invite * @type {string} */ this.code = data.code; /** * The approximate number of online members of the guild this invite is for * @type {?number} */ this.presenceCount = 'approximate_presence_count' in data ? data.approximate_presence_count : null; /** * The approximate total number of members of the guild this invite is for * @type {?number} */ this.memberCount = 'approximate_member_count' in data ? data.approximate_member_count : null; /** * Whether or not this invite is temporary * @type {?boolean} */ this.temporary = 'temporary' in data ? data.temporary : null; /** * The maximum age of the invite, in seconds, 0 if never expires * @type {?number} */ this.maxAge = 'max_age' in data ? data.max_age : null; /** * How many times this invite has been used * @type {?number} */ this.uses = 'uses' in data ? data.uses : null; /** * The maximum uses of this invite * @type {?number} */ this.maxUses = 'max_uses' in data ? data.max_uses : null; /** * The user who created this invite * @type {?User} */ this.inviter = data.inviter ? this.client.users.add(data.inviter) : null; /** * The user whose stream to display for this voice channel stream invite * @type {?User} */ this.targetUser = data.target_user ? this.client.users.add(data.target_user) : null; /** * The embedded application to open for this voice channel embedded application invite * @type {?IntegrationApplication} */ this.targetApplication = data.target_application ? new IntegrationApplication(this.client, data.target_application) : null; /** * The type of the invite target: * * 1: STREAM * * 2: EMBEDDED_APPLICATION * @typedef {number} TargetType */ /** * The target type * @type {?TargetType} */ this.targetType = typeof data.target_type === 'number' ? data.target_type : null; /** * The channel the invite is for * @type {Channel} */ this.channel = this.client.channels.add(data.channel, this.guild, false); /** * The timestamp the invite was created at * @type {?number} */ this.createdTimestamp = 'created_at' in data ? new Date(data.created_at).getTime() : null; this._expiresTimestamp = 'expires_at' in data ? new Date(data.expires_at).getTime() : null; } /** * The time the invite was created at * @type {?Date} * @readonly */ get createdAt() { return this.createdTimestamp ? new Date(this.createdTimestamp) : null; } /** * Whether the invite is deletable by the client user * @type {boolean} * @readonly */ get deletable() { const guild = this.guild; if (!guild || !this.client.guilds.cache.has(guild.id)) return false; if (!guild.me) throw new Error('GUILD_UNCACHED_ME'); return ( this.channel.permissionsFor(this.client.user).has(Permissions.FLAGS.MANAGE_CHANNELS, false) || guild.me.permissions.has(Permissions.FLAGS.MANAGE_GUILD) ); } /** * The timestamp the invite will expire at * @type {?number} * @readonly */ get expiresTimestamp() { return ( this._expiresTimestamp ?? (this.createdTimestamp && this.maxAge ? this.createdTimestamp + this.maxAge * 1000 : null) ); } /** * The time the invite will expire at * @type {?Date} * @readonly */ get expiresAt() { const { expiresTimestamp } = this; return expiresTimestamp ? new Date(expiresTimestamp) : null; } /** * The URL to the invite * @type {string} * @readonly */ get url() { return Endpoints.invite(this.client.options.http.invite, this.code); } /** * Deletes this invite. * @param {string} [reason] Reason for deleting this invite * @returns {Promise<Invite>} */ delete(reason) { return this.client.api.invites[this.code].delete({ reason }).then(() => this); } /** * When concatenated with a string, this automatically concatenates the invite's URL instead of the object. * @returns {string} * @example * // Logs: Invite: https://discord.gg/A1b2C3 * console.log(`Invite: ${invite}`); */ toString() { return this.url; } toJSON() { return super.toJSON({ url: true, expiresTimestamp: true, presenceCount: false, memberCount: false, uses: false, channel: 'channelID', inviter: 'inviterID', guild: 'guildID', }); } valueOf() { return this.code; } } /** * Regular expression that globally matches Discord invite links * @type {RegExp} */ Invite.INVITES_PATTERN = /discord(?:(?:app)?\.com\/invite|\.gg(?:\/invite)?)\/([\w-]{2,255})/gi; module.exports = Invite;
'use strict'; const url = require('url'); const path = require('path'); const pgConnectionString = require('pg-connection-string'); const retry = require('retry-as-promised'); const _ = require('lodash'); const Utils = require('./utils'); const Model = require('./model'); const DataTypes = require('./data-types'); const Deferrable = require('./deferrable'); const ModelManager = require('./model-manager'); const { Transaction, TRANSACTION_TYPES } = require('./transaction'); const { QueryTypes } = require('./query-types'); const { TableHints } = require('./table-hints'); const { IndexHints } = require('./index-hints'); const sequelizeErrors = require('./errors'); const Hooks = require('./hooks'); const Association = require('./associations/index'); const Validator = require('./utils/validator-extras').validator; const { Op } = require('./operators'); const deprecations = require('./utils/deprecations'); const { QueryInterface } = require('./dialects/abstract/query-interface'); const { BelongsTo } = require('./associations/belongs-to'); const HasOne = require('./associations/has-one'); const { BelongsToMany } = require('./associations/belongs-to-many'); const { HasMany } = require('./associations/has-many'); /** * This is the main class, the entry point to sequelize. */ class Sequelize { /** * Instantiate sequelize with name of database, username and password. * * @example * // without password / with blank password * const sequelize = new Sequelize('database', 'username', null, { * dialect: 'mysql' * }) * * // with password and options * const sequelize = new Sequelize('my_database', 'john', 'doe', { * dialect: 'postgres' * }) * * // with database, username, and password in the options object * const sequelize = new Sequelize({ database, username, password, dialect: 'mssql' }); * * // with uri * const sequelize = new Sequelize('mysql://localhost:3306/database', {}) * * // option examples * const sequelize = new Sequelize('database', 'username', 'password', { * // the sql dialect of the database * // currently supported: 'mysql', 'sqlite', 'postgres', 'mssql' * dialect: 'mysql', * * // custom host; default: localhost * host: 'my.server.tld', * // for postgres, you can also specify an absolute path to a directory * // containing a UNIX socket to connect over * // host: '/sockets/psql_sockets'. * * // custom port; default: dialect default * port: 12345, * * // custom protocol; default: 'tcp' * // postgres only, useful for Heroku * protocol: null, * * // disable logging or provide a custom logging function; default: console.log * logging: false, * * // you can also pass any dialect options to the underlying dialect library * // - default is empty * // - currently supported: 'mysql', 'postgres', 'mssql' * dialectOptions: { * socketPath: '/Applications/MAMP/tmp/mysql/mysql.sock', * supportBigNumbers: true, * bigNumberStrings: true * }, * * // the storage engine for sqlite * // - default ':memory:' * storage: 'path/to/database.sqlite', * * // disable inserting undefined values as NULL * // - default: false * omitNull: true, * * // a flag for using a native library or not. * // in the case of 'pg' -- set this to true will allow SSL support * // - default: false * native: true, * * // Specify options, which are used when sequelize.define is called. * // The following example: * // define: { timestamps: false } * // is basically the same as: * // Model.init(attributes, { timestamps: false }); * // sequelize.define(name, attributes, { timestamps: false }); * // so defining the timestamps for each model will be not necessary * define: { * underscored: false, * freezeTableName: false, * charset: 'utf8', * dialectOptions: { * collate: 'utf8_general_ci' * }, * timestamps: true * }, * * // similar for sync: you can define this to always force sync for models * sync: { force: true }, * * // pool configuration used to pool database connections * pool: { * max: 5, * idle: 30000, * acquire: 60000, * }, * * // isolation level of each transaction * // defaults to dialect default * isolationLevel: Transaction.ISOLATION_LEVELS.REPEATABLE_READ * }) * * @param {string} [database] The name of the database * @param {string} [username=null] The username which is used to authenticate against the database. * @param {string} [password=null] The password which is used to authenticate against the database. Supports SQLCipher encryption for SQLite. * @param {object} [options={}] An object with options. * @param {string} [options.host='localhost'] The host of the relational database. * @param {number} [options.port] The port of the relational database. * @param {string} [options.username=null] The username which is used to authenticate against the database. * @param {string} [options.password=null] The password which is used to authenticate against the database. * @param {string} [options.database=null] The name of the database. * @param {string} [options.dialect] The dialect of the database you are connecting to. One of mysql, postgres, sqlite, db2, mariadb and mssql. * @param {string} [options.dialectModule=null] If specified, use this dialect library. For example, if you want to use pg.js instead of pg when connecting to a pg database, you should specify 'require("pg.js")' here * @param {string} [options.dialectModulePath=null] If specified, load the dialect library from this path. For example, if you want to use pg.js instead of pg when connecting to a pg database, you should specify '/path/to/pg.js' here * @param {object} [options.dialectOptions] An object of additional options, which are passed directly to the connection library * @param {string} [options.storage] Only used by sqlite. Defaults to ':memory:' * @param {string} [options.protocol='tcp'] The protocol of the relational database. * @param {object} [options.define={}] Default options for model definitions. See {@link Model.init}. * @param {object} [options.query={}] Default options for sequelize.query * @param {string} [options.schema=null] A schema to use * @param {object} [options.set={}] Default options for sequelize.set * @param {object} [options.sync={}] Default options for sequelize.sync * @param {string} [options.timezone='+00:00'] The timezone used when converting a date from the database into a JavaScript date. The timezone is also used to SET TIMEZONE when connecting to the server, to ensure that the result of NOW, CURRENT_TIMESTAMP and other time related functions have in the right timezone. For best cross platform performance use the format +/-HH:MM. Will also accept string versions of timezones used by moment.js (e.g. 'America/Los_Angeles'); this is useful to capture daylight savings time changes. * @param {string|boolean} [options.clientMinMessages='warning'] (Deprecated) The PostgreSQL `client_min_messages` session parameter. Set to `false` to not override the database's default. * @param {boolean} [options.standardConformingStrings=true] The PostgreSQL `standard_conforming_strings` session parameter. Set to `false` to not set the option. WARNING: Setting this to false may expose vulnerabilities and is not recommended! * @param {Function} [options.logging=console.log] A function that gets executed every time Sequelize would log something. Function may receive multiple parameters but only first one is printed by `console.log`. To print all values use `(...msg) => console.log(msg)` * @param {boolean} [options.benchmark=false] Pass query execution time in milliseconds as second argument to logging function (options.logging). * @param {boolean} [options.omitNull=false] A flag that defines if null values should be passed as values to CREATE/UPDATE SQL queries or not. * @param {boolean} [options.native=false] A flag that defines if native library shall be used or not. Currently only has an effect for postgres * @param {boolean} [options.replication=false] Use read / write replication. To enable replication, pass an object, with two properties, read and write. Write should be an object (a single server for handling writes), and read an array of object (several servers to handle reads). Each read/write server can have the following properties: `host`, `port`, `username`, `password`, `database` * @param {object} [options.pool] sequelize connection pool configuration * @param {number} [options.pool.max=5] Maximum number of connection in pool * @param {number} [options.pool.min=0] Minimum number of connection in pool * @param {number} [options.pool.idle=10000] The maximum time, in milliseconds, that a connection can be idle before being released. * @param {number} [options.pool.acquire=60000] The maximum time, in milliseconds, that pool will try to get connection before throwing error * @param {number} [options.pool.evict=1000] The time interval, in milliseconds, after which sequelize-pool will remove idle connections. * @param {Function} [options.pool.validate] A function that validates a connection. Called with client. The default function checks that client is an object, and that its state is not disconnected * @param {number} [options.pool.maxUses=Infinity] The number of times a connection can be used before discarding it for a replacement, [`used for eventual cluster rebalancing`](https://github.com/sequelize/sequelize-pool). * @param {boolean} [options.quoteIdentifiers=true] Set to `false` to make table names and attributes case-insensitive on Postgres and skip double quoting of them. WARNING: Setting this to false may expose vulnerabilities and is not recommended! * @param {string} [options.transactionType='DEFERRED'] Set the default transaction type. See `Sequelize.Transaction.TYPES` for possible options. Sqlite only. * @param {string} [options.isolationLevel] Set the default transaction isolation level. See `Sequelize.Transaction.ISOLATION_LEVELS` for possible options. * @param {object} [options.retry] Set of flags that control when a query is automatically retried. Accepts all options for [`retry-as-promised`](https://github.com/mickhansen/retry-as-promised). * @param {Array} [options.retry.match] Only retry a query if the error matches one of these strings. * @param {number} [options.retry.max] How many times a failing query is automatically retried. Set to 0 to disable retrying on SQL_BUSY error. * @param {boolean} [options.typeValidation=false] Run built-in type validators on insert and update, and select with where clause, e.g. validate that arguments passed to integer fields are integer-like. * @param {object} [options.operatorsAliases] String based operator alias. Pass object to limit set of aliased operators. * @param {object} [options.hooks] An object of global hook functions that are called before and after certain lifecycle events. Global hooks will run after any model-specific hooks defined for the same event (See `Sequelize.Model.init()` for a list). Additionally, `beforeConnect()`, `afterConnect()`, `beforeDisconnect()`, and `afterDisconnect()` hooks may be defined here. * @param {boolean} [options.minifyAliases=false] A flag that defines if aliases should be minified (mostly useful to avoid Postgres alias character limit of 64) * @param {boolean} [options.logQueryParameters=false] A flag that defines if show bind parameters in log. */ constructor(database, username, password, options) { let config; if (arguments.length === 1 && typeof database === 'object') { // new Sequelize({ ... options }) options = database; config = _.pick(options, 'host', 'port', 'database', 'username', 'password'); } else if (arguments.length === 1 && typeof database === 'string' || arguments.length === 2 && typeof username === 'object') { // new Sequelize(URI, { ... options }) config = {}; options = username || {}; const urlParts = url.parse(arguments[0], true); options.dialect = urlParts.protocol.replace(/:$/, ''); options.host = urlParts.hostname; if (options.dialect === 'sqlite' && urlParts.pathname && !urlParts.pathname.startsWith('/:memory')) { const storagePath = path.join(options.host, urlParts.pathname); options.storage = path.resolve(options.storage || storagePath); } if (urlParts.pathname) { config.database = urlParts.pathname.replace(/^\//, ''); } if (urlParts.port) { options.port = urlParts.port; } if (urlParts.auth) { const authParts = urlParts.auth.split(':'); config.username = authParts[0]; if (authParts.length > 1) { config.password = authParts.slice(1).join(':'); } } if (urlParts.query) { // Allow host query argument to override the url host. // Enables specifying domain socket hosts which cannot be specified via the typical // host part of a url. if (urlParts.query.host) { options.host = urlParts.query.host; } if (options.dialectOptions) { Object.assign(options.dialectOptions, urlParts.query); } else { options.dialectOptions = urlParts.query; if (urlParts.query.options) { try { const o = JSON.parse(urlParts.query.options); options.dialectOptions.options = o; } catch { // Nothing to do, string is not a valid JSON // an thus does not need any further processing } } } } // For postgres, we can use this helper to load certs directly from the // connection string. if (['postgres', 'postgresql'].includes(options.dialect)) { Object.assign(options.dialectOptions, pgConnectionString.parse(arguments[0])); } } else { // new Sequelize(database, username, password, { ... options }) options = options || {}; config = { database, username, password }; } Sequelize.runHooks('beforeInit', config, options); this.options = { dialect: null, dialectModule: null, dialectModulePath: null, host: 'localhost', protocol: 'tcp', define: {}, query: {}, sync: {}, timezone: '+00:00', standardConformingStrings: true, logging: console.debug, omitNull: false, native: false, replication: false, ssl: undefined, pool: {}, quoteIdentifiers: true, hooks: {}, retry: { max: 5, match: [ 'SQLITE_BUSY: database is locked', ], }, transactionType: TRANSACTION_TYPES.DEFERRED, isolationLevel: null, databaseVersion: 0, typeValidation: false, benchmark: false, minifyAliases: false, logQueryParameters: false, ...options, }; if (!this.options.dialect) { throw new Error('Dialect needs to be explicitly supplied as of v4.0.0'); } if (this.options.dialect === 'postgresql') { this.options.dialect = 'postgres'; } if (this.options.dialect === 'sqlite' && this.options.timezone !== '+00:00') { throw new Error('Setting a custom timezone is not supported by SQLite, dates are always returned as UTC. Please remove the custom timezone parameter.'); } if (this.options.dialect === 'ibmi' && this.options.timezone !== '+00:00') { throw new Error('Setting a custom timezone is not supported by Db2 for i, dates are always returned as UTC. Please remove the custom timezone parameter.'); } if (this.options.logging === true) { deprecations.noTrueLogging(); this.options.logging = console.debug; } this._setupHooks(options.hooks); this.config = { database: config.database || this.options.database, username: config.username || this.options.username, password: config.password || this.options.password || null, host: config.host || this.options.host, port: config.port || this.options.port, pool: this.options.pool, protocol: this.options.protocol, native: this.options.native, ssl: this.options.ssl, replication: this.options.replication, dialectModule: this.options.dialectModule, dialectModulePath: this.options.dialectModulePath, keepDefaultTimezone: this.options.keepDefaultTimezone, dialectOptions: this.options.dialectOptions, }; let Dialect; // Requiring the dialect in a switch-case to keep the // require calls static. (Browserify fix) switch (this.getDialect()) { case 'mariadb': Dialect = require('./dialects/mariadb'); break; case 'mssql': Dialect = require('./dialects/mssql'); break; case 'mysql': Dialect = require('./dialects/mysql'); break; case 'postgres': Dialect = require('./dialects/postgres'); break; case 'sqlite': Dialect = require('./dialects/sqlite'); break; case 'ibmi': Dialect = require('./dialects/ibmi'); break; case 'db2': Dialect = require('./dialects/db2'); break; case 'snowflake': Dialect = require('./dialects/snowflake'); break; default: throw new Error(`The dialect ${this.getDialect()} is not supported. Supported dialects: mssql, mariadb, mysql, postgres, db2, ibmi and sqlite.`); } this.dialect = new Dialect(this); this.dialect.queryGenerator.typeValidation = options.typeValidation; if (_.isPlainObject(this.options.operatorsAliases)) { deprecations.noStringOperators(); this.dialect.queryGenerator.setOperatorsAliases(this.options.operatorsAliases); } else if (typeof this.options.operatorsAliases === 'boolean') { deprecations.noBoolOperatorAliases(); } this.queryInterface = this.dialect.queryInterface; /** * Models are stored here under the name given to `sequelize.define` */ this.models = {}; this.modelManager = new ModelManager(this); this.connectionManager = this.dialect.connectionManager; Sequelize.runHooks('afterInit', this); } /** * Refresh data types and parsers. * * @private */ refreshTypes() { this.connectionManager.refreshTypeParser(DataTypes); } /** * Returns the specified dialect. * * @returns {string} The specified dialect. */ getDialect() { return this.options.dialect; } /** * Returns the database name. * * @returns {string} The database name. */ getDatabaseName() { return this.config.database; } /** * Returns an instance of QueryInterface. * * @returns {QueryInterface} An instance (singleton) of QueryInterface. */ getQueryInterface() { return this.queryInterface; } /** * Define a new model, representing a table in the database. * * The table columns are defined by the object that is given as the second argument. Each key of the object represents a column * * @param {string} modelName The name of the model. The model will be stored in `sequelize.models` under this name * @param {object} attributes An object, where each attribute is a column of the table. See {@link Model.init} * @param {object} [options] These options are merged with the default define options provided to the Sequelize constructor and passed to Model.init() * * @see * {@link Model.init} for a more comprehensive specification of the `options` and `attributes` objects. * @see * <a href="/master/manual/model-basics.html">Model Basics</a> guide * * @returns {Model} Newly defined model * * @example * sequelize.define('modelName', { * columnA: { * type: Sequelize.BOOLEAN, * validate: { * is: ["[a-z]",'i'], // will only allow letters * max: 23, // only allow values <= 23 * isIn: { * args: [['en', 'zh']], * msg: "Must be English or Chinese" * } * }, * field: 'column_a' * }, * columnB: Sequelize.STRING, * columnC: 'MY VERY OWN COLUMN TYPE' * }); * * sequelize.models.modelName // The model will now be available in models under the name given to define */ define(modelName, attributes, options = {}) { options.modelName = modelName; options.sequelize = this; const model = class extends Model {}; model.init(attributes, options); return model; } /** * Fetch a Model which is already defined * * @param {string} modelName The name of a model defined with Sequelize.define * * @throws Will throw an error if the model is not defined (that is, if sequelize#isDefined returns false) * @returns {Model} Specified model */ model(modelName) { if (!this.isDefined(modelName)) { throw new Error(`${modelName} has not been defined`); } return this.modelManager.getModel(modelName); } /** * Checks whether a model with the given name is defined * * @param {string} modelName The name of a model defined with Sequelize.define * * @returns {boolean} Returns true if model is already defined, otherwise false */ isDefined(modelName) { return this.modelManager.models.some(model => model.name === modelName); } /** * Execute a query on the DB, optionally bypassing all the Sequelize goodness. * * By default, the function will return two arguments: an array of results, and a metadata object, containing number of affected rows etc. * * If you are running a type of query where you don't need the metadata, for example a `SELECT` query, you can pass in a query type to make sequelize format the results: * * ```js * const [results, metadata] = await sequelize.query('SELECT...'); // Raw query - use array destructuring * * const results = await sequelize.query('SELECT...', { type: sequelize.QueryTypes.SELECT }); // SELECT query - no destructuring * ``` * * @param {string} sql * @param {object} [options={}] Query options. * @param {boolean} [options.raw] If true, sequelize will not try to format the results of the query, or build an instance of a model from the result * @param {Transaction} [options.transaction=null] The transaction that the query should be executed under * @param {QueryTypes} [options.type='RAW'] The type of query you are executing. The query type affects how results are formatted before they are passed back. The type is a string, but `Sequelize.QueryTypes` is provided as convenience shortcuts. * @param {boolean} [options.nest=false] If true, transforms objects with `.` separated property names into nested objects using [dottie.js](https://github.com/mickhansen/dottie.js). For example { 'user.username': 'john' } becomes { user: { username: 'john' }}. When `nest` is true, the query type is assumed to be `'SELECT'`, unless otherwise specified * @param {boolean} [options.plain=false] Sets the query type to `SELECT` and return a single row * @param {object|Array} [options.replacements] Either an object of named parameter replacements in the format `:param` or an array of unnamed replacements to replace `?` in your SQL. * @param {object|Array} [options.bind] Either an object of named bind parameter in the format `_param` or an array of unnamed bind parameter to replace `$1, $2, ...` in your SQL. * @param {boolean} [options.useMaster=false] Force the query to use the write pool, regardless of the query type. * @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql. * @param {Model} [options.instance] A sequelize model instance whose Model is to be used to build the query result * @param {ModelStatic<Model>} [options.model] A sequelize model used to build the returned model instances * @param {object} [options.retry] Set of flags that control when a query is automatically retried. Accepts all options for [`retry-as-promised`](https://github.com/mickhansen/retry-as-promised). * @param {Array} [options.retry.match] Only retry a query if the error matches one of these strings. * @param {Integer} [options.retry.max] How many times a failing query is automatically retried. * @param {string} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only) * @param {boolean} [options.supportsSearchPath] If false do not prepend the query with the search_path (Postgres only) * @param {boolean} [options.mapToModel=false] Map returned fields to model's fields if `options.model` or `options.instance` is present. Mapping will occur before building the model instance. * @param {object} [options.fieldMap] Map returned fields to arbitrary names for `SELECT` query type. * @param {boolean} [options.rawErrors=false] Set to `true` to cause errors coming from the underlying connection/database library to be propagated unmodified and unformatted. Else, the default behavior (=false) is to reinterpret errors as sequelize.errors.BaseError objects. * * @returns {Promise} * * @see {@link Model.build} for more information about instance option. */ async query(sql, options) { options = { ...this.options.query, ...options }; if (options.instance && !options.model) { options.model = options.instance.constructor; } if (!options.instance && !options.model) { options.raw = true; } // map raw fields to model attributes if (options.mapToModel) { options.fieldMap = _.get(options, 'model.fieldAttributeMap', {}); } options = _.defaults(options, { logging: Object.prototype.hasOwnProperty.call(this.options, 'logging') ? this.options.logging : console.debug, searchPath: Object.prototype.hasOwnProperty.call(this.options, 'searchPath') ? this.options.searchPath : 'DEFAULT', }); if (!options.type) { if (options.model || options.nest || options.plain) { options.type = QueryTypes.SELECT; } else { options.type = QueryTypes.RAW; } } // if dialect doesn't support search_path or dialect option // to prepend searchPath is not true delete the searchPath option if ( !this.dialect.supports.searchPath || !this.options.dialectOptions || !this.options.dialectOptions.prependSearchPath || options.supportsSearchPath === false ) { delete options.searchPath; } else if (!options.searchPath) { // if user wants to always prepend searchPath (dialectOptions.preprendSearchPath = true) // then set to DEFAULT if none is provided options.searchPath = 'DEFAULT'; } if (typeof sql === 'object') { if (sql.values !== undefined) { if (options.replacements !== undefined) { throw new Error('Both `sql.values` and `options.replacements` cannot be set at the same time'); } options.replacements = sql.values; } if (sql.bind !== undefined) { if (options.bind !== undefined) { throw new Error('Both `sql.bind` and `options.bind` cannot be set at the same time'); } options.bind = sql.bind; } if (sql.query !== undefined) { sql = sql.query; } } sql = sql.trim(); if (options.replacements && options.bind) { throw new Error('Both `replacements` and `bind` cannot be set at the same time'); } if (options.replacements) { if (Array.isArray(options.replacements)) { sql = Utils.format([sql].concat(options.replacements), this.options.dialect); } else { sql = Utils.formatNamedParameters(sql, options.replacements, this.options.dialect); } } let bindParameters; if (options.bind) { [sql, bindParameters] = this.dialect.Query.formatBindParameters(sql, options.bind, this.options.dialect); } const checkTransaction = () => { if (options.transaction && options.transaction.finished && !options.completesTransaction) { const error = new Error(`${options.transaction.finished} has been called on this transaction(${options.transaction.id}), you can no longer use it. (The rejected query is attached as the 'sql' property of this error)`); error.sql = sql; throw error; } }; const retryOptions = { ...this.options.retry, ...options.retry }; return retry(async () => { if (options.transaction === undefined && Sequelize._cls) { options.transaction = Sequelize._cls.get('transaction'); } checkTransaction(); const connection = await (options.transaction ? options.transaction.connection : this.connectionManager.getConnection({ useMaster: options.useMaster, type: options.type === 'SELECT' ? 'read' : 'write', })); if (this.options.dialect === 'db2' && options.alter && options.alter.drop === false) { connection.dropTable = false; } const query = new this.dialect.Query(connection, this, options); try { await this.runHooks('beforeQuery', options, query); checkTransaction(); return await query.run(sql, bindParameters); } finally { await this.runHooks('afterQuery', options, query); if (!options.transaction) { await this.connectionManager.releaseConnection(connection); } } }, retryOptions); } /** * Execute a query which would set an environment or user variable. The variables are set per connection, so this function needs a transaction. * Only works for MySQL or MariaDB. * * @param {object} variables Object with multiple variables. * @param {object} [options] query options. * @param {Transaction} [options.transaction] The transaction that the query should be executed under * * @memberof Sequelize * * @returns {Promise} */ async set(variables, options) { // Prepare options options = { ...this.options.set, ...typeof options === 'object' && options }; if (!['mysql', 'mariadb'].includes(this.options.dialect)) { throw new Error('sequelize.set is only supported for mysql or mariadb'); } if (!options.transaction || !(options.transaction instanceof Transaction)) { throw new TypeError('options.transaction is required'); } // Override some options, since this isn't a SELECT options.raw = true; options.plain = true; options.type = 'SET'; // Generate SQL Query const query = `SET ${ _.map(variables, (v, k) => `@${k} := ${typeof v === 'string' ? `"${v}"` : v}`).join(', ')}`; return await this.query(query, options); } /** * Escape value. * * @param {string} value string value to escape * * @returns {string} */ escape(value) { return this.dialect.queryGenerator.escape(value); } /** * Create a new database schema. * * **Note:** this is a schema in the [postgres sense of the word](http://www.postgresql.org/docs/9.1/static/ddl-schemas.html), * not a database table. In mysql and sqlite, this command will do nothing. * * @see * {@link Model.schema} * * @param {string} schema Name of the schema * @param {object} [options={}] query options * @param {boolean|Function} [options.logging] A function that logs sql queries, or false for no logging * * @returns {Promise} */ async createSchema(schema, options) { return await this.getQueryInterface().createSchema(schema, options); } /** * Show all defined schemas * * **Note:** this is a schema in the [postgres sense of the word](http://www.postgresql.org/docs/9.1/static/ddl-schemas.html), * not a database table. In mysql and sqlite, this will show all tables. * * @param {object} [options={}] query options * @param {boolean|Function} [options.logging] A function that logs sql queries, or false for no logging * * @returns {Promise} */ async showAllSchemas(options) { return await this.getQueryInterface().showAllSchemas(options); } /** * Drop a single schema * * **Note:** this is a schema in the [postgres sense of the word](http://www.postgresql.org/docs/9.1/static/ddl-schemas.html), * not a database table. In mysql and sqlite, this drop a table matching the schema name * * @param {string} schema Name of the schema * @param {object} [options={}] query options * @param {boolean|Function} [options.logging] A function that logs sql queries, or false for no logging * * @returns {Promise} */ async dropSchema(schema, options) { return await this.getQueryInterface().dropSchema(schema, options); } /** * Drop all schemas. * * **Note:** this is a schema in the [postgres sense of the word](http://www.postgresql.org/docs/9.1/static/ddl-schemas.html), * not a database table. In mysql and sqlite, this is the equivalent of drop all tables. * * @param {object} [options={}] query options * @param {boolean|Function} [options.logging] A function that logs sql queries, or false for no logging * * @returns {Promise} */ async dropAllSchemas(options) { return await this.getQueryInterface().dropAllSchemas(options); } /** * Sync all defined models to the DB. * * @param {object} [options={}] sync options * @param {boolean} [options.force=false] If force is true, each Model will run `DROP TABLE IF EXISTS`, before it tries to create its own table * @param {RegExp} [options.match] Match a regex against the database name before syncing, a safety check for cases where force: true is used in tests but not live code * @param {boolean|Function} [options.logging=console.log] A function that logs sql queries, or false for no logging * @param {string} [options.schema='public'] The schema that the tables should be created in. This can be overridden for each table in sequelize.define * @param {string} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only) * @param {boolean} [options.hooks=true] If hooks is true then beforeSync, afterSync, beforeBulkSync, afterBulkSync hooks will be called * @param {boolean|object} [options.alter=false] Alters tables to fit models. Provide an object for additional configuration. Not recommended for production use. If not further configured deletes data in columns that were removed or had their type changed in the model. * @param {boolean} [options.alter.drop=true] Prevents any drop statements while altering a table when set to `false` * * @returns {Promise} */ async sync(options) { options = { ...this.options, ...this.options.sync, ...options, hooks: options ? options.hooks !== false : true, }; if (options.match && !options.match.test(this.config.database)) { throw new Error(`Database "${this.config.database}" does not match sync match parameter "${options.match}"`); } if (options.hooks) { await this.runHooks('beforeBulkSync', options); } if (options.force) { await this.drop(options); } const models = []; // Topologically sort by foreign key constraints to give us an appropriate // creation order this.modelManager.forEachModel(model => { if (model) { models.push(model); } else { // DB should throw an SQL error if referencing non-existent table } }); // no models defined, just authenticate if (models.length === 0) { await this.authenticate(options); } else { for (const model of models) { await model.sync(options); } } if (options.hooks) { await this.runHooks('afterBulkSync', options); } return this; } /** * Truncate all tables defined through the sequelize models. * This is done by calling `Model.truncate()` on each model. * * @param {object} [options] The options passed to Model.destroy in addition to truncate * @param {boolean|Function} [options.logging] A function that logs sql queries, or false for no logging * @returns {Promise} * * @see * {@link Model.truncate} for more information */ async truncate(options) { const models = []; this.modelManager.forEachModel(model => { if (model) { models.push(model); } }, { reverse: false }); if (options && options.cascade) { for (const model of models) { await model.truncate(options); } } else { await Promise.all(models.map(model => model.truncate(options))); } } /** * Drop all tables defined through this sequelize instance. * This is done by calling Model.drop on each model. * * @see * {@link Model.drop} for options * * @param {object} [options] The options passed to each call to Model.drop * @param {boolean|Function} [options.logging] A function that logs sql queries, or false for no logging * * @returns {Promise} */ async drop(options) { const models = []; this.modelManager.forEachModel(model => { if (model) { models.push(model); } }, { reverse: false }); for (const model of models) { await model.drop(options); } } /** * Test the connection by trying to authenticate. It runs `SELECT 1+1 AS result` query. * * @param {object} [options={}] query options * * @returns {Promise} */ async authenticate(options) { options = { raw: true, plain: true, type: QueryTypes.SELECT, ...options, }; await this.query(`SELECT 1+1 AS result${this.options.dialect === 'ibmi' ? ' FROM SYSIBM.SYSDUMMY1' : ''}`, options); } async databaseVersion(options) { return await this.getQueryInterface().databaseVersion(options); } /** * Get the fn for random based on the dialect * * @returns {Sequelize.fn} */ random() { if (['postgres', 'sqlite', 'snowflake'].includes(this.getDialect())) { return this.fn('RANDOM'); } return this.fn('RAND'); } /** * Creates an object representing a database function. This can be used in search queries, both in where and order parts, and as default values in column definitions. * If you want to refer to columns in your function, you should use `sequelize.col`, so that the columns are properly interpreted as columns and not a strings. * * @see * {@link Model.findAll} * @see * {@link Sequelize.define} * @see * {@link Sequelize.col} * * @param {string} fn The function you want to call * @param {any} args All further arguments will be passed as arguments to the function * * @since v2.0.0-dev3 * @memberof Sequelize * @returns {Sequelize.fn} * * @example <caption>Convert a user's username to upper case</caption> * instance.update({ * username: sequelize.fn('upper', sequelize.col('username')) * }); */ static fn(fn, ...args) { return new Utils.Fn(fn, args); } /** * Creates an object which represents a column in the DB, this allows referencing another column in your query. This is often useful in conjunction with `sequelize.fn`, since raw string arguments to fn will be escaped. * * @see * {@link Sequelize#fn} * * @param {string} col The name of the column * @since v2.0.0-dev3 * @memberof Sequelize * * @returns {Sequelize.col} */ static col(col) { return new Utils.Col(col); } /** * Creates an object representing a call to the cast function. * * @param {any} val The value to cast * @param {string} type The type to cast it to * @since v2.0.0-dev3 * @memberof Sequelize * * @returns {Sequelize.cast} */ static cast(val, type) { return new Utils.Cast(val, type); } /** * Creates an object representing a literal, i.e. something that will not be escaped. * * @param {any} val literal value * @since v2.0.0-dev3 * @memberof Sequelize * * @returns {Sequelize.literal} */ static literal(val) { return new Utils.Literal(val); } /** * An AND query * * @see * {@link Model.findAll} * * @param {...string|object} args Each argument will be joined by AND * @since v2.0.0-dev3 * @memberof Sequelize * * @returns {Sequelize.and} */ static and(...args) { return { [Op.and]: args }; } /** * An OR query * * @see * {@link Model.findAll} * * @param {...string|object} args Each argument will be joined by OR * @since v2.0.0-dev3 * @memberof Sequelize * * @returns {Sequelize.or} */ static or(...args) { return { [Op.or]: args }; } /** * Creates an object representing nested where conditions for postgres/sqlite/mysql json data-type. * * @see * {@link Model.findAll} * * @param {string|object} conditionsOrPath A hash containing strings/numbers or other nested hash, a string using dot notation or a string using postgres/sqlite/mysql json syntax. * @param {string|number|boolean} [value] An optional value to compare against. Produces a string of the form "<json path> = '<value>'". * @memberof Sequelize * * @returns {Sequelize.json} */ static json(conditionsOrPath, value) { return new Utils.Json(conditionsOrPath, value); } /** * A way of specifying attr = condition. * * The attr can either be an object taken from `Model.rawAttributes` (for example `Model.rawAttributes.id` or `Model.rawAttributes.name`). The * attribute should be defined in your model definition. The attribute can also be an object from one of the sequelize utility functions (`sequelize.fn`, `sequelize.col` etc.) * * For string attributes, use the regular `{ where: { attr: something }}` syntax. If you don't want your string to be escaped, use `sequelize.literal`. * * @see * {@link Model.findAll} * * @param {object} attr The attribute, which can be either an attribute object from `Model.rawAttributes` or a sequelize object, for example an instance of `sequelize.fn`. For simple string attributes, use the POJO syntax * @param {symbol} [comparator='Op.eq'] operator * @param {string|object} logic The condition. Can be both a simply type, or a further condition (`or`, `and`, `.literal` etc.) * @since v2.0.0-dev3 */ static where(attr, comparator, logic) { return new Utils.Where(attr, comparator, logic); } /** * Start a transaction. When using transactions, you should pass the transaction in the options argument in order for the query to happen under that transaction @see {@link Transaction} * * If you have [CLS](https://github.com/Jeff-Lewis/cls-hooked) enabled, the transaction will automatically be passed to any query that runs within the callback * * @example * * try { * const transaction = await sequelize.transaction(); * const user = await User.findOne(..., { transaction }); * await user.update(..., { transaction }); * await transaction.commit(); * } catch { * await transaction.rollback() * } * * @example <caption>A syntax for automatically committing or rolling back based on the promise chain resolution is also supported</caption> * * try { * await sequelize.transaction(transaction => { // Note that we pass a callback rather than awaiting the call with no arguments * const user = await User.findOne(..., {transaction}); * await user.update(..., {transaction}); * }); * // Committed * } catch(err) { * // Rolled back * console.error(err); * } * @example <caption>To enable CLS, add it do your project, create a namespace and set it on the sequelize constructor:</caption> * * const cls = require('cls-hooked'); * const namespace = cls.createNamespace('....'); * const Sequelize = require('@sequelize/core'); * Sequelize.useCLS(namespace); * * // Note, that CLS is enabled for all sequelize instances, and all instances will share the same namespace * * @param {object} [options] Transaction options * @param {string} [options.type='DEFERRED'] See `Sequelize.Transaction.TYPES` for possible options. Sqlite only. * @param {string} [options.isolationLevel] See `Sequelize.Transaction.ISOLATION_LEVELS` for possible options * @param {string} [options.deferrable] Sets the constraints to be deferred or immediately checked. See `Sequelize.Deferrable`. PostgreSQL Only * @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql. * @param {Function} [autoCallback] The callback is called with the transaction object, and should return a promise. If the promise is resolved, the transaction commits; if the promise rejects, the transaction rolls back * * @returns {Promise} */ async transaction(options, autoCallback) { if (typeof options === 'function') { autoCallback = options; options = undefined; } const transaction = new Transaction(this, options); if (!autoCallback) { await transaction.prepareEnvironment(false); return transaction; } // autoCallback provided return Sequelize._clsRun(async () => { try { await transaction.prepareEnvironment(); const result = await autoCallback(transaction); await transaction.commit(); return await result; } catch (error) { try { if (!transaction.finished) { await transaction.rollback(); } else { // release the connection, even if we don't need to rollback await transaction.cleanup(); } } catch { // ignore } throw error; } }); } /** * Use CLS (Continuation Local Storage) with Sequelize. With Continuation * Local Storage, all queries within the transaction callback will * automatically receive the transaction object. * * CLS namespace provided is stored as `Sequelize._cls` * * @param {object} ns CLS namespace * @returns {object} Sequelize constructor */ static useCLS(ns) { // check `ns` is valid CLS namespace if (!ns || typeof ns !== 'object' || typeof ns.bind !== 'function' || typeof ns.run !== 'function') { throw new Error('Must provide CLS namespace'); } // save namespace as `Sequelize._cls` Sequelize._cls = ns; // return Sequelize for chaining return this; } /** * Run function in CLS context. * If no CLS context in use, just runs the function normally * * @private * @param {Function} fn Function to run * @returns {*} Return value of function */ static _clsRun(fn) { const ns = Sequelize._cls; if (!ns) { return fn(); } let res; ns.run(context => { res = fn(context); }); return res; } log(...args) { let options; const last = _.last(args); if (last && _.isPlainObject(last) && Object.prototype.hasOwnProperty.call(last, 'logging')) { options = last; // remove options from set of logged arguments if options.logging is equal to console.log or console.debug // eslint-disable-next-line no-console -- intended console.log use if (options.logging === console.log || options.logging === console.debug) { args.splice(-1, 1); } } else { options = this.options; } if (options.logging) { if (options.logging === true) { deprecations.noTrueLogging(); options.logging = console.debug; } // second argument is sql-timings, when benchmarking option enabled if ((this.options.benchmark || options.benchmark) && options.logging === console.debug) { args = [`${args[0]} Elapsed time: ${args[1]}ms`]; } options.logging(...args); } } /** * Close all connections used by this sequelize instance, and free all references so the instance can be garbage collected. * * Normally this is done on process exit, so you only need to call this method if you are creating multiple instances, and want * to garbage collect some of them. * * @returns {Promise} */ close() { return this.connectionManager.close(); } normalizeDataType(Type) { let type = typeof Type === 'function' ? new Type() : Type; const dialectTypes = this.dialect.DataTypes || {}; if (dialectTypes[type.key]) { type = dialectTypes[type.key].extend(type); } if (type instanceof DataTypes.ARRAY) { if (!type.type) { throw new Error('ARRAY is missing type definition for its values.'); } if (dialectTypes[type.type.key]) { type.type = dialectTypes[type.type.key].extend(type.type); } } return type; } normalizeAttribute(attribute) { if (!_.isPlainObject(attribute)) { attribute = { type: attribute }; } if (!attribute.type) { return attribute; } attribute.type = this.normalizeDataType(attribute.type); if (Object.prototype.hasOwnProperty.call(attribute, 'defaultValue') && typeof attribute.defaultValue === 'function' && [DataTypes.NOW, DataTypes.UUIDV1, DataTypes.UUIDV4].includes(attribute.defaultValue) ) { attribute.defaultValue = new attribute.defaultValue(); } if (attribute.type instanceof DataTypes.ENUM) { // The ENUM is a special case where the type is an object containing the values if (attribute.values) { attribute.type.values = attribute.type.options.values = attribute.values; } else { attribute.values = attribute.type.values; } if (attribute.values.length === 0) { throw new Error('Values for ENUM have not been defined.'); } } return attribute; } } // Aliases Sequelize.prototype.fn = Sequelize.fn; Sequelize.prototype.col = Sequelize.col; Sequelize.prototype.cast = Sequelize.cast; Sequelize.prototype.literal = Sequelize.literal; Sequelize.prototype.and = Sequelize.and; Sequelize.prototype.or = Sequelize.or; Sequelize.prototype.json = Sequelize.json; Sequelize.prototype.where = Sequelize.where; Sequelize.prototype.validate = Sequelize.prototype.authenticate; /** * Sequelize version number. */ // To avoid any errors on startup when this field is unused, only resolve it as needed. // this is to prevent any potential issues on startup with unusual environments (eg, bundled code) // where relative paths may fail that are unnecessary. Object.defineProperty(Sequelize, 'version', { enumerable: true, get() { return require('../package.json').version; }, }); Sequelize.options = { hooks: {} }; /** * @private */ Sequelize.Utils = Utils; /** * Operators symbols to be used for querying data * * @see {@link Operators} */ Sequelize.Op = Op; /** * Available table hints to be used for querying data in mssql for table hints * * @see {@link TableHints} */ Sequelize.TableHints = TableHints; /** * Available index hints to be used for querying data in mysql for index hints * * @see {@link IndexHints} */ Sequelize.IndexHints = IndexHints; /** * A reference to the sequelize transaction class. Use this to access isolationLevels and types when creating a transaction * * @see {@link Transaction} * @see {@link Sequelize.transaction} */ Sequelize.Transaction = Transaction; /** * A reference to Sequelize constructor from sequelize. Useful for accessing DataTypes, Errors etc. * * @see {@link Sequelize} */ Sequelize.prototype.Sequelize = Sequelize; /** * Available query types for use with `sequelize.query` * * @see {@link QueryTypes} */ Sequelize.prototype.QueryTypes = Sequelize.QueryTypes = QueryTypes; /** * Exposes the validator.js object, so you can extend it with custom validation functions. The validator is exposed both on the instance, and on the constructor. * * @see https://github.com/chriso/validator.js */ Sequelize.prototype.Validator = Sequelize.Validator = Validator; Sequelize.Model = Model; Sequelize.QueryInterface = QueryInterface; Sequelize.BelongsTo = BelongsTo; Sequelize.HasOne = HasOne; Sequelize.HasMany = HasMany; Sequelize.BelongsToMany = BelongsToMany; Sequelize.DataTypes = DataTypes; for (const dataType in DataTypes) { Sequelize[dataType] = DataTypes[dataType]; } /** * A reference to the deferrable collection. Use this to access the different deferrable options. * * @see {@link Transaction.Deferrable} * @see {@link Sequelize#transaction} */ Sequelize.Deferrable = Deferrable; /** * A reference to the sequelize association class. * * @see {@link Association} */ Sequelize.prototype.Association = Sequelize.Association = Association; /** * Provide alternative version of `inflection` module to be used by `Utils.pluralize` etc. * * @param {object} _inflection - `inflection` module */ Sequelize.useInflection = Utils.useInflection; /** * Allow hooks to be defined on Sequelize + on sequelize instance as universal hooks to run on all models * and on Sequelize/sequelize methods e.g. Sequelize(), Sequelize#define() */ Hooks.applyTo(Sequelize); Hooks.applyTo(Sequelize.prototype); /** * Expose various errors available */ // expose alias to BaseError Sequelize.Error = sequelizeErrors.BaseError; for (const error of Object.keys(sequelizeErrors)) { Sequelize[error] = sequelizeErrors[error]; } module.exports = Sequelize; module.exports.Sequelize = Sequelize; module.exports.default = Sequelize;
from rest_framework.views import APIView from rest_framework import generics, mixins from rest_framework.permissions import IsAuthenticated, IsAuthenticatedOrReadOnly, AllowAny from django.http import HttpResponse from django.db.models import Q from .serializers import GuestPaymentSerializer from django.contrib.auth import get_user_model from rest_framework.response import Response from rest_framework import status from payments.models import GuestPaymentInfo class GuestPaymentDetailView(APIView): def post(self,request,*args,**kwargs): file_serializer = GuestPaymentSerializer(data=request.data) if file_serializer.is_valid(): file_serializer.save() return Response(file_serializer.data, status=status.HTTP_201_CREATED) else: return Response(file_serializer.errors, status=status.HTTP_400_BAD_REQUEST) def delete(self,request,id =None): try: tab = GuestPaymentInfo.objects.get(id=id) tab.delete() return HttpResponse(status=204) except GuestPaymentInfo.DoesNotExist as e: return Response({"error": "Given Tab object not found."}, status=404) from rest_framework import viewsets from rest_framework.response import Response class GuestPaymentViewSet(viewsets.ViewSet): """ A simple ViewSet for listing or retrieving users. """ def list(self, request, lat, long, keyword): print("The lat is " + lat) keywords = keyword keywordsplit = keywords.split(',') for word in keywordsplit: print(word) queryset = GuestPaymentInfo.objects.all() serializer = GuestPaymentSerializer(queryset, many=True) return Response(serializer.data)
/*! * AngularJS Material Design * https://github.com/angular/material * @license MIT * v1.1.3-master-90b64fe */ goog.provide('ngmaterial.components.input'); goog.require('ngmaterial.core'); /** * @ngdoc module * @name material.components.input */ mdInputContainerDirective['$inject'] = ["$mdTheming", "$parse"]; inputTextareaDirective['$inject'] = ["$mdUtil", "$window", "$mdAria", "$timeout", "$mdGesture"]; mdMaxlengthDirective['$inject'] = ["$animate", "$mdUtil"]; placeholderDirective['$inject'] = ["$compile"]; ngMessageDirective['$inject'] = ["$mdUtil"]; mdSelectOnFocusDirective['$inject'] = ["$timeout"]; mdInputInvalidMessagesAnimation['$inject'] = ["$$AnimateRunner", "$animateCss", "$mdUtil", "$log"]; ngMessagesAnimation['$inject'] = ["$$AnimateRunner", "$animateCss", "$mdUtil", "$log"]; ngMessageAnimation['$inject'] = ["$$AnimateRunner", "$animateCss", "$mdUtil", "$log"]; var inputModule = angular.module('material.components.input', [ 'material.core' ]) .directive('mdInputContainer', mdInputContainerDirective) .directive('label', labelDirective) .directive('input', inputTextareaDirective) .directive('textarea', inputTextareaDirective) .directive('mdMaxlength', mdMaxlengthDirective) .directive('placeholder', placeholderDirective) .directive('ngMessages', ngMessagesDirective) .directive('ngMessage', ngMessageDirective) .directive('ngMessageExp', ngMessageDirective) .directive('mdSelectOnFocus', mdSelectOnFocusDirective) .animation('.md-input-invalid', mdInputInvalidMessagesAnimation) .animation('.md-input-messages-animation', ngMessagesAnimation) .animation('.md-input-message-animation', ngMessageAnimation); // If we are running inside of tests; expose some extra services so that we can test them if (window._mdMocksIncluded) { inputModule.service('$$mdInput', function() { return { // special accessor to internals... useful for testing messages: { show : showInputMessages, hide : hideInputMessages, getElement : getMessagesElement } } }) // Register a service for each animation so that we can easily inject them into unit tests .service('mdInputInvalidAnimation', mdInputInvalidMessagesAnimation) .service('mdInputMessagesAnimation', ngMessagesAnimation) .service('mdInputMessageAnimation', ngMessageAnimation); } /** * @ngdoc directive * @name mdInputContainer * @module material.components.input * * @restrict E * * @description * `<md-input-container>` is the parent of any input or textarea element. * * Input and textarea elements will not behave properly unless the md-input-container * parent is provided. * * A single `<md-input-container>` should contain only one `<input>` element, otherwise it will throw an error. * * <b>Exception:</b> Hidden inputs (`<input type="hidden" />`) are ignored and will not throw an error, so * you may combine these with other inputs. * * <b>Note:</b> When using `ngMessages` with your input element, make sure the message and container elements * are *block* elements, otherwise animations applied to the messages will not look as intended. Either use a `div` and * apply the `ng-message` and `ng-messages` classes respectively, or use the `md-block` class on your element. * * @param md-is-error {expression=} When the given expression evaluates to true, the input container * will go into error state. Defaults to erroring if the input has been touched and is invalid. * @param md-no-float {boolean=} When present, `placeholder` attributes on the input will not be converted to floating * labels. * * @usage * <hljs lang="html"> * * <md-input-container> * <label>Username</label> * <input type="text" ng-model="user.name"> * </md-input-container> * * <md-input-container> * <label>Description</label> * <textarea ng-model="user.description"></textarea> * </md-input-container> * * </hljs> * * <h3>When disabling floating labels</h3> * <hljs lang="html"> * * <md-input-container md-no-float> * <input type="text" placeholder="Non-Floating Label"> * </md-input-container> * * </hljs> */ function mdInputContainerDirective($mdTheming, $parse) { ContainerCtrl['$inject'] = ["$scope", "$element", "$attrs", "$animate"]; var INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT', 'MD-SELECT']; var LEFT_SELECTORS = INPUT_TAGS.reduce(function(selectors, isel) { return selectors.concat(['md-icon ~ ' + isel, '.md-icon ~ ' + isel]); }, []).join(","); var RIGHT_SELECTORS = INPUT_TAGS.reduce(function(selectors, isel) { return selectors.concat([isel + ' ~ md-icon', isel + ' ~ .md-icon']); }, []).join(","); return { restrict: 'E', compile: compile, controller: ContainerCtrl }; function compile(tElement) { // Check for both a left & right icon var leftIcon = tElement[0].querySelector(LEFT_SELECTORS); var rightIcon = tElement[0].querySelector(RIGHT_SELECTORS); if (leftIcon) { tElement.addClass('md-icon-left'); } if (rightIcon) { tElement.addClass('md-icon-right'); } return function postLink(scope, element) { $mdTheming(element); }; } function ContainerCtrl($scope, $element, $attrs, $animate) { var self = this; self.isErrorGetter = $attrs.mdIsError && $parse($attrs.mdIsError); self.delegateClick = function() { self.input.focus(); }; self.element = $element; self.setFocused = function(isFocused) { $element.toggleClass('md-input-focused', !!isFocused); }; self.setHasValue = function(hasValue) { $element.toggleClass('md-input-has-value', !!hasValue); }; self.setHasPlaceholder = function(hasPlaceholder) { $element.toggleClass('md-input-has-placeholder', !!hasPlaceholder); }; self.setInvalid = function(isInvalid) { if (isInvalid) { $animate.addClass($element, 'md-input-invalid'); } else { $animate.removeClass($element, 'md-input-invalid'); } }; $scope.$watch(function() { return self.label && self.input; }, function(hasLabelAndInput) { if (hasLabelAndInput && !self.label.attr('for')) { self.label.attr('for', self.input.attr('id')); } }); } } function labelDirective() { return { restrict: 'E', require: '^?mdInputContainer', link: function(scope, element, attr, containerCtrl) { if (!containerCtrl || attr.mdNoFloat || element.hasClass('md-container-ignore')) return; containerCtrl.label = element; scope.$on('$destroy', function() { containerCtrl.label = null; }); } }; } /** * @ngdoc directive * @name mdInput * @restrict E * @module material.components.input * * @description * You can use any `<input>` or `<textarea>` element as a child of an `<md-input-container>`. This * allows you to build complex forms for data entry. * * When the input is required and uses a floating label, then the label will automatically contain * an asterisk (`*`).<br/> * This behavior can be disabled by using the `md-no-asterisk` attribute. * * @param {number=} md-maxlength The maximum number of characters allowed in this input. If this is * specified, a character counter will be shown underneath the input.<br/><br/> * The purpose of **`md-maxlength`** is exactly to show the max length counter text. If you don't * want the counter text and only need "plain" validation, you can use the "simple" `ng-maxlength` * or maxlength attributes.<br/><br/> * **Note:** Only valid for text/string inputs (not numeric). * * @param {string=} aria-label Aria-label is required when no label is present. A warning message * will be logged in the console if not present. * @param {string=} placeholder An alternative approach to using aria-label when the label is not * PRESENT. The placeholder text is copied to the aria-label attribute. * @param md-no-autogrow {boolean=} When present, textareas will not grow automatically. * @param md-no-asterisk {boolean=} When present, an asterisk will not be appended to the inputs floating label * @param md-no-resize {boolean=} Disables the textarea resize handle. * @param {number=} max-rows The maximum amount of rows for a textarea. * @param md-detect-hidden {boolean=} When present, textareas will be sized properly when they are * revealed after being hidden. This is off by default for performance reasons because it * guarantees a reflow every digest cycle. * * @usage * <hljs lang="html"> * <md-input-container> * <label>Color</label> * <input type="text" ng-model="color" required md-maxlength="10"> * </md-input-container> * </hljs> * * <h3>With Errors</h3> * * `md-input-container` also supports errors using the standard `ng-messages` directives and * animates the messages when they become visible using from the `ngEnter`/`ngLeave` events or * the `ngShow`/`ngHide` events. * * By default, the messages will be hidden until the input is in an error state. This is based off * of the `md-is-error` expression of the `md-input-container`. This gives the user a chance to * fill out the form before the errors become visible. * * <hljs lang="html"> * <form name="colorForm"> * <md-input-container> * <label>Favorite Color</label> * <input name="favoriteColor" ng-model="favoriteColor" required> * <div ng-messages="colorForm.favoriteColor.$error"> * <div ng-message="required">This is required!</div> * </div> * </md-input-container> * </form> * </hljs> * * We automatically disable this auto-hiding functionality if you provide any of the following * visibility directives on the `ng-messages` container: * * - `ng-if` * - `ng-show`/`ng-hide` * - `ng-switch-when`/`ng-switch-default` * * You can also disable this functionality manually by adding the `md-auto-hide="false"` expression * to the `ng-messages` container. This may be helpful if you always want to see the error messages * or if you are building your own visibilty directive. * * _<b>Note:</b> The `md-auto-hide` attribute is a static string that is only checked upon * initialization of the `ng-messages` directive to see if it equals the string `false`._ * * <hljs lang="html"> * <form name="userForm"> * <md-input-container> * <label>Last Name</label> * <input name="lastName" ng-model="lastName" required md-maxlength="10" minlength="4"> * <div ng-messages="userForm.lastName.$error" ng-show="userForm.lastName.$dirty"> * <div ng-message="required">This is required!</div> * <div ng-message="md-maxlength">That's too long!</div> * <div ng-message="minlength">That's too short!</div> * </div> * </md-input-container> * <md-input-container> * <label>Biography</label> * <textarea name="bio" ng-model="biography" required md-maxlength="150"></textarea> * <div ng-messages="userForm.bio.$error" ng-show="userForm.bio.$dirty"> * <div ng-message="required">This is required!</div> * <div ng-message="md-maxlength">That's too long!</div> * </div> * </md-input-container> * <md-input-container> * <input aria-label='title' ng-model='title'> * </md-input-container> * <md-input-container> * <input placeholder='title' ng-model='title'> * </md-input-container> * </form> * </hljs> * * <h3>Notes</h3> * * - Requires [ngMessages](https://docs.angularjs.org/api/ngMessages). * - Behaves like the [AngularJS input directive](https://docs.angularjs.org/api/ng/directive/input). * * The `md-input` and `md-input-container` directives use very specific positioning to achieve the * error animation effects. Therefore, it is *not* advised to use the Layout system inside of the * `<md-input-container>` tags. Instead, use relative or absolute positioning. * * * <h3>Textarea directive</h3> * The `textarea` element within a `md-input-container` has the following specific behavior: * - By default the `textarea` grows as the user types. This can be disabled via the `md-no-autogrow` * attribute. * - If a `textarea` has the `rows` attribute, it will treat the `rows` as the minimum height and will * continue growing as the user types. For example a textarea with `rows="3"` will be 3 lines of text * high initially. If no rows are specified, the directive defaults to 1. * - The textarea's height gets set on initialization, as well as while the user is typing. In certain situations * (e.g. while animating) the directive might have been initialized, before the element got it's final height. In * those cases, you can trigger a resize manually by broadcasting a `md-resize-textarea` event on the scope. * - If you want a `textarea` to stop growing at a certain point, you can specify the `max-rows` attribute. * - The textarea's bottom border acts as a handle which users can drag, in order to resize the element vertically. * Once the user has resized a `textarea`, the autogrowing functionality becomes disabled. If you don't want a * `textarea` to be resizeable by the user, you can add the `md-no-resize` attribute. */ function inputTextareaDirective($mdUtil, $window, $mdAria, $timeout, $mdGesture) { return { restrict: 'E', require: ['^?mdInputContainer', '?ngModel', '?^form'], link: postLink }; function postLink(scope, element, attr, ctrls) { var containerCtrl = ctrls[0]; var hasNgModel = !!ctrls[1]; var ngModelCtrl = ctrls[1] || $mdUtil.fakeNgModel(); var parentForm = ctrls[2]; var isReadonly = angular.isDefined(attr.readonly); var mdNoAsterisk = $mdUtil.parseAttributeBoolean(attr.mdNoAsterisk); var tagName = element[0].tagName.toLowerCase(); if (!containerCtrl) return; if (attr.type === 'hidden') { element.attr('aria-hidden', 'true'); return; } else if (containerCtrl.input) { if (containerCtrl.input[0].contains(element[0])) { return; } else { throw new Error("<md-input-container> can only have *one* <input>, <textarea> or <md-select> child element!"); } } containerCtrl.input = element; setupAttributeWatchers(); // Add an error spacer div after our input to provide space for the char counter and any ng-messages var errorsSpacer = angular.element('<div class="md-errors-spacer">'); element.after(errorsSpacer); if (!containerCtrl.label) { $mdAria.expect(element, 'aria-label', attr.placeholder); } element.addClass('md-input'); if (!element.attr('id')) { element.attr('id', 'input_' + $mdUtil.nextUid()); } // This works around a Webkit issue where number inputs, placed in a flexbox, that have // a `min` and `max` will collapse to about 1/3 of their proper width. Please check #7349 // for more info. Also note that we don't override the `step` if the user has specified it, // in order to prevent some unexpected behaviour. if (tagName === 'input' && attr.type === 'number' && attr.min && attr.max && !attr.step) { element.attr('step', 'any'); } else if (tagName === 'textarea') { setupTextarea(); } // If the input doesn't have an ngModel, it may have a static value. For that case, // we have to do one initial check to determine if the container should be in the // "has a value" state. if (!hasNgModel) { inputCheckValue(); } var isErrorGetter = containerCtrl.isErrorGetter || function() { return ngModelCtrl.$invalid && (ngModelCtrl.$touched || (parentForm && parentForm.$submitted)); }; scope.$watch(isErrorGetter, containerCtrl.setInvalid); // When the developer uses the ngValue directive for the input, we have to observe the attribute, because // AngularJS's ngValue directive is just setting the `value` attribute. if (attr.ngValue) { attr.$observe('value', inputCheckValue); } ngModelCtrl.$parsers.push(ngModelPipelineCheckValue); ngModelCtrl.$formatters.push(ngModelPipelineCheckValue); element.on('input', inputCheckValue); if (!isReadonly) { element .on('focus', function(ev) { $mdUtil.nextTick(function() { containerCtrl.setFocused(true); }); }) .on('blur', function(ev) { $mdUtil.nextTick(function() { containerCtrl.setFocused(false); inputCheckValue(); }); }); } scope.$on('$destroy', function() { containerCtrl.setFocused(false); containerCtrl.setHasValue(false); containerCtrl.input = null; }); /** Gets run through ngModel's pipeline and set the `has-value` class on the container. */ function ngModelPipelineCheckValue(arg) { containerCtrl.setHasValue(!ngModelCtrl.$isEmpty(arg)); return arg; } function setupAttributeWatchers() { if (containerCtrl.label) { attr.$observe('required', function (value) { // We don't need to parse the required value, it's always a boolean because of angular's // required directive. containerCtrl.label.toggleClass('md-required', value && !mdNoAsterisk); }); } } function inputCheckValue() { // An input's value counts if its length > 0, // or if the input's validity state says it has bad input (eg string in a number input) containerCtrl.setHasValue(element.val().length > 0 || (element[0].validity || {}).badInput); } function setupTextarea() { var isAutogrowing = !attr.hasOwnProperty('mdNoAutogrow'); attachResizeHandle(); if (!isAutogrowing) return; // Can't check if height was or not explicity set, // so rows attribute will take precedence if present var minRows = attr.hasOwnProperty('rows') ? parseInt(attr.rows) : NaN; var maxRows = attr.hasOwnProperty('maxRows') ? parseInt(attr.maxRows) : NaN; var scopeResizeListener = scope.$on('md-resize-textarea', growTextarea); var lineHeight = null; var node = element[0]; // This timeout is necessary, because the browser needs a little bit // of time to calculate the `clientHeight` and `scrollHeight`. $timeout(function() { $mdUtil.nextTick(growTextarea); }, 10, false); // We could leverage ngModel's $parsers here, however it // isn't reliable, because AngularJS trims the input by default, // which means that growTextarea won't fire when newlines and // spaces are added. element.on('input', growTextarea); // We should still use the $formatters, because they fire when // the value was changed from outside the textarea. if (hasNgModel) { ngModelCtrl.$formatters.push(formattersListener); } if (!minRows) { element.attr('rows', 1); } angular.element($window).on('resize', growTextarea); scope.$on('$destroy', disableAutogrow); function growTextarea() { // temporarily disables element's flex so its height 'runs free' element .attr('rows', 1) .css('height', 'auto') .addClass('md-no-flex'); var height = getHeight(); if (!lineHeight) { // offsetHeight includes padding which can throw off our value var originalPadding = element[0].style.padding || ''; lineHeight = element.css('padding', 0).prop('offsetHeight'); element[0].style.padding = originalPadding; } if (minRows && lineHeight) { height = Math.max(height, lineHeight * minRows); } if (maxRows && lineHeight) { var maxHeight = lineHeight * maxRows; if (maxHeight < height) { element.attr('md-no-autogrow', ''); height = maxHeight; } else { element.removeAttr('md-no-autogrow'); } } if (lineHeight) { element.attr('rows', Math.round(height / lineHeight)); } element .css('height', height + 'px') .removeClass('md-no-flex'); } function getHeight() { var offsetHeight = node.offsetHeight; var line = node.scrollHeight - offsetHeight; return offsetHeight + Math.max(line, 0); } function formattersListener(value) { $mdUtil.nextTick(growTextarea); return value; } function disableAutogrow() { if (!isAutogrowing) return; isAutogrowing = false; angular.element($window).off('resize', growTextarea); scopeResizeListener && scopeResizeListener(); element .attr('md-no-autogrow', '') .off('input', growTextarea); if (hasNgModel) { var listenerIndex = ngModelCtrl.$formatters.indexOf(formattersListener); if (listenerIndex > -1) { ngModelCtrl.$formatters.splice(listenerIndex, 1); } } } function attachResizeHandle() { if (attr.hasOwnProperty('mdNoResize')) return; var handle = angular.element('<div class="md-resize-handle"></div>'); var isDragging = false; var dragStart = null; var startHeight = 0; var container = containerCtrl.element; var dragGestureHandler = $mdGesture.register(handle, 'drag', { horizontal: false }); element.wrap('<div class="md-resize-wrapper">').after(handle); handle.on('mousedown', onMouseDown); container .on('$md.dragstart', onDragStart) .on('$md.drag', onDrag) .on('$md.dragend', onDragEnd); scope.$on('$destroy', function() { handle .off('mousedown', onMouseDown) .remove(); container .off('$md.dragstart', onDragStart) .off('$md.drag', onDrag) .off('$md.dragend', onDragEnd); dragGestureHandler(); handle = null; container = null; dragGestureHandler = null; }); function onMouseDown(ev) { ev.preventDefault(); isDragging = true; dragStart = ev.clientY; startHeight = parseFloat(element.css('height')) || element.prop('offsetHeight'); } function onDragStart(ev) { if (!isDragging) return; ev.preventDefault(); disableAutogrow(); container.addClass('md-input-resized'); } function onDrag(ev) { if (!isDragging) return; element.css('height', (startHeight + ev.pointer.distanceY) + 'px'); } function onDragEnd(ev) { if (!isDragging) return; isDragging = false; container.removeClass('md-input-resized'); } } // Attach a watcher to detect when the textarea gets shown. if (attr.hasOwnProperty('mdDetectHidden')) { var handleHiddenChange = function() { var wasHidden = false; return function() { var isHidden = node.offsetHeight === 0; if (isHidden === false && wasHidden === true) { growTextarea(); } wasHidden = isHidden; }; }(); // Check every digest cycle whether the visibility of the textarea has changed. // Queue up to run after the digest cycle is complete. scope.$watch(function() { $mdUtil.nextTick(handleHiddenChange, false); return true; }); } } } } function mdMaxlengthDirective($animate, $mdUtil) { return { restrict: 'A', require: ['ngModel', '^mdInputContainer'], link: postLink }; function postLink(scope, element, attr, ctrls) { var maxlength; var ngModelCtrl = ctrls[0]; var containerCtrl = ctrls[1]; var charCountEl, errorsSpacer; // Wait until the next tick to ensure that the input has setup the errors spacer where we will // append our counter $mdUtil.nextTick(function() { errorsSpacer = angular.element(containerCtrl.element[0].querySelector('.md-errors-spacer')); charCountEl = angular.element('<div class="md-char-counter">'); // Append our character counter inside the errors spacer errorsSpacer.append(charCountEl); // Stop model from trimming. This makes it so whitespace // over the maxlength still counts as invalid. attr.$set('ngTrim', 'false'); scope.$watch(attr.mdMaxlength, function(value) { maxlength = value; if (angular.isNumber(value) && value > 0) { if (!charCountEl.parent().length) { $animate.enter(charCountEl, errorsSpacer); } renderCharCount(); } else { $animate.leave(charCountEl); } }); ngModelCtrl.$validators['md-maxlength'] = function(modelValue, viewValue) { if (!angular.isNumber(maxlength) || maxlength < 0) { return true; } // We always update the char count, when the modelValue has changed. // Using the $validators for triggering the update works very well. renderCharCount(); return ( modelValue || element.val() || viewValue || '' ).length <= maxlength; }; }); function renderCharCount(value) { // If we have not been appended to the body yet; do not render if (!charCountEl.parent) { return value; } // Force the value into a string since it may be a number, // which does not have a length property. charCountEl.text(String(element.val() || value || '').length + ' / ' + maxlength); return value; } } } function placeholderDirective($compile) { return { restrict: 'A', require: '^^?mdInputContainer', priority: 200, link: { // Note that we need to do this in the pre-link, as opposed to the post link, if we want to // support data bindings in the placeholder. This is necessary, because we have a case where // we transfer the placeholder value to the `<label>` and we remove it from the original `<input>`. // If we did this in the post-link, AngularJS would have set up the observers already and would be // re-adding the attribute, even though we removed it from the element. pre: preLink } }; function preLink(scope, element, attr, inputContainer) { // If there is no input container, just return if (!inputContainer) return; var label = inputContainer.element.find('label'); var noFloat = inputContainer.element.attr('md-no-float'); // If we have a label, or they specify the md-no-float attribute, just return if ((label && label.length) || noFloat === '' || scope.$eval(noFloat)) { // Add a placeholder class so we can target it in the CSS inputContainer.setHasPlaceholder(true); return; } // md-select handles placeholders on it's own if (element[0].nodeName != 'MD-SELECT') { // Move the placeholder expression to the label var newLabel = angular.element('<label ng-click="delegateClick()" tabindex="-1">' + attr.placeholder + '</label>'); // Note that we unset it via `attr`, in order to get AngularJS // to remove any observers that it might have set up. Otherwise // the attribute will be added on the next digest. attr.$set('placeholder', null); // We need to compile the label manually in case it has any bindings. // A gotcha here is that we first add the element to the DOM and we compile // it later. This is necessary, because if we compile the element beforehand, // it won't be able to find the `mdInputContainer` controller. inputContainer.element .addClass('md-icon-float') .prepend(newLabel); $compile(newLabel)(scope); } } } /** * @ngdoc directive * @name mdSelectOnFocus * @module material.components.input * * @restrict A * * @description * The `md-select-on-focus` directive allows you to automatically select the element's input text on focus. * * <h3>Notes</h3> * - The use of `md-select-on-focus` is restricted to `<input>` and `<textarea>` elements. * * @usage * <h3>Using with an Input</h3> * <hljs lang="html"> * * <md-input-container> * <label>Auto Select</label> * <input type="text" md-select-on-focus> * </md-input-container> * </hljs> * * <h3>Using with a Textarea</h3> * <hljs lang="html"> * * <md-input-container> * <label>Auto Select</label> * <textarea md-select-on-focus>This text will be selected on focus.</textarea> * </md-input-container> * * </hljs> */ function mdSelectOnFocusDirective($timeout) { return { restrict: 'A', link: postLink }; function postLink(scope, element, attr) { if (element[0].nodeName !== 'INPUT' && element[0].nodeName !== "TEXTAREA") return; var preventMouseUp = false; element .on('focus', onFocus) .on('mouseup', onMouseUp); scope.$on('$destroy', function() { element .off('focus', onFocus) .off('mouseup', onMouseUp); }); function onFocus() { preventMouseUp = true; $timeout(function() { // Use HTMLInputElement#select to fix firefox select issues. // The debounce is here for Edge's sake, otherwise the selection doesn't work. element[0].select(); // This should be reset from inside the `focus`, because the event might // have originated from something different than a click, e.g. a keyboard event. preventMouseUp = false; }, 1, false); } // Prevents the default action of the first `mouseup` after a focus. // This is necessary, because browsers fire a `mouseup` right after the element // has been focused. In some browsers (Firefox in particular) this can clear the // selection. There are examples of the problem in issue #7487. function onMouseUp(event) { if (preventMouseUp) { event.preventDefault(); } } } } var visibilityDirectives = ['ngIf', 'ngShow', 'ngHide', 'ngSwitchWhen', 'ngSwitchDefault']; function ngMessagesDirective() { return { restrict: 'EA', link: postLink, // This is optional because we don't want target *all* ngMessage instances, just those inside of // mdInputContainer. require: '^^?mdInputContainer' }; function postLink(scope, element, attrs, inputContainer) { // If we are not a child of an input container, don't do anything if (!inputContainer) return; // Add our animation class element.toggleClass('md-input-messages-animation', true); // Add our md-auto-hide class to automatically hide/show messages when container is invalid element.toggleClass('md-auto-hide', true); // If we see some known visibility directives, remove the md-auto-hide class if (attrs.mdAutoHide == 'false' || hasVisibiltyDirective(attrs)) { element.toggleClass('md-auto-hide', false); } } function hasVisibiltyDirective(attrs) { return visibilityDirectives.some(function(attr) { return attrs[attr]; }); } } function ngMessageDirective($mdUtil) { return { restrict: 'EA', compile: compile, priority: 100 }; function compile(tElement) { if (!isInsideInputContainer(tElement)) { // When the current element is inside of a document fragment, then we need to check for an input-container // in the postLink, because the element will be later added to the DOM and is currently just in a temporary // fragment, which causes the input-container check to fail. if (isInsideFragment()) { return function (scope, element) { if (isInsideInputContainer(element)) { // Inside of the postLink function, a ngMessage directive will be a comment element, because it's // currently hidden. To access the shown element, we need to use the element from the compile function. initMessageElement(tElement); } }; } } else { initMessageElement(tElement); } function isInsideFragment() { var nextNode = tElement[0]; while (nextNode = nextNode.parentNode) { if (nextNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { return true; } } return false; } function isInsideInputContainer(element) { return !!$mdUtil.getClosest(element, "md-input-container"); } function initMessageElement(element) { // Add our animation class element.toggleClass('md-input-message-animation', true); } } } var $$AnimateRunner, $animateCss, $mdUtil, $log; function mdInputInvalidMessagesAnimation($$AnimateRunner, $animateCss, $mdUtil, $log) { saveSharedServices($$AnimateRunner, $animateCss, $mdUtil, $log); return { addClass: function(element, className, done) { showInputMessages(element, done); } // NOTE: We do not need the removeClass method, because the message ng-leave animation will fire }; } function ngMessagesAnimation($$AnimateRunner, $animateCss, $mdUtil, $log) { saveSharedServices($$AnimateRunner, $animateCss, $mdUtil, $log); return { enter: function(element, done) { showInputMessages(element, done); }, leave: function(element, done) { hideInputMessages(element, done); }, addClass: function(element, className, done) { if (className == "ng-hide") { hideInputMessages(element, done); } else { done(); } }, removeClass: function(element, className, done) { if (className == "ng-hide") { showInputMessages(element, done); } else { done(); } } }; } function ngMessageAnimation($$AnimateRunner, $animateCss, $mdUtil, $log) { saveSharedServices($$AnimateRunner, $animateCss, $mdUtil, $log); return { enter: function(element, done) { var animator = showMessage(element); animator.start().done(done); }, leave: function(element, done) { var animator = hideMessage(element); animator.start().done(done); } }; } function showInputMessages(element, done) { var animators = [], animator; var messages = getMessagesElement(element); var children = messages.children(); if (messages.length == 0 || children.length == 0) { $log.warn('mdInput messages show animation called on invalid messages element: ', element); done(); return; } angular.forEach(children, function(child) { animator = showMessage(angular.element(child)); animators.push(animator.start()); }); $$AnimateRunner.all(animators, done); } function hideInputMessages(element, done) { var animators = [], animator; var messages = getMessagesElement(element); var children = messages.children(); if (messages.length == 0 || children.length == 0) { $log.warn('mdInput messages hide animation called on invalid messages element: ', element); done(); return; } angular.forEach(children, function(child) { animator = hideMessage(angular.element(child)); animators.push(animator.start()); }); $$AnimateRunner.all(animators, done); } function showMessage(element) { var height = parseInt(window.getComputedStyle(element[0]).height); var topMargin = parseInt(window.getComputedStyle(element[0]).marginTop); var messages = getMessagesElement(element); var container = getInputElement(element); // Check to see if the message is already visible so we can skip var alreadyVisible = (topMargin > -height); // If we have the md-auto-hide class, the md-input-invalid animation will fire, so we can skip if (alreadyVisible || (messages.hasClass('md-auto-hide') && !container.hasClass('md-input-invalid'))) { return $animateCss(element, {}); } return $animateCss(element, { event: 'enter', structural: true, from: {"opacity": 0, "margin-top": -height + "px"}, to: {"opacity": 1, "margin-top": "0"}, duration: 0.3 }); } function hideMessage(element) { var height = element[0].offsetHeight; var styles = window.getComputedStyle(element[0]); // If we are already hidden, just return an empty animation if (parseInt(styles.opacity) === 0) { return $animateCss(element, {}); } // Otherwise, animate return $animateCss(element, { event: 'leave', structural: true, from: {"opacity": 1, "margin-top": 0}, to: {"opacity": 0, "margin-top": -height + "px"}, duration: 0.3 }); } function getInputElement(element) { var inputContainer = element.controller('mdInputContainer'); return inputContainer.element; } function getMessagesElement(element) { // If we ARE the messages element, just return ourself if (element.hasClass('md-input-messages-animation')) { return element; } // If we are a ng-message element, we need to traverse up the DOM tree if (element.hasClass('md-input-message-animation')) { return angular.element($mdUtil.getClosest(element, function(node) { return node.classList.contains('md-input-messages-animation'); })); } // Otherwise, we can traverse down return angular.element(element[0].querySelector('.md-input-messages-animation')); } function saveSharedServices(_$$AnimateRunner_, _$animateCss_, _$mdUtil_, _$log_) { $$AnimateRunner = _$$AnimateRunner_; $animateCss = _$animateCss_; $mdUtil = _$mdUtil_; $log = _$log_; } ngmaterial.components.input = angular.module("material.components.input");
;(function(angular){ 'use strict'; var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; function map(items, property) { var mappedArray = []; angular.forEach(items, function(item) { mappedArray.push(angular.isFunction(property) ? property(item) : item[property]); }); return mappedArray; } angular.module('pickadate', []) .provider('pickadateI18n', function() { var defaults = { 'prev': 'prev', 'next': 'next' }; this.translations = {}; this.$get = function() { var translations = this.translations; return { t: function(key) { return translations[key] || defaults[key]; } }; }; }) .factory('pickadateModalBindings', ['$window', '$document', function($window, $document) { var supportPageOffset = $window.pageXOffset !== undefined, isCSS1Compat = (($document.compatMode || "") === "CSS1Compat"); var computeStyles = function(element) { var scrollX = supportPageOffset ? $window.pageXOffset : isCSS1Compat ? $document.documentElement.scrollLeft : $document.body.scrollLeft, scrollY = supportPageOffset ? $window.pageYOffset : isCSS1Compat ? $document.documentElement.scrollTop : $document.body.scrollTop, innerWidth = $window.innerWidth || $document.documentElement.clientWidth || $document.body.clientWidth, styles = { top: scrollY + element.getBoundingClientRect().bottom + 'px' }; if ((innerWidth - element.getBoundingClientRect().left ) >= 300) { styles.left = scrollX + element.getBoundingClientRect().left + 'px'; } else { styles.right = innerWidth - element.getBoundingClientRect().right - scrollX + 'px'; } return styles; }; var isDescendant = function(parent, child) { var node = child.parentNode; while (node !== null) { if (node === parent) return true; node = node.parentNode; } return false; }; return function(scope, element, rootNode) { var togglePicker = function(toggle) { scope.displayPicker = toggle; scope.$apply(); }; element.on('focus', function() { scope.modalStyles = computeStyles(element[0]); togglePicker(true); }); element.on('keydown', function(e) { if (indexOf.call([9, 13, 27], e.keyCode) >= 0) togglePicker(false); }); $document.on('click', function(e) { if (isDescendant(rootNode, e.target) || e.target === element[0]) return; togglePicker(false); }); }; }]) .factory('pickadateDateHelper', ['$locale', 'dateFilter', function($locale, dateFilter) { function getPartName(part) { switch (part) { case 'dd': return 'day'; case 'MM': return 'month'; case 'yyyy': return 'year'; } } return function(format, options) { var minDate, maxDate, disabledDates, currentDate, weekStartsOn, noExtraRows; options = options || {}; format = format || 'yyyy-MM-dd'; weekStartsOn = options.weekStartsOn; noExtraRows = options.noExtraRows; disabledDates = options.disabledDates || angular.noop; if (!angular.isNumber(weekStartsOn) || weekStartsOn < 0 || weekStartsOn > 6) weekStartsOn = 0; return { parseDate: function(dateString) { if (!dateString) return; if (angular.isDate(dateString)) return new Date(dateString); var formatRegex = '(dd|MM|yyyy)', separator = format.match(/[-|/]/)[0], dateParts = dateString.split(separator), regexp = new RegExp([formatRegex, formatRegex, formatRegex].join(separator)), formatParts = format.match(regexp), dateObj = {}; formatParts.shift(); angular.forEach(formatParts, function(part, i) { dateObj[getPartName(part)] = parseInt(dateParts[i], 10); }); if (isNaN(dateObj.year) || isNaN(dateObj.month) || isNaN(dateObj.day)) return; return new Date(dateObj.year, dateObj.month - 1, dateObj.day, 3); }, setRestrictions: function(restrictions) { minDate = this.parseDate(restrictions.minDate) || new Date(0); maxDate = this.parseDate(restrictions.maxDate) || new Date(99999999999999); currentDate = restrictions.currentDate; }, allowPrevMonth: function() { return currentDate > minDate; }, allowNextMonth: function() { var nextMonth = angular.copy(currentDate); nextMonth.setMonth(nextMonth.getMonth() + 1); return nextMonth <= maxDate; }, buildDateObject: function(date) { var localDate = angular.copy(date), formattedDate = dateFilter(localDate, format), disabled = disabledDates({date: localDate, formattedDate: formattedDate}), monthOffset = this.getMonthOffset(localDate, currentDate), outOfMinRange = localDate < minDate, outOfMaxRange = localDate > maxDate, outOfMonth = (monthOffset === -1 && !options.previousMonthSelectable) || (monthOffset === 1 && !options.nextMonthSelectable); return { date: localDate, formattedDate: formattedDate, today: formattedDate === dateFilter(new Date(), format), disabled: disabled, outOfMinRange: outOfMinRange, outOfMaxRange: outOfMaxRange, monthOffset: monthOffset, enabled: !(disabled || outOfMinRange || outOfMaxRange || outOfMonth) }; }, buildDates: function(year, month, options) { var dates = [], date = new Date(year, month, 1, 3), lastDate = new Date(year, month + 1, 0, 3); options = options || {}; currentDate = angular.copy(date); while (date.getDay() !== weekStartsOn) date.setDate(date.getDate() - 1); for (var i = 0; i < 42; i++) { // 42 == 6 rows of dates if (noExtraRows && date.getDay() === weekStartsOn && date > lastDate) break; dates.push(this.buildDateObject(date)); date.setDate(date.getDate() + 1); } return dates; }, buildDayNames: function() { var dayNames = $locale.DATETIME_FORMATS.SHORTDAY; if (weekStartsOn) { dayNames = dayNames.slice(0); for (var i = 0; i < weekStartsOn; i++) dayNames.push(dayNames.shift()); } return dayNames; }, getMonthOffset: function(date1, date2) { return date1.getMonth() - date2.getMonth() + (12 * (date1.getFullYear() - date2.getFullYear())); } }; }; }]) .directive('pickadate', ['$locale', '$sce', '$compile', '$document', '$window', 'pickadateDateHelper', 'pickadateI18n', 'pickadateModalBindings', 'filterFilter', function($locale, $sce, $compile, $document, $window, dateHelperFactory, i18n, modalBindings, filter) { var TEMPLATE = '<div class="pickadate" ng-show="displayPicker" ng-style="modalStyles">' + '<div class="pickadate-header">' + '<div class="pickadate-controls">' + '<a href="" class="pickadate-prev" ng-click="changeMonth(-1)" ng-show="allowPrevMonth">' + $sce.trustAsHtml(i18n.t('prev')) + '</a>' + '<a href="" class="pickadate-next" ng-click="changeMonth(1)" ng-show="allowNextMonth">' + $sce.trustAsHtml(i18n.t('next')) + '</a>' + '</div>'+ '<h3 class="pickadate-centered-heading">' + '{{currentDate | date:"MMMM yyyy"}}' + '</h3>' + '</div>' + '<div class="pickadate-body">' + '<div class="pickadate-main">' + '<ul class="pickadate-cell">' + '<li class="pickadate-head" ng-repeat="dayName in dayNames">' + '{{dayName}}' + '</li>' + '</ul>' + '<ul class="pickadate-cell">' + '<li ng-repeat="dateObj in dates" ng-click="setDate(dateObj)" ng-class="classesFor(dateObj)">' + '{{dateObj.date | date:"d"}}' + '</li>' + '</ul>' + '</div>' + '</div>' + '</div>'; return { require: 'ngModel', scope: { defaultDate: '=', minDate: '=', maxDate: '=', disabledDates: '&', weekStartsOn: '=', holidayList: '=' }, link: function(scope, element, attrs, ngModel) { var allowMultiple = attrs.hasOwnProperty('multiple'), allowBlank = attrs.hasOwnProperty('allowBlankDate'), selectedDates = [], wantsModal = element[0] instanceof HTMLInputElement, compiledHtml = $compile(TEMPLATE)(scope), format = (attrs.format || 'yyyy-MM-dd').replace(/m/g, 'M'), dateHelper = dateHelperFactory(format, { previousMonthSelectable: /^(previous|both)$/.test(attrs.selectOtherMonths), nextMonthSelectable: /^(next|both)$/.test(attrs.selectOtherMonths), weekStartsOn: scope.weekStartsOn, noExtraRows: attrs.hasOwnProperty('noExtraRows'), disabledDates: scope.disabledDates }); scope.displayPicker = !wantsModal; function isHoliday(dateStr) { return indexOf.call(scope.holidayList, dateStr) >= 0; } scope.setDate = function(dateObj) { if (!dateObj.enabled) return; selectedDates = toggleDate(dateObj, selectedDates); setViewValue(selectedDates); scope.changeMonth(dateObj.monthOffset); scope.displayPicker = !wantsModal; }; var $render = ngModel.$render = function(options) { if (angular.isArray(ngModel.$viewValue)) { selectedDates = ngModel.$viewValue; } else if (ngModel.$viewValue) { selectedDates = [ngModel.$viewValue]; } scope.currentDate = dateHelper.parseDate(scope.defaultDate || selectedDates[0]) || new Date(); dateHelper.setRestrictions(scope); selectedDates = map(selectedDates, function(date) { return dateHelper.buildDateObject(dateHelper.parseDate(date)); }); selectedDates = filter(selectedDates, { enabled: true }); setViewValue(selectedDates, options); render(); }; scope.classesFor = function(date) { var formattedDates = map(selectedDates, 'formattedDate'), classes = indexOf.call(formattedDates, date.formattedDate) >= 0 ? 'pickadate-active' : null; return date.classNames.concat(classes); }; scope.changeMonth = function(offset) { if (!offset) return; // If the current date is January 31th, setting the month to date.getMonth() + 1 // sets the date to March the 3rd, since the date object adds 30 days to the current // date. Settings the date to the 2nd day of the month is a workaround to prevent this // behaviour scope.currentDate.setDate(1); scope.currentDate.setMonth(scope.currentDate.getMonth() + offset); render(); }; // Workaround to watch multiple properties. XXX use $scope.$watchGroup in angular 1.3 scope.$watch(function() { return angular.toJson([scope.minDate, scope.maxDate]); }, $render); // Insert datepicker into DOM if (wantsModal) { modalBindings(scope, element, compiledHtml[0]); // if the user types a date, update the picker and set validity scope.$watch(function() { return ngModel.$viewValue; }, function(val) { var isValidDate = dateHelper.parseDate(val); if (isValidDate) $render({ skipRenderInput: true }); ngModel.$setValidity('date', !!isValidDate); }); // if the input element has a value, set it as the ng-model scope.$$postDigest(function() { if (attrs.value) { ngModel.$viewValue = attrs.value; $render(); } }); element.after(compiledHtml.addClass('pickadate-modal')); } else { element.append(compiledHtml); } function render() { var dates = dateHelper.buildDates(scope.currentDate.getFullYear(), scope.currentDate.getMonth()); scope.allowPrevMonth = dateHelper.allowPrevMonth(); scope.allowNextMonth = dateHelper.allowNextMonth(); scope.dayNames = dateHelper.buildDayNames(); scope.dates = map(dates, function(date) { date.classNames = [date.enabled ? 'pickadate-enabled' : 'pickadate-disabled']; if (date.today) date.classNames.push('pickadate-today'); if (date.disabled) date.classNames.push('pickadate-unavailable'); if (isHoliday(date)) date.classNames.push('pickadate-holiday'); return date; }); } function setViewValue(value, options) { options = options || {}; if (allowMultiple) { ngModel.$setViewValue(map(value, 'formattedDate')); } else { ngModel.$setViewValue(value[0] && value[0].formattedDate); } if (!options.skipRenderInput) element.val(ngModel.$viewValue); } function toggleDate(dateObj, dateArray) { var index = indexOf.call(map(dateArray, 'formattedDate'), dateObj.formattedDate); if (index === -1) { dateArray = addDate(dateObj, dateArray); } else if (allowBlank || (dateArray.length > 1)) { dateArray.splice(index, 1); } return dateArray; } function addDate(dateObj, dateArray){ if (allowMultiple) { dateArray.push(dateObj); } else { dateArray = [dateObj]; } return dateArray; } } }; }]); })(window.angular);
Object.defineProperty(exports, "__esModule", { value: true }); var commonModule = require("./dataform-common"); var color_1 = require("tns-core-modules/color"); var utilsModule = require("tns-core-modules/utils/utils"); var observableModule = require("tns-core-modules/data/observable"); var enums = require("tns-core-modules/ui/enums"); require("utils/module-merge").merge(commonModule, exports); var RadDataForm = (function (_super) { __extends(RadDataForm, _super); function RadDataForm() { var _this = _super !== null && _super.apply(this, arguments) || this; _this._loaded = false; return _this; } RadDataForm.prototype.createNativeView = function () { if (!this._android) { this._android = new com.telerik.widget.dataform.visualization.RadDataForm(this._context); this._layoutManager = new com.telerik.widget.dataform.visualization.DataFormGroupLayoutManager(this._context); this._android.setLayoutManager(this._layoutManager); } var that = new WeakRef(this); this.entityPropertyChangedHandler = function (propertyChangeData) { var property = propertyChangeData.object; if (!property._shouldSkipEditorUpdate || propertyChangeData.propertyName != "editor") { if (!that.get()._android || !that.get()._loaded) { return; } switch (propertyChangeData.propertyName) { case 'index': case 'hidden': case 'editor': that.get().reload(); break; } } }; this.groupTitleStylePropertyChangedHandler = function (propertyChangeData) { if (!that.get()._android || !that.get()._loaded) { return; } that.get()._layoutManager.applyEditorGroupCustomizations(); }; this.groupLayoutPropertyChangedHandler = function (propertyChangeData) { if (!that.get()._android || !that.get()._loaded) { return; } that.get().android.arrangeEditors(); }; this.groupPropertyChangedHandler = function (propertyChangeData) { if (!that.get()._android || !that.get()._loaded) { return; } switch (propertyChangeData.propertyName) { case "collapsed": var propertyGroup = propertyChangeData.object; if (!propertyGroup.collapsible) { // If the group is not collapsible, we don't want to collapse it. if (propertyChangeData.value) { console.log("WARNING: collapsible should be true before collapsing a group."); } return; } var nativeGroup = that.get().getNativeGroup(propertyGroup.name); nativeGroup.setIsExpanded(!propertyChangeData.value); break; case "hidden": case "titleHidden": case "collapsible": case "layout": that.get()._android.arrangeEditors(); if (propertyChangeData.propertyName === 'layout') { that.get()._attachGroupLayoutChangeListener(undefined, propertyChangeData.value); } break; case "titleStyle": that.get()._layoutManager.applyEditorGroupCustomizations(); that.get()._attachGroupTitleStyleChangeListener(undefined, propertyChangeData.value); break; case "name": var group = propertyChangeData.object; if (group.properties) { for (var i = 0; i < group.properties.length; i++) { var property = group.properties[i]; if (property.android) { property.android.setGroupName(group.name); } } that.get().reload(); } break; } }; this._setupGroups(); this._updateEditorStyles(); this._updateGroupStyles(); this._updateSource(); this._updateIsReadOnly(); this._updateCommitMode(); this._updateValidationMode(); this._updateMetadata(); this._addValidationListener(); this._addCommitListener(); this._loaded = true; return this._android; }; RadDataForm.prototype.notifyValidated = function (propertyName, result) { var property = this.getPropertyByName(propertyName); var editor = property.editor; if (property.android) { var message = result ? property.successMessage : property.errorMessage; property.android.onValidationResult(property.valueCandidate, result, message); } }; RadDataForm.prototype._setupGroups = function () { var that = new WeakRef(this); this._layoutManager.setCreateGroup(new com.telerik.android.common.Function2({ apply: function (context, name) { if (that.get().groups) { for (var i = 0; i < that.get().groups.length; i++) { var propertyGroup = that.get().groups[i]; if (propertyGroup.name === name.toString()) { var group_1 = void 0; if (propertyGroup.collapsible) { group_1 = new com.telerik.widget.dataform.visualization.ExpandableEditorGroup(context, name.toString()); that.get()._addIsExpandedChangedListener(group_1); if (propertyGroup.collapsed) { group_1.setIsExpanded(false); } } else { group_1 = new com.telerik.widget.dataform.visualization.EditorGroup(context, name.toString()); } if (propertyGroup.hidden) { group_1.rootLayout().setVisibility(android.view.View.GONE); } if (propertyGroup.titleHidden) { group_1.getHeaderContainer().setVisibility(android.view.View.GONE); } if (!propertyGroup.titleStyle) { propertyGroup.titleStyle = new commonModule.GroupTitleStyle(); } if (!propertyGroup.layout) { propertyGroup.layout = new commonModule.DataFormStackLayout(); } that.get()._updateGroupLayout(propertyGroup, group_1); that.get()._attachGroupChangeListener(propertyGroup); return group_1; } } } var group = new com.telerik.widget.dataform.visualization.EditorGroup(context, name.toString()); if (group.getHeaderView()) { group.getHeaderView().setVisibility(android.view.View.GONE); } return group; } })); this._android.arrangeEditors(); }; RadDataForm.prototype._updateGroupLayout = function (propertyGroup, nativeGroup) { var context = nativeGroup.rootLayout().getContext(); if (propertyGroup.layout instanceof commonModule.DataFormStackLayout) { var nativeLinearLayout = new com.telerik.widget.dataform.visualization.DataFormLinearLayoutManager(context); if (propertyGroup.layout.orientation == enums.Orientation.horizontal) { nativeLinearLayout.setOrientation(android.widget.LinearLayout.HORIZONTAL); } else { nativeLinearLayout.setOrientation(android.widget.LinearLayout.VERTICAL); } nativeGroup.setLayoutManager(nativeLinearLayout); } else if (propertyGroup.layout instanceof commonModule.DataFormGridLayout) { var nativeTableLayout = new com.telerik.widget.dataform.visualization.DataFormTableLayoutManager(context); nativeGroup.setLayoutManager(nativeTableLayout); } }; RadDataForm.prototype._updateSource = function () { if (!this._android || !this.source) { return; } this._android.setReloadSuspended(true); var objJSON = JSON.stringify(this.source); var jsonObject = new org.json.JSONObject(objJSON); this._android.setEntity(jsonObject); this._syncPropertiesWithNativeProperties(); this._updateNativeGroups(); this._android.setReloadSuspended(false); this.reload(); }; RadDataForm.prototype._updateMetadata = function () { if (!this._android || !this.metadata) { return; } this._android.setReloadSuspended(true); var objJSON = JSON.stringify(this.metadata); var jsonObject = new org.json.JSONObject(objJSON); var metadata = new com.telerik.widget.dataform.engine.DataFormMetadata(jsonObject); this._android.setMetadata(metadata); this._android.setReloadSuspended(false); this.reload(); }; RadDataForm.prototype._syncPropertiesWithNativeProperties = function () { var nativeEntity = this._android.getEntity(); var nativeProperties = nativeEntity.properties(); // We probably need to use the for(let ) loop here var length = nativeProperties.size(); for (var i = 0; i < length; i++) { var nativeProperty = nativeProperties.get(i); var property = this.getPropertyByName(nativeProperty.name()); if (property == null) { var property = this._createPropertyFromNative(nativeProperty); if (!this.properties) { this.properties = new Array(); } this.properties.push(property); } else { property._linkPropertyWithNative(nativeProperty); } this._attachEntityPropertyPropertyChangeListener(property); } }; RadDataForm.prototype.updateNativePropertyEditorDisplayMode = function (editor, value) { var nativeValue; switch (value.toLowerCase()) { case commonModule.AutoCompleteDisplayMode.Plain.toLowerCase(): nativeValue = com.telerik.widget.autocomplete.DisplayMode.PLAIN; break; case commonModule.AutoCompleteDisplayMode.Tokens.toLowerCase(): nativeValue = com.telerik.widget.autocomplete.DisplayMode.TOKENS; break; } if (value && editor) { editor.setDisplayMode(nativeValue); } else { console.log("autoCompleteDisplayMode cannot be set to: " + value); } }; RadDataForm.prototype._updateNativeGroups = function () { if (!this.source) { return; } //go through all groups / entity properties if (this.groups) { for (var i = 0; i < this.groups.length; i++) { if (this.groups[i].properties) { for (var j = 0; j < this.groups[i].properties.length; j++) { var entityProperty = this.groups[i].properties[j]; if (entityProperty.android) { entityProperty.android.setGroupName(this.groups[i].name); } } } } } }; RadDataForm.prototype.getNativeGroup = function (name) { var groupCount = this._layoutManager.editorGroups().size(); for (var i = 0; i < groupCount; i++) { var group = this._layoutManager.editorGroups().get(i); if (group.name() == name) { return group; } } return null; }; RadDataForm.prototype._updateEditorStyles = function () { var that = new WeakRef(this); this._android.setEditorCustomizations(new com.telerik.android.common.Procedure({ apply: function (editor) { var property = that.get().getPropertyByName(editor.property().name()); if (property.editor) { PropertyEditorHelper.applyStyle(property.editor); } var groupName = property.android ? property.android.getGroupName() : undefined; var args = { eventName: commonModule.RadDataForm.editorUpdateEvent, object: that.get(), editor: editor, entityProperty: property.android, propertyName: property.name, group: undefined, groupName: groupName, returnValue: true }; that.get().notify(args); } })); }; RadDataForm.prototype._updateGroupStyles = function () { var that = new WeakRef(this); this._layoutManager.setEditorGroupCustomizations(new com.telerik.android.common.Procedure({ apply: function (editorGroup) { var group = that.get().getGroupByName(editorGroup.name()); if (group == null || group.titleStyle == null) { return; } that.get()._applyGroupTitleStyle(editorGroup, group.titleStyle); //throw event for additional customizations var groupName = editorGroup.name(); var args = { eventName: commonModule.RadDataForm.groupUpdateEvent, object: this._owner, editor: undefined, entityProperty: undefined, propertyName: undefined, group: editorGroup, groupName: groupName, returnValue: true }; that.get().notify(args); } })); }; RadDataForm.prototype._createPropertyFromNative = function (nativeProperty) { var entityProperty = new EntityProperty(); entityProperty.name = nativeProperty.name(); entityProperty._linkPropertyWithNative(nativeProperty); return entityProperty; }; RadDataForm.prototype._addValidationListener = function () { var that = new WeakRef(this); this._android.addValidationListener(new com.telerik.widget.dataform.engine.EntityPropertyValidationListener({ onValidate: function (property) { var entityProperty = that.get().getPropertyByName(property.name()); var group = that.get().getGroupByName(property.getGroupName()); var args = { eventName: commonModule.RadDataForm.propertyValidateEvent, object: that.get(), editor: entityProperty.editor, entityProperty: entityProperty, propertyName: property.name(), group: group, groupName: property.getGroupName(), returnValue: true }; that.get().notify(args); var result = Promise.resolve(args.returnValue); property.onValidationStarted(); var validationValue = entityProperty.valueCandidate; result.then((function (answer) { if (answer == false) { property.onValidationResult(validationValue, false, entityProperty.errorMessage); } else { property.onValidationResult(validationValue, true, entityProperty.successMessage); } })); }, onDidValidate: function (property) { var entityProperty = that.get().getPropertyByName(property.name()); var group = that.get().getGroupByName(property.getGroupName()); var args = { eventName: commonModule.RadDataForm.propertyValidatedEvent, object: that.get(), editor: entityProperty.editor, entityProperty: entityProperty, propertyName: property.name(), group: group, groupName: property.getGroupName(), returnValue: true }; that.get().notify(args); } })); }; RadDataForm.prototype._addCommitListener = function () { var that = new WeakRef(this); this._android.addCommitListener(new com.telerik.widget.dataform.engine.EntityPropertyCommitListener({ onBeforeCommit: function (property) { var entityProperty = that.get().getPropertyByName(property.name()); var args = { eventName: commonModule.RadDataForm.propertyCommitEvent, object: that.get(), editor: undefined, entityProperty: entityProperty, propertyName: property.name(), group: undefined, groupName: property.getGroupName(), returnValue: true }; that.get().notify(args); return !args.returnValue; }, onAfterCommit: function (property) { var entityProperty = that.get().getPropertyByName(property.name()); if (that.get().source.hasOwnProperty(property.name())) { var oldValue = that.get().source[property.name()]; var newValue = that.get().android.getEditedObject().get(property.name()); if (typeof oldValue == "number") { newValue = Number(newValue); } if (typeof oldValue == "boolean") { if (!(typeof newValue == "boolean")) { newValue = newValue == 'true'; } } that.get().source[property.name()] = newValue; var args = { eventName: commonModule.RadDataForm.propertyCommittedEvent, object: that.get(), editor: undefined, entityProperty: entityProperty, propertyName: property.name(), group: undefined, groupName: property.getGroupName(), returnValue: true }; that.get().notify(args); } } })); }; RadDataForm.prototype._addIsExpandedChangedListener = function (group) { var that = new WeakRef(this); group.addIsExpandedChangedListener(new com.telerik.widget.dataform.visualization.ExpandableEditorGroup.IsExpandedChangedListener({ onChanged: function (isExpanded) { var name = isExpanded ? commonModule.RadDataForm.groupExpandedEvent : commonModule.RadDataForm.groupCollapsedEvent; var propertyGroup = that.get().getGroupByName(group.name()); propertyGroup.collapsed = !isExpanded; var args = { eventName: name, object: that.get(), editor: undefined, entityProperty: undefined, propertyName: undefined, group: group, groupName: group.name(), returnValue: true }; that.get().notify(args); } })); }; RadDataForm.prototype._applyGroupTitleStyle = function (nativeGroup, titleStyle) { if (titleStyle.fillColor) { nativeGroup.getHeaderContainer().setBackgroundColor(RadDataForm._makeAndroidColor(titleStyle.fillColor)); } if (titleStyle.strokeColor || titleStyle.strokeWidth) { var drawable = new android.graphics.drawable.GradientDrawable(); var strokeWidthDips = titleStyle.strokeWidth ? titleStyle.strokeWidth : 2; var strokeWidth = strokeWidthDips * utilsModule.layout.getDisplayDensity(); var strokeColor = titleStyle.strokeColor ? RadDataForm._makeAndroidColor(titleStyle.strokeColor) : android.graphics.Color.BLACK; var fillColor = titleStyle.fillColor ? RadDataForm._makeAndroidColor(titleStyle.fillColor) : android.graphics.Color.TRANSPARENT; drawable.setStroke(strokeWidth, strokeColor); drawable.setColor(fillColor); nativeGroup.getHeaderContainer().setBackgroundDrawable(drawable); } if (titleStyle.labelTextColor) { nativeGroup.getHeaderView().setTextColor(RadDataForm._makeAndroidColor(titleStyle.labelTextColor)); } if (titleStyle.labelFontName || titleStyle.labelFontStyle) { var editorTypeface = RadDataForm._makeTypeface(titleStyle.labelFontName, titleStyle.labelFontStyle); nativeGroup.getHeaderView().setTypeface(editorTypeface); } if (titleStyle.labelTextSize) { nativeGroup.getHeaderView().setTextSize(titleStyle.labelTextSize); } }; Object.defineProperty(RadDataForm.prototype, "editedObject", { get: function () { var editedObject = this._android.getEditedObject(); if (editedObject) { return editedObject.toString(); } }, enumerable: true, configurable: true }); RadDataForm.prototype._onIsReadOnlyPropertyChanged = function (oldValue, newValue) { this._updateIsReadOnly(); }; RadDataForm.prototype._onCommitModePropertyChanged = function (oldValue, newValue) { this._updateCommitMode(); }; RadDataForm.prototype._onValidationModePropertyChanged = function (oldValue, newValue) { this._updateValidationMode(); }; RadDataForm.prototype._updateIsReadOnly = function () { if (!this._android) { return; } this._android.setEnabled(!this.isReadOnly); }; RadDataForm.prototype._updateCommitMode = function () { if (!this._android) { return; } switch (this.commitMode) { case commonModule.CommitMode.Immediate: this._android.setCommitMode(com.telerik.widget.dataform.visualization.core.CommitMode.IMMEDIATE); break; case commonModule.CommitMode.Manual: this._android.setCommitMode(com.telerik.widget.dataform.visualization.core.CommitMode.MANUAL); break; case commonModule.CommitMode.OnLostFocus: this._android.setCommitMode(com.telerik.widget.dataform.visualization.core.CommitMode.ON_LOST_FOCUS); break; } }; RadDataForm.prototype._updateValidationMode = function () { if (!this._android) { return; } switch (this.validationMode) { case commonModule.ValidationMode.Immediate: this._android.setValidationMode(com.telerik.widget.dataform.visualization.core.ValidationMode.IMMEDIATE); break; case commonModule.ValidationMode.Manual: this._android.setValidationMode(com.telerik.widget.dataform.visualization.core.ValidationMode.MANUAL); break; case commonModule.ValidationMode.OnLostFocus: this._android.setValidationMode(com.telerik.widget.dataform.visualization.core.ValidationMode.ON_LOST_FOCUS); break; } }; RadDataForm.prototype.reload = function () { if (this._android) { this._android.reload(); if (!this._android.isReloadSuspended()) { this._syncEditorsWithNativeEditors(); } } }; RadDataForm.prototype.validateAll = function () { if (!this._android) { return null; } var that = new WeakRef(this); var promise = new Promise(function (resolve) { that.get()._validateResolve = resolve; }); this._android.validateChanges(new com.telerik.android.common.Procedure({ apply: function (info) { that.get().onValidateChangesEnded(!info.hasErrors()); } })); return promise; }; RadDataForm.prototype.onValidateChangesEnded = function (value) { if (this._validateResolve) { this._validateResolve(value); this._validateResolve = null; } }; RadDataForm.prototype.validateAndCommitAll = function () { if (!this._android) { return null; } var that = new WeakRef(this); return new Promise(function (resolve) { that.get().validateAll().then(function (result) { if (result) { that.get().android.commitForced(); } resolve(result); }); }); }; RadDataForm.prototype.commitAll = function () { if (!this._android) { return; } this._android.commitForced(); }; RadDataForm.prototype.hasValidationErrors = function () { if (this._android) { this._android.validateChanges(); return this._android.hasValidationErrors(); } }; RadDataForm.prototype._onSourcePropertyChanged = function (oldValue, newValue) { this._updateSource(); }; RadDataForm.prototype._onMetadataPropertyChanged = function (oldValue, newValue) { this._updateMetadata(); }; RadDataForm.prototype._updateNativeEditor = function (entityProperty) { var nativeEditor = this._android.getExistingEditorForProperty(entityProperty.name); if (nativeEditor == null) { return; } if (!entityProperty.editor) { entityProperty._createEditorFromNative(nativeEditor); } else { PropertyEditorHelper._linkEditorWithNative(entityProperty.editor, nativeEditor); if (entityProperty.autoCompleteDisplayMode) { this.updateNativePropertyEditorDisplayMode(nativeEditor, entityProperty.autoCompleteDisplayMode); } } }; RadDataForm.prototype._syncEditorsWithNativeEditors = function () { if (!this.source) { return; } if (this.groups) { for (var i = 0; i < this.groups.length; i++) { if (this.groups[i].properties) { for (var j = 0; j < this.groups[i].properties.length; j++) { var entityProperty = this.groups[i].properties[j]; this._updateNativeEditor(entityProperty); } } } } if (this.properties) { for (var i = 0; i < this.properties.length; i++) { var entityProperty = this.properties[i]; this._updateNativeEditor(entityProperty); } } }; RadDataForm._makeAndroidColor = function (colorValue) { var nsColor = new color_1.Color(colorValue); return nsColor.android; }; RadDataForm._makeTypeface = function (fontName, style) { var fontStyle = android.graphics.Typeface.NORMAL; if (style) { switch (commonModule.FontStyles[style]) { case commonModule.FontStyles.Bold: fontStyle = android.graphics.Typeface.BOLD; break; case commonModule.FontStyles.Italic: fontStyle = android.graphics.Typeface.ITALIC; break; case commonModule.FontStyles.BoldItalic: fontStyle = android.graphics.Typeface.BOLD_ITALIC; break; } } return android.graphics.Typeface.create(fontName, fontStyle); }; return RadDataForm; }(commonModule.RadDataForm)); exports.RadDataForm = RadDataForm; var EntityProperty = (function (_super) { __extends(EntityProperty, _super); function EntityProperty() { var _this = _super.call(this) || this; _this._shouldSkipEditorUpdate = false; return _this; } Object.defineProperty(EntityProperty.prototype, "android", { get: function () { return this._android; }, enumerable: true, configurable: true }); Object.defineProperty(EntityProperty.prototype, "isValid", { get: function () { if (this.android) { return this.android.isValid(); } return undefined; }, enumerable: true, configurable: true }); Object.defineProperty(EntityProperty.prototype, "value", { get: function () { if (this.android) { return this.android.getValue(); } return undefined; }, enumerable: true, configurable: true }); Object.defineProperty(EntityProperty.prototype, "valueCandidate", { get: function () { if (this.android) { return this.android.getValueCandidate(); } return undefined; }, enumerable: true, configurable: true }); EntityProperty.prototype._linkPropertyWithNative = function (value) { this._android = value; this._onNativeSet(); }; EntityProperty.prototype._createEditorFromNative = function (nativeEditor) { var type = PropertyEditor._getNativeEditorType(nativeEditor); this._shouldSkipEditorUpdate = true; var propertyEditor = new PropertyEditor(); propertyEditor.type = type; PropertyEditorHelper._linkEditorWithNative(propertyEditor, nativeEditor); this.editor = propertyEditor; this._shouldSkipEditorUpdate = false; }; EntityProperty.prototype.onEditorChanged = function (oldValue, newValue) { if (oldValue) { oldValue.off(observableModule.Observable.propertyChangeEvent); } if (newValue instanceof commonModule.PropertyEditor) { var that = new WeakRef(this); newValue.on(observableModule.Observable.propertyChangeEvent, function (propertyChangeData) { if (propertyChangeData.propertyName === "type") { that.get()._onEditorTypeChanged(propertyChangeData); } }); if (!this._shouldSkipEditorUpdate) { this.updateNativeEditor(newValue); } } }; EntityProperty.prototype._onEditorTypeChanged = function (data) { var newEditor = new PropertyEditor(); newEditor.type = this.editor.type; newEditor.propertyEditorStyle = this.editor.propertyEditorStyle; newEditor.params = this.editor.params; this.editor = newEditor; }; EntityProperty.prototype._onNativeSet = function () { if (!this._android) { return; } this.updateNativeEditor(this.editor); this.updateNativeValidators(this.validators); this.updateNativeConverter(this.converter); this.updateNativeValuesProvider(this.valuesProviderArray); this.updateNativeDisplayName(this.displayName); this.updateNativeIndex(this.index); this.updateNativeColumnIndex(this.columnIndex); this.updateNativeHidden(this.hidden); this.updateNativeReadOnly(this.readOnly); this.updateNativeRequired(this.required); this.updateNativeHintText(this.hintText); this.updateNativeImageResource(this.imageResource); }; EntityProperty.prototype.updateNativeEditor = function (value) { if (!this._android || !value) { return; } if (value instanceof CustomPropertyEditor) { this._android.setEditorType(com.telerik.widget.dataform.visualization.editors.DataFormCustomEditor.class); return; } if (value.type == commonModule.EditorType.DatePicker) { this.android.setConverter(new StringToDateConverter().android); } else if (value.type == commonModule.EditorType.TimePicker) { this.android.setConverter(new StringToTimeConverter().android); } this._android.setEditorType(value.editorClass); this._android.setEditorParams(value.editorParams); }; EntityProperty.prototype.updateNativeValidators = function (value) { if (!this._android || !value) { return; } var validatorSet = new com.telerik.widget.dataform.engine.PropertyValidatorSet(); for (var k = 0; k < value.length; k++) { var validatorBase = value[k]; var aValidator = validatorBase.android; validatorSet.add(aValidator); } this._android.setValidator(validatorSet); }; EntityProperty.prototype.updateNativeValuesProvider = function (value) { if (!this._android || !value) { return; } var nativeSource = new java.util.ArrayList(); for (var i = 0; i < value.length; i++) { var nativeValue = value[i]; if (typeof nativeValue == "string") { nativeValue = nativeValue.trim(); } if (typeof nativeValue == "number") { nativeValue = new java.lang.Integer(nativeValue); } nativeSource.add(nativeValue); } var nativeList = nativeSource.toArray(); this._android.updateValues(nativeList); if (this.editor && this.editor.android) { this.editor.android.notifyEntityPropertyChanged(); } }; EntityProperty.prototype.updateNativeImageResource = function (value) { if (!this._android || value === undefined) { return; } if (value != null) { var nativeValue = value; var appResources = utilsModule.ad.getApplicationContext().getResources(); var packageName = utilsModule.ad.getApplication().getPackageName(); if (appResources) { var identifier = appResources.getIdentifier(nativeValue, 'drawable', packageName); nativeValue = identifier; } this._android.setImageResource(nativeValue); } else { this._android.setImageResource(0); } if (this.editor && this.editor.android) { this.editor.android.notifyEntityPropertyChanged(); } }; EntityProperty.prototype.updateNativeDisplayName = function (value) { if (!this._android || value == null) { return; } this._android.setHeader(value); if (this.editor && this.editor.android) { this.editor.android.notifyEntityPropertyChanged(); } }; EntityProperty.prototype.updateNativeIndex = function (value) { if (!this._android || value == null) { return; } this._android.setPosition(value); }; EntityProperty.prototype.updateNativeConverter = function (value) { if (!this._android || value == null) { return; } this._android.setConverter(new com.telerik.widget.dataform.engine.PropertyConverter({ convertTo: function (source) { var result = value.convertTo(source); return result; }, convertFrom: function (source) { var result = value.convertFrom(source); return result; } })); if (this.editor && this.editor.android) { this.editor.android.loadPropertyValue(); } }; EntityProperty.prototype.updateNativeColumnIndex = function (value) { if (!this._android || value == null) { return; } this._android.setColumnPosition(value); }; EntityProperty.prototype.updateNativeHidden = function (value) { if (!this._android || value == null) { return; } this._android.setSkip(value); }; EntityProperty.prototype.updateNativeReadOnly = function (value) { if (!this._android || value == null) { return; } if (this.editor) { PropertyEditorHelper.setReadOnly(this.editor, value); if (this.editor.android) { this.editor.android.setEnabled(!value); } } }; EntityProperty.prototype.updateNativeRequired = function (value) { if (!this._android || value == null) { return; } this._android.setRequired(value); }; EntityProperty.prototype.updateNativeHintText = function (value) { if (!this._android || !value) { return; } this._android.setHintText(value); if (this.editor && this.editor.android) { this.editor.android.notifyEntityPropertyChanged(); } }; return EntityProperty; }(commonModule.EntityProperty)); exports.EntityProperty = EntityProperty; ////////////////////////////////////////////////////////////////////////////////////////////// // Editors var PropertyEditor = (function (_super) { __extends(PropertyEditor, _super); function PropertyEditor() { var _this = _super !== null && _super.apply(this, arguments) || this; _this._readOnly = false; return _this; } Object.defineProperty(PropertyEditor.prototype, "android", { get: function () { return this._android; }, enumerable: true, configurable: true }); Object.defineProperty(PropertyEditor.prototype, "editorClass", { get: function () { return this._editorClass; }, enumerable: true, configurable: true }); Object.defineProperty(PropertyEditor.prototype, "editorParams", { get: function () { return this._editorParams; }, enumerable: true, configurable: true }); PropertyEditor.prototype.onPropertyEditorStyleChanged = function (oldValue, newValue) { PropertyEditorHelper.applyStyle(this); }; PropertyEditor.prototype.onStylePropertyChanged = function (propertyName) { PropertyEditorHelper.applyStyleForProperty(this, propertyName); }; PropertyEditor.prototype.onParamsChanged = function (oldValue, newValue) { PropertyEditorHelper.applyParams(this); }; PropertyEditor.prototype.onParamsPropertyChanged = function (propertyName) { PropertyEditorHelper.applyParams(this); }; PropertyEditor.prototype.onTypeChanged = function (oldValue, newValue) { this._updateEditorClass(); }; PropertyEditor.prototype._updateEditorClass = function () { if (this.type == null) { return; } switch (commonModule.EditorType[this.type]) { case commonModule.EditorType.Text: this._editorClass = com.telerik.widget.dataform.visualization.editors.DataFormTextEditor.class; break; case commonModule.EditorType.MultilineText: this._editorClass = com.telerik.widget.dataform.visualization.editors.DataFormMultilineTextEditor.class; break; case commonModule.EditorType.Email: this._editorClass = com.telerik.widget.dataform.visualization.editors.DataFormEmailEditor.class; break; case commonModule.EditorType.Password: this._editorClass = com.telerik.widget.dataform.visualization.editors.DataFormPasswordEditor.class; break; case commonModule.EditorType.Phone: this._editorClass = com.telerik.widget.dataform.visualization.editors.DataFormPhoneEditor.class; break; case commonModule.EditorType.Decimal: this._editorClass = com.telerik.widget.dataform.visualization.editors.DataFormDecimalEditor.class; break; case commonModule.EditorType.Number: this._editorClass = com.telerik.widget.dataform.visualization.editors.DataFormIntegerEditor.class; break; case commonModule.EditorType.Switch: this._editorClass = com.telerik.widget.dataform.visualization.editors.DataFormSwitchEditor.class; break; case commonModule.EditorType.Stepper: this._editorClass = com.telerik.widget.dataform.visualization.editors.DataFormNumberPickerEditor.class; break; case commonModule.EditorType.Slider: this._editorClass = com.telerik.widget.dataform.visualization.editors.DataFormSeekBarEditor.class; break; case commonModule.EditorType.SegmentedEditor: this._editorClass = com.telerik.widget.dataform.visualization.editors.DataFormSegmentedEditor.class; break; case commonModule.EditorType.DatePicker: this._editorClass = com.telerik.widget.dataform.visualization.editors.DataFormDateEditor.class; break; case commonModule.EditorType.TimePicker: this._editorClass = com.telerik.widget.dataform.visualization.editors.DataFormTimeEditor.class; break; case commonModule.EditorType.Picker: this._editorClass = com.telerik.widget.dataform.visualization.editors.DataFormSpinnerEditor.class; break; case commonModule.EditorType.List: this._editorClass = com.telerik.widget.dataform.visualization.editors.DataFormListViewEditor.class; break; case commonModule.EditorType.AutoCompleteInline: this._editorClass = com.telerik.widget.dataform.visualization.editors.DataFormRadAutoCompleteEditor.class; break; case commonModule.EditorType.Label: this._editorClass = com.telerik.widget.dataform.visualization.editors.DataFormLabelEditor.class; break; default: console.log("WARNING: Unsupported editor type: " + this.type); } }; PropertyEditor._getNativeEditorType = function (nativeEditor) { var nativeEditorClass = nativeEditor.getClass(); if (nativeEditorClass == com.telerik.widget.dataform.visualization.editors.DataFormMultilineTextEditor.class) { return commonModule.EditorType.MultilineText; } if (nativeEditorClass == com.telerik.widget.dataform.visualization.editors.DataFormEmailEditor.class) { return commonModule.EditorType.Email; } if (nativeEditorClass == com.telerik.widget.dataform.visualization.editors.DataFormPasswordEditor.class) { return commonModule.EditorType.Password; } if (nativeEditorClass == com.telerik.widget.dataform.visualization.editors.DataFormPhoneEditor.class) { return commonModule.EditorType.Phone; } if (nativeEditorClass == com.telerik.widget.dataform.visualization.editors.DataFormDecimalEditor.class) { return commonModule.EditorType.Decimal; } if (nativeEditorClass == com.telerik.widget.dataform.visualization.editors.DataFormIntegerEditor.class) { return commonModule.EditorType.Number; } if (nativeEditorClass == com.telerik.widget.dataform.visualization.editors.DataFormSwitchEditor.class) { return commonModule.EditorType.Switch; } if (nativeEditorClass == com.telerik.widget.dataform.visualization.editors.DataFormNumberPickerEditor.class) { return commonModule.EditorType.Stepper; } if (nativeEditorClass == com.telerik.widget.dataform.visualization.editors.DataFormSeekBarEditor.class) { return commonModule.EditorType.Slider; } if (nativeEditorClass == com.telerik.widget.dataform.visualization.editors.DataFormSegmentedEditor.class) { return commonModule.EditorType.SegmentedEditor; } if (nativeEditorClass == com.telerik.widget.dataform.visualization.editors.DataFormDateEditor.class) { return commonModule.EditorType.DatePicker; } if (nativeEditorClass == com.telerik.widget.dataform.visualization.editors.DataFormTimeEditor.class) { return commonModule.EditorType.TimePicker; } if (nativeEditorClass == com.telerik.widget.dataform.visualization.editors.DataFormSpinnerEditor.class) { return commonModule.EditorType.Picker; } if (nativeEditorClass == com.telerik.widget.dataform.visualization.editors.DataFormListViewEditor.class) { return commonModule.EditorType.List; } if (nativeEditorClass == com.telerik.widget.dataform.visualization.editors.DataFormRadAutoCompleteEditor.class) { return commonModule.EditorType.AutoCompleteInline; } if (nativeEditorClass == com.telerik.widget.dataform.visualization.editors.DataFormLabelEditor.class) { return commonModule.EditorType.Label; } return commonModule.EditorType.Text; }; return PropertyEditor; }(commonModule.PropertyEditor)); exports.PropertyEditor = PropertyEditor; var CustomPropertyEditor = (function (_super) { __extends(CustomPropertyEditor, _super); function CustomPropertyEditor() { var _this = _super !== null && _super.apply(this, arguments) || this; _this._readOnly = false; return _this; } Object.defineProperty(CustomPropertyEditor.prototype, "android", { get: function () { return this._android; }, enumerable: true, configurable: true }); Object.defineProperty(CustomPropertyEditor.prototype, "editorClass", { get: function () { return this._editorClass; }, enumerable: true, configurable: true }); Object.defineProperty(CustomPropertyEditor.prototype, "editorParams", { get: function () { return this._editorParams; }, enumerable: true, configurable: true }); CustomPropertyEditor.prototype.onPropertyEditorStyleChanged = function (oldValue, newValue) { PropertyEditorHelper.applyStyle(this); }; CustomPropertyEditor.prototype.onStylePropertyChanged = function (propertyName) { PropertyEditorHelper.applyStyleForProperty(this, propertyName); }; CustomPropertyEditor.prototype.onParamsChanged = function (oldValue, newValue) { PropertyEditorHelper.applyParams(this); }; CustomPropertyEditor.prototype.onParamsPropertyChanged = function (propertyName) { PropertyEditorHelper.applyParams(this); }; CustomPropertyEditor.prototype.onTypeChanged = function (oldValue, newValue) { console.log("WARNING: You can't change CustomPropertyEditor's type"); }; CustomPropertyEditor.prototype.createView = function (context) { var args = { eventName: commonModule.CustomPropertyEditor.editorNeedsViewEvent, object: this, view: undefined, context: context, value: undefined }; this.notify(args); return args.view; }; CustomPropertyEditor.prototype.applyValueToEditor = function (value, view) { var args = { eventName: commonModule.CustomPropertyEditor.editorHasToApplyValueEvent, object: this, view: view, context: view.getContext(), value: value }; this.notify(args); }; CustomPropertyEditor.prototype.value = function (view) { var args = { eventName: commonModule.CustomPropertyEditor.editorNeedsValueEvent, object: this, view: view, context: view.getContext(), value: undefined }; this.notify(args); return args.value; }; CustomPropertyEditor.prototype.notifyValueChanged = function () { if (this.android) { this.android.notifyEditorValueChanged(); } }; return CustomPropertyEditor; }(commonModule.CustomPropertyEditor)); exports.CustomPropertyEditor = CustomPropertyEditor; var PropertyEditorHelper = (function () { function PropertyEditorHelper() { } PropertyEditorHelper._linkEditorWithNative = function (editor, value) { if (editor instanceof CustomPropertyEditor) { editor._android = value; } else { editor._android = value; } if (!editor.propertyEditorStyle) { editor.propertyEditorStyle = new commonModule.PropertyEditorStyle(); } if (!editor.params) { editor.params = new commonModule.PropertyEditorParams(); } PropertyEditorHelper._onNativeSet(editor); }; PropertyEditorHelper._onNativeSet = function (editor) { if (!editor.android) { return; } if (editor instanceof CustomPropertyEditor) { editor.android.setProvider(new com.telerik.widget.dataform.visualization.editors.DataFormCustomEditor.DataFormCustomEditorProvider({ createView: function (context) { return editor.createView(context); }, applyValueToEditor: function (value, view) { editor.applyValueToEditor(value, view); }, getValue: function (view) { return editor.value(view); } })); } else { if (!editor.type) { editor.type = PropertyEditor._getNativeEditorType(editor.android); } } PropertyEditorHelper.applyStyle(editor); PropertyEditorHelper.applyParams(editor); var editorEnabled = !PropertyEditorHelper.isReadOnly(editor); editor.android.setEnabled(editorEnabled); editor.android.notifyEntityPropertyChanged(); }; PropertyEditorHelper._updateLabelTextColor = function (editor, labelTextColor) { if (!editor.android || labelTextColor === undefined) { return; } var nsColor = RadDataForm._makeAndroidColor(labelTextColor); // <<<<<<< HEAD:nativescript-telerik-ui-pro/dataform/dataform.android.ts // (<android.widget.TextView>this._android.getHeaderView()).setTextColor(nsColor); // ======= editor.android.getHeaderView().setTextColor(nsColor); //>>>>>>> master:dataform/dev_env/app/component/dataform.android.ts }; PropertyEditorHelper._updateLabelFont = function (editor, labelFontName, labelFontStyle) { if (!editor._android || (labelFontName === undefined && labelFontStyle === undefined)) { return; } var editorTypeface = RadDataForm._makeTypeface(labelFontName, labelFontStyle); editor.android.getHeaderView().setTypeface(editorTypeface); }; PropertyEditorHelper._updateLabelTextSize = function (editor, labelTextSize) { if (!editor.android || labelTextSize === undefined) { return; } editor.android.getHeaderView().setTextSize(labelTextSize); }; PropertyEditorHelper._updateLabelHorizontalOffset = function (editor, labelHorizontalOffset) { if (!editor.android || labelHorizontalOffset === undefined) { return; } editor.android.getHeaderView().setTranslationX(labelHorizontalOffset); }; PropertyEditorHelper._updateLabelVerticalOffset = function (editor, labelVerticalOffset) { if (!editor.android || labelVerticalOffset === undefined) { return; } editor.android.getHeaderView().setTranslationY(labelVerticalOffset); }; PropertyEditorHelper._updateEditorHorizontalOffset = function (editor, editorHorizontalOffset) { if (!editor.android || editorHorizontalOffset === undefined) { return; } editor.android.getEditorView().setTranslationX(editorHorizontalOffset); }; PropertyEditorHelper._updateEditorVerticalOffset = function (editor, editorVerticalOffset) { if (!editor.android || editorVerticalOffset === undefined) { return; } editor.android.getEditorView().setTranslationY(editorVerticalOffset); }; PropertyEditorHelper._updateEditorFillColor = function (editor, editorFillColor) { if (!editor.android || editorFillColor === undefined) { return; } var nsColor = RadDataForm._makeAndroidColor(editorFillColor); editor.android.rootLayout().setBackgroundColor(nsColor); }; PropertyEditorHelper._updateEditorStroke = function (editor, editorStrokeColor, editorStrokeWidth, editorFillColor) { if (!editor.android || (editorStrokeColor === undefined && editorStrokeWidth === undefined)) { return; } var drawable = new android.graphics.drawable.GradientDrawable(); var strokeWidthDips = editorStrokeWidth ? editorStrokeWidth : 2; var strokeWidth = strokeWidthDips * utilsModule.layout.getDisplayDensity(); var strokeColor = editorStrokeColor ? RadDataForm._makeAndroidColor(editorStrokeColor) : android.graphics.Color.BLACK; var fillColor = editorFillColor ? RadDataForm._makeAndroidColor(editorFillColor) : android.graphics.Color.TRANSPARENT; drawable.setStroke(strokeWidth, strokeColor); drawable.setColor(fillColor); editor.android.rootLayout().setBackgroundDrawable(drawable); }; PropertyEditorHelper._updateLabelHidden = function (editor, labelHidden) { if (!editor.android || labelHidden === undefined) { return; } var visibility = labelHidden ? android.view.View.GONE : android.view.View.VISIBLE; editor.android.getHeaderView().setVisibility(visibility); }; PropertyEditorHelper._updateLabelPosition = function (editor, labelPosition) { if (!editor.android || labelPosition === undefined) { return; } var nativeLabelPosition = labelPosition == commonModule.DataFormLabelPosition.Left ? com.telerik.widget.dataform.engine.LabelPosition.LEFT : com.telerik.widget.dataform.engine.LabelPosition.TOP; editor.android.setLabelPosition(nativeLabelPosition); }; PropertyEditorHelper._updateLabelWidth = function (editor, labelWidth) { if (!editor.android || labelWidth === undefined) { return; } var nativeLabelWidth = labelWidth * utilsModule.layout.getDisplayDensity(); editor.android.setLabelWidth(nativeLabelWidth); }; PropertyEditorHelper.applyParams = function (editor) { var editorParams = editor.params; if (!editorParams) { return; } editor._editorParams = new java.util.HashMap(); if (editorParams.minimum) { var min = new java.lang.Float(editorParams.minimum); editor._editorParams.put("minimum", min); } if (editorParams.maximum) { var max = new java.lang.Float(editorParams.maximum); editor._editorParams.put("maximum", max); } if (editorParams.step) { var step = new java.lang.Float(editorParams.step); editor._editorParams.put("step", step); } if (editor.android) { editor.android.applyParams(editor.editorParams); } }; PropertyEditorHelper.applyStyle = function (editor) { if (!editor.propertyEditorStyle) { return; } PropertyEditorHelper._updateLabelTextColor(editor, editor.propertyEditorStyle.labelTextColor); PropertyEditorHelper._updateLabelFont(editor, editor.propertyEditorStyle.labelFontName, editor.propertyEditorStyle.labelFontStyle); PropertyEditorHelper._updateLabelTextSize(editor, editor.propertyEditorStyle.labelTextSize); PropertyEditorHelper._updateLabelHorizontalOffset(editor, editor.propertyEditorStyle.labelHorizontalOffset); PropertyEditorHelper._updateLabelVerticalOffset(editor, editor.propertyEditorStyle.labelVerticalOffset); PropertyEditorHelper._updateEditorHorizontalOffset(editor, editor.propertyEditorStyle.editorHorizontalOffset); PropertyEditorHelper._updateEditorVerticalOffset(editor, editor.propertyEditorStyle.editorVerticalOffset); PropertyEditorHelper._updateEditorFillColor(editor, editor.propertyEditorStyle.fillColor); PropertyEditorHelper._updateEditorStroke(editor, editor.propertyEditorStyle.strokeColor, editor.propertyEditorStyle.strokeWidth, editor.propertyEditorStyle.fillColor); PropertyEditorHelper._updateLabelHidden(editor, editor.propertyEditorStyle.labelHidden); PropertyEditorHelper._updateLabelPosition(editor, editor.propertyEditorStyle.labelPosition); PropertyEditorHelper._updateLabelWidth(editor, editor.propertyEditorStyle.labelWidth); }; PropertyEditorHelper.applyStyleForProperty = function (editor, propertyName) { if (!editor.propertyEditorStyle) { return; } switch (propertyName) { case "labelTextColor": PropertyEditorHelper._updateLabelTextColor(editor, editor.propertyEditorStyle.labelTextColor); break; case "labelFontName": case "labelFontStyle": PropertyEditorHelper._updateLabelFont(editor, editor.propertyEditorStyle.labelFontName, editor.propertyEditorStyle.labelFontStyle); break; case "labelTextSize": PropertyEditorHelper._updateLabelTextSize(editor, editor.propertyEditorStyle.labelTextSize); break; case "labelHorizontalOffset": PropertyEditorHelper._updateLabelHorizontalOffset(editor, editor.propertyEditorStyle.labelHorizontalOffset); break; case "labelVerticalOffset": PropertyEditorHelper._updateLabelVerticalOffset(editor, editor.propertyEditorStyle.labelVerticalOffset); break; case "editorHorizontalOffset": PropertyEditorHelper._updateEditorHorizontalOffset(editor, editor.propertyEditorStyle.editorHorizontalOffset); break; case "editorVerticalOffset": PropertyEditorHelper._updateEditorVerticalOffset(editor, editor.propertyEditorStyle.editorVerticalOffset); break; case "fillColor": PropertyEditorHelper._updateEditorFillColor(editor, editor.propertyEditorStyle.fillColor); PropertyEditorHelper._updateEditorStroke(editor, editor.propertyEditorStyle.strokeColor, editor.propertyEditorStyle.strokeWidth, editor.propertyEditorStyle.fillColor); break; case "strokeColor": case "strokeWidth": PropertyEditorHelper._updateEditorStroke(editor, editor.propertyEditorStyle.strokeColor, editor.propertyEditorStyle.strokeWidth, editor.propertyEditorStyle.fillColor); break; case "labelHidden": PropertyEditorHelper._updateLabelHidden(editor, editor.propertyEditorStyle.labelHidden); break; case "labelPosition": PropertyEditorHelper._updateLabelPosition(editor, editor.propertyEditorStyle.labelPosition); case "labelWidth": PropertyEditorHelper._updateLabelWidth(editor, editor.propertyEditorStyle.labelWidth); break; } }; PropertyEditorHelper.isReadOnly = function (editor) { if (editor instanceof CustomPropertyEditor) { return editor._readOnly; } return editor._readOnly; }; PropertyEditorHelper.setReadOnly = function (editor, value) { if (editor instanceof CustomPropertyEditor) { editor._readOnly = value; } editor._readOnly = value; }; return PropertyEditorHelper; }()); exports.PropertyEditorHelper = PropertyEditorHelper; ////////////////////////////////////////////////////////////////////////////////////////////// // Validators var PropertyValidator = (function (_super) { __extends(PropertyValidator, _super); function PropertyValidator() { var _this = _super.call(this) || this; _this._android = new com.telerik.widget.dataform.engine.PropertyValidatorManual(); var that = new WeakRef(_this); _this._android.setValidationProvider(new com.telerik.widget.dataform.engine.PropertyValidatorManual.ValidationProvider({ validate: function (value, propertyName) { return that.get().validate(value, propertyName); } })); if (_this.errorMessage == undefined) { _this.errorMessage = "This is not valid."; } return _this; } Object.defineProperty(PropertyValidator.prototype, "android", { get: function () { return this._android; }, enumerable: true, configurable: true }); PropertyValidator.prototype.validate = function (value, propertyName) { return true; }; return PropertyValidator; }(commonModule.PropertyValidator)); exports.PropertyValidator = PropertyValidator; var MinimumLengthValidator = (function (_super) { __extends(MinimumLengthValidator, _super); function MinimumLengthValidator() { var _this = _super.call(this) || this; _this._android = new com.telerik.widget.dataform.engine.MinimumLengthValidator(); return _this; } Object.defineProperty(MinimumLengthValidator.prototype, "android", { get: function () { return this._android; }, enumerable: true, configurable: true }); MinimumLengthValidator.prototype.onLengthChanged = function (oldValue, newValue) { if (!isNaN(+newValue)) { this.android.setMinimumLength(newValue); } }; return MinimumLengthValidator; }(commonModule.MinimumLengthValidator)); exports.MinimumLengthValidator = MinimumLengthValidator; var MaximumLengthValidator = (function (_super) { __extends(MaximumLengthValidator, _super); function MaximumLengthValidator() { var _this = _super.call(this) || this; _this._android = new com.telerik.widget.dataform.engine.MaximumLengthValidator(); return _this; } Object.defineProperty(MaximumLengthValidator.prototype, "android", { get: function () { return this._android; }, enumerable: true, configurable: true }); MaximumLengthValidator.prototype.onLengthChanged = function (oldValue, newValue) { if (!isNaN(+newValue)) { this.android.setMaximumLength(newValue); } }; return MaximumLengthValidator; }(commonModule.MaximumLengthValidator)); exports.MaximumLengthValidator = MaximumLengthValidator; var EmailValidator = (function (_super) { __extends(EmailValidator, _super); function EmailValidator() { var _this = _super.call(this) || this; _this._android = new com.telerik.widget.dataform.engine.MailValidator(); return _this; } Object.defineProperty(EmailValidator.prototype, "android", { get: function () { return this._android; }, enumerable: true, configurable: true }); return EmailValidator; }(commonModule.EmailValidator)); exports.EmailValidator = EmailValidator; var NonEmptyValidator = (function (_super) { __extends(NonEmptyValidator, _super); function NonEmptyValidator() { var _this = _super.call(this) || this; _this._android = new com.telerik.widget.dataform.engine.NonEmptyValidator(); return _this; } Object.defineProperty(NonEmptyValidator.prototype, "android", { get: function () { return this._android; }, enumerable: true, configurable: true }); return NonEmptyValidator; }(commonModule.NonEmptyValidator)); exports.NonEmptyValidator = NonEmptyValidator; var RangeValidator = (function (_super) { __extends(RangeValidator, _super); function RangeValidator() { var _this = _super.call(this) || this; _this._android = new com.telerik.widget.dataform.engine.RangeValidator(); return _this; } Object.defineProperty(RangeValidator.prototype, "android", { get: function () { return this._android; }, enumerable: true, configurable: true }); RangeValidator.prototype.onMinimumChanged = function (oldValue, newValue) { if (!isNaN(+newValue)) { this._android.setMin(newValue); } }; RangeValidator.prototype.onMaximumChanged = function (oldValue, newValue) { if (!isNaN(+newValue)) { this._android.setMax(newValue); } }; return RangeValidator; }(commonModule.RangeValidator)); exports.RangeValidator = RangeValidator; var PhoneValidator = (function (_super) { __extends(PhoneValidator, _super); function PhoneValidator() { var _this = _super.call(this) || this; _this._android = new com.telerik.widget.dataform.engine.PhoneValidator(); return _this; } Object.defineProperty(PhoneValidator.prototype, "android", { get: function () { return this._android; }, enumerable: true, configurable: true }); return PhoneValidator; }(commonModule.PhoneValidator)); exports.PhoneValidator = PhoneValidator; var RegExValidator = (function (_super) { __extends(RegExValidator, _super); function RegExValidator() { var _this = _super.call(this) || this; _this._android = new com.telerik.widget.dataform.engine.RegExValidator(); return _this; } Object.defineProperty(RegExValidator.prototype, "android", { get: function () { return this._android; }, enumerable: true, configurable: true }); RegExValidator.prototype.onRegExChanged = function (oldValue, newValue) { this._android.setRegEx(newValue); }; return RegExValidator; }(commonModule.RegExValidator)); exports.RegExValidator = RegExValidator; var IsTrueValidator = (function (_super) { __extends(IsTrueValidator, _super); function IsTrueValidator() { var _this = _super.call(this) || this; _this._android = new com.telerik.widget.dataform.engine.IsTrueValidator(); return _this; } Object.defineProperty(IsTrueValidator.prototype, "android", { get: function () { return this._android; }, enumerable: true, configurable: true }); return IsTrueValidator; }(commonModule.IsTrueValidator)); exports.IsTrueValidator = IsTrueValidator; var StringToDateConverter = (function (_super) { __extends(StringToDateConverter, _super); function StringToDateConverter() { var _this = _super.call(this) || this; _this._android = new com.telerik.widget.dataform.engine.StringToDateConverter(); return _this; } Object.defineProperty(StringToDateConverter.prototype, "android", { get: function () { return this._android; }, enumerable: true, configurable: true }); return StringToDateConverter; }(commonModule.StringToDateConverter)); exports.StringToDateConverter = StringToDateConverter; var StringToTimeConverter = (function (_super) { __extends(StringToTimeConverter, _super); function StringToTimeConverter() { var _this = _super.call(this) || this; _this._android = new com.telerik.widget.dataform.engine.StringToTimeConverter(); return _this; } Object.defineProperty(StringToTimeConverter.prototype, "android", { get: function () { return this._android; }, enumerable: true, configurable: true }); return StringToTimeConverter; }(commonModule.StringToTimeConverter)); exports.StringToTimeConverter = StringToTimeConverter;
/* This file is a part of Mibew Messenger. http://mibew.org Copyright (c) 2005-2015 Mibew Messenger Community License: http://mibew.org/license.php */ Ajax.PeriodicalUpdater=Class.create(); Class.inherit(Ajax.PeriodicalUpdater,Ajax.Base,{initialize:function(a){this.setOptions(a);this._options.onComplete=this.requestComplete.bind(this);this._options.onException=this.handleException.bind(this);this._options.onTimeout=this.handleTimeout.bind(this);this._options.timeout=5E3;this.frequency=this._options.frequency||2;this.updater={};this.update()},handleException:function(a,b){this._options.handleError&&this._options.handleError("offline, reconnecting");this.stopUpdate();this.timer=setTimeout(this.update.bind(this), 1E3)},handleTimeout:function(a){this._options.handleError&&this._options.handleError("timeout, reconnecting");this.stopUpdate();this.timer=setTimeout(this.update.bind(this),1E3)},stopUpdate:function(){this.updater._options&&(this.updater._options.onComplete=void 0);clearTimeout(this.timer)},update:function(){this._options.updateParams&&(this._options.parameters=this._options.updateParams());this.updater=new Ajax.Request(this._options.url,this._options)},requestComplete:function(a){try{var b=Ajax.getXml(a); b?(this._options.updateContent||Ajax.emptyFunction)(b):this._options.handleError&&this._options.handleError("reconnecting")}catch(c){}this.timer=setTimeout(this.update.bind(this),1E3*this.frequency)}}); var HtmlGenerationUtils={popupLink:function(a,b,c,d,e,m,l){return'<a href="'+a+'"'+(null!=l?' class="'+l+'"':"")+' target="_blank" title="'+b+'" onclick="this.newWindow = window.open(\''+a+"', '"+c+"', 'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width="+e+",height="+m+",resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;\">"+d+"</a>"},generateOneRowTable:function(a){return'<table class="inner"><tr>'+a+"</tr></table>"},viewOpenCell:function(a,b,c,d,e,m,l,p){m= 2;b=b+"?thread="+c;var f="<td>",f=e||d?f+HtmlGenerationUtils.popupLink(p||!d?b:b+"&viewonly=true",localized[e?0:1],"ImCenter"+c,a,640,480,null):f+('<a href="#">'+a+"</a>"),f=f+"</td>";e&&(f=f+'<td class="icon">'+HtmlGenerationUtils.popupLink(b,localized[0],"ImCenter"+c,'<img src="'+mibewRoot+'/images/tbliclspeak.gif" width="15" height="15" border="0" alt="'+localized[0]+'">',640,480,null),f+="</td>",m++);d&&(f+='<td class="icon">',f+=HtmlGenerationUtils.popupLink(b+"&viewonly=true",localized[1],"ImCenter"+ c,'<img src="'+mibewRoot+'/images/tbliclread.gif" width="15" height="15" border="0" alt="'+localized[1]+'">',640,480,null),f+="</td>",m++);""!=l&&(f+='</tr><tr><td class="firstmessage" colspan="'+m+'"><a href="javascript:void(0)" title="'+l+'" onclick="alert(this.title);return false;">',f+=30<l.length?l.substring(0,30)+"...":l,f+="</a></td>");return HtmlGenerationUtils.generateOneRowTable(f)},banCell:function(a,b){return'<td class="icon">'+HtmlGenerationUtils.popupLink(mibewRoot+"/operator/ban.php?"+ (b?"id="+b:"thread="+a),localized[2],"ban"+a,'<img src="'+mibewRoot+'/images/ban.gif" width="15" height="15" border="0" alt="'+localized[2]+'">',720,480,null)+"</td>"}};Ajax.ThreadListUpdater=Class.create(); Class.inherit(Ajax.ThreadListUpdater,Ajax.Base,{initialize:function(a){this.setOptions(a);this._options.updateParams=this.updateParams.bind(this);this._options.handleError=this.handleError.bind(this);this._options.updateContent=this.updateContent.bind(this);this._options.lastrevision=0;this.threadTimers={};this.delta=0;this.t=this._options.table;this.periodicalUpdater=new Ajax.PeriodicalUpdater(this._options)},updateParams:function(){return"since="+this._options.lastrevision+"&status="+this._options.istatus+ (this._options.showonline?"&showonline=1":"")},setStatus:function(a){this._options.status.innerHTML=a},handleError:function(a){this.setStatus(a)},updateThread:function(a){function b(a,b,c,d){if(a=CommonUtils.getCell(c,b,a))a.innerHTML=d}for(var c,d,e,m=!1,l=!1,p=!1,f=null,q=null,g=0;g<a.attributes.length;g++){var n=a.attributes[g];"id"==n.nodeName?c=n.nodeValue:"stateid"==n.nodeName?d=n.nodeValue:"state"==n.nodeName?e=n.nodeValue:"canopen"==n.nodeName?l=!0:"canview"==n.nodeName?m=!0:"canban"==n.nodeName? p=!0:"ban"==n.nodeName?f=n.nodeValue:"banid"==n.nodeName&&(q=n.nodeValue)}g=CommonUtils.getRow("thr"+c,this.t);if("closed"==d)g&&this.t.deleteRow(g.rowIndex),this.threadTimers[c]=null;else{var n=NodeUtils.getNodeValue(a,"name"),u=NodeUtils.getNodeValue(a,"addr"),s=NodeUtils.getNodeValue(a,"time"),v=NodeUtils.getNodeValue(a,"agent"),t=NodeUtils.getNodeValue(a,"modified"),w=NodeUtils.getNodeValue(a,"message"),r="<td>"+NodeUtils.getNodeValue(a,"useragent")+"</td>";null!=f&&(r="<td>"+NodeUtils.getNodeValue(a, "reason")+"</td>");p&&(r+=HtmlGenerationUtils.banCell(c,q));r=HtmlGenerationUtils.generateOneRowTable(r);a=CommonUtils.getRow("t"+d,this.t);p=CommonUtils.getRow("t"+d+"end",this.t);null!=g&&(g.rowIndex<=a.rowIndex||g.rowIndex>=p.rowIndex)&&(this.t.deleteRow(g.rowIndex),g=this.threadTimers[c]=null);if(null==g){if(g=this.t.insertRow(a.rowIndex+1),g.className="blocked"==f&&"chat"!=d?"ban":"in"+d,g.id="thr"+c,this.threadTimers[c]=[s,t,d],CommonUtils.insertCell(g,"name","visitor",null,null,HtmlGenerationUtils.viewOpenCell(n, this._options.agentservl,c,m,l,f,w,"chat"!=d)),CommonUtils.insertCell(g,"contid","visitor","center",null,u),CommonUtils.insertCell(g,"state","visitor","center",null,e),CommonUtils.insertCell(g,"op","visitor","center",null,v),CommonUtils.insertCell(g,"time","visitor","center",null,this.getTimeSince(s)),CommonUtils.insertCell(g,"wait","visitor","center",null,"chat"!=d?this.getTimeSince(t):"-"),CommonUtils.insertCell(g,"etc","visitor","center",null,r),"wait"==d||"prio"==d)return!0}else this.threadTimers[c]= [s,t,d],g.className="blocked"==f&&"chat"!=d?"ban":"in"+d,b(this.t,g,"name",HtmlGenerationUtils.viewOpenCell(n,this._options.agentservl,c,m,l,f,w,"chat"!=d)),b(this.t,g,"contid",u),b(this.t,g,"state",e),b(this.t,g,"op",v),b(this.t,g,"time",this.getTimeSince(s)),b(this.t,g,"wait","chat"!=d?this.getTimeSince(t):"-"),b(this.t,g,"etc",r);return!1}},updateQueueMessages:function(){function a(a,b){var c=$(b),l=$(b+"end");return null==c||null==l?!1:c.rowIndex+1<l.rowIndex}var b=$("statustd");if(b){var c=a(this.t, "twait")||a(this.t,"tprio")||a(this.t,"tchat");b.innerHTML=c?"":this._options.noclients;b.height=c?5:30}},getTimeSince:function(a){a=Math.floor(((new Date).getTime()-a-this.delta)/1E3);var b=Math.floor(a/60),c="";a%=60;10>a&&(a="0"+a);60<=b&&(c=Math.floor(b/60),b%=60,10>b&&(b="0"+b),c+=":");return c+b+":"+a},updateTimers:function(){for(var a in this.threadTimers)if(null!=this.threadTimers[a]){var b=this.threadTimers[a],c=CommonUtils.getRow("thr"+a,this.t);if(null!=c){var d=this.getTimeSince(b[0]), e=CommonUtils.getCell("time",c,this.t);e&&(e.innerHTML=d);b="chat"!=b[2]?this.getTimeSince(b[1]):"-";if(c=CommonUtils.getCell("wait",c,this.t))c.innerHTML=b}}},updateThreads:function(a){var b=!1,c=NodeUtils.getAttrValue(a,"time"),d=NodeUtils.getAttrValue(a,"revision");c&&(this.delta=(new Date).getTime()-c);d&&(this._options.lastrevision=d);for(c=0;c<a.childNodes.length;c++)d=a.childNodes[c],"thread"==d.tagName&&this.updateThread(d)&&(b=!0);this.updateQueueMessages();this.updateTimers();this.setStatus(this._options.istatus? "Away":"Up to date");b&&(playSound(mibewRoot+"/sounds/new_user.wav"),window.focus(),updaterOptions.showpopup&&alert(localized[5]))},updateOperators:function(a){var b=$("onlineoperators");if(b){for(var c=[],d=0;d<a.childNodes.length;d++){var e=a.childNodes[d];if("operator"==e.tagName){var m=NodeUtils.getAttrValue(e,"name"),e=null!=NodeUtils.getAttrValue(e,"away");c[c.length]='<img src="'+mibewRoot+"/images/op"+(e?"away":"online")+'.gif" width="12" height="12" border="0" alt="'+localized[1]+'"> '+m}}b.innerHTML= c.join(", ")}},updateContent:function(a){if("update"==a.tagName)for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];"threads"==c.tagName?this.updateThreads(c):"operators"==c.tagName&&this.updateOperators(c)}else"error"==a.tagName?this.setStatus(NodeUtils.getNodeValue(a,"descr")):this.setStatus("reconnecting")}}); function togglemenu(){$("sidebar")&&$("wcontent")&&$("togglemenu")&&("contentnomenu"==$("wcontent").className?($("sidebar").style.display="block",$("wcontent").className="contentinner",$("togglemenu").innerHTML=localized[4]):($("sidebar").style.display="none",$("wcontent").className="contentnomenu",$("togglemenu").innerHTML=localized[3]))}var mibewRoot="";Behaviour.register({"#togglemenu":function(a){a.onclick=function(){togglemenu()}}}); EventHelper.register(window,"onload",function(){mibewRoot=updaterOptions.wroot;new Ajax.ThreadListUpdater({table:$("threadlist"),status:$("connstatus"),istatus:0}.extend(updaterOptions||{}));updaterOptions.havemenu||togglemenu()});
// @flow import React, { Component } from 'react'; type Props = { children: React.Element<any>, }; class App extends Component { props: Props render() { const { children } = this.props; return ( <div> {React.Children.toArray(children)} </div> ); } } export default App;
import Vue from 'vue'; // ไฝฟ็”จ Event Bus export function test() { reutrn "bus" } const bus = new Vue(); export default bus;
import React, { Component } from 'react'; import { Mutation } from 'react-apollo'; import gql from 'graphql-tag'; import Form from './styles/Form'; import Error from './ErrorMessage'; const REQUEST_RESET_MUTATION = gql` mutation REQUEST_RESET_MUTATION($email: String!) { requestReset(email: $email) { message } } `; class RequestReset extends Component { state = { email: '', }; saveToState = e => { this.setState({ [e.target.name]: e.target.value }); }; render() { return ( <Mutation mutation={REQUEST_RESET_MUTATION} variables={this.state}> {(reset, { error, loading, called }) => ( <Form method="post" data-test="form" onSubmit={async e => { e.preventDefault(); await reset(); this.setState({ email: '' }); }} > <fieldset disabled={loading} aria-busy={loading}> <h2>Request a password reset</h2> <Error error={error} /> {!error && !loading && called && <p>Success! Check your email for a reset link!</p>} <label htmlFor="email"> Email <input type="email" name="email" placeholder="email" value={this.state.email} onChange={this.saveToState} /> </label> <button type="submit">Request Reset!</button> </fieldset> </Form> )} </Mutation> ); } } export default RequestReset; export { REQUEST_RESET_MUTATION };
'use strict'; // Load modules const Code = require('@hapi/code'); const _Lab = require('../../test_runner'); // Declare internals const internals = {}; // Test shortcuts const lab = exports.lab = _Lab.script(); const describe = lab.describe; const it = lab.it; const expect = Code.expect; describe('Test CLI', () => { it('handles return rejection', () => { return Promise.reject(new Error('fail')); }); it('handles return rejection in next tick', () => { return new Promise(() => { setImmediate(() => { Promise.reject(new Error('rejection')); }); }); }); it('handles throw in next tick', () => { return new Promise(() => { setImmediate(() => { throw new Error('throw'); }); }); }); it('passes rejection to flags.onUnhandledRejection handler', (flags) => { return new Promise((resolve) => { flags.onUnhandledRejection = (err) => { expect(err).to.be.an.error('rejection'); resolve(); }; setImmediate(() => { Promise.reject(new Error('rejection')); }); }); }); it('handles an error inside flags.onUnhandledRejection handler', (flags) => { return new Promise(() => { flags.onUnhandledRejection = () => { throw new Error('incorrectly implemented error handling or a failed assertion'); }; setImmediate(() => { Promise.reject(new Error('rejection')); }); }); }); it('passes asynchronously thrown exception into flags.onUncaughtException handler', (flags) => { return new Promise((resolve) => { flags.onUncaughtException = (err) => { expect(err).to.be.an.error('throw'); resolve(); }; setImmediate(() => { throw new Error('throw'); }); }); }); it('handles an error inside flags.onUncaughtException handler', (flags) => { return new Promise(() => { flags.onUncaughtException = () => { throw new Error('incorrectly implemented error handling or a failed assertion'); }; setImmediate(() => { throw new Error('throw'); }); }); }); });
import os from pathlib import Path import shutil dirs = ["five", "four", "one", "six", "three", "two"] # So bad, but whatever... for dir in dirs: file_list = Path(os.path.join(dir)).glob("*.jpg") for file in file_list: file_name = os.path.basename(file) for other_dir in dirs: if other_dir != dir: other_file_list = Path(os.path.join(other_dir)).glob("*.jpg") for other_file in other_file_list: other_file_name = os.path.basename(other_file) if other_file_name == file_name and dir < other_dir: print("Duplicate files: {} and {}".format(file, other_file))
import test from 'tape-catch'; import {ViewportFlyToInterpolator} from 'react-map-gl/utils/transition'; import {toLowPrecision} from 'react-map-gl/test/test-utils'; /* eslint-disable max-len */ const TEST_CASES = [ { title: 'throw for missing prop', startProps: {longitude: -122.45, latitude: 37.78, zoom: 12}, endProps: {longitude: -74, latitude: 40.7, zoom: 11}, shouldThrow: true }, { title: 'optional prop fallback', startProps: {width: 800, height: 600, longitude: -122.45, latitude: 37.78, zoom: 12}, endProps: {width: 800, height: 600, longitude: -74, latitude: 40.7, zoom: 11}, expect: { start: {width: 800, height: 600, longitude: -122.45, latitude: 37.78, zoom: 12, pitch: 0, bearing: 0}, end: {width: 800, height: 600, longitude: -74, latitude: 40.7, zoom: 11, pitch: 0, bearing: 0} }, transition: { 0.25: {bearing: 0, pitch: 0, longitude: -122.4017, latitude: 37.78297, zoom: 7.518116}, 0.5: {bearing: 0, pitch: 0, longitude: -106.3, latitude: 38.76683, zoom: 3.618313}, 0.75: {bearing: 0, pitch: 0, longitude: -74.19253, latitude: 40.68864, zoom: 6.522422} } }, { title: 'find shortest path', startProps: {width: 800, height: 600, longitude: -122.45, latitude: 37.78, zoom: 12, pitch: 0, bearing: -120}, endProps: {width: 800, height: 600, longitude: 179, latitude: 40.7, zoom: 11, bearing: 120}, expect: { start: {width: 800, height: 600, longitude: -122.45, latitude: 37.78, zoom: 12, pitch: 0, bearing: -120}, end: {width: 800, height: 600, longitude: -181, latitude: 40.7, zoom: 11, pitch: 0, bearing: -240} }, transition: { 0.25: {bearing: -150, pitch: 0, longitude: -122.4983, latitude: 37.78246, zoom: 7.38197}, 0.5: {bearing: -180, pitch: 0, longitude: -141.9667, latitude: 38.76683, zoom: 3.346515}, 0.75: {bearing: -210, pitch: 0, longitude: -180.8071, latitude: 40.69058, zoom: 6.38554} } } ]; /* eslint-enable max-len */ test('LinearInterpolator#initializeProps', t => { const interpolator = new ViewportFlyToInterpolator(); TEST_CASES.forEach(testCase => { const getResult = () => interpolator.initializeProps(testCase.startProps, testCase.endProps); if (testCase.shouldThrow) { t.throws(getResult, testCase.title); } else { t.deepEqual(getResult(), testCase.expect, testCase.title); } }); t.end(); }); test('LinearInterpolator#interpolateProps', t => { const interpolator = new ViewportFlyToInterpolator(); TEST_CASES .filter(testCase => testCase.transition) .forEach(testCase => { Object.keys(testCase.transition).forEach(time => { const propsInTransition = interpolator.interpolateProps( testCase.expect.start, testCase.expect.end, Number(time)); t.deepEqual(toLowPrecision(propsInTransition, 7), testCase.transition[time], time); }); }); t.end(); });
module("data", { teardown: moduleTeardown }); test("expando", function(){ expect(1); equal(jQuery.expando !== undefined, true, "jQuery is exposing the expando"); }); function dataTests( elem ) { var dataObj, internalDataObj; equal( jQuery.data(elem, "foo"), undefined, "No data exists initially" ); strictEqual( jQuery.hasData(elem), false, "jQuery.hasData agrees no data exists initially" ); dataObj = jQuery.data(elem); equal( typeof dataObj, "object", "Calling data with no args gives us a data object reference" ); strictEqual( jQuery.data(elem), dataObj, "Calling jQuery.data returns the same data object when called multiple times" ); strictEqual( jQuery.hasData(elem), false, "jQuery.hasData agrees no data exists even when an empty data obj exists" ); dataObj["foo"] = "bar"; equal( jQuery.data(elem, "foo"), "bar", "Data is readable by jQuery.data when set directly on a returned data object" ); strictEqual( jQuery.hasData(elem), true, "jQuery.hasData agrees data exists when data exists" ); jQuery.data(elem, "foo", "baz"); equal( jQuery.data(elem, "foo"), "baz", "Data can be changed by jQuery.data" ); equal( dataObj["foo"], "baz", "Changes made through jQuery.data propagate to referenced data object" ); jQuery.data(elem, "foo", undefined); equal( jQuery.data(elem, "foo"), "baz", "Data is not unset by passing undefined to jQuery.data" ); jQuery.data(elem, "foo", null); strictEqual( jQuery.data(elem, "foo"), null, "Setting null using jQuery.data works OK" ); jQuery.data(elem, "foo", "foo1"); jQuery.data(elem, { "bar" : "baz", "boom" : "bloz" }); strictEqual( jQuery.data(elem, "foo"), "foo1", "Passing an object extends the data object instead of replacing it" ); equal( jQuery.data(elem, "boom"), "bloz", "Extending the data object works" ); jQuery._data(elem, "foo", "foo2", true); equal( jQuery._data(elem, "foo"), "foo2", "Setting internal data works" ); equal( jQuery.data(elem, "foo"), "foo1", "Setting internal data does not override user data" ); internalDataObj = jQuery._data( elem ); ok( internalDataObj, "Internal data object exists" ); notStrictEqual( dataObj, internalDataObj, "Internal data object is not the same as user data object" ); strictEqual( elem.boom, undefined, "Data is never stored directly on the object" ); jQuery.removeData(elem, "foo"); strictEqual( jQuery.data(elem, "foo"), undefined, "jQuery.removeData removes single properties" ); jQuery.removeData(elem); strictEqual( jQuery._data(elem), internalDataObj, "jQuery.removeData does not remove internal data if it exists" ); jQuery.data(elem, "foo", "foo1"); jQuery._data(elem, "foo", "foo2"); equal( jQuery.data(elem, "foo"), "foo1", "(sanity check) Ensure data is set in user data object" ); equal( jQuery._data(elem, "foo"), "foo2", "(sanity check) Ensure data is set in internal data object" ); strictEqual( jQuery._data(elem, jQuery.expando), undefined, "Removing the last item in internal data destroys the internal data object" ); jQuery._data(elem, "foo", "foo2"); equal( jQuery._data(elem, "foo"), "foo2", "(sanity check) Ensure data is set in internal data object" ); jQuery.removeData(elem, "foo"); equal( jQuery._data(elem, "foo"), "foo2", "(sanity check) jQuery.removeData for user data does not remove internal data" ); } test("jQuery.data(div)", 25, function() { var div = document.createElement("div"); dataTests( div ); // We stored one key in the private data // assert that nothing else was put in there, and that that // one stayed there. QUnit.expectJqData( div, "foo" ); }); test("jQuery.data({})", 25, function() { dataTests( {} ); }); test("jQuery.data(window)", 25, function() { // remove bound handlers from window object to stop potential false positives caused by fix for #5280 in // transports/xhr.js jQuery( windowย ).off( "unload" ); dataTests( window ); }); test("jQuery.data(document)", 25, function() { dataTests( document ); QUnit.expectJqData( document, "foo" ); }); test("Expando cleanup", 4, function() { var expected, actual, div = document.createElement("div"); function assertExpandoAbsent(message) { if (jQuery.support.deleteExpando) { expected = false; actual = jQuery.expando in div; } else { expected = null; actual = div[ jQuery.expando ]; } equal( actual, expected, message ); } assertExpandoAbsent("There is no expando on new elements"); jQuery.data(div, "foo", 100); jQuery.data(div, "bar", 200); ok(jQuery.expando in div, "There is an expando on the element after using $.data()"); jQuery.removeData(div, "foo"); ok(jQuery.expando in div, "There is still an expando on the element after removing (some) of the data"); jQuery.removeData(div, "bar"); assertExpandoAbsent("Removing the last item in the data store deletes the expando"); // Clean up unattached element jQuery(div).remove(); }); test("Data is not being set on comment and text nodes", function() { expect(2); ok( !jQuery.hasData( jQuery("<!-- comment -->").data("foo", 0) ) ); ok( !jQuery.hasData( jQuery("<span>text</span>").contents().data("foo", 0) ) ); }); test("jQuery.acceptData", function() { expect( 10 ); var flash, pdf; ok( jQuery.acceptData( document ), "document" ); ok( jQuery.acceptData( document.documentElement ), "documentElement" ); ok( jQuery.acceptData( {} ), "object" ); ok( !jQuery.acceptData( document.createElement( "embed" ) ), "embed" ); flash = document.createElement( "object" ); flash.setAttribute( "classid", "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ); ok( jQuery.acceptData( flash ), "flash" ); pdf = document.createElement( "object" ); pdf.setAttribute( "classid", "clsid:CA8A9780-280D-11CF-A24D-444553540000" ); ok( !jQuery.acceptData( pdf ), "pdf" ); ok( !jQuery.acceptData( document.createComment( "" ) ), "comment" ); ok( !jQuery.acceptData( document.createTextNode( "" ) ), "text" ); ok( !jQuery.acceptData( document.createDocumentFragment() ), "documentFragment" ); ok( jQuery.acceptData( jQuery( "#form" ).append( "<input id='nodeType'/><input id='nodeName'/>" )[ 0 ] ), "form with aliased DOM properties" ); }); // attempting to access the data of an undefined jQuery element should be undefined test("jQuery().data() === undefined (#14101)", 2, function() { strictEqual(jQuery().data(), undefined); strictEqual(jQuery().data("key"), undefined); }); test(".data()", function() { expect(5); var div, dataObj, nodiv, obj; div = jQuery("#foo"); strictEqual( div.data("foo"), undefined, "Make sure that missing result is undefined" ); div.data("test", "success"); dataObj = div.data(); deepEqual( dataObj, {test: "success"}, "data() returns entire data object with expected properties" ); strictEqual( div.data("foo"), undefined, "Make sure that missing result is still undefined" ); nodiv = jQuery("#unfound"); equal( nodiv.data(), null, "data() on empty set returns null" ); obj = { foo: "bar" }; jQuery(obj).data("foo", "baz"); dataObj = jQuery.extend(true, {}, jQuery(obj).data()); deepEqual( dataObj, { "foo": "baz" }, "Retrieve data object from a wrapped JS object (#7524)" ); }); function testDataTypes( $obj ) { jQuery.each({ "null": null, "true": true, "false": false, "zero": 0, "one": 1, "empty string": "", "empty array": [], "array": [1], "empty object": {}, "object": { foo: "bar" }, "date": new Date(), "regex": /test/, "function": function() {} }, function( type, value ) { strictEqual( $obj.data( "test", value ).data("test"), value, "Data set to " + type ); }); } test("jQuery(Element).data(String, Object).data(String)", function() { expect( 18 ); var parent = jQuery("<div><div></div></div>"), div = parent.children(); strictEqual( div.data("test"), undefined, "No data exists initially" ); strictEqual( div.data("test", "success").data("test"), "success", "Data added" ); strictEqual( div.data("test", "overwritten").data("test"), "overwritten", "Data overwritten" ); strictEqual( div.data("test", undefined).data("test"), "overwritten", ".data(key,undefined) does nothing but is chainable (#5571)"); strictEqual( div.data("notexist"), undefined, "No data exists for unset key" ); testDataTypes( div ); parent.remove(); }); test("jQuery(plain Object).data(String, Object).data(String)", function() { expect( 16 ); // #3748 var $obj = jQuery({ exists: true }); strictEqual( $obj.data("nothing"), undefined, "Non-existent data returns undefined"); strictEqual( $obj.data("exists"), undefined, "Object properties are not returned as data" ); testDataTypes( $obj ); // Clean up $obj.removeData(); deepEqual( $obj[0], { exists: true }, "removeData does not clear the object" ); }); test("data-* attributes", function() { expect( 43 ); var prop, i, l, metadata, elem, obj, obj2, check, num, num2, parseJSON = jQuery.parseJSON, div = jQuery("<div>"), child = jQuery("<div data-myobj='old data' data-ignored=\"DOM\" data-other='test'></div>"), dummy = jQuery("<div data-myobj='old data' data-ignored=\"DOM\" data-other='test'></div>"); equal( div.data("attr"), undefined, "Check for non-existing data-attr attribute" ); div.attr("data-attr", "exists"); equal( div.data("attr"), "exists", "Check for existing data-attr attribute" ); div.attr("data-attr", "exists2"); equal( div.data("attr"), "exists", "Check that updates to data- don't update .data()" ); div.data("attr", "internal").attr("data-attr", "external"); equal( div.data("attr"), "internal", "Check for .data('attr') precedence (internal > external data-* attribute)" ); div.remove(); child.appendTo("#qunit-fixture"); equal( child.data("myobj"), "old data", "Value accessed from data-* attribute"); child.data("myobj", "replaced"); equal( child.data("myobj"), "replaced", "Original data overwritten"); child.data("ignored", "cache"); equal( child.data("ignored"), "cache", "Cached data used before DOM data-* fallback"); obj = child.data(); obj2 = dummy.data(); check = [ "myobj", "ignored", "other" ]; num = 0; num2 = 0; dummy.remove(); for ( i = 0, l = check.length; i < l; i++ ) { ok( obj[ check[i] ], "Make sure data- property exists when calling data-." ); ok( obj2[ check[i] ], "Make sure data- property exists when calling data-." ); } for ( prop in obj ) { num++; } equal( num, check.length, "Make sure that the right number of properties came through." ); for ( prop in obj2 ) { num2++; } equal( num2, check.length, "Make sure that the right number of properties came through." ); child.attr("data-other", "newvalue"); equal( child.data("other"), "test", "Make sure value was pulled in properly from a .data()." ); // attribute parsing i = 0; jQuery.parseJSON = function() { i++; return parseJSON.apply( this, arguments ); }; child .attr("data-true", "true") .attr("data-false", "false") .attr("data-five", "5") .attr("data-point", "5.5") .attr("data-pointe", "5.5E3") .attr("data-grande", "5.574E9") .attr("data-hexadecimal", "0x42") .attr("data-pointbad", "5..5") .attr("data-pointbad2", "-.") .attr("data-bigassnum", "123456789123456789123456789") .attr("data-badjson", "{123}") .attr("data-badjson2", "[abc]") .attr("data-notjson", " {}") .attr("data-notjson2", "[] ") .attr("data-empty", "") .attr("data-space", " ") .attr("data-null", "null") .attr("data-string", "test"); strictEqual( child.data("true"), true, "Primitive true read from attribute"); strictEqual( child.data("false"), false, "Primitive false read from attribute"); strictEqual( child.data("five"), 5, "Integer read from attribute"); strictEqual( child.data("point"), 5.5, "Floating-point number read from attribute"); strictEqual( child.data("pointe"), "5.5E3", "Exponential-notation number read from attribute as string"); strictEqual( child.data("grande"), "5.574E9", "Big exponential-notation number read from attribute as string"); strictEqual( child.data("hexadecimal"), "0x42", "Hexadecimal number read from attribute as string"); strictEqual( child.data("pointbad"), "5..5", "Extra-point non-number read from attribute as string"); strictEqual( child.data("pointbad2"), "-.", "No-digit non-number read from attribute as string"); strictEqual( child.data("bigassnum"), "123456789123456789123456789", "Bad bigass number read from attribute as string"); strictEqual( child.data("badjson"), "{123}", "Bad JSON object read from attribute as string"); strictEqual( child.data("badjson2"), "[abc]", "Bad JSON array read from attribute as string"); strictEqual( child.data("notjson"), " {}", "JSON object with leading non-JSON read from attribute as string"); strictEqual( child.data("notjson2"), "[] ", "JSON array with trailing non-JSON read from attribute as string"); strictEqual( child.data("empty"), "", "Empty string read from attribute"); strictEqual( child.data("space"), " ", "Whitespace string read from attribute"); strictEqual( child.data("null"), null, "Primitive null read from attribute"); strictEqual( child.data("string"), "test", "Typical string read from attribute"); equal( i, 2, "Correct number of JSON parse attempts when reading from attributes" ); jQuery.parseJSON = parseJSON; child.remove(); // tests from metadata plugin function testData(index, elem) { switch (index) { case 0: equal(jQuery(elem).data("foo"), "bar", "Check foo property"); equal(jQuery(elem).data("bar"), "baz", "Check baz property"); break; case 1: equal(jQuery(elem).data("test"), "bar", "Check test property"); equal(jQuery(elem).data("bar"), "baz", "Check bar property"); break; case 2: equal(jQuery(elem).data("zoooo"), "bar", "Check zoooo property"); deepEqual(jQuery(elem).data("bar"), {"test":"baz"}, "Check bar property"); break; case 3: equal(jQuery(elem).data("number"), true, "Check number property"); deepEqual(jQuery(elem).data("stuff"), [2,8], "Check stuff property"); break; default: ok(false, ["Assertion failed on index ", index, ", with data"].join("")); } } metadata = "<ol><li class='test test2' data-foo='bar' data-bar='baz' data-arr='[1,2]'>Some stuff</li><li class='test test2' data-test='bar' data-bar='baz'>Some stuff</li><li class='test test2' data-zoooo='bar' data-bar='{\"test\":\"baz\"}'>Some stuff</li><li class='test test2' data-number=true data-stuff='[2,8]'>Some stuff</li></ol>"; elem = jQuery(metadata).appendTo("#qunit-fixture"); elem.find("li").each(testData); elem.remove(); }); test(".data(Object)", function() { expect(4); var obj, jqobj, div = jQuery("<div/>"); div.data({ "test": "in", "test2": "in2" }); equal( div.data("test"), "in", "Verify setting an object in data" ); equal( div.data("test2"), "in2", "Verify setting an object in data" ); obj = {test:"unset"}; jqobj = jQuery(obj); jqobj.data("test", "unset"); jqobj.data({ "test": "in", "test2": "in2" }); equal( jQuery.data(obj)["test"], "in", "Verify setting an object on an object extends the data object" ); equal( obj["test2"], undefined, "Verify setting an object on an object does not extend the object" ); // manually clean up detached elements div.remove(); }); test("jQuery.removeData", function() { expect(10); var obj, div = jQuery("#foo")[0]; jQuery.data(div, "test", "testing"); jQuery.removeData(div, "test"); equal( jQuery.data(div, "test"), undefined, "Check removal of data" ); jQuery.data(div, "test2", "testing"); jQuery.removeData( div ); ok( !jQuery.data(div, "test2"), "Make sure that the data property no longer exists." ); ok( !div[ jQuery.expando ], "Make sure the expando no longer exists, as well." ); jQuery.data(div, { test3: "testing", test4: "testing" }); jQuery.removeData( div, "test3 test4" ); ok( !jQuery.data(div, "test3") || jQuery.data(div, "test4"), "Multiple delete with spaces." ); jQuery.data(div, { test3: "testing", test4: "testing" }); jQuery.removeData( div, [ "test3", "test4" ] ); ok( !jQuery.data(div, "test3") || jQuery.data(div, "test4"), "Multiple delete by array." ); jQuery.data(div, { "test3 test4": "testing", "test3": "testing" }); jQuery.removeData( div, "test3 test4" ); ok( !jQuery.data(div, "test3 test4"), "Multiple delete with spaces deleted key with exact name" ); ok( jQuery.data(div, "test3"), "Left the partial matched key alone" ); obj = {}; jQuery.data(obj, "test", "testing"); equal( jQuery(obj).data("test"), "testing", "verify data on plain object"); jQuery.removeData(obj, "test"); equal( jQuery.data(obj, "test"), undefined, "Check removal of data on plain object" ); jQuery.data( window, "BAD", true ); jQuery.removeData( window, "BAD" ); ok( !jQuery.data( window, "BAD" ), "Make sure that the value was not still set." ); }); test(".removeData()", function() { expect(6); var div = jQuery("#foo"); div.data("test", "testing"); div.removeData("test"); equal( div.data("test"), undefined, "Check removal of data" ); div.data("test", "testing"); div.data("test.foo", "testing2"); div.removeData("test.bar"); equal( div.data("test.foo"), "testing2", "Make sure data is intact" ); equal( div.data("test"), "testing", "Make sure data is intact" ); div.removeData("test"); equal( div.data("test.foo"), "testing2", "Make sure data is intact" ); equal( div.data("test"), undefined, "Make sure data is intact" ); div.removeData("test.foo"); equal( div.data("test.foo"), undefined, "Make sure data is intact" ); }); if (window.JSON && window.JSON.stringify) { test("JSON serialization (#8108)", function () { expect(1); var obj = { "foo": "bar" }; jQuery.data(obj, "hidden", true); equal( JSON.stringify(obj), "{\"foo\":\"bar\"}", "Expando is hidden from JSON.stringify" ); }); } test("jQuery.data should follow html5 specification regarding camel casing", function() { expect(10); var div = jQuery("<div id='myObject' data-w-t-f='ftw' data-big-a-little-a='bouncing-b' data-foo='a' data-foo-bar='b' data-foo-bar-baz='c'></div>") .prependTo("body"); equal( div.data()["wTF"], "ftw", "Verify single letter data-* key" ); equal( div.data()["bigALittleA"], "bouncing-b", "Verify single letter mixed data-* key" ); equal( div.data()["foo"], "a", "Verify single word data-* key" ); equal( div.data()["fooBar"], "b", "Verify multiple word data-* key" ); equal( div.data()["fooBarBaz"], "c", "Verify multiple word data-* key" ); equal( div.data("foo"), "a", "Verify single word data-* key" ); equal( div.data("fooBar"), "b", "Verify multiple word data-* key" ); equal( div.data("fooBarBaz"), "c", "Verify multiple word data-* key" ); div.data("foo-bar", "d"); equal( div.data("fooBar"), "d", "Verify updated data-* key" ); equal( div.data("foo-bar"), "d", "Verify updated data-* key" ); div.remove(); }); test("jQuery.data should not miss data with preset hyphenated property names", function() { expect(2); var div = jQuery("<div/>", { id: "hyphened" }).appendTo("#qunit-fixture"), test = { "camelBar": "camelBar", "hyphen-foo": "hyphen-foo" }; div.data( test ); jQuery.each( test , function(i, k) { equal( div.data(k), k, "data with property '"+k+"' was correctly found"); }); }); test("jQuery.data supports interoperable hyphenated/camelCase get/set of properties with arbitrary non-null|NaN|undefined values", function() { var div = jQuery("<div/>", { id: "hyphened" }).appendTo("#qunit-fixture"), datas = { "non-empty": "a string", "empty-string": "", "one-value": 1, "zero-value": 0, "an-array": [], "an-object": {}, "bool-true": true, "bool-false": false, // JSHint enforces double quotes, // but JSON strings need double quotes to parse // so we need escaped double quotes here "some-json": "{ \"foo\": \"bar\" }", "num-1-middle": true, "num-end-2": true, "2-num-start": true }; expect( 24 ); jQuery.each( datas, function( key, val ) { div.data( key, val ); deepEqual( div.data( key ), val, "get: " + key ); deepEqual( div.data( jQuery.camelCase( key ) ), val, "get: " + jQuery.camelCase( key ) ); }); }); test("jQuery.data supports interoperable removal of hyphenated/camelCase properties", function() { var div = jQuery("<div/>", { id: "hyphened" }).appendTo("#qunit-fixture"), datas = { "non-empty": "a string", "empty-string": "", "one-value": 1, "zero-value": 0, "an-array": [], "an-object": {}, "bool-true": true, "bool-false": false, // JSHint enforces double quotes, // but JSON strings need double quotes to parse // so we need escaped double quotes here "some-json": "{ \"foo\": \"bar\" }" }; expect( 27 ); jQuery.each( datas, function( key, val ) { div.data( key, val ); deepEqual( div.data( key ), val, "get: " + key ); deepEqual( div.data( jQuery.camelCase( key ) ), val, "get: " + jQuery.camelCase( key ) ); div.removeData( key ); equal( div.data( key ), undefined, "get: " + key ); }); }); test( ".removeData supports removal of hyphenated properties via array (#12786)", function() { expect( 4 ); var div, plain, compare; div = jQuery("<div>").appendTo("#qunit-fixture"); plain = jQuery({}); // When data is batch assigned (via plain object), the properties // are not camel cased as they are with (property, value) calls compare = { // From batch assignment .data({ "a-a": 1 }) "a-a": 1, // From property, value assignment .data( "b-b", 1 ) "bB": 1 }; // Mixed assignment div.data({ "a-a": 1 }).data( "b-b", 1 ); plain.data({ "a-a": 1 }).data( "b-b", 1 ); deepEqual( div.data(), compare, "Data appears as expected. (div)" ); deepEqual( plain.data(), compare, "Data appears as expected. (plain)" ); div.removeData([ "a-a", "b-b" ]); plain.removeData([ "a-a", "b-b" ]); // NOTE: Timo's proposal for "propEqual" (or similar) would be nice here deepEqual( div.data(), {}, "Data is empty. (div)" ); deepEqual( plain.data(), {}, "Data is empty. (plain)" ); }); // Test originally by Moschel test("Triggering the removeData should not throw exceptions. (#10080)", function() { expect(1); stop(); var frame = jQuery("#loadediframe"); jQuery(frame[0].contentWindow).on("unload", function() { ok(true, "called unload"); start(); }); // change the url to trigger unload frame.attr("src", "data/iframe.html?param=true"); }); test( "Only check element attributes once when calling .data() - #8909", function() { expect( 2 ); var testing = { "test": "testing", "test2": "testing" }, element = jQuery( "<div data-test='testing'>" ), node = element[ 0 ]; // set an attribute using attr to ensure it node.setAttribute( "data-test2", "testing" ); deepEqual( element.data(), testing, "Sanity Check" ); node.setAttribute( "data-test3", "testing" ); deepEqual( element.data(), testing, "The data didn't change even though the data-* attrs did" ); // clean up data cache element.remove(); }); test( "JSON data- attributes can have newlines", function() { expect(1); var x = jQuery("<div data-some='{\n\"foo\":\n\t\"bar\"\n}'></div>"); equal( x.data("some").foo, "bar", "got a JSON data- attribute with spaces" ); x.remove(); }); testIframeWithCallback( "enumerate data attrs on body (#14894)", "data/dataAttrs.html", function( result ) { expect(1); equal(result, "ok", "enumeration of data- attrs on body" ); });
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add("specialchar",function(e){var t,i,n=e.lang.specialChar,a=function(i){var n,a;if(n=i.data?i.data.getTarget():new CKEDITOR.dom.element(i),"a"==n.getName()&&(a=n.getChild(0).getHtml())){n.removeClass("cke_light_background"),t.hide();var o=e.document.createElement("span");o.setHtml(a),e.insertText(o.getText())}},o=CKEDITOR.tools.addFunction(a),r=function(e,n){var a;if(n=n||e.data.getTarget(),"span"==n.getName()&&(n=n.getParent()),"a"==n.getName()&&(a=n.getChild(0).getHtml())){i&&s(null,i);var o=t.getContentElement("info","htmlPreview").getElement();t.getContentElement("info","charPreview").getElement().setHtml(a),o.setHtml(CKEDITOR.tools.htmlEncode(a)),n.getParent().addClass("cke_light_background"),i=n}},s=function(e,n){n=n||e.data.getTarget(),"span"==n.getName()&&(n=n.getParent()),"a"==n.getName()&&(t.getContentElement("info","charPreview").getElement().setHtml("&nbsp;"),t.getContentElement("info","htmlPreview").getElement().setHtml("&nbsp;"),n.getParent().removeClass("cke_light_background"),i=void 0)},l=CKEDITOR.tools.addFunction(function(t){t=new CKEDITOR.dom.event(t);var i,n,o=t.getTarget(),l=t.getKeystroke(),c="rtl"==e.lang.dir;switch(l){case 38:(i=o.getParent().getParent().getPrevious())&&(n=i.getChild([o.getParent().getIndex(),0]),n.focus(),s(null,o),r(null,n)),t.preventDefault();break;case 40:(i=o.getParent().getParent().getNext())&&(n=i.getChild([o.getParent().getIndex(),0]),n&&1==n.type&&(n.focus(),s(null,o),r(null,n))),t.preventDefault();break;case 32:a({data:t}),t.preventDefault();break;case c?37:39:case 9:(i=o.getParent().getNext())?(n=i.getChild(0),1==n.type?(n.focus(),s(null,o),r(null,n),t.preventDefault(!0)):s(null,o)):(i=o.getParent().getParent().getNext())&&(n=i.getChild([0,0]),n&&1==n.type?(n.focus(),s(null,o),r(null,n),t.preventDefault(!0)):s(null,o));break;case c?39:37:case CKEDITOR.SHIFT+9:(i=o.getParent().getPrevious())?(n=i.getChild(0),n.focus(),s(null,o),r(null,n),t.preventDefault(!0)):(i=o.getParent().getParent().getPrevious())?(n=i.getLast().getChild(0),n.focus(),s(null,o),r(null,n),t.preventDefault(!0)):s(null,o);break;default:return}});return{title:n.title,minWidth:430,minHeight:280,buttons:[CKEDITOR.dialog.cancelButton],charColumns:17,onLoad:function(){for(var t,i,a=this.definition.charColumns,r=(e.config.extraSpecialChars,e.config.specialChars),s=CKEDITOR.tools.getNextId()+"_specialchar_table_label",c=['<table role="listbox" aria-labelledby="'+s+'" style="width: 320px; height: 100%; border-collapse: separate;" align="center" cellspacing="2" cellpadding="2" border="0">'],d=0,u=r.length;u>d;){c.push("<tr>");for(var h=0;a>h;h++,d++){if(t=r[d]){if(i="",t instanceof Array)i=t[1],t=t[0];else{var p=t.replace("&","").replace(";","").replace("#","");i=n[p]||t}var m="cke_specialchar_label_"+d+"_"+CKEDITOR.tools.getNextNumber();c.push('<td class="cke_dark_background" style="cursor: default" role="presentation"><a href="javascript: void(0);" role="option" aria-posinset="'+(d+1)+'"',' aria-setsize="'+u+'"',' aria-labelledby="'+m+'"',' style="cursor: inherit; display: block; height: 1.25em; margin-top: 0.25em; text-align: center;" title="',CKEDITOR.tools.htmlEncode(i),'" onkeydown="CKEDITOR.tools.callFunction( '+l+', event, this )" onclick="CKEDITOR.tools.callFunction('+o+', this); return false;" tabindex="-1"><span style="margin: 0 auto;cursor: inherit">'+t+'</span><span class="cke_voice_label" id="'+m+'">'+i+"</span></a>")}else c.push('<td class="cke_dark_background">&nbsp;');c.push("</td>")}c.push("</tr>")}c.push("</tbody></table>",'<span id="'+s+'" class="cke_voice_label">'+n.options+"</span>"),this.getContentElement("info","charContainer").getElement().setHtml(c.join(""))},contents:[{id:"info",label:e.lang.common.generalTab,title:e.lang.common.generalTab,padding:0,align:"top",elements:[{type:"hbox",align:"top",widths:["320px","90px"],children:[{type:"html",id:"charContainer",html:"",onMouseover:r,onMouseout:s,focus:function(){var e=this.getElement().getElementsByTag("a").getItem(0);setTimeout(function(){e.focus(),r(null,e)},0)},onShow:function(){var e=this.getElement().getChild([0,0,0,0,0]);setTimeout(function(){e.focus(),r(null,e)},0)},onLoad:function(e){t=e.sender}},{type:"hbox",align:"top",widths:["100%"],children:[{type:"vbox",align:"top",children:[{type:"html",html:"<div></div>"},{type:"html",id:"charPreview",className:"cke_dark_background",style:"border:1px solid #eeeeee;font-size:28px;height:40px;width:70px;padding-top:9px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:"<div>&nbsp;</div>"},{type:"html",id:"htmlPreview",className:"cke_dark_background",style:"border:1px solid #eeeeee;font-size:14px;height:20px;width:70px;padding-top:2px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:"<div>&nbsp;</div>"}]}]}]}]}]}});
describe("StackedSelectTags test", () => { it("is truthy", () => { expect(true).toBeTruthy(); }); });
# -*- coding: utf-8 -*- # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """appengine_config initialises before the server starts.""" import os import sys from google.appengine.ext import vendor # True if the app is running inside the dev appserver, false otherwise. This # is not the opposite of IS_RUNNING_IN_PRODUCTION; it is possible (in tests, # for example) for both IS_RUNNING_IN_DEV_APPSERVER and IS_RUNNING_IN_PRODUCTION # to be false. IS_RUNNING_IN_DEV_APPSERVER = ( os.getenv('SERVER_SOFTWARE') and os.getenv('SERVER_SOFTWARE').startswith('Development/') and 'testbed' not in os.getenv('SERVER_SOFTWARE')) # True if the app is running inside an AppEngine production environment, such # as prom.corp or appspot.com. False if it's running inside dev_appserver or # unsupported (such as from unit tests). IS_RUNNING_IN_PRODUCTION = ( os.getenv('SERVER_SOFTWARE') and os.getenv('SERVER_SOFTWARE').startswith('Google App Engine/')) # Add necessary directories to path. config_modules_path = os.path.join('config', 'modules') if IS_RUNNING_IN_PRODUCTION or IS_RUNNING_IN_DEV_APPSERVER: vendor.add('third_party') vendor.add('python') if os.path.exists(config_modules_path): vendor.add(config_modules_path) else: sys.path.insert(0, 'third_party') sys.path.insert(0, 'python') if os.path.exists(config_modules_path): sys.path.insert(0, config_modules_path) if IS_RUNNING_IN_PRODUCTION: import pkg_resources reload(pkg_resources) elif IS_RUNNING_IN_DEV_APPSERVER: import pkg_resources pkg_resources.working_set.add_entry('third_party') try: # Run any module initialization code. import module_init module_init.appengine() except ImportError: pass # https://github.com/googleapis/python-ndb/issues/249 import six reload(six) # Adding the protobuf module to the google module. Otherwise, we couldn't # import google.protobuf because google.appengine already took the name. import google google.__path__.insert(0, os.path.join('third_party', 'google')) if IS_RUNNING_IN_DEV_APPSERVER: from base import modules modules.disable_known_module_warnings() # In tests this is done in test_utils.with_cloud_emulators. if IS_RUNNING_IN_PRODUCTION or IS_RUNNING_IN_DEV_APPSERVER: # Use the App Engine Requests adapter. This makes sure that Requests uses # URLFetch. This is a workaround till we migrate to Python 3 on App Engine # Flex. import requests_toolbelt.adapters.appengine requests_toolbelt.adapters.appengine.monkeypatch() import firebase_admin firebase_admin.initialize_app()
/** * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format */ 'use strict'; var path = require('path'); var hmrTransform = 'react-transform-hmr/lib/index.js'; var transformPath = require.resolve(hmrTransform); module.exports = function(options, filename) { var transform = filename ? './' + path.relative(path.dirname(filename), transformPath) // packager can't handle absolute paths : hmrTransform; // Fix the module path to use '/' on Windows. if (path.sep === '\\') { transform = transform.replace(/\\/g, '/'); } return { plugins: [ [ require('metro-babel7-plugin-react-transform'), { transforms: [ { transform, imports: ['react'], locals: ['module'], }, ], }, ], ], }; };
# coding: utf-8 """ Unity Cloud Build This API is intended to be used in conjunction with the Unity Cloud Build service. A tool for building your Unity projects in the Cloud. See https://developer.cloud.unity3d.com for more information. ## Making requests This website is built to allow requests to be made against the API. If you are currently logged into Cloud Build you should be able to make requests without entering an API key. You can find your API key in the Unity Cloud Services portal by clicking on 'Cloud Build Preferences' in the sidebar. Copy the API Key and paste it into the upper left corner of this website. It will be used in all subsequent requests. ## Clients The Unity Cloud Build API is based upon Swagger. Client libraries to integrate with your projects can easily be generated with the [Swagger Code Generator](https://github.com/swagger-api/swagger-codegen). The JSON schema required to generate a client for this API version is located here: ``` [API_URL][BASE_PATH]/api.json ``` ## Authorization The Unity Cloud Build API requires an access token from your Unity Cloud Build account, which can be found at https://build.cloud.unity3d.com/login/me To authenticate requests, include a Basic Authentication header with your API key as the value. e.g. ``` Authorization: Basic [YOUR API KEY] ``` ## Pagination Paged results will take two parameters. A page number that is calculated based upon the per_page amount. For instance if there are 40 results and you specify page 2 with per_page set to 10 you will receive records 11-20. Paged results will also return a Content-Range header. For the example above the content range header would look like this: ``` Content-Range: items 11-20/40 ``` ## Versioning The API version is indicated in the request URL. Upgrading to a newer API version can be done by changing the path. The API will receive a new version in the following cases: * removal of a path or request type * addition of a required field * removal of a required field The following changes are considered backwards compatible and will not trigger a new API version: * addition of an endpoint or request type * addition of an optional field * removal of an optional field * changes to the format of ids ## Identifiers It should not be assumed that any of the identifiers used in paths will be a perfect match for your user-entered information. If you see unexpected 403s or 404s from API calls then check your identifiers match the ones used by the API. In particular, `projectId` does NOT typically change when the project is renamed and in fact may not be a direct match for the project name even at initial creation time. To avoid confusion we recommend that instead of using the human-readable autogenerated orgId and projectId available from the API you should instead use: * org foreign key for `orgId` (available from project APIs as `orgFk` and org APIs as `coreForeignKey`) * `guid` for `projectId` All links generated by the API and the Dashboard should follow this format already, making it easy to figure out the correct parameters by making a comparison. ## Rate Limiting Requests against the Cloud Build API are limited to a rate of 100 per minute. To preserve the quality of service throughout Cloud Build, additional rate limits may apply to some actions. For example, polling aggressively instead of using webhooks or making API calls with a high concurrency may result in rate limiting. It is not intended for these rate limits to interfere with any legitimate use of the API. Please contact support at <[email protected]> if your use is affected by this rate limit. You can check the returned HTTP headers for any API request to see your current rate limit status. * __X-RateLimit-Limit:__ maximum number of requests per minute * __X-RateLimit-Remaining:__ remaining number of requests in the current window * __X-RateLimit-Reset:__ time at which the current window will reset (UTC epoch seconds) Once you go over the rate limit you will receive an error response: ``` HTTP Status: 429 { \"error\": \"Rate limit exceeded, retry in XX seconds\" } ``` # noqa: E501 OpenAPI spec version: 1.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class Options8(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ """ Attributes: swagger_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition. """ swagger_types = { 'builds': 'list[OrgsorgidprojectsprojectidartifactsdeleteBuilds]' } attribute_map = { 'builds': 'builds' } def __init__(self, builds=None): # noqa: E501 """Options8 - a model defined in Swagger""" # noqa: E501 self._builds = None self.discriminator = None self.builds = builds @property def builds(self): """Gets the builds of this Options8. # noqa: E501 :return: The builds of this Options8. # noqa: E501 :rtype: list[OrgsorgidprojectsprojectidartifactsdeleteBuilds] """ return self._builds @builds.setter def builds(self, builds): """Sets the builds of this Options8. :param builds: The builds of this Options8. # noqa: E501 :type: list[OrgsorgidprojectsprojectidartifactsdeleteBuilds] """ if builds is None: raise ValueError("Invalid value for `builds`, must not be `None`") # noqa: E501 self._builds = builds def to_dict(self): """Returns the model properties as a dict""" result = {} for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, value.items() )) else: result[attr] = value if issubclass(Options8, dict): for key, value in self.items(): result[key] = value return result def to_str(self): """Returns the string representation of the model""" return pprint.pformat(self.to_dict()) def __repr__(self): """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): """Returns true if both objects are equal""" if not isinstance(other, Options8): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """Returns true if both objects are not equal""" return not self == other
var _ = require('lodash'); var keystone = require('../../'); var utils = keystone.utils; /** * Content Class * * Accessed via `Keystone.content` * * @api public */ var Content = function () {}; /** * Loads page content by page key (optional). * * If page key is not provided, returns a hash of all page contents in the database. * * ####Example: * * keystone.content.fetch('home', function(err, content) { ... }); * * @param {String} key (optional) * @param {Function} callback * @api public */ Content.prototype.fetch = function (page, callback) { if (utils.isFunction(page)) { callback = page; page = null; } var content = this; if (!this.AppContent) { return callback({ error: 'invalid page', message: 'No pages have been registered.' }); } if (page) { if (!this.pages[page]) { return callback({ error: 'invalid page', message: 'The page ' + page + ' does not exist.' }); } this.AppContent.findOne({ key: page }, function (err, result) { if (err) return callback(err); return callback(null, content.pages[page].populate(result ? result.content.data : {})); }); } else { this.AppContent.find(function (err, results) { if (err) return callback(err); var data = {}; results.forEach(function (i) { if (content.pages[i.key]) { data[i.key] = content.pages[i.key].populate(i.content.data); } }); _.forEach(content.pages, function (i) { if (!data[i.key]) { data[i.key] = i.populate(); } }); return data; }); } }; /** * Sets page content by page key. * * Merges content with existing content. * * ####Example: * * keystone.content.store('home', { title: 'Welcome' }, function(err) { ... }); * * @param {String} key * @param {Object} content * @param {Function} callback * @api public */ Content.prototype.store = function (page, content, callback) { if (!this.pages[page]) { return callback({ error: 'invalid page', message: 'The page ' + page + ' does not exist.' }); } content = this.pages[page].validate(content); // TODO: Handle validation errors this.AppContent.findOne({ key: page }, function (err, doc) { if (err) return callback(err); if (doc) { if (doc.content) { doc.history.push(doc.content); } _.defaults(content, doc.content); } else { doc = new content.AppContent({ key: page }); } doc.content = { data: this.pages[page].clean(content) }; doc.lastChangeDate = Date.now(); doc.save(callback); }); }; /** * Registers a page. Should not be called directly, use Page.register() instead. * * @param {Page} page * @api private */ Content.prototype.page = function (key, page) { if (!this.pages) { this.pages = {}; } if (arguments.length === 1) { if (!this.pages[key]) { throw new Error('keystone.content.page() Error: page ' + key + ' cannot be registered more than once.'); } return this.pages[key]; } this.initModel(); if (this.pages[key]) { throw new Error('keystone.content.page() Error: page ' + key + ' cannot be registered more than once.'); } this.pages[key] = page; return page; }; /** * Ensures the Mongoose model for storing content is initialised. * * Called automatically when pages are added. * * @api private */ Content.prototype.initModel = function () { if (this.AppContent) return; var contentSchemaDef = { createdAt: { type: Date, default: Date.now }, data: { type: keystone.mongoose.Schema.Types.Mixed }, }; var ContentSchema = new keystone.mongoose.Schema(contentSchemaDef); var PageSchema = new keystone.mongoose.Schema({ page: { type: String, index: true }, lastChangeDate: { type: Date, index: true }, content: contentSchemaDef, history: [ContentSchema], }, { collection: 'app_content' }); this.AppContent = keystone.mongoose.model('App_Content', PageSchema); }; /** * Outputs client-side editable data for content management * * Called automatically when pages are added. * * @api private */ Content.prototype.editable = function (user, options) { if (!user || !user.canAccessKeystone) { return undefined; } if (options.list) { var list = keystone.list(options.list); if (!list) { return JSON.stringify({ type: 'error', err: 'list not found' }); } var data = { type: 'list', path: list.getAdminURL(), singular: list.singular, plural: list.plural, }; if (options.id) { data.id = options.id; } return JSON.stringify(data); } }; /** * The exports object is an instance of Content. * * @api public */ module.exports = new Content(); // Expose Classes exports.Page = require('./page'); exports.Types = require('./types');
macDetailCallback("5c10c5000000/24",[{"d":"2020-09-11","t":"add","s":"ieee-oui.csv","a":"#94-1, Imsoo-Dong Gumi Gyeongbuk KR 730-350","c":"KR","o":"Samsung Electronics Co.,Ltd"}]);
import { getCommonHeader, getCommonCard, getCommonContainer, getCommonParagraph, getLabelWithValue, getCommonTitle, getDateField, getLabel, getPattern, getSelectField, getTextField, getBreak } from "egov-ui-framework/ui-config/screens/specs/utils"; //import { DOEApplyApplication} from "./applydoeResources/DOEApplyApplication"; import { setRoute } from "egov-ui-framework/ui-redux/app/actions"; import { getQueryArg } from "egov-ui-framework/ui-utils/commons"; import { validateFields, getTextToLocalMapping } from "../utils"; import { getSearchPensioner,getPTPattern } from "../../../../ui-utils/commons"; import { toggleSnackbar,toggleSpinner } from "egov-ui-framework/ui-redux/screen-configuration/actions"; import store from "../../../../ui-redux/store"; import { getstoreTenantId } from "../../../../ui-utils/storecommonsapi"; import { getTenantId,getUserInfo } from "egov-ui-kit/utils/localStorageUtils"; import find from "lodash/find"; import set from "lodash/set"; import get from "lodash/get"; import { prepareFinalObject, handleScreenConfigurationFieldChange as handleField } from "egov-ui-framework/ui-redux/screen-configuration/actions"; import { InventoryData } from "../../../../ui-utils/sampleResponses"; import { httpRequest } from "../../../../ui-utils"; import { getSearchResults } from "../../../../ui-utils/commons"; const redirecthouse = async (state, dispatch) => { dispatch(setRoute(`/egov-integration/search-house`)); }; const resetFields = (state, dispatch) => { const textFields = ["propertyTaxId","code","mobileNo","otp" ]; for (let i = 0; i < textFields.length; i++) { if ( `state.screenConfiguration.screenConfig.dashboardPT.components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.${textFields[i]}.props.value` ) { dispatch( handleField( "dashboardPT", `components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.${textFields[i]}`, "props.value", "" ) ); } } dispatch( handleField( `dashboardPT`, "components.div.children.SearchCard.children.cardContent.children.button.children.buttonContainer.children.validateOTPButton", "props.style", { display: "none" } ) ); dispatch( handleField( `dashboardPT`, "components.div.children.SearchCard.children.cardContent.children.button.children.buttonContainer.children.searchButton", "props.style", { display: "inline-block",marginTop:"8px" } ) ); dispatch( handleField( "dashboardPT", `components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.otp`, "props.style", { display: "none" } ) ); dispatch( handleField( "dashboardPT", `components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.code`, "props.style", { display: "none" } ) ); dispatch(prepareFinalObject("searchScreen", {})); dispatch(prepareFinalObject("APIData", [])); // dispatch( // handleField( // `dashboardPT`, // "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.code", // "label", // { labelName: "property Tax Id", labelKey: "PT_CODE" } // ) // ); // dispatch( // handleField( // `dashboardPT`, // "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer", // "props", // { disabled : false, } // ) // ); // set( // action.screenConfig, // "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.props", // { disabled : false, } // ); dispatch( handleField( `dashboardPT`, "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.code", "props.disabled", false ) ); dispatch( handleField( `dashboardPT`, "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.propertyTaxId", "props.disabled", false ) ); dispatch( handleField( `dashboardPT`, "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.mobileNo", "props.disabled", false ) ); }; const ValidateOTP = async (state, dispatch) => { let ValidateOTPobj = get( state.screenConfiguration.preparedFinalObject, "getOTP.ResponseBody[0]", {} ); let searchScreenObject = get( state.screenConfiguration.preparedFinalObject, "searchScreen", {} ); let OtpValid = false const fields = get( state.screenConfiguration.screenConfig[`dashboardPT`], "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children", {} ); if(fields.otp!==undefined ) { if(fields.otp.isFieldValid ===false) { dispatch( toggleSnackbar( true, { labelName: "Enter valid OTP", labelKey: "INTIGRATION_OTP_INPUT_VALIDATION" }, "warning" ) ); } else{ if(ValidateOTPobj.OTP === searchScreenObject.otp) OtpValid = true else{ dispatch( toggleSnackbar( true, { labelName: "Incorrect OTP", labelKey: "INTIGRATION_OTP_INPUT_COMPARE_VALIDATION" }, "warning" ) ); } } } let uid =''; let code = get( state.screenConfiguration.preparedFinalObject, "searchScreen.code", null ); let propertyTaxId = get( state.screenConfiguration.preparedFinalObject, "searchScreen.propertyTaxId", null ); if(fields.code.props.style.display ==="none") { uid = propertyTaxId } else{ uid = code } if(OtpValid) { const requestBody = { uid:uid, otp:searchScreenObject.otp, mobileNo:searchScreenObject.mobileNo, TokenId:ValidateOTPobj.TokenId, } dispatch(toggleSpinner()) let response = await getSearchResults([],requestBody, dispatch, "verifyOTP"); if(response) { dispatch( handleField( `dashboardPT`, "components.div.children.SearchCard.children.cardContent.children.button.children.buttonContainer.children.validateOTPButton", "props.style", { display: "none" } ) ); dispatch( handleField( "dashboardPT", `components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.otp`, "props.style", { display: "none" } ) ); if(get(response,"ResponseBody",[])) { dispatch(prepareFinalObject("APIData", get(response,"ResponseBody",[]))); } dispatch(toggleSpinner()) //GetData(state, dispatch) // call save api let {result} = state.screenConfiguration.preparedFinalObject.searchScreenMdmsData; let uidExist = false; // check id in list if(result) { result = result.filter(x=>x.propertyTaxId == uid) if(result.length >0) uidExist = true; } if(!uidExist) { try { const userInfo = JSON.parse(getUserInfo()); let payload = await httpRequest( "post", "/integration-services/pt-mapping/v1/_save", "_save", [], { PtMappingRequest:{ userId:userInfo.id, propertyTaxId:`${uid}`, tenantId: "ch", } } ); if(payload) { await getMdmsData(state, dispatch); } } catch(error) { dispatch( toggleSnackbar( true, { labelName: error.message, labelKey: error.message }, "error" ) ); } } } } } const GetOTP = async (state, dispatch) => { let searchScreenObject = get( state.screenConfiguration.preparedFinalObject, "searchScreen", {} ); if(searchScreenObject.mobileNo !== undefined && searchScreenObject.code !== undefined ) { let validmobileNo = false; let validcode = false; const fields = get( state.screenConfiguration.screenConfig[`dashboardPT`], "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children", {} ); if(fields.code!==undefined ) { if(fields.code.isFieldValid ===false) { if(fields.code.props.style.display !=="none") { dispatch( toggleSnackbar( true, { labelName: "Please enter valid property Id", labelKey: "INTIGRATION_ERR_FILL_VALID_FIELDS_PT_CODE" }, "warning" ) ); validcode = false; return; } else{ validcode = true; } } if(fields.code.isFieldValid ===true) { validcode = true } else{ if(fields.code.props.style.display ==="none") { validcode = true } else{ validcode = false } } } if(fields.mobileNo!==undefined ) { if(fields.mobileNo.isFieldValid ===false) { dispatch( toggleSnackbar( true, { labelName: "Please enter mobile Number", labelKey: "INTIGRATION_ERR_FILL_VALID_FIELDS_PT_MOBIL_NUMBER" }, "warning" ) ); validmobileNo = false; return; } else{ validmobileNo = true; } } if(validmobileNo && validcode) { let uid =''; let code = get( state.screenConfiguration.preparedFinalObject, "searchScreen.code", null ); let propertyTaxId = get( state.screenConfiguration.preparedFinalObject, "searchScreen.propertyTaxId", null ); if(fields.code.props.style.display ==="none") { uid = propertyTaxId } else{ uid = code } const requestBody = { uid:uid, mobileNo:searchScreenObject.mobileNo, } dispatch(toggleSpinner()) let response = await getSearchResults([],requestBody, dispatch, "getOTP"); if(response) { if(response.ResponseBody[0].Status ==='F') { const errorMessage = { labelName: "Please select the Minority", labelKey: response.ResponseBody[0].Msg }; dispatch(toggleSnackbar(true, errorMessage, "warning")); dispatch( handleField( `dashboardPT`, "components.div.children.SearchCard.children.cardContent.children.button.children.buttonContainer.children.validateOTPButton", "props.style", { display: "none" } ) ); dispatch( handleField( "dashboardPT", `components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.otp`, "props.style", { display: "none" } ) ); } else if(response.ResponseBody[0].Status ==='S') { const errorMessage = { labelName: "Please select the Minority", labelKey: response.ResponseBody[0].Msg }; dispatch(toggleSnackbar(true, errorMessage, "success")); dispatch( handleField( `dashboardPT`, "components.div.children.SearchCard.children.cardContent.children.button.children.buttonContainer.children.validateOTPButton", "props.style", { display: "inline-block",marginTop:"8px",color:"#ffffff" ,backgroundColor:"#0009"} ) ); dispatch( handleField( `dashboardPT`, "components.div.children.SearchCard.children.cardContent.children.button.children.buttonContainer.children.searchButton", "props.style", { display: "none" } ) ); dispatch( handleField( `dashboardPT`, "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.otp", "props.style", { display: "inline-block" } ) ); dispatch( handleField( `dashboardPT`, "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.code", "props.disabled", true ) ); dispatch( handleField( `dashboardPT`, "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.propertyTaxId", "props.disabled", true ) ); dispatch( handleField( `dashboardPT`, "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.mobileNo", "props.disabled", true ) ); } dispatch(prepareFinalObject("getOTP",response)); dispatch(toggleSpinner()) } } else{ if(!validmobileNo) { dispatch( toggleSnackbar( true, { labelName: "Please enter mobile Number", labelKey: "INTIGRATION_ERR_FILL_VALID_FIELDS_PT_MOBIL_NUMBER" }, "warning" ) ); } else if(!validcode) { dispatch( toggleSnackbar( true, { labelName: "Please enter valid property Id", labelKey: "INTIGRATION_ERR_FILL_VALID_FIELDS_PT_CODE" }, "warning" ) ); } } } else{ if(searchScreenObject.code === undefined) { dispatch( toggleSnackbar( true, { labelName: "Please enter valid property Id", labelKey: "INTIGRATION_ERR_FILL_VALID_FIELDS_PT_CODE" }, "warning" ) ); } else if (searchScreenObject.mobileNo === undefined) dispatch( toggleSnackbar( true, { labelName: "Please enter mobile Number", labelKey: "INTIGRATION_ERR_FILL_FIELDS_PT_MOBIL_NUMBER" }, "warning" ) ); } } const GetData = async (state, dispatch) => { let queryObject = [ { key: "tenantId", value: getTenantId() } ]; let searchScreenObject = get( state.screenConfiguration.preparedFinalObject, "searchScreen", {} ); let isSearchBoxFirstRowValid = validateFields( "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children", state, dispatch, "dashboardPT" ); //isSearchBoxFirstRowValid = true; if( Object.keys(searchScreenObject).length == 2 ) { const fields = get( state.screenConfiguration.screenConfig[`dashboardPT`], "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children", {} ); if(fields.code!==undefined ) { if(fields.code.isFieldValid ===false) { if(fields.code.props.style.display ==="none") { isSearchBoxFirstRowValid = true; } else { isSearchBoxFirstRowValid = false; } } else isSearchBoxFirstRowValid = true; } } else if( Object.keys(searchScreenObject).length == 1 ) { const fields = get( state.screenConfiguration.screenConfig[`dashboardPT`], "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children", {} ); if(fields.propertyTaxId!==undefined ) { if(fields.propertyTaxId.isFieldValid ===false) { isSearchBoxFirstRowValid = false; } else { if(fields.propertyTaxId.isFieldValid ===false) { isSearchBoxFirstRowValid = false; } else { isSearchBoxFirstRowValid = true; } } } } if( Object.keys(searchScreenObject).length == 0 ) { dispatch( toggleSnackbar( true, { labelName: "Please fill at least one field to start search", labelKey: "ERR_FILL_ALL_FIELDS" }, "warning" ) ); } else if (!(isSearchBoxFirstRowValid)) { dispatch( toggleSnackbar( true, { labelName: "Please enter valid property Id", labelKey: "INTIGRATION_ERR_FILL_VALID_FIELDS_PT_CODE" }, "error" ) ); } else { let uid =''; if( Object.keys(searchScreenObject).length == 1 ) { let propertyTaxId = get( state.screenConfiguration.preparedFinalObject, "searchScreen.propertyTaxId", null ); uid = propertyTaxId } else if( Object.keys(searchScreenObject).length == 2 ) { let code = get( state.screenConfiguration.preparedFinalObject, "searchScreen.code", null ); let propertyTaxId = get( state.screenConfiguration.preparedFinalObject, "searchScreen.propertyTaxId", null ); const fields = get( state.screenConfiguration.screenConfig[`dashboardPT`], "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children", {} ); if(fields.code.props.style.display ==="none") { uid = propertyTaxId } else{ uid = code } } // for (var key in searchScreenObject) { // queryObject.push({ key: key, value: (searchScreenObject[key]) }); // if(key ==="code") // { // uid=searchScreenObject[key].trim(); // } // else{ // uid=searchScreenObject[key].trim(); // } // } dispatch(toggleSpinner()) try { let payload =[]; let Responce = await httpRequest( "post", "integration-services/pt/v1/_get", "_get", [], { tenantId: "ch", uid: `${uid}` } ); // payload = InventoryData() // dispatch(prepareFinalObject("InventoryData", payload)); if(Responce) { if(get(Responce,"ResponseBody",[])) { dispatch(prepareFinalObject("APIData", get(Responce,"ResponseBody",[]))); // call save api /integration-services/pt-mapping/v1/_save if input id not exist in List // get integration-services/pt-mapping/v1/_get let {result} = state.screenConfiguration.preparedFinalObject.searchScreenMdmsData; let uidExist = false; // check id in list if(result) { result = result.filter(x=>x.propertyTaxId == uid) if(result.length >0) uidExist = true; } // call save api if(!uidExist) { try { const userInfo = JSON.parse(getUserInfo()); let payload = await httpRequest( "post", "/integration-services/pt-mapping/v1/_save", "_save", [], { PtMappingRequest:{ userId:userInfo.id, propertyTaxId:`${uid}`, tenantId: "ch", } } ); if(payload) { await getMdmsData(state, dispatch); } } catch(error) { dispatch( toggleSnackbar( true, { labelName: error.message, labelKey: error.message }, "error" ) ); } } dispatch(toggleSpinner()) } else { let APIData =[] dispatch(prepareFinalObject("APIData",APIData)); dispatch(toggleSpinner()) } } else{ let APIData =[] dispatch(prepareFinalObject("APIData",APIData)); dispatch(toggleSpinner()) } console.log(payload) return payload } catch (error) { console.log(error); let APIData =[] if(error.message ==="An unhandled exception occurred on the server") { const errorMessage = { labelName: "Enter Valid property tax id", labelKey: `INTIGRATION_ERR_FILL_VALID_FIELDS_PT_CODE` }; dispatch(toggleSnackbar(true, errorMessage, "warning")); } else{ dispatch( toggleSnackbar( true, { labelName: error.message, labelKey: error.message }, "error" ) ); } dispatch(prepareFinalObject("APIData",APIData)); dispatch(toggleSpinner()) } } } const addPropertyIdHandle = async (state, dispatch) => { console.log('call api to add property id seasrch'); }; export const getData = async (action, state, dispatch) => { await getMdmsData(state, dispatch); //fetching store name // const queryObject = [{ key: "tenantId", value: getTenantId() }]; // getSearchResults(queryObject, dispatch,"storeMaster") // .then(response =>{ // if(response){ // const storeNames = response.stores.map(item => { // let code = item.code; // let name = item.name; // let department = item.department.name; // let divisionName = item.divisionName; // return{code,name,department,divisionName} // } ) // dispatch(prepareFinalObject("searchMaster.storeNames", storeNames)); // } // }); }; const getMdmsData = async (state, dispatch) => { const tenantId = getstoreTenantId(); let mdmsBody = { userInfo: { id: 323, } }; try { const response = await httpRequest( "post", "/integration-services/pt-mapping/v1/_get", "_get", [], mdmsBody ); if(response) { dispatch(prepareFinalObject("searchScreenMdmsData",response.ResponseBody)) } //dispatch(prepareFinalObject("searchScreenMdmsData", get(response, "ResponseBody.result"))); const {result} = state.screenConfiguration.preparedFinalObject.searchScreenMdmsData; result.push( { propertyTaxId:"others", isActive:true, userId:0 } ) dispatch(prepareFinalObject("searchScreenMdmsData.result",result)) // if(result) // { // result.push( // { // propertyTaxId:"others", // isActive:true, // userId:0 // } // ) // dispatch(prepareFinalObject("searchScreenMdmsData.result",result)) // } // else{ // result.push( // { // propertyTaxId:"others", // isActive:true, // userId:0 // } // ) // dispatch(prepareFinalObject("searchScreenMdmsData.result",result)) // } return true; } catch (e) { console.log(e); } }; const header = getCommonHeader({ labelName: "RTI Data", labelKey: "PT_DATA_HEADER" }); const RegisterReviewResult = { uiFramework: "material-ui", name: "dashboardPT", beforeInitScreen: (action, state, dispatch) => { // resetFields(state, dispatch); const tenantId = getTenantId(); dispatch(prepareFinalObject("searchScreen",{})); const propertyTaxId = getQueryArg( window.location.href, "propertyId" ); getData(action, state, dispatch).then(responseAction => { dispatch(prepareFinalObject("searchScreen.code",propertyTaxId)); dispatch(prepareFinalObject("searchScreen.propertyTaxId","others")); }); let APIData =[] dispatch(prepareFinalObject("APIData",APIData)); dispatch( handleField( "dashboardPT", `components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.code`, "props.style", { display: "none" } ) ); if(propertyTaxId) { set( action.screenConfig, "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.code.props.style", { display: "inline-block" } ); dispatch( handleField( `dashboardPT`, "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.code", "props.value", propertyTaxId ) ); dispatch( handleField( `dashboardPT`, "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.code", "isFieldValid", true ) ); set( action.screenConfig, "components.div.children.SearchCard.children.cardContent.children.button.children.buttonContainer.children.validateOTPButton.props.style", { display: "none" } ); set( action.screenConfig, "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.otp.props.style", { display: "none" } ); } else{ set( action.screenConfig, "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.code.props.style", { display: "inline-block" } ); set( action.screenConfig, "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.mobileNo.props.style", { display: "inline-block" } ); set( action.screenConfig, "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.otp.props.style", { display: "none" } ); set( action.screenConfig, "components.div.children.SearchCard.children.cardContent.children.button.children.buttonContainer.children.validateOTPButton.props.style", { display: "none" } ); // set( // action.screenConfig, // "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.code", // "isFieldValid", // false // ); // dispatch( // handleField( // `dashboardPT`, // "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.code", // "isFieldValid", // false // ) // ); } set( action.screenConfig, "components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.newPropertycodePTButton.props.style", { display: "none" } ); return action; }, components: { div: { uiFramework: "custom-atoms", componentPath: "Form", props: { className: "common-div-css", id: "review" }, children: { headerDiv: { uiFramework: "custom-atoms", componentPath: "Container", children: { header: { gridDefination: { xs: 12, sm: 6 }, ...header }, newApplicationButton: { componentPath: "Button", gridDefination: { xs: 12, sm: 6, align: "right", }, visible: process.env.REACT_APP_NAME === "Employee"? false : true, props: { variant: "contained", color: "primary", style: { color: "white", borderRadius: "2px", width: "250px", height: "48px", }, }, children: { plusIconInsideButton: { uiFramework: "custom-atoms", componentPath: "Icon", props: { // iconName: "add", style: { fontSize: "24px", }, }, }, buttonLabel: getLabel({ labelName: "Search By HouseNo", labelKey: "INTIGRATION_SEARCH_BY_HOUSE", }), }, onClickDefination: { action: "condition", callBack: redirecthouse, }, }, } }, SearchCard: getCommonCard({ appPRSearchContainer: getCommonContainer({ propertyTaxId: { ...getSelectField({ label: { labelName: "property Tax Id", labelKey: "PT_CODE" }, placeholder: { labelName: "Select property Tax Id", labelKey: "PT_CODE" }, gridDefination: { xs: 12, sm: 6, }, required: true, jsonPath: "searchScreen.propertyTaxId", sourceJsonPath: "searchScreenMdmsData.result", props: { className: "hr-generic-selectfield", optionValue: "propertyTaxId", optionLabel: "propertyTaxId" } }), beforeFieldChange: (action, state, dispatch) => { if(action.value) { if(action.value.toUpperCase() === "OTHERS") { dispatch( handleField( "dashboardPT", `components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.code`, "props.style", { display: "inline-block" } ) ); dispatch( handleField( "dashboardPT", `components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.newPropertycodePTButton`, "props.style", { display: "inline-block" } ) ); dispatch( handleField( "dashboardPT", `components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.mobileNo`, "props.style", { display: "inline-block" } ) ); } else{ dispatch( handleField( "dashboardPT", `components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.code`, "props.style", { display: "none" } ) ); dispatch( handleField( "dashboardPT", `components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.mobileNo`, "props.style", { display: "inline-block" } ) ); dispatch( handleField( "dashboardPT", `components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.newPropertycodePTButton`, "props.style", { display: "none" } ) ); dispatch( handleField( "dashboardPT", `components.div.children.SearchCard.children.cardContent.children.appPRSearchContainer.children.code`, "props.value", "" ) ); } } } }, code: { ...getTextField({ label: { labelName: "Code", labelKey: "PT_CODE" }, placeholder: { labelName: "Enter Code", labelKey: "PT_CODE" }, required: true, jsonPath: "searchScreen.code", isFieldValid:true, pattern: getPTPattern("PropertycodePT"), gridDefination: { xs: 12, sm: 6, }, }) }, mobileNo: { ...getTextField({ label: { labelName: "mobileNo", labelKey: "INTIGRATION_MOBILE_NUMBER" }, placeholder: { labelName: "Enter mobileNo", labelKey: "INTIGRATION_MOBILE_NUMBER_PLACEHOLDER" }, required: true, jsonPath: "searchScreen.mobileNo", pattern: getPattern("MobileNo") || null, gridDefination: { xs: 12, sm: 6, }, }) }, otp: { ...getTextField({ label: { labelName: "otp", labelKey: "INTIGRATION_OTP" }, placeholder: { labelName: "Enter OTP", labelKey: "INTIGRATION_OTP" }, required: true, jsonPath: "searchScreen.otp", pattern: getPattern("UOMValue") || null, errorMessage: "INTIGRATION_OTP_INPUT_VALIDATION", gridDefination: { xs: 12, sm: 6, }, }) }, }), button: getCommonContainer({ buttonContainer: getCommonContainer({ searchButton: { componentPath: "Button", gridDefination: { xs: 12, sm: 2, // align: "center" }, props: { variant: "contained", style: { color: "white", margin: "8px", backgroundColor: "rgba(0, 0, 0, 0.6000000238418579)", borderRadius: "2px", // width: "220px", // height: "48px", }, }, children: { buttonLabel: getLabel({ labelName: "Send OTP", labelKey: "INTIGRATION_GET_OTP_BUTTON", }), }, onClickDefination: { action: "condition", callBack: GetOTP, }, }, validateOTPButton: { componentPath: "Button", gridDefination: { xs: 12, sm: 2, // align: "center" }, props: { variant: "contained", style: { color: "white", margin: "8px", backgroundColor: "rgba(0, 0, 0, 0.6000000238418579)", borderRadius: "2px", // width: "220px", // height: "48px", }, }, children: { buttonLabel: getLabel({ labelName: "Search", labelKey: "INTIGRATION_VALID_OTP_BUTTON", }), }, onClickDefination: { action: "condition", callBack: ValidateOTP, }, }, resetButton: { componentPath: "Button", gridDefination: { xs: 12, sm: 2, //align: "left" }, props: { variant: "outlined", style: { color: "#FE7A51", borderColor: "#FE7A51", // borderRadius: "2px", // width: "220px", // height: "48px", margin: "8px", float: "left", }, }, children: { buttonLabel: getLabel({ labelName: "Cancel", labelKey: "INTIGRATION_CANCEL_BUTTON", }), }, onClickDefination: { action: "condition", callBack: resetFields, }, }, }), }), }), breakAfterSearch: getBreak(), PensionReviewBottom: { uiFramework: "custom-containers-local", componentPath: "InventoryContainer", moduleName: "egov-integration", props: { dataPath: "records", moduleName: "RTI", pageName:"INTIGRATION_PT", } }, } }, } }; export default RegisterReviewResult;
getJasmineRequireObj().MockDate = function() { function MockDate(global) { var self = this; var currentTime = 0; if (!global || !global.Date) { self.install = function() {}; self.tick = function() {}; self.uninstall = function() {}; return self; } var GlobalDate = global.Date; self.install = function(mockDate) { if (mockDate instanceof GlobalDate) { currentTime = mockDate.getTime(); } else { currentTime = new GlobalDate().getTime(); } global.Date = FakeDate; }; self.tick = function(millis) { millis = millis || 0; currentTime = currentTime + millis; }; self.uninstall = function() { currentTime = 0; global.Date = GlobalDate; }; createDateProperties(); return self; function FakeDate() { switch(arguments.length) { case 0: return new GlobalDate(currentTime); case 1: return new GlobalDate(arguments[0]); case 2: return new GlobalDate(arguments[0], arguments[1]); case 3: return new GlobalDate(arguments[0], arguments[1], arguments[2]); case 4: return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3]); case 5: return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]); case 6: return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]); case 7: return new GlobalDate(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6]); } } function createDateProperties() { FakeDate.prototype = GlobalDate.prototype; FakeDate.now = function() { if (GlobalDate.now) { return currentTime; } else { throw new Error('Browser does not support Date.now()'); } }; FakeDate.toSource = GlobalDate.toSource; FakeDate.toString = GlobalDate.toString; FakeDate.parse = GlobalDate.parse; FakeDate.UTC = GlobalDate.UTC; } } return MockDate; };
/* * Copyright 2020 New Relic Corporation. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ 'use strict' const mapToStreamingType = require('./map-to-streaming-type') /** * Specialized attribute collection class for use with infinite streaming. * Currently designed to be sent over grpc via the v1.proto definition. * * @private * @class */ class StreamingSpanAttributes { constructor(attributes) { if (attributes) { this.addAttributes(attributes) } } /** * Add a key/value pair to the attribute collection. * null/undefined values will be dropped. * * Does not apply filtering/truncation. * * @param {string} key Name of the attribute to be stored. * @param {string|boolean|number} value Value of the attribute to be stored. */ addAttribute(key, value) { const streamingValue = mapToStreamingType(value) if (streamingValue) { this[key] = streamingValue return true } return false } /** * Adds all attributes in an object to the attribute collection. * null/undefined values will be dropped. * * Does not apply filtering/truncation. * * @param {object} [attributes] * @param {string} [attributes.key] Name of the attribute to be stored. * @param {string|boolean|number} [attributes.value] Value of the attribute to be stored. */ addAttributes(attributes) { if (!attributes) { return } for (const [key, value] of Object.entries(attributes)) { this.addAttribute(key, value) } } } module.exports = StreamingSpanAttributes
import _filter from "lodash/filter"; import _find from "lodash/find"; import _forEach from "lodash/forEach"; import alertify from "alertifyjs/build/alertify.min"; import APIConfig from "../../../../../utils/config"; class PersonalCreateStuffProfileController { constructor(PreloadService, AuthorizationService, HelperService, $rootScope, $scope, $state, Upload, $timeout, PersonalDependenciesService) { "ngInject"; this.PreloadService = PreloadService; this.AuthorizationService = AuthorizationService; this.HelperService = HelperService; this.$rootScope = $rootScope; this.$scope = $scope; this.$state = $state; this.Upload = Upload; this.$timeout = $timeout; this.PersonalDependenciesService = PersonalDependenciesService; this.avatar = null; this.preloadCompleted = $rootScope.$on("Preload.Completed", () => this.preloadInit()); } $onInit() { if (this.$rootScope.loading !== true && typeof this.$rootScope.loading !== "undefined") { this.preloadInit(); } } saveCropAvatar() { this.cropAvatarState = false; this.lastCroppedDataUrl = angular.copy(this.croppedDataUrl); this.profileData.avatar = this.avatar; this.profileData.lastCroppedDataUrl = this.lastCroppedDataUrl; } //Upload avatar after response uploadAvatar(dataUrl, name, doctor, doctorUpdateResponse) { this.Upload.upload({ url: APIConfig.API_URL + "doctor/change_avatar/", data: { doctor: doctor, avatar: this.Upload.dataUrltoBlob(dataUrl, name) }, }).then((response) => { doctorUpdateResponse.avatar = response.data.avatar; this.PreloadService.clinicStuffList.push(doctorUpdateResponse); this.PreloadService.helperStuffList.push(doctorUpdateResponse); this.$timeout(() => { this.saveAlert.delay(5).setContent("ะกะฟะตั†ะธะฐะปะธัั‚ ะดะพะฑะฐะฒะปะตะฝ"); this.$state.go("helper.personal.stuff"); }, 1500); }, (error) => { if (error.status > 0) this.errorMsg = error.status + ": " + error.data; }); } cancelCropAvatar() { this.croppedDataUrl = null; this.cropAvatarState = false; } preloadInit() { //Save avatar in window this.avatar = angular.copy(this.profileData.avatar); this.lastCroppedDataUrl = angular.copy(this.profileData.lastCroppedDataUrl); //Filter all helper to activated helpers this.helperList = _filter(this.PreloadService.clinicsHelperList, (helper) => helper.status === 0).reverse(); //Find yourself in all helper list if (this.profileData.helper !== null) { this.currentHelper = _find(this.PreloadService.clinicsHelperList, (helper) => this.profileData.helper.id === helper.id); } else { this.currentHelper = _find(this.PreloadService.clinicsHelperList, (helper) => helper.id === this.AuthorizationService.user.id); } // Set current helper like initial helper to our new personal this.dropdownState = null; this.avatarUplodaState = false; this.saveButtonState = false; this.specialityState = false; //Setting category to dropdown if it already exist switch (this.profileData.category) { case 1: this.currentCategory = { id: 1, text: "ะ’ั‚ะพั€ะฐั ะบะฒะฐะปะธั„ะธะบะฐั†ะธะพะฝะฝะฐั ะบะฐั‚ะตะณะพั€ะธั" }; break; case 2: this.currentCategory = { id: 2, text: "ะŸะตั€ะฒะฐั ะบะฒะฐะปะธั„ะธะบะฐั†ะธะพะฝะฝะฐั ะบะฐั‚ะตะณะพั€ะธั" }; break; case 3: this.currentCategory = { id: 3, text: "ะ’ั‹ััˆะฐั ะบะฒะฐะปะธั„ะธะบะฐั†ะธะพะฝะฝะฐั ะบะฐั‚ะตะณะพั€ะธั" }; break; case 4: this.currentCategory = { id: 4, text: "ะšะœะ" }; break; case 5: this.currentCategory = { id: 5, text: "ะ”ะœะ" }; break; case 6: this.currentCategory = { id: 6, text: "ะŸั€ะพั„ะตััะพั€" }; break; default: this.currentCategory = { id: 0, text: "ะšะฒะฐะปะธั„ะธะบะฐั†ะธั ะฝะต ะฒั‹ะฑั€ะฐะฝะฐ" }; break; } // switch (this.profileData.category) { // case 1: // this.currentCategory = { // id: 1, // text: "ะ’ั‚ะพั€ะฐั ะบะฒะฐะปะธั„ะธะบะฐั†ะธะพะฝะฝะฐั ะบะฐั‚ะตะณะพั€ะธั" // }; // break; // case 2: // this.currentCategory = { // id: 2, // text: "ะŸะตั€ะฒะฐั ะบะฒะฐะปะธั„ะธะบะฐั†ะธะพะฝะฝะฐั ะบะฐั‚ะตะณะพั€ะธั" // }; // break; // case 3: // this.currentCategory = { // id: 3, // text: "ะ’ั‹ััˆะฐั ะบะฒะฐะปะธั„ะธะบะฐั†ะธะพะฝะฝะฐั ะบะฐั‚ะตะณะพั€ะธั" // }; // break; // default: // this.currentCategory = { // id: 0, // text: "ะšะฒะฐะปะธั„ะธะบะฐั†ะธั ะฝะต ะฒั‹ะฑั€ะฐะฝะฐ" // }; // break; // } //Setting status to dropdown if it already exist switch (this.profileData.status) { case 0: this.currentDoctorStatus = { status: 0, text: "ะะบั‚ะธะฒะตะฝ" }; break; case 1: this.currentDoctorStatus = { status: 1, text: "ะะตะฐะบั‚ะธะฒะตะฝ" }; break; default: this.currentDoctorStatus = { status: 0, text: "ะะบั‚ะธะฒะตะฝ" }; } //Setting 'call to home' to dropdown if it already exist switch (this.profileData.allowed_type.indexOf(3)) { case -1: this.currentDoctorOnCall = { status: 0, text: "ะะตั‚" }; break; case 3: this.currentDoctorOnCall = { status: 1, text: "ะ”ะฐ" }; break; } //Setting all specialities that in base this.specialitiesList = this.PreloadService.specialities; } savePersonal() { this.saveButtonState = true; this.saveAlert = alertify.notify("ะกะพั…ั€ะฐะฝะตะฝะธะต...", "custom", 20); //Saving avatar this.avatar = angular.copy(this.profileData.avatar); this.lastCroppedDataUrl = angular.copy(this.profileData.lastCroppedDataUrl); this.qualification = angular.copy(this.profileData.qualification); this.education = angular.copy(this.profileData.education); this.profileData.helper = this.profileData.helper.id; //Deleting avatar before request delete this.profileData.avatar; delete this.profileData.lastCroppedDataUrl; //Deleting service before request // delete this.profileData.procedureService; // delete this.profileData.medtestService; //Deleting education and qualification // delete this.profileData.education; // delete this.profileData.qualification; //Setting doctor specialities to id`s this.specialitiId = []; for (let i in this.profileData.speciality) { this.specialitiId.push(this.profileData.speciality[i].id); } this.profileData.speciality = this.specialitiId; //Creating doctor this.HelperService.createPersonal(this.profileData).then((response) => { //Setting worktime of doctor let currentWorktime = []; let type = 0; if (response.data.type === 2) type = 1; for (let index in this.profileData.worktime) { let worktimeData = this.profileData.worktime[index]; worktimeData.doctor = response.data.id; worktimeData.type = type; currentWorktime.push(worktimeData); } let data = angular.copy(response.data); if (currentWorktime.length > 0) { this.HelperService.saveWorktimeByList(currentWorktime).then((response) => { data.worktime = response; }); } data.hours = response.data.worktime.length; //Uploading qualification _forEach(this.qualification, (item) => { let request = { doctor: response.data.id, description: item.qualification }; this.PersonalDependenciesService.createQualification(request).then((response) => { data.qualification.push(response.data); }); }); //Uploading education _forEach(this.education, (item) => { let request = { doctor: response.data.id, description: item.education }; this.PersonalDependenciesService.createEducation(request).then((response) => { data.education.push(response.data); }); }); //Checking avatar for "null" if (this.avatar === null) { this.$timeout(() => { this.PreloadService.clinicStuffList.push(data); this.PreloadService.helperStuffList.push(data); this.saveAlert.delay(5).setContent("ะกะฟะตั†ะธะฐะปะธัั‚ ัะพะทะดะฐะฝ"); this.$state.go("helper.personal.stuff"); }, 1000); } else { this.uploadAvatar(this.lastCroppedDataUrl, this.avatar, data.id, data); } }, (error) => { this.saveButtonState = false; this.saveAlert.dismiss(); alertify.notify("ะžัˆะธะฑะบะฐ!", "error", 1); }); } showDropdownMenu(state) { this.dropdownState = this.dropdownState === state ? null : state; } selectCategory(category) { this.currentCategory = category; // Set category id to profile form this.profileData.category = category.id; } selectDoctorOnCall(doctorOnCall) { this.currentDoctorOnCall = doctorOnCall; let indexDoctorOnCall = this.profileData.allowed_type.indexOf(3); // If status is 1 and not exist in array, append to array if (doctorOnCall.status === 1 && indexDoctorOnCall === -1) { this.profileData.allowed_type.push(3); } // If status is 0 and exist in array, remove from array if (doctorOnCall.status === 0 && indexDoctorOnCall !== -1) { this.profileData.allowed_type.splice(indexDoctorOnCall); } } selectDoctorStatus(status) { this.currentDoctorStatus = status; // Set status to profile form this.profileData.status = status.status; } selectHelper(helper) { this.currentHelper = helper; // Set helper id to profile form this.profileData.helper = helper; } } export default PersonalCreateStuffProfileController;
module.exports = new Date(2013, 0, 22)
(function() { 'use strict'; angular.module('master.detail') .run(ImportTemplate) ImportTemplate.$inject = ['$templateCache']; function ImportTemplate($templateCache){ $templateCache.put('/template/date-picker.directive.html', '<div class="master-detail-container">\n<div class="select-list col-xs-4">\n<div class="select-item-toolbar">\n<div style="width:100%; padding-right: 45px;"><input style="width:100%; vertical-align:middle; height: 34px"></div>\n<div style="display:inline; text-align: center">\n<div class="btn glyphicon glyphicon-plus otis-color" ng-click="addAndSelect()" style="display: inline-block; float:none; top: 5; right: 5; position: absolute;"></div>\n</div>\n</div>\n<div class="select-item"\n ng-class="{\'current-item\': $index === currentIndex}"\n ng-repeat="item in items track by tracker(item)"\n ng-click="updateDetailPane($index)">\n<div class="item-header">{{header(item)}}</div>\n<div class="item-detail" ng-repeat="detail in details">{{detail(item)}}</div>\n</div>\n<div class="list-filler"></div>\n</div>\n<div class="detail-pane col-xs-8">\n<div>\n<div ng-hide="!currentItem" style="display: inline-block" ng-class="{\'refresh-animation\': isRefreshingTransition}">\n<h4 class="item-header">{{header(currentItem)}}</h4>\n<div ng-repeat="detailProp in detailDisplay" style="padding-bottom: 5px; vertical-align: middle;">\n<input ng-if="!detailProp.type" \nclass="detail-input" \nng-model="currentItem[detailProp.property]">\n<input ng-if="detailProp.type === \'password\'" \ntype="password" \nclass="detail-input" \nng-model="currentItem[detailProp.property]">\n<select ng-if="detailProp.type === \'dropdown\'" \nclass="detail-input detail-dropdown" \nng-model="currentItem[detailProp.property]"\nng-options="item as prettify(item) for item in detailProp.listItems">\n</select>\n<label class="input-label">{{prettify(detailProp.label || detailProp.property)}}:</label>\n</div>\n<div style="padding-bottom: 20px; float: right">\n<div class="btn btn-success" ng-click="save()">Save</div>\n<div class="btn btn-danger">Delete</div>\n</div>\n</div>\n</div>\n</div>\n<style type="text/css">\nmaster-detail .select-list {\npadding-left: 0px;\npadding-right: 0px;\n}\n\nmaster-detail .list-filler {\nheight: auto;\nflex: auto;\n}\n\nmaster-detail .select-item{\ntransition: .5s linear;\ntransition: 0.01s color linear;\nheight: 6em;\npadding: 0.5em;\nborder-bottom: solid 0.1em;\nborder-color: rgb(200, 200, 200);\ndisplay: block;\nposition: relative;\n}\n\nmaster-detail .select-item-toolbar {\nheight: auto;\npadding: 5px;\nposition: relative;\n}\n\nmaster-detail .detail-pane {\npadding-left: 1.5em;\npadding-top: 1em;\nborder: solid rgb(200, 200, 200) 0.1em;\n}\n\nmaster-detail .master-detail-container {\ndisplay: flex;\nfont-family: helvetica;\nmargin-top: 1em;\n}\n\nmaster-detail .item-header {\nfont-size: 18px;\nfont-weight: bold;\n}\n\nmaster-detail .item-detail {\nfont-style: italic;\n}\n\nmaster-detail label {\npadding-right: 0.1em;\n}\n\nmaster-detail div.detailPane label {\ncolor: green;\n}\n\nmaster-detail .input-label {\npadding-bottom: 0px; \nline-height: 26px; \nfloat:right;\n}\n\nmaster-detail .detail-input {\nfloat:right; \npadding-left: 5px;\n}\n\nmaster-detail .detail-dropdown {\nwidth: 179px;\nheight: 26px;\n}\n\nmaster-detail .select-item.ng-enter, .select-item.ng-leave-active, .select-item.ng-move {\n-webkit-animation: md-enter 600ms cubic-bezier(0.445, 0.050, 0.550, 0.950);\nanimation: enter 600ms cubic-bezier(0.445, 0.050, 0.550, 0.950);\ndisplay: block;\nposition: relative;\n}\n\nmaster-detail .select-item.ng-enter-active, .select-item.ng-leave, .select-item.ng-move-active {\nborder-color: rgb(200, 200, 200);\nopacity: 1;\ntop:0;\nheight: 6em;\n}\n\n\n@-webkit-keyframes md-enter {\nfrom {\nopacity: 0;\nheight: 0px;\nleft: -70px;\n}\n75% {\nleft: 15px;\n}\nto {\nopacity: 1;\nheight: 6em;\nleft: 0px;\n}\n}\n\n@keyframes md-enter {\nfrom {\nopacity: 0;\nheight: 0px;\nleft: -70px;\n}\n75% {\nleft: 15px;\n}\nto {\nopacity: 1;\nheight: 6em;\nleft: 0px;\n}\n}\n\n\n@-webkit-keyframes leave {\nto {\nopacity: 0;\nheight: 0px;\nleft: -70px;\n}\n25% {\nleft: 15px;\n}\nfrom {\nopacity: 1;\nheight: 6em;\nleft: 0px;\n}\n}\n\n@keyframes leave {\nto {\nopacity: 0;\nheight: 0px;\nleft: -70px;\n}\n25% {\nleft: 15px;\n}\nfrom {\nopacity: 1;\nheight: 6em;\nleft: 0px;\n}\n}\n\nmaster-detail .current-item {\ncolor: #373e44;\nbackground-color: #c0c1c1;\n}\n\nmaster-detail .refresh-animation {\nanimation: md-refresh 0.5s;\n}\n\n@keyframes md-refresh {\n0% {\nopacity: 1;\n}\n50% {\nopacity: 0;\n}\n100% {\nopacity: 1;\n}\n}\n</style>\n</div>') } }());
/* eslint spaced-comment: 0 */ /* eslint no-redeclare: 0 */ /* eslint no-undef: 0 */ /* eslint no-unused-vars: 0 */ /* eslint no-bitwise: 0 */ const assert = require('chai').assert; /// title: Petch /// type: arcade-mode /// categories: /// algorithms /// xor /// encryption /// bit manipulation /// difficulty: 2 /// images: /// public/img/challenges/petch.png /// description: /// <img class='challenge__image' src='public/img/challenges/petch.png'> /// Despite what others say, you and Petch were the best of friends in childhood long before she became famous. In fact during that last summer before she moved away, you two were especially fond of solving cryptography puzzles after finding out about them one day from a magazine at the local market. Among the topics learned, you two learned of the XOR (exclusive-or) function which only outputs true when both inputs are different. In a table concerning bits, it would look like this. /// Input Output /// A B /// 0 0 0 /// 0 1 1 /// 1 0 1 /// 1 1 0 /// Accompanying the XOR function description was a 6-bit abbreviated ASCII set. /// !"#$%&'()*+,-./0123456789:;=?@[\]^_abcdefghijklmnopqrstuvwxyz|~ /// With the corresponding numbering in decimal, /// ! " ... /// 0 1 2 ... /// And in binary, /// 0 000000 /// ! 1 000001 /// " 2 000010 /// ... /// z 61 111101 /// | 62 111110 /// ~ 63 111111 /// You both also learned of the one-time pad, an uncrackable encryption technique that uses a one-time pre-shared key the same or longer than the message being sent. You two were inseparable. /// There then came a day when you found out. She had to move because her father had to relocate for work. You both knew what this meant. A few days before she left, she handed you a one-time pad. "In case anything happens," she said with a smirk on her face. "In case," you replied with a grin across yours. /// Fast forward to the present, you found out a few years ago that Petch has become a famous singer with millions of Twitter followers. Thinking that she may have long forgotten about you, you decide to anonymously follow her on Twitter, once in a while checking to see how her life is evolving. /// Then one day it happened. You saw the string of seemingly random characters in her most recent tweet. You knew beyond a doubt it was directed to you. You need to deciper her message. /// Implement a function that uses the XOR cipher to encrypt/decrypt messages when provided with a key and message. /// challengeSeed: const characterSet = ` !"#$%&'()*+,-./0123456789:;=?@[\\]^_abcdefghijklmnopqrstuvwxyz|~`; const OTP = `;'z@qxkw]0i"'8]mn64'y.x2*@xj87zy]k:xf"!p,!e(-xuar%!19#[t,@ &n r cido3j7( w_^$8^hyj1#d[rt.8_/4(1)]_c.l.75[r-mt]%8n$2[:y"7,:j:9)c_/"?l?u3pwbgt`; const petchMsg = `h_(^&tk667:"tm]#9]oio.(z^w-%8y532kg3d"jqy!-\\]*2a@jks9ej!xwgknb) 1'/os8bos26_`; function XOR (key, msg) { // Good luck! } // Run the following to get user output: // XOR(OTP, petchMsg); /// solutions: const characterSet = ` !"#$%&'()*+,-./0123456789:;=?@[\\]^_abcdefghijklmnopqrstuvwxyz|~`; const OTP = `;'z@qxkw]0i"'8]mn64'y.x2*@xj87zy]k:xf"!p,!e(-xuar%!19#[t,@ &n r cido3j7( w_^$8^hyj1#d[rt.8_/4(1)]_c.l.75[r-mt]%8n$2[:y"7,:j:9)c_/"?l?u3pwbgt`; const petchMsg = `h_(^&tk667:"tm]#9]oio.(z^w-%8y532kg3d"jqy!-\\]*2a@jks9ej!xwgknb) 1'/os8bos26_`; function XOR (key, msg) { let totalKey = key; while (msg.length > totalKey.length) { totalKey = key.concat(key); } return [...msg].map((ch, i) => { return characterSet[characterSet.indexOf(ch) ^ characterSet.indexOf(totalKey[i])] }).join(''); } // XOR(OTP, petchMsg); /// tail: const encryptedMsg = ''; const decipheredMsg = ''; /// tests: assert(typeof XOR === 'function', 'message: <code>XOR</code> is a function.'); assert(XOR(OTP, encryptedMsg) === decipheredMsg, 'message: <code>XOR</code> did not produce the right message.'); /// id: 59481016e949d6392ed98d4c
#!/usr/bin/env python3 from utilities import ImagesLoader from utilities import VideoLoader from utilities import Visualizer from Line import ImageProcessor import argparse import sys def main(): # enput arguments to main script to select data source data type (images or videos) # and select the source data folder ap = argparse.ArgumentParser(description="Lane detection") ap.add_argument("-d", "--directory", required=True, type=str, help="Data files directory") ap.add_argument("-t", "--file_type", required=True, type=str, help="Choose between videos or images as input") args = vars(ap.parse_args()) test_path = args["directory"] file_type = args["file_type"] print("Selected directory: {}".format(test_path)) print("Selected filte type: {}".format(file_type)) # Test that the input argumets are valid if file_type != "image" and file_type != "video": sys.stderr.write("Error!!! Unrecognized option -t/--file_type option.") print(ap.print_help()) # filter data is used to select only files with a certain extension or name filter_data = (lambda path : path.endswith('project_video.mp4'))\ if file_type == "video"\ else (lambda path : path.endswith('.jpg')) # allocate a Images/VideoLoader class to manage the access to the files to be precessed loader = ImagesLoader(test_path)\ if file_type == "image"\ else VideoLoader(test_path, predicate=filter_data) # Allocate an ImageProcessor class that is responsible to apply the whole # lanes detection pipeline to the data if file_type == "video": processor = ImageProcessor() frame_processor = lambda frame : processor[frame] else: # if the input is a series of images taken from different scenarios is important # to reset the class in order to not use previous image computation on the # current image def frame_processor(frame): processor = ImageProcessor() return processor[frame] # Apply the lanes detection pipeline loader.processData(frame_processor) # Save the result loader.writeOutput("video_out.mp4")\ if file_type == "video"\ else loader.writeOutput("output_images") return if __name__ == "__main__": main()
function readFile({filePath, options = {}, fs}) { return new Promise((resolve, reject) => { fs.readFile(filePath, options, (err, fileContent) => { if (err) return reject(err); return resolve(fileContent); }); }); } module.exports = readFile;
const assert = require('assert'); const base64url = require('base64url'); const JWT = require('../../helpers/jwt'); const instance = require('../../helpers/weak_cache'); const nanoid = require('../../helpers/nanoid'); const opaqueFormat = require('./opaque'); function getClaim(token, claim) { return JSON.parse(base64url.decode(token.split('.')[1]))[claim]; } const use = 'sig'; const FALLBACK_ALG = 'RS256'; module.exports = (provider) => { const opaque = opaqueFormat(provider); async function getSigningAlgAndKey(clientId) { let alg = FALLBACK_ALG; let client; if (clientId) { client = await provider.Client.find(clientId); assert(client); if (client.idTokenSignedResponseAlg !== 'none') { alg = client.idTokenSignedResponseAlg; } } const keystore = alg.startsWith('HS') ? client.keystore : instance(provider).keystore; const key = keystore.get({ alg, use }); return { key, alg }; } return { generateTokenId() { return nanoid(); }, async getValueAndPayload() { const [, payload] = await opaque.getValueAndPayload.call(this); const { jti, accountId: sub, iss, iat, exp, scope, aud, clientId: azp, 'x5t#S256': S256, perms, } = payload; let value; if (this.jwt) { value = this.jwt; } else { const { key, alg } = await getSigningAlgAndKey(azp); value = await JWT.sign({ jti, sub, iss, iat, exp, scope, ...(S256 ? { cnf: { 'x5t#S256': S256 } } : undefined), ...(aud ? { aud, azp } : { aud: azp }), ...(perms ? { perms } : undefined), }, key, alg); } payload.jwt = value; return [value, payload]; }, getTokenId(token) { return getClaim(token, 'jti'); }, async verify(token, stored, { ignoreExpiration, foundByUserCode }) { let jti; if (!foundByUserCode) { assert.deepEqual(token, stored.jwt); jti = this.getTokenId(token); } return opaque.verify.call(this, jti, stored, { ignoreExpiration, foundByUserCode }); }, }; };
from timemachines.skaters.tcn.tcninclusion import using_tcn if using_tcn: import numpy as np from typing import List from timemachines.skatertools.utilities.suppression import no_stdout_stderr def tcn_univariate_iskater(y: [[float]], k: int, a: List = None, t: List = None, e=None, tnc_onnx_model=None): """ """ if a: assert len(a) == len(y) + k if np.isscalar(y[0]): y0s = [ yt for yt in y] else: y0s = [ yt[0] for yt in y ] x_std = [1.0 for _ in x] return x, x_std if __name__=='__main__': assert using_tcn, 'pip install keras' import numpy as np import time st = time.time() y = list(np.cumsum(np.random.randn(400))) x, x_std = tcn_univariate_iskater(y=y, k=5) print(x) print(time.time()-st)
# Copyright (c) 2020-2021 by Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel, and University of Kassel. All rights reserved. # Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. from pandapipes.component_models.auxiliaries.component_toolbox import init_results_element try: import pandaplan.core.pplog as logging except ImportError: import logging logger = logging.getLogger(__name__) class Component: @classmethod def table_name(cls): raise NotImplementedError() @classmethod def extract_results(cls, net, options, node_name): """ Function that extracts certain results. :param net: The pandapipes network :type net: pandapipesNet :param options: :type options: :param node_name: :type node_name: :return: No Output. """ output, all_float = cls.get_result_table(net) init_results_element(net, cls.table_name(), output, all_float) res_table = net["res_" + cls.table_name()] return res_table @classmethod def get_component_input(cls): """ :return: :rtype: """ raise NotImplementedError @classmethod def get_result_table(cls, net): """ Get result table. :param net: a pandapipes net :type net: pandapipes.pandapipesNet :return: :rtype: """ raise NotImplementedError @classmethod def create_node_lookups(cls, net, ft_lookups, table_lookup, idx_lookups, current_start, current_table, internal_nodes_lookup): """ Function which creates node lookups. :param net: The pandapipes network :type net: pandapipesNet :param ft_lookups: :type ft_lookups: :param table_lookup: :type table_lookup: :param idx_lookups: :type idx_lookups: :param current_start: :type current_start: :param current_table: :type current_table: :param internal_nodes_lookup: :type internal_nodes_lookup: :return: :rtype: """ return current_start, current_table @classmethod def create_branch_lookups(cls, net, ft_lookups, table_lookup, idx_lookups, current_table, current_start): """ Function which creates branch lookups. :param net: The pandapipes network :type net: pandapipesNet :param ft_lookups: :type ft_lookups: :param table_lookup: :type table_lookup: :param idx_lookups: :type idx_lookups: :param current_table: :type current_table: :param current_start: :type current_start: :return: No Output. """ return current_start, current_table @classmethod def create_pit_node_entries(cls, net, node_pit, node_name): """ Function which creates pit branch entries. :param net: The pandapipes network :type net: pandapipesNet :param branch_pit: :type branch_pit: :return: No Output. """ pass @classmethod def create_pit_branch_entries(cls, net, branch_pit, node_name): """ Function which creates pit branch entries. :param net: The pandapipes network :type net: pandapipesNet :param node_pit: :type node_pit: :return: No Output. """ pass @classmethod def calculate_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lookups, options): """ Function which creates derivatives. :param net: The pandapipes network :type net: pandapipesNet :param branch_component_pit: :type branch_component_pit: :param node_pit: :type node_pit: :param idx_lookups: :type idx_lookups: :param options: :type options: :return: No Output. """ pass @classmethod def calculate_derivatives_thermal(cls, net, branch_pit, node_pit, idx_lookups, options): """ Function which creates derivatives. :param net: The pandapipes network :type net: pandapipesNet :param branch_component_pit: :type branch_component_pit: :param node_pit: :type node_pit: :param idx_lookups: :type idx_lookups: :param options: :type options: :return: No Output. """ pass
function my_function272(){ //17953822051003585400789088221343NSPoQYqTTdKKYreiTQBPxWAYZicQKWTm } function my_function388(){ //35199948924579126851970967085228SSOWTfZwXcvtnBwvEtnUqlVqdlBuxDPT } function my_function549(){ //53812885939313256799466706937290wFRUjfnOVVmmsGbhRHLuOaKoTZHEQHHU } function my_function489(){ //26340469025286592649471912080001jmyroAKdDAXouHyDWSAjIDCxvzFiJFTn } function my_function105(){ //09305683606460321559483127058573vTwYlFHmJjgZEprryNWQawGJlviNRFIO } function my_function345(){ //96194149804083303970811141907844OYpDgsckhCIWsxxemLzfCHaKtysNzaOR } function my_function282(){ //28712269551888945630950725799043lCvwYlmhuxsswqHkfHeBQRJdYiICDGCz } function my_function396(){ //90976688452995147936196573322962bGBTACiAUwFUtqxCZwdNpQOqDLUzSzms } function my_function427(){ //97537835585156294718021704552371lengNCZjNwvEIjskCiuJtNjWARDWfFiW }
define(['app'], function (app) { app.factory('authInterceptor', authInterceptor); authInterceptor.$inject = ['$window']; function authInterceptor($window) { var storage = $window.localStorage; var factory = { request: request, response: response }; return factory; function request(config) { var token = storage.getItem('userToken'); if (token) { config.headers.authorization = 'ali is just.' + token; } return config; } function response(res) { return res; } } app.config(function ($httpProvider) { $httpProvider.interceptors.push('authInterceptor'); }); });
import json import argparse import torch import os import random import numpy as np import requests import logging import math import copy import string import faiss import wandb from time import time from tqdm import tqdm, trange from densephrases.utils.single_utils import set_seed from densephrases.utils.eval_utils import normalize_answer, f1_score, exact_match_score, drqa_exact_match_score, \ drqa_regex_match_score, drqa_metric_max_over_ground_truths, drqa_normalize from densephrases.utils.open_utils import load_query_encoder, load_phrase_index, get_query2vec, load_qa_pairs from eval_phrase_retrieval import evaluate_results from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset from torch.utils.data.distributed import DistributedSampler from eval_reader import eval_reader from transformers import ( MODEL_MAPPING, AutoConfig, AutoTokenizer, AutoModel, AutoModelForQuestionAnswering, AdamW, get_linear_schedule_with_warmup, ) from reader import Reader from utils import process_sample, process_reader_input logging.basicConfig(format='%(asctime)s - %(levelname)s - %(name)s - %(message)s', datefmt='%m/%d/%Y %H:%M:%S', level=logging.INFO) logger = logging.getLogger(__name__) def train_reader(args): #wandb setup wandb.init(project="DensePhrases-Reader-Training", entity='howard-yen', mode="online" if args.wandb else "disabled") wandb.config.update(args) # Setup CUDA, GPU & distributed training if args.local_rank == -1 or not args.cuda: device = torch.device("cuda" if torch.cuda.is_available() and args.cuda else "cpu") args.n_gpu = 0 if not args.cuda else torch.cuda.device_count() else: # Initializes the distributed backend which will take care of sychronizing nodes/GPUs torch.cuda.set_device(args.local_rank) device = torch.device("cuda", args.local_rank) torch.distributed.init_process_group(backend="nccl") args.n_gpu = 1 args.device = device torch.cuda.empty_cache() logger.info('Training BERT model used for reading') config = AutoConfig.from_pretrained(args.config_name if args.config_name else args.pretrained_name_or_path, cache_dir=args.cache_dir if args.cache_dir else None) tokenizer = AutoTokenizer.from_pretrained(args.tokenizer_name if args.tokenizer_name else args.pretrained_name_or_path, cache_dir=args.cache_dir if args.cache_dir else None) model = Reader(config=config) model.to(device) # Check if saved model states exist if args.load_dir: if os.path.isfile(os.path.join(args.load_dir, "reader_model_load")): # Load in saved model states model = model.from_pretrained(os.path.join(args.load_dir, "reader_model_load")) #model.load_state_dict(torch.load(os.path.join(args.load_dir, "reader_model.pt"))) logger.info(f'model loaded from {args.load_dir}') train_dataset = process_reader_input(tokenizer, args.train_file, max_query_length=args.max_query_length, max_seq_length=args.max_seq_length, top_k=args.top_k) args.train_batch_size = args.per_gpu_train_batch_size * max(1, args.n_gpu) train_sampler = RandomSampler(train_dataset) if args.local_rank == -1 else DistributedSampler(train_dataset) train_dataloader = DataLoader(train_dataset, sampler=train_sampler, batch_size=args.train_batch_size) # Optimizer setting def is_train_param(name): if name.endswith("bert_start.embeddings.word_embeddings.weight") or \ name.endswith("bert_end.embeddings.word_embeddings.weight") or \ name.endswith("bert_q_start.embeddings.word_embeddings.weight") or \ name.endswith("bert_q_end.embeddings.word_embeddings.weight"): logger.info(f'freezing {name}') return False return True if args.max_steps > 0: t_total = args.max_steps args.num_train_epochs = args.max_steps // (len(train_dataloader) // args.gradient_accumulation_steps) + 1 else: t_total = len(train_dataloader) // args.gradient_accumulation_steps * args.num_train_epochs no_decay = ["bias", "LayerNorm.weight"] optimizer_grouped_parameters = [{ "params": [ p for n, p in model.named_parameters() \ if not any(nd in n for nd in no_decay) and is_train_param(n) ], "weight_decay": args.weight_decay, }, { "params": [ p for n, p in model.named_parameters() \ if any(nd in n for nd in no_decay) and is_train_param(n) ], "weight_decay": 0.0 }, ] optimizer = AdamW(optimizer_grouped_parameters, lr=args.learning_rate, eps=args.adam_epsilon) scheduler = get_linear_schedule_with_warmup( optimizer, num_warmup_steps=args.warmup_steps, num_training_steps=t_total ) # Check if saved optimizer or scheduler states exist if args.load_dir: if os.path.isfile(os.path.join(args.load_dir, "optimizer.pt")) and os.path.isfile( os.path.join(args.load_dir, "scheduler.pt") ): # Load in optimizer and scheduler states optimizer.load_state_dict(torch.load(os.path.join(args.load_dir, "optimizer.pt"))) scheduler.load_state_dict(torch.load(os.path.join(args.load_dir, "scheduler.pt"))) logger.info(f'optimizer and scheduler loaded from {args.load_dir}') if args.fp16: try: from apex import amp except ImportError: raise ImportError("Please install apex from https://www.github.com/nvidia/apex to use fp16 training.") model, optimizer = amp.initialize(model, optimizer, opt_level=args.fp16_opt_level) # multi-gpu training (should be after apex fp16 initialization) if args.n_gpu > 1: model = torch.nn.DataParallel(model) # Distributed training (should be after apex fp16 initialization) if args.local_rank != -1: model = torch.nn.parallel.DistributedDataParallel( model, device_ids=[args.local_rank], output_device=args.local_rank, find_unused_parameters=True ) # Train! logger.info("***** Running training *****") logger.info(" Num examples = %d", len(train_dataset)) logger.info(" Num Epochs = %d", args.num_train_epochs) logger.info(" Number of GPU = %d", args.n_gpu) logger.info(" Instantaneous batch size per GPU = %d", args.per_gpu_train_batch_size) logger.info( " Total train batch size (w. parallel, distributed & accumulation) = %d", args.train_batch_size * args.gradient_accumulation_steps * (torch.distributed.get_world_size() if args.local_rank != -1 else 1), ) logger.info(" Gradient Accumulation steps = %d", args.gradient_accumulation_steps) logger.info(" Total optimization steps = %d", t_total) global_step = 1 epochs_trained = 0 steps_trained_in_current_epoch = 0 # Check if continuing training from a checkpoint if args.load_dir: try: # set global_step to global_step of last saved checkpoint from model path checkpoint_suffix = args.load_dir.split("-")[-1].split("/")[0] global_step = int(checkpoint_suffix) epochs_trained = global_step // (len(train_dataloader) // args.gradient_accumulation_steps) steps_trained_in_current_epoch = global_step % (len(train_dataloader) // args.gradient_accumulation_steps) logger.info(" Continuing training from checkpoint, will skip to saved global_step") logger.info(" Continuing training from epoch %d", epochs_trained) logger.info(" Continuing training from global step %d", global_step) logger.info(" Will skip the first %d steps in the first epoch", steps_trained_in_current_epoch) except ValueError: logger.info(" Starting fine-tuning.") tr_loss, logging_loss = 0.0, 0.0 model.zero_grad() train_iterator = trange( epochs_trained, int(args.num_train_epochs), desc="Epoch", disable=args.local_rank not in [-1, 0] ) # Added here for reproductibility set_seed(args) for ep_idx, _ in enumerate(train_iterator): logger.info(f"\n[Epoch {ep_idx+1}]") epoch_iterator = tqdm(train_dataloader, desc="Iteration", disable=args.local_rank not in [-1, 0]) for step, batch in enumerate(epoch_iterator): # Skip past any already trained steps if resuming training if steps_trained_in_current_epoch > 0: steps_trained_in_current_epoch -= 1 continue model.train() torch.cuda.empty_cache() batch = tuple(t.to(device) for t in batch) inputs = { "input_ids": batch[0], "token_type_ids": batch[1], "attention_mask": batch[2], "start_positions": batch[3], "end_positions": batch[4], "is_impossible": batch[5], "rank": batch[6], #"input_ids_": batch[8], #"attention_mask_": batch[9], #"token_type_ids_": batch[10], } # skip this batch if none of the questions have a good passage if inputs['rank'].max() == -1: continue N = inputs['is_impossible'].size(0) # in batch negatives #for im_idx, im in enumerate(inputs['is_impossible']): # logger.info('doing in-batch negatives') # # can fill with negative example if didn't have passage # # can change to only have one positive passage during training # replace_count = torch.numel(im[im==-1]) # if replace_count == 0: # continue # # for now, assume batch_size >= top_k # replacements = torch.randperm(N-1) # replacements[replacements >= im_idx] += 1 # input_temp = inputs['input_ids'][im_idx][0] # type_temp = inputs['token_type_ids'][im_idx][0] # question_str = input_temp[type_temp == 0] # question_str = tokenizer.decode(question_str.tolist()) # for rep_idx, rep in enumerate(replacements): # if rep_idx >= replace_count: # break # input_temp = inputs['input_ids'][rep][0] # type_temp = inputs['token_type_ids'][rep][0] # passage_str = input_temp[type_temp == 1] # passage_str = tokenizer.decode(passage_str.tolist()) # new_encoded = tokenizer.encode_plus(question_str, text_pair=question_str, max_length=args.max_seq_length, pad_to_max_length=True, return_token_type_ids=True, return_attention_mask=True) # inputs['input_ids'][im_idx][args.top_k - replace_count + rep_idx] = torch.tensor(new_encoded['input_ids']).to(device) # inputs['token_type_ids'][im_idx][args.top_k - replace_count + rep_idx] = torch.tensor(new_encoded['token_type_ids']).to(device) # inputs['attention_mask'][im_idx][args.top_k - replace_count + rep_idx] = torch.tensor(new_encoded['attention_mask']).to(device) loss = model(**inputs) if args.n_gpu > 1: loss = loss.mean() # mean() to average on multi-gpu parallel (not distributed) training if args.gradient_accumulation_steps > 1: loss = loss / args.gradient_accumulation_steps epoch_iterator.set_description(f"Loss={loss.item():.3f}") if args.fp16: with amp.scale_loss(loss, optimizer) as scaled_loss: scaled_loss.backward() else: loss.backward() tr_loss += loss.item() if (step + 1) % args.gradient_accumulation_steps == 0: if args.fp16: torch.nn.utils.clip_grad_norm_(amp.master_params(optimizer), args.max_grad_norm) else: torch.nn.utils.clip_grad_norm_(model.parameters(), args.max_grad_norm) optimizer.step() scheduler.step() # Update learning rate schedule model.zero_grad() global_step += 1 # Log metrics if args.local_rank in [-1, 0] and args.logging_steps > 0 and global_step % args.logging_steps == 0: # Only evaluate when single GPU otherwise metrics may not average well if args.local_rank == -1 and args.evaluate_during_training: # Validation acc logger.setLevel(logging.WARNING) results, _ = eval_result_bert(args, model, tokenizer, config) #, prefix=global_step) wandb.log( {"Eval EM": results['exact'], "Eval F1": results['f1']}, step=global_step, ) logger.setLevel(logging.INFO) wandb.log( {"lr": scheduler.get_lr()[0], "loss": (tr_loss - logging_loss) / args.logging_steps}, step=global_step ) logging_loss = tr_loss # Save model checkpoint if args.local_rank in [-1, 0] and args.save_steps > 0 and global_step % args.save_steps == 0: #output_dir = os.path.join(args.output_dir, "checkpoint-{}".format(global_step)) output_dir = os.path.join(args.output_dir, f"checkpoint-{global_step}-{args.gradient_accumulation_steps}grad-{args.learning_rate}lr".format(global_step)) if not os.path.exists(output_dir): os.makedirs(output_dir) # Take care of distributed/parallel training model_to_save = model.module if hasattr(model, "module") else model #model_to_save.save_pretrained(output_dir) #torch.save(model_to_save.state_dict(), os.path.join(output_dir, 'reader_model.pt')) model_to_save.save_pretrained(os.path.join(output_dir, 'reader_model')) torch.save(args, os.path.join(output_dir, "training_args.bin")) logger.info("Saving model checkpoint to %s", output_dir) torch.save(optimizer.state_dict(), os.path.join(output_dir, "optimizer.pt")) torch.save(scheduler.state_dict(), os.path.join(output_dir, "scheduler.pt")) logger.info("Saving optimizer and scheduler states to %s", output_dir) batch = tuple(t.to('cpu') for t in batch) if args.max_steps > 0 and global_step > args.max_steps: epoch_iterator.close() break if args.max_steps > 0 and global_step > args.max_steps: train_iterator.close() break if args.local_rank in [-1, 0]: args.test_path = "/n/fs/nlp-hyen/DensePhrases/outputs/dph-nqsqd-pb2_pq96-nq-10/pred/test_preprocessed_3610.pred" eval_reader(args=args, model=model, tokenizer=tokenizer, config=config) return global_step, tr_loss / global_step if __name__ == '__main__': parser = argparse.ArgumentParser() # QueryEncoder parser.add_argument('--model_type', default='bert', type=str) parser.add_argument("--pretrained_name_or_path", default='SpanBERT/spanbert-base-cased', type=str) parser.add_argument("--config_name", default="", type=str) parser.add_argument("--tokenizer_name", default="", type=str) parser.add_argument("--do_lower_case", default=False, action='store_true') parser.add_argument('--max_query_length', default=64, type=int) parser.add_argument("--cache_dir", default=None, type=str) parser.add_argument("--query_encoder_path", default='', type=str) parser.add_argument("--query_port", default='-1', type=str) # PhraseIndex parser.add_argument('--dump_dir', default='dump') parser.add_argument('--phrase_dir', default='phrase') parser.add_argument('--index_dir', default='256_flat_SQ4') parser.add_argument('--index_name', default='index.faiss') parser.add_argument('--idx2id_name', default='idx2id.hdf5') parser.add_argument('--index_port', default='-1', type=str) # These can be dynamically changed. parser.add_argument('--max_answer_length', default=10, type=int) parser.add_argument('--top_k', default=10, type=int) parser.add_argument('--nprobe', default=256, type=int) parser.add_argument('--truecase', default=False, action='store_true') parser.add_argument("--truecase_path", default='truecase/english_with_questions.dist', type=str) # KILT parser.add_argument('--is_kilt', default=False, action='store_true') parser.add_argument('--kilt_gold_path', default='kilt/trex/trex-dev-kilt.jsonl') parser.add_argument('--title2wikiid_path', default='wikidump/title2wikiid.json') # Serving options parser.add_argument('--examples_path', default='examples.txt') # Training query encoder parser.add_argument('--train_path', default=None) parser.add_argument('--per_gpu_train_batch_size', default=48, type=int) parser.add_argument('--num_train_epochs', default=10, type=float) parser.add_argument("--learning_rate", default=3e-5, type=float) parser.add_argument("--warmup_steps", default=0.1, type=int) parser.add_argument('--gradient_accumulation_steps', type=int, default=1) parser.add_argument("--weight_decay", default=0.1, type=float, help="Weight decay if we apply some.") parser.add_argument("--adam_epsilon", default=1e-8, type=float, help="Epsilon for Adam optimizer.") parser.add_argument("--max_grad_norm", default=1.0, type=float, help="Max gradient norm.") parser.add_argument("--use_inbatch_neg", action="store_true", help="Whether to run with inb-neg.") parser.add_argument("--fp16", action="store_true", help="For fp16") parser.add_argument('--output_dir', default=None, type=str) # Training bert reranker parser.add_argument( "--max_seq_length", default=384, type=int, help="The maximum total input sequence length after WordPiece tokenization. Sequences " "longer than this will be truncated, and sequences shorter than this will be padded.", ) parser.add_argument( "--data_dir", default=None, type=str, help="The input data dir. Should contain the .json files for the task." + "If no data dir or train/predict files are specified, will run with tensorflow_datasets.", ) parser.add_argument( "--train_file", default=None, type=str, help="The input training file. If a data dir is specified, will look for the file there" + "If no data dir or train/predict files are specified, will run with tensorflow_datasets.", ) parser.add_argument( "--predict_file", default=None, type=str, help="The input evaluation file. If a data dir is specified, will look for the file there" + "If no data dir or train/predict files are specified, will run with tensorflow_datasets.", ) parser.add_argument( "--doc_stride", default=128, type=int, help="When splitting up a long document into chunks, how much stride to take between chunks.", ) parser.add_argument("--append_title", action="store_true", help="Whether to append title in context.") parser.add_argument("--threads", type=int, default=20, help="multiple threads for converting example to features") parser.add_argument( "--max_steps", default=-1, type=int, help="If > 0: set total number of training steps to perform. Override num_train_epochs.", ) parser.add_argument( "--fp16_opt_level", type=str, default="O1", help="For fp16: Apex AMP optimization level selected in ['O0', 'O1', 'O2', and 'O3']." "See details at https://nvidia.github.io/apex/amp.html", ) parser.add_argument("--local_rank", type=int, default=-1, help="local_rank for distributed training on gpus") parser.add_argument( "--version_2_with_negative", action="store_true", help="If true, the SQuAD examples contain some that do not have an answer.", ) parser.add_argument( "--load_dir", default=None, type=str, help="The load directory where the model checkpoints are saved. Set to output_dir if not specified.", ) parser.add_argument("--logging_steps", type=int, default=5000, help="Log every X updates steps.") parser.add_argument("--save_steps", type=int, default=9999999999, help="Save checkpoint every X updates steps.") parser.add_argument( "--evaluate_during_training", action="store_true", help="Run evaluation during training at each logging step." ) # Evaluation parser.add_argument('--dev_path', default='open-qa/nq-open/dev_preprocessed.json') parser.add_argument('--test_path', default='open-qa/nq-open/test_preprocessed.json') parser.add_argument('--candidate_path', default=None) parser.add_argument('--regex', default=False, action='store_true') parser.add_argument('--eval_batch_size', default=10, type=int) # Run mode parser.add_argument('--run_mode', default='train_query') parser.add_argument('--cuda', default=False, action='store_true') parser.add_argument('--draft', default=False, action='store_true') parser.add_argument('--debug', default=False, action='store_true') parser.add_argument('--wandb', default=False, action='store_true') parser.add_argument('--seed', default=1992, type=int) args = parser.parse_args() # Seed for reproducibility random.seed(args.seed) np.random.seed(args.seed) torch.manual_seed(args.seed) if torch.cuda.is_available(): torch.cuda.manual_seed_all(args.seed) if args.run_mode == 'train_reader': train_reader(args) else: raise NotImplementedError
# coding=utf-8 # -------------------------------------------------------------------------- # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- from msrest.serialization import Model class OperationDisplay(Model): """Contains the localized display information for this operation. Variables are only populated by the server, and will be ignored when sending a request. :ivar provider: Localized friendly form of the resource provider name :vartype provider: str :ivar resource: Localized friendly form of the resource type related to this operation :vartype resource: str :ivar operation: Localized friendly name for the operation :vartype operation: str :ivar description: Localized friendly description for the operation :vartype description: str """ _validation = { 'provider': {'readonly': True}, 'resource': {'readonly': True}, 'operation': {'readonly': True}, 'description': {'readonly': True}, } _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, 'operation': {'key': 'operation', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, } def __init__(self, **kwargs) -> None: super(OperationDisplay, self).__init__(**kwargs) self.provider = None self.resource = None self.operation = None self.description = None
/* global gtag, URI, getSearchResults, getAutocompleteSuggestions, parseYoutubeVideoID, getYouTubeVideoDescription */ var keyCodes = { SPACEBAR: 32 }; var timeIntervals = { SECONDS: 60 }; /** * YouTube iframe API required setup */ var plyrPlayer; var youTubeDataApiKey = "AIzaSyCxVxsC5k46b8I-CLXlF3cZHjpiqP_myVk"; var currentVideoID; var errorMessage = { init: function() { // nothing for now }, show: function(message) { $("#zen-error").text("ERROR: " + message); $("#zen-error").show(); // Pause if we got an error ZenPlayer.pause(); // When the error message is shown, also hide the player ZenPlayer.hide(); // Send the error to Google Analytics gtag("send", "event", "error", message); }, hide: function() { $("#zen-error").text("").hide(); ZenPlayer.show(); } }; /** * Are we serving the file over file:// * @returns {boolean} */ function isFileProtocol() { return URI(window.location).protocol() === "file"; } function handleYouTubeError(details) { if (typeof details.code === "number") { var message = "Got an unknown error, check the JS console."; var verboseMessage = message; // Handle the different error codes switch (details.code) { case 2: verboseMessage = "The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks."; message = "looks like an invalid video ID"; break; case 5: verboseMessage = "The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred."; message = "we can't play that video here, or something is wrong with YouTube's iframe API"; break; case 100: verboseMessage = "The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private."; message = "we can't find that video, it might be private or removed"; break; case 101: verboseMessage = "The owner of the requested video does not allow it to be played in embedded players."; message = "the video owner won't allow us to play that video"; break; case 150: verboseMessage = "This error is the same as 101. It's just a 101 error in disguise!"; message = "the video owner won't allow us to play that video"; break; } // Update the UI w/ error errorMessage.show(message); gtag("send", "event", "YouTube iframe API error", verboseMessage); // Log debug info console.log("Verbose debug error message: ", verboseMessage); } } // One day, try to move all globals under the ZenPlayer object var ZenPlayer = { updated: false, isPlaying: false, isRepeat: false, init: function(videoID) { // Inject svg with control icons $("#plyr-svg").load("../bower_components/plyr/dist/plyr.svg"); plyrPlayer = document.querySelector(".plyr"); plyr.setup(plyrPlayer, { autoplay: true, controls: ["play", "progress", "current-time", "duration", "mute", "volume"], hideControls: false }); // Load video into Plyr player if (plyrPlayer.plyr) { var that = this; plyrPlayer.addEventListener("error", function(event) { if (event && event.detail && typeof event.detail.code === "number") { handleYouTubeError(event.detail); ZenPlayer.hide(); } }); plyrPlayer.addEventListener("ready", function() { // Noop if we have nothing to play if (!currentVideoID || currentVideoID.length === 0) { return; } // gtagther video info that.videoTitle = plyrPlayer.plyr.embed.getVideoData().title; that.videoAuthor = plyrPlayer.plyr.embed.getVideoData().author; that.videoDuration = plyrPlayer.plyr.embed.getDuration(); that.videoDescription = that.getVideoDescription(videoID); that.videoUrl = plyrPlayer.plyr.embed.getVideoUrl(); // Updates the time position by a given argument in URL // IE https://zenplayer.audio/?v=koJv-j1usoI&t=30 starts at 0:30 var t = getCurrentTimePosition(); if (t) { that.videoPosition = t; window.sessionStorage[videoID] = t; } // Initialize UI that.setupTitle(); that.setupVideoDescription(videoID); that.setupPlyrToggle(); }); plyrPlayer.addEventListener("playing", function() { var videoDuration = plyrPlayer.plyr.embed.getDuration(); if (that.updated || videoDuration === 0) { return; } // Start video from where we left off, if it makes sense if (window.sessionStorage && window.sessionStorage.hasOwnProperty(videoID)) { var resumeTime = window.sessionStorage[videoID]; if (!isNaN(resumeTime) && resumeTime < videoDuration - 3) { plyrPlayer.plyr.embed.seekTo(resumeTime); } } that.updated = true; // Analytics gtag("send", "event", "Playing YouTube video title", that.videoTitle); gtag("send", "event", "Playing YouTube video author", that.videoAuthor); gtag("send", "event", "Playing YouTube video duration (seconds)", that.videoDuration); // Show player that.show(); updateTweetMessage(); }); plyrPlayer.addEventListener("timeupdate", function() { // Nothing is playing if (!plyrPlayer.plyr || !plyrPlayer.plyr.embed) { return; } // Store the current time of the video. var resumeTime = 0; var videoDuration = plyrPlayer.plyr.embed.getDuration(); if (window.sessionStorage && videoDuration > 0) { var currentTime = plyrPlayer.plyr.embed.getCurrentTime(); /** * Only store the current time if the video isn't done * playing yet. If the video finished already, then it * should start off at the beginning next time. * There is a fuzzy 3 seconds because sometimes the video * will end a few seconds before the video duration. */ if (currentTime < videoDuration - 3) { resumeTime = currentTime; } // check time and if isRepeat == true if (currentTime >= videoDuration && that.isRepeat) { resumeTime = 0; plyrPlayer.plyr.embed.seekTo(resumeTime); ZenPlayer.play(); } window.sessionStorage[videoID] = resumeTime; } var updatedUrl = that.videoUrl; if (resumeTime > 0) { updatedUrl = that.videoUrl + "&t=" + Math.round(resumeTime); $("#zen-video-title").attr("href", updatedUrl); } else if (resumeTime <= 0 && $("#zen-video-title").attr("href") !== that.videoUrl) { updatedUrl = that.videoUrl; } $("#zen-video-title").attr("href", updatedUrl); }); plyrPlayer.addEventListener("playing", function() { this.isPlaying = true; }.bind(this)); plyrPlayer.addEventListener("pause", function() { this.isPlaying = false; }.bind(this)); plyrPlayer.plyr.source({ type: "video", title: "Title", sources: [{ src: currentVideoID, type: "youtube" }] }); } }, show: function() { $("#audioplayer").show(); // Hide the demo link as some video is playing $("#demo").hide(); }, hide: function() { $("#audioplayer").hide(); // Show the demo link as no video is playing $("#demo").show(); }, setupTitle: function() { // Prepend music note only if title does not already begin with one. var tmpVideoTitle = this.videoTitle; if (!/^[\u2669\u266A\u266B\u266C\u266D\u266E\u266F]/.test(tmpVideoTitle)) { tmpVideoTitle = "<i class=\"fa fa-music\"></i> " + tmpVideoTitle; } $("#zen-video-title").html(tmpVideoTitle); $("#zen-video-title").attr("href", this.videoUrl); }, setupVideoDescription: function(videoID) { var description = anchorURLs(this.videoDescription); description = anchorTimestamps(description, videoID); $("#zen-video-description").html(description); $("#zen-video-description").hide(); $("#toggleDescription").click(function(event) { toggleElement(event, "#zen-video-description", "Description"); }); }, setupPlyrToggle: function() { // Show player button click event $("#togglePlayer").click(function(event) { toggleElement(event, ".plyr__video-wrapper", "Player"); }); }, getVideoDescription: function(videoID) { var description = ""; if (isFileProtocol()) { console.log("Skipping video description request as we're running the site locally."); $("#toggleDescription").hide(); } else { getYouTubeVideoDescription( videoID, youTubeDataApiKey, function(data) { if (data.items.length === 0) { errorMessage.show("Video description not found"); } else { description = data.items[0].snippet.description; } }, function(jqXHR, textStatus, errorThrown) { logError(jqXHR, textStatus, errorThrown, "Video Description error"); } ); } // If there's no description to show, don't pretend there is if (description.trim().length === 0) { $("#toggleDescription").hide(); } return description; }, play: function() { plyrPlayer.plyr.embed.playVideo(); }, pause: function() { plyrPlayer.plyr.embed.pauseVideo(); } }; /** * Create a twitter message with current song if we have one. */ function updateTweetMessage() { var url = URI("https://zen-audio-player.github.io"); var opts = { text: "Listen to YouTube videos without the distracting visuals", hashTags: "ZenAudioPlayer", url: url.toString() }; var id = getCurrentVideoID(); if (id) { url.setSearch("v", id); opts.url = url.toString(); opts.text = "I'm listening to " + plyrPlayer.plyr.embed.getVideoData().title; } twttr.widgets.createHashtagButton( "ZenAudioPlayer", document.getElementById("tweetButton"), opts ); } function logError(jqXHR, textStatus, errorThrown, _errorMessage) { var responseText = JSON.parse(jqXHR.error().responseText); errorMessage.show(responseText.error.errors[0].message); console.log(_errorMessage, errorThrown); } function toggleElement(event, toggleID, buttonText) { event.preventDefault(); var toggleElement = $(toggleID); toggleElement.toggle("fast"); var toggleTextElement = $("#" + event.currentTarget.id); if (toggleElement.is(":visible")) { // Check for current state(Hide/Show) and toggle it if (toggleTextElement.is(":contains(Hide)")) { toggleTextElement.text("Show " + buttonText); } else if (toggleTextElement.is(":contains(Show)")) { toggleTextElement.text("Hide " + buttonText); } } else { toggleTextElement.text("Show " + buttonText); } } /** * wrapParseYouTubeVideoID the first v query value. * Will return null if there's no v query param * @return {string|null} */ function getCurrentVideoID() { var v = URI(window.location).search(true).v; // If the URL has multiple v parameters, take parsing the last one (usually when ?v=someurl&v=xyz) var r; if (Array.isArray(v)) { r = wrapParseYouTubeVideoID(v.pop()); } else if (v) { r = wrapParseYouTubeVideoID(v); } return r; } /** * Return the current times position, provided by the t query param, parsed to seconds. * @returns {Number} */ function getCurrentTimePosition() { var t = parseInt(URI(window.location).search(true).t, 10); var timeContinue = parseInt(URI(window.location).search(true).time_continue, 10); if (t > 0 && t < Number.MAX_VALUE) { return t; } else if (timeContinue > 0 && timeContinue < Number.MAX_VALUE) { return timeContinue; } return 0; } /** * Return the q query param if one exists. * @returns {string|bool|null} */ function getCurrentSearchQuery() { return URI(window.location).search(true).q; } /** * Remove any search params or fragments from a URL. * @param url * @returns {string} The stripped URL */ function cleanURL(url) { return URI(url).search("").fragment(""); } /** * Return the current URL, appending v=videoID and t=videoPosition, if set. * Remove hashes from the URL. * @param {string} videoID * @param {number} [videoPosition] * @returns {string} */ function makeListenURL(videoID, videoPosition) { var url = cleanURL(window.location); url.setSearch("v", videoID); if (videoPosition) { url.setSearch("t", videoPosition); } return url.toString(); } /** * Return the current url with the Q query param set to the searchQuery. * Strip any hashes from the URL. * @param {string} searchQuery * @returns {string} */ function makeSearchURL(searchQuery) { return cleanURL(window.location).setSearch("q", searchQuery).toString(); } function anchorURLs(text) { /* RegEx to match http or https addresses * This will currently only match TLD of two or three letters * Ends capture when: * (1) it encounters a TLD * (2) it encounters a period (.) or whitespace, if the TLD was followed by a forwardslash (/) */ var re = /((?:http|https)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(?:\/\S*[^\.\s])?)/g; // eslint-disable-line no-useless-escape /* Wraps all found URLs in <a> tags */ return text.replace(re, "<a href=\"$1\" target=\"_blank\">$1</a>"); } function anchorTimestamps(text, videoID) { /* RegEx to match hh:mm:ss h:mm:ss mm:ss m:ss and wraps the timestamps in <a> tags RegEx explanation: ((?:[0-5]\d|\d|) either the string is "colon 00-59" or "0-9" or "blank" (?:\d|\:[0-5]\d) either the string is "colon 0-9" or "colon 00-59" (?:$|\:[0-5]\d)) either the string ends or is a a number between 00-59 */ var re = /((?:[0-5]\d|\d|)(?:\d|\:[0-5]\d)(?:$|\:[0-5]\d))/g; // eslint-disable-line no-useless-escape return text.replace(re, function(match) { return "<a href=\"" + makeListenURL(videoID, convertTimestamp(match)) + "\">" + match + "</a>"; }); } function convertTimestamp(timestamp) { var seconds = 0; var minutes = 0; var hours = 0; var timeComponents = timestamp.split(":"); if (timeComponents.length === 3) { hours = convertHoursToSeconds(timeComponents[0]); minutes = convertMinutesToSeconds(timeComponents[1]); seconds = parseBase10Int(timeComponents[2]); } else { minutes = convertMinutesToSeconds(timeComponents[0]); seconds = parseBase10Int(timeComponents[1]); } return hours + minutes + seconds; } function convertHoursToSeconds(hours) { return parseBase10Int(hours) * timeIntervals.SECONDS * timeIntervals.SECONDS; } function convertMinutesToSeconds(minutes) { return parseBase10Int(minutes) * timeIntervals.SECONDS; } function parseBase10Int(value) { return parseInt(value, 10); } function wrapParseYouTubeVideoID(url) { if (currentVideoID && url === currentVideoID) { // We have already determined the video id return currentVideoID; } var info = parseYoutubeVideoID(url); if (info.id) { currentVideoID = info.id; gtag("send", "event", "video ID format", info.format); return info.id; } else { errorMessage.show("Failed to parse the video ID."); } } // The focus video ID var focusId = "pJ5FD9_Orbg"; // The lofi video ID var lofiId = "5qap5aO4i9A"; // Some demo video's audio, feel free to add more var demos = [ "koJv-j1usoI", // The Glitch Mob - Starve the Ego, Feed the Soul "EBerFisqduk", // Cazzette - Together (Lost Kings Remix) "jxKjOOR9sPU", // The Temper Trap - Sweet Disposition "03O2yKUgrKw" // Mike Mago & Dragonette - Outlines ]; function pickDemo() { return demos[Math.floor(Math.random() * demos.length)]; } $(function() { if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { $("#container").hide(); $("#mobile-message").html("Sorry, we don't support mobile devices."); $("#mobile-message").show(); return; } errorMessage.init(); // How do we know if the value is truly invalid? // Preload the form from the URL var currentVideoID = getCurrentVideoID(); if (currentVideoID) { $("#v").attr("value", currentVideoID); } else { var currentSearchQuery = getCurrentSearchQuery(); if (currentSearchQuery) { $("#v").attr("value", currentSearchQuery); getSearchResults( currentSearchQuery, youTubeDataApiKey, function(data) { if (data.pageInfo.totalResults === 0) { errorMessage.show("No results."); return; } $("#search-results").show(); // Clear out results $("#search-results ul").html(""); var start = "<li><h4><a href=?v="; $.each(data.items, function(index, result) { $("#search-results ul").append(start + result.id.videoId + ">" + result.snippet.title + "</a></h4><a href=?v=" + result.id.videoId + "><img src=" + result.snippet.thumbnails.medium.url + " alt='" + result.snippet.title + "'></a></li>"); }); }, function(jqXHR, textStatus, errorThrown) { logError(jqXHR, textStatus, errorThrown, "Search error"); } ); } } // Autocomplete with youtube suggested queries $("#v").typeahead({ hint: false, highlight: true, minLength: 1 }, { source: function (query, processSync, processAsync) { getAutocompleteSuggestions(query, function(data) { return processAsync($.map(data[1], function(item) { return item[0]; })); }); } }).bind("typeahead:selected", function(obj, datum) { window.location.href = makeSearchURL(datum); }); // Handle form submission $("#form").submit(function(event) { event.preventDefault(); var formValue = $.trim($("#v").val()); var formValueTime = /[?&](t|time_continue)=(\d+)/g.exec(formValue); if (formValueTime && formValueTime.length > 2) { formValue = formValue.replace(formValueTime[0], ""); formValueTime = parseInt(formValueTime[2], 10); } if (formValue) { var videoID = wrapParseYouTubeVideoID(formValue, true); gtag("send", "event", "form submitted", videoID); if (isFileProtocol()) { errorMessage.show("Skipping video lookup request as we're running the site locally."); } else { $.ajax({ url: "https://www.googleapis.com/youtube/v3/videos", dataType: "json", async: false, data: { key: youTubeDataApiKey, part: "snippet", fields: "items/snippet/description", id: videoID }, success: function(data) { if (data.items.length === 0) { window.location.href = makeSearchURL(formValue); } else { window.location.href = makeListenURL(videoID, formValueTime); } } }).fail(function(jqXHR, textStatus, errorThrown) { logError(jqXHR, textStatus, errorThrown, "Lookup error"); }); } } else { // Show the Focus button If there is no search $("#focus-btn").show(); errorMessage.show("Try entering a YouTube video ID or URL!"); } }); // Reverts to Home when there is no text in input $("#v").on("input", function() { if ($("#v").val() === "") { $("#search-results").hide(); } }); $("#toggleRepeat").click(function() { $(this).toggleClass("toggleRepeatActive"); var active = $(this).hasClass("toggleRepeatActive"); if (active) { $(this).html("&#10004; Repeat Track"); } else { $(this).html("Repeat Track"); } ZenPlayer.isRepeat = $(this).hasClass("toggleRepeatActive"); }); // Handle demo link click $("#demo").click(function(event) { event.preventDefault(); gtag("send", "event", "demo", "clicked"); // Don't continue appending to the URL if it appears "good enough". // This is likely only a problem if the demo link didn't work right the first time var pickedDemo = pickDemo(); if (window.location.href.indexOf(demos) === -1) { window.location.href = makeListenURL(pickedDemo); } else { gtag("send", "event", "demo", "already had video ID in URL"); } }); // Handle community favorites click $("#fav-btn").click(function(event) { event.preventDefault(); $( "#focus-btn" ).toggle(); $( "#lofi-btn" ).toggle(); }); // Handle focus link click $("#focus-btn").click(function(event) { event.preventDefault(); gtag("send", "event", "focus", "clicked"); // Redirect to the favorite "focus" URL window.location.href = makeListenURL(focusId); }); // Handle lofi link click $("#lofi-btn").click(function(event) { event.preventDefault(); gtag("send", "event", "lofi", "clicked"); // Redirect to the favorite "lofi" URL window.location.href = makeListenURL(lofiId); }); // Check if the current ID is the community focus ID $(window).on("load", function() { // Show Focus Button if (window.location.href.indexOf(focusId) === -1) { $("#fav-btn").show(); } // Show Lofi Button else if (window.location.href.indexOf(lofiId) === -1) { $("#fav-btn").show(); } else { // Hide community favorites Button $("#fav-btn").hide(); } }); // Load the player ZenPlayer.init(currentVideoID); $(document).on("keyup", function(evt) { // Toggle play/pause if not typing in the search box if (evt.keyCode === keyCodes.SPACEBAR && !$("#v").is(":focus")) { evt.preventDefault(); if (ZenPlayer.isPlaying) { ZenPlayer.pause(); } else { ZenPlayer.play(); } } }); $(document).on("keydown", function(evt) { // If not typing in the search prevent "page down" scrolling if (evt.keyCode === keyCodes.SPACEBAR && !$("#v").is(":focus")) { evt.preventDefault(); } }); });
from lib.framework.NYISO.query import * from lib.framework.NYISO.merge import * import datetime raw_dir = os.path.join(os.getcwd(), 'raw_data', 'NYISO') data_dir = os.path.join(os.getcwd(), 'data', 'NYISO') if os.path.isdir(raw_dir): pass else: os.makedirs(raw_dir) if os.path.isdir(data_dir): pass else: os.makedirs(data_dir) ind = 1 while ind == 1: print('\nPlease enter the start date and duration of the desired data set.') month = int(input('Month: ')) day = int(input('Day: ')) year = int(input('Year (4-digit format): ')) try: datetime.datetime(year=year, month=month, day=day) ind = 0 except: print('\nWARNING: The Date Does NOT Exist. Please Try Again!!') duration = int(input('Duration (in days): ')) data_type = int(input('What type of data? (Answer 1, 2, or 3)\n' '(1) Pricing Data\n' '(2) Power Grid Data\n' '(3) Load Data\n')) if data_type == 1: price = int(input('\nWhat type of pricing data? (Answer 1 or 2)\n' '(1) Locational Based Marginal Prices (LBMP)\n' '(2) Ancillary Services Prices\n')) market = int(input('\nWhich energy market? (Answer 1 or 2)\n' '(1) Day-Ahead Market (DAM)\n' '(2) Real-Time Market (RTM)\n')) if price == 1: level = int(input('\nWhat degree of detail? (Answer 1 or 2)\n' '(1) Zonal\n' '(2) Generator\n')) if price == 1 and market == 1 and level == 1: dataid = 'damlbmp' aggType = 'zone' filenamedataid = dataid elif price == 1 and market == 1 and level == 2: dataid = 'damlbmp' aggType = 'gen' filenamedataid = dataid elif price == 1 and market == 2 and level == 1: dataid = 'realtime' aggType = 'zone' filenamedataid = dataid elif price == 1 and market == 2 and level == 2: dataid = 'realtime' aggType = 'gen' filenamedataid = dataid elif price == 2 and market == 1: dataid = 'damasp' aggType = None filenamedataid = dataid elif price == 2 and market == 2: dataid = 'rtasp' aggType = None filenamedataid = dataid elif data_type == 2: power_grid = int(input('\nWhat type of power grid data? (Answer 1 or 2)\n' '(1) Outages\n' '(2) Constraints\n')) market = int(input('\nWhich energy market? (Answer 1 or 2)\n' '(1) Day-Ahead Market (DAM)\n' '(2) Real-Time Market (RTM)\n')) if power_grid == 1 and market == 2: outage_type = int(input('\nWhat type of outages? (Answer 1 or 2)\n' '(1) Scheduled\n' '(2) Actual\n')) if power_grid == 1 and market == 1: dataid = 'outSched' aggType = None filenamedataid = dataid elif power_grid == 1 and market == 2 and outage_type == 1: dataid = 'schedlineoutages' aggType = None filenamedataid = 'SCLineOutages' elif power_grid == 1 and market == 2 and outage_type == 2: dataid = 'realtimelineoutages' aggType = None filenamedataid = 'RTLineOutages' elif power_grid == 2 and market == 1: dataid = 'DAMLimitingConstraints' aggType = None filenamedataid = dataid elif power_grid == 2 and market == 2: dataid = 'LimitingConstraints' aggType = None filenamedataid = dataid elif data_type == 3: load = int(input('\nWhat type of load data? (Answer 1 or 2)\n' '(1) Load Forecast/Commitment\n' '(2) Actual Load\n')) if load == 1: forecast = int(input('\nWhat type of load forecast/commitment data? (Answer 1, 2, or 3)\n' '(1) ISO Load Forecast\n' '(2) Zonal Bid Load\n' '(3) Weather Forecast\n')) if forecast == 1: dataid = 'isolf' aggType = None filenamedataid = dataid elif forecast == 2: dataid = 'zonalBidLoad' aggType = None filenamedataid = dataid elif forecast == 3: dataid = 'lfweather' aggType = None filenamedataid = dataid else: dataid = 'pal' aggType = None filenamedataid = dataid start = pd.Timestamp(year, month, day).date() end = start + pd.Timedelta(days=duration) startlist = [] temp = pd.Timestamp(start.year, start.month, 1).date() while temp < end: startlist.append(temp) temp += relativedelta(months=1) startdate = [] for s in startlist: startdate.append(str(s.year) + '{:02d}'.format(s.month) + '{:02d}'.format(s.day)) if aggType is None: path = os.path.join('raw_data/NYISO', dataid) else: path = os.path.join('raw_data/NYISO', dataid, aggType) for s in startdate: params = {'dataid': dataid, 'type': aggType, 'startdate': s, 'filenamedataid':filenamedataid, 'path': path} if params['type'] is None: full_url = base_url + '/%s/%s%s_csv.zip' % (params['dataid'], s, params['filenamedataid']) else: full_url = base_url + '/%s/%s%s_%s_csv.zip' %(params['dataid'], s, params['filenamedataid'], params['type']) print('\nDownloading from...\n' '\n%s' % full_url) write_request(params) merge(path, dataid, start, duration) print('\nYour data has been successfully downloaded!\n' 'Check your directory \'data/NYISO\'')
context = describe; describe('the JavaScript language', () => { describe('has different types and operators', () => { it('considers numbers to be equal to their string representation', () => { expect(1 == '1').toBeTruthy(); expect(1 != '1').toBeFalsy(); }); it('knows that numbers and strings are not exactly the same', () => { expect(1 === '1').toBeFalsy(); expect(1 !== '1').toBeTruthy(); }); it('joins parts as string when using the plus operator', () => { expect(1 + 'a').toEqual('1a'); }); it('operates integers before joining the string', () => { expect(1 + 1 + '2').toEqual('22'); }); it('knows the type of the variable', () => { const x = 1; expect(typeof x).toEqual('number'); }); it('surprises me, NaN is not comparable with NaN', () => { expect(5 / 'a').toEqual(5 / 'a'); expect(typeof(NaN)).toEqual('number'); expect(isNaN(5 / 'a')).toBeTruthy(); }); it('considers an empty string to be falsy', () => { expect("" == false).toBeTruthy();// Truthy or Falsy expect("" === false).toBeFalsy();// Truthy or Falsy }); it('considers zero to be falsy', () => { expect(0 == false).toBeTruthy();// Truthy or Falsy expect(0 === false).toBeFalsy();// Truthy or Falsy }); it('considers nulls to be falsy', () => { const x = null; let result; if (x) { result = true; } else { result = false; } expect(result == false).toBeTruthy();// Truthy or Falsy expect(null === false).toBeFalsy();// Truthy or Falsy expect(null == false).toBeFalsy();// Truthy or Falsy }); it('knows the type of a function', () => { function x() { // ... } expect(typeof x).toBe('function'); expect(typeof(xxx)).toBe('undefined'); }); it('has arrays and they can contain anything inside', () => { const arr = [1, 2, 3, 4]; arr.push(5); arr[9] = 6; const matrix = [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 7, 8]]; expect(arr[1]).toEqual(2); expect(arr[4]).toEqual(5); expect(arr[6]).toEqual(undefined); expect(arr[9]).toEqual(6); expect(matrix[0][2]).toEqual('c'); }); it('may contain functions inside arrays', () => { const arr = [ 1, 2, function(arg) { return 3 + arg; } ]; expect(arr[2](1)).toEqual(4); }); it('concatenate arrays - well, kind of', () => { const a = [1, 2, 3]; const b = [4, 5, 6]; expect(a + b).toEqual("1,2,34,5,6"); }); it('joins arrays and strings', () => { const a = [1, 2, 3]; expect ("1" + a).toEqual("11, 2, 3"); expect(a + "1").toEqual("1, 2, 31"); }); it('joins arrays and other things', () => { const a = [1, 2, 3]; const b = ['x', 'y', 'z']; expect(1 + a).toEqual("11, 2, 3"); expect(a + 1).toEqual("1, 2, 31"); expect(1 + b).toEqual("1x, y, z"); expect(true + a).toEqual("true, 1, 2, 3"); }); it("can't compare arrays", () => { const a = [1, 2, 3]; const b = [1, 2, 3]; expect(a == b).toBeFalsy(); // Truthy or Falsy expect(a === b).toBeFalsy(); // Truthy or Falsy }); it('is not the same to compare by value than by reference ', () => { const a = [1, 2, 3]; const b = [1, 2, 3]; expect(a).toEqual(b); // Jasmine toEqual compares by value expect(a).not.toBe(b); // Jasmine toBe compares by reference }); }); describe('considers functions as first class citizens', () => { it('can declare named functions', () => { function example() { return 'some example'; } expect(example()).toEqual("some example"); }); it('can declare anonymous functions', () => { const someVar = function(a, b) { return a + b; }; expect(typeof(someVar)).toBe('function'); expect(someVar(1,1)).toBe(2); }); it('may return anything', () => { function example(arg) { return [arg, arg * 2, arg * 3]; } const result = example(2); expect(result[1]).toEqual(4); }); it('may return arrays that contains functions and so on', () => { function example() { return [function(numb){ return [0,10] }] } expect(example()[0](1)[1]).toEqual(10); }); it("doesn't care about the declaration order when they are named", () => { function exampleA() { return exampleB(1); } expect(exampleA()).toEqual(1); function exampleB(arg1) { return arg1; } }); it('matters, the declaration order when they are anonymous', () => { const exampleA = function() { return exampleB(1); }; expect(exampleA()).toEqual(1); const exampleB = function(arg1) { return arg1; }; }); it('can use optional parameters', () => { function example(a, b, c) { if (c) { return a + b + c; } return a + b; } expect(example(1,1,1)).toBe(3); expect(example(1,1)).toBe(2); }); it('anonymous functions are anonymous', () => { const x = function z() { return 1; }; expect(typeof(z)).toEqual('undefined'); expect(x()).toEqual(1); }); it('can create closures with free variables', () => { function external() { const a = 1; function internal() { return a + 1; } return internal(); } //expect(external()).toBe(); }); it('can create closures with several free variables', () => { function external() { const a = 1, b = 2; function internal() { const c = 3; return a + b + c; } } //expect(external()).toBe(6); }); it('defines a pure function when there are no free variables', () => { function external() { const a = 1, b = 2; function internal(a, b) { const c = 1; return a + b + c; } return internal(4, 4); } //expect(external()).toBe(); }); it('may return arrays that contains closures and so on', () => { function example() { // write the missing code here } //expect(example()[0](1)[1]).toEqual(10); //expect(example()[0](2)[1]).toEqual(11); //expect(example()[0](3)[1]).toEqual(12); }); it('passes primitive types as values (a copy) to functions', () => { function example(arg) { arg = 'test!'; } const x = 1; const y = 'example'; const z = true; example(x); //expect(x).toEqual(); example(y); //expect(y).toEqual(); example(z); //expect(z).toEqual(); }); it('passes arrays by reference', () => { function example(arg) { arg[0] = 100; } const x = [1, 2, 3]; example(x); //expect(x).toEqual(); }); it('passes objects by reference', () => { function example(arg) { arg.property = 'test'; } const x = { property: 'cool!' }; example(x); //expect(x).toEqual(); }); it('may return a function as the result of invoking a function', () => { function add(a, b) { return a + b; } function example() { return add; } //expect(example()(1,2)).toEqual(); const f = example(); //expect(f(2,2)).toEqual(); }); it('can return closures as a function result', () => { function plus(amount) { return function(number) { return number + amount; }; } const f = plus(5); //expect(f(3)).toBe(); }); it('can have functions that receive other functions as arguments', () => { function add(a, b) { return a + b; } function example(arg) { return arg(2, 2) + 1; } //expect(example(add)).toEqual(); }); it('may have functions as the input and the output', () => { function plus(originalFunction) { return function(arg1) { return originalFunction() + arg1; }; } const f = plus(function() { return 1; }); //expect(f(2)).toBe(); }); it("can invoke functions indirectly using the special 'call'", () => { function f(a, b) { return a + b; } //expect(f.call(f,1,1)).toEqual(); }); it("can invoke functions indirectly using the special 'apply'", () => { function f(a, b) { return a + b; } //expect(f.apply(f, [1,1])).toEqual(); }); it("doesn't have a private scope inside blocks", () => { let j = 0; for (let i = 0; i < 5; i++) { j += i; } //expect(i).toEqual(); //expect(j).toEqual(); }); }); describe('has multiple ways to define and create objects', () => { it('can define object literals', () => { const obj = { name: 'bob', theName: function() { return this.name; } }; //expect(obj.theName()).toBe(); }); it('can create properties dynamically', () => { const obj = { name: 'bob', surname: 'sponge' }; obj.address = 'palm tree'; //expect(obj.address).toEqual(); //expect(obj['address']).toEqual(); //expect(obj['name']).toEqual(); }); it('may define complex objects', () => { let user; // write the contents of the obj to make the satisfy the expectations: //expect(user.address.street).toEqual('sesame'); //expect(user.friends[0].name).toEqual('triki'); }); it('has a pattern called, the Module Pattern', () => { function createObject() { let points = 0; return { addPoint: function() { ++points; }, score: function() { return points; } }; } const obj = createObject(); obj.addPoint(); //expect(obj.score()).toEqual(); //expect(typeof(obj.points)).toEqual(); }); it('may create objects also with the module pattern', () => { function createObject(initialScore) { // write the code here } /* const obj = createObject(5, 'red'); obj.incrementScoreIn(5); expect(obj.color).toEqual('red'); expect(obj.points()).toEqual(10); */ }); it('can define constructors', () => { function Obj() { const name = 'bob'; this.theName = function() { return name; }; } const obj = new Obj(); //expect(obj.theName()).toBe(); }); it("may contain 'static' methods", () => { function Obj() { const name = 'bob'; this.theName = function() { return name; }; } Obj.someStaticMethod = function() { return 22; }; //expect(Obj.someStaticMethod()).toBe(); }); it('can have have methods in the prototype', () => { function Obj() { const name = 'bob'; } Obj.prototype.theName = function() { return this.name; }; const obj = new Obj(); //expect(obj.theName()).toEqual(); //expect(obj.theName).toBe(new Obj().theName); }); it('can define a factory', () => { function obj() { const self = {}; const name = 'bob'; self.theName = function() { return name; }; return self; } const instance = obj(); //expect(instance.theName()).toBe(); //expect(instance.theName).not.toBe(obj().theName); }); it('can create methods dynamically on an object instance', () => { const obj = {}; const methodNames = ['meow', 'jump']; for (let i = 0; i < methodNames.length; i++) { obj[[methodNames[i]]] = function() { return 'it works'; }; } //expect(obj.meow()).toEqual(); }); describe('the polymorphism', () => { it('may use constructor plus prototype', () => { function Parent() { this.name = 'parent'; } Parent.prototype.someMethod = function() { return 10; }; function Child() { Parent.call(this); // constructor stealing this.name = 'child'; } Child.prototype = Object.create(Parent.prototype); // prototype chaining const child = new Child(); //expect(child.someMethod()).toEqual(); //expect(child.name).toEqual(); }); it('may use the functional inheritance', () => { function parent() { const name = 'parent'; const self = {}; self.someMethod = function() { return 10; }; return self; } function child() { const name = 'child'; const self = parent(); return self; } const instance = child(); //expect(instance.someMethod()).toBe(); }); }); }); describe('commons patterns with functions and behaviors', () => { it('can invoke functions immediately to take advantage of scopes', () => { const myNamespace = {}; (function(theNamespace) { let counter = 0; theNamespace.addOne = function() { counter++; }; theNamespace.giveMeTheCount = function() { return counter; }; })(myNamespace); myNamespace.addOne(); myNamespace.addOne(); //expect(myNamespace.giveMeTheCount()).toBe(); }); it("hoists variables the way you probably don't expect", () => { function generate() { const functions = []; for (let i = 0; i < 5; i++) { functions.push(function() { return i; }); } return functions; } //expect(generate()[0]()).toEqual(); //expect(generate()[1]()).toEqual(); }); }); context('has ways to simulate classes', () => { // "Class" function Cat() { this.kilos = 1; this.feed = function() { this.kilos++; }; this.isPurring = function() { return true; }; } ////////////////////////////////////// // "Class" ////////////////////////////////////// function Lion(energy) { Cat.call(this); this.energy = energy || 100; const self = this; const run = function() { // private method self.energy -= 10; }; const attack = function() { // private method self.energy -= 5; }; this.playWithFriend = function(friend) { if (friend.isPurring()) self.energy += 10; }; this.hunt = function() { // public method run(); attack(); this.onHunting(); // fire event }; this.onHunting = function() { /* event */ }; } context('and the THIS keyword', () => { let cat; beforeEach(function() { cat = new Cat(); window.kilos = 0; }); it('sometimes works as expected in other languages', () => { cat.feed(); cat.feed(); //expect(cat.kilos).toEqual(); }); it('works different on detached functions', () => { window.kilos = 10; let feed = cat.feed; feed(); //expect(window.kilos).toEqual(); //expect(cat.kilos).toEqual(); }); it('can be bound explicitly with CALL and APPLY', () => { const feed = cat.feed; feed.apply(cat); //expect(cat.kilos).toEqual(); }); it('can be bound in modern browsers with BIND', () => { const feed = cat.feed; const bound = feed.bind(cat); bound(); //expect(cat.kilos).toEqual(); }); it('works different when function is attached to other object', () => { const otherCat = new Cat(); otherCat.kilos = 10; otherCat.feed = cat.feed; otherCat.feed(); //expect(otherCat.kilos).toEqual(); //expect(cat.kilos).toEqual(); }); it('can be handled using the SELF trick', () => { const energy = 200; const lion = new Lion(energy); lion.hunt(); //expect(lion.energy).toEqual(); }); it('interprets the THIS when the function is executed', () => { const energy = 200; const lion = new Lion(); lion.hunt = function() { this.energy = 4000; }; lion.hunt(); //expect(lion.energy).toEqual(); }); }); }); });
import Route from '@ember/routing/route'; export default class JobsRoute extends Route { }
/* eslint-disable no-unused-vars, */ // TODO: This file was created by bulk-decaffeinate. // Fix any style issues and re-enable lint. const mongoose = require('mongoose') const Settings = require('settings-sharelatex') const { Schema } = mongoose const { ObjectId } = Schema const OauthApplicationSchema = new Schema( { id: String, clientSecret: String, grants: [String], name: String, redirectUris: [String], scopes: [String] }, { collection: 'oauthApplications' } ) const conn = mongoose.createConnection(Settings.mongo.url, { server: { poolSize: Settings.mongo.poolSize || 10 }, config: { autoIndex: false } }) const OauthApplication = conn.model('OauthApplication', OauthApplicationSchema) mongoose.model('OauthApplication', OauthApplicationSchema) exports.OauthApplication = OauthApplication exports.OauthApplicationSchema = OauthApplicationSchema
import nengi from 'nengi' import nengiConfig from '../common/nengiConfig' import InputSystem from './InputSystem' import MoveCommand from '../common/command/MoveCommand' import FireCommand from '../common/command/FireCommand' import PIXIRenderer from './graphics/PIXIRenderer' class GameClient { constructor() { this.client = new nengi.Client(nengiConfig) this.renderer = new PIXIRenderer() this.input = new InputSystem() this.client.onConnect(res => { console.log('onConnect response:', res) }) this.client.onClose(() => { console.log('connection closed') }) this.client.connect('ws://localhost:8079') } update(delta, tick, now) { /* receiving */ const network = this.client.readNetwork() network.entities.forEach(snapshot => { snapshot.createEntities.forEach(entity => { this.renderer.createEntity(entity) }) snapshot.updateEntities.forEach(update => { this.renderer.updateEntity(update) }) snapshot.deleteEntities.forEach(nid => { this.renderer.deleteEntity(nid) }) }) network.messages.forEach(message => { this.renderer.processMessage(message) }) network.localMessages.forEach(localMessage => { this.renderer.processLocalMessage(localMessage) }) /* * */ /* sending */ const input = this.input.frameState let rotation = 0 const worldCoord = this.renderer.toWorldCoordinates(this.input.currentState.mx, this.input.currentState.my) if (this.renderer.myEntity) { // calculate the direction our character is facing const dx = worldCoord.x - this.renderer.myEntity.x const dy = worldCoord.y - this.renderer.myEntity.y rotation = Math.atan2(dy, dx) } this.client.addCommand(new MoveCommand(input.w, input.a, input.s, input.d, rotation, delta)) if (input.mouseDown) { this.client.addCommand(new FireCommand(worldCoord.x, worldCoord.y)) } this.input.releaseKeys() this.client.update() /* * */ /* rendering */ this.renderer.update(delta) /* * */ } } export default GameClient
var fileBrowserModule = angular.module('account', ['angularGrid']); fileBrowserModule.controller('accountController', function($scope) { var columnDefs = [ {displayName: '', field: 'item', width: 200, cellRenderer: { renderer: 'group' }}, {displayName: "Units", field: "amount1", group: 'Week 1', width: 75}, {displayName: "GBP", field: "gbp1", group: 'Week 1', width: 75, cellRenderer: currencyRenderer}, {displayName: "Units", field: "amount2", group: 'Week 2', width: 75}, {displayName: "GBP", field: "gbp2", group: 'Week 2', width: 75, cellRenderer: currencyRenderer}, {displayName: "Units", field: "amount3", group: 'Week 3', width: 75}, {displayName: "GBP", field: "gbp3", group: 'Week 3', width: 75, cellRenderer: currencyRenderer}, {displayName: "Units", field: "amountTotal", group: 'Period Total', width: 75}, {displayName: "GBP", field: "gbpTotal", group: 'Period Total', width: 75, cellRenderer: currencyRenderer} ]; function currencyRenderer(params) { if (params.value) { return 'ยฃ ' + params.value.toLocaleString(); } else { return null; } } $scope.gridOptions = { columnDefs: columnDefs, rowData: createRowData(), rowSelection: 'single', groupKeys: ['category'], groupHeaders: true, groupDefaultExpanded: true, groupIncludeFooter: true, groupAggFields: ['amount1','gbp1','amount2','gbp2','amount3','gbp3','amount4','gbp4'], enableColResize: true, enableSorting: false, dontUseScrolls: true, icons: { groupExpanded: '<i class="fa fa-minus-square-o"/>', groupContracted: '<i class="fa fa-plus-square-o"/>' }, enableFilter: false }; function createRowData() { var rows = []; ['Ales','Larger','Cider','Wine','Spirits'].forEach( function (item) { rows.push({category: 'Alcoholic Drinks', item: item}); }); ['Water','Juice','Soda','Milk'].forEach( function (item) { rows.push({category: 'Non-Alcoholic Drinks', item: item}); }); rows.forEach( function(row) { row.amount1 = Math.round(Math.random() * 100); row.amount2 = Math.round(Math.random() * 100); row.amount3 = Math.round(Math.random() * 100); row.amountTotal = row.amount1 + row.amount2 + row.amount3; row.gbp1 = row.amount1 * 22; row.gbp2 = row.amount2 * 22; row.gbp3 = row.amount3 * 22; row.gbpTotal = row.amountTotal * 22; }); return rows; } });
/* โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ• โ–ˆโ–ˆโ•‘โ–„โ–„ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ• โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ•โ–€โ–€โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• */ require('dotenv').config(); // Licence require('./config/licence'); const express = require('express'); const compression = require('compression'); const logger = require('morgan'); const _ = require('lodash'); const path = require('path'); const Ajv = require('ajv').default; const socketIO = require('socket.io'); const fs = require('fs'); const helmet = require('helmet'); const passport = require('passport'); const { I18n } = require('i18n') const app = express(); const swaggerUi = require('swagger-ui-express'); const driver = require('./config/config').db; const instanceVersion = require('./package.json').version; // Routes const userRoutes = require('./api/routes/users'); const plmRoutes = require('./api/routes/plm'); const nodesRoutes = require('./api/routes/nodes'); const relationshipsRoutes = require('./api/routes/relationships'); const nodetypeRoutes = require('./api/routes/nodetypes'); const translationRoutes = require('./api/routes/translations'); const uploadRoutes = require('./api/routes/uploads'); const healthRoutes = require('./api/routes/health'); const configRoutes = require('./api/routes/config'); const logRoutes = require('./api/routes/log'); const filesRoutes = require('./api/routes/files'); const authRoutes = require('./api/routes/auth'); const deprecatedRoutes = require('./api/routes/deprecated'); // External APIs Routes const githubRoutes = require('./api/routes/external-apis/github'); const gitlabRoutes = require('./api/routes/external-apis/gitlab'); const element14Routes = require('./api/routes/external-apis/element14'); const ihsRoutes = require('./api/routes/external-apis/ihs'); const z2DataRoutes = require('./api/routes/external-apis/z2Data'); const { logAndRespond } = require('./api/helpers/controllerHelpers'); const config = require('./config/config'); // we load the db location from the JSON files // Global email Transporter to send emails anywhere global.ganisterMail = require('./api/utils/email'); // Import schema const jsonSchema = require('./api/models/datamodelSchema.json'); global.datamodel = require('./build/datamodel.json'); const cronjobs = require('./cronjobs'); const swaggerDocument = require('./help/swagger/document.json'); const ipfilter = require('express-ipfilter').IpFilter; // Allow the following IPs console.log('config.ipRestrictions', config.ipRestrictions); if (config.ipRestrictions && config.ipRestrictions.activated) { const ips = config.ipRestrictions.allowedIps; // Create the server app.use(ipfilter(ips, { mode: 'allow', log: true, logLevel: 'deny', })); } /* โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ• โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ• โ–ˆโ–ˆโ•‘ โ•šโ•โ• โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ•šโ–ˆโ–ˆโ–ˆโ•”โ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•šโ•โ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• */ // setup static folders app.use(express.static('assets')); app.use(express.static('build')); app.use(express.static('client')); app.use(express.static('node_modules')); app.use(express.static('apps')); app.use('/help/documentation', express.static('help/_generalDoc')); app.use('/help/tech', express.static('help/_techDoc')); if (config.env === 'dev') { app.use('/help/internal', express.static('help/_internalDoc')); } app.use(compression()); const i18n = new I18n({ header: 'ganister-language', locales: ['en', 'fr'], directory: path.join(__dirname, 'api/utils/locales'), register: global, }) app.use(i18n.init); app.use(helmet()); app.use(logger('dev')); app.use(express.urlencoded({ extended: false, limit: '50mb' })); app.use(express.json({ limit: '50mb' })); app.use(passport.initialize()); const options = { customCss: '.swagger-ui .topbar { display: none }', displayRequestDuration: true, filter: true, }; app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument, options)); /* โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ• โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• */ app.use('/api/:version/users', userRoutes); app.use('/api/:version/nodes', nodesRoutes, relationshipsRoutes); app.use('/api/:version/nodetypes', nodetypeRoutes); app.use('/api/:version/plm', plmRoutes); app.use('/api/:version/translations', translationRoutes); app.use('/api/:version/uploads', uploadRoutes); app.use('/api/:version/healthReport', healthRoutes); app.use('/api/:version/config', configRoutes); app.use('/api/:version/log', logRoutes); app.use('/api/:version/files', filesRoutes); app.use('/api/:version/', deprecatedRoutes); // External APIs Routes app.use('/api/:version/external-apis/github', githubRoutes); app.use('/api/:version/external-apis/gitlab', gitlabRoutes); app.use('/api/:version/external-apis/element14', element14Routes); app.use('/api/:version/external-apis/ihs', ihsRoutes); app.use('/api/:version/external-apis/z2Data', z2DataRoutes); app.engine('html', require('ejs').renderFile); app.set('view engine', 'ejs'); app.set('views', __dirname); if (config.activeGoogleLogin) { app.use('/auth', authRoutes); } /* โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ• โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ•šโ–ˆโ–ˆโ–ˆโ•”โ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ•šโ•โ•โ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•šโ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ• */ // G-CONFIG app.get('/g-config', (req, res) => { res.sendFile('./main.html', { root: path.join(__dirname, './apps/config') }); }); // OSS builder let packages; fs.readFile('package.json', (err, data) => { if (err) throw err; packages = JSON.parse(data).dependencies; }); app.get('/credits/oss', (req, res) => { res.render('./views/credits/oss', { packages }); }); // Main CLIENT app.get('/', (req, res) => { res.sendFile('./main.html', { root: path.join(__dirname, './client') }); }); // error Handler // eslint-disable-next-line app.use((err, req, res, next) => { const { name, title, statusCode = 500 } = err; if (statusCode === 404 && name !== 'Ganister Error') { return next(); } return logAndRespond(res, err, title); }); // -------------------------------------- 404 handler ---------------------------------------// // catch 404 app.use((req, res) => { res.status(404).sendFile('./404.html', { root: path.join(__dirname, './views/404/') }); }); /* โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ•šโ•โ• โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• */ const ajv = new Ajv({ allErrors: true, allowUnionTypes: true, verbose: true }); // options can be passed, e.g. {allErrors: true} const validate = ajv.compile(jsonSchema); const valid = validate(global.datamodel); const versionSession = driver.session(); const query = 'MATCH (g:Ganister) RETURN g.ganisterVersion as version'; versionSession.run(query) .then((result) => { versionSession.close(); if (result.records.length > 0) { // compare database version and instance version const dbVersion = result.records[0].get('version'); console.log(` - Instance Version : ${instanceVersion} - DB Version : ${dbVersion} `); if (instanceVersion !== dbVersion) { console.log(' WARNING: DB and Server version are different'); } else { console.log(' SUCCESS: DB and Server version are aligned'); } } else { console.error('could not read db version'); } }) .catch(async (error) => { console.error(error); await versionSession.close(); }); const session = driver.session(); const IndexesQuery = `CALL db.indexes()`; let nodetypeIndexesQueries = []; try { console.time(' Read indexes'); session.run(IndexesQuery) .then((res) => { console.timeEnd(' Read indexes'); let missingIndexes = global.datamodel.nodetypeDefinitions.filter((nt) => nt.elementType === 'node').map(nt => nt.name); res.records.forEach((ind) => { const indexName = ind.get('labelsOrTypes')[0]; missingIndexes = missingIndexes.filter(nt => nt != indexName); }); console.time(' Check missing Nodetypes Indexes in DB'); const txcNtIndexes = session.beginTransaction(); nodetypeIndexesQueries = missingIndexes.map((nodetype) => { const nodetypeQuery = ` CREATE INDEX ${nodetype}Id IF NOT EXISTS FOR (n:${nodetype}) ON (n._id) `; try { console.log(nodetypeQuery) return (txcNtIndexes.run(nodetypeQuery)); } catch (error) { console.error(error); } }); Promise.all(nodetypeIndexesQueries) .then(async () => { await txcNtIndexes.commit(); session.close(); console.timeEnd(' Check missing Nodetypes Indexes in DB'); const permissionSetSession = driver.session(); const permissionSetQuery = ` CREATE INDEX PermissionSetName IF NOT EXISTS FOR (n:PermissionSet) ON (n.name) `; console.time(' Check missing PermissionSet Indexes in DB'); try { await permissionSetSession.run(permissionSetQuery) } catch (error) { console.error(error); } finally { await permissionSetSession.close(); console.timeEnd(' Check missing PermissionSet Indexes in DB') } }); }) .catch((error) => { console.error(error); }); } catch (error) { console.error(error); } if (!valid) { console.log('\x1b[31m', ' ERROR: Datamodel is not Valid '); console.log(validate.errors); } else { /* โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ• โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•”โ•โ•โ• โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•šโ•โ• โ•šโ•โ• */ console.log('\x1b[32m', '\n\n\n SUCCESS : Your datamodel is Valid \x1b[0m '); const server = app.listen(config.port, () => { console.log('\x1b[32m', ' SUCCESS : Ganister Server is started \x1b[0m '); console.log(` \x1b[0m ---------------------------------------------------------------------------- | | | โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— | | โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— | | โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• | | โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ• โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— | | โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ | | โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•โ•โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ• โ•šโ•โ• | | | ---------------------------------------------------------------------------- PLM is a graph ! ---------------------------------------------------------------------------- \x1b[32m Ganister Server is running at ${config.url}:${config.port} \x1b[0m ---------------------------------------------------------------------------- Powered by NodeJs/Express/Neo4j ---------------------------------------------------------------------------- \x1b[33m General Documentation is available here: \x1b[32m ${config.url}:${config.port}/help/documentation \x1b[0m \n \x1b[33m Technical Documentation is available here: \x1b[32m ${config.url}:${config.port}/help/tech \x1b[0m \n \x1b[33m API Documentation is available here: \x1b[32m ${config.url}:${config.port}/api-docs/ \x1b[0m \n \x1b[33m Licence Key: ${global.ganister.validLicence ? 'Valid' : 'Trial'} ${global.ganister.expiredLicence ? ' (Licence Key Expired)' : ''} \x1b[32m Nodes: ${global.ganister.nodes} | Expiration Date: ${global.ganister.expirationDate ? global.ganister.expirationDate : 'No expiration date'} \x1b[0m \n ---------------------------------------------------------------------------- `); }); server.keepAliveTimeout = 240 * 1000; server.headersTimeout = 250 * 1000; /* โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• */ const analyticsFreq = 30000; let prevCPUusage = process.cpuUsage(); let cpuUsages = []; const metrics = setInterval(() => { cpuUsages = [process.cpuUsage(), prevCPUusage]; prevCPUusage = process.cpuUsage(); const result = { archi: process.arch, cpuUsage: { user: Math.round((100 * ((cpuUsages[0].user - cpuUsages[1].user) / 1000)) / analyticsFreq), system: Math.round((100 * ((cpuUsages[0].system - cpuUsages[1].system) / 1000)) / analyticsFreq), }, memoryUsage: process.memoryUsage(), platform: process.platform, upTime: process.uptime(), time: Date.now(), }; fs.appendFile(`${__dirname}/log/ressourcesAnalytics.log`, `\n ${JSON.stringify(result)}`, (err) => { if (err) throw err; }); }, analyticsFreq); /* โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ•โ• โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ• */ global.io = socketIO(server); /* global io */ io.on('connection', (sck) => { const socket = sck; // Get connectedUsers function getConnectedUsers() { let connectedUsers = []; Object.keys(io.sockets.sockets).forEach((id) => { if (io.sockets.sockets[id].user) { connectedUsers.push(io.sockets.sockets[id].user); } }); connectedUsers = _.uniqBy(connectedUsers, '_id'); return connectedUsers; } // When User Logged In, store user object in Socket and return connected Users to clients socket.on('loggedIn', (user) => { socket.broadcast.emit('userLoggedIn', user); socket.user = user; io.emit('connectedUsers', getConnectedUsers()); }); // Check if current Socket User is still connected in a different socket function userFoundInSockets(userId) { const connectedUsers = getConnectedUsers(); const userFound = connectedUsers.find(item => item._id === userId); return userFound !== undefined; } // Check if socket disconnected socket.on('disconnect', () => { // If a user is disconnected from all sockets, emit actions to clients if (socket.user) { if (!userFoundInSockets(socket.user._id)) { socket.broadcast.emit('disconnectedUser', socket.user); socket.broadcast.emit('connectedUsers', getConnectedUsers()); } } }); socket.on('message', (from, msg, to, time) => { console.log(`${msg} at ${time}`); io.emit('chat message', { from, msg, to, time, }); }); }); } cronjobs.counter(); module.exports = app; // for testing
// ะ—ะฐะดะฐั‡ะฐ. ะ”ะพะฑะฐะฒะปัะตะผ ะฝะพะฒะพะต ะทะตะปัŒะต // ะ—ะฐะดะฐะฝะธะต // ะ”ะพะฟะพะปะฝะธ ะผะตั‚ะพะด addPotion(potionName) ั‚ะฐะบ, ั‡ั‚ะพะฑั‹ ะพะฝ ะดะพะฑะฐะฒะปัะป ะทะตะปัŒะต potionName ะฒ ะบะพะฝะตั† ะผะฐััะธะฒะฐ ะทะตะปะธะน ะฒ ัะฒะพะนัั‚ะฒะต potions. // ะขะตัั‚ั‹ // ะžะฑัŠัะฒะปะตะฝะฐ ะฟะตั€ะตะผะตะฝะฝะฐั atTheOldToad. // ะ—ะฝะฐั‡ะตะฝะธะต ะฟะตั€ะตะผะตะฝะฝะพะน atTheOldToad ัั‚ะพ ะพะฑัŠะตะบั‚. // ะ—ะฝะฐั‡ะตะฝะธะต ัะฒะพะนัั‚ะฒะฐ atTheOldToad.potions ัั‚ะพ ะผะฐััะธะฒ ['ะ—ะตะปัŒะต ัะบะพั€ะพัั‚ะธ', 'ะ”ั‹ั…ะฐะฝะธะต ะดั€ะฐะบะพะฝะฐ', 'ะšะฐะผะตะฝะฝะฐั ะบะพะถะฐ']. // ะ—ะฝะฐั‡ะตะฝะธะต ัะฒะพะนัั‚ะฒะฐ atTheOldToad.addPotion ัั‚ะพ ะผะตั‚ะพะด ะพะฑัŠะตะบั‚ะฐ. // ะŸะพัะปะต ะฟะตั€ะฒะพะณะพ ะฒั‹ะทะพะฒะฐ ะผะตั‚ะพะดะฐ atTheOldToad.addPotion('ะะตะฒะธะดะธะผะบะฐ'), ะฒ ัะฒะพะนัั‚ะฒะต potions ะฑัƒะดะตั‚ ะผะฐััะธะฒ ['ะ—ะตะปัŒะต ัะบะพั€ะพัั‚ะธ', 'ะ”ั‹ั…ะฐะฝะธะต ะดั€ะฐะบะพะฝะฐ', 'ะšะฐะผะตะฝะฝะฐั ะบะพะถะฐ', 'ะะตะฒะธะดะธะผะบะฐ']. // ะŸะพัะปะต ะฒั‚ะพั€ะพะณะพ ะฒั‹ะทะพะฒะฐ ะผะตั‚ะพะดะฐ atTheOldToad.addPotion('ะ—ะตะปัŒะต ัะธะปั‹'), ะฒ ัะฒะพะนัั‚ะฒะต potions ะฑัƒะดะตั‚ ะผะฐััะธะฒ ['ะ—ะตะปัŒะต ัะบะพั€ะพัั‚ะธ', 'ะ”ั‹ั…ะฐะฝะธะต ะดั€ะฐะบะพะฝะฐ', 'ะšะฐะผะตะฝะฝะฐั ะบะพะถะฐ', 'ะะตะฒะธะดะธะผะบะฐ', 'ะ—ะตะปัŒะต ัะธะปั‹']. const atTheOldToad = { potions: ['ะ—ะตะปัŒะต ัะบะพั€ะพัั‚ะธ', 'ะ”ั‹ั…ะฐะฝะธะต ะดั€ะฐะบะพะฝะฐ', 'ะšะฐะผะตะฝะฝะฐั ะบะพะถะฐ'], addPotion(potionName) { // ะŸะธัˆะธ ะบะพะด ะฝะธะถะต ัั‚ะพะน ัั‚ั€ะพะบะธ for (const key of this.potions) { if (this.potions !== key) { this.potions.push(potionName); } return this.potions; } // ะŸะธัˆะธ ะบะพะด ะฒั‹ัˆะต ัั‚ะพะน ัั‚ั€ะพะบะธ }, }; console.log(atTheOldToad.addPotion('ะะตะฒะธะดะธะผะบะฐ')); console.log(atTheOldToad.addPotion('ะ—ะตะปัŒะต ัะธะปั‹'));
{"mlist":[],"rlist":{},"page":{"page":1,"count":0,"size":10,"type":0,"id":31899}}
/** * Returns the siblings of a specific route (that is the previous and next routes). */ export function getRouteContext(_route, routes, ctx = {}) { if (!_route) { return ctx; } const { path } = _route; const { parent } = ctx; for (let i = 0; i < routes.length; i += 1) { const route = routes[i]; if (route.routes) { ctx.parent = route; ctx = getRouteContext(_route, route.routes, ctx); // If the active route and the next route was found in nested routes, return it if (ctx.nextRoute) return ctx; } if (!route) continue; if (!route.path) continue; if (ctx.route) { ctx.nextRoute = parent && i === 0 ? { ...route, title: `${parent.title}: ${route.title}` } : route; return ctx; } if (route && route.path === path) { ctx.route = { ..._route, title: parent && !parent.heading ? `${parent.title}: ${_route.title}` : _route.title }; // Continue the loop until we know the next route continue; } ctx.prevRoute = parent && !parent.heading && !routes[i + 1]?.path ? { ...route, title: `${parent.title}: ${route.title}` } : route; } // The loop ended and the previous route was found, or nothing return ctx; }
'use strict' const config = require('../../config') const wpcom = require('wpcom')(config.get('WP_TOKEN')) class CmsModel { constructor() { this.blog = wpcom.site(config.get('WP_URL')) } getPost(slug) { return new Promise((resolve, reject) => { this.blog.post({slug: slug}).getBySlug((err, data) => { if (err) { reject(err) } else { resolve(data) } }) }) } async getListOfPosts(size) { // Return latest 10 blog posts by default size = size || 10 const result = await this.blog.postsList({number: size}) return result.posts } } module.exports.CmsModel = CmsModel
import elCard from "../../../package/card/index.js"; import san from "san"; describe("card structure", () => { const viewport = document.createElement("div"); beforeEach(() => { document.body.appendChild(viewport); }); afterEach(() => { viewport.remove(); }); it("It should have a header", () => { var myComponent = san.defineComponent({ template:`<div> <el-card header="true"> <div slot="header"> header test </div> </el-card> </div>`, card:{ 'el-card':elCard } }); let myApp = new myComponent(); myApp.attach(viewport); expect(document.getElementsByTagName("el-card").length > 0).to.be.true; }); it("It should have shadow when hover,and should't have shadow when mouse out", () => { var myComponent = san.defineComponent({ template:`<div> <el-card shadow="hover"> </el-card> </div>`, card:{ 'el-card':elCard } }); let myApp = new myComponent(); myApp.attach(viewport); expect(document.getElementsByClassName("is-hover-shadow").length > 0).to.be.true; }) });
import json import logging import discord.ext.commands as commands # Setup logging rlog = logging.getLogger() rlog.setLevel(logging.INFO) handler = logging.FileHandler('panda.log', encoding='utf-8') handler.setFormatter(logging.Formatter('{asctime}:{levelname}:{name}:{message}', style='{')) rlog.addHandler(handler) # Get the token with open('conf.json') as fp: conf = json.load(fp) # Complicated bot creation bot = commands.Bot(commands.when_mentioned_or(conf['prefix']), description='Never say no to Panda.') bot.load_extension('music') # For when the bot is shitting itself @bot.command() @commands.has_permissions(manage_guild=True) async def reload(ctx): """Reloads the music module. This command requires the Manage Server permission. """ ctx.bot.unload_extension('music') ctx.bot.load_extension('music') await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}') # Let's rock ! (and roll, because panda are round and fluffy) bot.run(conf['token'])
// @flow import * as React from 'react' import TextField from '@material-ui/core/TextField' import createStyled from "material-ui-render-props-styles" import type { Classes } from "material-ui-render-props-styles" const styles = { root: { padding: 8, }, labels: { width: '100%', }, } type Props = { +labels?: ?string, +onChange?: ?(field: string, newValue: ?string) => any, } const OptionsStyles = createStyled(styles, {name: 'Options'}) const Options = (props: Props): React.Node => ( <OptionsStyles> {({classes}: {classes: Classes<typeof styles>}) => { const onChange = props.onChange || ((field: string, newValue: ?string) => {}) return ( <div className={classes.root}> <TextField className={classes.labels} label="labels" multiline rows={10} value={props.labels} onChange={e => onChange('labels', e.target.value)} /> </div> ) }} </OptionsStyles> ) export default Options
#!/usr/bin/python # -*- coding: utf-8 -*- """Logout functionality""" from mini_project_1.common import ShellArgumentParser def get_logout_parser() -> ShellArgumentParser: """Argparser for the :class:`.shell.MiniProjectShell` ``logout`` command""" parser = ShellArgumentParser( prog="logout", description="Logout to the mini-project-1 database") return parser
๏ปฟ/* Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.lang.he={dir:'rtl',editorTitle:'Rich text editor, %1, press ALT 0 for help.',toolbar:'Toolbar',editor:'Rich Text Editor',source:'ืžืงื•ืจ',newPage:'ื“ืฃ ื—ื“ืฉ',save:'ืฉืžื™ืจื”',preview:'ืชืฆื•ื’ื” ืžืงื“ื™ืžื”',cut:'ื’ื–ื™ืจื”',copy:'ื”ืขืชืงื”',paste:'ื”ื“ื‘ืงื”',print:'ื”ื“ืคืกื”',underline:'ืงื• ืชื—ืชื•ืŸ',bold:'ืžื•ื“ื’ืฉ',italic:'ื ื˜ื•ื™',selectAll:'ื‘ื—ื™ืจืช ื”ื›ืœ',removeFormat:'ื”ืกืจืช ื”ืขื™ืฆื•ื‘',strike:'ื›ืชื™ื‘ ืžื—ื•ืง',subscript:'ื›ืชื™ื‘ ืชื—ืชื•ืŸ',superscript:'ื›ืชื™ื‘ ืขืœื™ื•ืŸ',horizontalrule:'ื”ื•ืกืคืช ืงื• ืื•ืคืงื™',pagebreak:'ื”ื•ืกืคืช ืฉื‘ื™ืจืช ื“ืฃ',unlink:'ื”ืกืจืช ื”ืงื™ืฉื•ืจ',undo:'ื‘ื™ื˜ื•ืœ ืฆืขื“ ืื—ืจื•ืŸ',redo:'ื—ื–ืจื” ืขืœ ืฆืขื“ ืื—ืจื•ืŸ',common:{browseServer:'ืกื™ื™ืจ ื”ืฉืจืช',url:'ื›ืชื•ื‘ืช (URL)',protocol:'ืคืจื•ื˜ื•ืงื•ืœ',upload:'ื”ืขืœืื”',uploadSubmit:'ืฉืœื™ื—ื” ืœืฉืจืช',image:'ืชืžื•ื ื”',flash:'ืคืœืืฉ',form:'ื˜ื•ืคืก',checkbox:'ืชื™ื‘ืช ืกื™ืžื•ืŸ',radio:'ืœื—ืฆืŸ ืืคืฉืจื•ื™ื•ืช',textField:'ืฉื“ื” ื˜ืงืกื˜',textarea:'ืื™ื–ื•ืจ ื˜ืงืกื˜',hiddenField:'ืฉื“ื” ื—ื‘ื•ื™',button:'ื›ืคืชื•ืจ',select:'ืฉื“ื” ื‘ื—ื™ืจื”',imageButton:'ื›ืคืชื•ืจ ืชืžื•ื ื”',notSet:'<ืœื ื ืงื‘ืข>',id:'ื–ื™ื”ื•ื™ (ID)',name:'ืฉื',langDir:'ื›ื™ื•ื•ืŸ ืฉืคื”',langDirLtr:'ืฉืžืืœ ืœื™ืžื™ืŸ (LTR)',langDirRtl:'ื™ืžื™ืŸ ืœืฉืžืืœ (RTL)',langCode:'ืงื•ื“ ืฉืคื”',longDescr:'ืงื™ืฉื•ืจ ืœืชื™ืื•ืจ ืžืคื•ืจื˜',cssClass:'ืžื—ืœืงืช ืขื™ืฆื•ื‘ (CSS Class)',advisoryTitle:'ื›ื•ืชืจืช ืžื•ืฆืขืช',cssStyle:'ืกื’ื ื•ืŸ',ok:'ืื™ืฉื•ืจ',cancel:'ื‘ื™ื˜ื•ืœ',close:'Close',preview:'Preview',generalTab:'ื›ืœืœื™',advancedTab:'ืืคืฉืจื•ื™ื•ืช ืžืชืงื“ืžื•ืช',validateNumberFailed:'ื”ืขืจืš ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžืกืคืจื™.',confirmNewPage:'ื›ืœ ื”ืฉื™ื ื•ื™ื™ื ืฉืœื ื ืฉืžืจื• ื™ืื‘ื“ื•. ื”ืื ืœื”ืขืœื•ืช ื“ืฃ ื—ื“ืฉ?',confirmCancel:'ื—ืœืง ืžื”ืืคืฉืจื•ื™ื•ืช ืฉื•ื ื•, ื”ืื ืœืกื’ื•ืจ ืืช ื”ื“ื™ืืœื•ื’?',options:'Options',target:'Target',targetNew:'New Window (_blank)',targetTop:'Topmost Window (_top)',targetSelf:'Same Window (_self)',targetParent:'Parent Window (_parent)',unavailable:'%1<span class="cke_accessibility">, ืœื ื–ืžื™ืŸ</span>'},specialChar:{toolbar:'ื”ื•ืกืคืช ืชื• ืžื™ื•ื—ื“',title:'ื‘ื—ื™ืจืช ืชื• ืžื™ื•ื—ื“'},link:{toolbar:'ื”ื•ืกืคืช/ืขืจื™ื›ืช ืงื™ืฉื•ืจ',menu:'ืžืืคื™ื™ื ื™ ืงื™ืฉื•ืจ',title:'ืงื™ืฉื•ืจ',info:'ืžื™ื“ืข ืขืœ ื”ืงื™ืฉื•ืจ',target:'ืžื˜ืจื”',upload:'ื”ืขืœืื”',advanced:'ืืคืฉืจื•ื™ื•ืช ืžืชืงื“ืžื•ืช',type:'ืกื•ื’ ืงื™ืฉื•ืจ',toUrl:'URL',toAnchor:'ืขื•ื’ืŸ ื‘ืขืžื•ื“ ื–ื”',toEmail:'ื“ื•ื"ืœ',targetFrame:'<ืžืกื’ืจืช>',targetPopup:'<ื—ืœื•ืŸ ืงื•ืคืฅ>',targetFrameName:'ืฉื ืžืกื’ืจืช ื”ื™ืขื“',targetPopupName:'ืฉื ื”ื—ืœื•ืŸ ื”ืงื•ืคืฅ',popupFeatures:'ืชื›ื•ื ื•ืช ื”ื—ืœื•ืŸ ื”ืงื•ืคืฅ',popupResizable:'ืฉื™ื ื•ื™ ื’ื•ื“ืœ',popupStatusBar:'ืกืจื’ืœ ื—ื™ื•ื•ื™',popupLocationBar:'ืกืจื’ืœ ื›ืชื•ื‘ืช',popupToolbar:'ืกืจื’ืœ ื”ื›ืœื™ื',popupMenuBar:'ืกืจื’ืœ ืชืคืจื™ื˜',popupFullScreen:'ืžืกืš ืžืœื (IE)',popupScrollBars:'ื ื™ืชืŸ ืœื’ืœื™ืœื”',popupDependent:'ืชืœื•ื™ (Netscape)',popupWidth:'ืจื•ื—ื‘',popupLeft:'ืžื™ืงื•ื ืฆื“ ืฉืžืืœ',popupHeight:'ื’ื•ื‘ื”',popupTop:'ืžื™ืงื•ื ืฆื“ ืขืœื™ื•ืŸ',id:'ื–ื™ื”ื•ื™ (ID)',langDir:'ื›ื™ื•ื•ืŸ ืฉืคื”',langDirLTR:'ืฉืžืืœ ืœื™ืžื™ืŸ (LTR)',langDirRTL:'ื™ืžื™ืŸ ืœืฉืžืืœ (RTL)',acccessKey:'ืžืงืฉ ื’ื™ืฉื”',name:'ืฉื',langCode:'ืงื•ื“ ืฉืคื”',tabIndex:'ืžืกืคืจ ื˜ืื‘',advisoryTitle:'ื›ื•ืชืจืช ืžื•ืฆืขืช',advisoryContentType:'Content Type ืžื•ืฆืข',cssClasses:'ื’ื™ืœื™ื•ื ื•ืช ืขื™ืฆื•ื‘ ืงื‘ื•ืฆื•ืช',charset:'ืงื™ื“ื•ื“ ื”ืžืฉืื‘ ื”ืžืงื•ืฉืจ',styles:'ืกื’ื ื•ืŸ',selectAnchor:'ื‘ื—ื™ืจืช ืขื•ื’ืŸ',anchorName:'ืขืค"ื™ ืฉื ื”ืขื•ื’ืŸ',anchorId:'ืขืค"ื™ ื–ื™ื”ื•ื™ (ID) ื”ืืœืžื ื˜',emailAddress:'ื›ืชื•ื‘ืช ื”ื“ื•ื"ืœ',emailSubject:'ื ื•ืฉื ื”ื”ื•ื“ืขื”',emailBody:'ื’ื•ืฃ ื”ื”ื•ื“ืขื”',noAnchors:'(ืื™ืŸ ืขื•ื’ื ื™ื ื–ืžื™ื ื™ื ื‘ื“ืฃ)',noUrl:'ื™ืฉ ืœื”ืงืœื™ื“ ืืช ื›ืชื•ื‘ืช ื”ืงื™ืฉื•ืจ (URL)',noEmail:'ื™ืฉ ืœื”ืงืœื™ื“ ืืช ื›ืชื•ื‘ืช ื”ื“ื•ื"ืœ'},anchor:{toolbar:'ื”ื•ืกืคืช/ืขืจื™ื›ืช ื ืงื•ื“ืช ืขื™ื’ื•ืŸ',menu:'ืžืืคื™ื™ื ื™ ื ืงื•ื“ืช ืขื™ื’ื•ืŸ',title:'ืžืืคื™ื™ื ื™ ื ืงื•ื“ืช ืขื™ื’ื•ืŸ',name:'ืฉื ืœื ืงื•ื“ืช ืขื™ื’ื•ืŸ',errorName:'ื™ืฉ ืœื”ืงืœื™ื“ ืฉื ืœื ืงื•ื“ืช ืขื™ื’ื•ืŸ'},findAndReplace:{title:'ื—ื™ืคื•ืฉ ื•ื”ื—ืœืคื”',find:'ื—ื™ืคื•ืฉ',replace:'ื”ื—ืœืคื”',findWhat:'ื—ื™ืคื•ืฉ ืžื—ืจื•ื–ืช:',replaceWith:'ื”ื—ืœืคื” ื‘ืžื—ืจื•ื–ืช:',notFoundMsg:'ื”ื˜ืงืกื˜ ื”ืžื‘ื•ืงืฉ ืœื ื ืžืฆื.',matchCase:'ื”ื‘ื—ื ื” ื‘ื™ืŸ ืื•ืชื™ื•ืช ืจืฉื™ื•ืช ืœืงื˜ื ื•ืช (Case)',matchWord:'ื”ืชืืžื” ืœืžื™ืœื” ื”ืžืœืื”',matchCyclic:'ื”ืชืืžื” ืžื—ื–ื•ืจื™ืช',replaceAll:'ื”ื—ืœืคื” ื‘ื›ืœ ื”ืขืžื•ื“',replaceSuccessMsg:'%1 ื˜ืงืกื˜ื™ื ื”ื•ื—ืœืคื•.'},table:{toolbar:'ื˜ื‘ืœื”',title:'ืžืืคื™ื™ื ื™ ื˜ื‘ืœื”',menu:'ืžืืคื™ื™ื ื™ ื˜ื‘ืœื”',deleteTable:'ืžื—ืง ื˜ื‘ืœื”',rows:'ืฉื•ืจื•ืช',columns:'ืขืžื•ื“ื•ืช',border:'ื’ื•ื“ืœ ืžืกื’ืจืช',align:'ื™ื™ืฉื•ืจ',alignLeft:'ืฉืžืืœ',alignCenter:'ืžืจื›ื–',alignRight:'ื™ืžื™ืŸ',width:'ืจื•ื—ื‘',widthPx:'ืคื™ืงืกืœื™ื',widthPc:'ืื—ื•ื–',widthUnit:'width unit',height:'ื’ื•ื‘ื”',cellSpace:'ืžืจื•ื•ื— ืชื',cellPad:'ืจื™ืคื•ื“ ืชื',caption:'ื›ื™ืชื•ื‘',summary:'ืชืงืฆื™ืจ',headers:'ื›ื•ืชืจื•ืช',headersNone:'ืื™ืŸ',headersColumn:'ืขืžื•ื“ื” ืจืืฉื•ื ื”',headersRow:'ืฉื•ืจื” ืจืืฉื•ื ื”',headersBoth:'ืฉื ื™ื”ื',invalidRows:'ืฉื“ื” ืžืกืคืจ ื”ืฉื•ืจื•ืช ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžืกืคืจ ื’ื“ื•ืœ ืž 0.',invalidCols:'ืฉื“ื” ืžืกืคืจ ื”ืขืžื•ื“ื•ืช ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžืกืคืจ ื’ื“ื•ืœ ืž 0.',invalidBorder:'ืฉื“ื” ื’ื•ื“ืœ ื”ืžืกื’ืจืช ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžืกืคืจ.',invalidWidth:'ืฉื“ื” ืจื•ื—ื‘ ื”ื˜ื‘ืœื” ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืจื•ื—ื‘.',invalidHeight:'ืฉื“ื” ื’ื•ื‘ื” ื”ื˜ื‘ืœื” ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžืกืคืจ.',invalidCellSpacing:'ืฉื“ื” ืจื™ื•ื•ื— ื”ืชืื™ื ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžืกืคืจ.',invalidCellPadding:'ืฉื“ื” ืจื™ืคื•ื“ ื”ืชืื™ื ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžืกืคืจ.',cell:{menu:'ืžืืคื™ื™ื ื™ ืชื',insertBefore:'ื”ื•ืกืคืช ืชื ืœืคื ื™',insertAfter:'ื”ื•ืกืคืช ืชื ืื—ืจื™',deleteCell:'ืžื—ื™ืงืช ืชืื™ื',merge:'ืžื™ื–ื•ื’ ืชืื™ื',mergeRight:'ืžื–ื’ ื™ืžื™ื ื”',mergeDown:'ืžื–ื’ ืœืžื˜ื”',splitHorizontal:'ืคื™ืฆื•ืœ ืชื ืื•ืคืงื™ืช',splitVertical:'ืคื™ืฆื•ืœ ืชื ืื ื›ื™ืช',title:'ืชื›ื•ื ื•ืช ื”ืชื',cellType:'ืกื•ื’ ื”ืชื',rowSpan:'ืžืชื™ื—ืช ื”ืฉื•ืจื•ืช',colSpan:'ืžืชื™ื—ืช ื”ืชืื™ื',wordWrap:'ืžื ื™ืขืช ื’ืœื™ืฉืช ืฉื•ืจื•ืช',hAlign:'ื™ื™ืฉื•ืจ ืื•ืคืงื™',vAlign:'ื™ื™ืฉื•ืจ ืื ื›ื™',alignTop:'ืœืžืขืœื”',alignMiddle:'ืžืจื›ื–',alignBottom:'ืœืžื˜ื”',alignBaseline:'ืฉื•ืจืช ื‘ืกื™ืก',bgColor:'ืฆื‘ืข ืจืงืข',borderColor:'ืฆื‘ืข ืžืกื’ืจืช',data:'ืžื™ื“ืข',header:'ื›ื•ืชืจืช',yes:'ื›ืŸ',no:'ืœื',invalidWidth:'ืฉื“ื” ืจื•ื—ื‘ ื”ืชื ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžืกืคืจ.',invalidHeight:'ืฉื“ื” ื’ื•ื‘ื” ื”ืชื ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžืกืคืจ.',invalidRowSpan:'ืฉื“ื” ืžืชื™ื—ืช ื”ืฉื•ืจื•ืช ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžืกืคืจ ืฉืœื.',invalidColSpan:'ืฉื“ื” ืžืชื™ื—ืช ื”ืขืžื•ื“ื•ืช ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžืกืคืจ ืฉืœื.',chooseColor:'ื‘ื—ืจ'},row:{menu:'ืฉื•ืจื”',insertBefore:'ื”ื•ืกืคืช ืฉื•ืจื” ืœืคื ื™',insertAfter:'ื”ื•ืกืคืช ืฉื•ืจื” ืื—ืจื™',deleteRow:'ืžื—ื™ืงืช ืฉื•ืจื•ืช'},column:{menu:'ืขืžื•ื“ื”',insertBefore:'ื”ื•ืกืคืช ืขืžื•ื“ื” ืœืคื ื™',insertAfter:'ื”ื•ืกืคืช ืขืžื•ื“ื” ืื—ืจื™',deleteColumn:'ืžื—ื™ืงืช ืขืžื•ื“ื•ืช'}},button:{title:'ืžืืคื™ื™ื ื™ ื›ืคืชื•ืจ',text:'ื˜ืงืกื˜ (ืขืจืš)',type:'ืกื•ื’',typeBtn:'ื›ืคืชื•ืจ',typeSbm:'ืฉืœื™ื—ื”',typeRst:'ืื™ืคื•ืก'},checkboxAndRadio:{checkboxTitle:'ืžืืคื™ื™ื ื™ ืชื™ื‘ืช ืกื™ืžื•ืŸ',radioTitle:'ืžืืคื™ื™ื ื™ ืœื—ืฆืŸ ืืคืฉืจื•ื™ื•ืช',value:'ืขืจืš',selected:'ืžืกื•ืžืŸ'},form:{title:'ืžืืคื™ื ื™ ื˜ื•ืคืก',menu:'ืžืืคื™ื ื™ ื˜ื•ืคืก',action:'ืฉืœื— ืืœ',method:'ืกื•ื’ ืฉืœื™ื—ื”',encoding:'ืงื™ื“ื•ื“'},select:{title:'ืžืืคื™ื™ื ื™ ืฉื“ื” ื‘ื—ื™ืจื”',selectInfo:'ืžื™ื“ืข',opAvail:'ืืคืฉืจื•ื™ื•ืช ื–ืžื™ื ื•ืช',value:'ืขืจืš',size:'ื’ื•ื“ืœ',lines:'ืฉื•ืจื•ืช',chkMulti:'ืื™ืคืฉื•ืจ ื‘ื—ื™ืจื•ืช ืžืจื•ื‘ื•ืช',opText:'ื˜ืงืกื˜',opValue:'ืขืจืš',btnAdd:'ื”ื•ืกืคื”',btnModify:'ืฉื™ื ื•ื™',btnUp:'ืœืžืขืœื”',btnDown:'ืœืžื˜ื”',btnSetValue:'ืงื‘ื™ืขื” ื›ื‘ืจื™ืจืช ืžื—ื“ืœ',btnDelete:'ืžื—ื™ืงื”'},textarea:{title:'ืžืืคื™ื™ื ื™ ืื™ื–ื•ืจ ื˜ืงืกื˜',cols:'ืขืžื•ื“ื•ืช',rows:'ืฉื•ืจื•ืช'},textfield:{title:'ืžืืคื™ื™ื ื™ ืฉื“ื” ื˜ืงืกื˜',name:'ืฉื',value:'ืขืจืš',charWidth:'ืจื•ื—ื‘ ืœืคื™ ืชื•ื•ื™ื',maxChars:'ืžืงืกื™ืžื•ื ืชื•ื•ื™ื',type:'ืกื•ื’',typeText:'ื˜ืงืกื˜',typePass:'ืกื™ืกืžื”'},hidden:{title:'ืžืืคื™ื ื™ ืฉื“ื” ื—ื‘ื•ื™',name:'ืฉื',value:'ืขืจืš'},image:{title:'ืžืืคื™ื™ื ื™ ื”ืชืžื•ื ื”',titleButton:'ืžืืคื™ื ื™ ื›ืคืชื•ืจ ืชืžื•ื ื”',menu:'ืชื›ื•ื ื•ืช ื”ืชืžื•ื ื”',infoTab:'ืžื™ื“ืข ืขืœ ื”ืชืžื•ื ื”',btnUpload:'ืฉืœื™ื—ื” ืœืฉืจืช',upload:'ื”ืขืœืื”',alt:'ื˜ืงืกื˜ ื—ืœื•ืคื™',width:'ืจื•ื—ื‘',height:'ื’ื•ื‘ื”',lockRatio:'ื ืขื™ืœืช ื”ื™ื—ืก',unlockRatio:'Unlock Ratio',resetSize:'ืื™ืคื•ืก ื”ื’ื•ื“ืœ',border:'ืžืกื’ืจืช',hSpace:'ืžืจื•ื•ื— ืื•ืคืงื™',vSpace:'ืžืจื•ื•ื— ืื ื›ื™',align:'ื™ื™ืฉื•ืจ',alignLeft:'ืœืฉืžืืœ',alignRight:'ืœื™ืžื™ืŸ',alertUrl:'ื™ืฉ ืœื”ืงืœื™ื“ ืืช ื›ืชื•ื‘ืช ื”ืชืžื•ื ื”',linkTab:'ืงื™ืฉื•ืจ',button2Img:'ื”ืื ืœื”ืคื•ืš ืืช ืชืžื•ื ืช ื”ื›ืคืชื•ืจ ืœืชืžื•ื ื” ืคืฉื•ื˜ื”?',img2Button:'ื”ืื ืœื”ืคื•ืš ืืช ื”ืชืžื•ื ื” ืœื›ืคืชื•ืจ ืชืžื•ื ื”?',urlMissing:'ื›ืชื•ื‘ืช ื”ืชืžื•ื ื” ื—ืกืจื”.',validateWidth:'Width must be a whole number.',validateHeight:'Height must be a whole number.',validateBorder:'Border must be a whole number.',validateHSpace:'HSpace must be a whole number.',validateVSpace:'VSpace must be a whole number.'},flash:{properties:'ืžืืคื™ื™ื ื™ ืคืœืืฉ',propertiesTab:'ืžืืคื™ื™ื ื™ื',title:'ืžืืคื™ื ื™ ืคืœืืฉ',chkPlay:'ื ื™ื’ื•ืŸ ืื•ื˜ื•ืžื˜ื™',chkLoop:'ืœื•ืœืื”',chkMenu:'ืืคืฉืจ ืชืคืจื™ื˜ ืคืœืืฉ',chkFull:'ืืคืฉืจ ื—ืœื•ืŸ ืžืœื',scale:'ื’ื•ื“ืœ',scaleAll:'ื”ืฆื’ ื”ื›ืœ',scaleNoBorder:'ืœืœื ื’ื‘ื•ืœื•ืช',scaleFit:'ื”ืชืืžื” ืžื•ืฉืœืžืช',access:'ื’ื™ืฉืช ืกืงืจื™ืคื˜',accessAlways:'ืชืžื™ื“',accessSameDomain:'ื“ื•ืžื™ื™ืŸ ื–ื”ื”',accessNever:'ืืฃ ืคืขื',align:'ื™ื™ืฉื•ืจ',alignLeft:'ืœืฉืžืืœ',alignAbsBottom:'ืœืชื—ืชื™ืช ื”ืื‘ืกื•ืœื•ื˜ื™ืช',alignAbsMiddle:'ืžืจื›ื•ื– ืื‘ืกื•ืœื•ื˜ื™',alignBaseline:'ืœืงื• ื”ืชื—ืชื™ืช',alignBottom:'ืœืชื—ืชื™ืช',alignMiddle:'ืœืืžืฆืข',alignRight:'ืœื™ืžื™ืŸ',alignTextTop:'ืœืจืืฉ ื”ื˜ืงืกื˜',alignTop:'ืœืžืขืœื”',quality:'ืื™ื›ื•ืช',qualityBest:'ืžืขื•ืœื”',qualityHigh:'ื’ื‘ื•ื”ื”',qualityAutoHigh:'ื’ื‘ื•ื”ื” ืื•ื˜ื•ืžื˜ื™ืช',qualityMedium:'ืžืžื•ืฆืขืช',qualityAutoLow:'ื ืžื•ื›ื” ืื•ื˜ื•ืžื˜ื™ืช',qualityLow:'ื ืžื•ื›ื”',windowModeWindow:'ื—ืœื•ืŸ',windowModeOpaque:'ืื˜ื•ื',windowModeTransparent:'ืฉืงื•ืฃ',windowMode:'ืžืฆื‘ ื—ืœื•ืŸ',flashvars:'ืžืฉืชื ื™ื ืœืคืœืืฉ',bgcolor:'ืฆื‘ืข ืจืงืข',width:'ืจื•ื—ื‘',height:'ื’ื•ื‘ื”',hSpace:'ืžืจื•ื•ื— ืื•ืคืงื™',vSpace:'ืžืจื•ื•ื— ืื ื›ื™',validateSrc:'ื™ืฉ ืœื”ืงืœื™ื“ ืืช ื›ืชื•ื‘ืช ืกืจื˜ื•ืŸ ื”ืคืœืืฉ (URL)',validateWidth:'ื”ืจื•ื—ื‘ ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžืกืคืจ.',validateHeight:'ื”ื’ื•ื‘ื” ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžืกืคืจ.',validateHSpace:'ื”ืžืจื•ื•ื— ื”ืื•ืคืงื™ ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžืกืคืจ.',validateVSpace:'ื”ืžืจื•ื•ื— ื”ืื ื›ื™ ื—ื™ื™ื‘ ืœื”ื™ื•ืช ืžืกืคืจ.'},spellCheck:{toolbar:'ื‘ื“ื™ืงืช ืื™ื•ืช',title:'ื‘ื“ื™ืงืช ืื™ื•ืช',notAvailable:'ืœื ื ืžืฆื ืฉื™ืจื•ืช ื–ืžื™ืŸ.',errorLoading:'ืฉื’ื™ืื” ื‘ื”ืขืœืืช ื”ืฉื™ืจื•ืช: %s.',notInDic:'ืœื ื ืžืฆื ื‘ืžื™ืœื•ืŸ',changeTo:'ืฉื™ื ื•ื™ ืœ',btnIgnore:'ื”ืชืขืœืžื•ืช',btnIgnoreAll:'ื”ืชืขืœืžื•ืช ืžื”ื›ืœ',btnReplace:'ื”ื—ืœืคื”',btnReplaceAll:'ื”ื—ืœืคืช ื”ื›ืœ',btnUndo:'ื”ื—ื–ืจื”',noSuggestions:'- ืื™ืŸ ื”ืฆืขื•ืช -',progress:'ื‘ื•ื“ืง ื”ืื™ื•ืช ื‘ืชื”ืœื™ืš ื‘ื“ื™ืงื”....',noMispell:'ื‘ื“ื™ืงื•ืช ืื™ื•ืช ื”ืกืชื™ื™ืžื”: ืœื ื ืžืฆืื• ืฉื’ื™ืื•ืช ื›ืชื™ื‘',noChanges:'ื‘ื“ื™ืงื•ืช ืื™ื•ืช ื”ืกืชื™ื™ืžื”: ืœื ืฉื•ื ืชื” ืืฃ ืžื™ืœื”',oneChange:'ื‘ื“ื™ืงื•ืช ืื™ื•ืช ื”ืกืชื™ื™ืžื”: ืฉื•ื ืชื” ืžื™ืœื” ืื—ืช',manyChanges:'ื‘ื“ื™ืงื•ืช ืื™ื•ืช ื”ืกืชื™ื™ืžื”: %1 ืžื™ืœื™ื ืฉื•ื ื•',ieSpellDownload:'ื‘ื•ื“ืง ื”ืื™ื•ืช ืœื ืžื•ืชืงืŸ, ื”ืื ืœื”ื•ืจื™ื“ื•?'},smiley:{toolbar:'ืกืžื™ื™ืœื™',title:'ื”ื•ืกืคืช ืกืžื™ื™ืœื™'},elementsPath:{eleLabel:'Elements path',eleTitle:'%1 ืืœืžื ื˜'},numberedlist:'ืจืฉื™ืžื” ืžืžื•ืกืคืจืช',bulletedlist:'ืจืฉื™ืžืช ื ืงื•ื“ื•ืช',indent:'ื”ื’ื“ืœืช ื”ื–ื—ื”',outdent:'ื”ืงื˜ื ืช ื”ื–ื—ื”',justify:{left:'ื™ื™ืฉื•ืจ ืœืฉืžืืœ',center:'ืžืจื›ื•ื–',right:'ื™ื™ืฉื•ืจ ืœื™ืžื™ืŸ',block:'ื™ื™ืฉื•ืจ ืœืฉื•ืœื™ื™ื'},blockquote:'ื‘ืœื•ืง ืฆื™ื˜ื•ื˜',clipboard:{title:'ื”ื“ื‘ืงื”',cutError:'ื”ื’ื“ืจื•ืช ื”ืื‘ื˜ื—ื” ื‘ื“ืคื“ืคืŸ ืฉืœืš ืœื ืžืืคืฉืจื•ืช ืœืขื•ืจืš ืœื‘ืฆืข ืคืขื•ืœื•ืช ื’ื–ื™ืจื” ืื•ื˜ื•ืžื˜ื™ื•ืช. ื™ืฉ ืœื”ืฉืชืžืฉ ื‘ืžืงืœื“ืช ืœืฉื ื›ืš (Ctrl+X).',copyError:'ื”ื’ื“ืจื•ืช ื”ืื‘ื˜ื—ื” ื‘ื“ืคื“ืคืŸ ืฉืœืš ืœื ืžืืคืฉืจื•ืช ืœืขื•ืจืš ืœื‘ืฆืข ืคืขื•ืœื•ืช ื”ืขืชืงื” ืื•ื˜ื•ืžื˜ื™ื•ืช. ื™ืฉ ืœื”ืฉืชืžืฉ ื‘ืžืงืœื“ืช ืœืฉื ื›ืš (Ctrl+C).',pasteMsg:'ื ื ืœื”ื“ื‘ื™ืง ื‘ืชื•ืš ื”ืงื•ืคืกื” ื‘ืืžืฆืขื•ืช (<b>Ctrl+V</b>) ื•ืœืœื—ื•ืฅ ืขืœ <b>ืื™ืฉื•ืจ</b>.',securityMsg:'ืขืงื‘ ื”ื’ื“ืจื•ืช ืื‘ื˜ื—ื” ื‘ื“ืคื“ืคืŸ, ืœื ื ื™ืชืŸ ืœื’ืฉืช ืืœ ืœื•ื— ื”ื’ื–ื™ืจื™ื (Clipboard) ื‘ืฆื•ืจื” ื™ืฉื™ืจื”. ื ื ืœื”ื“ื‘ื™ืง ืฉื•ื‘ ื‘ื—ืœื•ืŸ ื–ื”.',pasteArea:'Paste Area'},pastefromword:{confirmCleanup:'ื ืจืื” ื”ื˜ืงืกื˜ ืฉื‘ื›ื•ื•ื ืชืš ืœื”ื“ื‘ื™ืง ืžืงื•ืจื• ื‘ืงื•ื‘ืฅ ื•ื•ืจื“. ื”ืื ื‘ืจืฆื•ื ืš ืœื ืงื•ืช ืื•ืชื• ื˜ืจื ื”ื”ื“ื‘ืงื”?',toolbar:'ื”ื“ื‘ืงื” ืž-Word',title:'ื”ื“ื‘ืงื” ืž-Word',error:'ืœื ื ื™ืชืŸ ื”ื™ื” ืœื ืงื•ืช ืืช ื”ืžื™ื“ืข ื‘ืฉืœ ืชืงืœื” ืคื ื™ืžื™ืช.'},pasteText:{button:'ื”ื“ื‘ืงื” ื›ื˜ืงืกื˜ ืคืฉื•ื˜',title:'ื”ื“ื‘ืงื” ื›ื˜ืงืกื˜ ืคืฉื•ื˜'},templates:{button:'ืชื‘ื ื™ื•ืช',title:'ืชื‘ื™ื•ืช ืชื•ื›ืŸ',insertOption:'ื”ื—ืœืคืช ืชื•ื›ืŸ ืžืžืฉื™',selectPromptMsg:'ื™ืฉ ืœื‘ื—ื•ืจ ืชื‘ื ื™ืช ืœืคืชื™ื—ื” ื‘ืขื•ืจืš.<br />ื”ืชื•ื›ืŸ ื”ืžืงื•ืจื™ ื™ืžื—ืง:',emptyListMsg:'(ืœื ื”ื•ื’ื“ืจื• ืชื‘ื ื™ื•ืช)'},showBlocks:'ื”ืฆื’ืช ื‘ืœื•ืงื™ื',stylesCombo:{label:'ืกื’ื ื•ืŸ',panelTitle:'Formatting Styles',panelTitle1:'ืกื’ื ื•ื ื•ืช ื‘ืœื•ืง',panelTitle2:'ืกื’ื ื•ื ื•ืช ืจืฆืฃ',panelTitle3:'ืกื’ื ื•ื ื•ืช ืื•ื‘ื™ื™ืงื˜'},format:{label:'ืขื™ืฆื•ื‘',panelTitle:'ืขื™ืฆื•ื‘',tag_p:'ื ื•ืจืžืœื™',tag_pre:'ืงื•ื“',tag_address:'ื›ืชื•ื‘ืช',tag_h1:'ื›ื•ืชืจืช',tag_h2:'ื›ื•ืชืจืช 2',tag_h3:'ื›ื•ืชืจืช 3',tag_h4:'ื›ื•ืชืจืช 4',tag_h5:'ื›ื•ืชืจืช 5',tag_h6:'ื›ื•ืชืจืช 6',tag_div:'ื ื•ืจืžืœื™ (DIV)'},div:{title:'ื™ืฆื™ืจืช ืžื™ื›ืœ (Div)',toolbar:'ื™ืฆื™ืจืช ืžื™ื›ืœ (Div)',cssClassInputLabel:'ืžื—ืœืงืช ืขื™ืฆื•ื‘',styleSelectLabel:'ืกื’ื ื•ืŸ',IdInputLabel:'ืžื–ื”ื” (ID)',languageCodeInputLabel:'ืงื•ื“ ืฉืคื”',inlineStyleInputLabel:'ืกื’ื ื•ืŸ ืคื ื™ืžื™',advisoryTitleInputLabel:'ื›ื•ืชืจืช ืžื•ืฆืขืช',langDirLabel:'ื›ื™ื•ื•ืŸ ืฉืคื”',langDirLTRLabel:'ืฉืžืืœ ืœื™ืžื™ืŸ (LTR)',langDirRTLLabel:'ื™ืžื™ืŸ ืœืฉืžืืœ (RTL)',edit:'ืขืจื™ื›ืช ืžื™ื›ืœ (Div)',remove:'ื”ืกืจืช ืžื™ื›ืœ (Div)'},font:{label:'ื’ื•ืคืŸ',voiceLabel:'ื’ื•ืคืŸ',panelTitle:'ื’ื•ืคืŸ'},fontSize:{label:'ื’ื•ื“ืœ',voiceLabel:'ื’ื•ื“ืœ',panelTitle:'ื’ื•ื“ืœ'},colorButton:{textColorTitle:'ืฆื‘ืข ื˜ืงืกื˜',bgColorTitle:'ืฆื‘ืข ืจืงืข',panelTitle:'Colors',auto:'ืื•ื˜ื•ืžื˜ื™',more:'ืฆื‘ืขื™ื ื ื•ืกืคื™ื...'},colors:{'000':'ืฉื—ื•ืจ',800000:'ืกื’ื•ืœ ื›ื”ื”','8B4513':'ื—ื•ื ื‘ื”ื™ืจ','2F4F4F':'ืืคื•ืจ ืฆืคื—ื”','008080':'ื›ื—ื•ืœ-ื™ืจื•ืง','000080':'ื›ื—ื•ืœ-ืกื’ื•ืœ','4B0082':'ืื™ื ื“ื™ื’ื•',696969:'ืืคื•ืจ ืžืขื•ืžืขื',B22222:'ืื“ื•ื-ื—ื•ื',A52A2A:'ื—ื•ื',DAA520:'ื›ืชื•ื ื–ื”ื‘','006400':'ื™ืจื•ืง ื›ื”ื”','40E0D0':'ื˜ื•ืจืงื™ื–','0000CD':'ื›ื—ื•ืœ ื‘ื™ื ื•ื ื™',800080:'ืกื’ื•ืœ',808080:'ืืคื•ืจ',F00:'ืื“ื•ื',FF8C00:'ื›ืชื•ื ื›ื”ื”',FFD700:'ื–ื”ื‘','008000':'ื™ืจื•ืง','0FF':'ืฆื™ืืŸ','00F':'ื›ื—ื•ืœ',EE82EE:'ืกื’ืœื’ืœ',A9A9A9:'ืืคื•ืจ ื›ื”ื”',FFA07A:'ื›ืชื•ื-ื•ื•ืจื•ื“',FFA500:'ื›ืชื•ื',FFFF00:'ืฆื”ื•ื‘','00FF00':'ืœื™ื™ื',AFEEEE:'ื˜ื•ืจืงื™ื– ื‘ื”ื™ืจ',ADD8E6:'ื›ื—ื•ืœ ื‘ื”ื™ืจ',DDA0DD:'ืฉื–ื™ืฃ',D3D3D3:'ืืคื•ืจ ื‘ื”ื™ืจ',FFF0F5:'ืœื‘ื ื“ืจ ืžืกืžื™ืง',FAEBD7:'ืœื‘ืŸ ืขืชื™ืง',FFFFE0:'ืฆื”ื•ื‘ ื‘ื”ื™ืจ',F0FFF0:'ื˜ืœ ื“ื‘ืฉ',F0FFFF:'ืชื›ืœืช',F0F8FF:'ื›ื—ื•ืœ ื˜ื™ืคืช ืžื™ื',E6E6FA:'ืœื‘ื ื“ืจ',FFF:'ืœื‘ืŸ'},scayt:{title:'ื‘ื“ื™ืงืช ืื™ื•ืช ื‘ื–ืžืŸ ื›ืชื™ื‘ื” (SCAYT)',enable:'ืืคืฉืจ SCAYT',disable:'ื‘ื˜ืœ SCAYT',about:'ืื•ื“ื•ืช SCAYT',toggle:'ืฉื™ื ื•ื™ SCAYT',options:'ืืคืฉืจื•ื™ื•ืช',langs:'ืฉืคื•ืช',moreSuggestions:'ื”ืฆืขื•ืช ื ื•ืกืคื•ืช',ignore:'ื”ืชืขืœืžื•ืช',ignoreAll:'ื”ืชืขืœืžื•ืช ืžื”ื›ืœ',addWord:'ื”ื•ืกืคืช ืžื™ืœื”',emptyDic:'ื™ืฉ ืœื‘ื—ื•ืจ ืžื™ืœื•ืŸ.',optionsTab:'ืืคืฉืจื•ื™ื•ืช',languagesTab:'ืฉืคื•ืช',dictionariesTab:'ืžื™ืœื•ืŸ',aboutTab:'ืื•ื“ื•ืช'},about:{title:'ืื•ื“ื•ืช CKEditor',dlgTitle:'ืื•ื“ื•ืช CKEditor',moreInfo:'ืœืžื™ื“ืข ื ื•ืกืฃ ื‘ืงืจื• ื‘ืืชืจื ื•:',copy:'Copyright &copy; $1. ื›ืœ ื”ื–ื›ื•ื™ื•ืช ืฉืžื•ืจื•ืช.'},maximize:'ื”ื’ื“ืœื” ืœืžืงืกื™ืžื•ื',minimize:'ื”ืงื˜ื ื” ืœืžื™ื ื™ืžื•ื',fakeobjects:{anchor:'ืขื•ื’ืŸ',flash:'ืกืจื˜ื•ืŸ ืคืœืืฉ',div:'ืฉื‘ื™ืจืช ื“ืฃ',unknown:'ืื•ื‘ื™ื™ืงื˜ ืœื ื™ื“ื•ืข'},resize:'ื™ืฉ ืœื’ืจื•ืจ ื‘ื›ื“ื™ ืœืฉื ื•ืช ืืช ื”ื’ื•ื“ืœ',colordialog:{title:'ื‘ื—ื™ืจืช ืฆื‘ืข',highlight:'ืกื™ืžื•ืŸ',selected:'ื‘ื—ื™ืจื”',clear:'ื ื™ืงื•ื™'},toolbarCollapse:'ืžื–ืขื•ืจ ืกืจื’ืœ ื›ืœื™ื',toolbarExpand:'ื”ืจื—ื‘ืช ืกืจื’ืœ ื›ืœื™ื'};
//>>built require({cache:{"url:epi/cms/contentediting/templates/DateTimeNowEditor.html":"<div class=\"dijitInline dijitInputContainer\">\r\n <div data-dojo-type=\"epi.shell.widget.DateTimeSelectorDropDown\" data-dojo-attach-point=\"dateTimeSelector\"></div\r\n ><a class=\"epi-visibleLink\" style=\"padding-left:10px\" data-dojo-attach-event=\"onclick:_onExpireNowClick\">${resources.now}</a>\r\n</div>"}});define("epi/cms/contentediting/DateTimeNowEditor",["dojo/_base/connect","dojo/_base/declare","dojo/_base/lang","dojo/dom-construct","dojo/text!./templates/DateTimeNowEditor.html","dijit/_Widget","dijit/_TemplatedMixin","dijit/_WidgetsInTemplateMixin","dijit/Tooltip","epi/shell/widget/_ValueRequiredMixin","epi/i18n!epi/cms/nls/episerver.cms.contentediting.editors.datetimenow"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b){return _2([_6,_7,_8,_a],{templateString:_5,value:null,resources:_b,_selectorWatchHandle:null,postCreate:function(){this.inherited(arguments);this._selectorWatchHandle=this.dateTimeSelector.watch("value",_3.hitch(this,function(_c,_d,_e){this.onChange(_e);}));},onChange:function(_f){this.validate();},validate:function(){var _10=this.inherited(arguments);if(_10){var _11=this.get("value");_10=this.disabled||!_11||!this.minimumValue||_11>this.minimumValue;this._set("state",_10?"":"Error");if(_10){_9.hide(this.domNode);}else{_9.show(this.minimumValueMessage,this.domNode);}}return _10;},_setValueAttr:function(_12){this.dateTimeSelector.set("value",_12);this._set("value",_12);},_getValueAttr:function(){return this.dateTimeSelector.get("value");},_onExpireNowClick:function(){this.set("value",new Date());},destroy:function(){if(this._selectorWatchHandle){this._selectorWatchHandle.unwatch();}_9.hide(this.domNode);}});});
import os import shutil from os import getenv from json import loads from uuid import uuid4 from pytest import mark from os.path import join from pathlib import Path from platform import system from datetime import datetime from typing import Optional, Any from testrail_api import TestRailAPI from dotenv import load_dotenv from pkg import get_status, get_test_runs, create_comment, get_section, formatted_time load_dotenv() class TestRail: @staticmethod def id(*ids: str or list) -> mark: """ Assigning an id to a label in pytest :param ids: ID of the test case in the testrail :return: The pytest label """ return mark.testrail_ids(ids=ids) @staticmethod def suite(name: str) -> mark: """ Assigning an suite to a label in pytest :param name: Suite of the test case in the testrail :return: The pytest label """ return mark.testrail_suite(name=name) def _get_test_case_ids(self): test_case_ids = [] tests = self._get_path({'is_tests': True, 'nested_path': 'tests'}) for root, dirs, files in os.walk(tests, topdown=False): for name in files: if name.split('.')[-1] == 'pyc': continue file = open(os.path.join(root, name), 'r', encoding='UTF-8') text = str(file.read()) while text.find("@TestRail.id('") != -1: start_with = text.find("@TestRail.id('") + 15 id = text[start_with::].split("')")[0] if id != '' and len(id) > 2: test_case_ids.append(int(id)) text = text[start_with::] return test_case_ids def _copy_files(self, source_folder, destination_folder): for file_name in os.listdir(source_folder): source = join(source_folder, file_name) destination = join(destination_folder, file_name) if os.path.isfile(source): shutil.copy(source, destination) def _get_allure_result(self): results = [] testrail_ids = [] folder_name = str(uuid4()) os.mkdir(path=self._get_path({'is_tests': True, 'nested_path': folder_name})) self._copy_files( source_folder=self._get_path({'is_nested_path': False}), destination_folder=self._get_path({'is_tests': True, 'nested_path': folder_name}) ) files = self._get_path({'is_nested_path': False}) for root, _, files in os.walk(files, topdown=False): for file in files: if 'result.json' in file: with open(os.path.join(root, file), 'r', encoding='UTF-8') as f: results.append(loads(f.read())) start = "testrail_ids(ids=('C" end = "',))" for value in results: if 'labels' in value.keys(): for label in value['labels']: if str(label['value']).startswith(start): testrail_ids.append(label['value'][len(start):-len(end)]) return { 'results': results, 'testrail_ids': testrail_ids, 'temp_folder_name': folder_name, 'temp_folder': self._get_path({'is_tests': True, 'nested_path': folder_name}) } def _get_path(self, data): is_tests = data.get('is_tests', False) is_nested_path = data.get('is_nested_path', False) nested_path = data.get('nested_path', '/') files = join(Path(__file__).parent.parent.parent.parent, nested_path) if is_tests: return files else: if is_nested_path: return f'{join(Path(__file__).parent.parent.parent.parent, getenv("ALLURE_DIR"))}/{nested_path}' else: return f'{join(Path(__file__).parent.parent.parent.parent, getenv("ALLURE_DIR"))}' def _add_steps_in_file_test(self, steps: list, full_name: str): test_name = full_name.split('#')[-1] class_name = full_name.split('#')[0].split('.')[-1] file_name = full_name.split('#')[0].split('.')[-2] folder_path = full_name.split('#')[0].split('.')[-3] tests = self._get_path({'is_tests': True, 'nested_path': 'tests'}) readed_files = [] for root, dirs, files in os.walk(tests, topdown=False): for name in files: if name.split('.')[-1] == 'pyc': continue file = open(os.path.join(root, name), 'r', encoding='UTF-8') text = str(file.read()) file.close() if class_name in text and test_name in text: readed_name = f'{folder_path}/{file_name}/{class_name}/{test_name}' if readed_name in readed_files: continue readed_files.append(readed_name) with open(f'{tests}/{folder_path}/{file_name}.py', 'r+', encoding='UTF-8') as file: src = file.readlines() file.seek(0) for line in src: test__name = str(line).split('def ')[1].split('(')[0] if test_name in line else '' if line.find(test_name) != -1 and test_name == test__name: file.write(f"{line}{''.join(steps)}") else: file.write(line) def _add_testrail_id_in_file_before_test(self, id: int, full_name: str): test_name = full_name.split('#')[-1] class_name = full_name.split('#')[0].split('.')[-1] file_name = full_name.split('#')[0].split('.')[-2] folder_path = full_name.split('#')[0].split('.')[-3] tests = self._get_path({'is_tests': True, 'nested_path': 'tests'}) readed_files = [] for root, dirs, files in os.walk(tests, topdown=False): for name in files: if name.split('.')[-1] == 'pyc': continue file = open(os.path.join(root, name), 'r', encoding='UTF-8') text = str(file.read()) file.close() if class_name in text and test_name in text: readed_name = f'{folder_path}/{file_name}/{class_name}/{test_name}' if readed_name in readed_files: continue readed_files.append(readed_name) with open(f'{tests}/{folder_path}/{file_name}.py', 'r+', encoding='UTF-8') as file: src = file.readlines() file.seek(0) for line in src: test__name = str(line).split('def ')[1].split('(')[0] if test_name in line else '' if line.find(test_name) != -1 and test_name == test__name: file.write(f" @TestRail.id('C{id}')\n{line}") else: file.write(line) def _get_test_cases_by_suite(self, tr: TestRailAPI, suite_id: int, section_id: int, case_name: str) -> dict: cases = tr.cases.get_cases( project_id=int(getenv('TESTRAIL_PROJECT_ID')), suite_id=suite_id, section_id=section_id ) data = { 'result': False, 'data': {} } for case in cases: if 'title' not in case: return data if str(case['title']).lower() == case_name.lower(): return { 'result': True, 'data': case } return data def _get_custom_result_field(self, tr: TestRailAPI) -> dict: fields_list = {} fields = tr.result_fields.get_result_fields() for field in fields: if str(field['system_name']).startswith('custom_'): fields_list[field['system_name']] = field['configs'][0]['options'][ 'default_value'] if 'default_value' in field['configs'][0]['options'].keys() else "" return fields_list def _get_custom_case_field(self, tr: TestRailAPI) -> dict: fields_list = {} fields = tr.case_fields.get_case_fields() for field in fields: if str(field['system_name']).startswith('custom_'): fields_list[field['system_name']] = field['configs'][0]['options'][ 'default_value'] if 'default_value' in field['configs'][0]['options'].keys() else "" return fields_list def _update_test_case_preconds(self, tr: TestRailAPI, case: dict, case_params: list): custom_steps = [] if 'custom_preconds' not in dict(case).keys(): return params = str(case['custom_preconds']).split('\n\n\n')[0] params_header = str(params).split('\n|||')[0] params_data = str(params).split('\n|||')[-1] custom_steps.append(params_header) custom_steps.append('\n|||') custom_steps.append(params_data) custom_steps.append(''.join(case_params[2::])) tr.cases.update_case(case_id=case['id'], custom_preconds=''.join(custom_steps)) def _update_test_case_expected_result(self, tr: TestRailAPI, case_id: int, expected: list): case_info = tr.cases.get_case(case_id=case_id) for step in case_info['custom_steps_separated']: links_list = [] for result in expected: if result['step_name'].lower() == step['content'].lower(): links_list.append(result['name']) if 'ะฒะฐะปะธะดะฐั†ะธั ะพั‚ะฒะตั‚ะฐ api' not in step['content'].lower(): step['expected'] = ''.join(links_list) tr.cases.update_case(case_id=case_id, custom_steps_separated=case_info['custom_steps_separated']) def _create_test(self, tr: TestRailAPI, case_id: int, full_name: str): case_info = tr.cases.get_case(case_id=case_id) steps = [] for item in case_info['custom_steps_separated']: steps.append(f'#\t\twith step("{item["content"]}"):\n#\t\t\tassert "{item["expected"]}"\n') self._add_steps_in_file_test(steps=steps, full_name=full_name) def _get_attachments_for_case(self, tr: TestRailAPI, case_id: int) -> dict: return tr.attachments.get_attachments_for_case(case_id=case_id) def _convert_attachments_list(self, attachments_list: list, upload_list: list): remastered_files_list = [] for item in upload_list: for file in item: for attachment in attachments_list: if file['name'].lower() == attachment['name'].lower(): remastered_files_list.append({ 'name': f'[{attachment["name"]}](index.php?/attachments/get/{attachment["id"]})\n', 'step_name': file['top_step'] }) return remastered_files_list def _create_test_case(self, tr: TestRailAPI, case_info: list, custom_fields: dict, folder: str): result = { 'suite_name': None, 'title': None, 'description': None, 'steps': [], 'params': [], 'precondition': [], 'upload_files': [], 'expected_files': [], } start = "testrail_suite(name=('" end = "',))" if 'labels' in dict(case_info).keys(): for label in dict(case_info).get('labels'): if str(label['value']).startswith(start): result['suite_name'] = label['value'][len(start):-len(end)] if result['suite_name'] is None: return suite_id = get_section(testrail=tr, name=result['suite_name'], project_id=int(getenv('TESTRAIL_PROJECT_ID'))) if suite_id['id'] is None: return if 'name' not in dict(case_info).keys(): return result['title'] = dict(case_info).get('name') if 'description' not in dict(case_info).keys(): return result['description'] = dict(case_info).get('description') if 'parameters' in dict(case_info).keys(): result['precondition'].append('**ะŸะฐั€ะฐะผะตั‚ั€ั‹**:\n') result['precondition'].append('|||:ะะฐะทะฒะฐะฝะธะต|:ะ—ะฝะฐั‡ะตะฝะธะต\n') for parametr in dict(case_info).get('parameters'): result['precondition'].append(f'|| {parametr["name"]} | {parametr["value"]}\n') if 'steps' not in dict(case_info).keys(): return if len(dict(case_info).get('steps')) == 0: return # if 'steps' in dict(case_info).keys(): # result['steps'].append('\n\n**ะจะฐะณะธ**:\n') for key, step in enumerate(dict(case_info).get('steps')): top_step = f'{step["name"]}\n' if 'steps' in dict(step).keys(): internal_steps = [] upload_files = [] for k, s in enumerate(dict(step).get('steps')): filename = f'{k + 1}. {str(s["name"]).replace("/", "_").replace("?", "_")}{uuid4()}.txt' upload_files.append({ 'top_step': top_step, 'name': filename, 'path': self._get_path({ 'is_tests': True, 'nested_path': f'{folder}/{filename}' }) }) if 'steps' in dict(s).keys(): for idx, value in enumerate(dict(s).get('steps')): if 'attachments' in dict(value).keys(): for attachment in value["attachments"]: if 'request' == attachment['name']: with open(self._get_path({ 'is_tests': True, 'nested_path': f'{folder}/{attachment["source"]}' })) as file: curl = file.read() internal_steps.append( f'{k + 1}. {s["name"]}\n - {value["name"]}\n\n\t{curl}\n\n' ) if 'response' == attachment['name']: os.rename( self._get_path({ 'is_tests': True, 'nested_path': f'{folder}/{attachment["source"]}' }), self._get_path({ 'is_tests': True, 'nested_path': f'{folder}/{filename}' }) ) else: if 'attachments' in dict(s).keys(): for attachment in s["attachments"]: if 'request' == attachment['name']: with open(self._get_path({ 'is_tests': True, 'nested_path': f'{folder}/{attachment["source"]}' })) as file: curl = file.read() internal_steps.append(f'{k + 1}. {s["name"]}\n\n\t{curl}\n\n') if 'response' == attachment['name']: os.rename( self._get_path({ 'is_tests': True, 'nested_path': f'{folder}/{attachment["source"]}' }), self._get_path({ 'is_tests': True, 'nested_path': f'{folder}/{filename}' }) ) result['steps'].append({ "content": top_step, "additional_info": "".join(internal_steps), "expected": "".join([f'{file["name"]}\n' for file in upload_files]), }) result['upload_files'].append(upload_files) else: result['steps'].append({ "content": top_step, "expected": 'ะ”ะฐะฝะฝั‹ะน ัˆะฐะณ ั‚ะพะปัŒะบะพ ะดะปั ะฐะฒั‚ะพั‚ะตัั‚ะพะฒ' if 'ะฒะฐะปะธะดะฐั†ะธั ะพั‚ะฒะตั‚ะฐ api' in top_step.lower() else '', "additional_info": '' }) if 'fullName' not in dict(case_info).keys(): return case = self._get_test_cases_by_suite( tr=tr, suite_id=suite_id['suite_id'], section_id=suite_id['id'], case_name=result['title'] ) if case['result']: self._update_test_case_preconds(tr=tr, case=case['data'], case_params=result['precondition']) return for field in dict(custom_fields).keys(): if field == 'custom_description': custom_fields[field] = result['description'] if field == 'custom_preconds': custom_fields[field] = ''.join(result['precondition']) if field == 'custom_steps_separated': custom_fields[field] = result['steps'] created_case = tr.cases.add_case( section_id=suite_id['id'], title=result['title'], template_id=2, **custom_fields ) for item in result['upload_files']: for file in item: tr.attachments.add_attachment_to_case(case_id=created_case["id"], path=file['path']) self._update_test_case_expected_result( tr=tr, case_id=created_case["id"], expected=self._convert_attachments_list( attachments_list=self._get_attachments_for_case(tr=tr, case_id=created_case["id"]), upload_list=result['upload_files'] ) ) if 'fullName' in dict(case_info).keys(): self.set_automation_status( tr=tr, case_id=created_case['id'], automated_type=int(getenv('TESTRAIL_AUTOMATED')) ) self._add_testrail_id_in_file_before_test(id=created_case['id'], full_name=case_info['fullName']) def set_automation_status(self, tr: TestRailAPI, case_id: int, automated_type: int): if system().lower() in ['linux', 'darwin']: return case_info = tr.cases.get_case(case_id=case_id) if int(case_info['type_id']) != int(getenv('TESTRAIL_TYPE_AUTOMATED')): tr.cases.update_case(case_id=case_id, type_id=int(getenv('TESTRAIL_TYPE_AUTOMATED'))) if case_info['custom_automated'] != int(getenv('TESTRAIL_AUTOMATED')) \ and automated_type == int(getenv('TESTRAIL_AUTOMATED')): tr.cases.update_case(case_id=case_id, custom_automated=automated_type) def create_test_run(self, tr: TestRailAPI, testrail_ids=None) -> Optional[dict[int, Any]]: if testrail_ids is None: testrail_ids = [] case_ids = [] date = datetime.today().strftime('%d.%m.%Y') time = datetime.today().strftime('%H:%M:%S') name = f"{getenv('TESTRAIL_TITLE_RUN')} {date} {time}" ml = getenv('TESTRAIL_MILESTONE_ID') if not ml: raise ValueError('Milestone ั ัƒะบะฐะทะฐะฝั‹ะผ ID ะฝะต ะฝะฐะนะดะตะฝ') lasted_test_run = get_test_runs( testrail=tr, name=f"{getenv('TESTRAIL_TITLE_RUN')} {date}", project_id=int(getenv('TESTRAIL_PROJECT_ID')) ) if lasted_test_run is not None: return lasted_test_run if int(getenv('ALLURE_FOR_TESTRAIL_ENABLED')) == 0: case_ids = self._get_test_case_ids() elif int(getenv('ALLURE_FOR_TESTRAIL_ENABLED')) == 1: case_ids = testrail_ids return tr.runs.add_run( project_id=int(getenv('TESTRAIL_PROJECT_ID')), name=name, milestone_id=ml, case_ids=case_ids, include_all=len(case_ids) == 0 )['id'] def close_test_run(self, tr: TestRailAPI, run_id: int): if tr.runs.get_run(run_id=run_id)['is_completed']: return tr.runs.close_run(run_id=run_id) def set_status(self, tr: TestRailAPI, data: dict): test_run_id = data['test_run_id'] case_id = int(str(data['case_id'][1:])) if test_run_id is None: return if get_status(testrail=tr, case_id=case_id, test_run_id=test_run_id) == 5: print(f'ะขะตัั‚ ะบะตะนั ั ID {data["case_id"]} ัƒะถะต ะฝะฐั…ะพะดะธั‚ัั ะฒ ัั‚ะฐั‚ัƒัะต Failed') return result = tr.results.add_result_for_case( run_id=int(test_run_id), case_id=int(case_id), status_id=int(data['status']), elapsed=data['elapsed'], comment=data['comment'] ) if data.get('screenshot') is not None: tr.attachments.add_attachment_to_result(result["id"], data['screenshot']) def set_statuses(self, tr, data): raw_data = self._get_allure_result() custom_case_fields = self._get_custom_case_field(tr=tr) custom_result_fields = self._get_custom_result_field(tr=tr) custom_browser = getenv('TESTRAIL_BROWSER') if custom_browser is not None: custom_browser = int(custom_browser) for field in custom_result_fields.keys(): if field == 'custom_browser' and custom_browser is not None: custom_result_fields[field] = custom_browser if int(getenv("ALLURE_FOR_TESTRAIL_ENABLED")) == 1 and len(raw_data['testrail_ids']) > 0: data['test_run_id'] = self.create_test_run(tr=tr, testrail_ids=raw_data['testrail_ids']) for value in raw_data['results']: result = { 'case_id': None, 'case_name': '', 'case_status': '', 'case_description': '', 'case_time': 0, 'steps': [], 'attachments': [], 'upload_files': [], 'params': [], 'error': { 'message': '', 'trace': '' } } result['case_name'] = value['name'] if 'name' in value.keys() else '' result['case_status'] = value['status'] result['case_description'] = value['description'] if 'description' in value.keys() else '' start = "testrail_ids(ids=('C" end = "',))" if result['case_status'].lower() == 'broken': continue step_data = {} if 'labels' in value.keys(): for label in value['labels']: if str(label['value']).startswith(start): result['case_id'] = label['value'][len(start):-len(end)] if result['case_id'] is None: self._create_test_case( tr=tr, case_info=value, custom_fields=custom_case_fields, folder=raw_data["temp_folder_name"] ) continue if 'steps' not in dict(value).keys() and 'description' not in dict(value).keys(): self._create_test(tr=tr, case_id=result['case_id'], full_name=value['fullName']) continue if 'statusDetails' in value.keys(): result['error']['message'] = value['statusDetails']['message'] result['error']['trace'] = value['statusDetails']['trace'] if 'parameters' in value.keys(): result['params'].append('**ะŸะฐั€ะฐะผะตั‚ั€ั‹**:\n') result['params'].append('|||:ะะฐะทะฒะฐะฝะธะต|:ะ—ะฝะฐั‡ะตะฝะธะต\n') for parametr in value['parameters']: result['params'].append(f'|| {parametr["name"]} | {parametr["value"]}\n') if 'steps' in value.keys(): for step in value['steps']: image = { 'img': None, 'name': '' } if 'parameters' in step.keys(): for param in step['parameters']: if param['name'] == 'data' and param['value']: step_data['data'] = param['value'] if param['name'] == 'expected_data' and param['value']: step_data['expected_data'] = param['value'] if param['name'] == 'asserts_data' and param['value']: step_data['asserts_data'] = param['value'] if 'attachments' in step.keys(): image['img'] = step["attachments"][0]["source"] result['steps'].append({ 'name': step['name'], 'status': step['status'], 'time': formatted_time((step['stop'] - step['start']) / 1000), 'data': step_data, 'image': image }) result['case_time'] += (step['stop'] - step['start']) / 1000 result['case_time'] = formatted_time(round(result['case_time'], 3)) if 'attachments' in value.keys(): for attachment in value['attachments']: result['attachments'].append(attachment["source"]) for key, val in enumerate(result['steps']): # if val['status'] == 'passed': # continue if len(result['steps']) != key + 1: continue if val['image']['img'] is None: continue filename = f'ะจะฐะณ_{key + 1}_{result["case_id"]}.png' os.rename( self._get_path({ 'is_tests': True, 'nested_path': f'{raw_data["temp_folder_name"]}/{val["image"]["img"]}' }), self._get_path({'is_tests': True, 'nested_path': f'{raw_data["temp_folder_name"]}/{filename}'}) ) result['steps'][key]['image']['name'] = filename result['upload_files'].append( self._get_path({'is_tests': True, 'nested_path': f'{raw_data["temp_folder_name"]}/{filename}'})) with open(self._get_path({'is_nested_path': True, 'nested_path': 'mode.txt'}), 'r') as file: mode = file.read() case_status = True case_status_id_current = int( get_status(testrail=tr, case_id=int(result['case_id']), test_run_id=int(data['test_run_id']))) if case_status_id_current == int(getenv('TESTRAIL_FAILED_STATUS')) or result['case_status'] == 'failed': case_status = False result_case = tr.results.add_result_for_case( run_id=int(data['test_run_id']), case_id=int(result['case_id']), status_id=getenv('TESTRAIL_PASSED_STATUS') if case_status else getenv('TESTRAIL_FAILED_STATUS'), elapsed=result['case_time'], comment=create_comment(result, mode), **custom_result_fields ) for file in result['upload_files']: tr.attachments.add_attachment_to_result(result_case["id"], file) if 'fullName' in value.keys(): self.set_automation_status( tr=tr, case_id=result['case_id'], automated_type=int(getenv('TESTRAIL_AUTOMATED')) ) shutil.rmtree(raw_data['temp_folder'], ignore_errors=True) if int(getenv('TESTRAIL_AUTOCLOSE_TESTRUN')) == 1 and len(raw_data['testrail_ids']) > 0: self.close_test_run(tr=tr, run_id=data['test_run_id'])