Skip to content

Instantly share code, notes, and snippets.

@darind
Created December 10, 2018 08:49
Show Gist options
  • Save darind/ac13306230a7d6beeca4a14c1ac64187 to your computer and use it in GitHub Desktop.
Save darind/ac13306230a7d6beeca4a14c1ac64187 to your computer and use it in GitHub Desktop.
NativeScript blank app bundle
This file has been truncated, but you can view the full file.
/*!**********************************************************!*\
!*** ../android-snapshot-bundle-preamble.js ***!
\**********************************************************/
var global = Function('return this')(); global.global = global; // Mock global object
// Set the __snapshotEnabled flag to true
Object.defineProperty(global, "__snapshotEnabled", {
value: true,
writable: false,
configurable: false,
enumerable: false
});
// Set the __snapshot flag to true
Object.defineProperty(global, "__snapshot", {
value: true,
writable: false,
configurable: true,
enumerable: false
});
global.__requireOverride = (function() {
return function(moduleId, dirname) {
/*
The android runtime loads in advance all JS modules that contain a native class successor generated statically at build time.
In case of snapshot this file always is the bundled one. Since it is snapshoted it is already loaded in the heap and is not meant
to be required. The main entry file (bundle.js) is responsible for actually executing the modules containing native java classes.
*/
var resolvedModuleId = moduleId.replace(/^\.\/tns_modules\//, "");
if (resolvedModuleId === './_embedded_script_.js') {
return {};
}
};
}());
/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var executeModules = data[2];
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(installedChunks[chunkId]) {
/******/ resolves.push(installedChunks[chunkId][0]);
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ modules[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
/******/
/******/ // add entry modules from loaded chunk to deferred list
/******/ deferredModules.push.apply(deferredModules, executeModules || []);
/******/
/******/ // run deferred modules when all chunks ready
/******/ return checkDeferredModules();
/******/ };
/******/ function checkDeferredModules() {
/******/ var result;
/******/ for(var i = 0; i < deferredModules.length; i++) {
/******/ var deferredModule = deferredModules[i];
/******/ var fulfilled = true;
/******/ for(var j = 1; j < deferredModule.length; j++) {
/******/ var depId = deferredModule[j];
/******/ if(installedChunks[depId] !== 0) fulfilled = false;
/******/ }
/******/ if(fulfilled) {
/******/ deferredModules.splice(i--, 1);
/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
/******/ }
/******/ }
/******/ return result;
/******/ }
/******/
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // object to store loaded and loading chunks
/******/ var installedChunks = {
/******/ "snapshot-entry": 0
/******/ };
/******/
/******/ var deferredModules = [];
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ var jsonpArray = global["webpackJsonp"] = global["webpackJsonp"] || [];
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
/******/ jsonpArray.push = webpackJsonpCallback;
/******/ jsonpArray = jsonpArray.slice();
/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
/******/ var parentJsonpFunction = oldJsonpFunction;
/******/
/******/
/******/ // add entry module to deferred list
/******/ deferredModules.push(["../platforms/android/app/snapshot-entry.js","vendor"]);
/******/ // run deferred modules when ready
/******/ return checkDeferredModules();
/******/ })
/************************************************************************/
/******/ ({
/***/ "../platforms/android/app/snapshot-entry.js":
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__("../node_modules/nativescript-dev-webpack/load-application-css-regular.js")();
__webpack_require__("../node_modules/tns-core-modules/bundle-entry-points.js")
/***/ }),
/***/ "./ sync ^\\.\\/app\\.(css|scss|less|sass)$":
/***/ (function(module, exports, __webpack_require__) {
var map = {
"./app.css": "./app.css"
};
function webpackContext(req) {
var id = webpackContextResolve(req);
return __webpack_require__(id);
}
function webpackContextResolve(req) {
var id = map[req];
if(!(id + 1)) { // check for number or string
var e = new Error("Cannot find module '" + req + "'");
e.code = 'MODULE_NOT_FOUND';
throw e;
}
return id;
}
webpackContext.keys = function webpackContextKeys() {
return Object.keys(map);
};
webpackContext.resolve = webpackContextResolve;
module.exports = webpackContext;
webpackContext.id = "./ sync ^\\.\\/app\\.(css|scss|less|sass)$";
/***/ }),
/***/ "./app.css":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("../node_modules/css-loader/lib/css-base.js")(false);
// imports
exports.i(__webpack_require__("../node_modules/css-loader/index.js?!../node_modules/nativescript-theme-core/css/core.light.css"), "");
// module
exports.push([module.i, "/*\nIn NativeScript, the app.css file is where you place CSS rules that\nyou would like to apply to your entire application. Check out\nhttp://docs.nativescript.org/ui/styling for a full list of the CSS\nselectors and properties you can use to style UI components.\n\n/*\nIn many cases you may want to use the NativeScript core theme instead\nof writing your own CSS rules. For a full list of class names in the theme\nrefer to http://docs.nativescript.org/ui/theme. \nThe imported CSS rules must precede all other types of rules.\n*/\n\n/*\nThe following CSS rule changes the font size of all UI\ncomponents that have the btn class name.\n*/\n.btn {\n font-size: 18;\n}\n", ""]);
// exports
;
if (false) {}
/***/ }),
/***/ "./package.json":
/***/ (function(module) {
module.exports = {"main":"app.js","android":{"v8Flags":"--expose_gc"}};
/***/ })
/******/ });
(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["vendor"],{
/***/ "../node_modules/css-loader/index.js?!../node_modules/nativescript-theme-core/css/core.light.css":
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__("../node_modules/css-loader/lib/css-base.js")(false);
// imports
// module
exports.push([module.i, "/*!\n * NativeScript Theme v1.0.4 (https://nativescript.org)\n * Copyright 2016-2016 The Theme Authors\n * Copyright 2016-2016 Telerik\n * Licensed under MIT (https://github.com/NativeScript/theme/blob/master/LICENSE)\n */.c-white{color:#fff}.c-bg-white{background-color:#fff}.c-black{color:#000}.c-bg-black{background-color:#000}.c-aqua{color:#00caab}.c-bg-aqua{background-color:#00caab}.c-blue{color:#3d5afe}.c-bg-blue{background-color:#3d5afe}.c-charcoal{color:#303030}.c-bg-charcoal{background-color:#303030}.c-brown{color:#795548}.c-bg-brown{background-color:#795548}.c-forest{color:#006968}.c-bg-forest{background-color:#006968}.c-grey{color:#e0e0e0}.c-bg-grey{background-color:#e0e0e0}.c-grey-light{color:#bababa}.c-bg-grey-light{background-color:#bababa}.c-grey-dark{color:#5c687c}.c-bg-grey-dark{background-color:#5c687c}.c-purple{color:#8130ff}.c-bg-purple{background-color:#8130ff}.c-lemon{color:#ffea00}.c-bg-lemon{background-color:#ffea00}.c-lime{color:#aee406}.c-bg-lime{background-color:#aee406}.c-orange{color:#f57c00}.c-bg-orange{background-color:#f57c00}.c-ruby{color:#ff1744}.c-bg-ruby{background-color:#ff1744}.c-sky{color:#30bcff}.c-bg-sky{background-color:#30bcff}.w-full{width:100%}.w-100{width:100}.h-full{height:100%}.h-100{height:100}.m-0{margin:0}.m-t-0{margin-top:0}.m-r-0{margin-right:0}.m-b-0{margin-bottom:0}.m-l-0{margin-left:0}.m-x-0{margin-right:0;margin-left:0}.m-y-0{margin-top:0;margin-bottom:0}.m-2{margin:2}.m-t-2{margin-top:2}.m-r-2{margin-right:2}.m-b-2{margin-bottom:2}.m-l-2{margin-left:2}.m-x-2{margin-right:2;margin-left:2}.m-y-2{margin-top:2;margin-bottom:2}.m-4{margin:4}.m-t-4{margin-top:4}.m-r-4{margin-right:4}.m-b-4{margin-bottom:4}.m-l-4{margin-left:4}.m-x-4{margin-right:4;margin-left:4}.m-y-4{margin-top:4;margin-bottom:4}.m-5{margin:5}.m-t-5{margin-top:5}.m-r-5{margin-right:5}.m-b-5{margin-bottom:5}.m-l-5{margin-left:5}.m-x-5{margin-right:5;margin-left:5}.m-y-5{margin-top:5;margin-bottom:5}.m-8{margin:8}.m-t-8{margin-top:8}.m-r-8{margin-right:8}.m-b-8{margin-bottom:8}.m-l-8{margin-left:8}.m-x-8{margin-right:8;margin-left:8}.m-y-8{margin-top:8;margin-bottom:8}.m-10{margin:10}.m-t-10{margin-top:10}.m-r-10{margin-right:10}.m-b-10{margin-bottom:10}.m-l-10{margin-left:10}.m-x-10{margin-right:10;margin-left:10}.m-y-10{margin-top:10;margin-bottom:10}.m-12{margin:12}.m-t-12{margin-top:12}.m-r-12{margin-right:12}.m-b-12{margin-bottom:12}.m-l-12{margin-left:12}.m-x-12{margin-right:12;margin-left:12}.m-y-12{margin-top:12;margin-bottom:12}.m-15{margin:15}.m-t-15{margin-top:15}.m-r-15{margin-right:15}.m-b-15{margin-bottom:15}.m-l-15{margin-left:15}.m-x-15{margin-right:15;margin-left:15}.m-y-15{margin-top:15;margin-bottom:15}.m-16{margin:16}.m-t-16{margin-top:16}.m-r-16{margin-right:16}.m-b-16{margin-bottom:16}.m-l-16{margin-left:16}.m-x-16{margin-right:16;margin-left:16}.m-y-16{margin-top:16;margin-bottom:16}.m-20{margin:20}.m-t-20{margin-top:20}.m-r-20{margin-right:20}.m-b-20{margin-bottom:20}.m-l-20{margin-left:20}.m-x-20{margin-right:20;margin-left:20}.m-y-20{margin-top:20;margin-bottom:20}.m-24{margin:24}.m-t-24{margin-top:24}.m-r-24{margin-right:24}.m-b-24{margin-bottom:24}.m-l-24{margin-left:24}.m-x-24{margin-right:24;margin-left:24}.m-y-24{margin-top:24;margin-bottom:24}.m-25{margin:25}.m-t-25{margin-top:25}.m-r-25{margin-right:25}.m-b-25{margin-bottom:25}.m-l-25{margin-left:25}.m-x-25{margin-right:25;margin-left:25}.m-y-25{margin-top:25;margin-bottom:25}.m-28{margin:28}.m-t-28{margin-top:28}.m-r-28{margin-right:28}.m-b-28{margin-bottom:28}.m-l-28{margin-left:28}.m-x-28{margin-right:28;margin-left:28}.m-y-28{margin-top:28;margin-bottom:28}.m-30{margin:30}.m-t-30{margin-top:30}.m-r-30{margin-right:30}.m-b-30{margin-bottom:30}.m-l-30{margin-left:30}.m-x-30{margin-right:30;margin-left:30}.m-y-30{margin-top:30;margin-bottom:30}.p-0{padding:0}.p-t-0{padding-top:0}.p-r-0{padding-right:0}.p-b-0{padding-bottom:0}.p-l-0{padding-left:0}.p-x-0{padding-right:0;padding-left:0}.p-y-0{padding-top:0;padding-bottom:0}.p-2{padding:2}.p-t-2{padding-top:2}.p-r-2{padding-right:2}.p-b-2{padding-bottom:2}.p-l-2{padding-left:2}.p-x-2{padding-right:2;padding-left:2}.p-y-2{padding-top:2;padding-bottom:2}.p-4{padding:4}.p-t-4{padding-top:4}.p-r-4{padding-right:4}.p-b-4{padding-bottom:4}.p-l-4{padding-left:4}.p-x-4{padding-right:4;padding-left:4}.p-y-4{padding-top:4;padding-bottom:4}.p-5{padding:5}.p-t-5{padding-top:5}.p-r-5{padding-right:5}.p-b-5{padding-bottom:5}.p-l-5{padding-left:5}.p-x-5{padding-right:5;padding-left:5}.p-y-5{padding-top:5;padding-bottom:5}.p-8{padding:8}.p-t-8{padding-top:8}.p-r-8{padding-right:8}.p-b-8{padding-bottom:8}.p-l-8{padding-left:8}.p-x-8{padding-right:8;padding-left:8}.p-y-8{padding-top:8;padding-bottom:8}.p-10{padding:10}.p-t-10{padding-top:10}.p-r-10{padding-right:10}.p-b-10{padding-bottom:10}.p-l-10{padding-left:10}.p-x-10{padding-right:10;padding-left:10}.p-y-10{padding-top:10;padding-bottom:10}.p-12{padding:12}.p-t-12{padding-top:12}.p-r-12{padding-right:12}.p-b-12{padding-bottom:12}.p-l-12{padding-left:12}.p-x-12{padding-right:12;padding-left:12}.p-y-12{padding-top:12;padding-bottom:12}.p-15{padding:15}.p-t-15{padding-top:15}.p-r-15{padding-right:15}.p-b-15{padding-bottom:15}.p-l-15{padding-left:15}.p-x-15{padding-right:15;padding-left:15}.p-y-15{padding-top:15;padding-bottom:15}.p-16{padding:16}.p-t-16{padding-top:16}.p-r-16{padding-right:16}.p-b-16{padding-bottom:16}.p-l-16{padding-left:16}.p-x-16{padding-right:16;padding-left:16}.p-y-16{padding-top:16;padding-bottom:16}.p-20{padding:20}.p-t-20{padding-top:20}.p-r-20{padding-right:20}.p-b-20{padding-bottom:20}.p-l-20{padding-left:20}.p-x-20{padding-right:20;padding-left:20}.p-y-20{padding-top:20;padding-bottom:20}.p-24{padding:24}.p-t-24{padding-top:24}.p-r-24{padding-right:24}.p-b-24{padding-bottom:24}.p-l-24{padding-left:24}.p-x-24{padding-right:24;padding-left:24}.p-y-24{padding-top:24;padding-bottom:24}.p-25{padding:25}.p-t-25{padding-top:25}.p-r-25{padding-right:25}.p-b-25{padding-bottom:25}.p-l-25{padding-left:25}.p-x-25{padding-right:25;padding-left:25}.p-y-25{padding-top:25;padding-bottom:25}.p-28{padding:28}.p-t-28{padding-top:28}.p-r-28{padding-right:28}.p-b-28{padding-bottom:28}.p-l-28{padding-left:28}.p-x-28{padding-right:28;padding-left:28}.p-y-28{padding-top:28;padding-bottom:28}.p-30{padding:30}.p-t-30{padding-top:30}.p-r-30{padding-right:30}.p-b-30{padding-bottom:30}.p-l-30{padding-left:30}.p-x-30{padding-right:30;padding-left:30}.p-y-30{padding-top:30;padding-bottom:30}.hr-light{height:1;background-color:#e0e0e0;width:100%}.hr-dark{height:1;background-color:#303030;width:100%}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.font-weight-normal{font-weight:normal}.font-weight-bold{font-weight:bold}.font-italic{font-style:italic}.t-10{font-size:10}.t-12{font-size:12}.t-14{font-size:14}.t-15{font-size:15}.t-16{font-size:16}.t-17{font-size:17}.t-18{font-size:18}.t-19{font-size:19}.t-20{font-size:20}.t-25{font-size:25}.t-30{font-size:30}.img-rounded{border-radius:5}.img-circle{border-radius:20}.img-thumbnail{border-radius:0}.invisible{visibility:collapse}.pull-left{horizontal-align:left}.pull-right{horizontal-align:right}.m-x-auto{horizontal-align:center}.m-y-auto{vertical-align:center}.text-primary{color:#30bcff}.text-danger{color:#d50000}.text-muted{color:#9e9e9e}.bg-primary{background-color:#30bcff;color:#fff}.bg-danger{background-color:#d50000;color:#fff}.action-bar{background-color:#F8F8F8;color:#212121}.action-bar .action-bar-title{font-weight:bold;font-size:17;vertical-align:center}.action-bar .action-item{font-weight:normal}.activity-indicator{color:#30bcff;width:30;height:30}.btn{color:#30bcff;background-color:transparent;min-height:36;min-width:64;padding:10 10 10 10;font-size:18;margin:8 16 8 16}.btn.btn-active:highlighted{color:#fff;background-color:#c0ebff}.btn-primary{background-color:#30bcff;border-color:#30bcff;color:#fff}.btn-primary.btn-active:highlighted{background-color:#01a0ec;border-color:#01a0ec}.btn-primary.btn-aqua{background-color:#00caab}.btn-primary.btn-blue{background-color:#3d5afe}.btn-primary.btn-brown{background-color:#795548}.btn-primary.btn-forest{background-color:#006968}.btn-primary.btn-grey{background-color:#5c687c}.btn-primary.btn-lemon{background-color:#ffea00;color:#000}.btn-primary.btn-lime{background-color:#aee406;color:#000}.btn-primary.btn-orange{background-color:#f57c00}.btn-primary.btn-purple{background-color:#8130ff}.btn-primary.btn-ruby{background-color:#ff1744}.btn-primary.btn-sky{background-color:#30bcff}.btn-outline{background-color:transparent;border-color:#30bcff;color:#30bcff}.btn-outline.btn-active:highlighted{background-color:#c0ebff}.btn[isEnabled=false]{color:#a4a4a4;background-color:#e0e0e0;border-color:#e0e0e0}.fa{font-family:FontAwesome, fontawesome-webfont}.form .input{padding:16 8 16 8;background-color:transparent}.form .input.input-border{border-width:1;border-color:#e0e0e0;border-radius:2;padding:16}.form .input.input-rounded{border-width:1;border-color:#e0e0e0;border-radius:28;padding:16}.form .input[isEnabled='false']{background-color:#fafafa}.form .input-field{margin:8}.form .input-field .label{font-size:12;color:#bababa}.form .input-field .input{padding:0;margin:0 0 8 0}.form .input-field .hr-light.active,.form .input-field .hr-dark.active{background-color:#30bcff}.form .input-field.input-sides .label{font-size:18;margin:0 0 8 0}.h1,.h2,.h3,.h4,.h5,.h6{margin-bottom:4;font-weight:normal;color:#212121}.body,.body2,.footnote{font-weight:normal;color:#757575}.h1{font-size:32}.h2{font-size:22}.h3{font-size:15}.h4{font-size:12}.h5{font-size:11}.h6{font-size:10}.body{font-size:14}.body2{font-size:17}.footnote{font-size:13}.list-group .list-group-item{color:#212121;font-size:16;margin:0;padding:16}.list-group .list-group-item Label{vertical-align:center}.list-group .list-group-item .thumb{stretch:fill;width:40;height:40;margin-right:16}.list-group .list-group-item.active{background-color:#e0e0e0}.list-group .list-group-item .list-group-item-text{color:#757575;font-size:14}.page{background-color:#fff}.progress{color:#30bcff;background-color:#bababa}.segmented-bar{font-size:13;background-color:#fff;color:#212121;selected-background-color:#30bcff}.sidedrawer-left,.sidedrawer-center{background-color:#fafafa}.sidedrawer-header{background-color:#fafafa;height:148;width:100%}.sidedrawer-left .sidedrawer-header{padding:16 16 0 16}.sidedrawer-center .sidedrawer-header{padding:20 15 0 15}.sidedrawer-header-image{background-color:#e0e0e0}.sidedrawer-left .sidedrawer-header-image{height:64;width:64;border-radius:32;horizontal-align:left;margin-bottom:36}.sidedrawer-center .sidedrawer-header-image{height:74;width:74;border-radius:37;horizontal-align:center;margin-bottom:24}.sidedrawer-header-brand{color:#737373}.sidedrawer-left .sidedrawer-header-brand{horizontal-align:left;font-size:14}.sidedrawer-center .sidedrawer-header-brand{horizontal-align:center;font-size:15}.sidedrawer-list-item{height:48;horizontal-align:left;width:100%;orientation:horizontal}.sidedrawer-list-item .sidedrawer-list-item-icon{width:24;text-align:center;font-size:20;height:48;vertical-align:center}.sidedrawer-list-item.active{color:#fff;background-color:#30bcff}.sidedrawer-list-item.active .sidedrawer-list-item-icon{color:#fff}.sidedrawer-left .sidedrawer-list-item-icon{margin:0 16 0 16}.sidedrawer-center .sidedrawer-list-item-icon{margin:0 0 0 15}.sidedrawer-list-item-text{horizontal-align:left;text-align:left;font-size:15;background-color:transparent;border-width:0.1;width:80%;vertical-align:center}.sidedrawer-left .sidedrawer-list-item-text{padding-left:16}.sidedrawer-center .sidedrawer-list-item-text{padding-left:15}.slider{background-color:#30bcff}.slider[isEnabled=false]{background-color:#e0e0e0;color:#e0e0e0}.switch[checked=true]{background-color:#30bcff}.switch[checked=true][isEnabled=false]{background-color:#e0e0e0;color:#fff}.switch[isEnabled=false]{background-color:#e0e0e0;color:#e0e0e0}.tab-view{selected-color:#30bcff;tabs-background-color:#fff}.tab-view .tab-view-item{background-color:#fff;tabs-background-color:#fff}#login-background{margin-top:-20;background-size:cover;background-position:center}.login-wrap{padding:0 40}.logo-wrap{margin:60 0 10 0;padding:20 0}.logo-wrap .login-logo{text-align:center;font-size:30;font-weight:bold;margin-bottom:10;opacity:1;color:#212121;opacity:.9}.logo-wrap .login-logo-sub{color:#212121;opacity:.8;text-align:center}.login-wrapper{padding:20;background-color:#fff;border-radius:3}.login-wrapper TextField{padding:10 10;margin:10 0 0 0}.go-back{font-size:14;text-align:center;color:#212121;margin-top:10}.action-bar .action-bar-title{font-weight:500;font-size:20}.action-bar .action-item{background-color:rgba(255,0,0,0);border-color:rgba(255,0,0,0);border-width:1}.btn{font-family:'Roboto Medium';font-size:14}.btn-primary{border-color:rgba(255,0,0,0)}.btn-outline{background-color:rgba(255,0,0,0);border-width:1;border-color:#30bcff;height:36;padding:0}.btn-rounded-sm{border-radius:2;height:36;padding:0}.btn-rounded-lg{border-radius:40;height:36;padding:0}.form{font-family:'Roboto Regular'}.form .input{font-size:16}.h1{font-size:34}.h2{font-size:24}.h3{font-size:16}.h5{font-size:11;font-weight:bold}.body2{font-size:14;font-weight:500}.sidedrawer-list-item-icon{margin:0 16 0 16;padding-top:14}.sidedrawer-list-item-icon,.sidedrawer-list-item{color:#737373}.sidedrawer-list-item{font-family:'Roboto Medium';font-size:14}.slider{color:#30bcff;margin:20 16}.switch{margin:14 16;color:#e0e0e0;background-color:#e0e0e0}.switch[checked=true]{color:#30bcff}\n", ""]);
// exports
/***/ }),
/***/ "../node_modules/css-loader/lib/css-base.js":
/***/ (function(module, exports) {
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
module.exports = function(useSourceMap) {
var list = [];
// return the list of modules as css string
list.toString = function toString() {
return this.map(function (item) {
var content = cssWithMappingToString(item, useSourceMap);
if(item[2]) {
return "@media " + item[2] + "{" + content + "}";
} else {
return content;
}
}).join("");
};
// import a list of modules into the list
list.i = function(modules, mediaQuery) {
if(typeof modules === "string")
modules = [[null, modules, ""]];
var alreadyImportedModules = {};
for(var i = 0; i < this.length; i++) {
var id = this[i][0];
if(typeof id === "number")
alreadyImportedModules[id] = true;
}
for(i = 0; i < modules.length; i++) {
var item = modules[i];
// skip already imported module
// this implementation is not 100% perfect for weird media query combinations
// when a module is imported multiple times with different media queries.
// I hope this will never occur (Hey this way we have smaller bundles)
if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
if(mediaQuery && !item[2]) {
item[2] = mediaQuery;
} else if(mediaQuery) {
item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
}
list.push(item);
}
}
};
return list;
};
function cssWithMappingToString(item, useSourceMap) {
var content = item[1] || '';
var cssMapping = item[3];
if (!cssMapping) {
return content;
}
if (useSourceMap && typeof btoa === 'function') {
var sourceMapping = toComment(cssMapping);
var sourceURLs = cssMapping.sources.map(function (source) {
return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
});
return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
}
return [content].join('\n');
}
// Adapted from convert-source-map (MIT)
function toComment(sourceMap) {
// eslint-disable-next-line no-undef
var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
return '/*# ' + data + ' */';
}
/***/ }),
/***/ "../node_modules/nativescript-dev-webpack/load-application-css-regular.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {const loadCss = __webpack_require__("../node_modules/nativescript-dev-webpack/load-application-css.js");
module.exports = function() {
loadCss(function() {
const appCssContext = __webpack_require__("./ sync ^\\.\\/app\\.(css|scss|less|sass)$");
global.registerWebpackModules(appCssContext);
});
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/nativescript-dev-webpack/load-application-css.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports = function (loadModuleFn) {
const application = __webpack_require__("../node_modules/tns-core-modules/application/application.js");
__webpack_require__("../node_modules/tns-core-modules/ui/styling/style-scope.js");
loadModuleFn();
application.loadAppCss();
}
/***/ }),
/***/ "../node_modules/tns-core-modules/application/application-common.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
__webpack_require__("../node_modules/tns-core-modules/globals/globals.js");
var observable_1 = __webpack_require__("../node_modules/tns-core-modules/data/observable/observable.js");
exports.Observable = observable_1.Observable;
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
var events = new observable_1.Observable();
var launched = false;
function setLaunched() {
launched = true;
events.off("launch", setLaunched);
}
events.on("launch", setLaunched);
if (profiling_1.level() > 0) {
events.on("displayed", function () {
var duration = profiling_1.uptime();
var end = profiling_1.time();
var start = end - duration;
profiling_1.trace("Displayed in " + duration.toFixed(2) + "ms", start, end);
});
}
function hasLaunched() {
return launched;
}
exports.hasLaunched = hasLaunched;
exports.launchEvent = "launch";
exports.suspendEvent = "suspend";
exports.displayedEvent = "displayed";
exports.resumeEvent = "resume";
exports.exitEvent = "exit";
exports.lowMemoryEvent = "lowMemory";
exports.uncaughtErrorEvent = "uncaughtError";
exports.orientationChangedEvent = "orientationChanged";
var cssFile = "./app.css";
var resources = {};
function getResources() {
return resources;
}
exports.getResources = getResources;
function setResources(res) {
resources = res;
}
exports.setResources = setResources;
exports.android = undefined;
exports.ios = undefined;
exports.on = events.on.bind(events);
exports.off = events.off.bind(events);
exports.notify = events.notify.bind(events);
exports.hasListeners = events.hasListeners.bind(events);
var app;
function setApplication(instance) {
app = instance;
}
exports.setApplication = setApplication;
function livesync() {
events.notify({ eventName: "livesync", object: app });
var liveSyncCore = global.__onLiveSyncCore;
if (liveSyncCore) {
liveSyncCore();
}
}
exports.livesync = livesync;
function setCssFileName(cssFileName) {
cssFile = cssFileName;
events.notify({ eventName: "cssChanged", object: app, cssFile: cssFileName });
}
exports.setCssFileName = setCssFileName;
function getCssFileName() {
return cssFile;
}
exports.getCssFileName = getCssFileName;
function loadAppCss() {
try {
events.notify({ eventName: "loadAppCss", object: app, cssFile: getCssFileName() });
}
catch (e) {
throw new Error("The file " + getCssFileName() + " couldn't be loaded! " +
"You may need to register it inside ./app/vendor.ts.");
}
}
exports.loadAppCss = loadAppCss;
function addCss(cssText) {
events.notify({ eventName: "cssChanged", object: app, cssText: cssText });
}
exports.addCss = addCss;
global.__onUncaughtError = function (error) {
events.notify({ eventName: exports.uncaughtErrorEvent, object: app, android: error, ios: error, error: error });
};
//# sourceMappingURL=application-common.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/application/application.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var application_common_1 = __webpack_require__("../node_modules/tns-core-modules/application/application-common.js");
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
__export(__webpack_require__("../node_modules/tns-core-modules/application/application-common.js"));
var ActivityCreated = "activityCreated";
var ActivityDestroyed = "activityDestroyed";
var ActivityStarted = "activityStarted";
var ActivityPaused = "activityPaused";
var ActivityResumed = "activityResumed";
var ActivityStopped = "activityStopped";
var SaveActivityState = "saveActivityState";
var ActivityResult = "activityResult";
var ActivityBackPressed = "activityBackPressed";
var ActivityRequestPermissions = "activityRequestPermissions";
var AndroidApplication = (function (_super) {
__extends(AndroidApplication, _super);
function AndroidApplication() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.callbacks = {};
_this._registeredReceivers = {};
_this._pendingReceiverRegistrations = new Array();
return _this;
}
Object.defineProperty(AndroidApplication.prototype, "currentContext", {
get: function () {
return this.foregroundActivity;
},
enumerable: true,
configurable: true
});
AndroidApplication.prototype.init = function (nativeApp) {
if (this.nativeApp === nativeApp) {
return;
}
if (this.nativeApp) {
throw new Error("application.android already initialized.");
}
this.nativeApp = nativeApp;
this.packageName = nativeApp.getPackageName();
this.context = nativeApp.getApplicationContext();
this.callbacks.lifecycleCallbacks = initLifecycleCallbacks();
this.callbacks.componentCallbacks = initComponentCallbacks();
this.nativeApp.registerActivityLifecycleCallbacks(this.callbacks.lifecycleCallbacks);
this.nativeApp.registerComponentCallbacks(this.callbacks.componentCallbacks);
this._registerPendingReceivers();
};
AndroidApplication.prototype._registerPendingReceivers = function () {
var _this = this;
this._pendingReceiverRegistrations.forEach(function (func) { return func(_this.context); });
this._pendingReceiverRegistrations.length = 0;
};
AndroidApplication.prototype.registerBroadcastReceiver = function (intentFilter, onReceiveCallback) {
ensureBroadCastReceiverClass();
var that = this;
var registerFunc = function (context) {
var receiver = new BroadcastReceiverClass(onReceiveCallback);
context.registerReceiver(receiver, new android.content.IntentFilter(intentFilter));
that._registeredReceivers[intentFilter] = receiver;
};
if (this.context) {
registerFunc(this.context);
}
else {
this._pendingReceiverRegistrations.push(registerFunc);
}
};
AndroidApplication.prototype.unregisterBroadcastReceiver = function (intentFilter) {
var receiver = this._registeredReceivers[intentFilter];
if (receiver) {
this.context.unregisterReceiver(receiver);
this._registeredReceivers[intentFilter] = undefined;
delete this._registeredReceivers[intentFilter];
}
};
AndroidApplication.activityCreatedEvent = ActivityCreated;
AndroidApplication.activityDestroyedEvent = ActivityDestroyed;
AndroidApplication.activityStartedEvent = ActivityStarted;
AndroidApplication.activityPausedEvent = ActivityPaused;
AndroidApplication.activityResumedEvent = ActivityResumed;
AndroidApplication.activityStoppedEvent = ActivityStopped;
AndroidApplication.saveActivityStateEvent = SaveActivityState;
AndroidApplication.activityResultEvent = ActivityResult;
AndroidApplication.activityBackPressedEvent = ActivityBackPressed;
AndroidApplication.activityRequestPermissionsEvent = ActivityRequestPermissions;
return AndroidApplication;
}(application_common_1.Observable));
exports.AndroidApplication = AndroidApplication;
var androidApp = new AndroidApplication();
exports.android = androidApp;
application_common_1.setApplication(androidApp);
var mainEntry;
var started = false;
var createRootFrame = { value: true };
function start(entry) {
if (started) {
throw new Error("Application is already started.");
}
started = true;
mainEntry = typeof entry === "string" ? { moduleName: entry } : entry;
if (!androidApp.nativeApp) {
var nativeApp = getNativeApplication();
androidApp.init(nativeApp);
}
}
exports.start = start;
function shouldCreateRootFrame() {
return createRootFrame.value;
}
exports.shouldCreateRootFrame = shouldCreateRootFrame;
function run(entry) {
createRootFrame.value = false;
start(entry);
}
exports.run = run;
var CALLBACKS = "_callbacks";
function _resetRootView(entry) {
var activity = androidApp.foregroundActivity;
if (!activity) {
throw new Error("Cannot find android activity.");
}
createRootFrame.value = false;
mainEntry = typeof entry === "string" ? { moduleName: entry } : entry;
var callbacks = activity[CALLBACKS];
callbacks.resetActivityContent(activity);
}
exports._resetRootView = _resetRootView;
function getMainEntry() {
return mainEntry;
}
exports.getMainEntry = getMainEntry;
function getRootView() {
var activity = androidApp.foregroundActivity || androidApp.startActivity;
if (!activity) {
return undefined;
}
var callbacks = activity[CALLBACKS];
return callbacks ? callbacks.getRootView() : undefined;
}
exports.getRootView = getRootView;
function getNativeApplication() {
var nativeApp = androidApp.nativeApp;
if (!nativeApp) {
if (!nativeApp && com.tns.NativeScriptApplication) {
nativeApp = com.tns.NativeScriptApplication.getInstance();
}
if (!nativeApp) {
var clazz = java.lang.Class.forName("android.app.ActivityThread");
if (clazz) {
var method = clazz.getMethod("currentApplication", null);
if (method) {
nativeApp = method.invoke(null, null);
}
}
}
if (!nativeApp) {
throw new Error("Failed to retrieve native Android Application object. If you have a custom android.app.Application type implemented make sure that you've called the '<application-module>.android.init' method.");
}
}
return nativeApp;
}
exports.getNativeApplication = getNativeApplication;
global.__onLiveSync = function () {
if (androidApp && androidApp.paused) {
return;
}
application_common_1.livesync();
};
function initLifecycleCallbacks() {
var setThemeOnLaunch = profiling_1.profile("setThemeOnLaunch", function (activity) {
var activityInfo = activity.getPackageManager().getActivityInfo(activity.getComponentName(), android.content.pm.PackageManager.GET_META_DATA);
if (activityInfo.metaData) {
var setThemeOnLaunch_1 = activityInfo.metaData.getInt("SET_THEME_ON_LAUNCH", -1);
if (setThemeOnLaunch_1 !== -1) {
activity.setTheme(setThemeOnLaunch_1);
}
}
});
var notifyActivityCreated = profiling_1.profile("notifyActivityCreated", function (activity, savedInstanceState) {
androidApp.notify({ eventName: ActivityCreated, object: androidApp, activity: activity, bundle: savedInstanceState });
});
var subscribeForGlobalLayout = profiling_1.profile("subscribeForGlobalLayout", function (activity) {
var rootView = activity.getWindow().getDecorView().getRootView();
this.onGlobalLayoutListener = new android.view.ViewTreeObserver.OnGlobalLayoutListener({
onGlobalLayout: function () {
application_common_1.notify({ eventName: application_common_1.displayedEvent, object: androidApp, activity: activity });
var viewTreeObserver = rootView.getViewTreeObserver();
viewTreeObserver.removeOnGlobalLayoutListener(this.onGlobalLayoutListener);
}
});
rootView.getViewTreeObserver().addOnGlobalLayoutListener(this.onGlobalLayoutListener);
});
var lifecycleCallbacks = new android.app.Application.ActivityLifecycleCallbacks({
onActivityCreated: profiling_1.profile("onActivityCreated", function (activity, savedInstanceState) {
setThemeOnLaunch(activity);
if (!androidApp.startActivity) {
androidApp.startActivity = activity;
}
notifyActivityCreated(activity, savedInstanceState);
if (application_common_1.hasListeners(application_common_1.displayedEvent)) {
subscribeForGlobalLayout(activity);
}
}),
onActivityDestroyed: profiling_1.profile("onActivityDestroyed", function (activity) {
if (activity === androidApp.foregroundActivity) {
androidApp.foregroundActivity = undefined;
}
if (activity === androidApp.startActivity) {
androidApp.startActivity = undefined;
}
androidApp.notify({ eventName: ActivityDestroyed, object: androidApp, activity: activity });
gc();
}),
onActivityPaused: profiling_1.profile("onActivityPaused", function (activity) {
if (activity.isNativeScriptActivity) {
androidApp.paused = true;
application_common_1.notify({ eventName: application_common_1.suspendEvent, object: androidApp, android: activity });
}
androidApp.notify({ eventName: ActivityPaused, object: androidApp, activity: activity });
}),
onActivityResumed: profiling_1.profile("onActivityResumed", function (activity) {
androidApp.foregroundActivity = activity;
if (activity.isNativeScriptActivity) {
application_common_1.notify({ eventName: application_common_1.resumeEvent, object: androidApp, android: activity });
androidApp.paused = false;
}
androidApp.notify({ eventName: ActivityResumed, object: androidApp, activity: activity });
}),
onActivitySaveInstanceState: profiling_1.profile("onActivityResumed", function (activity, outState) {
androidApp.notify({ eventName: SaveActivityState, object: androidApp, activity: activity, bundle: outState });
}),
onActivityStarted: profiling_1.profile("onActivityStarted", function (activity) {
androidApp.notify({ eventName: ActivityStarted, object: androidApp, activity: activity });
}),
onActivityStopped: profiling_1.profile("onActivityStopped", function (activity) {
androidApp.notify({ eventName: ActivityStopped, object: androidApp, activity: activity });
})
});
return lifecycleCallbacks;
}
var currentOrientation;
function initComponentCallbacks() {
var componentCallbacks = new android.content.ComponentCallbacks2({
onLowMemory: profiling_1.profile("onLowMemory", function () {
gc();
java.lang.System.gc();
application_common_1.notify({ eventName: application_common_1.lowMemoryEvent, object: this, android: this });
}),
onTrimMemory: profiling_1.profile("onTrimMemory", function (level) {
}),
onConfigurationChanged: profiling_1.profile("onConfigurationChanged", function (newConfig) {
var newOrientation = newConfig.orientation;
if (newOrientation === currentOrientation) {
return;
}
currentOrientation = newOrientation;
var newValue;
switch (newOrientation) {
case android.content.res.Configuration.ORIENTATION_LANDSCAPE:
newValue = "landscape";
break;
case android.content.res.Configuration.ORIENTATION_PORTRAIT:
newValue = "portrait";
break;
default:
newValue = "unknown";
break;
}
application_common_1.notify({
eventName: application_common_1.orientationChangedEvent,
android: androidApp.nativeApp,
newValue: newValue,
object: androidApp
});
})
});
return componentCallbacks;
}
var BroadcastReceiverClass;
function ensureBroadCastReceiverClass() {
if (BroadcastReceiverClass) {
return;
}
var BroadcastReceiver = (function (_super) {
__extends(BroadcastReceiver, _super);
function BroadcastReceiver(onReceiveCallback) {
var _this = _super.call(this) || this;
_this._onReceiveCallback = onReceiveCallback;
return global.__native(_this);
}
BroadcastReceiver.prototype.onReceive = function (context, intent) {
if (this._onReceiveCallback) {
this._onReceiveCallback(context, intent);
}
};
return BroadcastReceiver;
}(android.content.BroadcastReceiver));
BroadcastReceiverClass = BroadcastReceiver;
}
//# sourceMappingURL=application.android.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/bundle-entry-points.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {if (true) {
__webpack_require__("../node_modules/tns-core-modules/globals/globals.js");
global.registerModule("text/formatted-string", function () { return __webpack_require__("../node_modules/tns-core-modules/text/formatted-string.js"); });
global.registerModule("text/span", function () { return __webpack_require__("../node_modules/tns-core-modules/text/span.js"); });
global.registerModule("ui/action-bar", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/action-bar/action-bar.js"); });
global.registerModule("ui/activity-indicator", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/activity-indicator/activity-indicator.js"); });
global.registerModule("ui/border", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/border/border.js"); });
global.registerModule("ui/button", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/button/button.js"); });
global.registerModule("ui/content-view", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/content-view/content-view.js"); });
global.registerModule("ui/date-picker", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/date-picker/date-picker.js"); });
global.registerModule("ui/frame", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/frame/frame.js"); });
global.registerModule("ui/html-view", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/html-view/html-view.js"); });
global.registerModule("ui/image", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/image/image.js"); });
global.registerModule("ui/label", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/label/label.js"); });
global.registerModule("ui/layouts/absolute-layout", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/layouts/absolute-layout/absolute-layout.js"); });
global.registerModule("ui/layouts/dock-layout", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/layouts/dock-layout/dock-layout.js"); });
global.registerModule("ui/layouts/grid-layout", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/layouts/grid-layout/grid-layout.js"); });
global.registerModule("ui/layouts/stack-layout", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/layouts/stack-layout/stack-layout.js"); });
global.registerModule("ui/layouts/flexbox-layout", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/layouts/flexbox-layout/flexbox-layout.js"); });
global.registerModule("ui/layouts/wrap-layout", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/layouts/wrap-layout/wrap-layout.js"); });
global.registerModule("ui/list-picker", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/list-picker/list-picker.js"); });
global.registerModule("ui/page", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/page/page.js"); });
global.registerModule("ui/placeholder", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/placeholder/placeholder.js"); });
global.registerModule("ui/progress", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/progress/progress.js"); });
global.registerModule("ui/proxy-view-container", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/proxy-view-container/proxy-view-container.js"); });
global.registerModule("ui/repeater", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/repeater/repeater.js"); });
global.registerModule("ui/scroll-view", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/scroll-view/scroll-view.js"); });
global.registerModule("ui/search-bar", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/search-bar/search-bar.js"); });
global.registerModule("ui/segmented-bar", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/segmented-bar/segmented-bar.js"); });
global.registerModule("ui/slider", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/slider/slider.js"); });
global.registerModule("ui/switch", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/switch/switch.js"); });
global.registerModule("ui/tab-view", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/tab-view/tab-view.js"); });
global.registerModule("ui/web-view", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/web-view/web-view.js"); });
global.registerModule("ui/text-field", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/text-field/text-field.js"); });
global.registerModule("ui/text-view", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/text-view/text-view.js"); });
global.registerModule("ui/time-picker", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/time-picker/time-picker.js"); });
global.registerModule("ui/list-view", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/list-view/list-view.js"); });
}
//# sourceMappingURL=bundle-entry-points.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/color/color-common.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var types = __webpack_require__("../node_modules/tns-core-modules/utils/types.js");
var knownColors = __webpack_require__("../node_modules/tns-core-modules/color/known-colors.js");
var SHARP = "#";
var HEX_REGEX = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i;
var Color = (function () {
function Color() {
if (arguments.length === 1) {
var arg = arguments[0];
if (types.isString(arg)) {
if (isRgbOrRgba(arg)) {
this._argb = argbFromRgbOrRgba(arg);
}
else if (knownColors.isKnownName(arg)) {
var hex = knownColors.getKnownColor(arg);
this._name = arg;
this._argb = this._argbFromString(hex);
}
else if (HEX_REGEX.test(arg)) {
var hex = this._normalizeHex(arg);
this._argb = this._argbFromString(hex);
}
else {
throw new Error("Invalid color: " + arg);
}
}
else if (types.isNumber(arg)) {
this._argb = arg >>> 0;
}
else {
throw new Error("Expected 1 or 4 constructor parameters.");
}
}
else if (arguments.length === 4) {
this._argb = (arguments[0] & 0xFF) * 0x01000000
+ (arguments[1] & 0xFF) * 0x00010000
+ (arguments[2] & 0xFF) * 0x00000100
+ (arguments[3] & 0xFF) * 0x00000001;
}
else {
throw new Error("Expected 1 or 4 constructor parameters.");
}
}
Object.defineProperty(Color.prototype, "a", {
get: function () { return (this._argb / 0x01000000) & 0xFF; },
enumerable: true,
configurable: true
});
Object.defineProperty(Color.prototype, "r", {
get: function () { return (this._argb / 0x00010000) & 0xFF; },
enumerable: true,
configurable: true
});
Object.defineProperty(Color.prototype, "g", {
get: function () { return (this._argb / 0x00000100) & 0xFF; },
enumerable: true,
configurable: true
});
Object.defineProperty(Color.prototype, "b", {
get: function () { return (this._argb / 0x00000001) & 0xFF; },
enumerable: true,
configurable: true
});
Object.defineProperty(Color.prototype, "argb", {
get: function () {
return this._argb;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Color.prototype, "hex", {
get: function () {
if (this.a === 0xFF) {
return ("#" + this._componentToHex(this.r) + this._componentToHex(this.g) + this._componentToHex(this.b)).toUpperCase();
}
else {
return ("#" + this._componentToHex(this.a) + this._componentToHex(this.r) + this._componentToHex(this.g) + this._componentToHex(this.b)).toUpperCase();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(Color.prototype, "name", {
get: function () {
return this._name;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Color.prototype, "ios", {
get: function () {
return undefined;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Color.prototype, "android", {
get: function () {
return undefined;
},
enumerable: true,
configurable: true
});
Color.prototype._argbFromString = function (hex) {
if (hex.charAt(0) === "#") {
hex = hex.substr(1);
}
if (hex.length === 3) {
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
}
else if (hex.length === 4) {
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2] + hex[3] + hex[3];
}
var intVal = parseInt(hex, 16);
if (hex.length === 6) {
intVal = (intVal & 0x00FFFFFF) + 0xFF000000;
}
return intVal;
};
Color.prototype.equals = function (value) {
return value && this.argb === value.argb;
};
Color.equals = function (value1, value2) {
if (!value1 && !value2) {
return true;
}
if (!value1 || !value2) {
return false;
}
return value1.equals(value2);
};
Color.isValid = function (value) {
if (types.isNullOrUndefined(value) || value instanceof Color) {
return true;
}
if (!types.isString(value)) {
return false;
}
if (knownColors.isKnownName(value)) {
return true;
}
return HEX_REGEX.test(value) || isRgbOrRgba(value);
};
Color.prototype._componentToHex = function (component) {
var hex = component.toString(16);
if (hex.length === 1) {
hex = "0" + hex;
}
return hex;
};
Color.prototype._normalizeHex = function (hexStr) {
if (hexStr.charAt(0) === SHARP && hexStr.length === 4) {
hexStr = hexStr.charAt(0)
+ hexStr.charAt(1) + hexStr.charAt(1)
+ hexStr.charAt(2) + hexStr.charAt(2)
+ hexStr.charAt(3) + hexStr.charAt(3);
}
return hexStr;
};
Color.prototype.toString = function () {
return this.hex;
};
return Color;
}());
exports.Color = Color;
function isRgbOrRgba(value) {
var toLower = value.toLowerCase();
return (toLower.indexOf("rgb(") === 0 || toLower.indexOf("rgba(") === 0) && toLower.indexOf(")") === (toLower.length - 1);
}
function argbFromRgbOrRgba(value) {
var toLower = value.toLowerCase();
var parts = toLower.replace("rgba(", "").replace("rgb(", "").replace(")", "").trim().split(",");
var r = 255;
var g = 255;
var b = 255;
var a = 255;
if (parts[0]) {
r = parseInt(parts[0].trim());
}
if (parts[1]) {
g = parseInt(parts[1].trim());
}
if (parts[2]) {
b = parseInt(parts[2].trim());
}
if (parts[3]) {
a = Math.round(parseFloat(parts[3].trim()) * 255);
}
return (a & 0xFF) * 0x01000000
+ (r & 0xFF) * 0x00010000
+ (g & 0xFF) * 0x00000100
+ (b & 0xFF) * 0x00000001;
}
//# sourceMappingURL=color-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/color/color.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var common = __webpack_require__("../node_modules/tns-core-modules/color/color-common.js");
var Color = (function (_super) {
__extends(Color, _super);
function Color() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(Color.prototype, "android", {
get: function () {
return this.argb >> 0;
},
enumerable: true,
configurable: true
});
return Color;
}(common.Color));
exports.Color = Color;
//# sourceMappingURL=color.android.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/color/known-colors.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.Transparent = "#00000000";
exports.AliceBlue = "#F0F8FF";
exports.AntiqueWhite = "#FAEBD7";
exports.Aqua = "#00FFFF";
exports.Aquamarine = "#7FFFD4";
exports.Azure = "#F0FFFF";
exports.Beige = "#F5F5DC";
exports.Bisque = "#FFE4C4";
exports.Black = "#000000";
exports.BlanchedAlmond = "#FFEBCD";
exports.Blue = "#0000FF";
exports.BlueViolet = "#8A2BE2";
exports.Brown = "#A52A2A";
exports.BurlyWood = "#DEB887";
exports.CadetBlue = "#5F9EA0";
exports.Chartreuse = "#7FFF00";
exports.Chocolate = "#D2691E";
exports.Coral = "#FF7F50";
exports.CornflowerBlue = "#6495ED";
exports.Cornsilk = "#FFF8DC";
exports.Crimson = "#DC143C";
exports.Cyan = "#00FFFF";
exports.DarkBlue = "#00008B";
exports.DarkCyan = "#008B8B";
exports.DarkGoldenRod = "#B8860B";
exports.DarkGray = "#A9A9A9";
exports.DarkGreen = "#006400";
exports.DarkKhaki = "#BDB76B";
exports.DarkMagenta = "#8B008B";
exports.DarkOliveGreen = "#556B2F";
exports.DarkOrange = "#FF8C00";
exports.DarkOrchid = "#9932CC";
exports.DarkRed = "#8B0000";
exports.DarkSalmon = "#E9967A";
exports.DarkSeaGreen = "#8FBC8F";
exports.DarkSlateBlue = "#483D8B";
exports.DarkSlateGray = "#2F4F4F";
exports.DarkTurquoise = "#00CED1";
exports.DarkViolet = "#9400D3";
exports.DeepPink = "#FF1493";
exports.DeepSkyBlue = "#00BFFF";
exports.DimGray = "#696969";
exports.DodgerBlue = "#1E90FF";
exports.FireBrick = "#B22222";
exports.FloralWhite = "#FFFAF0";
exports.ForestGreen = "#228B22";
exports.Fuchsia = "#FF00FF";
exports.Gainsboro = "#DCDCDC";
exports.GhostWhite = "#F8F8FF";
exports.Gold = "#FFD700";
exports.GoldenRod = "#DAA520";
exports.Gray = "#808080";
exports.Green = "#008000";
exports.GreenYellow = "#ADFF2F";
exports.HoneyDew = "#F0FFF0";
exports.HotPink = "#FF69B4";
exports.IndianRed = "#CD5C5C";
exports.Indigo = "#4B0082";
exports.Ivory = "#FFFFF0";
exports.Khaki = "#F0E68C";
exports.Lavender = "#E6E6FA";
exports.LavenderBlush = "#FFF0F5";
exports.LawnGreen = "#7CFC00";
exports.LemonChiffon = "#FFFACD";
exports.LightBlue = "#ADD8E6";
exports.LightCoral = "#F08080";
exports.LightCyan = "#E0FFFF";
exports.LightGoldenRodYellow = "#FAFAD2";
exports.LightGray = "#D3D3D3";
exports.LightGreen = "#90EE90";
exports.LightPink = "#FFB6C1";
exports.LightSalmon = "#FFA07A";
exports.LightSeaGreen = "#20B2AA";
exports.LightSkyBlue = "#87CEFA";
exports.LightSlateGray = "#778899";
exports.LightSteelBlue = "#B0C4DE";
exports.LightYellow = "#FFFFE0";
exports.Lime = "#00FF00";
exports.LimeGreen = "#32CD32";
exports.Linen = "#FAF0E6";
exports.Magenta = "#FF00FF";
exports.Maroon = "#800000";
exports.MediumAquaMarine = "#66CDAA";
exports.MediumBlue = "#0000CD";
exports.MediumOrchid = "#BA55D3";
exports.MediumPurple = "#9370DB";
exports.MediumSeaGreen = "#3CB371";
exports.MediumSlateBlue = "#7B68EE";
exports.MediumSpringGreen = "#00FA9A";
exports.MediumTurquoise = "#48D1CC";
exports.MediumVioletRed = "#C71585";
exports.MidnightBlue = "#191970";
exports.MintCream = "#F5FFFA";
exports.MistyRose = "#FFE4E1";
exports.Moccasin = "#FFE4B5";
exports.NavajoWhite = "#FFDEAD";
exports.Navy = "#000080";
exports.OldLace = "#FDF5E6";
exports.Olive = "#808000";
exports.OliveDrab = "#6B8E23";
exports.Orange = "#FFA500";
exports.OrangeRed = "#FF4500";
exports.Orchid = "#DA70D6";
exports.PaleGoldenRod = "#EEE8AA";
exports.PaleGreen = "#98FB98";
exports.PaleTurquoise = "#AFEEEE";
exports.PaleVioletRed = "#DB7093";
exports.PapayaWhip = "#FFEFD5";
exports.PeachPuff = "#FFDAB9";
exports.Peru = "#CD853F";
exports.Pink = "#FFC0CB";
exports.Plum = "#DDA0DD";
exports.PowderBlue = "#B0E0E6";
exports.Purple = "#800080";
exports.Red = "#FF0000";
exports.RosyBrown = "#BC8F8F";
exports.RoyalBlue = "#4169E1";
exports.SaddleBrown = "#8B4513";
exports.Salmon = "#FA8072";
exports.SandyBrown = "#F4A460";
exports.SeaGreen = "#2E8B57";
exports.SeaShell = "#FFF5EE";
exports.Sienna = "#A0522D";
exports.Silver = "#C0C0C0";
exports.SkyBlue = "#87CEEB";
exports.SlateBlue = "#6A5ACD";
exports.SlateGray = "#708090";
exports.Snow = "#FFFAFA";
exports.SpringGreen = "#00FF7F";
exports.SteelBlue = "#4682B4";
exports.Tan = "#D2B48C";
exports.Teal = "#008080";
exports.Thistle = "#D8BFD8";
exports.Tomato = "#FF6347";
exports.Turquoise = "#40E0D0";
exports.Violet = "#EE82EE";
exports.Wheat = "#F5DEB3";
exports.White = "#FFFFFF";
exports.WhiteSmoke = "#F5F5F5";
exports.Yellow = "#FFFF00";
exports.YellowGreen = "#9ACD32";
var _allColors = {};
(function () {
var name;
var underscore = "_";
for (var p in exports) {
name = p;
if (name.charAt(0) !== underscore) {
_allColors[name.toLowerCase()] = exports[p];
}
}
})();
function isKnownName(name) {
if (!name) {
return undefined;
}
return name.toLowerCase() in _allColors;
}
exports.isKnownName = isKnownName;
function getKnownColor(name) {
if (!name) {
return undefined;
}
return _allColors[name.toLowerCase()];
}
exports.getKnownColor = getKnownColor;
//# sourceMappingURL=known-colors.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/console/console.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var Console = (function () {
function Console() {
}
Console.prototype.time = function (reportName) {
};
Console.prototype.timeEnd = function (reportName) {
};
Console.prototype.assert = function (test, message) {
};
Console.prototype.info = function (message) {
};
Console.prototype.warn = function (message) {
};
Console.prototype.error = function (message) {
};
Console.prototype.log = function (message) {
};
Console.prototype.trace = function () {
};
Console.prototype.dir = function (obj) {
};
return Console;
}());
exports.Console = Console;
//# sourceMappingURL=console.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/css-value/index.js":
/***/ (function(module, exports) {
exports.parse = parse;
function parse(str) {
return new Parser(str).parse();
}
function Parser(str) {
this.str = str;
}
Parser.prototype.skip = function(m){
this.str = this.str.slice(m[0].length);
};
Parser.prototype.comma = function(){
var m = /^, */.exec(this.str);
if (!m) return;
this.skip(m);
return { type: 'comma', string: ',' };
};
Parser.prototype.ident = function(){
var m = /^([\w-]+) */.exec(this.str);
if (!m) return;
this.skip(m);
return {
type: 'ident',
string: m[1]
}
};
Parser.prototype.int = function(){
var m = /^(([-\+]?\d+)(\S+)?) */.exec(this.str);
if (!m) return;
this.skip(m);
var n = ~~m[2];
var u = m[3];
return {
type: 'number',
string: m[1],
unit: u || '',
value: n
}
};
Parser.prototype.float = function(){
var m = /^(((?:[-\+]?\d+)?\.\d+)(\S+)?) */.exec(this.str);
if (!m) return;
this.skip(m);
var n = parseFloat(m[2]);
var u = m[3];
return {
type: 'number',
string: m[1],
unit: u || '',
value: n
}
};
Parser.prototype.number = function(){
return this.float() || this.int();
};
Parser.prototype.double = function(){
var m = /^"([^"]*)" */.exec(this.str);
if (!m) return m;
this.skip(m);
return {
type: 'string',
quote: '"',
string: '"' + m[1] + '"',
value: m[1]
}
};
Parser.prototype.single = function(){
var m = /^'([^']*)' */.exec(this.str);
if (!m) return m;
this.skip(m);
return {
type: 'string',
quote: "'",
string: "'" + m[1] + "'",
value: m[1]
}
};
Parser.prototype.string = function(){
return this.single() || this.double();
};
Parser.prototype.value = function(){
return this.number()
|| this.ident()
|| this.string()
|| this.comma();
};
Parser.prototype.parse = function(){
var vals = [];
while (this.str.length) {
var obj = this.value();
if (!obj) throw new Error('failed to parse near `' + this.str.slice(0, 10) + '...`');
vals.push(obj);
}
return vals;
};
/***/ }),
/***/ "../node_modules/tns-core-modules/css/index.js":
/***/ (function(module, exports, __webpack_require__) {
exports.parse = __webpack_require__("../node_modules/tns-core-modules/css/lib/parse/index.js");
/***/ }),
/***/ "../node_modules/tns-core-modules/css/lib/parse/index.js":
/***/ (function(module, exports) {
// http://www.w3.org/TR/CSS21/grammar.html
// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027
var commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g
module.exports = function(css, options){
options = options || {};
/**
* Positional.
*/
var lineno = 1;
var column = 1;
/**
* Update lineno and column based on `str`.
*/
function updatePosition(str) {
var lines = str.match(/\n/g);
if (lines) lineno += lines.length;
var i = str.lastIndexOf('\n');
column = ~i ? str.length - i : column + str.length;
}
/**
* Mark position and patch `node.position`.
*/
function position() {
var start = { line: lineno, column: column };
return function(node){
node.position = new Position(start);
whitespace();
return node;
};
}
/**
* Store position information for a node
*/
function Position(start) {
this.start = start;
this.end = { line: lineno, column: column };
this.source = options.source;
}
/**
* Non-enumerable source string
*/
Position.prototype.content = css;
/**
* Error `msg`.
*/
var errorsList = [];
function error(msg) {
var err = new Error(options.source + ':' + lineno + ':' + column + ': ' + msg);
err.reason = msg;
err.filename = options.source;
err.line = lineno;
err.column = column;
err.source = css;
if (options.silent) {
errorsList.push(err);
} else {
throw err;
}
}
/**
* Parse stylesheet.
*/
function stylesheet() {
var rulesList = rules();
return {
type: 'stylesheet',
stylesheet: {
rules: rulesList,
parsingErrors: errorsList
}
};
}
/**
* Opening brace.
*/
function open() {
return match(/^{\s*/);
}
/**
* Closing brace.
*/
function close() {
return match(/^}/);
}
/**
* Parse ruleset.
*/
function rules() {
var node;
var rules = [];
whitespace();
comments(rules);
while (css.length && css.charAt(0) != '}' && (node = atrule() || rule())) {
if (node !== false) {
rules.push(node);
comments(rules);
}
}
return rules;
}
/**
* Match `re` and return captures.
*/
function match(re) {
var m = re.exec(css);
if (!m) return;
var str = m[0];
updatePosition(str);
css = css.slice(str.length);
return m;
}
/**
* Parse whitespace.
*/
function whitespace() {
match(/^\s*/);
}
/**
* Parse comments;
*/
function comments(rules) {
var c;
rules = rules || [];
while (c = comment()) {
if (c !== false) {
rules.push(c);
}
}
return rules;
}
/**
* Parse comment.
*/
function comment() {
var pos = position();
if ('/' != css.charAt(0) || '*' != css.charAt(1)) return;
var i = 2;
while ("" != css.charAt(i) && ('*' != css.charAt(i) || '/' != css.charAt(i + 1))) ++i;
i += 2;
if ("" === css.charAt(i-1)) {
return error('End of comment missing');
}
var str = css.slice(2, i - 2);
column += 2;
updatePosition(str);
css = css.slice(i);
column += 2;
return pos({
type: 'comment',
comment: str
});
}
/**
* Parse selector.
*/
function selector() {
var m = match(/^([^{]+)/);
if (!m) return;
/* @fix Remove all comments from selectors
* http://ostermiller.org/findcomment.html */
return trim(m[0])
.replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, '')
.replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, function(m) {
return m.replace(/,/g, '\u200C');
})
.split(/\s*(?![^(]*\)),\s*/)
.map(function(s) {
return s.replace(/\u200C/g, ',');
});
}
/**
* Parse declaration.
*/
function declaration() {
var pos = position();
// prop
var prop = match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);
if (!prop) return;
prop = trim(prop[0]);
// :
if (!match(/^:\s*/)) return error("property missing ':'");
// val
var val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/);
var ret = pos({
type: 'declaration',
property: prop.replace(commentre, ''),
value: val ? trim(val[0]).replace(commentre, '') : ''
});
// ;
match(/^[;\s]*/);
return ret;
}
/**
* Parse declarations.
*/
function declarations() {
var decls = [];
if (!open()) return error("missing '{'");
comments(decls);
// declarations
var decl;
while (decl = declaration()) {
if (decl !== false) {
decls.push(decl);
comments(decls);
}
}
if (!close()) return error("missing '}'");
return decls;
}
/**
* Parse keyframe.
*/
function keyframe() {
var m;
var vals = [];
var pos = position();
while (m = match(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/)) {
vals.push(m[1]);
match(/^,\s*/);
}
if (!vals.length) return;
return pos({
type: 'keyframe',
values: vals,
declarations: declarations()
});
}
/**
* Parse keyframes.
*/
function atkeyframes() {
var pos = position();
var m = match(/^@([-\w]+)?keyframes\s*/);
if (!m) return;
var vendor = m[1];
// identifier
var m = match(/^([-\w]+)\s*/);
if (!m) return error("@keyframes missing name");
var name = m[1];
if (!open()) return error("@keyframes missing '{'");
var frame;
var frames = comments();
while (frame = keyframe()) {
frames.push(frame);
frames = frames.concat(comments());
}
if (!close()) return error("@keyframes missing '}'");
return pos({
type: 'keyframes',
name: name,
vendor: vendor,
keyframes: frames
});
}
/**
* Parse supports.
*/
function atsupports() {
var pos = position();
var m = match(/^@supports *([^{]+)/);
if (!m) return;
var supports = trim(m[1]);
if (!open()) return error("@supports missing '{'");
var style = comments().concat(rules());
if (!close()) return error("@supports missing '}'");
return pos({
type: 'supports',
supports: supports,
rules: style
});
}
/**
* Parse host.
*/
function athost() {
var pos = position();
var m = match(/^@host\s*/);
if (!m) return;
if (!open()) return error("@host missing '{'");
var style = comments().concat(rules());
if (!close()) return error("@host missing '}'");
return pos({
type: 'host',
rules: style
});
}
/**
* Parse media.
*/
function atmedia() {
var pos = position();
var m = match(/^@media *([^{]+)/);
if (!m) return;
var media = trim(m[1]);
if (!open()) return error("@media missing '{'");
var style = comments().concat(rules());
if (!close()) return error("@media missing '}'");
return pos({
type: 'media',
media: media,
rules: style
});
}
/**
* Parse custom-media.
*/
function atcustommedia() {
var pos = position();
var m = match(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);
if (!m) return;
return pos({
type: 'custom-media',
name: trim(m[1]),
media: trim(m[2])
});
}
/**
* Parse paged media.
*/
function atpage() {
var pos = position();
var m = match(/^@page */);
if (!m) return;
var sel = selector() || [];
if (!open()) return error("@page missing '{'");
var decls = comments();
// declarations
var decl;
while (decl = declaration()) {
decls.push(decl);
decls = decls.concat(comments());
}
if (!close()) return error("@page missing '}'");
return pos({
type: 'page',
selectors: sel,
declarations: decls
});
}
/**
* Parse document.
*/
function atdocument() {
var pos = position();
var m = match(/^@([-\w]+)?document *([^{]+)/);
if (!m) return;
var vendor = trim(m[1]);
var doc = trim(m[2]);
if (!open()) return error("@document missing '{'");
var style = comments().concat(rules());
if (!close()) return error("@document missing '}'");
return pos({
type: 'document',
document: doc,
vendor: vendor,
rules: style
});
}
/**
* Parse font-face.
*/
function atfontface() {
var pos = position();
var m = match(/^@font-face\s*/);
if (!m) return;
if (!open()) return error("@font-face missing '{'");
var decls = comments();
// declarations
var decl;
while (decl = declaration()) {
decls.push(decl);
decls = decls.concat(comments());
}
if (!close()) return error("@font-face missing '}'");
return pos({
type: 'font-face',
declarations: decls
});
}
/**
* Parse import
*/
var atimport = _compileAtrule('import');
/**
* Parse charset
*/
var atcharset = _compileAtrule('charset');
/**
* Parse namespace
*/
var atnamespace = _compileAtrule('namespace');
/**
* Parse non-block at-rules
*/
function _compileAtrule(name) {
var re = new RegExp('^@' + name + '\\s*([^;]+);');
return function() {
var pos = position();
var m = match(re);
if (!m) return;
var ret = { type: name };
ret[name] = m[1].trim();
return pos(ret);
}
}
/**
* Parse at rule.
*/
function atrule() {
if (css[0] != '@') return;
return atkeyframes()
|| atmedia()
|| atcustommedia()
|| atsupports()
|| atimport()
|| atcharset()
|| atnamespace()
|| atdocument()
|| atpage()
|| athost()
|| atfontface();
}
/**
* Parse rule.
*/
function rule() {
var pos = position();
var sel = selector();
if (!sel) return error('selector missing');
comments();
return pos({
type: 'rule',
selectors: sel,
declarations: declarations()
});
}
return addParent(stylesheet());
};
/**
* Trim `str`.
*/
function trim(str) {
return str ? str.replace(/^\s+|\s+$/g, '') : '';
}
/**
* Adds non-enumerable parent node reference to each node.
*/
function addParent(obj, parent) {
var isNode = obj && typeof obj.type === 'string';
var childParent = isNode ? obj : parent;
for (var k in obj) {
var value = obj[k];
if (Array.isArray(value)) {
value.forEach(function(v) { addParent(v, childParent); });
} else if (value && typeof value === 'object') {
addParent(value, childParent);
}
}
if (isNode) {
Object.defineProperty(obj, 'parent', {
configurable: true,
writable: true,
enumerable: false,
value: parent || null
});
}
return obj;
}
/***/ }),
/***/ "../node_modules/tns-core-modules/css/parser.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var urlRegEx = /\s*url\((?:('|")([^\1]*)\1|([^\)]*))\)\s*/gy;
function parseURL(text, start) {
if (start === void 0) { start = 0; }
urlRegEx.lastIndex = start;
var result = urlRegEx.exec(text);
if (!result) {
return null;
}
var end = urlRegEx.lastIndex;
var value = result[2] || result[3];
return { start: start, end: end, value: value };
}
exports.parseURL = parseURL;
var hexColorRegEx = /\s*#((?:[0-9A-F]{8})|(?:[0-9A-F]{6})|(?:[0-9A-F]{3}))\s*/giy;
function parseHexColor(text, start) {
if (start === void 0) { start = 0; }
hexColorRegEx.lastIndex = start;
var result = hexColorRegEx.exec(text);
if (!result) {
return null;
}
var end = hexColorRegEx.lastIndex;
var hex = result[1];
var argb;
if (hex.length === 8) {
argb = parseInt("0x" + hex);
}
else if (hex.length === 6) {
argb = parseInt("0xFF" + hex);
}
else if (hex.length === 3) {
argb = parseInt("0xFF" + hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]);
}
return { start: start, end: end, value: argb };
}
exports.parseHexColor = parseHexColor;
function rgbaToArgbNumber(r, g, b, a) {
if (a === void 0) { a = 1; }
if (r >= 0 && r <= 255 && g >= 0 && g <= 255 && b >= 0 && b <= 255 && a >= 0 && a <= 1) {
return (Math.round(a * 0xFF) * 0x01000000) + (r * 0x010000) + (g * 0x000100) + (b * 0x000001);
}
else {
return null;
}
}
var rgbColorRegEx = /\s*(rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\))/gy;
function parseRGBColor(text, start) {
if (start === void 0) { start = 0; }
rgbColorRegEx.lastIndex = start;
var result = rgbColorRegEx.exec(text);
if (!result) {
return null;
}
var end = rgbColorRegEx.lastIndex;
var value = result[1] && rgbaToArgbNumber(parseInt(result[2]), parseInt(result[3]), parseInt(result[4]));
return { start: start, end: end, value: value };
}
exports.parseRGBColor = parseRGBColor;
var rgbaColorRegEx = /\s*(rgba\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*,\s*([01]?\.?\d*)\s*\))/gy;
function parseRGBAColor(text, start) {
if (start === void 0) { start = 0; }
rgbaColorRegEx.lastIndex = start;
var result = rgbaColorRegEx.exec(text);
if (!result) {
return null;
}
var end = rgbaColorRegEx.lastIndex;
var value = rgbaToArgbNumber(parseInt(result[2]), parseInt(result[3]), parseInt(result[4]), parseFloat(result[5]));
return { start: start, end: end, value: value };
}
exports.parseRGBAColor = parseRGBAColor;
var colors;
(function (colors) {
colors[colors["transparent"] = 0] = "transparent";
colors[colors["aliceblue"] = 4293982463] = "aliceblue";
colors[colors["antiquewhite"] = 4294634455] = "antiquewhite";
colors[colors["aqua"] = 4278255615] = "aqua";
colors[colors["aquamarine"] = 4286578644] = "aquamarine";
colors[colors["azure"] = 4293984255] = "azure";
colors[colors["beige"] = 4294309340] = "beige";
colors[colors["bisque"] = 4294960324] = "bisque";
colors[colors["black"] = 4278190080] = "black";
colors[colors["blanchedalmond"] = 4294962125] = "blanchedalmond";
colors[colors["blue"] = 4278190335] = "blue";
colors[colors["blueviolet"] = 4287245282] = "blueviolet";
colors[colors["brown"] = 4289014314] = "brown";
colors[colors["burlywood"] = 4292786311] = "burlywood";
colors[colors["cadetblue"] = 4284456608] = "cadetblue";
colors[colors["chartreuse"] = 4286578432] = "chartreuse";
colors[colors["chocolate"] = 4291979550] = "chocolate";
colors[colors["coral"] = 4294934352] = "coral";
colors[colors["cornflowerblue"] = 4284782061] = "cornflowerblue";
colors[colors["cornsilk"] = 4294965468] = "cornsilk";
colors[colors["crimson"] = 4292613180] = "crimson";
colors[colors["cyan"] = 4278255615] = "cyan";
colors[colors["darkblue"] = 4278190219] = "darkblue";
colors[colors["darkcyan"] = 4278225803] = "darkcyan";
colors[colors["darkgoldenrod"] = 4290283019] = "darkgoldenrod";
colors[colors["darkgray"] = 4289309097] = "darkgray";
colors[colors["darkgreen"] = 4278215680] = "darkgreen";
colors[colors["darkgrey"] = 4289309097] = "darkgrey";
colors[colors["darkkhaki"] = 4290623339] = "darkkhaki";
colors[colors["darkmagenta"] = 4287299723] = "darkmagenta";
colors[colors["darkolivegreen"] = 4283788079] = "darkolivegreen";
colors[colors["darkorange"] = 4294937600] = "darkorange";
colors[colors["darkorchid"] = 4288230092] = "darkorchid";
colors[colors["darkred"] = 4287299584] = "darkred";
colors[colors["darksalmon"] = 4293498490] = "darksalmon";
colors[colors["darkseagreen"] = 4287609999] = "darkseagreen";
colors[colors["darkslateblue"] = 4282924427] = "darkslateblue";
colors[colors["darkslategray"] = 4281290575] = "darkslategray";
colors[colors["darkslategrey"] = 4281290575] = "darkslategrey";
colors[colors["darkturquoise"] = 4278243025] = "darkturquoise";
colors[colors["darkviolet"] = 4287889619] = "darkviolet";
colors[colors["deeppink"] = 4294907027] = "deeppink";
colors[colors["deepskyblue"] = 4278239231] = "deepskyblue";
colors[colors["dimgray"] = 4285098345] = "dimgray";
colors[colors["dimgrey"] = 4285098345] = "dimgrey";
colors[colors["dodgerblue"] = 4280193279] = "dodgerblue";
colors[colors["firebrick"] = 4289864226] = "firebrick";
colors[colors["floralwhite"] = 4294966000] = "floralwhite";
colors[colors["forestgreen"] = 4280453922] = "forestgreen";
colors[colors["fuchsia"] = 4294902015] = "fuchsia";
colors[colors["gainsboro"] = 4292664540] = "gainsboro";
colors[colors["ghostwhite"] = 4294506751] = "ghostwhite";
colors[colors["gold"] = 4294956800] = "gold";
colors[colors["goldenrod"] = 4292519200] = "goldenrod";
colors[colors["gray"] = 4286611584] = "gray";
colors[colors["green"] = 4278222848] = "green";
colors[colors["greenyellow"] = 4289593135] = "greenyellow";
colors[colors["grey"] = 4286611584] = "grey";
colors[colors["honeydew"] = 4293984240] = "honeydew";
colors[colors["hotpink"] = 4294928820] = "hotpink";
colors[colors["indianred"] = 4291648604] = "indianred";
colors[colors["indigo"] = 4283105410] = "indigo";
colors[colors["ivory"] = 4294967280] = "ivory";
colors[colors["khaki"] = 4293977740] = "khaki";
colors[colors["lavender"] = 4293322490] = "lavender";
colors[colors["lavenderblush"] = 4294963445] = "lavenderblush";
colors[colors["lawngreen"] = 4286381056] = "lawngreen";
colors[colors["lemonchiffon"] = 4294965965] = "lemonchiffon";
colors[colors["lightblue"] = 4289583334] = "lightblue";
colors[colors["lightcoral"] = 4293951616] = "lightcoral";
colors[colors["lightcyan"] = 4292935679] = "lightcyan";
colors[colors["lightgoldenrodyellow"] = 4294638290] = "lightgoldenrodyellow";
colors[colors["lightgray"] = 4292072403] = "lightgray";
colors[colors["lightgreen"] = 4287688336] = "lightgreen";
colors[colors["lightgrey"] = 4292072403] = "lightgrey";
colors[colors["lightpink"] = 4294948545] = "lightpink";
colors[colors["lightsalmon"] = 4294942842] = "lightsalmon";
colors[colors["lightseagreen"] = 4280332970] = "lightseagreen";
colors[colors["lightskyblue"] = 4287090426] = "lightskyblue";
colors[colors["lightslategray"] = 4286023833] = "lightslategray";
colors[colors["lightslategrey"] = 4286023833] = "lightslategrey";
colors[colors["lightsteelblue"] = 4289774814] = "lightsteelblue";
colors[colors["lightyellow"] = 4294967264] = "lightyellow";
colors[colors["lime"] = 4278255360] = "lime";
colors[colors["limegreen"] = 4281519410] = "limegreen";
colors[colors["linen"] = 4294635750] = "linen";
colors[colors["magenta"] = 4294902015] = "magenta";
colors[colors["maroon"] = 4286578688] = "maroon";
colors[colors["mediumaquamarine"] = 4284927402] = "mediumaquamarine";
colors[colors["mediumblue"] = 4278190285] = "mediumblue";
colors[colors["mediumorchid"] = 4290401747] = "mediumorchid";
colors[colors["mediumpurple"] = 4287852763] = "mediumpurple";
colors[colors["mediumseagreen"] = 4282168177] = "mediumseagreen";
colors[colors["mediumslateblue"] = 4286277870] = "mediumslateblue";
colors[colors["mediumspringgreen"] = 4278254234] = "mediumspringgreen";
colors[colors["mediumturquoise"] = 4282962380] = "mediumturquoise";
colors[colors["mediumvioletred"] = 4291237253] = "mediumvioletred";
colors[colors["midnightblue"] = 4279834992] = "midnightblue";
colors[colors["mintcream"] = 4294311930] = "mintcream";
colors[colors["mistyrose"] = 4294960353] = "mistyrose";
colors[colors["moccasin"] = 4294960309] = "moccasin";
colors[colors["navajowhite"] = 4294958765] = "navajowhite";
colors[colors["navy"] = 4278190208] = "navy";
colors[colors["oldlace"] = 4294833638] = "oldlace";
colors[colors["olive"] = 4286611456] = "olive";
colors[colors["olivedrab"] = 4285238819] = "olivedrab";
colors[colors["orange"] = 4294944000] = "orange";
colors[colors["orangered"] = 4294919424] = "orangered";
colors[colors["orchid"] = 4292505814] = "orchid";
colors[colors["palegoldenrod"] = 4293847210] = "palegoldenrod";
colors[colors["palegreen"] = 4288215960] = "palegreen";
colors[colors["paleturquoise"] = 4289720046] = "paleturquoise";
colors[colors["palevioletred"] = 4292571283] = "palevioletred";
colors[colors["papayawhip"] = 4294963157] = "papayawhip";
colors[colors["peachpuff"] = 4294957753] = "peachpuff";
colors[colors["peru"] = 4291659071] = "peru";
colors[colors["pink"] = 4294951115] = "pink";
colors[colors["plum"] = 4292714717] = "plum";
colors[colors["powderblue"] = 4289781990] = "powderblue";
colors[colors["purple"] = 4286578816] = "purple";
colors[colors["red"] = 4294901760] = "red";
colors[colors["rosybrown"] = 4290547599] = "rosybrown";
colors[colors["royalblue"] = 4282477025] = "royalblue";
colors[colors["saddlebrown"] = 4287317267] = "saddlebrown";
colors[colors["salmon"] = 4294606962] = "salmon";
colors[colors["sandybrown"] = 4294222944] = "sandybrown";
colors[colors["seagreen"] = 4281240407] = "seagreen";
colors[colors["seashell"] = 4294964718] = "seashell";
colors[colors["sienna"] = 4288696877] = "sienna";
colors[colors["silver"] = 4290822336] = "silver";
colors[colors["skyblue"] = 4287090411] = "skyblue";
colors[colors["slateblue"] = 4285160141] = "slateblue";
colors[colors["slategray"] = 4285563024] = "slategray";
colors[colors["slategrey"] = 4285563024] = "slategrey";
colors[colors["snow"] = 4294966010] = "snow";
colors[colors["springgreen"] = 4278255487] = "springgreen";
colors[colors["steelblue"] = 4282811060] = "steelblue";
colors[colors["tan"] = 4291998860] = "tan";
colors[colors["teal"] = 4278222976] = "teal";
colors[colors["thistle"] = 4292394968] = "thistle";
colors[colors["tomato"] = 4294927175] = "tomato";
colors[colors["turquoise"] = 4282441936] = "turquoise";
colors[colors["violet"] = 4293821166] = "violet";
colors[colors["wheat"] = 4294303411] = "wheat";
colors[colors["white"] = 4294967295] = "white";
colors[colors["whitesmoke"] = 4294309365] = "whitesmoke";
colors[colors["yellow"] = 4294967040] = "yellow";
colors[colors["yellowgreen"] = 4288335154] = "yellowgreen";
})(colors = exports.colors || (exports.colors = {}));
;
function parseColorKeyword(value, start, keyword) {
if (keyword === void 0) { keyword = parseKeyword(value, start); }
if (keyword && keyword.value in colors) {
var end = keyword.end;
var value_1 = colors[keyword.value];
return { start: start, end: end, value: value_1 };
}
return null;
}
exports.parseColorKeyword = parseColorKeyword;
function parseColor(value, start, keyword) {
if (start === void 0) { start = 0; }
if (keyword === void 0) { keyword = parseKeyword(value, start); }
return parseHexColor(value, start) || parseColorKeyword(value, start, keyword) || parseRGBColor(value, start) || parseRGBAColor(value, start);
}
exports.parseColor = parseColor;
var keywordRegEx = /\s*([a-z][\w\-]*)\s*/giy;
function parseKeyword(text, start) {
if (start === void 0) { start = 0; }
keywordRegEx.lastIndex = start;
var result = keywordRegEx.exec(text);
if (!result) {
return null;
}
var end = keywordRegEx.lastIndex;
var value = result[1];
return { start: start, end: end, value: value };
}
var backgroundRepeatKeywords = new Set(["repeat", "repeat-x", "repeat-y", "no-repeat"]);
function parseRepeat(value, start, keyword) {
if (start === void 0) { start = 0; }
if (keyword === void 0) { keyword = parseKeyword(value, start); }
if (keyword && backgroundRepeatKeywords.has(keyword.value)) {
var end = keyword.end;
var value_2 = keyword.value;
return { start: start, end: end, value: value_2 };
}
return null;
}
exports.parseRepeat = parseRepeat;
var unitRegEx = /\s*([\+\-]?(?:\d+\.\d+|\d+|\.\d+)(?:[eE][\+\-]?\d+)?)([a-zA-Z]+|%)?\s*/gy;
function parseUnit(text, start) {
if (start === void 0) { start = 0; }
unitRegEx.lastIndex = start;
var result = unitRegEx.exec(text);
if (!result) {
return null;
}
var end = unitRegEx.lastIndex;
var value = parseFloat(result[1]);
var unit = result[2] || "dip";
return { start: start, end: end, value: { value: value, unit: unit } };
}
exports.parseUnit = parseUnit;
function parsePercentageOrLength(text, start) {
if (start === void 0) { start = 0; }
var unitResult = parseUnit(text, start);
if (unitResult) {
var start_1 = unitResult.start, end = unitResult.end;
var value = unitResult.value;
if (value.unit === "%") {
value.value /= 100;
}
else if (!value.unit) {
value.unit = "dip";
}
else if (value.unit === "px" || value.unit === "dip") {
}
else {
return null;
}
return { start: start_1, end: end, value: value };
}
return null;
}
exports.parsePercentageOrLength = parsePercentageOrLength;
var angleUnitsToRadMap = {
"deg": function (start, end, deg) { return ({ start: start, end: end, value: deg / 180 * Math.PI }); },
"rad": function (start, end, rad) { return ({ start: start, end: end, value: rad }); },
"grad": function (start, end, grad) { return ({ start: start, end: end, value: grad / 200 * Math.PI }); },
"turn": function (start, end, turn) { return ({ start: start, end: end, value: turn * Math.PI * 2 }); }
};
function parseAngle(value, start) {
if (start === void 0) { start = 0; }
var angleResult = parseUnit(value, start);
if (angleResult) {
var start_2 = angleResult.start, end = angleResult.end, value_3 = angleResult.value;
return (angleUnitsToRadMap[value_3.unit] || (function (_, __, ___) { return null; }))(start_2, end, value_3.value);
}
return null;
}
exports.parseAngle = parseAngle;
var backgroundSizeKeywords = new Set(["auto", "contain", "cover"]);
function parseBackgroundSize(value, start, keyword) {
if (start === void 0) { start = 0; }
if (keyword === void 0) { keyword = parseKeyword(value, start); }
var end = start;
if (keyword && backgroundSizeKeywords.has(keyword.value)) {
end = keyword.end;
var value_4 = keyword.value;
return { start: start, end: end, value: value_4 };
}
var firstLength = parsePercentageOrLength(value, end);
if (firstLength) {
end = firstLength.end;
var secondLength = parsePercentageOrLength(value, firstLength.end);
if (secondLength) {
end = secondLength.end;
return { start: start, end: end, value: { x: firstLength.value, y: secondLength.value } };
}
else {
return { start: start, end: end, value: { x: firstLength.value, y: "auto" } };
}
}
return null;
}
exports.parseBackgroundSize = parseBackgroundSize;
var backgroundPositionKeywords = Object.freeze(new Set(["left", "right", "top", "bottom", "center"]));
var backgroundPositionKeywordsDirection = {
"left": "x",
"right": "x",
"center": "center",
"top": "y",
"bottom": "y"
};
function parseBackgroundPosition(text, start, keyword) {
if (start === void 0) { start = 0; }
if (keyword === void 0) { keyword = parseKeyword(text, start); }
function formatH(align, offset) {
if (align.value === "center") {
return "center";
}
if (offset && offset.value.value !== 0) {
return { align: align.value, offset: offset.value };
}
return align.value;
}
function formatV(align, offset) {
if (align.value === "center") {
return "center";
}
if (offset && offset.value.value !== 0) {
return { align: align.value, offset: offset.value };
}
return align.value;
}
var end = start;
if (keyword && backgroundPositionKeywords.has(keyword.value)) {
end = keyword.end;
var firstDirection = backgroundPositionKeywordsDirection[keyword.value];
var firstLength = firstDirection !== "center" && parsePercentageOrLength(text, end);
if (firstLength) {
end = firstLength.end;
}
var secondKeyword = parseKeyword(text, end);
if (secondKeyword && backgroundPositionKeywords.has(secondKeyword.value)) {
end = secondKeyword.end;
var secondDirection = backgroundPositionKeywordsDirection[secondKeyword.end];
if (firstDirection === secondDirection && firstDirection !== "center") {
return null;
}
var secondLength = secondDirection !== "center" && parsePercentageOrLength(text, end);
if (secondLength) {
end = secondLength.end;
}
if ((firstDirection === secondDirection && secondDirection === "center") || (firstDirection === "x" || secondDirection === "y")) {
return { start: start, end: end, value: {
x: formatH(keyword, firstLength),
y: formatV(secondKeyword, secondLength)
} };
}
else {
return { start: start, end: end, value: {
x: formatH(secondKeyword, secondLength),
y: formatV(keyword, firstLength),
} };
}
}
else {
if (firstDirection === "center") {
return { start: start, end: end, value: { x: "center", y: "center" } };
}
else if (firstDirection === "x") {
return { start: start, end: end, value: { x: formatH(keyword, firstLength), y: "center" } };
}
else {
return { start: start, end: end, value: { x: "center", y: formatV(keyword, firstLength) } };
}
}
}
else {
var firstLength = parsePercentageOrLength(text, end);
if (firstLength) {
end = firstLength.end;
var secondLength = parsePercentageOrLength(text, end);
if (secondLength) {
end = secondLength.end;
return { start: start, end: end, value: { x: { align: "left", offset: firstLength.value }, y: { align: "top", offset: secondLength.value } } };
}
else {
return { start: start, end: end, value: { x: { align: "left", offset: firstLength.value }, y: "center" } };
}
}
else {
return null;
}
}
}
exports.parseBackgroundPosition = parseBackgroundPosition;
var directionRegEx = /\s*to\s*(left|right|top|bottom)\s*(left|right|top|bottom)?\s*/gy;
var sideDirections = {
top: Math.PI * 0 / 2,
right: Math.PI * 1 / 2,
bottom: Math.PI * 2 / 2,
left: Math.PI * 3 / 2
};
var cornerDirections = {
top: {
right: Math.PI * 1 / 4,
left: Math.PI * 7 / 4
},
right: {
top: Math.PI * 1 / 4,
bottom: Math.PI * 3 / 4
},
bottom: {
right: Math.PI * 3 / 4,
left: Math.PI * 5 / 4
},
left: {
top: Math.PI * 7 / 4,
bottom: Math.PI * 5 / 4
}
};
function parseDirection(text, start) {
if (start === void 0) { start = 0; }
directionRegEx.lastIndex = start;
var result = directionRegEx.exec(text);
if (!result) {
return null;
}
var end = directionRegEx.lastIndex;
var firstDirection = result[1];
if (result[2]) {
var secondDirection = result[2];
var value = cornerDirections[firstDirection][secondDirection];
return value === undefined ? null : { start: start, end: end, value: value };
}
else {
return { start: start, end: end, value: sideDirections[firstDirection] };
}
}
var openingBracketRegEx = /\s*\(\s*/gy;
var closingBracketRegEx = /\s*\)\s*/gy;
var closingBracketOrCommaRegEx = /\s*(\)|,)\s*/gy;
function parseArgumentsList(text, start, argument) {
openingBracketRegEx.lastIndex = start;
var openingBracket = openingBracketRegEx.exec(text);
if (!openingBracket) {
return null;
}
var end = openingBracketRegEx.lastIndex;
var value = [];
closingBracketRegEx.lastIndex = end;
var closingBracket = closingBracketRegEx.exec(text);
if (closingBracket) {
return { start: start, end: end, value: value };
}
for (var index = 0; true; index++) {
var arg = argument(text, end, index);
if (!arg) {
return null;
}
end = arg.end;
value.push(arg);
closingBracketOrCommaRegEx.lastIndex = end;
var closingBracketOrComma = closingBracketOrCommaRegEx.exec(text);
if (closingBracketOrComma) {
end = closingBracketOrCommaRegEx.lastIndex;
if (closingBracketOrComma[1] === ",") {
continue;
}
else if (closingBracketOrComma[1] === ")") {
return { start: start, end: end, value: value };
}
}
else {
return null;
}
}
}
function parseColorStop(text, start) {
if (start === void 0) { start = 0; }
var color = parseColor(text, start);
if (!color) {
return null;
}
var end = color.end;
var offset = parsePercentageOrLength(text, end);
if (offset) {
end = offset.end;
return { start: start, end: end, value: { argb: color.value, offset: offset.value } };
}
return { start: start, end: end, value: { argb: color.value } };
}
exports.parseColorStop = parseColorStop;
var linearGradientStartRegEx = /\s*linear-gradient\s*/gy;
function parseLinearGradient(text, start) {
if (start === void 0) { start = 0; }
linearGradientStartRegEx.lastIndex = start;
var lgs = linearGradientStartRegEx.exec(text);
if (!lgs) {
return null;
}
var end = linearGradientStartRegEx.lastIndex;
var angle = Math.PI;
var colors = [];
var parsedArgs = parseArgumentsList(text, end, function (text, start, index) {
if (index === 0) {
var angleArg = parseAngle(text, start) || parseDirection(text, start);
if (angleArg) {
angle = angleArg.value;
return angleArg;
}
}
var colorStop = parseColorStop(text, start);
if (colorStop) {
colors.push(colorStop.value);
return colorStop;
}
return null;
});
if (!parsedArgs) {
return null;
}
end = parsedArgs.end;
return { start: start, end: end, value: { angle: angle, colors: colors } };
}
exports.parseLinearGradient = parseLinearGradient;
var slashRegEx = /\s*(\/)\s*/gy;
function parseSlash(text, start) {
slashRegEx.lastIndex = start;
var slash = slashRegEx.exec(text);
if (!slash) {
return null;
}
var end = slashRegEx.lastIndex;
return { start: start, end: end, value: "/" };
}
function parseBackground(text, start) {
if (start === void 0) { start = 0; }
var value = {};
var end = start;
while (end < text.length) {
var keyword = parseKeyword(text, end);
var color = parseColor(text, end, keyword);
if (color) {
value.color = color.value;
end = color.end;
continue;
}
var repeat = parseRepeat(text, end, keyword);
if (repeat) {
value.repeat = repeat.value;
end = repeat.end;
continue;
}
var position = parseBackgroundPosition(text, end, keyword);
if (position) {
position.value.text = text.substring(position.start, position.end);
value.position = position.value;
end = position.end;
var slash = parseSlash(text, end);
if (slash) {
end = slash.end;
var size = parseBackgroundSize(text, end);
if (!size) {
return null;
}
value.size = size.value;
end = size.end;
}
continue;
}
var url = parseURL(text, end);
if (url) {
value.image = url.value;
end = url.end;
continue;
}
var gradient = parseLinearGradient(text, end);
if (gradient) {
value.image = gradient.value;
end = gradient.end;
continue;
}
return null;
}
return { start: start, end: end, value: value };
}
exports.parseBackground = parseBackground;
var universalSelectorRegEx = /\*/gy;
function parseUniversalSelector(text, start) {
if (start === void 0) { start = 0; }
universalSelectorRegEx.lastIndex = start;
var result = universalSelectorRegEx.exec(text);
if (!result) {
return null;
}
var end = universalSelectorRegEx.lastIndex;
return { start: start, end: end, value: { type: "*" } };
}
exports.parseUniversalSelector = parseUniversalSelector;
var simpleIdentifierSelectorRegEx = /(#|\.|:|\b)([_-\w][_-\w\d]*)/gy;
function parseSimpleIdentifierSelector(text, start) {
if (start === void 0) { start = 0; }
simpleIdentifierSelectorRegEx.lastIndex = start;
var result = simpleIdentifierSelectorRegEx.exec(text);
if (!result) {
return null;
}
var end = simpleIdentifierSelectorRegEx.lastIndex;
var type = result[1];
var identifier = result[2];
var value = { type: type, identifier: identifier };
return { start: start, end: end, value: value };
}
exports.parseSimpleIdentifierSelector = parseSimpleIdentifierSelector;
var attributeSelectorRegEx = /\[\s*([_-\w][_-\w\d]*)\s*(?:(=|\^=|\$=|\*=|\~=|\|=)\s*(?:([_-\w][_-\w\d]*)|"((?:[^\\"]|\\(?:"|n|r|f|\\|0-9a-f))*)"|'((?:[^\\']|\\(?:'|n|r|f|\\|0-9a-f))*)')\s*)?\]/gy;
function parseAttributeSelector(text, start) {
attributeSelectorRegEx.lastIndex = start;
var result = attributeSelectorRegEx.exec(text);
if (!result) {
return null;
}
var end = attributeSelectorRegEx.lastIndex;
var property = result[1];
if (result[2]) {
var test_1 = result[2];
var value = result[3] || result[4] || result[5];
return { start: start, end: end, value: { type: "[]", property: property, test: test_1, value: value } };
}
return { start: start, end: end, value: { type: "[]", property: property } };
}
exports.parseAttributeSelector = parseAttributeSelector;
function parseSimpleSelector(text, start) {
if (start === void 0) { start = 0; }
return parseUniversalSelector(text, start) ||
parseSimpleIdentifierSelector(text, start) ||
parseAttributeSelector(text, start);
}
exports.parseSimpleSelector = parseSimpleSelector;
function parseSimpleSelectorSequence(text, start) {
var simpleSelector = parseSimpleSelector(text, start);
if (!simpleSelector) {
return null;
}
var end = simpleSelector.end;
var value = [];
while (simpleSelector) {
value.push(simpleSelector.value);
end = simpleSelector.end;
simpleSelector = parseSimpleSelector(text, end);
}
return { start: start, end: end, value: value };
}
exports.parseSimpleSelectorSequence = parseSimpleSelectorSequence;
var combinatorRegEx = /\s*(\+|~|>)?\s*/gy;
function parseCombinator(text, start) {
if (start === void 0) { start = 0; }
combinatorRegEx.lastIndex = start;
var result = combinatorRegEx.exec(text);
if (!result) {
return null;
}
var end = combinatorRegEx.lastIndex;
var value = result[1] || " ";
return { start: start, end: end, value: value };
}
exports.parseCombinator = parseCombinator;
var whiteSpaceRegEx = /\s*/gy;
function parseSelector(text, start) {
if (start === void 0) { start = 0; }
var end = start;
whiteSpaceRegEx.lastIndex = end;
var leadingWhiteSpace = whiteSpaceRegEx.exec(text);
if (leadingWhiteSpace) {
end = whiteSpaceRegEx.lastIndex;
}
var value = [];
var combinator;
var expectSimpleSelector = true;
var pair;
do {
var simpleSelectorSequence = parseSimpleSelectorSequence(text, end);
if (!simpleSelectorSequence) {
if (expectSimpleSelector) {
return null;
}
else {
break;
}
}
end = simpleSelectorSequence.end;
if (combinator) {
pair[1] = combinator.value;
}
pair = [simpleSelectorSequence.value, undefined];
value.push(pair);
combinator = parseCombinator(text, end);
if (combinator) {
end = combinator.end;
}
expectSimpleSelector = combinator && combinator.value !== " ";
} while (combinator);
return { start: start, end: end, value: value };
}
exports.parseSelector = parseSelector;
var whitespaceRegEx = /[\s\t\n\r\f]*/gym;
var singleQuoteStringRegEx = /'((?:[^\n\r\f\']|\\(?:\$|\n|[0-9a-fA-F]{1,6}\s?))*)(:?'|$)/gym;
var doubleQuoteStringRegEx = /"((?:[^\n\r\f\"]|\\(?:\$|\n|[0-9a-fA-F]{1,6}\s?))*)(:?"|$)/gym;
var commentRegEx = /(\/\*(?:[^\*]|\*[^\/])*\*\/)/gym;
var numberRegEx = /[\+\-]?(?:\d+\.\d+|\d+|\.\d+)(?:[eE][\+\-]?\d+)?/gym;
var nameRegEx = /-?(?:(?:[a-zA-Z_]|[^\x00-\x7F]|\\(?:\$|\n|[0-9a-fA-F]{1,6}\s?))(?:[a-zA-Z_0-9\-]*|\\(?:\$|\n|[0-9a-fA-F]{1,6}\s?))*)/gym;
var CSS3Parser = (function () {
function CSS3Parser(text) {
this.text = text;
this.nextInputCodePointIndex = 0;
}
CSS3Parser.prototype.tokenize = function () {
var tokens = [];
var inputToken;
do {
inputToken = this.consumeAToken();
tokens.push(inputToken);
} while (inputToken);
return tokens;
};
CSS3Parser.prototype.consumeAToken = function () {
if (this.reconsumedInputToken) {
var result = this.reconsumedInputToken;
this.reconsumedInputToken = null;
return result;
}
var char = this.text[this.nextInputCodePointIndex];
switch (char) {
case "\"": return this.consumeAStringToken();
case "'": return this.consumeAStringToken();
case "(":
case ")":
case ",":
case ":":
case ";":
case "[":
case "]":
case "{":
case "}":
this.nextInputCodePointIndex++;
return char;
case "#": return this.consumeAHashToken() || this.consumeADelimToken();
case " ":
case "\t":
case "\n":
case "\r":
case "\f":
return this.consumeAWhitespace();
case "@": return this.consumeAtKeyword() || this.consumeADelimToken();
case "\\": return this.consumeAnIdentLikeToken() || this.consumeADelimToken();
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
return this.consumeANumericToken();
case "u":
case "U":
if (this.text[this.nextInputCodePointIndex + 1] === "+") {
var thirdChar = this.text[this.nextInputCodePointIndex + 2];
if (thirdChar >= "0" && thirdChar <= "9" || thirdChar === "?") {
throw new Error("Unicode tokens not supported!");
}
}
return this.consumeAnIdentLikeToken() || this.consumeADelimToken();
case "$":
case "*":
case "^":
case "|":
case "~":
return this.consumeAMatchToken() || this.consumeADelimToken();
case "-": return this.consumeANumericToken() || this.consumeAnIdentLikeToken() || this.consumeCDC() || this.consumeADelimToken();
case "+":
case ".":
return this.consumeANumericToken() || this.consumeADelimToken();
case "/": return this.consumeAComment() || this.consumeADelimToken();
case "<": return this.consumeCDO() || this.consumeADelimToken();
case undefined: return undefined;
default: return this.consumeAnIdentLikeToken() || this.consumeADelimToken();
}
};
CSS3Parser.prototype.consumeADelimToken = function () {
return { type: 2, text: this.text[this.nextInputCodePointIndex++] };
};
CSS3Parser.prototype.consumeAWhitespace = function () {
whitespaceRegEx.lastIndex = this.nextInputCodePointIndex;
whitespaceRegEx.exec(this.text);
this.nextInputCodePointIndex = whitespaceRegEx.lastIndex;
return " ";
};
CSS3Parser.prototype.consumeAHashToken = function () {
this.nextInputCodePointIndex++;
var hashName = this.consumeAName();
if (hashName) {
return { type: 12, text: "#" + hashName.text };
}
this.nextInputCodePointIndex--;
return null;
};
CSS3Parser.prototype.consumeCDO = function () {
if (this.text.substr(this.nextInputCodePointIndex, 4) === "<!--") {
this.nextInputCodePointIndex += 4;
return "<!--";
}
return null;
};
CSS3Parser.prototype.consumeCDC = function () {
if (this.text.substr(this.nextInputCodePointIndex, 3) === "-->") {
this.nextInputCodePointIndex += 3;
return "-->";
}
return null;
};
CSS3Parser.prototype.consumeAMatchToken = function () {
if (this.text[this.nextInputCodePointIndex + 1] === "=") {
var token = this.text.substr(this.nextInputCodePointIndex, 2);
this.nextInputCodePointIndex += 2;
return token;
}
return null;
};
CSS3Parser.prototype.consumeANumericToken = function () {
numberRegEx.lastIndex = this.nextInputCodePointIndex;
var result = numberRegEx.exec(this.text);
if (!result) {
return null;
}
this.nextInputCodePointIndex = numberRegEx.lastIndex;
if (this.text[this.nextInputCodePointIndex] === "%") {
return { type: 4, text: result[0] };
}
var name = this.consumeAName();
if (name) {
return { type: 5, text: result[0] + name.text };
}
return { type: 3, text: result[0] };
};
CSS3Parser.prototype.consumeAnIdentLikeToken = function () {
var name = this.consumeAName();
if (!name) {
return null;
}
if (this.text[this.nextInputCodePointIndex] === "(") {
this.nextInputCodePointIndex++;
if (name.text.toLowerCase() === "url") {
return this.consumeAURLToken();
}
return { type: 8, name: name.text, text: name.text + "(" };
}
return name;
};
CSS3Parser.prototype.consumeAStringToken = function () {
var char = this.text[this.nextInputCodePointIndex];
var result;
if (char === "'") {
singleQuoteStringRegEx.lastIndex = this.nextInputCodePointIndex;
result = singleQuoteStringRegEx.exec(this.text);
if (!result) {
return null;
}
this.nextInputCodePointIndex = singleQuoteStringRegEx.lastIndex;
}
else if (char === "\"") {
doubleQuoteStringRegEx.lastIndex = this.nextInputCodePointIndex;
result = doubleQuoteStringRegEx.exec(this.text);
if (!result) {
return null;
}
this.nextInputCodePointIndex = doubleQuoteStringRegEx.lastIndex;
}
return { type: 1, text: result[0] };
};
CSS3Parser.prototype.consumeAURLToken = function () {
var start = this.nextInputCodePointIndex - 3 - 1;
var urlToken = { type: 7, text: undefined };
this.consumeAWhitespace();
if (this.nextInputCodePointIndex >= this.text.length) {
return urlToken;
}
var nextInputCodePoint = this.text[this.nextInputCodePointIndex];
if (nextInputCodePoint === "\"" || nextInputCodePoint === "'") {
var stringToken = this.consumeAStringToken();
urlToken.text = stringToken.text;
this.consumeAWhitespace();
if (this.text[this.nextInputCodePointIndex] === ")" || this.nextInputCodePointIndex >= this.text.length) {
this.nextInputCodePointIndex++;
var end = this.nextInputCodePointIndex;
urlToken.text = this.text.substring(start, end);
return urlToken;
}
else {
return null;
}
}
while (this.nextInputCodePointIndex < this.text.length) {
var char = this.text[this.nextInputCodePointIndex++];
switch (char) {
case ")": return urlToken;
case " ":
case "\t":
case "\n":
case "\r":
case "\f":
this.consumeAWhitespace();
if (this.text[this.nextInputCodePointIndex] === ")") {
this.nextInputCodePointIndex++;
return urlToken;
}
else {
return null;
}
case "\"":
case "\'":
return null;
case "\\":
throw new Error("Escaping not yet supported!");
default:
urlToken.text += char;
}
}
return urlToken;
};
CSS3Parser.prototype.consumeAName = function () {
nameRegEx.lastIndex = this.nextInputCodePointIndex;
var result = nameRegEx.exec(this.text);
if (!result) {
return null;
}
this.nextInputCodePointIndex = nameRegEx.lastIndex;
return { type: 6, text: result[0] };
};
CSS3Parser.prototype.consumeAtKeyword = function () {
this.nextInputCodePointIndex++;
var name = this.consumeAName();
if (name) {
return { type: 11, text: name.text };
}
this.nextInputCodePointIndex--;
return null;
};
CSS3Parser.prototype.consumeAComment = function () {
if (this.text[this.nextInputCodePointIndex + 1] === "*") {
commentRegEx.lastIndex = this.nextInputCodePointIndex;
var result = commentRegEx.exec(this.text);
if (!result) {
return null;
}
this.nextInputCodePointIndex = commentRegEx.lastIndex;
return this.consumeAToken();
}
return null;
};
CSS3Parser.prototype.reconsumeTheCurrentInputToken = function (currentInputToken) {
this.reconsumedInputToken = currentInputToken;
};
CSS3Parser.prototype.parseAStylesheet = function () {
this.topLevelFlag = true;
var stylesheet = {
rules: this.consumeAListOfRules()
};
return stylesheet;
};
CSS3Parser.prototype.consumeAListOfRules = function () {
var rules = [];
var inputToken;
while (inputToken = this.consumeAToken()) {
switch (inputToken) {
case " ": continue;
case "<!--":
case "-->":
if (this.topLevelFlag) {
continue;
}
this.reconsumeTheCurrentInputToken(inputToken);
var atRule = this.consumeAnAtRule();
if (atRule) {
rules.push(atRule);
}
continue;
}
if (inputToken.type === 11) {
this.reconsumeTheCurrentInputToken(inputToken);
var atRule = this.consumeAnAtRule();
if (atRule) {
rules.push(atRule);
}
continue;
}
this.reconsumeTheCurrentInputToken(inputToken);
var qualifiedRule = this.consumeAQualifiedRule();
if (qualifiedRule) {
rules.push(qualifiedRule);
}
}
return rules;
};
CSS3Parser.prototype.consumeAnAtRule = function () {
var inputToken = this.consumeAToken();
var atRule = {
type: "at-rule",
name: inputToken.text,
prelude: [],
block: undefined
};
while (inputToken = this.consumeAToken()) {
if (inputToken === ";") {
return atRule;
}
else if (inputToken === "{") {
atRule.block = this.consumeASimpleBlock(inputToken);
return atRule;
}
else if (inputToken.type === 9 && inputToken.associatedToken === "{") {
atRule.block = inputToken;
return atRule;
}
this.reconsumeTheCurrentInputToken(inputToken);
var component = this.consumeAComponentValue();
if (component) {
atRule.prelude.push(component);
}
}
return atRule;
};
CSS3Parser.prototype.consumeAQualifiedRule = function () {
var qualifiedRule = {
type: "qualified-rule",
prelude: [],
block: undefined
};
var inputToken;
while (inputToken = this.consumeAToken()) {
if (inputToken === "{") {
var block = this.consumeASimpleBlock(inputToken);
qualifiedRule.block = block;
return qualifiedRule;
}
else if (inputToken.type === 9) {
var simpleBlock = inputToken;
if (simpleBlock.associatedToken === "{") {
qualifiedRule.block = simpleBlock;
return qualifiedRule;
}
}
this.reconsumeTheCurrentInputToken(inputToken);
var componentValue = this.consumeAComponentValue();
if (componentValue) {
qualifiedRule.prelude.push(componentValue);
}
}
return null;
};
CSS3Parser.prototype.consumeAComponentValue = function () {
var inputToken = this.consumeAToken();
switch (inputToken) {
case "{":
case "[":
case "(":
this.nextInputCodePointIndex++;
return this.consumeASimpleBlock(inputToken);
}
if (typeof inputToken === "object" && inputToken.type === 8) {
return this.consumeAFunction(inputToken.name);
}
return inputToken;
};
CSS3Parser.prototype.consumeASimpleBlock = function (associatedToken) {
var endianToken = {
"[": "]",
"{": "}",
"(": ")"
}[associatedToken];
var start = this.nextInputCodePointIndex - 1;
var block = {
type: 9,
text: undefined,
associatedToken: associatedToken,
values: []
};
var nextInputToken;
while (nextInputToken = this.text[this.nextInputCodePointIndex]) {
if (nextInputToken === endianToken) {
this.nextInputCodePointIndex++;
var end = this.nextInputCodePointIndex;
block.text = this.text.substring(start, end);
return block;
}
var value = this.consumeAComponentValue();
if (value) {
block.values.push(value);
}
}
block.text = this.text.substring(start);
return block;
};
CSS3Parser.prototype.consumeAFunction = function (name) {
var start = this.nextInputCodePointIndex;
var funcToken = { type: 14, name: name, text: undefined, components: [] };
do {
if (this.nextInputCodePointIndex >= this.text.length) {
funcToken.text = name + "(" + this.text.substring(start);
return funcToken;
}
var nextInputToken = this.text[this.nextInputCodePointIndex];
switch (nextInputToken) {
case ")":
this.nextInputCodePointIndex++;
var end = this.nextInputCodePointIndex;
funcToken.text = name + "(" + this.text.substring(start, end);
return funcToken;
default:
var component = this.consumeAComponentValue();
if (component) {
funcToken.components.push(component);
}
}
} while (true);
};
return CSS3Parser;
}());
exports.CSS3Parser = CSS3Parser;
var CSSNativeScript = (function () {
function CSSNativeScript() {
}
CSSNativeScript.prototype.parseStylesheet = function (stylesheet) {
return {
type: "stylesheet",
stylesheet: {
rules: this.parseRules(stylesheet.rules)
}
};
};
CSSNativeScript.prototype.parseRules = function (rules) {
var _this = this;
return rules.map(function (rule) { return _this.parseRule(rule); });
};
CSSNativeScript.prototype.parseRule = function (rule) {
if (rule.type === "at-rule") {
return this.parseAtRule(rule);
}
else if (rule.type === "qualified-rule") {
return this.parseQualifiedRule(rule);
}
};
CSSNativeScript.prototype.parseAtRule = function (rule) {
if (rule.name === "import") {
return {
import: rule.prelude.map(function (m) { return typeof m === "string" ? m : m.text; }).join("").trim(),
type: "import"
};
}
return;
};
CSSNativeScript.prototype.parseQualifiedRule = function (rule) {
return {
type: "rule",
selectors: this.preludeToSelectorsStringArray(rule.prelude),
declarations: this.ruleBlockToDeclarations(rule.block.values)
};
};
CSSNativeScript.prototype.ruleBlockToDeclarations = function (declarationsInputTokens) {
var declarations = [];
var property = "";
var value = "";
var reading = "property";
for (var i = 0; i < declarationsInputTokens.length; i++) {
var inputToken = declarationsInputTokens[i];
if (reading === "property") {
if (inputToken === ":") {
reading = "value";
}
else if (typeof inputToken === "string") {
property += inputToken;
}
else {
property += inputToken.text;
}
}
else {
if (inputToken === ";") {
property = property.trim();
value = value.trim();
declarations.push({ type: "declaration", property: property, value: value });
property = "";
value = "";
reading = "property";
}
else if (typeof inputToken === "string") {
value += inputToken;
}
else {
value += inputToken.text;
}
}
}
property = property.trim();
value = value.trim();
if (property || value) {
declarations.push({ type: "declaration", property: property, value: value });
}
return declarations;
};
CSSNativeScript.prototype.preludeToSelectorsStringArray = function (prelude) {
var selectors = [];
var selector = "";
prelude.forEach(function (inputToken) {
if (typeof inputToken === "string") {
if (inputToken === ",") {
if (selector) {
selectors.push(selector.trim());
}
selector = "";
}
else {
selector += inputToken;
}
}
else if (typeof inputToken === "object") {
selector += inputToken.text;
}
});
if (selector) {
selectors.push(selector.trim());
}
return selectors;
};
return CSSNativeScript;
}());
exports.CSSNativeScript = CSSNativeScript;
//# sourceMappingURL=parser.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/data/observable-array/observable-array.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var observable = __webpack_require__("../node_modules/tns-core-modules/data/observable/observable.js");
var types = __webpack_require__("../node_modules/tns-core-modules/utils/types.js");
var ChangeType = (function () {
function ChangeType() {
}
ChangeType.Add = "add";
ChangeType.Delete = "delete";
ChangeType.Update = "update";
ChangeType.Splice = "splice";
return ChangeType;
}());
exports.ChangeType = ChangeType;
var CHANGE = "change";
var ObservableArray = (function (_super) {
__extends(ObservableArray, _super);
function ObservableArray() {
var _this = _super.call(this) || this;
if (arguments.length === 1 && Array.isArray(arguments[0])) {
_this._array = arguments[0].slice();
}
else {
_this._array = Array.apply(null, arguments);
}
_this._addArgs = {
eventName: CHANGE, object: _this,
action: ChangeType.Add,
index: null,
removed: new Array(),
addedCount: 1
};
_this._deleteArgs = {
eventName: CHANGE, object: _this,
action: ChangeType.Delete,
index: null,
removed: null,
addedCount: 0
};
return _this;
}
ObservableArray.prototype.getItem = function (index) {
return this._array[index];
};
ObservableArray.prototype.setItem = function (index, value) {
var oldValue = this._array[index];
this._array[index] = value;
this.notify({
eventName: CHANGE, object: this,
action: ChangeType.Update,
index: index,
removed: [oldValue],
addedCount: 1
});
};
Object.defineProperty(ObservableArray.prototype, "length", {
get: function () {
return this._array.length;
},
set: function (value) {
if (types.isNumber(value) && this._array && this._array.length !== value) {
this.splice(value, this._array.length - value);
}
},
enumerable: true,
configurable: true
});
ObservableArray.prototype.toString = function () {
return this._array.toString();
};
ObservableArray.prototype.toLocaleString = function () {
return this._array.toLocaleString();
};
ObservableArray.prototype.concat = function () {
this._addArgs.index = this._array.length;
var result = this._array.concat.apply(this._array, arguments);
return result;
};
ObservableArray.prototype.join = function (separator) {
return this._array.join(separator);
};
ObservableArray.prototype.pop = function () {
this._deleteArgs.index = this._array.length - 1;
var result = this._array.pop();
this._deleteArgs.removed = [result];
this.notify(this._deleteArgs);
this._notifyLengthChange();
return result;
};
ObservableArray.prototype.push = function () {
this._addArgs.index = this._array.length;
if (arguments.length === 1 && Array.isArray(arguments[0])) {
var source = arguments[0];
for (var i = 0, l = source.length; i < l; i++) {
this._array.push(source[i]);
}
}
else {
this._array.push.apply(this._array, arguments);
}
this._addArgs.addedCount = this._array.length - this._addArgs.index;
this.notify(this._addArgs);
this._notifyLengthChange();
return this._array.length;
};
ObservableArray.prototype._notifyLengthChange = function () {
var lengthChangedData = this._createPropertyChangeData("length", this._array.length);
this.notify(lengthChangedData);
};
ObservableArray.prototype.reverse = function () {
return this._array.reverse();
};
ObservableArray.prototype.shift = function () {
var result = this._array.shift();
this._deleteArgs.index = 0;
this._deleteArgs.removed = [result];
this.notify(this._deleteArgs);
this._notifyLengthChange();
return result;
};
ObservableArray.prototype.slice = function (start, end) {
return this._array.slice(start, end);
};
ObservableArray.prototype.sort = function (compareFn) {
return this._array.sort(compareFn);
};
ObservableArray.prototype.splice = function (start, deleteCount) {
var length = this._array.length;
var result = this._array.splice.apply(this._array, arguments);
this.notify({
eventName: CHANGE, object: this,
action: ChangeType.Splice,
index: start,
removed: result,
addedCount: this._array.length > length ? this._array.length - length : 0
});
if (this._array.length !== length) {
this._notifyLengthChange();
}
return result;
};
ObservableArray.prototype.unshift = function () {
var length = this._array.length;
var result = this._array.unshift.apply(this._array, arguments);
this._addArgs.index = 0;
this._addArgs.addedCount = result - length;
this.notify(this._addArgs);
this._notifyLengthChange();
return result;
};
ObservableArray.prototype.indexOf = function (searchElement, fromIndex) {
var index = fromIndex ? fromIndex : 0;
for (var i = index, l = this._array.length; i < l; i++) {
if (this._array[i] === searchElement) {
return i;
}
}
return -1;
};
ObservableArray.prototype.lastIndexOf = function (searchElement, fromIndex) {
var index = fromIndex ? fromIndex : this._array.length - 1;
for (var i = index; i >= 0; i--) {
if (this._array[i] === searchElement) {
return i;
}
}
return -1;
};
ObservableArray.prototype.every = function (callbackfn, thisArg) {
return this._array.every(callbackfn, thisArg);
};
ObservableArray.prototype.some = function (callbackfn, thisArg) {
return this._array.some(callbackfn, thisArg);
};
ObservableArray.prototype.forEach = function (callbackfn, thisArg) {
this._array.forEach(callbackfn, thisArg);
};
ObservableArray.prototype.map = function (callbackfn, thisArg) {
return this._array.map(callbackfn, thisArg);
};
ObservableArray.prototype.filter = function (callbackfn, thisArg) {
return this._array.filter(callbackfn, thisArg);
};
ObservableArray.prototype.reduce = function (callbackfn, initialValue) {
return initialValue !== undefined ? this._array.reduce(callbackfn, initialValue) : this._array.reduce(callbackfn);
};
ObservableArray.prototype.reduceRight = function (callbackfn, initialValue) {
return initialValue !== undefined ? this._array.reduceRight(callbackfn, initialValue) : this._array.reduceRight(callbackfn);
};
ObservableArray.changeEvent = CHANGE;
return ObservableArray;
}(observable.Observable));
exports.ObservableArray = ObservableArray;
//# sourceMappingURL=observable-array.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/data/observable/observable.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var _wrappedIndex = 0;
var WrappedValue = (function () {
function WrappedValue(wrapped) {
this.wrapped = wrapped;
}
WrappedValue.unwrap = function (value) {
return (value && value.wrapped) ? value.wrapped : value;
};
WrappedValue.wrap = function (value) {
var w = _wrappedValues[_wrappedIndex++ % 5];
w.wrapped = value;
return w;
};
return WrappedValue;
}());
exports.WrappedValue = WrappedValue;
var _wrappedValues = [
new WrappedValue(null),
new WrappedValue(null),
new WrappedValue(null),
new WrappedValue(null),
new WrappedValue(null)
];
var Observable = (function () {
function Observable() {
this._observers = {};
}
Observable.prototype.get = function (name) {
return this[name];
};
Observable.prototype.set = function (name, value) {
var oldValue = this[name];
if (this[name] === value) {
return;
}
var newValue = WrappedValue.unwrap(value);
this[name] = newValue;
this.notifyPropertyChange(name, newValue, oldValue);
};
Observable.prototype.on = function (eventNames, callback, thisArg) {
this.addEventListener(eventNames, callback, thisArg);
};
Observable.prototype.once = function (event, callback, thisArg) {
var list = this._getEventList(event, true);
list.push({ callback: callback, thisArg: thisArg, once: true });
};
Observable.prototype.off = function (eventNames, callback, thisArg) {
this.removeEventListener(eventNames, callback, thisArg);
};
Observable.prototype.addEventListener = function (eventNames, callback, thisArg) {
if (typeof eventNames !== "string") {
throw new TypeError("Events name(s) must be string.");
}
if (typeof callback !== "function") {
throw new TypeError("callback must be function.");
}
var events = eventNames.split(",");
for (var i = 0, l = events.length; i < l; i++) {
var event_1 = events[i].trim();
var list = this._getEventList(event_1, true);
list.push({
callback: callback,
thisArg: thisArg
});
}
};
Observable.prototype.removeEventListener = function (eventNames, callback, thisArg) {
if (typeof eventNames !== "string") {
throw new TypeError("Events name(s) must be string.");
}
if (callback && typeof callback !== "function") {
throw new TypeError("callback must be function.");
}
var events = eventNames.split(",");
for (var i = 0, l = events.length; i < l; i++) {
var event_2 = events[i].trim();
if (callback) {
var list = this._getEventList(event_2, false);
if (list) {
var index_1 = this._indexOfListener(list, callback, thisArg);
if (index_1 >= 0) {
list.splice(index_1, 1);
}
if (list.length === 0) {
delete this._observers[event_2];
}
}
}
else {
this._observers[event_2] = undefined;
delete this._observers[event_2];
}
}
};
Observable.prototype.notify = function (data) {
var observers = this._observers[data.eventName];
if (!observers) {
return;
}
for (var i = observers.length - 1; i >= 0; i--) {
var entry = observers[i];
if (entry.once) {
observers.splice(i, 1);
}
if (entry.thisArg) {
entry.callback.apply(entry.thisArg, [data]);
}
else {
entry.callback(data);
}
}
};
Observable.prototype.notifyPropertyChange = function (name, value, oldValue) {
this.notify(this._createPropertyChangeData(name, value, oldValue));
};
Observable.prototype.hasListeners = function (eventName) {
return eventName in this._observers;
};
Observable.prototype._createPropertyChangeData = function (propertyName, value, oldValue) {
return { eventName: Observable.propertyChangeEvent, object: this, propertyName: propertyName, value: value, oldValue: oldValue };
};
Observable.prototype._emit = function (eventNames) {
var events = eventNames.split(",");
for (var i = 0, l = events.length; i < l; i++) {
var event_3 = events[i].trim();
this.notify({ eventName: event_3, object: this });
}
};
Observable.prototype._getEventList = function (eventName, createIfNeeded) {
if (!eventName) {
throw new TypeError("EventName must be valid string.");
}
var list = this._observers[eventName];
if (!list && createIfNeeded) {
list = [];
this._observers[eventName] = list;
}
return list;
};
Observable.prototype._indexOfListener = function (list, callback, thisArg) {
for (var i = 0; i < list.length; i++) {
var entry = list[i];
if (thisArg) {
if (entry.callback === callback && entry.thisArg === thisArg) {
return i;
}
}
else {
if (entry.callback === callback) {
return i;
}
}
}
return -1;
};
Observable.propertyChangeEvent = "propertyChange";
return Observable;
}());
exports.Observable = Observable;
var ObservableFromObject = (function (_super) {
__extends(ObservableFromObject, _super);
function ObservableFromObject() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._map = {};
return _this;
}
ObservableFromObject.prototype.get = function (name) {
return this._map[name];
};
ObservableFromObject.prototype.set = function (name, value) {
var currentValue = this._map[name];
if (currentValue === value) {
return;
}
var newValue = WrappedValue.unwrap(value);
this._map[name] = newValue;
this.notifyPropertyChange(name, newValue, currentValue);
};
return ObservableFromObject;
}(Observable));
function defineNewProperty(target, propertyName) {
Object.defineProperty(target, propertyName, {
get: function () {
return target._map[propertyName];
},
set: function (value) {
target.set(propertyName, value);
},
enumerable: true,
configurable: true
});
}
function addPropertiesFromObject(observable, source, recursive) {
if (recursive === void 0) { recursive = false; }
Object.keys(source).forEach(function (prop) {
var value = source[prop];
if (recursive
&& !Array.isArray(value)
&& value
&& typeof value === "object"
&& !(value instanceof Observable)) {
value = fromObjectRecursive(value);
}
defineNewProperty(observable, prop);
observable.set(prop, value);
});
}
function fromObject(source) {
var observable = new ObservableFromObject();
addPropertiesFromObject(observable, source, false);
return observable;
}
exports.fromObject = fromObject;
function fromObjectRecursive(source) {
var observable = new ObservableFromObject();
addPropertiesFromObject(observable, source, true);
return observable;
}
exports.fromObjectRecursive = fromObjectRecursive;
//# sourceMappingURL=observable.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/debugger/debugger.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
var network;
function getNetwork() {
return network;
}
exports.getNetwork = getNetwork;
function setNetwork(newNetwork) {
network = newNetwork;
}
exports.setNetwork = setNetwork;
var dom;
function getDOM() {
return dom;
}
exports.getDOM = getDOM;
function setDOM(newDOM) {
dom = newDOM;
}
exports.setDOM = setDOM;
var css;
function getCSS() {
return css;
}
exports.getCSS = getCSS;
function setCSS(newCSS) {
css = newCSS;
}
exports.setCSS = setCSS;
var NetworkAgent;
(function (NetworkAgent) {
function responseReceived(requestId, result, headers) {
var requestIdStr = requestId.toString();
var mimeType = headers["Content-Type"] || headers["content-type"] || "application/octet-stream";
var contentLengthHeader = headers["Content-Length"] || headers["content-length"];
var contentLength = parseInt(contentLengthHeader, 10);
if (isNaN(contentLength)) {
contentLength = 0;
}
var response = {
url: result.url || "",
status: result.statusCode,
statusText: result.statusText || "",
headers: headers,
mimeType: mimeType,
fromDiskCache: false,
connectionReused: true,
connectionId: 0,
encodedDataLength: contentLength,
securityState: "info"
};
var responseData = {
requestId: requestIdStr,
type: mimeTypeToType(response.mimeType),
response: response,
timestamp: getTimeStamp()
};
global.__inspector.responseReceived(responseData);
global.__inspector.loadingFinished({
requestId: requestIdStr,
timestamp: getTimeStamp(),
encodedDataLength: contentLength
});
var hasTextContent = responseData.type === "Document" || responseData.type === "Script";
var data;
if (!hasTextContent) {
if (responseData.type === "Image") {
var bitmap = result.responseAsImage;
if (bitmap) {
var outputStream = new java.io.ByteArrayOutputStream();
bitmap.compress(android.graphics.Bitmap.CompressFormat.PNG, 100, outputStream);
var base64Image = android.util.Base64.encodeToString(outputStream.toByteArray(), android.util.Base64.DEFAULT);
data = base64Image;
}
}
}
else {
data = result.responseAsString;
}
var successfulRequestData = {
requestId: requestIdStr,
data: data,
hasTextContent: hasTextContent
};
global.__inspector.dataForRequestId(successfulRequestData);
}
NetworkAgent.responseReceived = responseReceived;
function requestWillBeSent(requestId, options) {
var request = {
url: options.url,
method: options.method,
headers: options.headers || {},
postData: options.content ? options.content.toString() : "",
initialPriority: "Medium",
referrerPolicy: "no-referrer-when-downgrade"
};
var requestData = {
requestId: requestId.toString(),
url: request.url,
request: request,
timestamp: getTimeStamp(),
type: "Document",
wallTime: 0
};
global.__inspector.requestWillBeSent(requestData);
}
NetworkAgent.requestWillBeSent = requestWillBeSent;
function getTimeStamp() {
var d = new Date();
return Math.round(d.getTime() / 1000);
}
function mimeTypeToType(mimeType) {
var type = "Document";
if (mimeType) {
if (mimeType.indexOf("image") === 0) {
type = "Image";
}
else if (mimeType.indexOf("javascript") !== -1 || mimeType.indexOf("json") !== -1) {
type = "Script";
}
}
return type;
}
})(NetworkAgent = exports.NetworkAgent || (exports.NetworkAgent = {}));
//# sourceMappingURL=debugger.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/debugger/devtools-elements.common.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var dom_node_1 = __webpack_require__("../node_modules/tns-core-modules/debugger/dom-node.js");
var frameTopmost = function () { return __webpack_require__("../node_modules/tns-core-modules/ui/frame/frame.js").topmost(); };
var unsetValue;
function unsetViewValue(view, name) {
if (!unsetValue) {
unsetValue = __webpack_require__("../node_modules/tns-core-modules/ui/core/properties/properties.js").unsetValue;
}
view[name] = unsetValue;
}
function getViewById(nodeId) {
var node = dom_node_1.getNodeById(nodeId);
var view;
if (node) {
view = node.viewRef.get();
}
return view;
}
function getDocument() {
var topMostFrame = frameTopmost();
if (!topMostFrame) {
return undefined;
}
try {
topMostFrame.ensureDomNode();
}
catch (e) {
console.log("ERROR in getDocument(): " + e);
}
return topMostFrame.domNode.toObject();
}
exports.getDocument = getDocument;
function getComputedStylesForNode(nodeId) {
var view = getViewById(nodeId);
if (view) {
return view.domNode.getComputedProperties();
}
return [];
}
exports.getComputedStylesForNode = getComputedStylesForNode;
function removeNode(nodeId) {
var view = getViewById(nodeId);
if (view) {
var parent_1 = view.parent;
if (parent_1.removeChild) {
parent_1.removeChild(view);
}
else if (parent_1.content === view) {
parent_1.content = null;
}
else {
console.log("Can't remove child from " + parent_1);
}
}
}
exports.removeNode = removeNode;
function setAttributeAsText(nodeId, text, name) {
var view = getViewById(nodeId);
if (view) {
var hasOriginalAttribute = !!name.trim();
if (text) {
var textParts = text.split("=");
if (textParts.length === 2) {
var attrName = textParts[0];
var attrValue = textParts[1].replace(/['"]+/g, "");
if (name !== attrName && hasOriginalAttribute) {
unsetViewValue(view, name);
view[attrName] = attrValue;
}
else {
view[hasOriginalAttribute ? name : attrName] = attrValue;
}
}
}
else {
unsetViewValue(view, name);
}
view.domNode.loadAttributes();
}
}
exports.setAttributeAsText = setAttributeAsText;
//# sourceMappingURL=devtools-elements.common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/debugger/devtools-elements.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var devtools_elements_common_1 = __webpack_require__("../node_modules/tns-core-modules/debugger/devtools-elements.common.js");
var dom_node_1 = __webpack_require__("../node_modules/tns-core-modules/debugger/dom-node.js");
function attachDOMInspectorEventCallbacks(DOMDomainFrontend) {
dom_node_1.registerInspectorEvents(DOMDomainFrontend);
var originalChildNodeInserted = DOMDomainFrontend.childNodeInserted;
DOMDomainFrontend.childNodeInserted = function (parentId, lastId, node) {
originalChildNodeInserted(parentId, lastId, JSON.stringify(node.toObject()));
};
}
exports.attachDOMInspectorEventCallbacks = attachDOMInspectorEventCallbacks;
function attachDOMInspectorCommandCallbacks(DOMDomainBackend) {
DOMDomainBackend.getDocument = function () {
return JSON.stringify(devtools_elements_common_1.getDocument());
};
DOMDomainBackend.getComputedStylesForNode = function (nodeId) {
return JSON.stringify(devtools_elements_common_1.getComputedStylesForNode(nodeId));
};
DOMDomainBackend.removeNode = devtools_elements_common_1.removeNode;
DOMDomainBackend.setAttributeAsText = devtools_elements_common_1.setAttributeAsText;
}
exports.attachDOMInspectorCommandCallbacks = attachDOMInspectorCommandCallbacks;
function attachCSSInspectorCommandCallbacks(CSSDomainFrontend) {
}
exports.attachCSSInspectorCommandCallbacks = attachCSSInspectorCommandCallbacks;
//# sourceMappingURL=devtools-elements.android.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/debugger/dom-node.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var registeredDomNodes = {};
var ELEMENT_NODE_TYPE = 1;
var ROOT_NODE_TYPE = 9;
var propertyBlacklist = [
"effectivePaddingLeft",
"effectivePaddingBottom",
"effectivePaddingRight",
"effectivePaddingTop",
"effectiveBorderTopWidth",
"effectiveBorderRightWidth",
"effectiveBorderBottomWidth",
"effectiveBorderLeftWidth",
"effectiveMinWidth",
"effectiveMinHeight",
"effectiveWidth",
"effectiveHeight",
"effectiveMarginLeft",
"effectiveMarginTop",
"effectiveMarginRight",
"effectiveMarginBottom",
"nodeName",
"nodeType",
"decodeWidth",
"decodeHeight",
"ng-reflect-items",
"domNode",
"touchListenerIsSet",
"bindingContext",
"nativeView"
];
function lazy(action) {
var _value;
return function () { return _value || (_value = action()); };
}
var percentLengthToStringLazy = lazy(function () { return __webpack_require__("../node_modules/tns-core-modules/ui/styling/style-properties.js").PercentLength.convertToString; });
var getSetPropertiesLazy = lazy(function () { return __webpack_require__("../node_modules/tns-core-modules/ui/core/properties/properties.js").getSetProperties; });
var getComputedCssValuesLazy = lazy(function () { return __webpack_require__("../node_modules/tns-core-modules/ui/core/properties/properties.js").getComputedCssValues; });
function registerInspectorEvents(inspector) {
inspectorFrontendInstance = inspector;
}
exports.registerInspectorEvents = registerInspectorEvents;
var inspectorFrontendInstance;
function notifyInspector(callback) {
if (inspectorFrontendInstance) {
callback(inspectorFrontendInstance);
}
}
function valueToString(value) {
if (typeof value === "undefined" || value === null) {
return "";
}
else if (typeof value === "object" && value.unit) {
return percentLengthToStringLazy()(value);
}
else {
return value + "";
}
}
function propertyFilter(_a) {
var name = _a[0], value = _a[1];
if (name[0] === "_") {
return false;
}
if (value !== null && typeof value === "object") {
return false;
}
if (propertyBlacklist.indexOf(name) >= 0) {
return false;
}
return true;
}
function registerNode(domNode) {
registeredDomNodes[domNode.nodeId] = domNode;
}
function unregisterNode(domNode) {
delete registeredDomNodes[domNode.nodeId];
}
function getNodeById(id) {
return registeredDomNodes[id];
}
exports.getNodeById = getNodeById;
var DOMNode = (function () {
function DOMNode(view) {
this.nodeValue = "";
this.attributes = [];
this.viewRef = new WeakRef(view);
this.nodeType = view.typeName === "Frame" ? ROOT_NODE_TYPE : ELEMENT_NODE_TYPE;
this.nodeId = view._domId;
this.nodeName = view.typeName;
this.localName = this.nodeName;
this.loadAttributes();
registerNode(this);
}
DOMNode.prototype.loadAttributes = function () {
var _this = this;
this.attributes = [];
getSetPropertiesLazy()(this.viewRef.get())
.filter(propertyFilter)
.forEach(function (pair) { return _this.attributes.push(pair[0], pair[1] + ""); });
};
Object.defineProperty(DOMNode.prototype, "children", {
get: function () {
var view = this.viewRef.get();
if (!view) {
return [];
}
var res = [];
view.eachChild(function (child) {
child.ensureDomNode();
res.push(child.domNode);
return true;
});
return res;
},
enumerable: true,
configurable: true
});
DOMNode.prototype.onChildAdded = function (childView) {
var _this = this;
notifyInspector(function (ins) {
var view = _this.viewRef.get();
var previousChild;
view.eachChild(function (child) {
if (child === childView) {
return false;
}
previousChild = child;
return true;
});
var index = !!previousChild ? previousChild._domId : 0;
childView.ensureDomNode();
ins.childNodeInserted(_this.nodeId, index, childView.domNode);
});
};
DOMNode.prototype.onChildRemoved = function (view) {
var _this = this;
notifyInspector(function (ins) {
ins.childNodeRemoved(_this.nodeId, view._domId);
});
};
DOMNode.prototype.attributeModified = function (name, value) {
var _this = this;
notifyInspector(function (ins) {
if (propertyBlacklist.indexOf(name) < 0) {
ins.attributeModified(_this.nodeId, name, valueToString(value));
}
});
};
DOMNode.prototype.attributeRemoved = function (name) {
var _this = this;
notifyInspector(function (ins) {
ins.attributeRemoved(_this.nodeId, name);
});
};
DOMNode.prototype.getComputedProperties = function () {
var view = this.viewRef.get();
if (!view) {
return [];
}
var result = getComputedCssValuesLazy()(view)
.filter(function (pair) { return pair[0][0] !== "_"; })
.map(function (pair) {
return {
name: pair[0],
value: valueToString(pair[1])
};
});
return result;
};
DOMNode.prototype.dispose = function () {
unregisterNode(this);
this.viewRef.clear();
};
DOMNode.prototype.toObject = function () {
return {
nodeId: this.nodeId,
nodeType: this.nodeType,
nodeName: this.nodeName,
localName: this.localName,
nodeValue: this.nodeValue,
children: this.children.map(function (c) { return c.toObject(); }),
attributes: this.attributes,
backendNodeId: 0
};
};
return DOMNode;
}());
exports.DOMNode = DOMNode;
//# sourceMappingURL=dom-node.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/fetch/fetch.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {(function () {
'use strict';
exports.XMLHttpRequest = global.XMLHttpRequest;
exports.FormData = global.FormData;
if (!exports.XMLHttpRequest) {
var xhr = __webpack_require__("../node_modules/tns-core-modules/xhr/xhr.js");
exports.XMLHttpRequest = xhr.XMLHttpRequest;
exports.FormData = xhr.FormData;
}
function normalizeName(name) {
if (typeof name !== 'string') {
name = name.toString();
}
if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
throw new TypeError('Invalid character in header field name')
}
return name.toLowerCase()
}
function normalizeValue(value) {
if (typeof value !== 'string') {
value = value.toString();
}
return value
}
function Headers(headers) {
this.map = {}
if (headers instanceof Headers) {
headers.forEach(function (value, name) {
this.append(name, value)
}, this)
} else if (headers) {
Object.getOwnPropertyNames(headers).forEach(function (name) {
this.append(name, headers[name])
}, this)
}
}
Headers.prototype.append = function (name, value) {
name = normalizeName(name)
value = normalizeValue(value)
var list = this.map[name]
if (!list) {
list = []
this.map[name] = list
}
list.push(value)
}
Headers.prototype['delete'] = function (name) {
delete this.map[normalizeName(name)]
}
Headers.prototype.get = function (name) {
var values = this.map[normalizeName(name)]
return values ? values[0] : null
}
Headers.prototype.getAll = function (name) {
return this.map[normalizeName(name)] || []
}
Headers.prototype.has = function (name) {
return this.map.hasOwnProperty(normalizeName(name))
}
Headers.prototype.set = function (name, value) {
this.map[normalizeName(name)] = [normalizeValue(value)]
}
Headers.prototype.forEach = function (callback, thisArg) {
Object.getOwnPropertyNames(this.map).forEach(function (name) {
this.map[name].forEach(function (value) {
callback.call(thisArg, value, name, this)
}, this)
}, this)
}
function consumed(body) {
if (body.bodyUsed) {
return Promise.reject(new TypeError('Already read'))
}
body.bodyUsed = true
}
function fileReaderReady(reader) {
return new Promise(function (resolve, reject) {
reader.onload = function () {
resolve(reader.result)
}
reader.onerror = function () {
reject(reader.error)
}
})
}
function readBlobAsArrayBuffer(blob) {
var reader = new FileReader()
reader.readAsArrayBuffer(blob)
return fileReaderReady(reader)
}
function readBlobAsText(blob) {
var reader = new FileReader()
reader.readAsText(blob)
return fileReaderReady(reader)
}
var support = {
blob: 'FileReader' in exports && 'Blob' in exports && (function () {
try {
new Blob();
return true
} catch (e) {
return false
}
})(),
formData: 'FormData' in exports
}
function Body() {
this.bodyUsed = false
this._initBody = function (body) {
this._bodyInit = body
if (typeof body === 'string') {
this._bodyText = body
} else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
this._bodyBlob = body
} else if (support.formData && exports.FormData.prototype.isPrototypeOf(body)) {
this._bodyFormData = body
} else if (!body) {
this._bodyText = ''
} else {
throw new Error('unsupported BodyInit type')
}
}
if (support.blob) {
this.blob = function () {
var rejected = consumed(this)
if (rejected) {
return rejected
}
if (this._bodyBlob) {
return Promise.resolve(this._bodyBlob)
} else if (this._bodyFormData) {
throw new Error('could not read FormData body as blob')
} else {
return Promise.resolve(new Blob([this._bodyText]))
}
}
this.arrayBuffer = function () {
return this.blob().then(readBlobAsArrayBuffer)
}
this.text = function () {
var rejected = consumed(this)
if (rejected) {
return rejected
}
if (this._bodyBlob) {
return readBlobAsText(this._bodyBlob)
} else if (this._bodyFormData) {
throw new Error('could not read FormData body as text')
} else {
return Promise.resolve(this._bodyText)
}
}
} else {
this.text = function () {
var rejected = consumed(this)
return rejected ? rejected : Promise.resolve(this._bodyText)
}
}
if (support.formData) {
this.formData = function () {
return this.text().then(decode)
}
}
this.json = function () {
return this.text().then(JSON.parse)
}
return this
}
// HTTP methods whose capitalization should be normalized
var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
function normalizeMethod(method) {
var upcased = method.toUpperCase()
return (methods.indexOf(upcased) > -1) ? upcased : method
}
function Request(url, options) {
options = options || {}
this.url = url
this.credentials = options.credentials || 'omit'
this.headers = new Headers(options.headers)
this.method = normalizeMethod(options.method || 'GET')
this.mode = options.mode || null
this.referrer = null
if ((this.method === 'GET' || this.method === 'HEAD') && options.body) {
throw new TypeError('Body not allowed for GET or HEAD requests')
}
this._initBody(options.body)
}
function decode(body) {
var form = new exports.FormData()
body.trim().split('&').forEach(function (bytes) {
if (bytes) {
var split = bytes.split('=')
var name = split.shift().replace(/\+/g, ' ')
var value = split.join('=').replace(/\+/g, ' ')
form.append(decodeURIComponent(name), decodeURIComponent(value))
}
})
return form
}
function headers(xhr) {
var head = new Headers()
var pairs = xhr.getAllResponseHeaders().trim().split('\n')
pairs.forEach(function (header) {
var split = header.trim().split(':')
var key = split.shift().trim()
var value = split.join(':').trim()
head.append(key, value)
})
return head
}
Body.call(Request.prototype)
function Response(bodyInit, options) {
if (!options) {
options = {}
}
this._initBody(bodyInit)
this.type = 'default'
this.url = null
this.status = options.status
this.ok = this.status >= 200 && this.status < 300
this.statusText = options.statusText
this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)
this.url = options.url || ''
}
Body.call(Response.prototype)
exports.Headers = Headers;
exports.Request = Request;
exports.Response = Response;
exports.fetch = function (input, init) {
// TODO: Request constructor should accept input, init
var request
if (Request.prototype.isPrototypeOf(input) && !init) {
request = input
} else {
request = new Request(input, init)
}
return new Promise(function (resolve, reject) {
var xhr = new exports.XMLHttpRequest()
function responseURL() {
if ('responseURL' in xhr) {
return xhr.responseURL
}
// Avoid security warnings on getResponseHeader when not allowed by CORS
if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
return xhr.getResponseHeader('X-Request-URL')
}
return;
}
xhr.onload = function () {
var status = (xhr.status === 1223) ? 204 : xhr.status
if (status < 100 || status > 599) {
reject(new TypeError('Network request failed'))
return
}
var options = {
status: status,
statusText: xhr.statusText,
headers: headers(xhr),
url: responseURL()
}
//var body = 'response' in xhr ? xhr.response : xhr.responseText;
resolve(new Response(xhr.responseText, options))
}
xhr.onerror = function (error) {
reject(new TypeError(['Network request failed:', error.message].join(' ')))
}
xhr.open(request.method, request.url, true)
if (request.credentials === 'include') {
xhr.withCredentials = true
}
if ('responseType' in xhr && support.blob) {
xhr.responseType = 'blob'
}
request.headers.forEach(function (value, name) {
xhr.setRequestHeader(name, value)
})
xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
})
}
exports.fetch.polyfill = true
})();
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/file-system/file-name-resolver/file-name-resolver.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var platform_1 = __webpack_require__("../node_modules/tns-core-modules/platform/platform.js");
var file_system_1 = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system.js");
var trace = __webpack_require__("../node_modules/tns-core-modules/trace/trace.js");
var appCommonModule = __webpack_require__("../node_modules/tns-core-modules/application/application-common.js");
var MIN_WH = "minWH";
var MIN_W = "minW";
var MIN_H = "minH";
var PRIORITY_STEP = 10000;
var minWidthHeightQualifier = {
isMatch: function (value) {
return value.indexOf(MIN_WH) === 0;
},
getMatchValue: function (value, context) {
var numVal = parseInt(value.substr(MIN_WH.length));
if (isNaN(numVal)) {
return -1;
}
var actualLength = Math.min(context.width, context.height);
if (actualLength < numVal) {
return -1;
}
return PRIORITY_STEP - (actualLength - numVal);
}
};
var minWidthQualifier = {
isMatch: function (value) {
return value.indexOf(MIN_W) === 0 && value.indexOf(MIN_WH) < 0;
},
getMatchValue: function (value, context) {
var numVal = parseInt(value.substr(MIN_W.length));
if (isNaN(numVal)) {
return -1;
}
var actualWidth = context.width;
if (actualWidth < numVal) {
return -1;
}
return PRIORITY_STEP - (actualWidth - numVal);
}
};
var minHeightQualifier = {
isMatch: function (value) {
return value.indexOf(MIN_H) === 0 && value.indexOf(MIN_WH) < 0;
},
getMatchValue: function (value, context) {
var numVal = parseInt(value.substr(MIN_H.length));
if (isNaN(numVal)) {
return -1;
}
var actualHeight = context.height;
if (actualHeight < numVal) {
return -1;
}
return PRIORITY_STEP - (actualHeight - numVal);
}
};
var platformQualifier = {
isMatch: function (value) {
return value === "android" ||
value === "ios";
},
getMatchValue: function (value, context) {
return value === context.os.toLowerCase() ? 1 : -1;
}
};
var orientationQualifier = {
isMatch: function (value) {
return value === "land" ||
value === "port";
},
getMatchValue: function (value, context) {
var isLandscape = (context.width > context.height) ? 1 : -1;
return (value === "land") ? isLandscape : -isLandscape;
}
};
var supportedQualifiers = [
minWidthHeightQualifier,
minWidthQualifier,
minHeightQualifier,
orientationQualifier,
platformQualifier
];
var FileNameResolver = (function () {
function FileNameResolver(context) {
this._cache = {};
this._context = context;
}
FileNameResolver.prototype.resolveFileName = function (path, ext) {
var key = path + ext;
var result = this._cache[key];
if (result === undefined) {
result = this.resolveFileNameImpl(path, ext);
this._cache[key] = result;
}
return result;
};
FileNameResolver.prototype.clearCache = function () {
this._cache = {};
};
FileNameResolver.prototype.resolveFileNameImpl = function (path, ext) {
var result = null;
path = file_system_1.path.normalize(path);
ext = "." + ext;
var candidates = this.getFileCandidatesFromFolder(path, ext);
result = _findFileMatch(path, ext, candidates, this._context);
return result;
};
FileNameResolver.prototype.getFileCandidatesFromFolder = function (path, ext) {
var candidates = new Array();
var folderPath = path.substring(0, path.lastIndexOf(file_system_1.path.separator) + 1);
if (file_system_1.Folder.exists(folderPath)) {
var folder = file_system_1.Folder.fromPath(folderPath);
folder.eachEntity(function (e) {
if (e instanceof file_system_1.File) {
var file = e;
if (file.path.indexOf(path) === 0 && file.extension === ext) {
candidates.push(file.path);
}
}
return true;
});
}
else {
if (trace.isEnabled()) {
trace.write("Could not find folder " + folderPath + " when loading " + path + ext, trace.categories.Navigation);
}
}
return candidates;
};
return FileNameResolver;
}());
exports.FileNameResolver = FileNameResolver;
function _findFileMatch(path, ext, candidates, context) {
var bestValue = -1;
var result = null;
for (var i = 0; i < candidates.length; i++) {
var filePath = candidates[i];
var qualifiersStr = filePath.substr(path.length, filePath.length - path.length - ext.length);
var qualifiers = qualifiersStr.split(".");
var value = checkQualifiers(qualifiers, context);
if (value >= 0 && value > bestValue) {
bestValue = value;
result = candidates[i];
}
}
return result;
}
exports._findFileMatch = _findFileMatch;
function checkQualifiers(qualifiers, context) {
var result = 0;
for (var i = 0; i < qualifiers.length; i++) {
if (qualifiers[i]) {
var value = checkQualifier(qualifiers[i], context);
if (value < 0) {
return -1;
}
result += value;
}
}
return result;
}
function checkQualifier(value, context) {
for (var i = 0; i < supportedQualifiers.length; i++) {
if (supportedQualifiers[i].isMatch(value)) {
var result = supportedQualifiers[i].getMatchValue(value, context);
if (result > 0) {
result += (supportedQualifiers.length - i) * PRIORITY_STEP;
}
return result;
}
}
return -1;
}
var resolverInstance;
function resolveFileName(path, ext) {
if (!resolverInstance) {
resolverInstance = new FileNameResolver({
width: platform_1.screen.mainScreen.widthDIPs,
height: platform_1.screen.mainScreen.heightDIPs,
os: platform_1.device.os,
deviceType: platform_1.device.deviceType
});
}
return resolverInstance.resolveFileName(path, ext);
}
exports.resolveFileName = resolveFileName;
appCommonModule.on("cssChanged", function (args) { return resolverInstance = undefined; });
appCommonModule.on("livesync", function (args) { return resolverInstance && resolverInstance.clearCache(); });
//# sourceMappingURL=file-name-resolver.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/file-system/file-system-access.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var textModule = __webpack_require__("../node_modules/tns-core-modules/text/text.js");
var application_1 = __webpack_require__("../node_modules/tns-core-modules/application/application.js");
var applicationContext;
function getApplicationContext() {
if (!applicationContext) {
applicationContext = application_1.getNativeApplication().getApplicationContext();
}
return applicationContext;
}
var FileSystemAccess = (function () {
function FileSystemAccess() {
this._pathSeparator = "/";
}
FileSystemAccess.prototype.getLastModified = function (path) {
var javaFile = new java.io.File(path);
return new Date(javaFile.lastModified());
};
FileSystemAccess.prototype.getFileSize = function (path) {
var javaFile = new java.io.File(path);
return javaFile.length();
};
FileSystemAccess.prototype.getParent = function (path, onError) {
try {
var javaFile = new java.io.File(path);
var parent = javaFile.getParentFile();
return { path: parent.getAbsolutePath(), name: parent.getName() };
}
catch (exception) {
if (onError) {
onError(exception);
}
return undefined;
}
};
FileSystemAccess.prototype.getFile = function (path, onError) {
return this.ensureFile(new java.io.File(path), false, onError);
};
FileSystemAccess.prototype.getFolder = function (path, onError) {
var javaFile = new java.io.File(path);
var dirInfo = this.ensureFile(javaFile, true, onError);
if (!dirInfo) {
return undefined;
}
return { path: dirInfo.path, name: dirInfo.name };
};
FileSystemAccess.prototype.eachEntity = function (path, onEntity, onError) {
if (!onEntity) {
return;
}
this.enumEntities(path, onEntity, onError);
};
FileSystemAccess.prototype.getEntities = function (path, onError) {
var fileInfos = new Array();
var onEntity = function (entity) {
fileInfos.push(entity);
return true;
};
var errorOccurred;
var localError = function (error) {
if (onError) {
onError(error);
}
errorOccurred = true;
};
this.enumEntities(path, onEntity, localError);
if (!errorOccurred) {
return fileInfos;
}
return null;
};
FileSystemAccess.prototype.fileExists = function (path) {
var file = new java.io.File(path);
return file.exists();
};
FileSystemAccess.prototype.folderExists = function (path) {
var file = new java.io.File(path);
return file.exists() && file.isDirectory();
};
FileSystemAccess.prototype.deleteFile = function (path, onError) {
try {
var javaFile = new java.io.File(path);
if (!javaFile.isFile()) {
if (onError) {
onError({ message: "The specified parameter is not a File entity." });
}
return;
}
if (!javaFile.delete()) {
if (onError) {
onError({ message: "File deletion failed" });
}
}
}
catch (exception) {
if (onError) {
onError(exception);
}
}
};
FileSystemAccess.prototype.deleteFolder = function (path, onError) {
try {
var javaFile = new java.io.File(path);
if (!javaFile.getCanonicalFile().isDirectory()) {
if (onError) {
onError({ message: "The specified parameter is not a Folder entity." });
}
return;
}
this.deleteFolderContent(javaFile);
if (!javaFile.delete()) {
if (onError) {
onError({ message: "Folder deletion failed." });
}
}
}
catch (exception) {
if (onError) {
onError(exception);
}
}
};
FileSystemAccess.prototype.emptyFolder = function (path, onError) {
try {
var javaFile = new java.io.File(path);
if (!javaFile.getCanonicalFile().isDirectory()) {
if (onError) {
onError({ message: "The specified parameter is not a Folder entity." });
}
return;
}
this.deleteFolderContent(javaFile);
}
catch (exception) {
if (onError) {
onError(exception);
}
}
};
FileSystemAccess.prototype.rename = function (path, newPath, onError) {
var javaFile = new java.io.File(path);
if (!javaFile.exists()) {
if (onError) {
onError(new Error("The file to rename does not exist"));
}
return;
}
var newFile = new java.io.File(newPath);
if (newFile.exists()) {
if (onError) {
onError(new Error("A file with the same name already exists."));
}
return;
}
if (!javaFile.renameTo(newFile)) {
if (onError) {
onError(new Error("Failed to rename file '" + path + "' to '" + newPath + "'"));
}
}
};
FileSystemAccess.prototype.getDocumentsFolderPath = function () {
var dir = getApplicationContext().getFilesDir();
return dir.getAbsolutePath();
};
FileSystemAccess.prototype.getLogicalRootPath = function () {
var dir = getApplicationContext().getFilesDir();
return dir.getCanonicalPath();
};
FileSystemAccess.prototype.getTempFolderPath = function () {
var dir = getApplicationContext().getCacheDir();
return dir.getAbsolutePath();
};
FileSystemAccess.prototype.getCurrentAppPath = function () {
return this.getLogicalRootPath() + "/app";
};
FileSystemAccess.prototype.read = function (path, onError) {
try {
var javaFile = new java.io.File(path);
var stream = new java.io.FileInputStream(javaFile);
var bytes = Array.create("byte", javaFile.length());
var dataInputStream = new java.io.DataInputStream(stream);
dataInputStream.readFully(bytes);
return bytes;
}
catch (exception) {
if (onError) {
onError(exception);
}
}
};
FileSystemAccess.prototype.write = function (path, bytes, onError) {
try {
var javaFile = new java.io.File(path);
var stream = new java.io.FileOutputStream(javaFile);
stream.write(bytes, 0, bytes.length);
stream.close();
}
catch (exception) {
if (onError) {
onError(exception);
}
}
};
FileSystemAccess.prototype.readText = function (path, onError, encoding) {
try {
var javaFile = new java.io.File(path);
var stream = new java.io.FileInputStream(javaFile);
var actualEncoding = encoding;
if (!actualEncoding) {
actualEncoding = textModule.encoding.UTF_8;
}
var reader = new java.io.InputStreamReader(stream, actualEncoding);
var bufferedReader = new java.io.BufferedReader(reader);
var line = undefined;
var result = "";
while (true) {
line = bufferedReader.readLine();
if (line === null) {
break;
}
if (result.length > 0) {
result += "\n";
}
result += line;
}
if (actualEncoding === textModule.encoding.UTF_8) {
result = FileSystemAccess._removeUtf8Bom(result);
}
bufferedReader.close();
return result;
}
catch (exception) {
if (onError) {
onError(exception);
}
}
};
FileSystemAccess._removeUtf8Bom = function (s) {
if (s.charCodeAt(0) === 0xFEFF) {
s = s.slice(1);
}
return s;
};
FileSystemAccess.prototype.writeText = function (path, content, onError, encoding) {
try {
var javaFile = new java.io.File(path);
var stream = new java.io.FileOutputStream(javaFile);
var actualEncoding = encoding;
if (!actualEncoding) {
actualEncoding = textModule.encoding.UTF_8;
}
var writer = new java.io.OutputStreamWriter(stream, actualEncoding);
writer.write(content);
writer.close();
}
catch (exception) {
if (onError) {
onError(exception);
}
}
};
FileSystemAccess.prototype.deleteFolderContent = function (file) {
var filesList = file.listFiles();
if (filesList.length === 0) {
return true;
}
var i, childFile, success = false;
for (i = 0; i < filesList.length; i++) {
childFile = filesList[i];
if (childFile.getCanonicalFile().isDirectory()) {
success = this.deleteFolderContent(childFile);
if (!success) {
break;
}
}
success = childFile.delete();
}
return success;
};
FileSystemAccess.prototype.ensureFile = function (javaFile, isFolder, onError) {
try {
if (!javaFile.exists()) {
var created;
if (isFolder) {
created = javaFile.mkdirs();
}
else {
javaFile.getParentFile().mkdirs();
created = javaFile.createNewFile();
}
if (!created) {
if (onError) {
onError("Failed to create new java File for path " + javaFile.getAbsolutePath());
}
return undefined;
}
else {
javaFile.setReadable(true);
javaFile.setWritable(true);
}
}
var path = javaFile.getAbsolutePath();
return { path: path, name: javaFile.getName(), extension: this.getFileExtension(path) };
}
catch (exception) {
if (onError) {
onError(exception);
}
return undefined;
}
};
FileSystemAccess.prototype.getFileExtension = function (path) {
var dotIndex = path.lastIndexOf(".");
if (dotIndex && dotIndex >= 0 && dotIndex < path.length) {
return path.substring(dotIndex);
}
return "";
};
FileSystemAccess.prototype.enumEntities = function (path, callback, onError) {
try {
var javaFile = new java.io.File(path);
if (!javaFile.getCanonicalFile().isDirectory()) {
if (onError) {
onError("There is no folder existing at path " + path);
}
return;
}
var filesList = javaFile.listFiles();
var length = filesList.length;
var i;
var info;
var retVal;
for (i = 0; i < length; i++) {
javaFile = filesList[i];
info = {
path: javaFile.getAbsolutePath(),
name: javaFile.getName()
};
if (javaFile.isFile()) {
info.extension = this.getFileExtension(info.path);
}
retVal = callback(info);
if (retVal === false) {
break;
}
}
}
catch (exception) {
if (onError) {
onError(exception);
}
}
};
FileSystemAccess.prototype.getPathSeparator = function () {
return this._pathSeparator;
};
FileSystemAccess.prototype.normalizePath = function (path) {
var file = new java.io.File(path);
return file.getAbsolutePath();
};
FileSystemAccess.prototype.joinPath = function (left, right) {
var file1 = new java.io.File(left);
var file2 = new java.io.File(file1, right);
return file2.getPath();
};
FileSystemAccess.prototype.joinPaths = function (paths) {
if (!paths || paths.length === 0) {
return "";
}
if (paths.length === 1) {
return paths[0];
}
var i, result = paths[0];
for (i = 1; i < paths.length; i++) {
result = this.joinPath(result, paths[i]);
}
return result;
};
return FileSystemAccess;
}());
exports.FileSystemAccess = FileSystemAccess;
//# sourceMappingURL=file-system-access.android.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/file-system/file-system.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var file_access_module = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system-access.js");
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
var fileAccess;
var getFileAccess = function () {
if (!fileAccess) {
fileAccess = new file_access_module.FileSystemAccess();
}
return fileAccess;
};
var platform;
function ensurePlatform() {
if (!platform) {
platform = __webpack_require__("../node_modules/tns-core-modules/platform/platform.js");
}
}
var createFile = function (info) {
var file = new File();
file._path = info.path;
file._name = info.name;
file._extension = info.extension;
return file;
};
var createFolder = function (info) {
var documents = knownFolders.documents();
if (info.path === documents.path) {
return documents;
}
var temp = knownFolders.temp();
if (info.path === temp.path) {
return temp;
}
var folder = new Folder();
folder._path = info.path;
folder._name = info.name;
return folder;
};
var FileSystemEntity = (function () {
function FileSystemEntity() {
}
Object.defineProperty(FileSystemEntity.prototype, "parent", {
get: function () {
var onError = function (error) {
throw error;
};
var folderInfo = getFileAccess().getParent(this.path, onError);
if (!folderInfo) {
return undefined;
}
return createFolder(folderInfo);
},
enumerable: true,
configurable: true
});
FileSystemEntity.prototype.remove = function () {
var _this = this;
return new Promise(function (resolve, reject) {
var hasError = false;
var localError = function (error) {
hasError = true;
reject(error);
};
_this.removeSync(localError);
if (!hasError) {
resolve();
}
});
};
FileSystemEntity.prototype.removeSync = function (onError) {
if (this._isKnown) {
if (onError) {
onError({ message: "Cannot delete known folder." });
}
return;
}
var fileAccess = getFileAccess();
if (this instanceof File) {
fileAccess.deleteFile(this.path, onError);
}
else if (this instanceof Folder) {
fileAccess.deleteFolder(this.path, onError);
}
};
FileSystemEntity.prototype.rename = function (newName) {
var _this = this;
return new Promise(function (resolve, reject) {
var hasError = false;
var localError = function (error) {
hasError = true;
reject(error);
};
_this.renameSync(newName, localError);
if (!hasError) {
resolve();
}
});
};
FileSystemEntity.prototype.renameSync = function (newName, onError) {
if (this._isKnown) {
if (onError) {
onError(new Error("Cannot rename known folder."));
}
return;
}
var parentFolder = this.parent;
if (!parentFolder) {
if (onError) {
onError(new Error("No parent folder."));
}
return;
}
var fileAccess = getFileAccess();
var path = parentFolder.path;
var newPath = fileAccess.joinPath(path, newName);
var localError = function (error) {
if (onError) {
onError(error);
}
return null;
};
fileAccess.rename(this.path, newPath, localError);
this._path = newPath;
this._name = newName;
if (this instanceof File) {
this._extension = fileAccess.getFileExtension(newPath);
}
};
Object.defineProperty(FileSystemEntity.prototype, "name", {
get: function () {
return this._name;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FileSystemEntity.prototype, "path", {
get: function () {
return this._path;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FileSystemEntity.prototype, "lastModified", {
get: function () {
var value = this._lastModified;
if (!this._lastModified) {
value = this._lastModified = getFileAccess().getLastModified(this.path);
}
return value;
},
enumerable: true,
configurable: true
});
return FileSystemEntity;
}());
exports.FileSystemEntity = FileSystemEntity;
var File = (function (_super) {
__extends(File, _super);
function File() {
return _super !== null && _super.apply(this, arguments) || this;
}
File.fromPath = function (path) {
var onError = function (error) {
throw error;
};
var fileInfo = getFileAccess().getFile(path, onError);
if (!fileInfo) {
return undefined;
}
return createFile(fileInfo);
};
File.exists = function (path) {
return getFileAccess().fileExists(path);
};
Object.defineProperty(File.prototype, "extension", {
get: function () {
return this._extension;
},
enumerable: true,
configurable: true
});
Object.defineProperty(File.prototype, "isLocked", {
get: function () {
return !!this._locked;
},
enumerable: true,
configurable: true
});
Object.defineProperty(File.prototype, "size", {
get: function () {
return getFileAccess().getFileSize(this.path);
},
enumerable: true,
configurable: true
});
File.prototype.readSync = function (onError) {
this.checkAccess();
this._locked = true;
var that = this;
var localError = function (error) {
that._locked = false;
if (onError) {
onError(error);
}
};
var content = getFileAccess().read(this.path, localError);
this._locked = false;
return content;
};
File.prototype.writeSync = function (content, onError) {
this.checkAccess();
try {
this._locked = true;
var that = this;
var localError = function (error) {
that._locked = false;
if (onError) {
onError(error);
}
};
getFileAccess().write(this.path, content, localError);
}
finally {
this._locked = false;
}
};
File.prototype.readText = function (encoding) {
var _this = this;
return new Promise(function (resolve, reject) {
var hasError = false;
var localError = function (error) {
hasError = true;
reject(error);
};
var content = _this.readTextSync(localError, encoding);
if (!hasError) {
resolve(content);
}
});
};
File.prototype.readTextSync = function (onError, encoding) {
this.checkAccess();
this._locked = true;
var that = this;
var localError = function (error) {
that._locked = false;
if (onError) {
onError(error);
}
};
var content = getFileAccess().readText(this.path, localError, encoding);
this._locked = false;
return content;
};
File.prototype.writeText = function (content, encoding) {
var _this = this;
return new Promise(function (resolve, reject) {
var hasError = false;
var localError = function (error) {
hasError = true;
reject(error);
};
_this.writeTextSync(content, localError, encoding);
if (!hasError) {
resolve();
}
});
};
File.prototype.writeTextSync = function (content, onError, encoding) {
this.checkAccess();
try {
this._locked = true;
var that = this;
var localError = function (error) {
that._locked = false;
if (onError) {
onError(error);
}
};
getFileAccess().writeText(this.path, content, localError, encoding);
}
finally {
this._locked = false;
}
};
File.prototype.checkAccess = function () {
if (this.isLocked) {
throw new Error("Cannot access a locked file.");
}
};
__decorate([
profiling_1.profile
], File.prototype, "readTextSync", null);
return File;
}(FileSystemEntity));
exports.File = File;
var Folder = (function (_super) {
__extends(Folder, _super);
function Folder() {
return _super !== null && _super.apply(this, arguments) || this;
}
Folder.fromPath = function (path) {
var onError = function (error) {
throw error;
};
var folderInfo = getFileAccess().getFolder(path, onError);
if (!folderInfo) {
return undefined;
}
return createFolder(folderInfo);
};
Folder.exists = function (path) {
return getFileAccess().folderExists(path);
};
Folder.prototype.contains = function (name) {
var fileAccess = getFileAccess();
var path = fileAccess.joinPath(this.path, name);
if (fileAccess.fileExists(path)) {
return true;
}
return fileAccess.folderExists(path);
};
Folder.prototype.clear = function () {
var _this = this;
return new Promise(function (resolve, reject) {
var hasError = false;
var onError = function (error) {
hasError = true;
reject(error);
};
_this.clearSync(onError);
if (!hasError) {
resolve();
}
});
};
Folder.prototype.clearSync = function (onError) {
getFileAccess().emptyFolder(this.path, onError);
};
Object.defineProperty(Folder.prototype, "isKnown", {
get: function () {
return this._isKnown;
},
enumerable: true,
configurable: true
});
Folder.prototype.getFile = function (name) {
var fileAccess = getFileAccess();
var path = fileAccess.joinPath(this.path, name);
var onError = function (error) {
throw error;
};
var fileInfo = fileAccess.getFile(path, onError);
if (!fileInfo) {
return undefined;
}
return createFile(fileInfo);
};
Folder.prototype.getFolder = function (name) {
var fileAccess = getFileAccess();
var path = fileAccess.joinPath(this.path, name);
var onError = function (error) {
throw error;
};
var folderInfo = fileAccess.getFolder(path, onError);
if (!folderInfo) {
return undefined;
}
return createFolder(folderInfo);
};
Folder.prototype.getEntities = function () {
var _this = this;
return new Promise(function (resolve, reject) {
var hasError = false;
var localError = function (error) {
hasError = true;
reject(error);
};
var entities = _this.getEntitiesSync(localError);
if (!hasError) {
resolve(entities);
}
});
};
Folder.prototype.getEntitiesSync = function (onError) {
var fileInfos = getFileAccess().getEntities(this.path, onError);
if (!fileInfos) {
return null;
}
var entities = new Array();
var i;
for (i = 0; i < fileInfos.length; i++) {
if (fileInfos[i].extension) {
entities.push(createFile(fileInfos[i]));
}
else {
entities.push(createFolder(fileInfos[i]));
}
}
return entities;
};
Folder.prototype.eachEntity = function (onEntity) {
if (!onEntity) {
return;
}
var onSuccess = function (fileInfo) {
var entity;
if (fileInfo.extension) {
entity = createFile(fileInfo);
}
else {
entity = createFolder(fileInfo);
}
return onEntity(entity);
};
var onError = function (error) {
throw error;
};
getFileAccess().eachEntity(this.path, onSuccess, onError);
};
return Folder;
}(FileSystemEntity));
exports.Folder = Folder;
var knownFolders;
(function (knownFolders) {
var _documents;
var _temp;
var _app;
knownFolders.documents = function () {
if (!_documents) {
var path = getFileAccess().getDocumentsFolderPath();
_documents = new Folder();
_documents._path = path;
_documents._isKnown = true;
}
return _documents;
};
knownFolders.temp = function () {
if (!_temp) {
var path = getFileAccess().getTempFolderPath();
_temp = new Folder();
_temp._path = path;
_temp._isKnown = true;
}
return _temp;
};
knownFolders.currentApp = function () {
if (!_app) {
var path = getFileAccess().getCurrentAppPath();
_app = new Folder();
_app._path = path;
_app._isKnown = true;
}
return _app;
};
var ios;
(function (ios) {
function _checkPlatform(knownFolderName) {
ensurePlatform();
if (!platform.isIOS) {
throw new Error("The \"" + knownFolderName + "\" known folder is available on iOS only!");
}
}
var _library;
ios.library = function () {
_checkPlatform("library");
if (!_library) {
var existingFolderInfo = getExistingFolderInfo(5);
if (existingFolderInfo) {
_library = existingFolderInfo.folder;
_library._path = existingFolderInfo.path;
_library._isKnown = true;
}
}
return _library;
};
var _developer;
ios.developer = function () {
_checkPlatform("developer");
if (!_developer) {
var existingFolderInfo = getExistingFolderInfo(6);
if (existingFolderInfo) {
_developer = existingFolderInfo.folder;
_developer._path = existingFolderInfo.path;
_developer._isKnown = true;
}
}
return _developer;
};
var _desktop;
ios.desktop = function () {
_checkPlatform("desktop");
if (!_desktop) {
var existingFolderInfo = getExistingFolderInfo(12);
if (existingFolderInfo) {
_desktop = existingFolderInfo.folder;
_desktop._path = existingFolderInfo.path;
_desktop._isKnown = true;
}
}
return _desktop;
};
var _downloads;
ios.downloads = function () {
_checkPlatform("downloads");
if (!_downloads) {
var existingFolderInfo = getExistingFolderInfo(15);
if (existingFolderInfo) {
_downloads = existingFolderInfo.folder;
_downloads._path = existingFolderInfo.path;
_downloads._isKnown = true;
}
}
return _downloads;
};
var _movies;
ios.movies = function () {
_checkPlatform("movies");
if (!_movies) {
var existingFolderInfo = getExistingFolderInfo(17);
if (existingFolderInfo) {
_movies = existingFolderInfo.folder;
_movies._path = existingFolderInfo.path;
_movies._isKnown = true;
}
}
return _movies;
};
var _music;
ios.music = function () {
_checkPlatform("music");
if (!_music) {
var existingFolderInfo = getExistingFolderInfo(18);
if (existingFolderInfo) {
_music = existingFolderInfo.folder;
_music._path = existingFolderInfo.path;
_music._isKnown = true;
}
}
return _music;
};
var _pictures;
ios.pictures = function () {
_checkPlatform("pictures");
if (!_pictures) {
var existingFolderInfo = getExistingFolderInfo(19);
if (existingFolderInfo) {
_pictures = existingFolderInfo.folder;
_pictures._path = existingFolderInfo.path;
_pictures._isKnown = true;
}
}
return _pictures;
};
var _sharedPublic;
ios.sharedPublic = function () {
_checkPlatform("sharedPublic");
if (!_sharedPublic) {
var existingFolderInfo = getExistingFolderInfo(21);
if (existingFolderInfo) {
_sharedPublic = existingFolderInfo.folder;
_sharedPublic._path = existingFolderInfo.path;
_sharedPublic._isKnown = true;
}
}
return _sharedPublic;
};
function getExistingFolderInfo(pathDirectory) {
var fileAccess = getFileAccess();
var folderPath = fileAccess.getKnownPath(pathDirectory);
var folderInfo = fileAccess.getExistingFolder(folderPath);
if (folderInfo) {
return {
folder: createFolder(folderInfo),
path: folderPath
};
}
return undefined;
}
})(ios = knownFolders.ios || (knownFolders.ios = {}));
})(knownFolders = exports.knownFolders || (exports.knownFolders = {}));
var path;
(function (path_1) {
function normalize(path) {
return getFileAccess().normalizePath(path);
}
path_1.normalize = normalize;
function join() {
var paths = [];
for (var _i = 0; _i < arguments.length; _i++) {
paths[_i] = arguments[_i];
}
var fileAccess = getFileAccess();
return fileAccess.joinPaths(paths);
}
path_1.join = join;
path_1.separator = getFileAccess().getPathSeparator();
})(path = exports.path || (exports.path = {}));
//# sourceMappingURL=file-system.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/globals/globals.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
__webpack_require__("../node_modules/tns-core-modules/globals/ts-helpers.js");
global.moduleMerge = function (sourceExports, destExports) {
for (var key in sourceExports) {
destExports[key] = sourceExports[key];
}
};
var modules = new Map();
global.moduleResolvers = [global.require];
global.registerModule = function (name, loader) {
modules.set(name, loader);
};
var defaultExtensionMap = { ".js": ".js", ".ts": ".js", ".css": ".css", ".scss": ".css", ".xml": ".xml", ".less": ".css", ".sass": ".css" };
global.registerWebpackModules = function registerWebpackModules(context, extensionMap) {
if (extensionMap === void 0) { extensionMap = {}; }
context.keys().forEach(function (key) {
var extDotIndex = key.lastIndexOf(".");
var base = key.substr(0, extDotIndex);
var originalExt = key.substr(extDotIndex);
var registerExt = extensionMap[originalExt] || defaultExtensionMap[originalExt] || originalExt;
var isSourceFile = originalExt !== registerExt;
var registerName = base + registerExt;
if (registerName.startsWith("./") && registerName.endsWith(".js")) {
var jsNickNames = [
registerName.substr(2, registerName.length - 5),
registerName.substr(0, registerName.length - 3),
registerName.substr(2),
];
jsNickNames.forEach(function (jsNickName) {
if (isSourceFile || !global.moduleExists(jsNickName)) {
global.registerModule(jsNickName, function () { return context(key); });
}
});
}
if (isSourceFile || !global.moduleExists(registerName)) {
global.registerModule(registerName, function () { return context(key); });
}
});
};
global.moduleExists = function (name) {
return modules.has(name);
};
global.loadModule = function (name) {
var loader = modules.get(name);
if (loader) {
return loader();
}
var _loop_1 = function (resolver) {
var result = resolver(name);
if (result) {
modules.set(name, function () { return result; });
return { value: result };
}
};
for (var _i = 0, _a = global.moduleResolvers; _i < _a.length; _i++) {
var resolver = _a[_i];
var state_1 = _loop_1(resolver);
if (typeof state_1 === "object")
return state_1.value;
}
};
global.zonedCallback = function (callback) {
if (global.zone) {
return global.zone.bind(callback);
}
if (global.Zone) {
return global.Zone.current.wrap(callback);
}
else {
return callback;
}
};
global.registerModule("timer", function () { return __webpack_require__("../node_modules/tns-core-modules/timer/timer.js"); });
global.registerModule("ui/dialogs", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/dialogs/dialogs.js"); });
global.registerModule("xhr", function () { return __webpack_require__("../node_modules/tns-core-modules/xhr/xhr.js"); });
global.registerModule("fetch", function () { return __webpack_require__("../node_modules/tns-core-modules/fetch/fetch.js"); });
global.System = {
import: function (path) {
return new Promise(function (resolve, reject) {
try {
resolve(global.require(path));
}
catch (e) {
reject(e);
}
});
}
};
function registerOnGlobalContext(name, module) {
Object.defineProperty(global, name, {
get: function () {
var m = global.loadModule(module);
var resolvedValue = m[name];
Object.defineProperty(this, name, { value: resolvedValue, configurable: true, writable: true });
return resolvedValue;
},
configurable: true
});
}
var snapshotGlobals;
function install() {
if (global.__snapshot || global.__snapshotEnabled) {
if (!snapshotGlobals) {
var timer = __webpack_require__("../node_modules/tns-core-modules/timer/timer.js");
var dialogs = __webpack_require__("../node_modules/tns-core-modules/ui/dialogs/dialogs.js");
var xhr = __webpack_require__("../node_modules/tns-core-modules/xhr/xhr.js");
var fetch = __webpack_require__("../node_modules/tns-core-modules/fetch/fetch.js");
snapshotGlobals = snapshotGlobals || {
setTimeout: timer.setTimeout,
clearTimeout: timer.clearTimeout,
setInterval: timer.setInterval,
clearInterval: timer.clearInterval,
alert: dialogs.alert,
confirm: dialogs.confirm,
prompt: dialogs.prompt,
login: dialogs.login,
action: dialogs.action,
XMLHttpRequest: xhr.XMLHttpRequest,
FormData: xhr.FormData,
fetch: fetch.fetch,
Headers: fetch.Headers,
Request: fetch.Request,
Response: fetch.Response,
};
}
var consoleModule = __webpack_require__("../node_modules/tns-core-modules/console/console.js").Console;
global.console = global.console || new consoleModule();
Object.assign(global, snapshotGlobals);
}
else {
registerOnGlobalContext("setTimeout", "timer");
registerOnGlobalContext("clearTimeout", "timer");
registerOnGlobalContext("setInterval", "timer");
registerOnGlobalContext("clearInterval", "timer");
registerOnGlobalContext("alert", "ui/dialogs");
registerOnGlobalContext("confirm", "ui/dialogs");
registerOnGlobalContext("prompt", "ui/dialogs");
registerOnGlobalContext("login", "ui/dialogs");
registerOnGlobalContext("action", "ui/dialogs");
registerOnGlobalContext("XMLHttpRequest", "xhr");
registerOnGlobalContext("FormData", "xhr");
registerOnGlobalContext("fetch", "fetch");
registerOnGlobalContext("Headers", "fetch");
registerOnGlobalContext("Request", "fetch");
registerOnGlobalContext("Response", "fetch");
}
}
exports.install = install;
install();
function Deprecated(target, key, descriptor) {
if (descriptor) {
var originalMethod = descriptor.value;
descriptor.value = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
console.log(key.toString() + " is deprecated");
return originalMethod.apply(this, args);
};
return descriptor;
}
else {
console.log((target && target.name || target) + " is deprecated");
return target;
}
}
exports.Deprecated = Deprecated;
global.Deprecated = Deprecated;
function Experimental(target, key, descriptor) {
if (descriptor) {
var originalMethod = descriptor.value;
descriptor.value = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
console.log(key.toString() + " is experimental");
return originalMethod.apply(this, args);
};
return descriptor;
}
else {
console.log((target && target.name || target) + " is experimental");
return target;
}
}
exports.Experimental = Experimental;
global.Experimental = Experimental;
//# sourceMappingURL=globals.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/globals/ts-helpers.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
if (!global.__extends) {
global.__extends = function (d, b) {
for (var p in b) {
if (b.hasOwnProperty(p)) {
d[p] = b[p];
}
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}
var tslib = __webpack_require__("../node_modules/tslib/tslib.es6.js");
for (var _i = 0, _a = Object.keys(tslib); _i < _a.length; _i++) {
var fnName = _a[_i];
if (typeof tslib[fnName] !== "function") {
continue;
}
if (fnName in global) {
continue;
}
global[fnName] = tslib[fnName];
}
//# sourceMappingURL=ts-helpers.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/http/http-request/http-request-common.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
function getFilenameFromUrl(url) {
var fs = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system.js");
var slashPos = url.lastIndexOf("/") + 1;
var questionMarkPos = url.lastIndexOf("?");
var actualFileName;
if (questionMarkPos !== -1) {
actualFileName = url.substring(slashPos, questionMarkPos);
}
else {
actualFileName = url.substring(slashPos);
}
var result = fs.path.join(fs.knownFolders.documents().path, actualFileName);
return result;
}
exports.getFilenameFromUrl = getFilenameFromUrl;
//# sourceMappingURL=http-request-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/http/http-request/http-request.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
var http_request_common_1 = __webpack_require__("../node_modules/tns-core-modules/http/http-request/http-request-common.js");
var debugger_1 = __webpack_require__("../node_modules/tns-core-modules/debugger/debugger.js");
var HttpResponseEncoding;
(function (HttpResponseEncoding) {
HttpResponseEncoding[HttpResponseEncoding["UTF8"] = 0] = "UTF8";
HttpResponseEncoding[HttpResponseEncoding["GBK"] = 1] = "GBK";
})(HttpResponseEncoding = exports.HttpResponseEncoding || (exports.HttpResponseEncoding = {}));
function parseJSON(source) {
var src = source.trim();
if (src.lastIndexOf(")") === src.length - 1) {
return JSON.parse(src.substring(src.indexOf("(") + 1, src.lastIndexOf(")")));
}
return JSON.parse(src);
}
var requestIdCounter = 0;
var pendingRequests = {};
var imageSource;
function ensureImageSource() {
if (!imageSource) {
imageSource = __webpack_require__("../node_modules/tns-core-modules/image-source/image-source.js");
}
}
var platform;
function ensurePlatform() {
if (!platform) {
platform = __webpack_require__("../node_modules/tns-core-modules/platform/platform.js");
}
}
var completeCallback;
function ensureCompleteCallback() {
if (completeCallback) {
return;
}
completeCallback = new org.nativescript.widgets.Async.CompleteCallback({
onComplete: function (result, context) {
onRequestComplete(context, result);
}
});
}
function onRequestComplete(requestId, result) {
var callbacks = pendingRequests[requestId];
delete pendingRequests[requestId];
if (result.error) {
callbacks.rejectCallback(new Error(result.error.toString()));
return;
}
var headers = {};
if (result.headers) {
var jHeaders = result.headers;
var length = jHeaders.size();
var i;
var pair;
for (i = 0; i < length; i++) {
pair = jHeaders.get(i);
addHeader(headers, pair.key, pair.value);
}
}
if (global.__inspector && global.__inspector.isConnected) {
debugger_1.NetworkAgent.responseReceived(requestId, result, headers);
}
callbacks.resolveCallback({
content: {
raw: result.raw,
toString: function (encoding) {
var str;
if (encoding) {
str = decodeResponse(result.raw, encoding);
}
else {
str = result.responseAsString;
}
if (typeof str === "string") {
return str;
}
else {
throw new Error("Response content may not be converted to string");
}
},
toJSON: function (encoding) {
var str;
if (encoding) {
str = decodeResponse(result.raw, encoding);
}
else {
str = result.responseAsString;
}
return parseJSON(str);
},
toImage: function () {
ensureImageSource();
return new Promise(function (resolveImage, rejectImage) {
if (result.responseAsImage != null) {
resolveImage(imageSource.fromNativeSource(result.responseAsImage));
}
else {
rejectImage(new Error("Response content may not be converted to an Image"));
}
});
},
toFile: function (destinationFilePath) {
var fs = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system.js");
if (!destinationFilePath) {
destinationFilePath = http_request_common_1.getFilenameFromUrl(callbacks.url);
}
var stream;
try {
var javaFile = new java.io.File(destinationFilePath);
stream = new java.io.FileOutputStream(javaFile);
stream.write(result.raw.toByteArray());
return fs.File.fromPath(destinationFilePath);
}
catch (exception) {
throw new Error("Cannot save file with path: " + destinationFilePath + ".");
}
finally {
if (stream) {
stream.close();
}
}
}
},
statusCode: result.statusCode,
headers: headers
});
}
function buildJavaOptions(options) {
if (typeof options.url !== "string") {
throw new Error("Http request must provide a valid url.");
}
var javaOptions = new org.nativescript.widgets.Async.Http.RequestOptions();
javaOptions.url = options.url;
if (typeof options.method === "string") {
javaOptions.method = options.method;
}
if (typeof options.content === "string" || options.content instanceof FormData) {
javaOptions.content = options.content.toString();
}
if (typeof options.timeout === "number") {
javaOptions.timeout = options.timeout;
}
if (typeof options.dontFollowRedirects === "boolean") {
javaOptions.dontFollowRedirects = options.dontFollowRedirects;
}
if (options.headers) {
var arrayList = new java.util.ArrayList();
var pair = org.nativescript.widgets.Async.Http.KeyValuePair;
for (var key in options.headers) {
arrayList.add(new pair(key, options.headers[key] + ""));
}
javaOptions.headers = arrayList;
}
ensurePlatform();
var screen = platform.screen.mainScreen;
javaOptions.screenWidth = screen.widthPixels;
javaOptions.screenHeight = screen.heightPixels;
return javaOptions;
}
function request(options) {
if (options === undefined || options === null) {
return;
}
return new Promise(function (resolve, reject) {
try {
var javaOptions = buildJavaOptions(options);
if (global.__inspector && global.__inspector.isConnected) {
debugger_1.NetworkAgent.requestWillBeSent(requestIdCounter, options);
}
var callbacks = {
url: options.url,
resolveCallback: resolve,
rejectCallback: reject
};
pendingRequests[requestIdCounter] = callbacks;
ensureCompleteCallback();
org.nativescript.widgets.Async.Http.MakeRequest(javaOptions, completeCallback, new java.lang.Integer(requestIdCounter));
requestIdCounter++;
}
catch (ex) {
reject(ex);
}
});
}
exports.request = request;
function decodeResponse(raw, encoding) {
var charsetName = "UTF-8";
if (encoding === HttpResponseEncoding.GBK) {
charsetName = "GBK";
}
return raw.toString(charsetName);
}
function addHeader(headers, key, value) {
if (!headers[key]) {
headers[key] = value;
}
else if (Array.isArray(headers[key])) {
headers[key].push(value);
}
else {
var values = [headers[key]];
values.push(value);
headers[key] = values;
}
}
exports.addHeader = addHeader;
//# sourceMappingURL=http-request.android.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/http/http.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var httpRequest = __webpack_require__("../node_modules/tns-core-modules/http/http-request/http-request.js");
__export(__webpack_require__("../node_modules/tns-core-modules/http/http-request/http-request.js"));
function getString(arg) {
return new Promise(function (resolve, reject) {
httpRequest.request(typeof arg === "string" ? { url: arg, method: "GET" } : arg)
.then(function (r) {
try {
var str = r.content.toString();
resolve(str);
}
catch (e) {
reject(e);
}
}, function (e) { return reject(e); });
});
}
exports.getString = getString;
function getJSON(arg) {
return new Promise(function (resolve, reject) {
httpRequest.request(typeof arg === "string" ? { url: arg, method: "GET" } : arg)
.then(function (r) {
try {
var json = r.content.toJSON();
resolve(json);
}
catch (e) {
reject(e);
}
}, function (e) { return reject(e); });
});
}
exports.getJSON = getJSON;
function getImage(arg) {
return new Promise(function (resolve, reject) {
httpRequest.request(typeof arg === "string" ? { url: arg, method: "GET" } : arg)
.then(function (r) {
try {
resolve(r.content.toImage());
}
catch (err) {
reject(err);
}
}, function (err) {
reject(err);
});
});
}
exports.getImage = getImage;
function getFile(arg, destinationFilePath) {
return new Promise(function (resolve, reject) {
httpRequest.request(typeof arg === "string" ? { url: arg, method: "GET" } : arg)
.then(function (r) {
try {
var file = r.content.toFile(destinationFilePath);
resolve(file);
}
catch (e) {
reject(e);
}
}, function (e) { return reject(e); });
});
}
exports.getFile = getFile;
//# sourceMappingURL=http.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/image-asset/image-asset-common.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var observable = __webpack_require__("../node_modules/tns-core-modules/data/observable/observable.js");
var platform = __webpack_require__("../node_modules/tns-core-modules/platform/platform.js");
var ImageAsset = (function (_super) {
__extends(ImageAsset, _super);
function ImageAsset() {
var _this = _super.call(this) || this;
_this._options = { keepAspectRatio: true, autoScaleFactor: true };
return _this;
}
Object.defineProperty(ImageAsset.prototype, "options", {
get: function () {
return this._options;
},
set: function (value) {
this._options = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ImageAsset.prototype, "nativeImage", {
get: function () {
return this._nativeImage;
},
set: function (value) {
this._nativeImage = value;
},
enumerable: true,
configurable: true
});
ImageAsset.prototype.getImageAsync = function (callback) {
};
return ImageAsset;
}(observable.Observable));
exports.ImageAsset = ImageAsset;
function getAspectSafeDimensions(sourceWidth, sourceHeight, reqWidth, reqHeight) {
var widthCoef = sourceWidth / reqWidth;
var heightCoef = sourceHeight / reqHeight;
var aspectCoef = Math.min(widthCoef, heightCoef);
return {
width: Math.floor(sourceWidth / aspectCoef),
height: Math.floor(sourceHeight / aspectCoef)
};
}
exports.getAspectSafeDimensions = getAspectSafeDimensions;
function getRequestedImageSize(src, options) {
var screen = platform.screen.mainScreen;
var reqWidth = options.width || Math.min(src.width, screen.widthPixels);
var reqHeight = options.height || Math.min(src.height, screen.heightPixels);
if (options && options.keepAspectRatio) {
var safeAspectSize = getAspectSafeDimensions(src.width, src.height, reqWidth, reqHeight);
reqWidth = safeAspectSize.width;
reqHeight = safeAspectSize.height;
}
return {
width: reqWidth,
height: reqHeight
};
}
exports.getRequestedImageSize = getRequestedImageSize;
//# sourceMappingURL=image-asset-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/image-asset/image-asset.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
var common = __webpack_require__("../node_modules/tns-core-modules/image-asset/image-asset-common.js");
var file_system_1 = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system.js");
global.moduleMerge(common, exports);
var ImageAsset = (function (_super) {
__extends(ImageAsset, _super);
function ImageAsset(asset) {
var _this = _super.call(this) || this;
var fileName = typeof asset === "string" ? asset.trim() : "";
if (fileName.indexOf("~/") === 0) {
fileName = file_system_1.path.join(file_system_1.knownFolders.currentApp().path, fileName.replace("~/", ""));
}
_this.android = fileName;
return _this;
}
Object.defineProperty(ImageAsset.prototype, "android", {
get: function () {
return this._android;
},
set: function (value) {
this._android = value;
},
enumerable: true,
configurable: true
});
ImageAsset.prototype.getImageAsync = function (callback) {
var bitmapOptions = new android.graphics.BitmapFactory.Options();
bitmapOptions.inJustDecodeBounds = true;
var bitmap = android.graphics.BitmapFactory.decodeFile(this.android, bitmapOptions);
var sourceSize = {
width: bitmapOptions.outWidth,
height: bitmapOptions.outHeight
};
var requestedSize = common.getRequestedImageSize(sourceSize, this.options);
var sampleSize = org.nativescript.widgets.image.Fetcher.calculateInSampleSize(bitmapOptions.outWidth, bitmapOptions.outHeight, requestedSize.width, requestedSize.height);
var finalBitmapOptions = new android.graphics.BitmapFactory.Options();
finalBitmapOptions.inSampleSize = sampleSize;
try {
var error = null;
bitmap = android.graphics.BitmapFactory.decodeFile(this.android, finalBitmapOptions);
if (bitmap) {
if (requestedSize.width !== bitmap.getWidth() || requestedSize.height !== bitmap.getHeight()) {
bitmap = android.graphics.Bitmap.createScaledBitmap(bitmap, requestedSize.width, requestedSize.height, true);
}
var rotationAngle = calculateAngleFromFile(this.android);
if (rotationAngle !== 0) {
var matrix = new android.graphics.Matrix();
matrix.postRotate(rotationAngle);
bitmap = android.graphics.Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
}
}
if (!bitmap) {
error = "Asset '" + this.android + "' cannot be found.";
}
callback(bitmap, error);
}
catch (ex) {
callback(null, ex);
}
};
return ImageAsset;
}(common.ImageAsset));
exports.ImageAsset = ImageAsset;
var calculateAngleFromFile = function (filename) {
var rotationAngle = 0;
var ei = new android.media.ExifInterface(filename);
var orientation = ei.getAttributeInt(android.media.ExifInterface.TAG_ORIENTATION, android.media.ExifInterface.ORIENTATION_NORMAL);
switch (orientation) {
case android.media.ExifInterface.ORIENTATION_ROTATE_90:
rotationAngle = 90;
break;
case android.media.ExifInterface.ORIENTATION_ROTATE_180:
rotationAngle = 180;
break;
case android.media.ExifInterface.ORIENTATION_ROTATE_270:
rotationAngle = 270;
break;
}
return rotationAngle;
};
//# sourceMappingURL=image-asset.android.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/image-source/image-source.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var file_system_1 = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system.js");
var utils_1 = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
exports.isFileOrResourcePath = utils_1.isFileOrResourcePath;
var application_1 = __webpack_require__("../node_modules/tns-core-modules/application/application.js");
var http;
function ensureHttp() {
if (!http) {
http = __webpack_require__("../node_modules/tns-core-modules/http/http.js");
}
}
var application;
var resources;
function getApplication() {
if (!application) {
application = application_1.getNativeApplication();
}
return application;
}
function getResources() {
if (!resources) {
resources = getApplication().getResources();
}
return resources;
}
var ImageSource = (function () {
function ImageSource() {
}
ImageSource.prototype.fromAsset = function (asset) {
var _this = this;
return new Promise(function (resolve, reject) {
asset.getImageAsync(function (image, err) {
if (image) {
_this.setNativeSource(image);
resolve(_this);
}
else {
reject(err);
}
});
});
};
ImageSource.prototype.loadFromResource = function (name) {
this.android = null;
var res = getResources();
if (res) {
var identifier = res.getIdentifier(name, "drawable", getApplication().getPackageName());
if (0 < identifier) {
var bitmapDrawable = res.getDrawable(identifier);
if (bitmapDrawable && bitmapDrawable.getBitmap) {
this.android = bitmapDrawable.getBitmap();
}
}
}
return this.android != null;
};
ImageSource.prototype.fromResource = function (name) {
var _this = this;
return new Promise(function (resolve, reject) {
resolve(_this.loadFromResource(name));
});
};
ImageSource.prototype.setRotationAngleFromFile = function (filename) {
this.rotationAngle = 0;
var ei = new android.media.ExifInterface(filename);
var orientation = ei.getAttributeInt(android.media.ExifInterface.TAG_ORIENTATION, android.media.ExifInterface.ORIENTATION_NORMAL);
switch (orientation) {
case android.media.ExifInterface.ORIENTATION_ROTATE_90:
this.rotationAngle = 90;
break;
case android.media.ExifInterface.ORIENTATION_ROTATE_180:
this.rotationAngle = 180;
break;
case android.media.ExifInterface.ORIENTATION_ROTATE_270:
this.rotationAngle = 270;
break;
}
};
ImageSource.prototype.loadFromFile = function (path) {
var fileName = typeof path === "string" ? path.trim() : "";
if (fileName.indexOf("~/") === 0) {
fileName = file_system_1.path.join(file_system_1.knownFolders.currentApp().path, fileName.replace("~/", ""));
}
this.setRotationAngleFromFile(fileName);
this.android = android.graphics.BitmapFactory.decodeFile(fileName, null);
return this.android != null;
};
ImageSource.prototype.fromFile = function (path) {
var _this = this;
return new Promise(function (resolve, reject) {
resolve(_this.loadFromFile(path));
});
};
ImageSource.prototype.loadFromData = function (data) {
this.android = android.graphics.BitmapFactory.decodeStream(data);
return this.android != null;
};
ImageSource.prototype.fromData = function (data) {
var _this = this;
return new Promise(function (resolve, reject) {
resolve(_this.loadFromData(data));
});
};
ImageSource.prototype.loadFromBase64 = function (source) {
if (typeof source === "string") {
var bytes = android.util.Base64.decode(source, android.util.Base64.DEFAULT);
this.android = android.graphics.BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
}
return this.android != null;
};
ImageSource.prototype.fromBase64 = function (data) {
var _this = this;
return new Promise(function (resolve, reject) {
resolve(_this.loadFromBase64(data));
});
};
ImageSource.prototype.setNativeSource = function (source) {
if (source && !(source instanceof android.graphics.Bitmap)) {
throw new Error("The method setNativeSource() expects android.graphics.Bitmap instance.");
}
this.android = source;
};
ImageSource.prototype.saveToFile = function (path, format, quality) {
if (quality === void 0) { quality = 100; }
if (!this.android) {
return false;
}
var targetFormat = getTargetFormat(format);
var outputStream = new java.io.BufferedOutputStream(new java.io.FileOutputStream(path));
var res = this.android.compress(targetFormat, quality, outputStream);
outputStream.close();
return res;
};
ImageSource.prototype.toBase64String = function (format, quality) {
if (quality === void 0) { quality = 100; }
if (!this.android) {
return null;
}
var targetFormat = getTargetFormat(format);
var outputStream = new java.io.ByteArrayOutputStream();
var base64Stream = new android.util.Base64OutputStream(outputStream, android.util.Base64.NO_WRAP);
this.android.compress(targetFormat, quality, base64Stream);
base64Stream.close();
outputStream.close();
return outputStream.toString();
};
Object.defineProperty(ImageSource.prototype, "height", {
get: function () {
if (this.android) {
return this.android.getHeight();
}
return NaN;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ImageSource.prototype, "width", {
get: function () {
if (this.android) {
return this.android.getWidth();
}
return NaN;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ImageSource.prototype, "rotationAngle", {
get: function () {
return this._rotationAngle;
},
set: function (value) {
this._rotationAngle = value;
},
enumerable: true,
configurable: true
});
return ImageSource;
}());
exports.ImageSource = ImageSource;
function getTargetFormat(format) {
switch (format) {
case "jpeg":
case "jpg":
return android.graphics.Bitmap.CompressFormat.JPEG;
default:
return android.graphics.Bitmap.CompressFormat.PNG;
}
}
function fromAsset(asset) {
var image = new ImageSource();
return image.fromAsset(asset);
}
exports.fromAsset = fromAsset;
function fromResource(name) {
var image = new ImageSource();
return image.loadFromResource(name) ? image : null;
}
exports.fromResource = fromResource;
function fromFile(path) {
var image = new ImageSource();
return image.loadFromFile(path) ? image : null;
}
exports.fromFile = fromFile;
function fromData(data) {
var image = new ImageSource();
return image.loadFromData(data) ? image : null;
}
exports.fromData = fromData;
function fromBase64(source) {
var image = new ImageSource();
return image.loadFromBase64(source) ? image : null;
}
exports.fromBase64 = fromBase64;
function fromNativeSource(source) {
var imageSource = new ImageSource();
imageSource.setNativeSource(source);
return imageSource;
}
exports.fromNativeSource = fromNativeSource;
function fromUrl(url) {
ensureHttp();
return http.getImage(url);
}
exports.fromUrl = fromUrl;
function fromFileOrResource(path) {
if (!utils_1.isFileOrResourcePath(path)) {
throw new Error(path + " is not a valid file or resource.");
}
if (path.indexOf(utils_1.RESOURCE_PREFIX) === 0) {
return fromResource(path.substr(utils_1.RESOURCE_PREFIX.length));
}
return fromFile(path);
}
exports.fromFileOrResource = fromFileOrResource;
//# sourceMappingURL=image-source.android.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/js-libs/easysax/easysax.js":
/***/ (function(module, exports, __webpack_require__) {
 /*
new function() {
var parser = new EasySAXParser();
parser.ns('rss', { // or false
rss: 'http://purl.org/rss/1.0/',
atom: 'http://www.w3.org/2005/Atom',
xhtml: 'http://www.w3.org/1999/xhtml',
media: 'http://search.yahoo.com/mrss/'
});
parser.on('error', function(msg) {
//console.log(msg)
});
parser.on('startNode', function(elem, attr, uq, tagend, getStrNode) {
attr();
return;
if (tagend) {
console.log(' '+str)
} else {
console.log('+ '+str)
};
});
parser.on('endNode', function(elem, uq, tagstart, str) {
return;
if (!tagstart) console.log('- ' + str)
});
parser.on('textNode', function(s, uq) {
uq(s);
return
console.log(' '+s)
});
parser.on('cdata', function(data) {
});
parser.on('comment', function(text) {
//console.log('--'+text+'--')
});
//parser.on('question', function() {}); // <? ... ?>
//parser.on('attention', function() {}); // <!XXXXX zzzz="eeee">
console.time('easysax');
for(var z=1000;z--;) {
parser.parse(xml)
};
console.timeEnd('easysax');
};
*/
// << ------------------------------------------------------------------------ >> //
if (true /*&& this == exports*/) {
module.exports.EasySAXParser = EasySAXParser;
};
function EasySAXParser() {
'use strict';
if (!this) return null;
this.angularSyntax = false;
function nullFunc() {};
this.onTextNode = nullFunc;
this.onStartNode = nullFunc;
this.onEndNode = nullFunc;
this.onCDATA = nullFunc;
this.onError = nullFunc;
this.onComment = null;
this.onQuestion = null;
this.onAttention = null;
this.is_onComment = this.is_onQuestion = this.is_onAttention = false;
this.isNamespace = false;
this.useNS = null;
this.default_xmlns = null;
this.xmlns = null;
this.nsmatrix = {xmlns: this.xmlns};
this.hasSurmiseNS = false;
;
this.attr_string = ''; // строка атрибутов
this.attr_posstart = 0; //
this.attr_res; // закешированный результат разбора атрибутов , null - разбор не проводился, object - хеш атрибутов, true - нет атрибутов, false - невалидный xml
}
EasySAXParser.prototype.on = function(name, cb) {
if (typeof cb !== 'function') {
if (cb !== null) return;
};
switch(name) {
case 'error': this.onError = cb || nullFunc; break;
case 'startNode': this.onStartNode = cb || nullFunc; break;
case 'endNode': this.onEndNode = cb || nullFunc; break;
case 'textNode': this.onTextNode = cb || nullFunc; break;
case 'cdata': this.onCDATA = cb || nullFunc; break;
case 'comment': this.onComment = cb; this.is_onComment = !!cb; break;
case 'question': this.onQuestion = cb; this.is_onQuestion = !!cb; break; // <? .... ?>
case 'attention': this.onAttention = cb; this.is_onAttention = !!cb; break; // <!XXXXX zzzz="eeee">
};
};
EasySAXParser.prototype.ns = function(root, ns) {
if (!root || typeof root !== 'string' || !ns) {
return;
};
var u, x = {}, ok, v, i;
for(i in ns) {
v = ns[i];
if (typeof v === 'string') {
if (root === v) ok = true;
x[i] = v;
};
};
if (ok) {
this.isNamespace = true;
this.default_xmlns = root;
this.useNS = x;
};
};
EasySAXParser.prototype.parse = function(xml) {
if (typeof xml !== 'string') {
return;
};
if (this.isNamespace) {
this.nsmatrix = {xmlns: this.default_xmlns};
parse(xml);
this.nsmatrix = false;
} else {
parse(xml);
};
this.attr_res = true;
};
// -----------------------------------------------------
var xharsQuot={constructor: false, hasOwnProperty: false, isPrototypeOf: false, propertyIsEnumerable: false, toLocaleString: false, toString: false, valueOf: false
, quot: '"'
, QUOT: '"'
, amp: '&'
, AMP: '&'
, nbsp: '\u00A0'
, apos: '\''
, lt: '<'
, LT: '<'
, gt: '>'
, GT: '>'
, copy: '\u00A9'
, laquo: '\u00AB'
, raquo: '\u00BB'
, reg: '\u00AE'
, deg: '\u00B0'
, plusmn: '\u00B1'
, sup2: '\u00B2'
, sup3: '\u00B3'
, micro: '\u00B5'
, para: '\u00B6'
};
function rpEntities(s, d, x, z) {
if (z) {
return xharsQuot[z] || '\x01';
};
if (d) {
return String.fromCharCode(d);
};
return String.fromCharCode(parseInt(x, 16));
};
function unEntities(s, i) {
s = String(s);
if (s.length > 3 && s.indexOf('&') !== -1) {
if (s.indexOf('&gt;') !== -1) s = s.replace(/&gt;/g, '>');
if (s.indexOf('&lt;') !== -1) s = s.replace(/&lt;/g, '<');
if (s.indexOf('&quot;') !== -1) s = s.replace(/&quot;/g, '"');
if (s.indexOf('&') !== -1) {
s = s.replace(/&#(\d+);|&#x([0123456789abcdef]+);|&(\w+);/ig, rpEntities);
};
};
return s;
};
EasySAXParser.prototype.allowedAngularAttributeChars = function(w) {
if (!this.angularSyntax) {
return false;
} else {
return (
w === 40 || // (
w === 41 || // )
w === 91 || // [
w === 93 || // ]
w === 94 || // ^
w === 35 // #
);
}
};
/*
парсит атрибуты по требованию. Важно! - функция не генерирует исключения.
если была ошибка разбора возврашается false
если атрибутов нет и разбор удачен то возврашается true
если есть атрибуты то возврашается обьект(хеш)
*/
EasySAXParser.prototype.getAttrs = function() {
if (this.attr_res !== null) {
return this.attr_res;
};
/*
if (xxtest !== u && attr_string.indexOf(xxtest) === -1) {
/ *
// для ускорения
if (getAttrs('html').type == 'html') {
...
};
* /
return true;
};
*/
var u
, res = {}
, s = this.attr_string
, i = this.attr_posstart
, l = s.length
, attr_list = this.hasSurmiseNS ? [] : false
, name, value = ''
, ok = false
, noValueAttribute = false
, j, w, nn, n
, hasNewMatrix
, alias, newalias
;
aa:
for(; i < l; i++) {
w = s.charCodeAt(i);
if (w===32 || (w<14 && w > 8) ) { // \f\n\r\t\v
continue
};
// Check for valid attribute start char
if ((w < 65 && !this.allowedAngularAttributeChars(w)) ||
w > 122 || (w > 90 && w < 97 && !this.allowedAngularAttributeChars(w)) ) { // ожидаем символ
return this.attr_res = false; // error. invalid char
};
for(j = i + 1; j < l; j++) { // проверяем все символы имени атрибута
w = s.charCodeAt(j);
if (w > 96 && w < 123 || w > 64 && w < 91 || w > 47 && w < 59 || w === 45 || w === 95 || w === 46 /* https://github.com/telerik/xPlatCore/issues/179 */) {
if (noValueAttribute) {
j--; //Started next attribute. Get back and break out of the loop.
break;
} else {
continue;
}
};
if (this.allowedAngularAttributeChars(w)) {
continue;
}
if (w === 32 || (w > 8 && w < 14) ) { // \f\n\r\t\v пробел
noValueAttribute = true;
continue;
} else if (w === 61) { // "=" == 61
noValueAttribute = false;
break;
} else {
//console.log('error 2');
if (!noValueAttribute)
return this.attr_res = false; // error. invalid char
};
break;
};
name = s.substring(i, j).trim();
ok = true;
if (name === 'xmlns:xmlns') {
//console.log('error 6')
return this.attr_res = false; // error. invalid name
};
w = s.charCodeAt(j+1);
while (w = s.charCodeAt(j+1)) {
if (w===32 || (w > 8 && w<14) ) { // \f\n\r\t\v пробел
j++;
} else {
break;
}
}
if (!noValueAttribute) {
if (w === 34) { // '"'
j = s.indexOf('"', i = j+2 );
} else {
if (w === 39) {
j = s.indexOf('\'', i = j+2 );
} else { // "'"
return this.attr_res = false; // error. invalid char
};
};
}
if (j === -1) {
//console.log('error 4')
return this.attr_res = false; // error. invalid char
};
if (j+1 < l && !noValueAttribute) {
w = s.charCodeAt(j+1);
if (w > 32 || w < 9 || (w < 32 && w > 13)) {
// error. invalid char
//console.log('error 5')
return this.attr_res = false;
};
};
if (noValueAttribute) {
value = '';
} else {
value = s.substring(i, j);
}
//i = j + 1; // след. семвол уже проверен потому проверять нужно следуюший
i = j; // след. семвол уже проверен потому проверять нужно следуюший
if (this.isNamespace) { //
if (this.hasSurmiseNS) {
// есть подозрение что в атрибутах присутствует xmlns
if (newalias = name === 'xmlns' ? 'xmlns' : name.charCodeAt(0) === 120 && name.substr(0, 6) === 'xmlns:' && name.substr(6) ) {
alias = this.useNS[unEntities(value)];
if (alias) {
if (this.nsmatrix[newalias] !== alias) {
if (!hasNewMatrix) {
hasNewMatrix = true;
nn = {}; for (n in this.nsmatrix) nn[n] = this.nsmatrix[n];
this.nsmatrix = nn;
};
this.nsmatrix[newalias] = alias;
};
} else {
if (this.nsmatrix[newalias]) {
if (!hasNewMatrix) {
hasNewMatrix = true;
nn = {}; for (n in this.nsmatrix) nn[n] = this.nsmatrix[n];
this.nsmatrix = nn;
};
this.nsmatrix[newalias] = false;
};
};
res[name] = value;
continue;
};
attr_list.push(name, value);
continue;
};
w = name.length;
while(--w) {
if (name.charCodeAt(w) === 58) { // ':'
if (w = this.nsmatrix[name.substring(0, w)] ) {
res[w + name.substr(w)] = value;
};
continue aa;
// 'xml:base' ???
};
};
};
res[name] = value;
noValueAttribute = false;
};
if (!ok) {
return this.attr_res = true; // атрибутов нет, ошибок тоже нет
};
if (this.hasSurmiseNS) {
bb:
for (i = 0, l = attr_list.length; i < l; i++) {
name = attr_list[i++];
w = name.length;
while(--w) { // name.indexOf(':')
if (name.charCodeAt(w) === 58) { // ':'
if (w = this.nsmatrix[name.substring(0, w)]) {
res[w + name.substr(w)] = attr_list[i];
};
continue bb;
break;
};
};
res[name] = attr_list[i];
};
};
return this.attr_res = res;
};
// xml - string
EasySAXParser.prototype.parse = function(xml) {
var u
, xml = String(xml)
, nodestack = []
, stacknsmatrix = []
//, string_node
, elem
, tagend = false
, tagstart = false
, j = 0, i = 0, k = 0, len
, x, y, q, w
, xmlns
, stopIndex = 0
, stop // используется при разборе "namespace" . если встретился неизвестное пространство то события не генерируются
, _nsmatrix
, ok
, pos = 0, ln = 0, lnStart = -2, lnEnd = -1
;
len = xml.length;
function getStringNode() {
return xml.substring(i, j+1)
};
function findLineAndColumnFromPos() {
while (lnStart < lnEnd && lnEnd < pos) {
lnStart = lnEnd;
lnEnd = xml.indexOf("\n", lnEnd + 1);
++ln;
}
return { line: ln, column: pos - lnStart };
}
function position(p) {
pos = p;
return findLineAndColumnFromPos;
}
while(j !== -1) {
stop = stopIndex > 0;
if (xml.charCodeAt(j) === 60) { // "<"
i = j;
} else {
i = xml.indexOf('<', j);
};
if (i === -1) { // конец разбора
if (nodestack.length) {
this.onError('end file', position(j));
return;
};
return;
};
if (j !== i && !stop) {
ok = this.onTextNode(xml.substring(j, i), unEntities, position(j));
if (ok === false) return;
};
w = xml.charCodeAt(i+1);
if (w === 33) { // "!"
w = xml.charCodeAt(i+2);
if (w === 91 && xml.substr(i+3, 6) === 'CDATA[') { // 91 == "["
j = xml.indexOf(']]>', i);
if (j === -1) {
this.onError('cdata', position(i));
return;
};
//x = xml.substring(i+9, j);
if (!stop) {
ok = this.onCDATA(xml.substring(i+9, j), false, position(i));
if (ok === false) return;
};
j += 3;
continue;
};
if (w === 45 && xml.charCodeAt(i+3) === 45) { // 45 == "-"
j = xml.indexOf('-->', i);
if (j === -1) {
this.onError('expected -->', position(i));
return;
};
if (this.is_onComment && !stop) {
ok = this.onComment(xml.substring(i+4, j), unEntities, position(i));
if (ok === false) return;
};
j += 3;
continue;
};
j = xml.indexOf('>', i+1);
if (j === -1) {
this.onError('expected ">"', position(i + 1));
return;
};
if (this.is_onAttention && !stop) {
ok = this.onAttention(xml.substring(i, j+1), unEntities, position(i));
if (ok === false) return;
};
j += 1;
continue;
} else {
if (w === 63) { // "?"
j = xml.indexOf('?>', i);
if (j === -1) { // error
this.onError('...?>', position(i));
return;
};
if (this.is_onQuestion) {
ok = this.onQuestion(xml.substring(i, j+2), position(i));
if (ok === false) return;
};
j += 2;
continue;
};
};
var inside=false;
for (k=i,j=-1;k<len;k++) {
var c = xml.charCodeAt(k);
if (!inside) {
if (c === 34) { // '"'
inside = c;
}
else if (c === 39) { // "'"
inside = c;
}
else if (c === 62) { // <
j = k; break;
}
} else {
if (c === inside) { inside = false; }
}
}
if (j == -1) { // error
this.onError('...>', position(i + 1));
return;
};
this.attr_res = true; // атрибутов нет
//if (xml.charCodeAt(i+1) === 47) { // </...
if (w === 47) { // </...
tagstart = false;
tagend = true;
// проверяем что должен быть закрыт тотже тег что и открывался
x = elem = nodestack.pop();
q = i + 2 + x.length;
//console.log()
if (xml.substring(i+2, q) !== x) {
this.onError('close tagname', position(i + 2));
return;
};
// проверим что в закрываюшем теге нет лишнего
for(; q < j; q++) {
w = xml.charCodeAt(q);
if (w===32 || (w > 8 && w<14) ) { // \f\n\r\t\v пробел
continue;
};
this.onError('close tag', position(i + 2));
return;
};
} else {
if (xml.charCodeAt(j-1) === 47) { // .../>
x = elem = xml.substring(i+1, j-1);
tagstart = true;
tagend = true;
} else {
x = elem = xml.substring(i+1, j);
tagstart = true;
tagend = false;
};
if ( !(w > 96 && w < 123 || w > 64 && w <91) ) {
this.onError('first char nodeName', position(i + 1));
return;
};
for(q = 1, y = x.length; q < y; q++) {
w = x.charCodeAt(q);
if (w > 96 && w < 123 || w > 64 && w < 91 || w > 47 && w < 59 || w === 45 || w === 95 || w === 46 /* https://github.com/telerik/xPlatCore/issues/179 */) {
continue;
};
if (w===32 || (w<14 && w > 8)) { // \f\n\r\t\v пробел
elem = x.substring(0, q)
this.attr_res = null; // возможно есть атирибуты
break;
};
this.onError('invalid nodeName', position(i + 1));
return;
};
if (!tagend) {
nodestack.push(elem);
};
};
if (this.isNamespace) {
if (stop) {
if (tagend) {
if (!tagstart) {
if (--stopIndex === 0) {
this.nsmatrix = stacknsmatrix.pop();
};
};
} else {
stopIndex += 1;
};
j += 1;
continue;
};
_nsmatrix = this.nsmatrix;
if (!tagend) {
stacknsmatrix.push(this.nsmatrix);
if (this.attr_res !== true) {
if (this.hasSurmiseNS = x.indexOf('xmlns', q) !== -1) {
this.attr_string = x;
this.attr_posstart = q;
this.getAttrs();
this.hasSurmiseNS = false;
};
};
};
w = elem.indexOf(':');
if (w !== -1) {
xmlns = this.nsmatrix[elem.substring(0, w)];
elem = elem.substr(w+1);
} else {
xmlns = this.nsmatrix.xmlns;
};
if (!xmlns) {
if (tagend) {
if (tagstart) {
this.nsmatrix = _nsmatrix;
} else {
this.nsmatrix = stacknsmatrix.pop();
};
} else {
stopIndex = 1; // первый элемент для которого не определено пространство имен
this.attr_res = true;
};
j += 1;
continue;
};
elem = xmlns + ':' + elem;
};
//string_node = xml.substring(i, j+1); // текст ноды как есть
if (tagstart) { // is_onStartNode
this.attr_string = x;
this.attr_posstart = q;
var that = this;
ok = this.onStartNode(elem, function() { return that.getAttrs() }, unEntities, tagend
, getStringNode, position(i)
);
if (ok === false) {
return;
};
this.attr_res = true;
};
if (tagend) {
ok = this.onEndNode(elem, unEntities, tagstart
, getStringNode, position(i)
);
if (ok === false) {
return;
};
if (this.isNamespace) {
if (tagstart) {
this.nsmatrix = _nsmatrix;
} else {
this.nsmatrix = stacknsmatrix.pop();
};
};
};
j += 1;
};
};
/***/ }),
/***/ "../node_modules/tns-core-modules/js-libs/esprima/esprima.js":
/***/ (function(module, exports) {
/*
Copyright (C) 2013 Ariya Hidayat <[email protected]>
Copyright (C) 2013 Thaddee Tyl <[email protected]>
Copyright (C) 2012 Ariya Hidayat <[email protected]>
Copyright (C) 2012 Mathias Bynens <[email protected]>
Copyright (C) 2012 Joost-Wim Boekesteijn <[email protected]>
Copyright (C) 2012 Kris Kowal <[email protected]>
Copyright (C) 2012 Yusuke Suzuki <[email protected]>
Copyright (C) 2012 Arpad Borsos <[email protected]>
Copyright (C) 2011 Ariya Hidayat <[email protected]>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
(function (global) {
'use strict';
var Token,
TokenName,
Syntax,
Messages,
source,
index,
length,
delegate,
lookahead,
state;
Token = {
BooleanLiteral: 1,
EOF: 2,
Identifier: 3,
Keyword: 4,
NullLiteral: 5,
NumericLiteral: 6,
Punctuator: 7,
StringLiteral: 8
};
TokenName = {};
TokenName[Token.BooleanLiteral] = 'Boolean';
TokenName[Token.EOF] = '<end>';
TokenName[Token.Identifier] = 'Identifier';
TokenName[Token.Keyword] = 'Keyword';
TokenName[Token.NullLiteral] = 'Null';
TokenName[Token.NumericLiteral] = 'Numeric';
TokenName[Token.Punctuator] = 'Punctuator';
TokenName[Token.StringLiteral] = 'String';
Syntax = {
ArrayExpression: 'ArrayExpression',
BinaryExpression: 'BinaryExpression',
CallExpression: 'CallExpression',
ConditionalExpression: 'ConditionalExpression',
EmptyStatement: 'EmptyStatement',
ExpressionStatement: 'ExpressionStatement',
Identifier: 'Identifier',
Literal: 'Literal',
LabeledStatement: 'LabeledStatement',
LogicalExpression: 'LogicalExpression',
MemberExpression: 'MemberExpression',
ObjectExpression: 'ObjectExpression',
Program: 'Program',
Property: 'Property',
ThisExpression: 'ThisExpression',
UnaryExpression: 'UnaryExpression'
};
// Error messages should be identical to V8.
Messages = {
UnexpectedToken: 'Unexpected token %0',
UnknownLabel: 'Undefined label \'%0\'',
Redeclaration: '%0 \'%1\' has already been declared'
};
// Ensure the condition is true, otherwise throw an error.
// This is only to have a better contract semantic, i.e. another safety net
// to catch a logic error. The condition shall be fulfilled in normal case.
// Do NOT use this to enforce a certain condition on any user input.
function assert(condition, message) {
if (!condition) {
throw new Error('ASSERT: ' + message);
}
}
function isDecimalDigit(ch) {
return (ch >= 48 && ch <= 57); // 0..9
}
// 7.2 White Space
function isWhiteSpace(ch) {
return (ch === 32) || // space
(ch === 9) || // tab
(ch === 0xB) ||
(ch === 0xC) ||
(ch === 0xA0) ||
(ch >= 0x1680 && '\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\uFEFF'.indexOf(String.fromCharCode(ch)) > 0);
}
// 7.3 Line Terminators
function isLineTerminator(ch) {
return (ch === 10) || (ch === 13) || (ch === 0x2028) || (ch === 0x2029);
}
// 7.6 Identifier Names and Identifiers
function isIdentifierStart(ch) {
return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)
(ch >= 65 && ch <= 90) || // A..Z
(ch >= 97 && ch <= 122); // a..z
}
function isIdentifierPart(ch) {
return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)
(ch >= 65 && ch <= 90) || // A..Z
(ch >= 97 && ch <= 122) || // a..z
(ch >= 48 && ch <= 57); // 0..9
}
// 7.6.1.1 Keywords
function isKeyword(id) {
return (id === 'this')
}
// 7.4 Comments
function skipWhitespace() {
while (index < length && isWhiteSpace(source.charCodeAt(index))) {
++index;
}
}
function getIdentifier() {
var start, ch;
start = index++;
while (index < length) {
ch = source.charCodeAt(index);
if (isIdentifierPart(ch)) {
++index;
} else {
break;
}
}
return source.slice(start, index);
}
function scanIdentifier() {
var start, id, type;
start = index;
id = getIdentifier();
// There is no keyword or literal with only one character.
// Thus, it must be an identifier.
if (id.length === 1) {
type = Token.Identifier;
} else if (isKeyword(id)) {
type = Token.Keyword;
} else if (id === 'null') {
type = Token.NullLiteral;
} else if (id === 'true' || id === 'false') {
type = Token.BooleanLiteral;
} else {
type = Token.Identifier;
}
return {
type: type,
value: id,
range: [start, index]
};
}
// 7.7 Punctuators
function scanPunctuator() {
var start = index,
code = source.charCodeAt(index),
code2,
ch1 = source[index],
ch2;
switch (code) {
// Check for most common single-character punctuators.
case 46: // . dot
case 40: // ( open bracket
case 41: // ) close bracket
case 59: // ; semicolon
case 44: // , comma
case 123: // { open curly brace
case 125: // } close curly brace
case 91: // [
case 93: // ]
case 58: // :
case 63: // ?
++index;
return {
type: Token.Punctuator,
value: String.fromCharCode(code),
range: [start, index]
};
default:
code2 = source.charCodeAt(index + 1);
// '=' (char #61) marks an assignment or comparison operator.
if (code2 === 61) {
switch (code) {
case 37: // %
case 38: // &
case 42: // *:
case 43: // +
case 45: // -
case 47: // /
case 60: // <
case 62: // >
case 124: // |
index += 2;
return {
type: Token.Punctuator,
value: String.fromCharCode(code) + String.fromCharCode(code2),
range: [start, index]
};
case 33: // !
case 61: // =
index += 2;
// !== and ===
if (source.charCodeAt(index) === 61) {
++index;
}
return {
type: Token.Punctuator,
value: source.slice(start, index),
range: [start, index]
};
default:
break;
}
}
break;
}
// Peek more characters.
ch2 = source[index + 1];
// Other 2-character punctuators: && ||
if (ch1 === ch2 && ('&|'.indexOf(ch1) >= 0)) {
index += 2;
return {
type: Token.Punctuator,
value: ch1 + ch2,
range: [start, index]
};
}
if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {
++index;
return {
type: Token.Punctuator,
value: ch1,
range: [start, index]
};
}
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
// 7.8.3 Numeric Literals
function scanNumericLiteral() {
var number, start, ch;
ch = source[index];
assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),
'Numeric literal must start with a decimal digit or a decimal point');
start = index;
number = '';
if (ch !== '.') {
number = source[index++];
ch = source[index];
// Hex number starts with '0x'.
// Octal number starts with '0'.
if (number === '0') {
// decimal number starts with '0' such as '09' is illegal.
if (ch && isDecimalDigit(ch.charCodeAt(0))) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
}
while (isDecimalDigit(source.charCodeAt(index))) {
number += source[index++];
}
ch = source[index];
}
if (ch === '.') {
number += source[index++];
while (isDecimalDigit(source.charCodeAt(index))) {
number += source[index++];
}
ch = source[index];
}
if (ch === 'e' || ch === 'E') {
number += source[index++];
ch = source[index];
if (ch === '+' || ch === '-') {
number += source[index++];
}
if (isDecimalDigit(source.charCodeAt(index))) {
while (isDecimalDigit(source.charCodeAt(index))) {
number += source[index++];
}
} else {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
}
if (isIdentifierStart(source.charCodeAt(index))) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
return {
type: Token.NumericLiteral,
value: parseFloat(number),
range: [start, index]
};
}
// 7.8.4 String Literals
function scanStringLiteral() {
var str = '', quote, start, ch, octal = false;
quote = source[index];
assert((quote === '\'' || quote === '"'),
'String literal must starts with a quote');
start = index;
++index;
while (index < length) {
ch = source[index++];
if (ch === quote) {
quote = '';
break;
} else if (ch === '\\') {
ch = source[index++];
if (!ch || !isLineTerminator(ch.charCodeAt(0))) {
switch (ch) {
case 'n':
str += '\n';
break;
case 'r':
str += '\r';
break;
case 't':
str += '\t';
break;
case 'b':
str += '\b';
break;
case 'f':
str += '\f';
break;
case 'v':
str += '\x0B';
break;
default:
str += ch;
break;
}
} else {
if (ch === '\r' && source[index] === '\n') {
++index;
}
}
} else if (isLineTerminator(ch.charCodeAt(0))) {
break;
} else {
str += ch;
}
}
if (quote !== '') {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
return {
type: Token.StringLiteral,
value: str,
octal: octal,
range: [start, index]
};
}
function isIdentifierName(token) {
return token.type === Token.Identifier ||
token.type === Token.Keyword ||
token.type === Token.BooleanLiteral ||
token.type === Token.NullLiteral;
}
function advance() {
var ch;
skipWhitespace();
if (index >= length) {
return {
type: Token.EOF,
range: [index, index]
};
}
ch = source.charCodeAt(index);
// Very common: ( and ) and ;
if (ch === 40 || ch === 41 || ch === 58) {
return scanPunctuator();
}
// String literal starts with single quote (#39) or double quote (#34).
if (ch === 39 || ch === 34) {
return scanStringLiteral();
}
if (isIdentifierStart(ch)) {
return scanIdentifier();
}
// Dot (.) char #46 can also start a floating-point number, hence the need
// to check the next character.
if (ch === 46) {
if (isDecimalDigit(source.charCodeAt(index + 1))) {
return scanNumericLiteral();
}
return scanPunctuator();
}
if (isDecimalDigit(ch)) {
return scanNumericLiteral();
}
return scanPunctuator();
}
function lex() {
var token;
token = lookahead;
index = token.range[1];
lookahead = advance();
index = token.range[1];
return token;
}
function peek() {
var pos;
pos = index;
lookahead = advance();
index = pos;
}
// Throw an exception
function throwError(token, messageFormat) {
var error,
args = Array.prototype.slice.call(arguments, 2),
msg = messageFormat.replace(
/%(\d)/g,
function (whole, index) {
assert(index < args.length, 'Message reference must be in range');
return args[index];
}
);
error = new Error(msg);
error.index = index;
error.description = msg;
throw error;
}
// Throw an exception because of the token.
function throwUnexpected(token) {
throwError(token, Messages.UnexpectedToken, token.value);
}
// Expect the next token to match the specified punctuator.
// If not, an exception will be thrown.
function expect(value) {
var token = lex();
if (token.type !== Token.Punctuator || token.value !== value) {
throwUnexpected(token);
}
}
// Return true if the next token matches the specified punctuator.
function match(value) {
return lookahead.type === Token.Punctuator && lookahead.value === value;
}
// Return true if the next token matches the specified keyword
function matchKeyword(keyword) {
return lookahead.type === Token.Keyword && lookahead.value === keyword;
}
function consumeSemicolon() {
// Catch the very common case first: immediately a semicolon (char #59).
if (source.charCodeAt(index) === 59) {
lex();
return;
}
skipWhitespace();
if (match(';')) {
lex();
return;
}
if (lookahead.type !== Token.EOF && !match('}')) {
throwUnexpected(lookahead);
}
}
// 11.1.4 Array Initialiser
function parseArrayInitialiser() {
var elements = [];
expect('[');
while (!match(']')) {
if (match(',')) {
lex();
elements.push(null);
} else {
elements.push(parseExpression());
if (!match(']')) {
expect(',');
}
}
}
expect(']');
return delegate.createArrayExpression(elements);
}
// 11.1.5 Object Initialiser
function parseObjectPropertyKey() {
var token;
skipWhitespace();
token = lex();
// Note: This function is called only from parseObjectProperty(), where
// EOF and Punctuator tokens are already filtered out.
if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) {
return delegate.createLiteral(token);
}
return delegate.createIdentifier(token.value);
}
function parseObjectProperty() {
var token, key;
token = lookahead;
skipWhitespace();
if (token.type === Token.EOF || token.type === Token.Punctuator) {
throwUnexpected(token);
}
key = parseObjectPropertyKey();
expect(':');
return delegate.createProperty('init', key, parseExpression());
}
function parseObjectInitialiser() {
var properties = [];
expect('{');
while (!match('}')) {
properties.push(parseObjectProperty());
if (!match('}')) {
expect(',');
}
}
expect('}');
return delegate.createObjectExpression(properties);
}
// 11.1.6 The Grouping Operator
function parseGroupExpression() {
var expr;
expect('(');
expr = parseExpression();
expect(')');
return expr;
}
// 11.1 Primary Expressions
function parsePrimaryExpression() {
var type, token, expr;
if (match('(')) {
return parseGroupExpression();
}
type = lookahead.type;
if (type === Token.Identifier) {
expr = delegate.createIdentifier(lex().value);
} else if (type === Token.StringLiteral || type === Token.NumericLiteral) {
expr = delegate.createLiteral(lex());
} else if (type === Token.Keyword) {
if (matchKeyword('this')) {
lex();
expr = delegate.createThisExpression();
}
} else if (type === Token.BooleanLiteral) {
token = lex();
token.value = (token.value === 'true');
expr = delegate.createLiteral(token);
} else if (type === Token.NullLiteral) {
token = lex();
token.value = null;
expr = delegate.createLiteral(token);
} else if (match('[')) {
expr = parseArrayInitialiser();
} else if (match('{')) {
expr = parseObjectInitialiser();
}
if (expr) {
return expr;
}
throwUnexpected(lex());
}
// 11.2 Left-Hand-Side Expressions
function parseArguments() {
var args = [];
expect('(');
if (!match(')')) {
while (index < length) {
args.push(parseExpression());
if (match(')')) {
break;
}
expect(',');
}
}
expect(')');
return args;
}
function parseNonComputedProperty() {
var token;
token = lex();
if (!isIdentifierName(token)) {
throwUnexpected(token);
}
return delegate.createIdentifier(token.value);
}
function parseNonComputedMember() {
expect('.');
return parseNonComputedProperty();
}
function parseComputedMember() {
var expr;
expect('[');
expr = parseExpression();
expect(']');
return expr;
}
function parseLeftHandSideExpression() {
var expr, args, property;
expr = parsePrimaryExpression();
while (true) {
if (match('[')) {
property = parseComputedMember();
expr = delegate.createMemberExpression('[', expr, property);
} else if (match('.')) {
property = parseNonComputedMember();
expr = delegate.createMemberExpression('.', expr, property);
} else if (match('(')) {
args = parseArguments();
expr = delegate.createCallExpression(expr, args);
} else {
break;
}
}
return expr;
}
// 11.3 Postfix Expressions
var parsePostfixExpression = parseLeftHandSideExpression;
// 11.4 Unary Operators
function parseUnaryExpression() {
var token, expr;
if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {
expr = parsePostfixExpression();
} else if (match('+') || match('-') || match('!')) {
token = lex();
expr = parseUnaryExpression();
expr = delegate.createUnaryExpression(token.value, expr);
} else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {
throwError({}, Messages.UnexpectedToken);
} else {
expr = parsePostfixExpression();
}
return expr;
}
function binaryPrecedence(token) {
var prec = 0;
if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {
return 0;
}
switch (token.value) {
case '||':
prec = 1;
break;
case '&&':
prec = 2;
break;
case '==':
case '!=':
case '===':
case '!==':
prec = 6;
break;
case '<':
case '>':
case '<=':
case '>=':
case 'instanceof':
prec = 7;
break;
case 'in':
prec = 7;
break;
case '+':
case '-':
prec = 9;
break;
case '*':
case '/':
case '%':
prec = 11;
break;
default:
break;
}
return prec;
}
// 11.5 Multiplicative Operators
// 11.6 Additive Operators
// 11.7 Bitwise Shift Operators
// 11.8 Relational Operators
// 11.9 Equality Operators
// 11.10 Binary Bitwise Operators
// 11.11 Binary Logical Operators
function parseBinaryExpression() {
var expr, token, prec, stack, right, operator, left, i;
left = parseUnaryExpression();
token = lookahead;
prec = binaryPrecedence(token);
if (prec === 0) {
return left;
}
token.prec = prec;
lex();
right = parseUnaryExpression();
stack = [left, token, right];
while ((prec = binaryPrecedence(lookahead)) > 0) {
// Reduce: make a binary expression from the three topmost entries.
while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {
right = stack.pop();
operator = stack.pop().value;
left = stack.pop();
expr = delegate.createBinaryExpression(operator, left, right);
stack.push(expr);
}
// Shift.
token = lex();
token.prec = prec;
stack.push(token);
expr = parseUnaryExpression();
stack.push(expr);
}
// Final reduce to clean-up the stack.
i = stack.length - 1;
expr = stack[i];
while (i > 1) {
expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);
i -= 2;
}
return expr;
}
// 11.12 Conditional Operator
function parseConditionalExpression() {
var expr, consequent, alternate;
expr = parseBinaryExpression();
if (match('?')) {
lex();
consequent = parseConditionalExpression();
expect(':');
alternate = parseConditionalExpression();
expr = delegate.createConditionalExpression(expr, consequent, alternate);
}
return expr;
}
// Simplification since we do not support AssignmentExpression.
var parseExpression = parseConditionalExpression;
// Polymer Syntax extensions
// Filter ::
// Identifier
// Identifier "(" ")"
// Identifier "(" FilterArguments ")"
function parseFilter() {
var identifier, args;
identifier = lex();
if (identifier.type !== Token.Identifier) {
throwUnexpected(identifier);
}
args = match('(') ? parseArguments() : [];
return delegate.createFilter(identifier.value, args);
}
// Filters ::
// "|" Filter
// Filters "|" Filter
function parseFilters() {
while (match('|')) {
lex();
parseFilter();
}
}
// TopLevel ::
// LabelledExpressions
// AsExpression
// InExpression
// FilterExpression
// AsExpression ::
// FilterExpression as Identifier
// InExpression ::
// Identifier, Identifier in FilterExpression
// Identifier in FilterExpression
// FilterExpression ::
// Expression
// Expression Filters
function parseTopLevel() {
skipWhitespace();
peek();
var expr = parseExpression();
if (expr) {
if (lookahead.value === ',' || lookahead.value == 'in' &&
expr.type === Syntax.Identifier) {
parseInExpression(expr);
} else {
parseFilters();
if (lookahead.value === 'as') {
parseAsExpression(expr);
} else {
delegate.createTopLevel(expr);
}
}
}
if (lookahead.type !== Token.EOF) {
throwUnexpected(lookahead);
}
}
function parseAsExpression(expr) {
lex(); // as
var identifier = lex().value;
delegate.createAsExpression(expr, identifier);
}
function parseInExpression(identifier) {
var indexName;
if (lookahead.value === ',') {
lex();
if (lookahead.type !== Token.Identifier)
throwUnexpected(lookahead);
indexName = lex().value;
}
lex(); // in
var expr = parseExpression();
parseFilters();
delegate.createInExpression(identifier.name, indexName, expr);
}
function parse(code, inDelegate) {
delegate = inDelegate;
source = code;
index = 0;
length = source.length;
lookahead = null;
state = {
labelSet: {}
};
return parseTopLevel();
}
global.esprima = {
parse: parse
};
})(module.exports);
/***/ }),
/***/ "../node_modules/tns-core-modules/js-libs/polymer-expressions/path-parser.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/*
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
function detectEval() {
// Don't test for eval if we're running in a Chrome App environment.
// We check for APIs set that only exist in a Chrome App context.
if (typeof chrome !== 'undefined' && chrome.app && chrome.app.runtime) {
return false;
}
// Firefox OS Apps do not allow eval. This feature detection is very hacky
// but even if some other platform adds support for this function this code
// will continue to work.
if (typeof navigator != 'undefined' && navigator.getDeviceStorage) {
return false;
}
try {
var f = new Function('', 'return true;');
return f();
} catch (ex) {
return false;
}
}
var hasEval = detectEval();
function isIndex(s) {
return +s === s >>> 0 && s !== '';
}
function toNumber(s) {
return +s;
}
function isObject(obj) {
return obj === Object(obj);
}
var numberIsNaN = Number.isNaN || function (value) {
return typeof value === 'number' && isNaN(value);
}
function areSameValue(left, right) {
if (left === right)
return left !== 0 || 1 / left === 1 / right;
if (numberIsNaN(left) && numberIsNaN(right))
return true;
return left !== left && right !== right;
}
var createObject = ('__proto__' in {}) ?
function (obj) { return obj; } :
function (obj) {
var proto = obj.__proto__;
if (!proto)
return obj;
var newObject = Object.create(proto);
Object.getOwnPropertyNames(obj).forEach(function (name) {
Object.defineProperty(newObject, name,
Object.getOwnPropertyDescriptor(obj, name));
});
return newObject;
};
var identStart = '[\$_a-zA-Z]';
var identPart = '[\$_a-zA-Z0-9]';
var identRegExp = new RegExp('^' + identStart + '+' + identPart + '*' + '$');
function getPathCharType(char) {
if (char === undefined)
return 'eof';
var code = char.charCodeAt(0);
switch (code) {
case 0x5B: // [
case 0x5D: // ]
case 0x2E: // .
case 0x22: // "
case 0x27: // '
case 0x30: // 0
return char;
case 0x5F: // _
case 0x24: // $
return 'ident';
case 0x20: // Space
case 0x09: // Tab
case 0x0A: // Newline
case 0x0D: // Return
case 0xA0: // No-break space
case 0xFEFF: // Byte Order Mark
case 0x2028: // Line Separator
case 0x2029: // Paragraph Separator
return 'ws';
}
// a-z, A-Z
if ((0x61 <= code && code <= 0x7A) || (0x41 <= code && code <= 0x5A))
return 'ident';
// 1-9
if (0x31 <= code && code <= 0x39)
return 'number';
return 'else';
}
var pathStateMachine = {
'beforePath': {
'ws': ['beforePath'],
'ident': ['inIdent', 'append'],
'[': ['beforeElement'],
'eof': ['afterPath']
},
'inPath': {
'ws': ['inPath'],
'.': ['beforeIdent'],
'[': ['beforeElement'],
'eof': ['afterPath']
},
'beforeIdent': {
'ws': ['beforeIdent'],
'ident': ['inIdent', 'append']
},
'inIdent': {
'ident': ['inIdent', 'append'],
'0': ['inIdent', 'append'],
'number': ['inIdent', 'append'],
'ws': ['inPath', 'push'],
'.': ['beforeIdent', 'push'],
'[': ['beforeElement', 'push'],
'eof': ['afterPath', 'push']
},
'beforeElement': {
'ws': ['beforeElement'],
'0': ['afterZero', 'append'],
'number': ['inIndex', 'append'],
"'": ['inSingleQuote', 'append', ''],
'"': ['inDoubleQuote', 'append', '']
},
'afterZero': {
'ws': ['afterElement', 'push'],
']': ['inPath', 'push']
},
'inIndex': {
'0': ['inIndex', 'append'],
'number': ['inIndex', 'append'],
'ws': ['afterElement'],
']': ['inPath', 'push']
},
'inSingleQuote': {
"'": ['afterElement'],
'eof': ['error'],
'else': ['inSingleQuote', 'append']
},
'inDoubleQuote': {
'"': ['afterElement'],
'eof': ['error'],
'else': ['inDoubleQuote', 'append']
},
'afterElement': {
'ws': ['afterElement'],
']': ['inPath', 'push']
}
}
function noop() { }
function parsePath(path) {
var keys = [];
var index = -1;
var c, newChar, key, type, transition, action, typeMap, mode = 'beforePath';
var actions = {
push: function () {
if (key === undefined)
return;
keys.push(key);
key = undefined;
},
append: function () {
if (key === undefined)
key = newChar
else
key += newChar;
}
};
function maybeUnescapeQuote() {
if (index >= path.length)
return;
var nextChar = path[index + 1];
if ((mode == 'inSingleQuote' && nextChar == "'") ||
(mode == 'inDoubleQuote' && nextChar == '"')) {
index++;
newChar = nextChar;
actions.append();
return true;
}
}
while (mode) {
index++;
c = path[index];
if (c == '\\' && maybeUnescapeQuote(mode))
continue;
type = getPathCharType(c);
typeMap = pathStateMachine[mode];
transition = typeMap[type] || typeMap['else'] || 'error';
if (transition == 'error')
return; // parse error;
mode = transition[0];
action = actions[transition[1]] || noop;
newChar = transition[2] === undefined ? c : transition[2];
action();
if (mode === 'afterPath') {
return keys;
}
}
return; // parse error
}
function isIdent(s) {
return identRegExp.test(s);
}
var constructorIsPrivate = {};
function Path(parts, privateToken) {
if (privateToken !== constructorIsPrivate)
throw Error('Use Path.get to retrieve path objects');
for (var i = 0; i < parts.length; i++) {
this.push(String(parts[i]));
}
if (hasEval && this.length) {
this.getValueFrom = this.compiledGetValueFromFn();
}
}
// TODO(rafaelw): Make simple LRU cache
var pathCache = {};
function getPath(pathString) {
if (pathString instanceof Path)
return pathString;
if (pathString == null || pathString.length == 0)
pathString = '';
if (typeof pathString != 'string') {
if (isIndex(pathString.length)) {
// Constructed with array-like (pre-parsed) keys
return new Path(pathString, constructorIsPrivate);
}
pathString = String(pathString);
}
var path = pathCache[pathString];
if (path)
return path;
var parts = parsePath(pathString);
if (!parts)
return invalidPath;
var path = new Path(parts, constructorIsPrivate);
pathCache[pathString] = path;
return path;
}
Path.get = getPath;
function formatAccessor(key) {
if (isIndex(key)) {
return '[' + key + ']';
} else {
return '["' + key.replace(/"/g, '\\"') + '"]';
}
}
Path.prototype = createObject({
__proto__: [],
valid: true,
toString: function () {
var pathString = '';
for (var i = 0; i < this.length; i++) {
var key = this[i];
if (isIdent(key)) {
pathString += i ? '.' + key : key;
} else {
pathString += formatAccessor(key);
}
}
return pathString;
},
getValueFrom: function (obj, directObserver) {
for (var i = 0; i < this.length; i++) {
if (obj == null)
return;
obj = obj[this[i]];
}
return obj;
},
iterateObjects: function (obj, observe) {
for (var i = 0; i < this.length; i++) {
if (i)
obj = obj[this[i - 1]];
if (!isObject(obj))
return;
observe(obj, this[i]);
}
},
compiledGetValueFromFn: function () {
var str = '';
var pathString = 'obj';
str += 'if (obj != null';
var i = 0;
var key;
for (; i < (this.length - 1) ; i++) {
key = this[i];
pathString += isIdent(key) ? '.' + key : formatAccessor(key);
str += ' &&\n ' + pathString + ' != null';
}
str += ')\n';
var key = this[i];
pathString += isIdent(key) ? '.' + key : formatAccessor(key);
str += ' return ' + pathString + ';\nelse\n return undefined;';
return new Function('obj', str);
},
setValueFrom: function (obj, value) {
if (!this.length)
return false;
for (var i = 0; i < this.length - 1; i++) {
if (!isObject(obj))
return false;
obj = obj[this[i]];
}
if (!isObject(obj))
return false;
obj[this[i]] = value;
return true;
}
});
var invalidPath = new Path('', constructorIsPrivate);
invalidPath.valid = false;
invalidPath.getValueFrom = invalidPath.setValueFrom = function () { };
exports.Path = Path;
/***/ }),
/***/ "../node_modules/tns-core-modules/js-libs/polymer-expressions/polymer-expressions.js":
/***/ (function(module, exports, __webpack_require__) {
// Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
// This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
// The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
// The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
// Code distributed by Google as part of the polymer project is also
// subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
var esprima = __webpack_require__("../node_modules/tns-core-modules/js-libs/esprima/esprima.js").esprima;
var Path = __webpack_require__("../node_modules/tns-core-modules/js-libs/polymer-expressions/path-parser.js").Path;
(function (global) {
'use strict';
// TODO(rafaelw): Implement simple LRU.
var expressionParseCache = Object.create(null);
function getExpression(expressionText) {
var expression = expressionParseCache[expressionText];
if (!expression) {
var delegate = new ASTDelegate();
esprima.parse(expressionText, delegate);
expression = new Expression(delegate);
expressionParseCache[expressionText] = expression;
}
return expression;
}
function Literal(value) {
this.value = value;
this.valueFn_ = undefined;
}
Literal.prototype = {
valueFn: function () {
if (!this.valueFn_) {
var value = this.value;
this.valueFn_ = function () {
return value;
}
}
return this.valueFn_;
}
}
function IdentPath(name) {
this.name = name;
this.path = Path.get(name);
}
IdentPath.prototype = {
valueFn: function () {
if (!this.valueFn_) {
var name = this.name;
var path = this.path;
this.valueFn_ = function (model, observer, changedModel) {
if (observer)
observer.addPath(model, path);
if (changedModel) {
var result = path.getValueFrom(changedModel);
if (result !== undefined) {
return result;
}
}
return path.getValueFrom(model);
}
}
return this.valueFn_;
},
setValue: function (model, newValue) {
if (this.path.length == 1) {
model = findScope(model, this.path[0]);
}
return this.path.setValueFrom(model, newValue);
}
};
function MemberExpression(object, property, accessor) {
this.computed = accessor == '[';
this.dynamicDeps = typeof object == 'function' ||
object.dynamicDeps ||
(this.computed && !(property instanceof Literal));
this.simplePath =
!this.dynamicDeps &&
(property instanceof IdentPath || property instanceof Literal) &&
(object instanceof MemberExpression || object instanceof IdentPath);
this.object = this.simplePath ? object : getFn(object);
this.property = !this.computed || this.simplePath ?
property : getFn(property);
}
MemberExpression.prototype = {
get fullPath() {
if (!this.fullPath_) {
var parts = this.object instanceof MemberExpression ?
this.object.fullPath.slice() : [this.object.name];
parts.push(this.property instanceof IdentPath ?
this.property.name : this.property.value);
this.fullPath_ = Path.get(parts);
}
return this.fullPath_;
},
valueFn: function () {
if (!this.valueFn_) {
var object = this.object;
if (this.simplePath) {
var path = this.fullPath;
this.valueFn_ = function (model, observer) {
if (observer)
observer.addPath(model, path);
return path.getValueFrom(model);
};
} else if (!this.computed) {
var path = Path.get(this.property.name);
this.valueFn_ = function (model, observer, filterRegistry) {
var context = object(model, observer, filterRegistry);
if (observer)
observer.addPath(context, path);
return path.getValueFrom(context);
}
} else {
// Computed property.
var property = this.property;
this.valueFn_ = function (model, observer, filterRegistry) {
var context = object(model, observer, filterRegistry);
var propName = property(model, observer, filterRegistry);
if (observer)
observer.addPath(context, [propName]);
return context ? context[propName] : undefined;
};
}
}
return this.valueFn_;
},
setValue: function (model, newValue) {
if (this.simplePath) {
this.fullPath.setValueFrom(model, newValue);
return newValue;
}
var object = this.object(model);
var propName = this.property instanceof IdentPath ? this.property.name :
this.property(model);
return object[propName] = newValue;
}
};
function Filter(name, args) {
this.name = name;
this.args = [];
for (var i = 0; i < args.length; i++) {
this.args[i] = getFn(args[i]);
}
}
Filter.prototype = {
transform: function (model, observer, filterRegistry, toModelDirection,
initialArgs) {
var fn = filterRegistry[this.name];
var context = model;
if (fn) {
context = undefined;
} else {
fn = context[this.name];
if (!fn) {
console.error('Cannot find function or filter: ' + this.name);
return;
}
}
// If toModelDirection is falsey, then the "normal" (dom-bound) direction
// is used. Otherwise, it looks for a 'toModel' property function on the
// object.
if (toModelDirection) {
fn = fn.toModel;
} else if (typeof fn.toView == 'function') {
fn = fn.toView;
}
if (typeof fn != 'function') {
console.error('Cannot find function or filter: ' + this.name);
return;
}
var args = initialArgs || [];
for (var i = 0; i < this.args.length; i++) {
args.push(getFn(this.args[i])(model, observer, filterRegistry));
}
return fn.apply(context, args);
}
};
function notImplemented() { throw Error('Not Implemented'); }
var unaryOperators = {
'+': function (v) { return +v; },
'-': function (v) { return -v; },
'!': function (v) { return !v; }
};
var binaryOperators = {
'+': function (l, r) { return l + r; },
'-': function (l, r) { return l - r; },
'*': function (l, r) { return l * r; },
'/': function (l, r) { return l / r; },
'%': function (l, r) { return l % r; },
'<': function (l, r) { return l < r; },
'>': function (l, r) { return l > r; },
'<=': function (l, r) { return l <= r; },
'>=': function (l, r) { return l >= r; },
'==': function (l, r) { return l == r; },
'!=': function (l, r) { return l != r; },
'===': function (l, r) { return l === r; },
'!==': function (l, r) { return l !== r; },
'&&': function (l, r) { return l && r; },
'||': function (l, r) { return l || r; },
};
function getFn(arg) {
return typeof arg == 'function' ? arg : arg.valueFn();
}
function ASTDelegate() {
this.expression = null;
this.filters = [];
this.deps = {};
this.currentPath = undefined;
this.scopeIdent = undefined;
this.indexIdent = undefined;
this.dynamicDeps = false;
}
ASTDelegate.prototype = {
createUnaryExpression: function (op, argument) {
if (!unaryOperators[op])
throw Error('Disallowed operator: ' + op);
argument = getFn(argument);
return function (model, observer, filterRegistry) {
return unaryOperators[op](argument(model, observer, filterRegistry));
};
},
createBinaryExpression: function (op, left, right) {
if (!binaryOperators[op])
throw Error('Disallowed operator: ' + op);
left = getFn(left);
right = getFn(right);
switch (op) {
case '||':
this.dynamicDeps = true;
return function (model, observer, filterRegistry) {
return left(model, observer, filterRegistry) ||
right(model, observer, filterRegistry);
};
case '&&':
this.dynamicDeps = true;
return function (model, observer, filterRegistry) {
return left(model, observer, filterRegistry) &&
right(model, observer, filterRegistry);
};
}
return function (model, observer, filterRegistry) {
return binaryOperators[op](left(model, observer, filterRegistry),
right(model, observer, filterRegistry));
};
},
createConditionalExpression: function (test, consequent, alternate) {
test = getFn(test);
consequent = getFn(consequent);
alternate = getFn(alternate);
this.dynamicDeps = true;
return function (model, observer, filterRegistry) {
return test(model, observer, filterRegistry) ?
consequent(model, observer, filterRegistry) :
alternate(model, observer, filterRegistry);
}
},
createIdentifier: function (name) {
var ident = new IdentPath(name);
ident.type = 'Identifier';
return ident;
},
createMemberExpression: function (accessor, object, property) {
var ex = new MemberExpression(object, property, accessor);
if (ex.dynamicDeps)
this.dynamicDeps = true;
return ex;
},
createCallExpression: function (expression, args) {
if (!(expression instanceof IdentPath))
throw Error('Only identifier function invocations are allowed');
var filter = new Filter(expression.name, args);
return function (model, observer, filterRegistry) {
return filter.transform(model, observer, filterRegistry, false);
};
},
createLiteral: function (token) {
return new Literal(token.value);
},
createArrayExpression: function (elements) {
for (var i = 0; i < elements.length; i++)
elements[i] = getFn(elements[i]);
return function (model, observer, filterRegistry) {
var arr = []
for (var i = 0; i < elements.length; i++)
arr.push(elements[i](model, observer, filterRegistry));
return arr;
}
},
createProperty: function (kind, key, value) {
return {
key: key instanceof IdentPath ? key.name : key.value,
value: value
};
},
createObjectExpression: function (properties) {
for (var i = 0; i < properties.length; i++)
properties[i].value = getFn(properties[i].value);
return function (model, observer, filterRegistry) {
var obj = {};
for (var i = 0; i < properties.length; i++)
obj[properties[i].key] =
properties[i].value(model, observer, filterRegistry);
return obj;
}
},
createFilter: function (name, args) {
this.filters.push(new Filter(name, args));
},
createAsExpression: function (expression, scopeIdent) {
this.expression = expression;
this.scopeIdent = scopeIdent;
},
createInExpression: function (scopeIdent, indexIdent, expression) {
this.expression = expression;
this.scopeIdent = scopeIdent;
this.indexIdent = indexIdent;
},
createTopLevel: function (expression) {
this.expression = expression;
},
createThisExpression: notImplemented
}
function Expression(delegate) {
this.scopeIdent = delegate.scopeIdent;
this.indexIdent = delegate.indexIdent;
if (!delegate.expression)
throw Error('No expression found.');
this.expression = delegate.expression;
getFn(this.expression); // forces enumeration of path dependencies
this.filters = delegate.filters;
this.dynamicDeps = delegate.dynamicDeps;
}
Expression.prototype = {
getValue: function (model, isBackConvert, changedModel, observer) {
var value = getFn(this.expression)(model.context, observer, changedModel);
for (var i = 0; i < this.filters.length; i++) {
value = this.filters[i].transform(model.context, observer, model.context, isBackConvert, [value]);
}
return value;
},
setValue: function (model, newValue, filterRegistry) {
var count = this.filters ? this.filters.length : 0;
while (count-- > 0) {
newValue = this.filters[count].transform(model, undefined,
filterRegistry, true, [newValue]);
}
if (this.expression.setValue)
return this.expression.setValue(model, newValue);
}
}
/**
* Converts a style property name to a css property name. For example:
* "WebkitUserSelect" to "-webkit-user-select"
*/
function convertStylePropertyName(name) {
return String(name).replace(/[A-Z]/g, function (c) {
return '-' + c.toLowerCase();
});
}
var parentScopeName = '@' + Math.random().toString(36).slice(2);
// Single ident paths must bind directly to the appropriate scope object.
// I.e. Pushed values in two-bindings need to be assigned to the actual model
// object.
function findScope(model, prop) {
while (model[parentScopeName] &&
!Object.prototype.hasOwnProperty.call(model, prop)) {
model = model[parentScopeName];
}
return model;
}
function isLiteralExpression(pathString) {
switch (pathString) {
case '':
return false;
case 'false':
case 'null':
case 'true':
return true;
}
if (!isNaN(Number(pathString)))
return true;
return false;
};
function PolymerExpressions() { }
PolymerExpressions.prototype = {
// "built-in" filters
styleObject: function (value) {
var parts = [];
for (var key in value) {
parts.push(convertStylePropertyName(key) + ': ' + value[key]);
}
return parts.join('; ');
},
tokenList: function (value) {
var tokens = [];
for (var key in value) {
if (value[key])
tokens.push(key);
}
return tokens.join(' ');
},
// binding delegate API
prepareInstancePositionChanged: function (template) {
var indexIdent = template.polymerExpressionIndexIdent_;
if (!indexIdent)
return;
return function (templateInstance, index) {
templateInstance.model[indexIdent] = index;
};
},
prepareInstanceModel: function (template) {
var scopeName = template.polymerExpressionScopeIdent_;
if (!scopeName)
return;
var parentScope = template.templateInstance ?
template.templateInstance.model :
template.model;
var indexName = template.polymerExpressionIndexIdent_;
return function (model) {
return createScopeObject(parentScope, model, scopeName, indexName);
};
}
};
var createScopeObject = ('__proto__' in {}) ?
function (parentScope, model, scopeName, indexName) {
var scope = {};
scope[scopeName] = model;
scope[indexName] = undefined;
scope[parentScopeName] = parentScope;
scope.__proto__ = parentScope;
return scope;
} :
function (parentScope, model, scopeName, indexName) {
var scope = Object.create(parentScope);
Object.defineProperty(scope, scopeName,
{ value: model, configurable: true, writable: true });
Object.defineProperty(scope, indexName,
{ value: undefined, configurable: true, writable: true });
Object.defineProperty(scope, parentScopeName,
{ value: parentScope, configurable: true, writable: true });
return scope;
};
global.PolymerExpressions = PolymerExpressions;
PolymerExpressions.getExpression = getExpression;
})(module.exports);
/***/ }),
/***/ "../node_modules/tns-core-modules/matrix/matrix.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var number_utils_1 = __webpack_require__("../node_modules/tns-core-modules/utils/number-utils.js");
exports.getTransformMatrix = function (_a) {
var property = _a.property, value = _a.value;
return TRANSFORM_MATRIXES[property](value);
};
var TRANSFORM_MATRIXES = {
"scale": function (_a) {
var x = _a.x, y = _a.y;
return [
x, 0, 0,
0, y, 0,
0, 0, 1,
];
},
"translate": function (_a) {
var x = _a.x, y = _a.y;
return [
1, 0, x,
0, 1, y,
0, 0, 1,
];
},
"rotate": function (angleInDeg) {
var angleInRad = number_utils_1.degreesToRadians(angleInDeg);
return [
Math.cos(angleInRad), -Math.sin(angleInRad), 0,
Math.sin(angleInRad), Math.cos(angleInRad), 0,
0, 0, 1,
];
},
};
exports.matrixArrayToCssMatrix = function (m) { return [
m[0], m[3], m[1],
m[4], m[2], m[5],
]; };
function multiplyAffine2d(m1, m2) {
return [
m1[0] * m2[0] + m1[1] * m2[3],
m1[0] * m2[1] + m1[1] * m2[4],
m1[0] * m2[2] + m1[1] * m2[5] + m1[2],
m1[3] * m2[0] + m1[4] * m2[3],
m1[3] * m2[1] + m1[4] * m2[4],
m1[3] * m2[2] + m1[4] * m2[5] + m1[5]
];
}
exports.multiplyAffine2d = multiplyAffine2d;
function decompose2DTransformMatrix(matrix) {
verifyTransformMatrix(matrix);
var _a = matrix.slice(), A = _a[0], B = _a[1], C = _a[2], D = _a[3], E = _a[4], F = _a[5];
var determinant = A * D - B * C;
var translate = { x: E || 0, y: F || 0 };
var rotate = 0;
var scale = { x: 1, y: 1 };
if (A || B) {
var R = Math.sqrt(A * A + B * B);
rotate = B > 0 ? Math.acos(A / R) : -Math.acos(A / R);
scale = { x: R, y: determinant / R };
}
else if (C || D) {
var R = Math.sqrt(C * C + D * D);
rotate = Math.PI / 2 - (D > 0 ? Math.acos(-C / R) : -Math.acos(C / R));
scale = { x: determinant / R, y: R };
}
rotate = number_utils_1.radiansToDegrees(rotate);
return { translate: translate, rotate: rotate, scale: scale };
}
exports.decompose2DTransformMatrix = decompose2DTransformMatrix;
function verifyTransformMatrix(matrix) {
if (matrix.length < 6) {
throw new Error("Transform matrix should be 2x3.");
}
}
//# sourceMappingURL=matrix.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/platform/platform.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var appModule = __webpack_require__("../node_modules/tns-core-modules/application/application.js");
var MIN_TABLET_PIXELS = 600;
var platformNames;
(function (platformNames) {
platformNames.android = "Android";
platformNames.ios = "iOS";
})(platformNames = exports.platformNames || (exports.platformNames = {}));
var Device = (function () {
function Device() {
}
Object.defineProperty(Device.prototype, "os", {
get: function () {
return platformNames.android;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Device.prototype, "manufacturer", {
get: function () {
if (!this._manufacturer) {
this._manufacturer = android.os.Build.MANUFACTURER;
}
return this._manufacturer;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Device.prototype, "osVersion", {
get: function () {
if (!this._osVersion) {
this._osVersion = android.os.Build.VERSION.RELEASE;
}
return this._osVersion;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Device.prototype, "model", {
get: function () {
if (!this._model) {
this._model = android.os.Build.MODEL;
}
return this._model;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Device.prototype, "sdkVersion", {
get: function () {
if (!this._sdkVersion) {
this._sdkVersion = android.os.Build.VERSION.SDK;
}
return this._sdkVersion;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Device.prototype, "deviceType", {
get: function () {
if (!this._deviceType) {
var dips = Math.min(screen.mainScreen.widthPixels, screen.mainScreen.heightPixels) / screen.mainScreen.scale;
if (dips >= MIN_TABLET_PIXELS) {
this._deviceType = "Tablet";
}
else {
this._deviceType = "Phone";
}
}
return this._deviceType;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Device.prototype, "uuid", {
get: function () {
if (!this._uuid) {
var nativeApp = appModule.android.nativeApp;
this._uuid = android.provider.Settings.Secure.getString(nativeApp.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
}
return this._uuid;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Device.prototype, "language", {
get: function () {
if (!this._language) {
this._language = java.util.Locale.getDefault().getLanguage().replace("_", "-");
}
return this._language;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Device.prototype, "region", {
get: function () {
if (!this._region) {
this._region = java.util.Locale.getDefault().getCountry();
}
return this._region;
},
enumerable: true,
configurable: true
});
return Device;
}());
var MainScreen = (function () {
function MainScreen() {
}
MainScreen.prototype.reinitMetrics = function () {
if (!this._metrics) {
this._metrics = new android.util.DisplayMetrics();
}
this.initMetrics();
};
MainScreen.prototype.initMetrics = function () {
var nativeApp = appModule.getNativeApplication();
nativeApp.getSystemService(android.content.Context.WINDOW_SERVICE).getDefaultDisplay().getRealMetrics(this._metrics);
};
Object.defineProperty(MainScreen.prototype, "metrics", {
get: function () {
if (!this._metrics) {
appModule.on("cssChanged", this.reinitMetrics, this);
appModule.on(appModule.orientationChangedEvent, this.reinitMetrics, this);
this._metrics = new android.util.DisplayMetrics();
this.initMetrics();
}
return this._metrics;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MainScreen.prototype, "widthPixels", {
get: function () {
return this.metrics.widthPixels;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MainScreen.prototype, "heightPixels", {
get: function () {
return this.metrics.heightPixels;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MainScreen.prototype, "scale", {
get: function () {
return this.metrics.density;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MainScreen.prototype, "widthDIPs", {
get: function () {
return this.metrics.widthPixels / this.metrics.density;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MainScreen.prototype, "heightDIPs", {
get: function () {
return this.metrics.heightPixels / this.metrics.density;
},
enumerable: true,
configurable: true
});
return MainScreen;
}());
exports.device = new Device();
var screen;
(function (screen) {
screen.mainScreen = new MainScreen();
})(screen = exports.screen || (exports.screen = {}));
exports.isAndroid = true;
//# sourceMappingURL=platform.android.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/profiling/profiling.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
function uptime() {
return global.android ? org.nativescript.Process.getUpTime() : global.__tns_uptime();
}
exports.uptime = uptime;
function log(message) {
if (global.__nslog) {
global.__nslog("CONSOLE LOG: " + message);
}
console.log(message);
}
exports.log = log;
var timers = {};
var anyGlobal = global;
var profileNames = [];
exports.time = global.__time || Date.now;
function start(name) {
var info = timers[name];
if (info) {
info.currentStart = exports.time();
info.runCount++;
}
else {
info = {
totalTime: 0,
count: 0,
currentStart: exports.time(),
runCount: 1
};
timers[name] = info;
profileNames.push(name);
}
}
exports.start = start;
function stop(name) {
var info = timers[name];
if (!info) {
throw new Error("No timer started: " + name);
}
if (info.runCount) {
info.runCount--;
if (info.runCount) {
info.count++;
}
else {
info.lastTime = exports.time() - info.currentStart;
info.totalTime += info.lastTime;
info.count++;
info.currentStart = 0;
}
}
else {
throw new Error("Timer " + name + " paused more times than started.");
}
return info;
}
exports.stop = stop;
function timer(name) {
return timers[name];
}
exports.timer = timer;
function print(name) {
var info = timers[name];
if (!info) {
throw new Error("No timer started: " + name);
}
console.log("---- [" + name + "] STOP total: " + info.totalTime + " count:" + info.count);
return info;
}
exports.print = print;
function isRunning(name) {
var info = timers[name];
return !!(info && info.runCount);
}
exports.isRunning = isRunning;
function countersProfileFunctionFactory(fn, name, type) {
if (type === void 0) { type = 1; }
profileNames.push(name);
return function () {
start(name);
try {
return fn.apply(this, arguments);
}
finally {
stop(name);
}
};
}
function timelineProfileFunctionFactory(fn, name, type) {
if (type === void 0) { type = 1; }
return type === 1 ? function () {
var start = exports.time();
try {
return fn.apply(this, arguments);
}
finally {
var end = exports.time();
console.log("Timeline: Modules: " + name + " " + this + " (" + start + "ms. - " + end + "ms.)");
}
} : function () {
var start = exports.time();
try {
return fn.apply(this, arguments);
}
finally {
var end = exports.time();
console.log("Timeline: Modules: " + name + " (" + start + "ms. - " + end + "ms.)");
}
};
}
var Level;
(function (Level) {
Level[Level["none"] = 0] = "none";
Level[Level["lifecycle"] = 1] = "lifecycle";
Level[Level["timeline"] = 2] = "timeline";
})(Level = exports.Level || (exports.Level = {}));
var tracingLevel = Level.none;
var profileFunctionFactory;
function enable(mode) {
if (mode === void 0) { mode = "counters"; }
profileFunctionFactory = mode && {
counters: countersProfileFunctionFactory,
timeline: timelineProfileFunctionFactory
}[mode];
tracingLevel = {
lifecycle: Level.lifecycle,
timeline: Level.timeline,
}[mode] || Level.none;
}
exports.enable = enable;
try {
var appConfig = __webpack_require__("./package.json");
if (appConfig && appConfig.profiling) {
enable(appConfig.profiling);
}
}
catch (e1) {
try {
console.log("Profiling startup failed to figure out defaults from package.json, error: " + e1);
}
catch (e2) {
}
}
function disable() {
profileFunctionFactory = undefined;
}
exports.disable = disable;
function profileFunction(fn, customName) {
return profileFunctionFactory(fn, customName || fn.name);
}
var profileMethodUnnamed = function (target, key, descriptor) {
if (descriptor === undefined) {
descriptor = Object.getOwnPropertyDescriptor(target, key);
}
var originalMethod = descriptor.value;
var className = "";
if (target && target.constructor && target.constructor.name) {
className = target.constructor.name + ".";
}
var name = className + key;
descriptor.value = profileFunctionFactory(originalMethod, name, 1);
return descriptor;
};
var profileStaticMethodUnnamed = function (ctor, key, descriptor) {
if (descriptor === undefined) {
descriptor = Object.getOwnPropertyDescriptor(ctor, key);
}
var originalMethod = descriptor.value;
var className = "";
if (ctor && ctor.name) {
className = ctor.name + ".";
}
var name = className + key;
descriptor.value = profileFunctionFactory(originalMethod, name, 0);
return descriptor;
};
function profileMethodNamed(name) {
return function (target, key, descriptor) {
if (descriptor === undefined) {
descriptor = Object.getOwnPropertyDescriptor(target, key);
}
var originalMethod = descriptor.value;
descriptor.value = profileFunctionFactory(originalMethod, name);
return descriptor;
};
}
var voidMethodDecorator = function () {
};
function profile(nameFnOrTarget, fnOrKey, descriptor) {
if (typeof nameFnOrTarget === "object" && (typeof fnOrKey === "string" || typeof fnOrKey === "symbol")) {
if (!profileFunctionFactory) {
return;
}
return profileMethodUnnamed(nameFnOrTarget, fnOrKey, descriptor);
}
else if (typeof nameFnOrTarget === "function" && (typeof fnOrKey === "string" || typeof fnOrKey === "symbol")) {
if (!profileFunctionFactory) {
return;
}
return profileStaticMethodUnnamed(nameFnOrTarget, fnOrKey, descriptor);
}
else if (typeof nameFnOrTarget === "string" && typeof fnOrKey === "function") {
if (!profileFunctionFactory) {
return fnOrKey;
}
return profileFunction(fnOrKey, nameFnOrTarget);
}
else if (typeof nameFnOrTarget === "function") {
if (!profileFunctionFactory) {
return nameFnOrTarget;
}
return profileFunction(nameFnOrTarget);
}
else if (typeof nameFnOrTarget === "string") {
if (!profileFunctionFactory) {
return voidMethodDecorator;
}
return profileMethodNamed(nameFnOrTarget);
}
else {
if (!profileFunctionFactory) {
return voidMethodDecorator;
}
return profileMethodUnnamed;
}
}
exports.profile = profile;
function dumpProfiles() {
profileNames.forEach(function (name) {
var info = timers[name];
if (info) {
console.log("---- [" + name + "] STOP total: " + info.totalTime + " count:" + info.count);
}
else {
console.log("---- [" + name + "] Never called");
}
});
}
exports.dumpProfiles = dumpProfiles;
function resetProfiles() {
profileNames.forEach(function (name) {
var info = timers[name];
if (info) {
if (info.runCount) {
console.log("---- timer with name [" + name + "] is currently running and won't be reset");
}
else {
timers[name] = undefined;
}
}
});
}
exports.resetProfiles = resetProfiles;
function startCPUProfile(name) {
if (anyGlobal.android) {
__startCPUProfiler(name);
}
}
exports.startCPUProfile = startCPUProfile;
function stopCPUProfile(name) {
if (anyGlobal.android) {
__stopCPUProfiler(name);
}
}
exports.stopCPUProfile = stopCPUProfile;
function level() {
return tracingLevel;
}
exports.level = level;
function trace(message, start, end) {
log("Timeline: Modules: " + message + " (" + start + "ms. - " + end + "ms.)");
}
exports.trace = trace;
//# sourceMappingURL=profiling.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/text/formatted-string.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var span_1 = __webpack_require__("../node_modules/tns-core-modules/text/span.js");
exports.Span = span_1.Span;
var observable_1 = __webpack_require__("../node_modules/tns-core-modules/data/observable/observable.js");
var observable_array_1 = __webpack_require__("../node_modules/tns-core-modules/data/observable-array/observable-array.js");
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
var knownCollections;
(function (knownCollections) {
knownCollections.spans = "spans";
})(knownCollections = exports.knownCollections || (exports.knownCollections = {}));
var CHILD_SPAN = "Span";
var FormattedString = (function (_super) {
__extends(FormattedString, _super);
function FormattedString() {
var _this = _super.call(this) || this;
_this._spans = new observable_array_1.ObservableArray();
_this._spans.addEventListener(observable_array_1.ObservableArray.changeEvent, _this.onSpansCollectionChanged, _this);
return _this;
}
Object.defineProperty(FormattedString.prototype, "fontFamily", {
get: function () {
return this.style.fontFamily;
},
set: function (value) {
this.style.fontFamily = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FormattedString.prototype, "fontSize", {
get: function () {
return this.style.fontSize;
},
set: function (value) {
this.style.fontSize = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FormattedString.prototype, "fontStyle", {
get: function () {
return this.style.fontStyle;
},
set: function (value) {
this.style.fontStyle = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FormattedString.prototype, "fontWeight", {
get: function () {
return this.style.fontWeight;
},
set: function (value) {
this.style.fontWeight = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FormattedString.prototype, "textDecoration", {
get: function () {
return this.style.textDecoration;
},
set: function (value) {
this.style.textDecoration = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FormattedString.prototype, "color", {
get: function () {
return this.style.color;
},
set: function (value) {
this.style.color = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FormattedString.prototype, "backgroundColor", {
get: function () {
return this.style.backgroundColor;
},
set: function (value) {
this.style.backgroundColor = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FormattedString.prototype, "spans", {
get: function () {
if (!this._spans) {
this._spans = new observable_array_1.ObservableArray();
}
return this._spans;
},
enumerable: true,
configurable: true
});
FormattedString.prototype.toString = function () {
var result = "";
for (var i = 0, length_1 = this._spans.length; i < length_1; i++) {
result += this._spans.getItem(i).text;
}
return result;
};
FormattedString.prototype._addArrayFromBuilder = function (name, value) {
if (name === knownCollections.spans) {
this.spans.push(value);
}
};
FormattedString.prototype._addChildFromBuilder = function (name, value) {
if (name === CHILD_SPAN) {
this.spans.push(value);
}
};
FormattedString.prototype.onSpansCollectionChanged = function (eventData) {
if (eventData.addedCount > 0) {
for (var i = 0; i < eventData.addedCount; i++) {
var span = eventData.object.getItem(eventData.index + i);
this._addView(span);
this.addPropertyChangeHandler(span);
}
}
if (eventData.removed && eventData.removed.length > 0) {
for (var p = 0; p < eventData.removed.length; p++) {
var span = eventData.removed[p];
this.removePropertyChangeHandler(span);
this._removeView(span);
}
}
this.notifyPropertyChange(".", this);
};
FormattedString.prototype.addPropertyChangeHandler = function (span) {
var style = span.style;
span.on(observable_1.Observable.propertyChangeEvent, this.onPropertyChange, this);
style.on("fontFamilyChange", this.onPropertyChange, this);
style.on("fontSizeChange", this.onPropertyChange, this);
style.on("fontStyleChange", this.onPropertyChange, this);
style.on("fontWeightChange", this.onPropertyChange, this);
style.on("textDecorationChange", this.onPropertyChange, this);
style.on("colorChange", this.onPropertyChange, this);
style.on("backgroundColorChange", this.onPropertyChange, this);
};
FormattedString.prototype.removePropertyChangeHandler = function (span) {
var style = span.style;
span.off(observable_1.Observable.propertyChangeEvent, this.onPropertyChange, this);
style.off("fontFamilyChange", this.onPropertyChange, this);
style.off("fontSizeChange", this.onPropertyChange, this);
style.off("fontStyleChange", this.onPropertyChange, this);
style.off("fontWeightChange", this.onPropertyChange, this);
style.off("textDecorationChange", this.onPropertyChange, this);
style.off("colorChange", this.onPropertyChange, this);
style.off("backgroundColorChange", this.onPropertyChange, this);
};
FormattedString.prototype.onPropertyChange = function (data) {
this.notifyPropertyChange(data.propertyName, this);
};
FormattedString.prototype.eachChild = function (callback) {
this.spans.forEach(function (v, i, arr) { return callback(v); });
};
return FormattedString;
}(view_1.ViewBase));
exports.FormattedString = FormattedString;
//# sourceMappingURL=formatted-string.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/text/span.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
var Span = (function (_super) {
__extends(Span, _super);
function Span() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(Span.prototype, "fontFamily", {
get: function () {
return this.style.fontFamily;
},
set: function (value) {
this.style.fontFamily = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Span.prototype, "fontSize", {
get: function () {
return this.style.fontSize;
},
set: function (value) {
this.style.fontSize = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Span.prototype, "fontStyle", {
get: function () {
return this.style.fontStyle;
},
set: function (value) {
this.style.fontStyle = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Span.prototype, "fontWeight", {
get: function () {
return this.style.fontWeight;
},
set: function (value) {
this.style.fontWeight = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Span.prototype, "textDecoration", {
get: function () {
return this.style.textDecoration;
},
set: function (value) {
this.style.textDecoration = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Span.prototype, "color", {
get: function () {
return this.style.color;
},
set: function (value) {
this.style.color = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Span.prototype, "backgroundColor", {
get: function () {
return this.style.backgroundColor;
},
set: function (value) {
this.style.backgroundColor = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Span.prototype, "text", {
get: function () {
return this._text;
},
set: function (value) {
if (this._text !== value) {
this._text = value;
this.notifyPropertyChange("text", value);
}
},
enumerable: true,
configurable: true
});
Span.prototype._setTextInternal = function (value) {
this._text = value;
};
return Span;
}(view_1.ViewBase));
exports.Span = Span;
//# sourceMappingURL=span.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/text/text.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var encoding;
(function (encoding) {
encoding.ISO_8859_1 = "ISO-8859-1";
encoding.US_ASCII = "US-ASCII";
encoding.UTF_16 = "UTF-16";
encoding.UTF_16BE = "UTF-16BE";
encoding.UTF_16LE = "UTF-16LE";
encoding.UTF_8 = "UTF-8";
})(encoding = exports.encoding || (exports.encoding = {}));
//# sourceMappingURL=text.android.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/timer/timer.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var timeoutHandler;
var timeoutCallbacks = {};
var timerId = 0;
function createHandlerAndGetId() {
if (!timeoutHandler) {
timeoutHandler = new android.os.Handler(android.os.Looper.myLooper());
}
timerId++;
return timerId;
}
function setTimeout(callback, milliseconds) {
if (milliseconds === void 0) { milliseconds = 0; }
var args = [];
for (var _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i];
}
var id = createHandlerAndGetId();
var invoke = function () { return callback.apply(void 0, args); };
var zoneBound = zonedCallback(invoke);
var runnable = new java.lang.Runnable({
run: function () {
zoneBound();
if (timeoutCallbacks[id]) {
delete timeoutCallbacks[id];
}
}
});
if (!timeoutCallbacks[id]) {
timeoutCallbacks[id] = runnable;
}
timeoutHandler.postDelayed(runnable, long(milliseconds));
return id;
}
exports.setTimeout = setTimeout;
function clearTimeout(id) {
var index = id;
if (timeoutCallbacks[index]) {
timeoutHandler.removeCallbacks(timeoutCallbacks[index]);
delete timeoutCallbacks[index];
}
}
exports.clearTimeout = clearTimeout;
function setInterval(callback, milliseconds) {
if (milliseconds === void 0) { milliseconds = 0; }
var args = [];
for (var _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i];
}
var id = createHandlerAndGetId();
var handler = timeoutHandler;
var invoke = function () { return callback.apply(void 0, args); };
var zoneBound = zonedCallback(invoke);
var runnable = new java.lang.Runnable({
run: function () {
zoneBound();
if (timeoutCallbacks[id]) {
handler.postDelayed(runnable, long(milliseconds));
}
}
});
if (!timeoutCallbacks[id]) {
timeoutCallbacks[id] = runnable;
}
timeoutHandler.postDelayed(runnable, long(milliseconds));
return id;
}
exports.setInterval = setInterval;
exports.clearInterval = clearTimeout;
//# sourceMappingURL=timer.android.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/trace/trace.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var enabled = false;
var _categories = {};
var _writers = [];
var _eventListeners = [];
var _errorHandler;
function enable() {
enabled = true;
}
exports.enable = enable;
function disable() {
enabled = false;
}
exports.disable = disable;
function isEnabled() {
return enabled;
}
exports.isEnabled = isEnabled;
function isCategorySet(category) {
return category in _categories;
}
exports.isCategorySet = isCategorySet;
function addWriter(writer) {
_writers.push(writer);
}
exports.addWriter = addWriter;
function removeWriter(writer) {
var index = _writers.indexOf(writer);
if (index >= 0) {
_writers.splice(index, 1);
}
}
exports.removeWriter = removeWriter;
function clearWriters() {
if (_writers.length > 0) {
_writers.splice(0, _writers.length);
}
}
exports.clearWriters = clearWriters;
function setCategories(categories) {
_categories = {};
addCategories(categories);
}
exports.setCategories = setCategories;
function addCategories(categories) {
var split = categories.split(",");
for (var i = 0; i < split.length; i++) {
_categories[split[i].trim()] = true;
}
}
exports.addCategories = addCategories;
function write(message, category, type) {
var i;
if (type === messageType.error) {
for (i = 0; i < _writers.length; i++) {
_writers[i].write(message, category, type);
}
return;
}
if (!enabled) {
return;
}
if (!(category in _categories)) {
return;
}
for (i = 0; i < _writers.length; i++) {
_writers[i].write(message, category, type);
}
}
exports.write = write;
function notifyEvent(object, name, data) {
if (!enabled) {
return;
}
var i, listener, filters;
for (i = 0; i < _eventListeners.length; i++) {
listener = _eventListeners[i];
if (listener.filter) {
filters = listener.filter.split(",");
filters.forEach(function (value) {
if (value.trim() === name) {
listener.on(object, name, data);
}
});
}
else {
listener.on(object, name, data);
}
}
}
exports.notifyEvent = notifyEvent;
function addEventListener(listener) {
_eventListeners.push(listener);
}
exports.addEventListener = addEventListener;
function removeEventListener(listener) {
var index = _eventListeners.indexOf(listener);
if (index >= 0) {
_eventListeners.splice(index, 1);
}
}
exports.removeEventListener = removeEventListener;
var messageType;
(function (messageType) {
messageType.log = 0;
messageType.info = 1;
messageType.warn = 2;
messageType.error = 3;
})(messageType = exports.messageType || (exports.messageType = {}));
var categories;
(function (categories) {
categories.VisualTreeEvents = "VisualTreeEvents";
categories.Layout = "Layout";
categories.Style = "Style";
categories.ViewHierarchy = "ViewHierarchy";
categories.NativeLifecycle = "NativeLifecycle";
categories.Debug = "Debug";
categories.Navigation = "Navigation";
categories.Test = "Test";
categories.Binding = "Binding";
categories.BindingError = "BindingError";
categories.Error = "Error";
categories.Animation = "Animation";
categories.Transition = "Transition";
categories.All = categories.VisualTreeEvents + "," + categories.Layout + "," + categories.Style + "," + categories.ViewHierarchy + "," + categories.NativeLifecycle + "," + categories.Debug + "," + categories.Navigation + "," + categories.Test + "," + categories.Binding + "," + categories.Error + "," + categories.Animation + "," + categories.Transition;
categories.separator = ",";
function concat() {
var i;
var result;
for (i = 0; i < arguments.length; i++) {
if (!result) {
result = arguments[i];
continue;
}
result = result.concat(categories.separator, arguments[i]);
}
return result;
}
categories.concat = concat;
})(categories = exports.categories || (exports.categories = {}));
var ConsoleWriter = (function () {
function ConsoleWriter() {
}
ConsoleWriter.prototype.write = function (message, category, type) {
if (!console) {
return;
}
var msgType;
if (type === undefined) {
msgType = messageType.log;
}
else {
msgType = type;
}
switch (msgType) {
case messageType.log:
console.log(category + ": " + message);
break;
case messageType.info:
console.info(category + ": " + message);
break;
case messageType.warn:
console.warn(category + ": " + message);
break;
case messageType.error:
console.error(category + ": " + message);
break;
}
};
return ConsoleWriter;
}());
addWriter(new ConsoleWriter());
var DefaultErrorHandler = (function () {
function DefaultErrorHandler() {
}
DefaultErrorHandler.prototype.handlerError = function (error) {
throw error;
};
return DefaultErrorHandler;
}());
exports.DefaultErrorHandler = DefaultErrorHandler;
setErrorHandler(new DefaultErrorHandler());
function getErrorHandler() {
return _errorHandler;
}
exports.getErrorHandler = getErrorHandler;
function setErrorHandler(handler) {
_errorHandler = handler;
}
exports.setErrorHandler = setErrorHandler;
function error(error) {
if (!_errorHandler) {
return;
}
if (typeof error === "string") {
error = new Error(error);
}
_errorHandler.handlerError(error);
}
exports.error = error;
//# sourceMappingURL=trace.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/action-bar/action-bar-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js"));
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
var knownCollections;
(function (knownCollections) {
knownCollections.actionItems = "actionItems";
})(knownCollections = exports.knownCollections || (exports.knownCollections = {}));
var ActionBarBase = (function (_super) {
__extends(ActionBarBase, _super);
function ActionBarBase() {
var _this = _super.call(this) || this;
_this._actionItems = new ActionItems(_this);
return _this;
}
Object.defineProperty(ActionBarBase.prototype, "navigationButton", {
get: function () {
return this._navigationButton;
},
set: function (value) {
if (this._navigationButton !== value) {
if (this._navigationButton) {
this._removeView(this._navigationButton);
this._navigationButton.actionBar = undefined;
}
this._navigationButton = value;
if (this._navigationButton) {
this._navigationButton.actionBar = this;
this._addView(this._navigationButton);
}
this.update();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(ActionBarBase.prototype, "actionItems", {
get: function () {
return this._actionItems;
},
set: function (value) {
throw new Error("actionItems property is read-only");
},
enumerable: true,
configurable: true
});
Object.defineProperty(ActionBarBase.prototype, "titleView", {
get: function () {
return this._titleView;
},
set: function (value) {
if (this._titleView !== value) {
if (this._titleView) {
this._removeView(this._titleView);
this._titleView.style[view_1.horizontalAlignmentProperty.cssName] = view_1.unsetValue;
this._titleView.style[view_1.verticalAlignmentProperty.cssName] = view_1.unsetValue;
}
this._titleView = value;
if (value) {
this._addView(value);
var style = value.style;
if (!view_1.horizontalAlignmentProperty.isSet(style)) {
style[view_1.horizontalAlignmentProperty.cssName] = "center";
}
if (!view_1.verticalAlignmentProperty.isSet(style)) {
style[view_1.verticalAlignmentProperty.cssName] = "middle";
}
}
this.update();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(ActionBarBase.prototype, "android", {
get: function () {
return undefined;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ActionBarBase.prototype, "_childrenCount", {
get: function () {
var actionViewsCount = 0;
this._actionItems.getItems().forEach(function (actionItem) {
if (actionItem.actionView) {
actionViewsCount++;
}
});
return actionViewsCount + (this.titleView ? 1 : 0);
},
enumerable: true,
configurable: true
});
ActionBarBase.prototype.update = function () {
};
ActionBarBase.prototype._onTitlePropertyChanged = function () {
};
ActionBarBase.prototype._addArrayFromBuilder = function (name, value) {
if (name === "actionItems") {
this.actionItems.setItems(value);
}
};
ActionBarBase.prototype.eachChildView = function (callback) {
var titleView = this.titleView;
if (titleView) {
callback(titleView);
}
};
ActionBarBase.prototype.eachChild = function (callback) {
var titleView = this.titleView;
if (titleView) {
callback(titleView);
}
var navigationButton = this._navigationButton;
if (navigationButton) {
callback(navigationButton);
}
this.actionItems.getItems().forEach(function (actionItem) {
callback(actionItem);
});
};
ActionBarBase.prototype._isEmpty = function () {
if (this.title ||
this.titleView ||
(this.android && this.android.icon) ||
this.navigationButton ||
this.actionItems.getItems().length > 0) {
return false;
}
return true;
};
ActionBarBase = __decorate([
view_1.CSSType("ActionBar")
], ActionBarBase);
return ActionBarBase;
}(view_1.View));
exports.ActionBarBase = ActionBarBase;
var ActionItems = (function () {
function ActionItems(actionBar) {
this._items = new Array();
this._actionBar = actionBar;
}
ActionItems.prototype.addItem = function (item) {
if (!item) {
throw new Error("Cannot add empty item");
}
this._items.push(item);
item.actionBar = this._actionBar;
this._actionBar._addView(item);
this.invalidate();
};
ActionItems.prototype.removeItem = function (item) {
if (!item) {
throw new Error("Cannot remove empty item");
}
var itemIndex = this._items.indexOf(item);
if (itemIndex < 0) {
throw new Error("Cannot find item to remove");
}
this._items.splice(itemIndex, 1);
this._actionBar._removeView(item);
item.actionBar = undefined;
this.invalidate();
};
ActionItems.prototype.getItems = function () {
return this._items.slice();
};
ActionItems.prototype.getVisibleItems = function () {
var visibleItems = [];
this._items.forEach(function (item) {
if (isVisible(item)) {
visibleItems.push(item);
}
});
return visibleItems;
};
ActionItems.prototype.getItemAt = function (index) {
if (index < 0 || index >= this._items.length) {
return undefined;
}
return this._items[index];
};
ActionItems.prototype.setItems = function (items) {
while (this._items.length > 0) {
this.removeItem(this._items[this._items.length - 1]);
}
for (var i = 0; i < items.length; i++) {
this.addItem(items[i]);
}
this.invalidate();
};
ActionItems.prototype.invalidate = function () {
if (this._actionBar) {
this._actionBar.update();
}
};
return ActionItems;
}());
exports.ActionItems = ActionItems;
var ActionItemBase = (function (_super) {
__extends(ActionItemBase, _super);
function ActionItemBase() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(ActionItemBase.prototype, "actionView", {
get: function () {
return this._actionView;
},
set: function (value) {
if (this._actionView !== value) {
if (this._actionView) {
this._actionView.style[view_1.horizontalAlignmentProperty.cssName] = view_1.unsetValue;
this._actionView.style[view_1.verticalAlignmentProperty.cssName] = view_1.unsetValue;
this._removeView(this._actionView);
}
this._actionView = value;
if (this._actionView) {
this._addView(this._actionView);
}
if (this._actionBar) {
this._actionBar.update();
}
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(ActionItemBase.prototype, "actionBar", {
get: function () {
return this._actionBar;
},
set: function (value) {
if (value !== this._actionBar) {
this._actionBar = value;
}
},
enumerable: true,
configurable: true
});
ActionItemBase.prototype.onLoaded = function () {
if (this._actionView) {
this._actionView.style[view_1.horizontalAlignmentProperty.cssName] = "center";
this._actionView.style[view_1.verticalAlignmentProperty.cssName] = "middle";
}
_super.prototype.onLoaded.call(this);
};
ActionItemBase.prototype._raiseTap = function () {
this._emit(ActionItemBase.tapEvent);
};
ActionItemBase.prototype._addChildFromBuilder = function (name, value) {
this.actionView = value;
};
ActionItemBase.prototype._onVisibilityChanged = function (visibility) {
if (this.actionBar) {
this.actionBar.update();
}
};
ActionItemBase.prototype.eachChild = function (callback) {
if (this._actionView) {
callback(this._actionView);
}
};
ActionItemBase.tapEvent = "tap";
__decorate([
profiling_1.profile
], ActionItemBase.prototype, "onLoaded", null);
return ActionItemBase;
}(view_1.ViewBase));
exports.ActionItemBase = ActionItemBase;
function isVisible(item) {
return item.visibility === "visible";
}
exports.isVisible = isVisible;
function onTitlePropertyChanged(actionBar, oldValue, newValue) {
actionBar._onTitlePropertyChanged();
}
exports.titleProperty = new view_1.Property({ name: "title", valueChanged: onTitlePropertyChanged });
exports.titleProperty.register(ActionBarBase);
function onItemChanged(item, oldValue, newValue) {
if (item.actionBar) {
item.actionBar.update();
}
}
function onVisibilityChanged(item, oldValue, newValue) {
item._onVisibilityChanged(newValue);
}
function traceMissingIcon(icon) {
view_1.traceWrite("Could not load action bar icon: " + icon, view_1.traceCategories.Error, view_1.traceMessageType.error);
}
exports.traceMissingIcon = traceMissingIcon;
exports.textProperty = new view_1.Property({ name: "text", defaultValue: "", valueChanged: onItemChanged });
exports.textProperty.register(ActionItemBase);
exports.iconProperty = new view_1.Property({ name: "icon", valueChanged: onItemChanged });
exports.iconProperty.register(ActionItemBase);
exports.visibilityProperty = new view_1.Property({ name: "visibility", defaultValue: "visible", valueChanged: onVisibilityChanged });
exports.visibilityProperty.register(ActionItemBase);
exports.flatProperty = new view_1.Property({ name: "flat", defaultValue: false, valueConverter: view_1.booleanConverter });
exports.flatProperty.register(ActionBarBase);
//# sourceMappingURL=action-bar-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/action-bar/action-bar.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var action_bar_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/action-bar/action-bar-common.js");
var utils_1 = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
var image_source_1 = __webpack_require__("../node_modules/tns-core-modules/image-source/image-source.js");
var application = __webpack_require__("../node_modules/tns-core-modules/application/application.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/action-bar/action-bar-common.js"));
var R_ID_HOME = 0x0102002c;
var ACTION_ITEM_ID_OFFSET = 10000;
var DEFAULT_ELEVATION = 4;
var AppCompatTextView;
var actionItemIdGenerator = ACTION_ITEM_ID_OFFSET;
function generateItemId() {
actionItemIdGenerator++;
return actionItemIdGenerator;
}
var appResources;
var MenuItemClickListener;
function initializeMenuItemClickListener() {
if (MenuItemClickListener) {
return;
}
AppCompatTextView = android.support.v7.widget.AppCompatTextView;
var MenuItemClickListenerImpl = (function (_super) {
__extends(MenuItemClickListenerImpl, _super);
function MenuItemClickListenerImpl(owner) {
var _this = _super.call(this) || this;
_this.owner = owner;
return global.__native(_this);
}
MenuItemClickListenerImpl.prototype.onMenuItemClick = function (item) {
var itemId = item.getItemId();
return this.owner._onAndroidItemSelected(itemId);
};
MenuItemClickListenerImpl = __decorate([
Interfaces([android.support.v7.widget.Toolbar.OnMenuItemClickListener])
], MenuItemClickListenerImpl);
return MenuItemClickListenerImpl;
}(java.lang.Object));
MenuItemClickListener = MenuItemClickListenerImpl;
appResources = application.android.context.getResources();
}
var ActionItem = (function (_super) {
__extends(ActionItem, _super);
function ActionItem() {
var _this = _super.call(this) || this;
_this._androidPosition = {
position: "actionBar",
systemIcon: undefined
};
_this._itemId = generateItemId();
return _this;
}
Object.defineProperty(ActionItem.prototype, "android", {
get: function () {
return this._androidPosition;
},
set: function (value) {
throw new Error("ActionItem.android is read-only");
},
enumerable: true,
configurable: true
});
ActionItem.prototype._getItemId = function () {
return this._itemId;
};
return ActionItem;
}(action_bar_common_1.ActionItemBase));
exports.ActionItem = ActionItem;
var AndroidActionBarSettings = (function () {
function AndroidActionBarSettings(actionBar) {
this._iconVisibility = "auto";
this._actionBar = actionBar;
}
Object.defineProperty(AndroidActionBarSettings.prototype, "icon", {
get: function () {
return this._icon;
},
set: function (value) {
if (value !== this._icon) {
this._icon = value;
this._actionBar._onIconPropertyChanged();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(AndroidActionBarSettings.prototype, "iconVisibility", {
get: function () {
return this._iconVisibility;
},
set: function (value) {
if (value !== this._iconVisibility) {
this._iconVisibility = value;
this._actionBar._onIconPropertyChanged();
}
},
enumerable: true,
configurable: true
});
return AndroidActionBarSettings;
}());
exports.AndroidActionBarSettings = AndroidActionBarSettings;
var NavigationButton = (function (_super) {
__extends(NavigationButton, _super);
function NavigationButton() {
return _super !== null && _super.apply(this, arguments) || this;
}
return NavigationButton;
}(ActionItem));
exports.NavigationButton = NavigationButton;
var ActionBar = (function (_super) {
__extends(ActionBar, _super);
function ActionBar() {
var _this = _super.call(this) || this;
_this._android = new AndroidActionBarSettings(_this);
return _this;
}
Object.defineProperty(ActionBar.prototype, "android", {
get: function () {
return this._android;
},
enumerable: true,
configurable: true
});
ActionBar.prototype._addChildFromBuilder = function (name, value) {
if (value instanceof NavigationButton) {
this.navigationButton = value;
}
else if (value instanceof ActionItem) {
this.actionItems.addItem(value);
}
else if (value instanceof action_bar_common_1.View) {
this.titleView = value;
}
};
ActionBar.prototype.createNativeView = function () {
return new android.support.v7.widget.Toolbar(this._context);
};
ActionBar.prototype.initNativeView = function () {
_super.prototype.initNativeView.call(this);
var nativeView = this.nativeViewProtected;
initializeMenuItemClickListener();
var menuItemClickListener = new MenuItemClickListener(this);
nativeView.setOnMenuItemClickListener(menuItemClickListener);
nativeView.menuItemClickListener = menuItemClickListener;
};
ActionBar.prototype.disposeNativeView = function () {
this.nativeViewProtected.menuItemClickListener.owner = null;
_super.prototype.disposeNativeView.call(this);
};
ActionBar.prototype.onLoaded = function () {
_super.prototype.onLoaded.call(this);
this.update();
};
ActionBar.prototype.update = function () {
if (!this.nativeViewProtected) {
return;
}
var page = this.page;
if (!page.frame || !page.frame._getNavBarVisible(page)) {
this.nativeViewProtected.setVisibility(android.view.View.GONE);
return;
}
this.nativeViewProtected.setVisibility(android.view.View.VISIBLE);
this._addActionItems();
this._updateTitleAndTitleView();
this._updateIcon();
this._updateNavigationButton();
};
ActionBar.prototype._onAndroidItemSelected = function (itemId) {
if (this.navigationButton && itemId === R_ID_HOME) {
this.navigationButton._raiseTap();
return true;
}
var menuItem = undefined;
var items = this.actionItems.getItems();
for (var i = 0; i < items.length; i++) {
if (items[i]._getItemId() === itemId) {
menuItem = items[i];
break;
}
}
if (menuItem) {
menuItem._raiseTap();
return true;
}
return false;
};
ActionBar.prototype._updateNavigationButton = function () {
var navButton = this.navigationButton;
if (navButton && action_bar_common_1.isVisible(navButton)) {
var systemIcon = navButton.android.systemIcon;
if (systemIcon !== undefined) {
var systemResourceId = getSystemResourceId(systemIcon);
if (systemResourceId) {
this.nativeViewProtected.setNavigationIcon(systemResourceId);
}
}
else if (navButton.icon) {
var drawableOrId = getDrawableOrResourceId(navButton.icon, appResources);
if (drawableOrId) {
this.nativeViewProtected.setNavigationIcon(drawableOrId);
}
}
this.nativeViewProtected.setNavigationContentDescription(navButton.text || null);
var navBtn_1 = new WeakRef(navButton);
this.nativeViewProtected.setNavigationOnClickListener(new android.view.View.OnClickListener({
onClick: function (v) {
var owner = navBtn_1.get();
if (owner) {
owner._raiseTap();
}
}
}));
}
else {
this.nativeViewProtected.setNavigationIcon(null);
}
};
ActionBar.prototype._updateIcon = function () {
var visibility = getIconVisibility(this.android.iconVisibility);
if (visibility) {
var icon = this.android.icon;
if (icon !== undefined) {
var drawableOrId = getDrawableOrResourceId(icon, appResources);
if (drawableOrId) {
this.nativeViewProtected.setLogo(drawableOrId);
}
}
else {
var defaultIcon = application.android.nativeApp.getApplicationInfo().icon;
this.nativeViewProtected.setLogo(defaultIcon);
}
}
else {
this.nativeViewProtected.setLogo(null);
}
};
ActionBar.prototype._updateTitleAndTitleView = function () {
if (!this.titleView) {
var title = this.title;
if (title !== undefined) {
this.nativeViewProtected.setTitle(title);
}
else {
var appContext = application.android.context;
var appInfo = appContext.getApplicationInfo();
var appLabel = appContext.getPackageManager().getApplicationLabel(appInfo);
if (appLabel) {
this.nativeViewProtected.setTitle(appLabel);
}
}
}
};
ActionBar.prototype._addActionItems = function () {
var menu = this.nativeViewProtected.getMenu();
var items = this.actionItems.getVisibleItems();
menu.clear();
for (var i = 0; i < items.length; i++) {
var item = items[i];
var menuItem = menu.add(android.view.Menu.NONE, item._getItemId(), android.view.Menu.NONE, item.text + "");
if (item.actionView && item.actionView.android) {
item.android.position = "actionBar";
menuItem.setActionView(item.actionView.android);
ActionBar._setOnClickListener(item);
}
else if (item.android.systemIcon) {
var systemResourceId = getSystemResourceId(item.android.systemIcon);
if (systemResourceId) {
menuItem.setIcon(systemResourceId);
}
}
else if (item.icon) {
var drawableOrId = getDrawableOrResourceId(item.icon, appResources);
if (drawableOrId) {
menuItem.setIcon(drawableOrId);
}
}
var showAsAction = getShowAsAction(item);
menuItem.setShowAsAction(showAsAction);
}
};
ActionBar._setOnClickListener = function (item) {
var weakRef = new WeakRef(item);
item.actionView.android.setOnClickListener(new android.view.View.OnClickListener({
onClick: function (v) {
var owner = weakRef.get();
if (owner) {
owner._raiseTap();
}
}
}));
};
ActionBar.prototype._onTitlePropertyChanged = function () {
if (this.nativeViewProtected) {
this._updateTitleAndTitleView();
}
};
ActionBar.prototype._onIconPropertyChanged = function () {
if (this.nativeViewProtected) {
this._updateIcon();
}
};
ActionBar.prototype._addViewToNativeVisualTree = function (child, atIndex) {
if (atIndex === void 0) { atIndex = Number.MAX_VALUE; }
_super.prototype._addViewToNativeVisualTree.call(this, child);
if (this.nativeViewProtected && child.nativeViewProtected) {
if (atIndex >= this.nativeViewProtected.getChildCount()) {
this.nativeViewProtected.addView(child.nativeViewProtected);
}
else {
this.nativeViewProtected.addView(child.nativeViewProtected, atIndex);
}
return true;
}
return false;
};
ActionBar.prototype._removeViewFromNativeVisualTree = function (child) {
_super.prototype._removeViewFromNativeVisualTree.call(this, child);
if (this.nativeViewProtected && child.nativeViewProtected) {
this.nativeViewProtected.removeView(child.nativeViewProtected);
}
};
ActionBar.prototype[action_bar_common_1.colorProperty.getDefault] = function () {
var nativeView = this.nativeViewProtected;
if (!defaultTitleTextColor) {
var tv = getAppCompatTextView(nativeView);
if (!tv) {
var title = nativeView.getTitle();
nativeView.setTitle("");
tv = getAppCompatTextView(nativeView);
if (title) {
nativeView.setTitle(title);
}
}
defaultTitleTextColor = tv ? tv.getTextColors().getDefaultColor() : -570425344;
}
return defaultTitleTextColor;
};
ActionBar.prototype[action_bar_common_1.colorProperty.setNative] = function (value) {
var color = value instanceof action_bar_common_1.Color ? value.android : value;
this.nativeViewProtected.setTitleTextColor(color);
};
ActionBar.prototype[action_bar_common_1.flatProperty.setNative] = function (value) {
var compat = android.support.v4.view.ViewCompat;
if (compat.setElevation) {
if (value) {
compat.setElevation(this.nativeViewProtected, 0);
}
else {
var val = DEFAULT_ELEVATION * action_bar_common_1.layout.getDisplayDensity();
compat.setElevation(this.nativeViewProtected, val);
}
}
};
return ActionBar;
}(action_bar_common_1.ActionBarBase));
exports.ActionBar = ActionBar;
function getAppCompatTextView(toolbar) {
for (var i = 0, count = toolbar.getChildCount(); i < count; i++) {
var child = toolbar.getChildAt(i);
if (child instanceof AppCompatTextView) {
return child;
}
}
return null;
}
ActionBar.prototype.recycleNativeView = "auto";
var defaultTitleTextColor;
function getDrawableOrResourceId(icon, resources) {
if (typeof icon !== "string") {
return undefined;
}
var result = undefined;
if (icon.indexOf(utils_1.RESOURCE_PREFIX) === 0) {
var resourceId = resources.getIdentifier(icon.substr(utils_1.RESOURCE_PREFIX.length), "drawable", application.android.packageName);
if (resourceId > 0) {
result = resourceId;
}
}
else {
var drawable = void 0;
var is = image_source_1.fromFileOrResource(icon);
if (is) {
drawable = new android.graphics.drawable.BitmapDrawable(is.android);
}
result = drawable;
}
if (!result) {
action_bar_common_1.traceMissingIcon(icon);
}
return result;
}
function getShowAsAction(menuItem) {
switch (menuItem.android.position) {
case "actionBarIfRoom":
return android.view.MenuItem.SHOW_AS_ACTION_IF_ROOM;
case "popup":
return android.view.MenuItem.SHOW_AS_ACTION_NEVER;
case "actionBar":
default:
return android.view.MenuItem.SHOW_AS_ACTION_ALWAYS;
}
}
function getIconVisibility(iconVisibility) {
switch (iconVisibility) {
case "always":
return true;
case "auto":
case "never":
default:
return false;
}
}
function getSystemResourceId(systemIcon) {
return android.content.res.Resources.getSystem().getIdentifier(systemIcon, "drawable", "android");
}
//# sourceMappingURL=action-bar.android.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/activity-indicator/activity-indicator-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js"));
var ActivityIndicatorBase = (function (_super) {
__extends(ActivityIndicatorBase, _super);
function ActivityIndicatorBase() {
return _super !== null && _super.apply(this, arguments) || this;
}
ActivityIndicatorBase = __decorate([
view_1.CSSType("ActivityIndicator")
], ActivityIndicatorBase);
return ActivityIndicatorBase;
}(view_1.View));
exports.ActivityIndicatorBase = ActivityIndicatorBase;
ActivityIndicatorBase.prototype.recycleNativeView = "auto";
exports.busyProperty = new view_1.Property({ name: "busy", defaultValue: false, valueConverter: view_1.booleanConverter });
exports.busyProperty.register(ActivityIndicatorBase);
//# sourceMappingURL=activity-indicator-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/activity-indicator/activity-indicator.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var activity_indicator_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/activity-indicator/activity-indicator-common.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/activity-indicator/activity-indicator-common.js"));
var ActivityIndicator = (function (_super) {
__extends(ActivityIndicator, _super);
function ActivityIndicator() {
return _super !== null && _super.apply(this, arguments) || this;
}
ActivityIndicator.prototype.createNativeView = function () {
var progressBar = new android.widget.ProgressBar(this._context);
progressBar.setVisibility(android.view.View.INVISIBLE);
progressBar.setIndeterminate(true);
return progressBar;
};
ActivityIndicator.prototype[activity_indicator_common_1.busyProperty.getDefault] = function () {
return false;
};
ActivityIndicator.prototype[activity_indicator_common_1.busyProperty.setNative] = function (value) {
if (this.visibility === activity_indicator_common_1.Visibility.VISIBLE) {
this.nativeViewProtected.setVisibility(value ? android.view.View.VISIBLE : android.view.View.INVISIBLE);
}
};
ActivityIndicator.prototype[activity_indicator_common_1.visibilityProperty.getDefault] = function () {
return activity_indicator_common_1.Visibility.HIDDEN;
};
ActivityIndicator.prototype[activity_indicator_common_1.visibilityProperty.setNative] = function (value) {
switch (value) {
case activity_indicator_common_1.Visibility.VISIBLE:
this.nativeViewProtected.setVisibility(this.busy ? android.view.View.VISIBLE : android.view.View.INVISIBLE);
break;
case activity_indicator_common_1.Visibility.HIDDEN:
this.nativeViewProtected.setVisibility(android.view.View.INVISIBLE);
break;
case activity_indicator_common_1.Visibility.COLLAPSE:
this.nativeViewProtected.setVisibility(android.view.View.GONE);
break;
default:
throw new Error("Invalid visibility value: " + value + ". Valid values are: \"" + activity_indicator_common_1.Visibility.VISIBLE + "\", \"" + activity_indicator_common_1.Visibility.HIDDEN + "\", \"" + activity_indicator_common_1.Visibility.COLLAPSE + "\".");
}
};
ActivityIndicator.prototype[activity_indicator_common_1.colorProperty.getDefault] = function () {
return -1;
};
ActivityIndicator.prototype[activity_indicator_common_1.colorProperty.setNative] = function (value) {
if (value instanceof activity_indicator_common_1.Color) {
this.nativeViewProtected.getIndeterminateDrawable().setColorFilter(value.android, android.graphics.PorterDuff.Mode.SRC_IN);
}
else {
this.nativeViewProtected.getIndeterminateDrawable().clearColorFilter();
}
};
return ActivityIndicator;
}(activity_indicator_common_1.ActivityIndicatorBase));
exports.ActivityIndicator = ActivityIndicator;
//# sourceMappingURL=activity-indicator.android.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/animation/animation-common.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var color_1 = __webpack_require__("../node_modules/tns-core-modules/color/color.js");
exports.Color = color_1.Color;
var trace_1 = __webpack_require__("../node_modules/tns-core-modules/trace/trace.js");
exports.traceEnabled = trace_1.isEnabled;
exports.traceWrite = trace_1.write;
exports.traceCategories = trace_1.categories;
exports.traceType = trace_1.messageType;
var Properties;
(function (Properties) {
Properties.opacity = "opacity";
Properties.backgroundColor = "backgroundColor";
Properties.translate = "translate";
Properties.rotate = "rotate";
Properties.scale = "scale";
})(Properties = exports.Properties || (exports.Properties = {}));
var CubicBezierAnimationCurve = (function () {
function CubicBezierAnimationCurve(x1, y1, x2, y2) {
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
}
return CubicBezierAnimationCurve;
}());
exports.CubicBezierAnimationCurve = CubicBezierAnimationCurve;
var AnimationBase = (function () {
function AnimationBase(animationDefinitions, playSequentially) {
if (!animationDefinitions || animationDefinitions.length === 0) {
throw new Error("No animation definitions specified");
}
if (trace_1.isEnabled()) {
trace_1.write("Analyzing " + animationDefinitions.length + " animation definitions...", trace_1.categories.Animation);
}
this._propertyAnimations = new Array();
for (var i = 0, length_1 = animationDefinitions.length; i < length_1; i++) {
if (animationDefinitions[i].curve) {
animationDefinitions[i].curve = this._resolveAnimationCurve(animationDefinitions[i].curve);
}
this._propertyAnimations = this._propertyAnimations.concat(AnimationBase._createPropertyAnimations(animationDefinitions[i]));
}
if (this._propertyAnimations.length === 0) {
throw new Error("Nothing to animate.");
}
if (trace_1.isEnabled()) {
trace_1.write("Created " + this._propertyAnimations.length + " individual property animations.", trace_1.categories.Animation);
}
this._playSequentially = playSequentially;
}
AnimationBase.prototype._rejectAlreadyPlaying = function () {
var reason = "Animation is already playing.";
trace_1.write(reason, trace_1.categories.Animation, trace_1.messageType.warn);
return new Promise(function (resolve, reject) {
reject(reason);
});
};
AnimationBase.prototype.play = function () {
var _this_1 = this;
var animationFinishedPromise = new Promise(function (resolve, reject) {
_this_1._resolve = resolve;
_this_1._reject = reject;
});
this.fixupAnimationPromise(animationFinishedPromise);
this._isPlaying = true;
return animationFinishedPromise;
};
AnimationBase.prototype.fixupAnimationPromise = function (promise) {
var _this = this;
promise.cancel = function () {
_this.cancel();
};
var _then = promise.then;
promise.then = function () {
var r = _then.apply(promise, arguments);
_this.fixupAnimationPromise(r);
return r;
};
var _catch = promise.catch;
promise.catch = function () {
var r = _catch.apply(promise, arguments);
_this.fixupAnimationPromise(r);
return r;
};
};
AnimationBase.prototype.cancel = function () {
};
Object.defineProperty(AnimationBase.prototype, "isPlaying", {
get: function () {
return this._isPlaying;
},
enumerable: true,
configurable: true
});
AnimationBase.prototype._resolveAnimationFinishedPromise = function () {
this._isPlaying = false;
this._resolve();
};
AnimationBase.prototype._rejectAnimationFinishedPromise = function () {
this._isPlaying = false;
this._reject(new Error("Animation cancelled."));
};
AnimationBase._createPropertyAnimations = function (animationDefinition) {
if (!animationDefinition.target) {
throw new Error("No animation target specified.");
}
for (var item in animationDefinition) {
if (animationDefinition[item] === undefined) {
continue;
}
if ((item === Properties.opacity ||
item === Properties.rotate ||
item === "duration" ||
item === "delay" ||
item === "iterations") && typeof animationDefinition[item] !== "number") {
throw new Error("Property " + item + " must be valid number. Value: " + animationDefinition[item]);
}
else if ((item === Properties.scale || item === Properties.translate) &&
(typeof animationDefinition[item].x !== "number" || typeof animationDefinition[item].y !== "number")) {
throw new Error("Property " + item + " must be valid Pair. Value: " + animationDefinition[item]);
}
else if (item === Properties.backgroundColor && !color_1.Color.isValid(animationDefinition.backgroundColor)) {
throw new Error("Property " + item + " must be valid color. Value: " + animationDefinition[item]);
}
}
var propertyAnimations = new Array();
if (animationDefinition.opacity !== undefined) {
propertyAnimations.push({
target: animationDefinition.target,
property: Properties.opacity,
value: animationDefinition.opacity,
duration: animationDefinition.duration,
delay: animationDefinition.delay,
iterations: animationDefinition.iterations,
curve: animationDefinition.curve
});
}
if (animationDefinition.backgroundColor !== undefined) {
propertyAnimations.push({
target: animationDefinition.target,
property: Properties.backgroundColor,
value: typeof animationDefinition.backgroundColor === "string" ?
new color_1.Color(animationDefinition.backgroundColor) : animationDefinition.backgroundColor,
duration: animationDefinition.duration,
delay: animationDefinition.delay,
iterations: animationDefinition.iterations,
curve: animationDefinition.curve
});
}
if (animationDefinition.translate !== undefined) {
propertyAnimations.push({
target: animationDefinition.target,
property: Properties.translate,
value: animationDefinition.translate,
duration: animationDefinition.duration,
delay: animationDefinition.delay,
iterations: animationDefinition.iterations,
curve: animationDefinition.curve
});
}
if (animationDefinition.scale !== undefined) {
propertyAnimations.push({
target: animationDefinition.target,
property: Properties.scale,
value: animationDefinition.scale,
duration: animationDefinition.duration,
delay: animationDefinition.delay,
iterations: animationDefinition.iterations,
curve: animationDefinition.curve
});
}
if (animationDefinition.rotate !== undefined) {
propertyAnimations.push({
target: animationDefinition.target,
property: Properties.rotate,
value: animationDefinition.rotate,
duration: animationDefinition.duration,
delay: animationDefinition.delay,
iterations: animationDefinition.iterations,
curve: animationDefinition.curve
});
}
if (propertyAnimations.length === 0) {
throw new Error("No animation property specified.");
}
return propertyAnimations;
};
AnimationBase._getAnimationInfo = function (animation) {
return JSON.stringify({
target: animation.target.id,
property: animation.property,
value: animation.value,
duration: animation.duration,
delay: animation.delay,
iterations: animation.iterations,
curve: animation.curve
});
};
return AnimationBase;
}());
exports.AnimationBase = AnimationBase;
//# sourceMappingURL=animation-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/animation/animation.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var animation_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/animation/animation-common.js");
var style_properties_1 = __webpack_require__("../node_modules/tns-core-modules/ui/styling/style-properties.js");
var utils_1 = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
var lazy_1 = __webpack_require__("../node_modules/tns-core-modules/utils/lazy.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/animation/animation-common.js"));
var argbEvaluator;
function ensureArgbEvaluator() {
if (!argbEvaluator) {
argbEvaluator = new android.animation.ArgbEvaluator();
}
}
var easeIn = lazy_1.default(function () { return new android.view.animation.AccelerateInterpolator(1); });
var easeOut = lazy_1.default(function () { return new android.view.animation.DecelerateInterpolator(1); });
var easeInOut = lazy_1.default(function () { return new android.view.animation.AccelerateDecelerateInterpolator(); });
var linear = lazy_1.default(function () { return new android.view.animation.LinearInterpolator(); });
var bounce = lazy_1.default(function () { return new android.view.animation.BounceInterpolator(); });
var keyPrefix = "ui.animation.";
var propertyKeys = {};
propertyKeys[animation_common_1.Properties.backgroundColor] = Symbol(keyPrefix + animation_common_1.Properties.backgroundColor);
propertyKeys[animation_common_1.Properties.opacity] = Symbol(keyPrefix + animation_common_1.Properties.opacity);
propertyKeys[animation_common_1.Properties.rotate] = Symbol(keyPrefix + animation_common_1.Properties.rotate);
propertyKeys[animation_common_1.Properties.scale] = Symbol(keyPrefix + animation_common_1.Properties.scale);
propertyKeys[animation_common_1.Properties.translate] = Symbol(keyPrefix + animation_common_1.Properties.translate);
function _resolveAnimationCurve(curve) {
switch (curve) {
case "easeIn":
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("Animation curve resolved to android.view.animation.AccelerateInterpolator(1).", animation_common_1.traceCategories.Animation);
}
return easeIn();
case "easeOut":
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("Animation curve resolved to android.view.animation.DecelerateInterpolator(1).", animation_common_1.traceCategories.Animation);
}
return easeOut();
case "easeInOut":
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("Animation curve resolved to android.view.animation.AccelerateDecelerateInterpolator().", animation_common_1.traceCategories.Animation);
}
return easeInOut();
case "linear":
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("Animation curve resolved to android.view.animation.LinearInterpolator().", animation_common_1.traceCategories.Animation);
}
return linear();
case "spring":
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("Animation curve resolved to android.view.animation.BounceInterpolator().", animation_common_1.traceCategories.Animation);
}
return bounce();
case "ease":
return android.support.v4.view.animation.PathInterpolatorCompat.create(0.25, 0.1, 0.25, 1.0);
default:
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("Animation curve resolved to original: " + curve, animation_common_1.traceCategories.Animation);
}
if (curve instanceof animation_common_1.CubicBezierAnimationCurve) {
return android.support.v4.view.animation.PathInterpolatorCompat.create(curve.x1, curve.y1, curve.x2, curve.y2);
}
else if (curve && curve.getInterpolation) {
return curve;
}
else if (curve instanceof android.view.animation.LinearInterpolator) {
return curve;
}
else {
throw new Error("Invalid animation curve: " + curve);
}
}
}
exports._resolveAnimationCurve = _resolveAnimationCurve;
var Animation = (function (_super) {
__extends(Animation, _super);
function Animation(animationDefinitions, playSequentially) {
var _this = _super.call(this, animationDefinitions, playSequentially) || this;
_this._valueSource = "animation";
if (animationDefinitions.length > 0 && animationDefinitions[0].valueSource !== undefined) {
_this._valueSource = animationDefinitions[0].valueSource;
}
var that = new WeakRef(_this);
_this._animatorListener = new android.animation.Animator.AnimatorListener({
onAnimationStart: function (animator) {
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("MainAnimatorListener.onAndroidAnimationStart(" + animator + ")", animation_common_1.traceCategories.Animation);
}
},
onAnimationRepeat: function (animator) {
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("MainAnimatorListener.onAnimationRepeat(" + animator + ")", animation_common_1.traceCategories.Animation);
}
},
onAnimationEnd: function (animator) {
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("MainAnimatorListener.onAnimationEnd(" + animator + ")", animation_common_1.traceCategories.Animation);
}
var thisRef = that.get();
if (thisRef) {
thisRef._onAndroidAnimationEnd();
}
},
onAnimationCancel: function (animator) {
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("MainAnimatorListener.onAnimationCancel(" + animator + ")", animation_common_1.traceCategories.Animation);
}
var thisRef = that.get();
if (thisRef) {
thisRef._onAndroidAnimationCancel();
}
}
});
return _this;
}
Animation.prototype.play = function () {
if (this.isPlaying) {
return this._rejectAlreadyPlaying();
}
var animationFinishedPromise = _super.prototype.play.call(this);
this._animators = new Array();
this._propertyUpdateCallbacks = new Array();
this._propertyResetCallbacks = new Array();
for (var i = 0, length_1 = this._propertyAnimations.length; i < length_1; i++) {
this._createAnimators(this._propertyAnimations[i]);
}
this._nativeAnimatorsArray = Array.create(android.animation.Animator, this._animators.length);
for (var i = 0, length_2 = this._animators.length; i < length_2; i++) {
this._nativeAnimatorsArray[i] = this._animators[i];
}
this._animatorSet = new android.animation.AnimatorSet();
this._animatorSet.addListener(this._animatorListener);
if (this._animators.length > 0) {
if (this._playSequentially) {
this._animatorSet.playSequentially(this._nativeAnimatorsArray);
}
else {
this._animatorSet.playTogether(this._nativeAnimatorsArray);
}
}
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("Starting " + this._nativeAnimatorsArray.length + " animations " + (this._playSequentially ? "sequentially." : "together."), animation_common_1.traceCategories.Animation);
}
this._animatorSet.setupStartValues();
this._animatorSet.start();
return animationFinishedPromise;
};
Animation.prototype.cancel = function () {
if (!this.isPlaying) {
animation_common_1.traceWrite("Animation is not currently playing.", animation_common_1.traceCategories.Animation, animation_common_1.traceType.warn);
return;
}
animation_common_1.traceWrite("Cancelling AnimatorSet.", animation_common_1.traceCategories.Animation);
this._animatorSet.cancel();
};
Animation.prototype._resolveAnimationCurve = function (curve) {
return _resolveAnimationCurve(curve);
};
Animation.prototype._onAndroidAnimationEnd = function () {
if (!this.isPlaying) {
return;
}
this._propertyUpdateCallbacks.forEach(function (v) { return v(); });
this._resolveAnimationFinishedPromise();
if (this._target) {
this._target._removeAnimation(this);
}
};
Animation.prototype._onAndroidAnimationCancel = function () {
this._propertyResetCallbacks.forEach(function (v) { return v(); });
this._rejectAnimationFinishedPromise();
if (this._target) {
this._target._removeAnimation(this);
}
};
Animation.prototype._createAnimators = function (propertyAnimation) {
if (!propertyAnimation.target.nativeViewProtected) {
return;
}
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("Creating ObjectAnimator(s) for animation: " + Animation._getAnimationInfo(propertyAnimation) + "...", animation_common_1.traceCategories.Animation);
}
if (propertyAnimation.target === null || propertyAnimation.target === undefined) {
throw new Error("Animation target cannot be null or undefined; property: " + propertyAnimation.property + "; value: " + propertyAnimation.value + ";");
}
if (propertyAnimation.property === null || propertyAnimation.property === undefined) {
throw new Error("Animation property cannot be null or undefined; target: " + propertyAnimation.target + "; value: " + propertyAnimation.value + ";");
}
if (propertyAnimation.value === null || propertyAnimation.value === undefined) {
throw new Error("Animation value cannot be null or undefined; target: " + propertyAnimation.target + "; property: " + propertyAnimation.property + ";");
}
this._target = propertyAnimation.target;
var nativeArray;
var nativeView = propertyAnimation.target.nativeViewProtected;
var animators = new Array();
var propertyUpdateCallbacks = new Array();
var propertyResetCallbacks = new Array();
var originalValue1;
var originalValue2;
var density = utils_1.layout.getDisplayDensity();
var xyObjectAnimators;
var animatorSet;
var key = propertyKeys[propertyAnimation.property];
if (key) {
propertyAnimation.target[key] = propertyAnimation;
}
function checkAnimation(cb) {
return function () {
if (propertyAnimation.target[key] === propertyAnimation) {
delete propertyAnimation.target[key];
cb();
}
};
}
var setLocal = this._valueSource === "animation";
var style = propertyAnimation.target.style;
switch (propertyAnimation.property) {
case animation_common_1.Properties.opacity:
style_properties_1.opacityProperty._initDefaultNativeValue(style);
originalValue1 = nativeView.getAlpha();
nativeArray = Array.create("float", 1);
nativeArray[0] = propertyAnimation.value;
propertyUpdateCallbacks.push(checkAnimation(function () {
propertyAnimation.target.style[setLocal ? style_properties_1.opacityProperty.name : style_properties_1.opacityProperty.keyframe] = propertyAnimation.value;
}));
propertyResetCallbacks.push(checkAnimation(function () {
if (setLocal) {
propertyAnimation.target.style[style_properties_1.opacityProperty.name] = originalValue1;
}
else {
propertyAnimation.target.style[style_properties_1.opacityProperty.keyframe] = originalValue1;
}
if (propertyAnimation.target.nativeViewProtected) {
propertyAnimation.target[style_properties_1.opacityProperty.setNative](propertyAnimation.target.style.opacity);
}
}));
animators.push(android.animation.ObjectAnimator.ofFloat(nativeView, "alpha", nativeArray));
break;
case animation_common_1.Properties.backgroundColor:
style_properties_1.backgroundColorProperty._initDefaultNativeValue(style);
ensureArgbEvaluator();
originalValue1 = propertyAnimation.target.backgroundColor;
nativeArray = Array.create(java.lang.Object, 2);
nativeArray[0] = propertyAnimation.target.backgroundColor ? java.lang.Integer.valueOf(propertyAnimation.target.backgroundColor.argb) : java.lang.Integer.valueOf(-1);
nativeArray[1] = java.lang.Integer.valueOf(propertyAnimation.value.argb);
var animator = android.animation.ValueAnimator.ofObject(argbEvaluator, nativeArray);
animator.addUpdateListener(new android.animation.ValueAnimator.AnimatorUpdateListener({
onAnimationUpdate: function (animator) {
var argb = animator.getAnimatedValue().intValue();
propertyAnimation.target.style[setLocal ? style_properties_1.backgroundColorProperty.name : style_properties_1.backgroundColorProperty.keyframe] = new animation_common_1.Color(argb);
}
}));
propertyUpdateCallbacks.push(checkAnimation(function () {
propertyAnimation.target.style[setLocal ? style_properties_1.backgroundColorProperty.name : style_properties_1.backgroundColorProperty.keyframe] = propertyAnimation.value;
}));
propertyResetCallbacks.push(checkAnimation(function () {
if (setLocal) {
propertyAnimation.target.style[style_properties_1.backgroundColorProperty.name] = originalValue1;
}
else {
propertyAnimation.target.style[style_properties_1.backgroundColorProperty.keyframe] = originalValue1;
}
if (propertyAnimation.target.nativeViewProtected && propertyAnimation.target[style_properties_1.backgroundColorProperty.setNative]) {
propertyAnimation.target[style_properties_1.backgroundColorProperty.setNative](propertyAnimation.target.style.backgroundColor);
}
}));
animators.push(animator);
break;
case animation_common_1.Properties.translate:
style_properties_1.translateXProperty._initDefaultNativeValue(style);
style_properties_1.translateYProperty._initDefaultNativeValue(style);
xyObjectAnimators = Array.create(android.animation.Animator, 2);
nativeArray = Array.create("float", 1);
nativeArray[0] = propertyAnimation.value.x * density;
xyObjectAnimators[0] = android.animation.ObjectAnimator.ofFloat(nativeView, "translationX", nativeArray);
xyObjectAnimators[0].setRepeatCount(Animation._getAndroidRepeatCount(propertyAnimation.iterations));
nativeArray = Array.create("float", 1);
nativeArray[0] = propertyAnimation.value.y * density;
xyObjectAnimators[1] = android.animation.ObjectAnimator.ofFloat(nativeView, "translationY", nativeArray);
xyObjectAnimators[1].setRepeatCount(Animation._getAndroidRepeatCount(propertyAnimation.iterations));
originalValue1 = nativeView.getTranslationX() / density;
originalValue2 = nativeView.getTranslationY() / density;
propertyUpdateCallbacks.push(checkAnimation(function () {
propertyAnimation.target.style[setLocal ? style_properties_1.translateXProperty.name : style_properties_1.translateXProperty.keyframe] = propertyAnimation.value.x;
propertyAnimation.target.style[setLocal ? style_properties_1.translateYProperty.name : style_properties_1.translateYProperty.keyframe] = propertyAnimation.value.y;
}));
propertyResetCallbacks.push(checkAnimation(function () {
if (setLocal) {
propertyAnimation.target.style[style_properties_1.translateXProperty.name] = originalValue1;
propertyAnimation.target.style[style_properties_1.translateYProperty.name] = originalValue2;
}
else {
propertyAnimation.target.style[style_properties_1.translateXProperty.keyframe] = originalValue1;
propertyAnimation.target.style[style_properties_1.translateYProperty.keyframe] = originalValue2;
}
if (propertyAnimation.target.nativeViewProtected) {
propertyAnimation.target[style_properties_1.translateXProperty.setNative](propertyAnimation.target.style.translateX);
propertyAnimation.target[style_properties_1.translateYProperty.setNative](propertyAnimation.target.style.translateY);
}
}));
animatorSet = new android.animation.AnimatorSet();
animatorSet.playTogether(xyObjectAnimators);
animatorSet.setupStartValues();
animators.push(animatorSet);
break;
case animation_common_1.Properties.scale:
style_properties_1.scaleXProperty._initDefaultNativeValue(style);
style_properties_1.scaleYProperty._initDefaultNativeValue(style);
xyObjectAnimators = Array.create(android.animation.Animator, 2);
nativeArray = Array.create("float", 1);
nativeArray[0] = propertyAnimation.value.x;
xyObjectAnimators[0] = android.animation.ObjectAnimator.ofFloat(nativeView, "scaleX", nativeArray);
xyObjectAnimators[0].setRepeatCount(Animation._getAndroidRepeatCount(propertyAnimation.iterations));
nativeArray = Array.create("float", 1);
nativeArray[0] = propertyAnimation.value.y;
xyObjectAnimators[1] = android.animation.ObjectAnimator.ofFloat(nativeView, "scaleY", nativeArray);
xyObjectAnimators[1].setRepeatCount(Animation._getAndroidRepeatCount(propertyAnimation.iterations));
originalValue1 = nativeView.getScaleX();
originalValue2 = nativeView.getScaleY();
propertyUpdateCallbacks.push(checkAnimation(function () {
propertyAnimation.target.style[setLocal ? style_properties_1.scaleXProperty.name : style_properties_1.scaleXProperty.keyframe] = propertyAnimation.value.x;
propertyAnimation.target.style[setLocal ? style_properties_1.scaleYProperty.name : style_properties_1.scaleYProperty.keyframe] = propertyAnimation.value.y;
}));
propertyResetCallbacks.push(checkAnimation(function () {
if (setLocal) {
propertyAnimation.target.style[style_properties_1.scaleXProperty.name] = originalValue1;
propertyAnimation.target.style[style_properties_1.scaleYProperty.name] = originalValue2;
}
else {
propertyAnimation.target.style[style_properties_1.scaleXProperty.keyframe] = originalValue1;
propertyAnimation.target.style[style_properties_1.scaleYProperty.keyframe] = originalValue2;
}
if (propertyAnimation.target.nativeViewProtected) {
propertyAnimation.target[style_properties_1.scaleXProperty.setNative](propertyAnimation.target.style.scaleX);
propertyAnimation.target[style_properties_1.scaleYProperty.setNative](propertyAnimation.target.style.scaleY);
}
}));
animatorSet = new android.animation.AnimatorSet();
animatorSet.playTogether(xyObjectAnimators);
animatorSet.setupStartValues();
animators.push(animatorSet);
break;
case animation_common_1.Properties.rotate:
style_properties_1.rotateProperty._initDefaultNativeValue(style);
originalValue1 = nativeView.getRotation();
nativeArray = Array.create("float", 1);
nativeArray[0] = propertyAnimation.value;
propertyUpdateCallbacks.push(checkAnimation(function () {
propertyAnimation.target.style[setLocal ? style_properties_1.rotateProperty.name : style_properties_1.rotateProperty.keyframe] = propertyAnimation.value;
}));
propertyResetCallbacks.push(checkAnimation(function () {
if (setLocal) {
propertyAnimation.target.style[style_properties_1.rotateProperty.name] = originalValue1;
}
else {
propertyAnimation.target.style[style_properties_1.rotateProperty.keyframe] = originalValue1;
}
if (propertyAnimation.target.nativeViewProtected) {
propertyAnimation.target[style_properties_1.rotateProperty.setNative](propertyAnimation.target.style.rotate);
}
}));
animators.push(android.animation.ObjectAnimator.ofFloat(nativeView, "rotation", nativeArray));
break;
default:
throw new Error("Cannot animate " + propertyAnimation.property);
}
for (var i = 0, length_3 = animators.length; i < length_3; i++) {
if (propertyAnimation.duration !== undefined) {
animators[i].setDuration(propertyAnimation.duration);
}
if (propertyAnimation.delay !== undefined) {
animators[i].setStartDelay(propertyAnimation.delay);
}
if (propertyAnimation.iterations !== undefined && animators[i] instanceof android.animation.ValueAnimator) {
animators[i].setRepeatCount(Animation._getAndroidRepeatCount(propertyAnimation.iterations));
}
if (propertyAnimation.curve !== undefined) {
animators[i].setInterpolator(propertyAnimation.curve);
}
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("Animator created: " + animators[i], animation_common_1.traceCategories.Animation);
}
}
this._animators = this._animators.concat(animators);
this._propertyUpdateCallbacks = this._propertyUpdateCallbacks.concat(propertyUpdateCallbacks);
this._propertyResetCallbacks = this._propertyResetCallbacks.concat(propertyResetCallbacks);
};
Animation._getAndroidRepeatCount = function (iterations) {
return (iterations === Number.POSITIVE_INFINITY) ? android.view.animation.Animation.INFINITE : iterations - 1;
};
return Animation;
}(animation_common_1.AnimationBase));
exports.Animation = Animation;
//# sourceMappingURL=animation.android.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/animation/keyframe-animation.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var enums_1 = __webpack_require__("../node_modules/tns-core-modules/ui/enums/enums.js");
var trace_1 = __webpack_require__("../node_modules/tns-core-modules/trace/trace.js");
var properties_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/properties/properties.js");
var animation_1 = __webpack_require__("../node_modules/tns-core-modules/ui/animation/animation.js");
var style_properties_1 = __webpack_require__("../node_modules/tns-core-modules/ui/styling/style-properties.js");
var Keyframes = (function () {
function Keyframes() {
}
return Keyframes;
}());
exports.Keyframes = Keyframes;
var UnparsedKeyframe = (function () {
function UnparsedKeyframe() {
}
return UnparsedKeyframe;
}());
exports.UnparsedKeyframe = UnparsedKeyframe;
var KeyframeDeclaration = (function () {
function KeyframeDeclaration() {
}
return KeyframeDeclaration;
}());
exports.KeyframeDeclaration = KeyframeDeclaration;
var KeyframeInfo = (function () {
function KeyframeInfo() {
this.curve = enums_1.AnimationCurve.ease;
}
return KeyframeInfo;
}());
exports.KeyframeInfo = KeyframeInfo;
var KeyframeAnimationInfo = (function () {
function KeyframeAnimationInfo() {
this.name = "";
this.duration = 0.3;
this.delay = 0;
this.iterations = 1;
this.curve = "ease";
this.isForwards = false;
this.isReverse = false;
}
return KeyframeAnimationInfo;
}());
exports.KeyframeAnimationInfo = KeyframeAnimationInfo;
var KeyframeAnimation = (function () {
function KeyframeAnimation() {
this.delay = 0;
this.iterations = 1;
}
KeyframeAnimation.keyframeAnimationFromInfo = function (info) {
var length = info.keyframes.length;
var animations = new Array();
var startDuration = 0;
if (info.isReverse) {
for (var index_1 = length - 1; index_1 >= 0; index_1--) {
var keyframe = info.keyframes[index_1];
startDuration = KeyframeAnimation.parseKeyframe(info, keyframe, animations, startDuration);
}
}
else {
for (var index_2 = 0; index_2 < length; index_2++) {
var keyframe = info.keyframes[index_2];
startDuration = KeyframeAnimation.parseKeyframe(info, keyframe, animations, startDuration);
}
for (var index_3 = length - 1; index_3 > 0; index_3--) {
var a1 = animations[index_3];
var a2 = animations[index_3 - 1];
if (a2["curve"] !== undefined) {
a1["curve"] = a2["curve"];
a2["curve"] = undefined;
}
}
}
animations.map(function (a) { return a["curve"] ? a : Object.assign(a, { curve: info.curve }); });
var animation = new KeyframeAnimation();
animation.delay = info.delay;
animation.iterations = info.iterations;
animation.animations = animations;
animation._isForwards = info.isForwards;
return animation;
};
KeyframeAnimation.parseKeyframe = function (info, keyframe, animations, startDuration) {
var animation = {};
for (var _i = 0, _a = keyframe.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
animation[declaration.property] = declaration.value;
}
var duration = keyframe.duration;
if (duration === 0) {
duration = 0.01;
}
else {
duration = (info.duration * duration) - startDuration;
startDuration += duration;
}
animation.duration = info.isReverse ? info.duration - duration : duration;
animation.curve = keyframe.curve;
animation.forceLayer = true;
animation.valueSource = "keyframe";
animations.push(animation);
return startDuration;
};
Object.defineProperty(KeyframeAnimation.prototype, "isPlaying", {
get: function () {
return this._isPlaying;
},
enumerable: true,
configurable: true
});
KeyframeAnimation.prototype.cancel = function () {
if (!this.isPlaying) {
trace_1.write("Keyframe animation is already playing.", trace_1.categories.Animation, trace_1.messageType.warn);
return;
}
this._isPlaying = false;
for (var i = this._nativeAnimations.length - 1; i >= 0; i--) {
var animation = this._nativeAnimations[i];
if (animation.isPlaying) {
animation.cancel();
}
}
if (this._nativeAnimations.length > 0) {
var animation = this._nativeAnimations[0];
this._resetAnimationValues(this._target, animation);
}
this._resetAnimations();
};
KeyframeAnimation.prototype.play = function (view) {
var _this = this;
if (this._isPlaying) {
trace_1.write("Keyframe animation is already playing.", trace_1.categories.Animation, trace_1.messageType.warn);
return new Promise(function (resolve) {
resolve();
});
}
var animationFinishedPromise = new Promise(function (resolve) {
_this._resolve = resolve;
});
this._isPlaying = true;
this._nativeAnimations = new Array();
this._target = view;
if (this.delay !== 0) {
setTimeout(function () { return _this.animate(view, 0, _this.iterations); }, this.delay);
}
else {
this.animate(view, 0, this.iterations);
}
return animationFinishedPromise;
};
KeyframeAnimation.prototype.animate = function (view, index, iterations) {
var _this = this;
if (!this._isPlaying) {
return;
}
if (index === 0) {
var animation = this.animations[0];
if ("backgroundColor" in animation) {
view.style[style_properties_1.backgroundColorProperty.keyframe] = animation.backgroundColor;
}
if ("scale" in animation) {
view.style[style_properties_1.scaleXProperty.keyframe] = animation.scale.x;
view.style[style_properties_1.scaleYProperty.keyframe] = animation.scale.y;
}
if ("translate" in animation) {
view.style[style_properties_1.translateXProperty.keyframe] = animation.translate.x;
view.style[style_properties_1.translateYProperty.keyframe] = animation.translate.y;
}
if ("rotate" in animation) {
view.style[style_properties_1.rotateProperty.keyframe] = animation.rotate;
}
if ("opacity" in animation) {
view.style[style_properties_1.opacityProperty.keyframe] = animation.opacity;
}
setTimeout(function () { return _this.animate(view, 1, iterations); }, 1);
}
else if (index < 0 || index >= this.animations.length) {
iterations -= 1;
if (iterations > 0) {
this.animate(view, 0, iterations);
}
else {
if (this._isForwards === false) {
var animation = this.animations[this.animations.length - 1];
this._resetAnimationValues(view, animation);
}
this._resolveAnimationFinishedPromise();
}
}
else {
var animation = void 0;
var cachedAnimation = this._nativeAnimations[index - 1];
if (cachedAnimation) {
animation = cachedAnimation;
}
else {
var animationDef = this.animations[index];
animationDef.target = view;
animation = new animation_1.Animation([animationDef]);
this._nativeAnimations.push(animation);
}
animation.play().then(function () {
_this.animate(view, index + 1, iterations);
}, function (error) {
trace_1.write(typeof error === "string" ? error : error.message, trace_1.categories.Animation, trace_1.messageType.warn);
}).catch(function (error) {
trace_1.write(typeof error === "string" ? error : error.message, trace_1.categories.Animation, trace_1.messageType.warn);
});
}
};
KeyframeAnimation.prototype._resolveAnimationFinishedPromise = function () {
this._nativeAnimations = new Array();
this._isPlaying = false;
this._target = null;
this._resolve();
};
KeyframeAnimation.prototype._resetAnimations = function () {
this._nativeAnimations = new Array();
this._isPlaying = false;
this._target = null;
};
KeyframeAnimation.prototype._resetAnimationValues = function (view, animation) {
if ("backgroundColor" in animation) {
view.style[style_properties_1.backgroundColorProperty.keyframe] = properties_1.unsetValue;
}
if ("scale" in animation) {
view.style[style_properties_1.scaleXProperty.keyframe] = properties_1.unsetValue;
view.style[style_properties_1.scaleYProperty.keyframe] = properties_1.unsetValue;
}
if ("translate" in animation) {
view.style[style_properties_1.translateXProperty.keyframe] = properties_1.unsetValue;
view.style[style_properties_1.translateYProperty.keyframe] = properties_1.unsetValue;
}
if ("rotate" in animation) {
view.style[style_properties_1.rotateProperty.keyframe] = properties_1.unsetValue;
}
if ("opacity" in animation) {
view.style[style_properties_1.opacityProperty.keyframe] = properties_1.unsetValue;
}
};
return KeyframeAnimation;
}());
exports.KeyframeAnimation = KeyframeAnimation;
//# sourceMappingURL=keyframe-animation.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/border/border.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var content_view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/content-view/content-view.js");
var Border = (function (_super) {
__extends(Border, _super);
function Border() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(Border.prototype, "cornerRadius", {
get: function () {
if (typeof this.borderRadius === "number") {
return this.borderRadius;
}
return 0;
},
set: function (value) {
this.borderRadius = value;
},
enumerable: true,
configurable: true
});
Border.prototype.onMeasure = function (widthMeasureSpec, heightMeasureSpec) {
var width = content_view_1.layout.getMeasureSpecSize(widthMeasureSpec);
var widthMode = content_view_1.layout.getMeasureSpecMode(widthMeasureSpec);
var height = content_view_1.layout.getMeasureSpecSize(heightMeasureSpec);
var heightMode = content_view_1.layout.getMeasureSpecMode(heightMeasureSpec);
var horizontalBorderLength = this.effectiveBorderLeftWidth + this.effectiveBorderRightWidth;
var verticalBorderLength = this.effectiveBorderTopWidth + this.effectiveBorderBottomWidth;
var result = content_view_1.View.measureChild(this, this.layoutView, content_view_1.layout.makeMeasureSpec(width - horizontalBorderLength, widthMode), content_view_1.layout.makeMeasureSpec(height - verticalBorderLength, heightMode));
var widthAndState = content_view_1.View.resolveSizeAndState(result.measuredWidth + horizontalBorderLength, width, widthMode, 0);
var heightAndState = content_view_1.View.resolveSizeAndState(result.measuredHeight + verticalBorderLength, height, heightMode, 0);
this.setMeasuredDimension(widthAndState, heightAndState);
};
Border.prototype.onLayout = function (left, top, right, bottom) {
var horizontalBorderLength = this.effectiveBorderLeftWidth + this.effectiveBorderRightWidth;
var verticalBorderLength = this.effectiveBorderTopWidth + this.effectiveBorderBottomWidth;
content_view_1.View.layoutChild(this, this.layoutView, this.effectiveBorderLeftWidth, this.effectiveBorderTopWidth, right - left - horizontalBorderLength, bottom - top - verticalBorderLength);
};
Border = __decorate([
Deprecated,
content_view_1.CSSType("Border")
], Border);
return Border;
}(content_view_1.ContentView));
exports.Border = Border;
Border.prototype.recycleNativeView = "auto";
//# sourceMappingURL=border.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/builder/binding-builder.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var expressionSymbolsRegex = /[\+\-\*\/%\?:<>=!\|&\(\)^~]/;
var bindingConstants;
(function (bindingConstants) {
bindingConstants.sourceProperty = "sourceProperty";
bindingConstants.targetProperty = "targetProperty";
bindingConstants.expression = "expression";
bindingConstants.twoWay = "twoWay";
bindingConstants.source = "source";
bindingConstants.bindingValueKey = "$value";
bindingConstants.parentValueKey = "$parent";
bindingConstants.parentsValueKey = "$parents";
bindingConstants.newPropertyValueKey = "$newPropertyValue";
})(bindingConstants = exports.bindingConstants || (exports.bindingConstants = {}));
;
var hasEqualSignRegex = /=+/;
var equalSignComparisionOperatorsRegex = /(==|===|>=|<=|!=|!==)/;
exports.parentsRegex = /\$parents\s*\[\s*(['"]*)\w*\1\s*\]/g;
function isNamedParam(value) {
var equalSignIndex = value.search(hasEqualSignRegex);
if (equalSignIndex > -1) {
var equalSignSurround = value.substr(equalSignIndex > 0 ? equalSignIndex - 1 : 0, 3);
if (equalSignSurround.search(equalSignComparisionOperatorsRegex) === -1) {
return true;
}
}
return false;
}
function areNamedParams(params) {
var i;
for (i = 0; i < params.length; i++) {
if (isNamedParam(params[i])) {
return true;
}
}
return false;
}
var namedParamConstants = {
propName: "propName",
propValue: "propValue"
};
function getPropertyNameValuePair(param, knownOptions, callback) {
var nameValuePair = {};
var propertyName = param.substr(0, param.indexOf("=")).trim();
var propertyValue = param.substr(param.indexOf("=") + 1).trim();
if (knownOptions) {
if (!propertyName) {
propertyName = knownOptions.defaultProperty;
}
else {
propertyName = propertyName in knownOptions ? propertyName : null;
}
}
if (propertyName) {
if (callback) {
nameValuePair = callback(propertyName, propertyValue);
}
else {
nameValuePair[namedParamConstants.propName] = propertyName;
nameValuePair[namedParamConstants.propValue] = propertyValue;
}
return nameValuePair;
}
return null;
}
function parseNamedProperties(parameterList, knownOptions, callback) {
var result = {};
var i;
for (i = 0; i < parameterList.length; i++) {
var nameValuePair = getPropertyNameValuePair(parameterList[i], knownOptions, callback);
if (nameValuePair) {
result[nameValuePair[namedParamConstants.propName]] = nameValuePair[namedParamConstants.propValue];
}
}
return result;
}
function getParamsArray(value) {
var result = [];
var i;
var skipComma = 0;
var indexReached = 0;
var singleQuoteBlock, doubleQuoteBlock = false;
for (i = 0; i < value.length; i++) {
if (value[i] === "\"") {
doubleQuoteBlock = !doubleQuoteBlock;
}
if (value[i] === "'") {
singleQuoteBlock = !singleQuoteBlock;
}
if (value[i] === "(" || value[i] === "[") {
skipComma++;
}
if (value[i] === ")" || value[i] === "]") {
skipComma--;
}
if (value[i] === "," && skipComma === 0 && !(singleQuoteBlock || doubleQuoteBlock)) {
result.push(value.substr(indexReached, i - indexReached));
indexReached = i + 1;
}
}
result.push(value.substr(indexReached));
return result;
}
function isExpression(expression) {
if (expression.search(expressionSymbolsRegex) > -1) {
var parentsMatches = expression.match(exports.parentsRegex);
if (parentsMatches) {
var restOfExpression = expression.substr(expression.indexOf(parentsMatches[0]) + parentsMatches[0].length);
if (!(restOfExpression.search(expressionSymbolsRegex) > -1)) {
return false;
}
}
return true;
}
return false;
}
function getBindingOptions(name, value) {
var namedParams = [];
var params = getParamsArray(value);
if (!areNamedParams(params)) {
if (params.length === 1) {
var trimmedValue = params[0].trim();
var sourceProp;
if (isExpression(trimmedValue)) {
sourceProp = bindingConstants.bindingValueKey;
namedParams.push(bindingConstants.expression + " = " + trimmedValue);
}
else {
sourceProp = trimmedValue;
}
namedParams.push(bindingConstants.sourceProperty + " = " + sourceProp);
namedParams.push(bindingConstants.twoWay + " = true");
}
else {
namedParams.push(bindingConstants.sourceProperty + " = " + params[0].trim());
namedParams.push(bindingConstants.expression + " = " + params[1].trim());
var twoWay = params[2] ? params[2].toLowerCase().trim() === "true" : true;
namedParams.push(bindingConstants.twoWay + " = " + twoWay);
}
}
else {
namedParams = params;
}
var bindingPropertyHandler = function (prop, value) {
var result = {};
result[namedParamConstants.propName] = prop;
if (prop === bindingConstants.twoWay) {
if (value === "true") {
result[namedParamConstants.propValue] = true;
}
else {
result[namedParamConstants.propValue] = false;
}
}
else {
result[namedParamConstants.propValue] = value;
}
return result;
};
var bindingOptionsParameters = parseNamedProperties(namedParams, xmlBindingProperties, bindingPropertyHandler);
var bindOptions = {
targetProperty: name
};
for (var prop in bindingOptionsParameters) {
if (bindingOptionsParameters.hasOwnProperty(prop)) {
bindOptions[prop] = bindingOptionsParameters[prop];
}
}
if (bindOptions[bindingConstants.twoWay] === undefined) {
bindOptions[bindingConstants.twoWay] = true;
}
return bindOptions;
}
exports.getBindingOptions = getBindingOptions;
var xmlBindingProperties = {
sourceProperty: true,
expression: true,
twoWay: true,
source: true,
defaultProperty: bindingConstants.sourceProperty
};
//# sourceMappingURL=binding-builder.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/builder/builder.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
var debug_1 = __webpack_require__("../node_modules/tns-core-modules/utils/debug.js");
var xml = __webpack_require__("../node_modules/tns-core-modules/xml/xml.js");
var file_system_1 = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system.js");
var types_1 = __webpack_require__("../node_modules/tns-core-modules/utils/types.js");
var component_builder_1 = __webpack_require__("../node_modules/tns-core-modules/ui/builder/component-builder/component-builder.js");
var platform_1 = __webpack_require__("../node_modules/tns-core-modules/platform/platform.js");
var file_name_resolver_1 = __webpack_require__("../node_modules/tns-core-modules/file-system/file-name-resolver/file-name-resolver.js");
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
var ios = platform_1.platformNames.ios.toLowerCase();
var android = platform_1.platformNames.android.toLowerCase();
var defaultNameSpaceMatcher = /tns\.xsd$/i;
var trace;
function ensureTrace() {
if (!trace) {
trace = __webpack_require__("../node_modules/tns-core-modules/trace/trace.js");
}
}
function parse(value, context) {
if (typeof value === "function") {
return value();
}
else {
var exports_1 = context ? getExports(context) : undefined;
var componentModule = parseInternal(value, exports_1);
return componentModule && componentModule.component;
}
}
exports.parse = parse;
function parseMultipleTemplates(value, context) {
var dummyComponent = "<ListView><ListView.itemTemplates>" + value + "</ListView.itemTemplates></ListView>";
return parseInternal(dummyComponent, context).component["itemTemplates"];
}
exports.parseMultipleTemplates = parseMultipleTemplates;
function load(pathOrOptions, context) {
var componentModule;
if (!context) {
if (typeof pathOrOptions === "string") {
componentModule = loadInternal(pathOrOptions);
}
else {
componentModule = loadCustomComponent(pathOrOptions.path, pathOrOptions.name, pathOrOptions.attributes, pathOrOptions.exports, pathOrOptions.page, true);
}
}
else {
var path_1 = pathOrOptions;
componentModule = loadInternal(path_1, context);
}
return componentModule && componentModule.component;
}
exports.load = load;
function loadPage(moduleNamePath, fileName, context) {
var componentModule = loadInternal(fileName, context, moduleNamePath);
return componentModule && componentModule.component;
}
exports.loadPage = loadPage;
var loadModule = profiling_1.profile("loadModule", function (moduleNamePath, entry) {
if (global.moduleExists(entry.moduleName)) {
return global.loadModule(entry.moduleName);
}
else {
var moduleExportsResolvedPath = file_name_resolver_1.resolveFileName(moduleNamePath, "js");
if (moduleExportsResolvedPath) {
moduleExportsResolvedPath = moduleExportsResolvedPath.substr(0, moduleExportsResolvedPath.length - 3);
return global.loadModule(moduleExportsResolvedPath);
}
}
return null;
});
var viewFromBuilder = profiling_1.profile("viewFromBuilder", function (moduleNamePath, moduleExports) {
var fileName = file_name_resolver_1.resolveFileName(moduleNamePath, "xml");
return loadPage(moduleNamePath, fileName, moduleExports);
});
exports.createViewFromEntry = profiling_1.profile("createViewFromEntry", function (entry) {
if (entry.create) {
return createView(entry);
}
else if (entry.moduleName) {
var currentAppPath = file_system_1.knownFolders.currentApp().path;
var moduleNamePath = file_system_1.path.join(currentAppPath, entry.moduleName);
var moduleExports = loadModule(moduleNamePath, entry);
if (moduleExports && moduleExports.createPage) {
return moduleCreateView(moduleNamePath, moduleExports);
}
else {
return viewFromBuilder(moduleNamePath, moduleExports);
}
}
throw new Error("Failed to load page XML file for module: " + entry.moduleName);
});
var createView = profiling_1.profile("entry.create", function (entry) {
var view = entry.create();
if (!view) {
throw new Error("Failed to create Page with entry.create() function.");
}
return view;
});
var moduleCreateView = profiling_1.profile("module.createView", function (moduleNamePath, moduleExports) {
var view = moduleExports.createPage();
var cssFileName = file_name_resolver_1.resolveFileName(moduleNamePath, "css");
if (cssFileName) {
view.addCssFile(cssFileName);
}
return view;
});
function loadInternal(fileName, context, moduleNamePath) {
var componentModule;
var appPath = file_system_1.knownFolders.currentApp().path;
var filePathRelativeToApp = (moduleNamePath && moduleNamePath.startsWith(appPath) ? "./" + moduleNamePath.substr(appPath.length + 1) : moduleNamePath) + ".xml";
if (global.moduleExists(filePathRelativeToApp)) {
var text = global.loadModule(filePathRelativeToApp);
componentModule = parseInternal(text, context, fileName, moduleNamePath);
}
else if (fileName && file_system_1.File.exists(fileName)) {
var file = file_system_1.File.fromPath(fileName);
var text_1 = file.readTextSync(function (error) { throw new Error("Error loading file " + fileName + " :" + error.message); });
componentModule = parseInternal(text_1, context, fileName, moduleNamePath);
}
if (componentModule && componentModule.component) {
componentModule.component.exports = context;
}
return componentModule;
}
function loadCustomComponent(componentPath, componentName, attributes, context, parentPage, isRootComponent, moduleNamePath) {
if (isRootComponent === void 0) { isRootComponent = true; }
if (!parentPage && context) {
parentPage = context["_parentPage"];
delete context["_parentPage"];
}
var result;
componentPath = componentPath.replace("~/", "");
var moduleName = componentPath + "/" + componentName;
var xmlModuleName = moduleName + ".xml";
var fullComponentPathFilePathWithoutExt = componentPath;
if (!file_system_1.File.exists(componentPath) || componentPath === "." || componentPath === "./") {
fullComponentPathFilePathWithoutExt = file_system_1.path.join(file_system_1.knownFolders.currentApp().path, componentPath, componentName);
}
var xmlFilePath = file_name_resolver_1.resolveFileName(fullComponentPathFilePathWithoutExt, "xml");
if (xmlFilePath || global.moduleExists(xmlModuleName)) {
var subExports = context;
if (global.moduleExists(moduleName)) {
subExports = global.loadModule(moduleName);
}
else {
var jsFilePath = file_name_resolver_1.resolveFileName(fullComponentPathFilePathWithoutExt, "js");
if (jsFilePath) {
subExports = global.loadModule(jsFilePath);
}
}
if (!subExports) {
subExports = {};
}
subExports["_parentPage"] = parentPage;
result = xmlFilePath ?
loadInternal(xmlFilePath, subExports) :
loadInternal(xmlFilePath, subExports, moduleName);
if (types_1.isDefined(result) && types_1.isDefined(result.component) && types_1.isDefined(attributes)) {
for (var attr in attributes) {
component_builder_1.setPropertyValue(result.component, subExports, context, attr, attributes[attr]);
}
}
}
else {
result = component_builder_1.getComponentModule(componentName, componentPath, attributes, context, moduleNamePath, isRootComponent);
}
var cssModulePath = fullComponentPathFilePathWithoutExt + ".css";
if (cssModulePath.startsWith("/")) {
var app = file_system_1.knownFolders.currentApp().path + "/";
if (cssModulePath.startsWith(app)) {
cssModulePath = "./" + cssModulePath.substr(app.length);
}
}
if (global.moduleExists(cssModulePath)) {
parentPage.addCssFile(cssModulePath);
}
else {
var cssFilePath = file_name_resolver_1.resolveFileName(fullComponentPathFilePathWithoutExt, "css");
if (cssFilePath) {
if (parentPage && typeof parentPage.addCssFile === "function") {
parentPage.addCssFile(cssFilePath);
}
else {
ensureTrace();
trace.write("CSS file found but no page specified. Please specify page in the options!", trace.categories.Error, trace.messageType.error);
}
}
}
return result;
}
function getExports(instance) {
var isView = !!instance._domId;
if (!isView) {
return instance.exports || instance;
}
var exportObject = instance.exports;
var parent = instance.parent;
while (exportObject === undefined && parent) {
exportObject = parent.exports;
parent = parent.parent;
}
return exportObject;
}
function parseInternal(value, context, uri, moduleNamePath) {
var start;
var ui;
var errorFormat = (debug_1.debug && uri) ? xml2ui.SourceErrorFormat(uri) : xml2ui.PositionErrorFormat;
var componentSourceTracker = (debug_1.debug && uri) ? xml2ui.ComponentSourceTracker(uri) : function () {
};
(start = new xml2ui.XmlStringParser(errorFormat))
.pipe(new xml2ui.PlatformFilter())
.pipe(new xml2ui.XmlStateParser(ui = new xml2ui.ComponentParser(context, errorFormat, componentSourceTracker, moduleNamePath)));
start.parse(value);
return ui.rootComponentModule;
}
var xml2ui;
(function (xml2ui) {
var XmlProducerBase = (function () {
function XmlProducerBase() {
}
XmlProducerBase.prototype.pipe = function (next) {
this._next = next;
return next;
};
XmlProducerBase.prototype.next = function (args) {
this._next.parse(args);
};
return XmlProducerBase;
}());
xml2ui.XmlProducerBase = XmlProducerBase;
var XmlStringParser = (function (_super) {
__extends(XmlStringParser, _super);
function XmlStringParser(error) {
var _this = _super.call(this) || this;
_this.error = error || PositionErrorFormat;
return _this;
}
XmlStringParser.prototype.parse = function (value) {
var _this = this;
var xmlParser = new xml.XmlParser(function (args) {
try {
_this.next(args);
}
catch (e) {
throw _this.error(e, args.position);
}
}, function (e, p) {
throw _this.error(e, p);
}, true);
if (types_1.isString(value)) {
xmlParser.parse(value);
}
};
return XmlStringParser;
}(XmlProducerBase));
xml2ui.XmlStringParser = XmlStringParser;
function PositionErrorFormat(e, p) {
return new debug_1.ScopeError(e, "Parsing XML at " + p.line + ":" + p.column);
}
xml2ui.PositionErrorFormat = PositionErrorFormat;
function SourceErrorFormat(uri) {
return function (e, p) {
var source = p ? new debug_1.Source(uri, p.line, p.column) : new debug_1.Source(uri, -1, -1);
e = new debug_1.SourceError(e, source, "Building UI from XML.");
return e;
};
}
xml2ui.SourceErrorFormat = SourceErrorFormat;
function ComponentSourceTracker(uri) {
return function (component, p) {
if (!debug_1.Source.get(component)) {
var source = p ? new debug_1.Source(uri, p.line, p.column) : new debug_1.Source(uri, -1, -1);
debug_1.Source.set(component, source);
}
};
}
xml2ui.ComponentSourceTracker = ComponentSourceTracker;
var PlatformFilter = (function (_super) {
__extends(PlatformFilter, _super);
function PlatformFilter() {
return _super !== null && _super.apply(this, arguments) || this;
}
PlatformFilter.prototype.parse = function (args) {
if (args.eventType === xml.ParserEventType.StartElement) {
if (PlatformFilter.isPlatform(args.elementName)) {
if (this.currentPlatformContext) {
throw new Error("Already in '" + this.currentPlatformContext + "' platform context and cannot switch to '" + args.elementName + "' platform! Platform tags cannot be nested.");
}
this.currentPlatformContext = args.elementName;
return;
}
}
if (args.eventType === xml.ParserEventType.EndElement) {
if (PlatformFilter.isPlatform(args.elementName)) {
this.currentPlatformContext = undefined;
return;
}
}
if (this.currentPlatformContext && !PlatformFilter.isCurentPlatform(this.currentPlatformContext)) {
return;
}
this.next(args);
};
PlatformFilter.isPlatform = function (value) {
if (value) {
var toLower = value.toLowerCase();
return toLower === android || toLower === ios;
}
return false;
};
PlatformFilter.isCurentPlatform = function (value) {
return value && value.toLowerCase() === platform_1.device.os.toLowerCase();
};
return PlatformFilter;
}(XmlProducerBase));
xml2ui.PlatformFilter = PlatformFilter;
var XmlArgsReplay = (function (_super) {
__extends(XmlArgsReplay, _super);
function XmlArgsReplay(args, errorFormat) {
var _this = _super.call(this) || this;
_this.args = args;
_this.error = errorFormat;
return _this;
}
XmlArgsReplay.prototype.replay = function () {
var _this = this;
this.args.forEach(function (args) {
try {
_this.next(args);
}
catch (e) {
throw _this.error(e, args.position);
}
});
};
return XmlArgsReplay;
}(XmlProducerBase));
xml2ui.XmlArgsReplay = XmlArgsReplay;
var XmlStateParser = (function () {
function XmlStateParser(state) {
this.state = state;
}
XmlStateParser.prototype.parse = function (args) {
this.state = this.state.parse(args);
};
return XmlStateParser;
}());
xml2ui.XmlStateParser = XmlStateParser;
var TemplateParser = (function () {
function TemplateParser(parent, templateProperty, setTemplateProperty) {
if (setTemplateProperty === void 0) { setTemplateProperty = true; }
this.parent = parent;
this._context = templateProperty.context;
this._recordedXmlStream = new Array();
this._templateProperty = templateProperty;
this._nestingLevel = 0;
this._state = 0;
this._setTemplateProperty = setTemplateProperty;
}
TemplateParser.prototype.parse = function (args) {
if (args.eventType === xml.ParserEventType.StartElement) {
this.parseStartElement(args.prefix, args.namespace, args.elementName, args.attributes);
}
else if (args.eventType === xml.ParserEventType.EndElement) {
this.parseEndElement(args.prefix, args.elementName);
}
this._recordedXmlStream.push(args);
return this._state === 2 ? this.parent : this;
};
Object.defineProperty(TemplateParser.prototype, "elementName", {
get: function () {
return this._templateProperty.elementName;
},
enumerable: true,
configurable: true
});
TemplateParser.prototype.parseStartElement = function (prefix, namespace, elementName, attributes) {
if (this._state === 0) {
this._state = 1;
}
else if (this._state === 2) {
throw new Error("Template must have exactly one root element but multiple elements were found.");
}
this._nestingLevel++;
};
TemplateParser.prototype.parseEndElement = function (prefix, elementName) {
if (this._state === 0) {
throw new Error("Template must have exactly one root element but none was found.");
}
else if (this._state === 2) {
throw new Error("No more closing elements expected for this template.");
}
this._nestingLevel--;
if (this._nestingLevel === 0) {
this._state = 2;
if (this._setTemplateProperty && this._templateProperty.name in this._templateProperty.parent.component) {
var template = this.buildTemplate();
this._templateProperty.parent.component[this._templateProperty.name] = template;
}
}
};
TemplateParser.prototype.buildTemplate = function () {
var _this = this;
var context = this._context;
var errorFormat = this._templateProperty.errorFormat;
var sourceTracker = this._templateProperty.sourceTracker;
var template = profiling_1.profile("Template()", function () {
var start;
var ui;
(start = new xml2ui.XmlArgsReplay(_this._recordedXmlStream, errorFormat))
.pipe(new XmlStateParser(ui = new ComponentParser(context, errorFormat, sourceTracker)));
start.replay();
return ui.rootComponentModule.component;
});
return template;
};
return TemplateParser;
}());
xml2ui.TemplateParser = TemplateParser;
var MultiTemplateParser = (function () {
function MultiTemplateParser(parent, templateProperty) {
this.parent = parent;
this.templateProperty = templateProperty;
this._childParsers = new Array();
}
Object.defineProperty(MultiTemplateParser.prototype, "value", {
get: function () { return this._value; },
enumerable: true,
configurable: true
});
MultiTemplateParser.prototype.parse = function (args) {
if (args.eventType === xml.ParserEventType.StartElement && args.elementName === "template") {
var childParser = new TemplateParser(this, this.templateProperty, false);
childParser["key"] = args.attributes["key"];
this._childParsers.push(childParser);
return childParser;
}
if (args.eventType === xml.ParserEventType.EndElement) {
var name_1 = ComponentParser.getComplexPropertyName(args.elementName);
if (name_1 === this.templateProperty.name) {
var templates = new Array();
for (var i = 0; i < this._childParsers.length; i++) {
templates.push({
key: this._childParsers[i]["key"],
createView: this._childParsers[i].buildTemplate()
});
}
this._value = templates;
return this.parent.parse(args);
}
}
return this;
};
return MultiTemplateParser;
}());
xml2ui.MultiTemplateParser = MultiTemplateParser;
var ComponentParser = (function () {
function ComponentParser(context, errorFormat, sourceTracker, moduleNamePath) {
this.moduleNamePath = moduleNamePath;
this.parents = new Array();
this.complexProperties = new Array();
this.context = context;
this.error = errorFormat;
this.sourceTracker = sourceTracker;
}
ComponentParser.prototype.buildComponent = function (args) {
if (args.prefix && args.namespace) {
return loadCustomComponent(args.namespace, args.elementName, args.attributes, this.context, this.currentRootView, !this.currentRootView, this.moduleNamePath);
}
else {
var namespace = args.namespace;
if (defaultNameSpaceMatcher.test(namespace || "")) {
namespace = undefined;
}
return component_builder_1.getComponentModule(args.elementName, namespace, args.attributes, this.context, this.moduleNamePath, !this.currentRootView);
}
};
ComponentParser.prototype.parse = function (args) {
var parent = this.parents[this.parents.length - 1];
var complexProperty = this.complexProperties[this.complexProperties.length - 1];
if (args.eventType === xml.ParserEventType.StartElement) {
if (ComponentParser.isComplexProperty(args.elementName)) {
var name = ComponentParser.getComplexPropertyName(args.elementName);
var complexProperty_1 = {
parent: parent,
name: name,
items: []
};
this.complexProperties.push(complexProperty_1);
if (ComponentParser.isKnownTemplate(name, parent.exports)) {
return new TemplateParser(this, {
context: (parent ? getExports(parent.component) : null) || this.context,
parent: parent,
name: name,
elementName: args.elementName,
templateItems: [],
errorFormat: this.error,
sourceTracker: this.sourceTracker
});
}
if (ComponentParser.isKnownMultiTemplate(name, parent.exports)) {
var parser = new MultiTemplateParser(this, {
context: (parent ? getExports(parent.component) : null) || this.context,
parent: parent,
name: name,
elementName: args.elementName,
templateItems: [],
errorFormat: this.error,
sourceTracker: this.sourceTracker
});
complexProperty_1.parser = parser;
return parser;
}
}
else {
var componentModule = this.buildComponent(args);
if (componentModule) {
this.sourceTracker(componentModule.component, args.position);
if (parent) {
if (complexProperty) {
ComponentParser.addToComplexProperty(parent, complexProperty, componentModule);
}
else if (parent.component._addChildFromBuilder) {
parent.component._addChildFromBuilder(args.elementName, componentModule.component);
}
}
else if (this.parents.length === 0) {
this.rootComponentModule = componentModule;
if (this.rootComponentModule) {
this.currentRootView = this.rootComponentModule.component;
if (this.currentRootView.exports) {
this.context = this.currentRootView.exports;
}
}
}
this.parents.push(componentModule);
}
}
}
else if (args.eventType === xml.ParserEventType.EndElement) {
if (ComponentParser.isComplexProperty(args.elementName)) {
if (complexProperty) {
if (complexProperty.parser) {
parent.component[complexProperty.name] = complexProperty.parser.value;
}
else if (parent && parent.component._addArrayFromBuilder) {
parent.component._addArrayFromBuilder(complexProperty.name, complexProperty.items);
complexProperty.items = [];
}
}
this.complexProperties.pop();
}
else {
this.parents.pop();
}
}
return this;
};
ComponentParser.isComplexProperty = function (name) {
return types_1.isString(name) && name.indexOf(".") !== -1;
};
ComponentParser.getComplexPropertyName = function (fullName) {
var name;
if (types_1.isString(fullName)) {
var names = fullName.split(".");
name = names[names.length - 1];
}
return name;
};
ComponentParser.isKnownTemplate = function (name, exports) {
return ComponentParser.KNOWNTEMPLATES in exports && exports[ComponentParser.KNOWNTEMPLATES] && name in exports[ComponentParser.KNOWNTEMPLATES];
};
ComponentParser.isKnownMultiTemplate = function (name, exports) {
return ComponentParser.KNOWNMULTITEMPLATES in exports && exports[ComponentParser.KNOWNMULTITEMPLATES] && name in exports[ComponentParser.KNOWNMULTITEMPLATES];
};
ComponentParser.addToComplexProperty = function (parent, complexProperty, elementModule) {
var parentComponent = parent.component;
if (ComponentParser.isKnownCollection(complexProperty.name, parent.exports)) {
complexProperty.items.push(elementModule.component);
}
else if (parentComponent._addChildFromBuilder) {
parentComponent._addChildFromBuilder(complexProperty.name, elementModule.component);
}
else {
parentComponent[complexProperty.name] = elementModule.component;
}
};
ComponentParser.isKnownCollection = function (name, context) {
return ComponentParser.KNOWNCOLLECTIONS in context && context[ComponentParser.KNOWNCOLLECTIONS] && name in context[ComponentParser.KNOWNCOLLECTIONS];
};
ComponentParser.KNOWNCOLLECTIONS = "knownCollections";
ComponentParser.KNOWNTEMPLATES = "knownTemplates";
ComponentParser.KNOWNMULTITEMPLATES = "knownMultiTemplates";
__decorate([
profiling_1.profile
], ComponentParser.prototype, "buildComponent", null);
return ComponentParser;
}());
xml2ui.ComponentParser = ComponentParser;
})(xml2ui || (xml2ui = {}));
//# sourceMappingURL=builder.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/builder/component-builder/component-builder.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
var bindable_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/bindable/bindable.js");
var file_system_1 = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system.js");
var binding_builder_1 = __webpack_require__("../node_modules/tns-core-modules/ui/builder/binding-builder.js");
var file_name_resolver_1 = __webpack_require__("../node_modules/tns-core-modules/file-system/file-name-resolver/file-name-resolver.js");
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
var platform = __webpack_require__("../node_modules/tns-core-modules/platform/platform.js");
var filesystem = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system.js");
var UI_PATH = "ui/";
var MODULES = {
"TabViewItem": "ui/tab-view",
"FormattedString": "text/formatted-string",
"Span": "text/span",
"ActionItem": "ui/action-bar",
"NavigationButton": "ui/action-bar",
"SegmentedBarItem": "ui/segmented-bar",
};
var CODEFILE = "codeFile";
var CSSFILE = "cssFile";
var IMPORT = "import";
var createComponentInstance = profiling_1.profile("createComponentInstance", function (elementName, namespace) {
var instance;
var instanceModule;
var moduleId = MODULES[elementName] || UI_PATH +
(elementName.toLowerCase().indexOf("layout") !== -1 ? "layouts/" : "") +
elementName.split(/(?=[A-Z])/).join("-").toLowerCase();
try {
if (typeof namespace === "string") {
if (global.moduleExists(namespace)) {
moduleId = namespace;
}
else {
var pathInsideTNSModules = file_system_1.path.join(file_system_1.knownFolders.currentApp().path, "tns_modules", namespace);
try {
instanceModule = global.require(pathInsideTNSModules);
moduleId = pathInsideTNSModules;
}
catch (e) {
moduleId = file_system_1.path.join(file_system_1.knownFolders.currentApp().path, namespace);
}
}
}
if (!instanceModule) {
instanceModule = global.loadModule(moduleId);
}
var instanceType = instanceModule[elementName] || Object;
instance = new instanceType();
}
catch (ex) {
var debug = __webpack_require__("../node_modules/tns-core-modules/utils/debug.js");
throw new debug.ScopeError(ex, "Module '" + moduleId + "' not found for element '" + (namespace ? namespace + ":" : "") + elementName + "'.");
}
return { instance: instance, instanceModule: instanceModule };
});
var getComponentModuleExports = profiling_1.profile("getComponentModuleExports", function (instance, moduleExports, attributes) {
if (attributes) {
if (attributes[IMPORT]) {
var importPath = attributes[IMPORT].trim();
if (importPath.indexOf("~/") === 0) {
importPath = file_system_1.path.join(file_system_1.knownFolders.currentApp().path, importPath.replace("~/", ""));
}
moduleExports = global.loadModule(importPath);
instance.exports = moduleExports;
}
if (attributes[CODEFILE]) {
var codeFilePath = attributes[CODEFILE].trim();
if (codeFilePath.indexOf("~/") === 0) {
codeFilePath = file_system_1.path.join(file_system_1.knownFolders.currentApp().path, codeFilePath.replace("~/", ""));
}
var codeFilePathWithExt = codeFilePath.indexOf(".js") !== -1 ? codeFilePath : codeFilePath + ".js";
if (file_system_1.File.exists(codeFilePathWithExt)) {
moduleExports = global.loadModule(codeFilePath);
instance.exports = moduleExports;
}
else {
throw new Error("Code file with path \"" + codeFilePathWithExt + "\" cannot be found!");
}
}
}
return moduleExports;
});
var applyComponentCss = profiling_1.profile("applyComponentCss", function (instance, moduleNamePath, attributes) {
var cssApplied = false;
if (attributes) {
if (attributes[CSSFILE] && typeof instance.addCssFile === "function") {
var cssFilePath = attributes[CSSFILE].trim();
if (cssFilePath.indexOf("~/") === 0) {
cssFilePath = file_system_1.path.join(file_system_1.knownFolders.currentApp().path, cssFilePath.replace("~/", ""));
}
if (file_system_1.File.exists(cssFilePath)) {
instance.addCssFile(cssFilePath);
cssApplied = true;
}
else {
throw new Error("Css file with path \"" + cssFilePath + "\" cannot be found!");
}
}
}
if (typeof instance.addCssFile === "function") {
if (moduleNamePath && !cssApplied) {
var appPath = filesystem.knownFolders.currentApp().path;
var cssPathRelativeToApp = (moduleNamePath.startsWith(appPath) ? "./" + moduleNamePath.substr(appPath.length + 1) : moduleNamePath) + ".css";
if (global.moduleExists(cssPathRelativeToApp)) {
instance.addCssFile(cssPathRelativeToApp);
}
var cssFilePath = file_name_resolver_1.resolveFileName(moduleNamePath, "css");
if (cssFilePath) {
instance.addCssFile(cssFilePath);
cssApplied = true;
}
}
}
});
var applyComponentAttributes = profiling_1.profile("applyComponentAttributes", function (instance, instanceModule, moduleExports, attributes) {
if (instance && instanceModule) {
for (var attr in attributes) {
var attrValue = attributes[attr];
if (attr.indexOf(":") !== -1) {
var platformName = attr.split(":")[0].trim();
if (platformName.toLowerCase() === platform.device.os.toLowerCase()) {
attr = attr.split(":")[1].trim();
}
else {
continue;
}
}
if (attr.indexOf(".") !== -1) {
var subObj = instance;
var properties = attr.split(".");
var subPropName = properties[properties.length - 1];
for (var i = 0; i < properties.length - 1; i++) {
if (subObj !== undefined && subObj !== null) {
subObj = subObj[properties[i]];
}
}
if (subObj !== undefined && subObj !== null) {
setPropertyValue(subObj, instanceModule, moduleExports, subPropName, attrValue);
}
}
else {
setPropertyValue(instance, instanceModule, moduleExports, attr, attrValue);
}
}
}
});
function getComponentModule(elementName, namespace, attributes, moduleExports, moduleNamePath, isRootComponent) {
elementName = elementName.split("-").map(function (s) { return s[0].toUpperCase() + s.substring(1); }).join("");
var _a = createComponentInstance(elementName, namespace), instance = _a.instance, instanceModule = _a.instanceModule;
moduleExports = getComponentModuleExports(instance, moduleExports, attributes);
if (isRootComponent) {
applyComponentCss(instance, moduleNamePath, attributes);
}
applyComponentAttributes(instance, instanceModule, moduleExports, attributes);
var componentModule;
if (instance && instanceModule) {
componentModule = { component: instance, exports: instanceModule };
}
return componentModule;
}
exports.getComponentModule = getComponentModule;
function setPropertyValue(instance, instanceModule, exports, propertyName, propertyValue) {
if (isBinding(propertyValue) && instance.bind) {
var bindOptions = binding_builder_1.getBindingOptions(propertyName, getBindingExpressionFromAttribute(propertyValue));
instance.bind({
sourceProperty: bindOptions[binding_builder_1.bindingConstants.sourceProperty],
targetProperty: bindOptions[binding_builder_1.bindingConstants.targetProperty],
expression: bindOptions[binding_builder_1.bindingConstants.expression],
twoWay: bindOptions[binding_builder_1.bindingConstants.twoWay]
}, bindOptions[binding_builder_1.bindingConstants.source]);
}
else if (bindable_1.isEventOrGesture(propertyName, instance)) {
var handler = exports && exports[propertyValue];
if (typeof handler === "function") {
instance.on(propertyName, handler);
}
}
else if (isKnownFunction(propertyName, instance) && exports && typeof exports[propertyValue] === "function") {
instance[propertyName] = exports[propertyValue];
}
else {
instance[propertyName] = propertyValue;
}
}
exports.setPropertyValue = setPropertyValue;
function getBindingExpressionFromAttribute(value) {
return value.replace("{{", "").replace("}}", "").trim();
}
function isBinding(value) {
var isBinding;
if (typeof value === "string") {
var str = value.trim();
isBinding = str.indexOf("{{") === 0 && str.lastIndexOf("}}") === str.length - 2;
}
return isBinding;
}
var KNOWN_FUNCTIONS = "knownFunctions";
function isKnownFunction(name, instance) {
return instance.constructor
&& KNOWN_FUNCTIONS in instance.constructor
&& instance.constructor[KNOWN_FUNCTIONS].indexOf(name) !== -1;
}
//# sourceMappingURL=component-builder.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/button/button-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var text_base_1 = __webpack_require__("../node_modules/tns-core-modules/ui/text-base/text-base.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/text-base/text-base.js"));
var ButtonBase = (function (_super) {
__extends(ButtonBase, _super);
function ButtonBase() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(ButtonBase.prototype, "textWrap", {
get: function () {
return this.style.whiteSpace === "normal";
},
set: function (value) {
if (typeof value === "string") {
value = text_base_1.booleanConverter(value);
}
this.style.whiteSpace = value ? "normal" : "nowrap";
},
enumerable: true,
configurable: true
});
ButtonBase.tapEvent = "tap";
ButtonBase = __decorate([
text_base_1.CSSType("Button")
], ButtonBase);
return ButtonBase;
}(text_base_1.TextBase));
exports.ButtonBase = ButtonBase;
ButtonBase.prototype.recycleNativeView = "auto";
//# sourceMappingURL=button-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/button/button.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var button_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/button/button-common.js");
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
var gestures_1 = __webpack_require__("../node_modules/tns-core-modules/ui/gestures/gestures.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/button/button-common.js"));
var ClickListener;
var APILEVEL;
var AndroidButton;
function initializeClickListener() {
if (ClickListener) {
return;
}
var ClickListenerImpl = (function (_super) {
__extends(ClickListenerImpl, _super);
function ClickListenerImpl(owner) {
var _this = _super.call(this) || this;
_this.owner = owner;
return global.__native(_this);
}
ClickListenerImpl.prototype.onClick = function (v) {
var owner = this.owner;
if (owner) {
owner._emit(button_common_1.ButtonBase.tapEvent);
}
};
ClickListenerImpl = __decorate([
Interfaces([android.view.View.OnClickListener])
], ClickListenerImpl);
return ClickListenerImpl;
}(java.lang.Object));
ClickListener = ClickListenerImpl;
}
var Button = (function (_super) {
__extends(Button, _super);
function Button() {
var _this = _super.call(this) || this;
if (!APILEVEL) {
APILEVEL = android.os.Build.VERSION.SDK_INT;
}
return _this;
}
Button.prototype.createNativeView = function () {
if (!AndroidButton) {
AndroidButton = android.widget.Button;
}
return new AndroidButton(this._context);
};
Button.prototype.initNativeView = function () {
_super.prototype.initNativeView.call(this);
var nativeView = this.nativeViewProtected;
initializeClickListener();
var clickListener = new ClickListener(this);
nativeView.setOnClickListener(clickListener);
nativeView.clickListener = clickListener;
};
Button.prototype.disposeNativeView = function () {
if (this.nativeViewProtected) {
this.nativeViewProtected.clickListener.owner = null;
}
_super.prototype.disposeNativeView.call(this);
};
Button.prototype.resetNativeView = function () {
_super.prototype.resetNativeView.call(this);
if (this._stateListAnimator && APILEVEL >= 21) {
this.nativeViewProtected.setStateListAnimator(this._stateListAnimator);
this._stateListAnimator = undefined;
}
};
Button.prototype._updateHandler = function (subscribe) {
var _this = this;
if (subscribe) {
this._highlightedHandler = this._highlightedHandler || (function (args) {
switch (args.action) {
case gestures_1.TouchAction.up:
_this._goToVisualState("normal");
break;
case gestures_1.TouchAction.down:
_this._goToVisualState("highlighted");
break;
}
});
this.on(gestures_1.GestureTypes.touch, this._highlightedHandler);
}
else {
this.off(gestures_1.GestureTypes.touch, this._highlightedHandler);
}
};
Button.prototype[button_common_1.paddingTopProperty.getDefault] = function () {
return { value: this._defaultPaddingTop, unit: "px" };
};
Button.prototype[button_common_1.paddingTopProperty.setNative] = function (value) {
org.nativescript.widgets.ViewHelper.setPaddingTop(this.nativeViewProtected, button_common_1.Length.toDevicePixels(value, 0) + button_common_1.Length.toDevicePixels(this.style.borderTopWidth, 0));
};
Button.prototype[button_common_1.paddingRightProperty.getDefault] = function () {
return { value: this._defaultPaddingRight, unit: "px" };
};
Button.prototype[button_common_1.paddingRightProperty.setNative] = function (value) {
org.nativescript.widgets.ViewHelper.setPaddingRight(this.nativeViewProtected, button_common_1.Length.toDevicePixels(value, 0) + button_common_1.Length.toDevicePixels(this.style.borderRightWidth, 0));
};
Button.prototype[button_common_1.paddingBottomProperty.getDefault] = function () {
return { value: this._defaultPaddingBottom, unit: "px" };
};
Button.prototype[button_common_1.paddingBottomProperty.setNative] = function (value) {
org.nativescript.widgets.ViewHelper.setPaddingBottom(this.nativeViewProtected, button_common_1.Length.toDevicePixels(value, 0) + button_common_1.Length.toDevicePixels(this.style.borderBottomWidth, 0));
};
Button.prototype[button_common_1.paddingLeftProperty.getDefault] = function () {
return { value: this._defaultPaddingLeft, unit: "px" };
};
Button.prototype[button_common_1.paddingLeftProperty.setNative] = function (value) {
org.nativescript.widgets.ViewHelper.setPaddingLeft(this.nativeViewProtected, button_common_1.Length.toDevicePixels(value, 0) + button_common_1.Length.toDevicePixels(this.style.borderLeftWidth, 0));
};
Button.prototype[button_common_1.zIndexProperty.setNative] = function (value) {
if (APILEVEL >= 21) {
var nativeView = this.nativeViewProtected;
if (!this._stateListAnimator) {
this._stateListAnimator = nativeView.getStateListAnimator();
}
nativeView.setStateListAnimator(null);
}
org.nativescript.widgets.ViewHelper.setZIndex(this.nativeViewProtected, value);
};
Button.prototype[button_common_1.textAlignmentProperty.setNative] = function (value) {
var newValue = value === "initial" ? "center" : value;
_super.prototype[button_common_1.textAlignmentProperty.setNative].call(this, newValue);
};
__decorate([
profiling_1.profile
], Button.prototype, "createNativeView", null);
__decorate([
button_common_1.PseudoClassHandler("normal", "highlighted", "pressed", "active")
], Button.prototype, "_updateHandler", null);
return Button;
}(button_common_1.ButtonBase));
exports.Button = Button;
//# sourceMappingURL=button.android.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/content-view/content-view.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js"));
var ContentView = (function (_super) {
__extends(ContentView, _super);
function ContentView() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(ContentView.prototype, "content", {
get: function () {
return this._content;
},
set: function (value) {
var oldView = this._content;
if (this._content) {
this._removeView(this._content);
}
this._content = value;
if (this._content) {
this._addView(this._content);
}
this._onContentChanged(oldView, value);
if (view_1.isIOS && oldView !== value) {
this.requestLayout();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(ContentView.prototype, "layoutView", {
get: function () {
var result;
if (this._content) {
var first_1 = true;
this._content._eachLayoutView(function (child) {
if (first_1) {
first_1 = false;
result = child;
}
else {
throw new Error("More than one layout child inside a ContentView");
}
});
}
return result;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ContentView.prototype, "_childrenCount", {
get: function () {
return this._content ? 1 : 0;
},
enumerable: true,
configurable: true
});
ContentView.prototype._onContentChanged = function (oldView, newView) {
};
ContentView.prototype._addChildFromBuilder = function (name, value) {
if (value instanceof view_1.View) {
this.content = value;
}
};
ContentView.prototype.eachChildView = function (callback) {
var content = this._content;
if (content) {
callback(content);
}
};
ContentView.prototype.onMeasure = function (widthMeasureSpec, heightMeasureSpec) {
var result = view_1.View.measureChild(this, this.layoutView, widthMeasureSpec, heightMeasureSpec);
var width = view_1.layout.getMeasureSpecSize(widthMeasureSpec);
var widthMode = view_1.layout.getMeasureSpecMode(widthMeasureSpec);
var height = view_1.layout.getMeasureSpecSize(heightMeasureSpec);
var heightMode = view_1.layout.getMeasureSpecMode(heightMeasureSpec);
var measureWidth = Math.max(result.measuredWidth, this.effectiveMinWidth);
var measureHeight = Math.max(result.measuredHeight, this.effectiveMinHeight);
var widthAndState = view_1.View.resolveSizeAndState(measureWidth, width, widthMode, 0);
var heightAndState = view_1.View.resolveSizeAndState(measureHeight, height, heightMode, 0);
this.setMeasuredDimension(widthAndState, heightAndState);
};
ContentView.prototype.onLayout = function (left, top, right, bottom) {
view_1.View.layoutChild(this, this.layoutView, 0, 0, right - left, bottom - top);
};
return ContentView;
}(view_1.CustomLayoutView));
exports.ContentView = ContentView;
ContentView.prototype.recycleNativeView = "auto";
//# sourceMappingURL=content-view.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/core/bindable/bindable.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
var properties_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/properties/properties.js");
var observable_1 = __webpack_require__("../node_modules/tns-core-modules/data/observable/observable.js");
exports.Observable = observable_1.Observable;
exports.WrappedValue = observable_1.WrappedValue;
var weak_event_listener_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/weak-event-listener/weak-event-listener.js");
var binding_builder_1 = __webpack_require__("../node_modules/tns-core-modules/ui/builder/binding-builder.js");
var utils_1 = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
var trace_1 = __webpack_require__("../node_modules/tns-core-modules/trace/trace.js");
exports.traceEnabled = trace_1.isEnabled;
exports.traceWrite = trace_1.write;
exports.traceError = trace_1.error;
exports.traceCategories = trace_1.categories;
exports.traceNotifyEvent = trace_1.notifyEvent;
exports.isCategorySet = trace_1.isCategorySet;
exports.traceMessageType = trace_1.messageType;
var types = __webpack_require__("../node_modules/tns-core-modules/utils/types.js");
var applicationCommon = __webpack_require__("../node_modules/tns-core-modules/application/application-common.js");
var polymerExpressions = __webpack_require__("../node_modules/tns-core-modules/js-libs/polymer-expressions/polymer-expressions.js");
var contextKey = "context";
var paramsRegex = /\[\s*(['"])*(\w*)\1\s*\]/;
var bc = binding_builder_1.bindingConstants;
var emptyArray = [];
var propertiesCache = {};
function getProperties(property) {
if (!property) {
return emptyArray;
}
var result = propertiesCache[property];
if (result) {
return result;
}
var parentsMatches = property.match(binding_builder_1.parentsRegex);
result = property.replace(binding_builder_1.parentsRegex, "parentsMatch")
.replace(/\]/g, "")
.split(/\.|\[/);
var parentsMatchesCounter = 0;
for (var i = 0, resultLength = result.length; i < resultLength; i++) {
if (result[i] === "parentsMatch") {
result[i] = parentsMatches[parentsMatchesCounter++];
}
}
propertiesCache[property] = result;
return result;
}
function getEventOrGestureName(name) {
return name.indexOf("on") === 0 ? name.substr(2, name.length - 2) : name;
}
exports.getEventOrGestureName = getEventOrGestureName;
function isGesture(eventOrGestureName) {
var t = eventOrGestureName.trim().toLowerCase();
return t === "tap"
|| t === "doubletap"
|| t === "pinch"
|| t === "pan"
|| t === "swipe"
|| t === "rotation"
|| t === "longpress"
|| t === "touch";
}
exports.isGesture = isGesture;
function isEventOrGesture(name, view) {
if (typeof name === "string") {
var eventOrGestureName = getEventOrGestureName(name);
var evt = eventOrGestureName + "Event";
return view.constructor && evt in view.constructor || isGesture(eventOrGestureName.toLowerCase());
}
return false;
}
exports.isEventOrGesture = isEventOrGesture;
var Binding = (function () {
function Binding(target, options) {
this.propertyChangeListeners = new Map();
this.target = new WeakRef(target);
this.options = options;
this.sourceProperties = getProperties(options.sourceProperty);
this.targetOptions = this.resolveOptions(target, getProperties(options.targetProperty));
if (!this.targetOptions) {
throw new Error("Invalid property: " + options.targetProperty + " for target: " + target);
}
if (options.twoWay) {
var target_1 = this.targetOptions.instance.get();
if (target_1 instanceof observable_1.Observable) {
target_1.on(this.targetOptions.property + "Change", this.onTargetPropertyChanged, this);
}
}
}
Binding.prototype.onTargetPropertyChanged = function (data) {
this.updateTwoWay(data.value);
};
Binding.prototype.loadedHandlerVisualTreeBinding = function (args) {
var target = args.object;
target.off("loaded", this.loadedHandlerVisualTreeBinding, this);
var context = target.bindingContext;
if (context !== undefined && context !== null) {
this.update(context);
}
};
;
Binding.prototype.clearSource = function () {
var _this = this;
this.propertyChangeListeners.forEach(function (observable, index, map) {
weak_event_listener_1.removeWeakEventListener(observable, observable_1.Observable.propertyChangeEvent, _this.onSourcePropertyChanged, _this);
});
this.propertyChangeListeners.clear();
if (this.source) {
this.source.clear();
}
if (this.sourceOptions) {
this.sourceOptions.instance.clear();
this.sourceOptions = undefined;
}
};
Binding.prototype.sourceAsObject = function (source) {
var objectType = typeof source;
if (objectType === "number") {
source = new Number(source);
}
else if (objectType === "boolean") {
source = new Boolean(source);
}
else if (objectType === "string") {
source = new String(source);
}
return source;
};
Binding.prototype.bindingContextChanged = function (data) {
var target = this.targetOptions.instance.get();
if (!target) {
this.unbind();
return;
}
var value = data.value;
if (value !== null && value !== undefined) {
this.update(value);
}
else {
this.clearBinding();
}
};
Binding.prototype.bind = function (source) {
var target = this.targetOptions.instance.get();
if (this.sourceIsBindingContext && target instanceof observable_1.Observable && this.targetOptions.property !== "bindingContext") {
target.on("bindingContextChange", this.bindingContextChanged, this);
}
this.update(source);
};
Binding.prototype.update = function (source) {
this.clearSource();
source = this.sourceAsObject(source);
if (!types.isNullOrUndefined(source)) {
this.source = new WeakRef(source);
this.sourceOptions = this.resolveOptions(source, this.sourceProperties);
var sourceValue = this.getSourcePropertyValue();
this.updateTarget(sourceValue);
this.addPropertyChangeListeners(this.source, this.sourceProperties);
}
else if (!this.sourceIsBindingContext) {
var sourceValue = this.getSourcePropertyValue();
this.updateTarget(sourceValue ? sourceValue : source);
}
};
Binding.prototype.unbind = function () {
var target = this.targetOptions.instance.get();
if (target instanceof observable_1.Observable) {
if (this.options.twoWay) {
target.off(this.targetOptions.property + "Change", this.onTargetPropertyChanged, this);
}
if (this.sourceIsBindingContext && this.targetOptions.property !== "bindingContext") {
target.off("bindingContextChange", this.bindingContextChanged, this);
}
}
if (this.targetOptions) {
this.targetOptions = undefined;
}
this.sourceProperties = undefined;
if (!this.source) {
return;
}
this.clearSource();
};
Binding.prototype.resolveObjectsAndProperties = function (source, properties) {
var result = [];
var currentObject = source;
var currentObjectChanged = false;
for (var i = 0, propsArrayLength = properties.length; i < propsArrayLength; i++) {
var property = properties[i];
if (property === bc.bindingValueKey) {
currentObjectChanged = true;
}
if (property === bc.parentValueKey || property.indexOf(bc.parentsValueKey) === 0) {
var parentView = this.getParentView(this.target.get(), property).view;
if (parentView) {
currentObject = parentView.bindingContext;
}
else {
var targetInstance = this.target.get();
targetInstance.off("loaded", this.loadedHandlerVisualTreeBinding, this);
targetInstance.on("loaded", this.loadedHandlerVisualTreeBinding, this);
}
currentObjectChanged = true;
}
if (currentObject) {
result.push({ instance: currentObject, property: property });
}
else {
break;
}
if (!currentObjectChanged && (i < propsArrayLength - 1)) {
currentObject = currentObject ? currentObject[properties[i]] : null;
}
currentObjectChanged = false;
}
return result;
};
Binding.prototype.addPropertyChangeListeners = function (source, sourceProperty, parentProperies) {
var objectsAndProperties = this.resolveObjectsAndProperties(source.get(), sourceProperty);
var prop = parentProperies || "";
for (var i = 0, length_1 = objectsAndProperties.length; i < length_1; i++) {
var propName = objectsAndProperties[i].property;
prop += "$" + propName;
var currentObject = objectsAndProperties[i].instance;
if (!this.propertyChangeListeners.has(prop) && currentObject instanceof observable_1.Observable && currentObject._isViewBase) {
weak_event_listener_1.addWeakEventListener(currentObject, propName + "Change", this.onSourcePropertyChanged, this);
weak_event_listener_1.addWeakEventListener(currentObject, observable_1.Observable.propertyChangeEvent, this.onSourcePropertyChanged, this);
this.propertyChangeListeners.set(prop, currentObject);
}
else if (!this.propertyChangeListeners.has(prop) && currentObject instanceof observable_1.Observable) {
weak_event_listener_1.addWeakEventListener(currentObject, observable_1.Observable.propertyChangeEvent, this.onSourcePropertyChanged, this);
this.propertyChangeListeners.set(prop, currentObject);
}
}
};
Binding.prototype.prepareExpressionForUpdate = function () {
var escapedSourceProperty = utils_1.escapeRegexSymbols(this.options.sourceProperty);
var expRegex = new RegExp(escapedSourceProperty, "g");
var resultExp = this.options.expression.replace(expRegex, bc.newPropertyValueKey);
return resultExp;
};
Binding.prototype.updateTwoWay = function (value) {
if (this.updating || !this.options.twoWay) {
return;
}
var newValue = value;
if (this.options.expression) {
var changedModel = {};
changedModel[bc.bindingValueKey] = value;
changedModel[bc.newPropertyValueKey] = value;
var sourcePropertyName = "";
if (this.sourceOptions) {
sourcePropertyName = this.sourceOptions.property;
}
else if (typeof this.options.sourceProperty === "string" && this.options.sourceProperty.indexOf(".") === -1) {
sourcePropertyName = this.options.sourceProperty;
}
if (sourcePropertyName !== "") {
changedModel[sourcePropertyName] = value;
}
var updateExpression = this.prepareExpressionForUpdate();
this.prepareContextForExpression(changedModel, updateExpression, undefined);
var expressionValue = this._getExpressionValue(updateExpression, true, changedModel);
if (expressionValue instanceof Error) {
trace_1.write(expressionValue.message, trace_1.categories.Binding, trace_1.messageType.error);
}
newValue = expressionValue;
}
this.updateSource(newValue);
};
Binding.prototype._getExpressionValue = function (expression, isBackConvert, changedModel) {
try {
var exp_1 = polymerExpressions.PolymerExpressions.getExpression(expression);
if (exp_1) {
var context_1 = this.source && this.source.get && this.source.get() || global;
var model = {};
var addedProps = [];
var resources = applicationCommon.getResources();
for (var prop in resources) {
if (resources.hasOwnProperty(prop) && !context_1.hasOwnProperty(prop)) {
context_1[prop] = resources[prop];
addedProps.push(prop);
}
}
this.prepareContextForExpression(context_1, expression, addedProps);
model[contextKey] = context_1;
var result = exp_1.getValue(model, isBackConvert, changedModel ? changedModel : model);
var addedPropsLength = addedProps.length;
for (var i = 0; i < addedPropsLength; i++) {
delete context_1[addedProps[i]];
}
addedProps.length = 0;
return result;
}
return new Error(expression + " is not a valid expression.");
}
catch (e) {
var errorMessage = "Run-time error occured in file: " + e.sourceURL + " at line: " + e.line + " and column: " + e.column;
return new Error(errorMessage);
}
};
Binding.prototype.onSourcePropertyChanged = function (data) {
var sourceProps = this.sourceProperties;
var sourcePropsLength = sourceProps.length;
var changedPropertyIndex = sourceProps.indexOf(data.propertyName);
var parentProps = "";
if (changedPropertyIndex > -1) {
parentProps = "$" + sourceProps.slice(0, changedPropertyIndex + 1).join("$");
while (this.propertyChangeListeners.get(parentProps) !== data.object) {
changedPropertyIndex += sourceProps.slice(changedPropertyIndex + 1).indexOf(data.propertyName) + 1;
parentProps = "$" + sourceProps.slice(0, changedPropertyIndex + 1).join("$");
}
}
if (this.options.expression) {
var expressionValue = this._getExpressionValue(this.options.expression, false, undefined);
if (expressionValue instanceof Error) {
trace_1.write(expressionValue.message, trace_1.categories.Binding, trace_1.messageType.error);
}
else {
this.updateTarget(expressionValue);
}
}
else {
if (changedPropertyIndex > -1) {
var props = sourceProps.slice(changedPropertyIndex + 1);
var propsLength = props.length;
if (propsLength > 0) {
var value = data.value;
for (var i = 0; i < propsLength; i++) {
value = value[props[i]];
}
this.updateTarget(value);
}
else if (data.propertyName === this.sourceOptions.property) {
this.updateTarget(data.value);
}
}
}
if (changedPropertyIndex > -1 && changedPropertyIndex < sourcePropsLength - 1) {
var probablyChangedObject = this.propertyChangeListeners.get(parentProps);
if (probablyChangedObject &&
probablyChangedObject !== data.object[sourceProps[changedPropertyIndex]]) {
for (var i = sourcePropsLength - 1; i > changedPropertyIndex; i--) {
var prop = "$" + sourceProps.slice(0, i + 1).join("$");
if (this.propertyChangeListeners.has(prop)) {
weak_event_listener_1.removeWeakEventListener(this.propertyChangeListeners.get(prop), observable_1.Observable.propertyChangeEvent, this.onSourcePropertyChanged, this);
this.propertyChangeListeners.delete(prop);
}
}
var newProps = sourceProps.slice(changedPropertyIndex + 1);
var newObject = data.object[sourceProps[changedPropertyIndex]];
if (!types.isNullOrUndefined(newObject) && typeof newObject === "object") {
this.addPropertyChangeListeners(new WeakRef(newObject), newProps, parentProps);
}
}
}
};
Binding.prototype.prepareContextForExpression = function (model, expression, newProps) {
var parentViewAndIndex;
var parentView;
var addedProps = newProps || [];
if (expression.indexOf(bc.bindingValueKey) > -1) {
model[bc.bindingValueKey] = model;
addedProps.push(bc.bindingValueKey);
}
if (expression.indexOf(bc.parentValueKey) > -1) {
parentView = this.getParentView(this.target.get(), bc.parentValueKey).view;
if (parentView) {
model[bc.parentValueKey] = parentView.bindingContext;
addedProps.push(bc.parentValueKey);
}
}
var parentsArray = expression.match(binding_builder_1.parentsRegex);
if (parentsArray) {
for (var i = 0; i < parentsArray.length; i++) {
parentViewAndIndex = this.getParentView(this.target.get(), parentsArray[i]);
if (parentViewAndIndex.view) {
model[bc.parentsValueKey] = model[bc.parentsValueKey] || {};
model[bc.parentsValueKey][parentViewAndIndex.index] = parentViewAndIndex.view.bindingContext;
addedProps.push(bc.parentsValueKey);
}
}
}
};
Binding.prototype.getSourcePropertyValue = function () {
if (this.options.expression) {
var changedModel = {};
changedModel[bc.bindingValueKey] = this.source ? this.source.get() : undefined;
var expressionValue = this._getExpressionValue(this.options.expression, false, changedModel);
if (expressionValue instanceof Error) {
trace_1.write(expressionValue.message, trace_1.categories.Binding, trace_1.messageType.error);
}
else {
return expressionValue;
}
}
if (this.sourceOptions) {
var sourceOptionsInstance = this.sourceOptions.instance.get();
if (this.sourceOptions.property === bc.bindingValueKey) {
return sourceOptionsInstance;
}
else if ((sourceOptionsInstance instanceof observable_1.Observable) && (this.sourceOptions.property && this.sourceOptions.property !== "")) {
return sourceOptionsInstance.get(this.sourceOptions.property);
}
else if (sourceOptionsInstance && this.sourceOptions.property && this.sourceOptions.property !== "" &&
this.sourceOptions.property in sourceOptionsInstance) {
return sourceOptionsInstance[this.sourceOptions.property];
}
else {
trace_1.write("Property: '" + this.sourceOptions.property + "' is invalid or does not exist. SourceProperty: '" + this.options.sourceProperty + "'", trace_1.categories.Binding, trace_1.messageType.error);
}
}
return null;
};
Binding.prototype.clearBinding = function () {
this.clearSource();
this.updateTarget(properties_1.unsetValue);
};
Binding.prototype.updateTarget = function (value) {
if (this.updating) {
return;
}
this.updateOptions(this.targetOptions, types.isNullOrUndefined(value) ? properties_1.unsetValue : value);
};
Binding.prototype.updateSource = function (value) {
if (this.updating || !this.source || !this.source.get()) {
return;
}
this.updateOptions(this.sourceOptions, value);
};
Binding.prototype.getParentView = function (target, property) {
if (!target) {
return { view: null, index: null };
}
var result;
if (property === bc.parentValueKey) {
result = target.parent;
}
var index = null;
if (property.indexOf(bc.parentsValueKey) === 0) {
result = target.parent;
var indexParams = paramsRegex.exec(property);
if (indexParams && indexParams.length > 1) {
index = indexParams[2];
}
if (!isNaN(index)) {
var indexAsInt = parseInt(index);
while (indexAsInt > 0) {
result = result.parent;
indexAsInt--;
}
}
else if (types.isString(index)) {
while (result && result.typeName !== index) {
result = result.parent;
}
}
}
return { view: result, index: index };
};
Binding.prototype.resolveOptions = function (obj, properties) {
var objectsAndProperties = this.resolveObjectsAndProperties(obj, properties);
if (objectsAndProperties.length > 0) {
var resolvedObj = objectsAndProperties[objectsAndProperties.length - 1].instance;
var prop = objectsAndProperties[objectsAndProperties.length - 1].property;
return {
instance: new WeakRef(this.sourceAsObject(resolvedObj)),
property: prop
};
}
return null;
};
Binding.prototype.updateOptions = function (options, value) {
var optionsInstance;
if (options && options.instance) {
optionsInstance = options.instance.get();
}
if (!optionsInstance) {
return;
}
this.updating = true;
try {
if (isEventOrGesture(options.property, optionsInstance) &&
types.isFunction(value)) {
optionsInstance.off(options.property, null, optionsInstance.bindingContext);
optionsInstance.on(options.property, value, optionsInstance.bindingContext);
}
else if (optionsInstance instanceof observable_1.Observable) {
optionsInstance.set(options.property, value);
}
else {
optionsInstance[options.property] = value;
}
}
catch (ex) {
trace_1.write("Binding error while setting property " + options.property + " of " + optionsInstance + ": " + ex, trace_1.categories.Binding, trace_1.messageType.error);
}
this.updating = false;
};
return Binding;
}());
exports.Binding = Binding;
//# sourceMappingURL=bindable.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/core/properties/properties.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var observable_1 = __webpack_require__("../node_modules/tns-core-modules/data/observable/observable.js");
var style_1 = __webpack_require__("../node_modules/tns-core-modules/ui/styling/style/style.js");
exports.Style = style_1.Style;
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
exports.unsetValue = new Object();
var cssPropertyNames = [];
var symbolPropertyMap = {};
var cssSymbolPropertyMap = {};
var inheritableProperties = new Array();
var inheritableCssProperties = new Array();
function print(map) {
var symbols = Object.getOwnPropertySymbols(map);
for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) {
var symbol = symbols_1[_i];
var prop = map[symbol];
if (!prop.registered) {
console.log("Property " + prop.name + " not Registered!!!!!");
}
}
}
function _printUnregisteredProperties() {
print(symbolPropertyMap);
print(cssSymbolPropertyMap);
}
exports._printUnregisteredProperties = _printUnregisteredProperties;
function _getProperties() {
return getPropertiesFromMap(symbolPropertyMap);
}
exports._getProperties = _getProperties;
function _getStyleProperties() {
return getPropertiesFromMap(cssSymbolPropertyMap);
}
exports._getStyleProperties = _getStyleProperties;
function getPropertiesFromMap(map) {
var props = [];
Object.getOwnPropertySymbols(map).forEach(function (symbol) { return props.push(map[symbol]); });
return props;
}
var Property = (function () {
function Property(options) {
this.enumerable = true;
this.configurable = true;
var propertyName = options.name;
this.name = propertyName;
var key = Symbol(propertyName + ":propertyKey");
this.key = key;
var getDefault = Symbol(propertyName + ":getDefault");
this.getDefault = getDefault;
var setNative = Symbol(propertyName + ":setNative");
this.setNative = setNative;
var defaultValueKey = Symbol(propertyName + ":nativeDefaultValue");
this.defaultValueKey = defaultValueKey;
var defaultValue = options.defaultValue;
this.defaultValue = defaultValue;
var eventName = propertyName + "Change";
var equalityComparer = options.equalityComparer;
var affectsLayout = options.affectsLayout;
var valueChanged = options.valueChanged;
var valueConverter = options.valueConverter;
var property = this;
this.set = function (boxedValue) {
var reset = boxedValue === exports.unsetValue;
var value;
var wrapped;
if (reset) {
value = defaultValue;
}
else {
wrapped = boxedValue && boxedValue.wrapped;
value = wrapped ? observable_1.WrappedValue.unwrap(boxedValue) : boxedValue;
if (valueConverter && typeof value === "string") {
value = valueConverter(value);
}
}
var oldValue = key in this ? this[key] : defaultValue;
var changed = equalityComparer ? !equalityComparer(oldValue, value) : oldValue !== value;
if (wrapped || changed) {
if (affectsLayout) {
this.requestLayout();
}
if (reset) {
delete this[key];
if (valueChanged) {
valueChanged(this, oldValue, value);
}
if (this[setNative]) {
if (this._suspendNativeUpdatesCount) {
if (this._suspendedUpdates) {
this._suspendedUpdates[propertyName] = property;
}
}
else {
if (defaultValueKey in this) {
this[setNative](this[defaultValueKey]);
delete this[defaultValueKey];
}
else {
this[setNative](defaultValue);
}
}
}
}
else {
this[key] = value;
if (valueChanged) {
valueChanged(this, oldValue, value);
}
if (this[setNative]) {
if (this._suspendNativeUpdatesCount) {
if (this._suspendedUpdates) {
this._suspendedUpdates[propertyName] = property;
}
}
else {
if (!(defaultValueKey in this)) {
this[defaultValueKey] = this[getDefault] ? this[getDefault]() : defaultValue;
}
this[setNative](value);
}
}
}
if (this.hasListeners(eventName)) {
this.notify({ object: this, eventName: eventName, propertyName: propertyName, value: value, oldValue: oldValue });
}
if (this.domNode) {
if (reset) {
this.domNode.attributeRemoved(propertyName);
}
else {
this.domNode.attributeModified(propertyName, value);
}
}
}
};
this.get = function () {
return key in this ? this[key] : defaultValue;
};
this.nativeValueChange = function (owner, value) {
var oldValue = key in owner ? owner[key] : defaultValue;
var changed = equalityComparer ? !equalityComparer(oldValue, value) : oldValue !== value;
if (changed) {
owner[key] = value;
if (valueChanged) {
valueChanged(owner, oldValue, value);
}
if (owner.nativeViewProtected && !(defaultValueKey in owner)) {
owner[defaultValueKey] = owner[getDefault] ? owner[getDefault]() : defaultValue;
}
if (owner.hasListeners(eventName)) {
owner.notify({ object: owner, eventName: eventName, propertyName: propertyName, value: value, oldValue: oldValue });
}
if (affectsLayout) {
owner.requestLayout();
}
if (owner.domNode) {
owner.domNode.attributeModified(propertyName, value);
}
}
};
symbolPropertyMap[key] = this;
}
Property.prototype.register = function (cls) {
if (this.registered) {
throw new Error("Property " + this.name + " already registered.");
}
this.registered = true;
Object.defineProperty(cls.prototype, this.name, this);
};
Property.prototype.isSet = function (instance) {
return this.key in instance;
};
return Property;
}());
exports.Property = Property;
Property.prototype.isStyleProperty = false;
var CoercibleProperty = (function (_super) {
__extends(CoercibleProperty, _super);
function CoercibleProperty(options) {
var _this = _super.call(this, options) || this;
var propertyName = options.name;
var key = _this.key;
var getDefault = _this.getDefault;
var setNative = _this.setNative;
var defaultValueKey = _this.defaultValueKey;
var defaultValue = _this.defaultValue;
var coerceKey = Symbol(propertyName + ":coerceKey");
var eventName = propertyName + "Change";
var affectsLayout = options.affectsLayout;
var equalityComparer = options.equalityComparer;
var valueChanged = options.valueChanged;
var valueConverter = options.valueConverter;
var coerceCallback = options.coerceValue;
var property = _this;
_this.coerce = function (target) {
var originalValue = coerceKey in target ? target[coerceKey] : defaultValue;
target[propertyName] = originalValue;
};
_this.set = function (boxedValue) {
var reset = boxedValue === exports.unsetValue;
var value;
var wrapped;
if (reset) {
value = defaultValue;
delete this[coerceKey];
}
else {
wrapped = boxedValue && boxedValue.wrapped;
value = wrapped ? observable_1.WrappedValue.unwrap(boxedValue) : boxedValue;
if (valueConverter && typeof value === "string") {
value = valueConverter(value);
}
this[coerceKey] = value;
value = coerceCallback(this, value);
}
var oldValue = key in this ? this[key] : defaultValue;
var changed = equalityComparer ? !equalityComparer(oldValue, value) : oldValue !== value;
if (wrapped || changed) {
if (reset) {
delete this[key];
if (valueChanged) {
valueChanged(this, oldValue, value);
}
if (this[setNative]) {
if (this._suspendNativeUpdatesCount) {
if (this._suspendedUpdates) {
this._suspendedUpdates[propertyName] = property;
}
}
else {
if (defaultValueKey in this) {
this[setNative](this[defaultValueKey]);
delete this[defaultValueKey];
}
else {
this[setNative](defaultValue);
}
}
}
}
else {
this[key] = value;
if (valueChanged) {
valueChanged(this, oldValue, value);
}
if (this[setNative]) {
if (this._suspendNativeUpdatesCount) {
if (this._suspendedUpdates) {
this._suspendedUpdates[propertyName] = property;
}
}
else {
if (!(defaultValueKey in this)) {
this[defaultValueKey] = this[getDefault] ? this[getDefault]() : defaultValue;
}
this[setNative](value);
}
}
}
if (this.hasListeners(eventName)) {
this.notify({ object: this, eventName: eventName, propertyName: propertyName, value: value, oldValue: oldValue });
}
if (affectsLayout) {
this.requestLayout();
}
if (this.domNode) {
if (reset) {
this.domNode.attributeRemoved(propertyName);
}
else {
this.domNode.attributeModified(propertyName, value);
}
}
}
};
return _this;
}
return CoercibleProperty;
}(Property));
exports.CoercibleProperty = CoercibleProperty;
var InheritedProperty = (function (_super) {
__extends(InheritedProperty, _super);
function InheritedProperty(options) {
var _this = _super.call(this, options) || this;
var name = options.name;
var key = _this.key;
var defaultValue = options.defaultValue;
var sourceKey = Symbol(name + ":valueSourceKey");
_this.sourceKey = sourceKey;
var setBase = _this.set;
var setFunc = function (valueSource) { return function (value) {
var that = this;
var unboxedValue;
var newValueSource;
if (value === exports.unsetValue) {
var parent_1 = that.parent;
if (parent_1 && parent_1[sourceKey] !== 0) {
unboxedValue = parent_1[name];
newValueSource = 1;
}
else {
unboxedValue = defaultValue;
newValueSource = 0;
}
}
else {
unboxedValue = value;
newValueSource = valueSource;
}
var currentValue = that[key];
setBase.call(that, unboxedValue);
var newValue = that[key];
that[sourceKey] = newValueSource;
if (currentValue !== newValue) {
var reset_1 = newValueSource === 0;
that.eachChild(function (child) {
var childValueSource = child[sourceKey] || 0;
if (reset_1) {
if (childValueSource === 1) {
setFunc.call(child, exports.unsetValue);
}
}
else {
if (childValueSource <= 1) {
setInheritedValue.call(child, newValue);
}
}
return true;
});
}
}; };
var setInheritedValue = setFunc(1);
_this.setInheritedValue = setInheritedValue;
_this.set = setFunc(3);
inheritableProperties.push(_this);
return _this;
}
return InheritedProperty;
}(Property));
exports.InheritedProperty = InheritedProperty;
var CssProperty = (function () {
function CssProperty(options) {
var propertyName = options.name;
this.name = propertyName;
cssPropertyNames.push(options.cssName);
this.cssName = "css:" + options.cssName;
this.cssLocalName = options.cssName;
var key = Symbol(propertyName + ":propertyKey");
this.key = key;
var sourceKey = Symbol(propertyName + ":valueSourceKey");
this.sourceKey = sourceKey;
var getDefault = Symbol(propertyName + ":getDefault");
this.getDefault = getDefault;
var setNative = Symbol(propertyName + ":setNative");
this.setNative = setNative;
var defaultValueKey = Symbol(propertyName + ":nativeDefaultValue");
this.defaultValueKey = defaultValueKey;
var defaultValue = options.defaultValue;
this.defaultValue = defaultValue;
var eventName = propertyName + "Change";
var affectsLayout = options.affectsLayout;
var equalityComparer = options.equalityComparer;
var valueChanged = options.valueChanged;
var valueConverter = options.valueConverter;
var property = this;
function setLocalValue(newValue) {
var reset = newValue === exports.unsetValue || newValue === "";
var value;
if (reset) {
value = defaultValue;
delete this[sourceKey];
}
else {
this[sourceKey] = 3;
value = (valueConverter && typeof newValue === "string") ?
valueConverter(newValue) :
newValue;
}
var oldValue = key in this ? this[key] : defaultValue;
var changed = equalityComparer ? !equalityComparer(oldValue, value) : oldValue !== value;
if (changed) {
var view = this.view;
if (reset) {
delete this[key];
if (valueChanged) {
valueChanged(this, oldValue, value);
}
if (view[setNative]) {
if (view._suspendNativeUpdatesCount) {
if (view._suspendedUpdates) {
view._suspendedUpdates[propertyName] = property;
}
}
else {
if (defaultValueKey in this) {
view[setNative](this[defaultValueKey]);
delete this[defaultValueKey];
}
else {
view[setNative](defaultValue);
}
}
}
}
else {
this[key] = value;
if (valueChanged) {
valueChanged(this, oldValue, value);
}
if (view[setNative]) {
if (view._suspendNativeUpdatesCount) {
if (view._suspendedUpdates) {
view._suspendedUpdates[propertyName] = property;
}
}
else {
if (!(defaultValueKey in this)) {
this[defaultValueKey] = view[getDefault] ? view[getDefault]() : defaultValue;
}
view[setNative](value);
}
}
}
if (this.hasListeners(eventName)) {
this.notify({ object: this, eventName: eventName, propertyName: propertyName, value: value, oldValue: oldValue });
}
if (affectsLayout) {
view.requestLayout();
}
}
}
function setCssValue(newValue) {
var currentValueSource = this[sourceKey] || 0;
if (currentValueSource === 3) {
return;
}
var reset = newValue === exports.unsetValue || newValue === "";
var value;
if (reset) {
value = defaultValue;
delete this[sourceKey];
}
else {
value = valueConverter && typeof newValue === "string" ?
valueConverter(newValue) :
newValue;
this[sourceKey] = 2;
}
var oldValue = key in this ? this[key] : defaultValue;
var changed = equalityComparer ? !equalityComparer(oldValue, value) : oldValue !== value;
if (changed) {
var view = this.view;
if (reset) {
delete this[key];
if (valueChanged) {
valueChanged(this, oldValue, value);
}
if (view[setNative]) {
if (view._suspendNativeUpdatesCount) {
if (view._suspendedUpdates) {
view._suspendedUpdates[propertyName] = property;
}
}
else {
if (defaultValueKey in this) {
view[setNative](this[defaultValueKey]);
delete this[defaultValueKey];
}
else {
view[setNative](defaultValue);
}
}
}
}
else {
this[key] = value;
if (valueChanged) {
valueChanged(this, oldValue, value);
}
if (view[setNative]) {
if (view._suspendNativeUpdatesCount) {
if (view._suspendedUpdates) {
view._suspendedUpdates[propertyName] = property;
}
}
else {
if (!(defaultValueKey in this)) {
this[defaultValueKey] = view[getDefault] ? view[getDefault]() : defaultValue;
}
view[setNative](value);
}
}
}
if (this.hasListeners(eventName)) {
this.notify({ object: this, eventName: eventName, propertyName: propertyName, value: value, oldValue: oldValue });
}
if (affectsLayout) {
view.requestLayout();
}
}
}
function get() {
return key in this ? this[key] : defaultValue;
}
this.cssValueDescriptor = {
enumerable: true,
configurable: true,
get: get,
set: setCssValue
};
this.localValueDescriptor = {
enumerable: true,
configurable: true,
get: get,
set: setLocalValue
};
cssSymbolPropertyMap[key] = this;
}
CssProperty.prototype.register = function (cls) {
if (this.registered) {
throw new Error("Property " + this.name + " already registered.");
}
this.registered = true;
Object.defineProperty(cls.prototype, this.name, this.localValueDescriptor);
Object.defineProperty(cls.prototype, this.cssName, this.cssValueDescriptor);
if (this.cssLocalName !== this.cssName) {
Object.defineProperty(cls.prototype, this.cssLocalName, this.localValueDescriptor);
}
};
CssProperty.prototype.isSet = function (instance) {
return this.key in instance;
};
return CssProperty;
}());
exports.CssProperty = CssProperty;
CssProperty.prototype.isStyleProperty = true;
var CssAnimationProperty = (function () {
function CssAnimationProperty(options) {
var valueConverter = options.valueConverter, equalityComparer = options.equalityComparer, valueChanged = options.valueChanged, defaultValue = options.defaultValue;
var propertyName = options.name;
this.name = propertyName;
cssPropertyNames.push(options.cssName);
CssAnimationProperty.properties[propertyName] = this;
if (options.cssName && options.cssName !== propertyName) {
CssAnimationProperty.properties[options.cssName] = this;
}
this._valueConverter = options.valueConverter;
var cssLocalName = (options.cssName || propertyName);
this.cssLocalName = cssLocalName;
var cssName = "css:" + cssLocalName;
this.cssName = cssName;
var keyframeName = "keyframe:" + propertyName;
this.keyframe = keyframeName;
var defaultName = "default:" + propertyName;
var defaultValueKey = Symbol(defaultName);
this.defaultValueKey = defaultValueKey;
this.defaultValue = defaultValue;
var cssValue = Symbol(cssName);
var styleValue = Symbol("local:" + propertyName);
var keyframeValue = Symbol(keyframeName);
var computedValue = Symbol("computed-value:" + propertyName);
this.key = computedValue;
var computedSource = Symbol("computed-source:" + propertyName);
this.source = computedSource;
this.getDefault = Symbol(propertyName + ":getDefault");
var getDefault = this.getDefault;
var setNative = this.setNative = Symbol(propertyName + ":setNative");
var eventName = propertyName + "Change";
var property = this;
function descriptor(symbol, propertySource, enumerable, configurable, getsComputed) {
return {
enumerable: enumerable, configurable: configurable,
get: getsComputed ? function () { return this[computedValue]; } : function () { return this[symbol]; },
set: function (boxedValue) {
var oldValue = this[computedValue];
var oldSource = this[computedSource];
var wasSet = oldSource !== 0;
var reset = boxedValue === exports.unsetValue || boxedValue === "";
if (reset) {
this[symbol] = exports.unsetValue;
if (this[computedSource] === propertySource) {
if (this[styleValue] !== exports.unsetValue) {
this[computedSource] = 3;
this[computedValue] = this[styleValue];
}
else if (this[cssValue] !== exports.unsetValue) {
this[computedSource] = 2;
this[computedValue] = this[cssValue];
}
else {
delete this[computedSource];
delete this[computedValue];
}
}
}
else {
if (valueConverter && typeof boxedValue === "string") {
boxedValue = valueConverter(boxedValue);
}
this[symbol] = boxedValue;
if (this[computedSource] <= propertySource) {
this[computedSource] = propertySource;
this[computedValue] = boxedValue;
}
}
var value = this[computedValue];
var source = this[computedSource];
var isSet = source !== 0;
var computedValueChanged = oldValue !== value && (!equalityComparer || !equalityComparer(oldValue, value));
if (computedValueChanged && valueChanged) {
valueChanged(this, oldValue, value);
}
var view = this.view;
if (view[setNative] && (computedValueChanged || isSet !== wasSet)) {
if (view._suspendNativeUpdatesCount) {
if (view._suspendedUpdates) {
view._suspendedUpdates[propertyName] = property;
}
}
else {
if (isSet) {
if (!wasSet && !(defaultValueKey in this)) {
this[defaultValueKey] = view[getDefault] ? view[getDefault]() : defaultValue;
}
view[setNative](value);
}
else if (wasSet) {
if (defaultValueKey in this) {
view[setNative](this[defaultValueKey]);
}
else {
view[setNative](defaultValue);
}
}
}
}
if (computedValueChanged && this.hasListeners(eventName)) {
this.notify({ object: this, eventName: eventName, propertyName: propertyName, value: value, oldValue: oldValue });
}
}
};
}
var defaultPropertyDescriptor = descriptor(defaultValueKey, 0, false, false, false);
var cssPropertyDescriptor = descriptor(cssValue, 2, false, false, false);
var stylePropertyDescriptor = descriptor(styleValue, 3, true, true, true);
var keyframePropertyDescriptor = descriptor(keyframeValue, 4, false, false, false);
symbolPropertyMap[computedValue] = this;
cssSymbolPropertyMap[computedValue] = this;
this.register = function (cls) {
cls.prototype[computedValue] = options.defaultValue;
cls.prototype[computedSource] = 0;
cls.prototype[cssValue] = exports.unsetValue;
cls.prototype[styleValue] = exports.unsetValue;
cls.prototype[keyframeValue] = exports.unsetValue;
Object.defineProperty(cls.prototype, defaultName, defaultPropertyDescriptor);
Object.defineProperty(cls.prototype, cssName, cssPropertyDescriptor);
Object.defineProperty(cls.prototype, propertyName, stylePropertyDescriptor);
if (options.cssName && options.cssName !== options.name) {
Object.defineProperty(cls.prototype, options.cssName, stylePropertyDescriptor);
}
Object.defineProperty(cls.prototype, keyframeName, keyframePropertyDescriptor);
};
}
CssAnimationProperty.prototype._initDefaultNativeValue = function (target) {
var defaultValueKey = this.defaultValueKey;
if (!(defaultValueKey in target)) {
var view = target.view;
var getDefault = this.getDefault;
target[defaultValueKey] = view[getDefault] ? view[getDefault]() : this.defaultValue;
}
};
CssAnimationProperty._getByCssName = function (name) {
return this.properties[name];
};
CssAnimationProperty._getPropertyNames = function () {
return Object.keys(CssAnimationProperty.properties);
};
CssAnimationProperty.prototype.isSet = function (instance) {
return instance[this.source] !== 0;
};
CssAnimationProperty.properties = {};
return CssAnimationProperty;
}());
exports.CssAnimationProperty = CssAnimationProperty;
CssAnimationProperty.prototype.isStyleProperty = true;
var InheritedCssProperty = (function (_super) {
__extends(InheritedCssProperty, _super);
function InheritedCssProperty(options) {
var _this = _super.call(this, options) || this;
var propertyName = options.name;
var key = _this.key;
var sourceKey = _this.sourceKey;
var getDefault = _this.getDefault;
var setNative = _this.setNative;
var defaultValueKey = _this.defaultValueKey;
var eventName = propertyName + "Change";
var defaultValue = options.defaultValue;
var affectsLayout = options.affectsLayout;
var equalityComparer = options.equalityComparer;
var valueChanged = options.valueChanged;
var valueConverter = options.valueConverter;
var property = _this;
var setFunc = function (valueSource) { return function (boxedValue) {
var reset = boxedValue === exports.unsetValue || boxedValue === "";
var currentValueSource = this[sourceKey] || 0;
if (reset) {
if (valueSource === 2 && currentValueSource === 3) {
return;
}
}
else {
if (currentValueSource > valueSource) {
return;
}
}
var oldValue = key in this ? this[key] : defaultValue;
var view = this.view;
var value;
var unsetNativeValue = false;
if (reset) {
var parent_2 = view.parent;
var style = parent_2 ? parent_2.style : null;
if (style && style[sourceKey] > 0) {
value = style[propertyName];
this[sourceKey] = 1;
this[key] = value;
}
else {
value = defaultValue;
delete this[sourceKey];
delete this[key];
unsetNativeValue = true;
}
}
else {
this[sourceKey] = valueSource;
if (valueConverter && typeof boxedValue === "string") {
value = valueConverter(boxedValue);
}
else {
value = boxedValue;
}
this[key] = value;
}
var changed = equalityComparer ? !equalityComparer(oldValue, value) : oldValue !== value;
if (changed) {
var view_1 = this.view;
if (valueChanged) {
valueChanged(this, oldValue, value);
}
if (view_1[setNative]) {
if (view_1._suspendNativeUpdatesCount) {
if (view_1._suspendedUpdates) {
view_1._suspendedUpdates[propertyName] = property;
}
}
else {
if (unsetNativeValue) {
if (defaultValueKey in this) {
view_1[setNative](this[defaultValueKey]);
delete this[defaultValueKey];
}
else {
view_1[setNative](defaultValue);
}
}
else {
if (!(defaultValueKey in this)) {
this[defaultValueKey] = view_1[getDefault] ? view_1[getDefault]() : defaultValue;
}
view_1[setNative](value);
}
}
}
if (this.hasListeners(eventName)) {
this.notify({ object: this, eventName: eventName, propertyName: propertyName, value: value, oldValue: oldValue });
}
if (affectsLayout) {
view_1.requestLayout();
}
view_1.eachChild(function (child) {
var childStyle = child.style;
var childValueSource = childStyle[sourceKey] || 0;
if (reset) {
if (childValueSource === 1) {
setDefaultFunc.call(childStyle, exports.unsetValue);
}
}
else {
if (childValueSource <= 1) {
setInheritedFunc.call(childStyle, value);
}
}
return true;
});
}
}; };
var setDefaultFunc = setFunc(0);
var setInheritedFunc = setFunc(1);
_this.setInheritedValue = setInheritedFunc;
_this.cssValueDescriptor.set = setFunc(2);
_this.localValueDescriptor.set = setFunc(3);
inheritableCssProperties.push(_this);
return _this;
}
return InheritedCssProperty;
}(CssProperty));
exports.InheritedCssProperty = InheritedCssProperty;
var ShorthandProperty = (function () {
function ShorthandProperty(options) {
this.name = options.name;
var key = Symbol(this.name + ":propertyKey");
this.key = key;
this.cssName = "css:" + options.cssName;
this.cssLocalName = "" + options.cssName;
var converter = options.converter;
function setLocalValue(value) {
var _this = this;
this.view._batchUpdate(function () {
for (var _i = 0, _a = converter(value); _i < _a.length; _i++) {
var _b = _a[_i], p = _b[0], v = _b[1];
_this[p.name] = v;
}
});
}
function setCssValue(value) {
var _this = this;
this.view._batchUpdate(function () {
for (var _i = 0, _a = converter(value); _i < _a.length; _i++) {
var _b = _a[_i], p = _b[0], v = _b[1];
_this[p.cssName] = v;
}
});
}
this.cssValueDescriptor = {
enumerable: true,
configurable: true,
get: options.getter,
set: setCssValue
};
this.localValueDescriptor = {
enumerable: true,
configurable: true,
get: options.getter,
set: setLocalValue
};
this.propertyBagDescriptor = {
enumerable: false,
configurable: true,
set: function (value) {
var _this = this;
converter(value).forEach(function (_a) {
var property = _a[0], value = _a[1];
_this[property.cssLocalName] = value;
});
}
};
cssSymbolPropertyMap[key] = this;
}
ShorthandProperty.prototype.register = function (cls) {
if (this.registered) {
throw new Error("Property " + this.name + " already registered.");
}
this.registered = true;
Object.defineProperty(cls.prototype, this.name, this.localValueDescriptor);
Object.defineProperty(cls.prototype, this.cssName, this.cssValueDescriptor);
if (this.cssLocalName !== this.cssName) {
Object.defineProperty(cls.prototype, this.cssLocalName, this.localValueDescriptor);
}
Object.defineProperty(cls.prototype.PropertyBag, this.cssLocalName, this.propertyBagDescriptor);
};
return ShorthandProperty;
}());
exports.ShorthandProperty = ShorthandProperty;
function inheritablePropertyValuesOn(view) {
var array = new Array();
for (var _i = 0, inheritableProperties_1 = inheritableProperties; _i < inheritableProperties_1.length; _i++) {
var prop = inheritableProperties_1[_i];
var sourceKey = prop.sourceKey;
var valueSource = view[sourceKey] || 0;
if (valueSource !== 0) {
array.push({ property: prop, value: view[prop.name] });
}
}
return array;
}
function inheritableCssPropertyValuesOn(style) {
var array = new Array();
for (var _i = 0, inheritableCssProperties_1 = inheritableCssProperties; _i < inheritableCssProperties_1.length; _i++) {
var prop = inheritableCssProperties_1[_i];
var sourceKey = prop.sourceKey;
var valueSource = style[sourceKey] || 0;
if (valueSource !== 0) {
array.push({ property: prop, value: style[prop.name] });
}
}
return array;
}
exports.initNativeView = profiling_1.profile("\"properties\".initNativeView", function initNativeView(view) {
if (view._suspendedUpdates) {
applyPendingNativeSetters(view);
}
else {
applyAllNativeSetters(view);
}
view._suspendedUpdates = {};
});
function applyPendingNativeSetters(view) {
var suspendedUpdates = view._suspendedUpdates;
for (var propertyName in suspendedUpdates) {
var property = suspendedUpdates[propertyName];
var setNative = property.setNative;
if (view[setNative]) {
var getDefault = property.getDefault, isStyleProperty = property.isStyleProperty, defaultValueKey = property.defaultValueKey, defaultValue = property.defaultValue;
var value = void 0;
if (isStyleProperty) {
var style = view.style;
if (property.isSet(view.style)) {
if (!(defaultValueKey in style)) {
style[defaultValueKey] = view[getDefault] ? view[getDefault]() : defaultValue;
}
value = view.style[propertyName];
}
else {
value = style[defaultValueKey];
}
}
else {
if (property.isSet(view)) {
if (!(defaultValueKey in view)) {
view[defaultValueKey] = view[getDefault] ? view[getDefault]() : defaultValue;
}
value = view[propertyName];
}
else {
value = view[defaultValueKey];
}
}
view[setNative](value);
}
}
}
exports.applyPendingNativeSetters = applyPendingNativeSetters;
function applyAllNativeSetters(view) {
var symbols = Object.getOwnPropertySymbols(view);
for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) {
var symbol = symbols_2[_i];
var property = symbolPropertyMap[symbol];
if (!property) {
continue;
}
var setNative = property.setNative;
var getDefault = property.getDefault;
if (setNative in view) {
var defaultValueKey = property.defaultValueKey;
if (!(defaultValueKey in view)) {
view[defaultValueKey] = view[getDefault] ? view[getDefault]() : property.defaultValue;
}
var value = view[symbol];
view[setNative](value);
}
}
var style = view.style;
symbols = Object.getOwnPropertySymbols(style);
for (var _a = 0, symbols_3 = symbols; _a < symbols_3.length; _a++) {
var symbol = symbols_3[_a];
var property = cssSymbolPropertyMap[symbol];
if (!property) {
continue;
}
if (view[property.setNative]) {
var defaultValueKey = property.defaultValueKey;
if (!(defaultValueKey in style)) {
style[defaultValueKey] = view[property.getDefault] ? view[property.getDefault]() : property.defaultValue;
}
var value = style[symbol];
view[property.setNative](value);
}
}
}
exports.applyAllNativeSetters = applyAllNativeSetters;
function resetNativeView(view) {
var symbols = Object.getOwnPropertySymbols(view);
for (var _i = 0, symbols_4 = symbols; _i < symbols_4.length; _i++) {
var symbol = symbols_4[_i];
var property = symbolPropertyMap[symbol];
if (!property) {
continue;
}
if (view[property.setNative]) {
if (property.defaultValueKey in view) {
view[property.setNative](view[property.defaultValueKey]);
delete view[property.defaultValueKey];
}
else {
view[property.setNative](property.defaultValue);
}
}
}
var style = view.style;
symbols = Object.getOwnPropertySymbols(style);
for (var _a = 0, symbols_5 = symbols; _a < symbols_5.length; _a++) {
var symbol = symbols_5[_a];
var property = cssSymbolPropertyMap[symbol];
if (!property) {
continue;
}
if (view[property.setNative]) {
if (property.defaultValueKey in style) {
view[property.setNative](style[property.defaultValueKey]);
delete style[property.defaultValueKey];
}
else {
view[property.setNative](property.defaultValue);
}
}
}
}
exports.resetNativeView = resetNativeView;
function clearInheritedProperties(view) {
for (var _i = 0, inheritableProperties_2 = inheritableProperties; _i < inheritableProperties_2.length; _i++) {
var prop = inheritableProperties_2[_i];
var sourceKey = prop.sourceKey;
if (view[sourceKey] === 1) {
prop.set.call(view, exports.unsetValue);
}
}
var style = view.style;
for (var _a = 0, inheritableCssProperties_2 = inheritableCssProperties; _a < inheritableCssProperties_2.length; _a++) {
var prop = inheritableCssProperties_2[_a];
var sourceKey = prop.sourceKey;
if (style[sourceKey] === 1) {
prop.setInheritedValue.call(style, exports.unsetValue);
}
}
}
exports.clearInheritedProperties = clearInheritedProperties;
function resetCSSProperties(style) {
var symbols = Object.getOwnPropertySymbols(style);
for (var _i = 0, symbols_6 = symbols; _i < symbols_6.length; _i++) {
var symbol = symbols_6[_i];
var cssProperty = void 0;
if (cssProperty = cssSymbolPropertyMap[symbol]) {
style[cssProperty.cssName] = exports.unsetValue;
if (cssProperty instanceof CssAnimationProperty) {
style[cssProperty.keyframe] = exports.unsetValue;
}
}
}
}
exports.resetCSSProperties = resetCSSProperties;
function propagateInheritableProperties(view, child) {
var inheritablePropertyValues = inheritablePropertyValuesOn(view);
for (var _i = 0, inheritablePropertyValues_1 = inheritablePropertyValues; _i < inheritablePropertyValues_1.length; _i++) {
var pair = inheritablePropertyValues_1[_i];
var prop = pair.property;
var sourceKey = prop.sourceKey;
var currentValueSource = child[sourceKey] || 0;
if (currentValueSource <= 1) {
prop.setInheritedValue.call(child, pair.value);
}
}
}
exports.propagateInheritableProperties = propagateInheritableProperties;
function propagateInheritableCssProperties(parentStyle, childStyle) {
var inheritableCssPropertyValues = inheritableCssPropertyValuesOn(parentStyle);
for (var _i = 0, inheritableCssPropertyValues_1 = inheritableCssPropertyValues; _i < inheritableCssPropertyValues_1.length; _i++) {
var pair = inheritableCssPropertyValues_1[_i];
var prop = pair.property;
var sourceKey = prop.sourceKey;
var currentValueSource = childStyle[sourceKey] || 0;
if (currentValueSource <= 1) {
prop.setInheritedValue.call(childStyle, pair.value, 1);
}
}
}
exports.propagateInheritableCssProperties = propagateInheritableCssProperties;
function makeValidator() {
var values = [];
for (var _i = 0; _i < arguments.length; _i++) {
values[_i] = arguments[_i];
}
var set = new Set(values);
return function (value) { return set.has(value); };
}
exports.makeValidator = makeValidator;
function makeParser(isValid) {
return function (value) {
var lower = value && value.toLowerCase();
if (isValid(lower)) {
return lower;
}
else {
throw new Error("Invalid value: " + value);
}
};
}
exports.makeParser = makeParser;
function getSetProperties(view) {
var result = [];
Object.getOwnPropertyNames(view).forEach(function (prop) {
result.push([prop, view[prop]]);
});
var symbols = Object.getOwnPropertySymbols(view);
for (var _i = 0, symbols_7 = symbols; _i < symbols_7.length; _i++) {
var symbol = symbols_7[_i];
var property = symbolPropertyMap[symbol];
if (!property) {
continue;
}
var value = view[property.key];
result.push([property.name, value]);
}
return result;
}
exports.getSetProperties = getSetProperties;
function getComputedCssValues(view) {
var result = [];
var style = view.style;
for (var _i = 0, cssPropertyNames_1 = cssPropertyNames; _i < cssPropertyNames_1.length; _i++) {
var prop = cssPropertyNames_1[_i];
result.push([prop, style[prop]]);
}
result.push(["top", "auto"]);
result.push(["left", "auto"]);
result.push(["bottom", "auto"]);
result.push(["right", "auto"]);
return result;
}
exports.getComputedCssValues = getComputedCssValues;
//# sourceMappingURL=properties.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/core/view-base/view-base.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var properties_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/properties/properties.js");
var debug_1 = __webpack_require__("../node_modules/tns-core-modules/utils/debug.js");
var bindable_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/bindable/bindable.js");
var platform_1 = __webpack_require__("../node_modules/tns-core-modules/platform/platform.js");
exports.isIOS = platform_1.isIOS;
exports.isAndroid = platform_1.isAndroid;
var utils_1 = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
exports.layout = utils_1.layout;
var style_properties_1 = __webpack_require__("../node_modules/tns-core-modules/ui/styling/style-properties.js");
var types = __webpack_require__("../node_modules/tns-core-modules/utils/types.js");
var color_1 = __webpack_require__("../node_modules/tns-core-modules/color/color.js");
exports.Color = color_1.Color;
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/bindable/bindable.js"));
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/properties/properties.js"));
var ssm = __webpack_require__("../node_modules/tns-core-modules/ui/styling/style-scope.js");
var domNodeModule;
function ensuredomNodeModule() {
if (!domNodeModule) {
domNodeModule = __webpack_require__("../node_modules/tns-core-modules/debugger/dom-node.js");
}
}
var styleScopeModule;
function ensureStyleScopeModule() {
if (!styleScopeModule) {
styleScopeModule = __webpack_require__("../node_modules/tns-core-modules/ui/styling/style-scope.js");
}
}
var defaultBindingSource = {};
function getAncestor(view, criterion) {
var matcher = null;
if (typeof criterion === "string") {
matcher = function (view) { return view.typeName === criterion; };
}
else {
matcher = function (view) { return view instanceof criterion; };
}
for (var parent_1 = view.parent; parent_1 != null; parent_1 = parent_1.parent) {
if (matcher(parent_1)) {
return parent_1;
}
}
return null;
}
exports.getAncestor = getAncestor;
function getViewById(view, id) {
if (!view) {
return undefined;
}
if (view.id === id) {
return view;
}
var retVal;
var descendantsCallback = function (child) {
if (child.id === id) {
retVal = child;
return false;
}
return true;
};
eachDescendant(view, descendantsCallback);
return retVal;
}
exports.getViewById = getViewById;
function eachDescendant(view, callback) {
if (!callback || !view) {
return;
}
var continueIteration;
var localCallback = function (child) {
continueIteration = callback(child);
if (continueIteration) {
child.eachChild(localCallback);
}
return continueIteration;
};
view.eachChild(localCallback);
}
exports.eachDescendant = eachDescendant;
var viewIdCounter = 1;
var Flags;
(function (Flags) {
Flags["superOnLoadedCalled"] = "Loaded";
Flags["superOnUnloadedCalled"] = "Unloaded";
})(Flags || (Flags = {}));
var SuspendType;
(function (SuspendType) {
SuspendType[SuspendType["Incremental"] = 0] = "Incremental";
SuspendType[SuspendType["Loaded"] = 1048576] = "Loaded";
SuspendType[SuspendType["NativeView"] = 2097152] = "NativeView";
SuspendType[SuspendType["UISetup"] = 4194304] = "UISetup";
SuspendType[SuspendType["IncrementalCountMask"] = -7340033] = "IncrementalCountMask";
})(SuspendType || (SuspendType = {}));
(function (SuspendType) {
function toString(type) {
return (type ? "suspended" : "resumed") + "(" +
"Incremental: " + (type & SuspendType.IncrementalCountMask) + ", " +
"Loaded: " + !(type & SuspendType.Loaded) + ", " +
"NativeView: " + !(type & SuspendType.NativeView) + ", " +
"UISetup: " + !(type & SuspendType.UISetup) +
")";
}
SuspendType.toString = toString;
})(SuspendType || (SuspendType = {}));
var ViewBase = (function (_super) {
__extends(ViewBase, _super);
function ViewBase() {
var _this = _super.call(this) || this;
_this._onLoadedCalled = false;
_this._onUnloadedCalled = false;
_this._cssState = new ssm.CssState(_this);
_this.pseudoClassAliases = {
"highlighted": [
"active",
"pressed"
]
};
_this.cssClasses = new Set();
_this.cssPseudoClasses = new Set();
_this._domId = viewIdCounter++;
_this._style = new properties_1.Style(_this);
return _this;
}
Object.defineProperty(ViewBase.prototype, "parentNode", {
get: function () {
return this._templateParent || this.parent;
},
set: function (node) {
this._templateParent = node;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewBase.prototype, "nativeView", {
get: function () {
return this.nativeViewProtected;
},
set: function (value) {
this.setNativeView(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewBase.prototype, "typeName", {
get: function () {
return types.getClass(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewBase.prototype, "style", {
get: function () {
return this._style;
},
set: function (inlineStyle) {
if (typeof inlineStyle === "string") {
this.setInlineStyle(inlineStyle);
}
else {
throw new Error("View.style property is read-only.");
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewBase.prototype, "android", {
get: function () {
return this._androidView;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewBase.prototype, "ios", {
get: function () {
return this._iosView;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewBase.prototype, "isLoaded", {
get: function () {
return this._isLoaded;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewBase.prototype, "class", {
get: function () {
return this.className;
},
set: function (v) {
this.className = v;
},
enumerable: true,
configurable: true
});
ViewBase.prototype.getViewById = function (id) {
return getViewById(this, id);
};
Object.defineProperty(ViewBase.prototype, "page", {
get: function () {
if (this.parent) {
return this.parent.page;
}
return null;
},
enumerable: true,
configurable: true
});
ViewBase.prototype.ensureDomNode = function () {
if (!this.domNode) {
ensuredomNodeModule();
this.domNode = new domNodeModule.DOMNode(this);
}
};
ViewBase.prototype.set = function (name, value) {
this[name] = bindable_1.WrappedValue.unwrap(value);
};
ViewBase.prototype.onLoaded = function () {
var _this = this;
this.setFlag(Flags.superOnLoadedCalled, true);
if (this._isLoaded) {
return;
}
this._isLoaded = true;
this._cssState.onLoaded();
this._resumeNativeUpdates(SuspendType.Loaded);
this.eachChild(function (child) {
_this.loadView(child);
return true;
});
this._emit("loaded");
};
ViewBase.prototype.onUnloaded = function () {
var _this = this;
this.setFlag(Flags.superOnUnloadedCalled, true);
if (!this._isLoaded) {
return;
}
this._suspendNativeUpdates(SuspendType.Loaded);
this.eachChild(function (child) {
_this.unloadView(child);
return true;
});
this._isLoaded = false;
this._cssState.onUnloaded();
this._emit("unloaded");
};
ViewBase.prototype._suspendNativeUpdates = function (type) {
if (type) {
this._suspendNativeUpdatesCount = this._suspendNativeUpdatesCount | type;
}
else {
this._suspendNativeUpdatesCount++;
}
};
ViewBase.prototype._resumeNativeUpdates = function (type) {
if (type) {
this._suspendNativeUpdatesCount = this._suspendNativeUpdatesCount & ~type;
}
else {
if ((this._suspendNativeUpdatesCount & SuspendType.IncrementalCountMask) === 0) {
throw new Error("Invalid call to " + this + "._resumeNativeUpdates");
}
this._suspendNativeUpdatesCount--;
}
if (!this._suspendNativeUpdatesCount) {
this.onResumeNativeUpdates();
}
};
ViewBase.prototype._batchUpdate = function (callback) {
try {
this._suspendNativeUpdates(SuspendType.Incremental);
return callback();
}
finally {
this._resumeNativeUpdates(SuspendType.Incremental);
}
};
ViewBase.prototype.setFlag = function (flag, value) {
switch (flag) {
case Flags.superOnLoadedCalled:
this._onLoadedCalled = value;
break;
case Flags.superOnUnloadedCalled:
this._onUnloadedCalled = value;
break;
}
};
ViewBase.prototype.isFlagSet = function (flag) {
switch (flag) {
case Flags.superOnLoadedCalled:
return this._onLoadedCalled;
case Flags.superOnUnloadedCalled:
return this._onUnloadedCalled;
}
};
ViewBase.prototype.callFunctionWithSuper = function (flag, func) {
this.setFlag(flag, false);
func();
if (!this.isFlagSet(flag)) {
throw new Error("super." + flag + " not called in " + this);
}
};
ViewBase.prototype.callLoaded = function () {
var _this = this;
this.callFunctionWithSuper(Flags.superOnLoadedCalled, function () { return _this.onLoaded(); });
};
ViewBase.prototype.callUnloaded = function () {
var _this = this;
this.callFunctionWithSuper(Flags.superOnUnloadedCalled, function () { return _this.onUnloaded(); });
};
ViewBase.prototype.notifyPseudoClassChanged = function (pseudoClass) {
this.notify({ eventName: ":" + pseudoClass, object: this });
};
ViewBase.prototype.getAllAliasedStates = function (name) {
var allStates = [];
allStates.push(name);
if (name in this.pseudoClassAliases) {
for (var i = 0; i < this.pseudoClassAliases[name].length; i++) {
allStates.push(this.pseudoClassAliases[name][i]);
}
}
return allStates;
};
ViewBase.prototype.addPseudoClass = function (name) {
var allStates = this.getAllAliasedStates(name);
for (var i = 0; i < allStates.length; i++) {
if (!this.cssPseudoClasses.has(allStates[i])) {
this.cssPseudoClasses.add(allStates[i]);
this.notifyPseudoClassChanged(allStates[i]);
}
}
};
ViewBase.prototype.deletePseudoClass = function (name) {
var allStates = this.getAllAliasedStates(name);
for (var i = 0; i < allStates.length; i++) {
if (this.cssPseudoClasses.has(allStates[i])) {
this.cssPseudoClasses.delete(allStates[i]);
this.notifyPseudoClassChanged(allStates[i]);
}
}
};
ViewBase.prototype.bindingContextChanged = function (data) {
this.bindings.get("bindingContext").bind(data.value);
};
ViewBase.prototype.bind = function (options, source) {
if (source === void 0) { source = defaultBindingSource; }
var targetProperty = options.targetProperty;
this.unbind(targetProperty);
if (!this.bindings) {
this.bindings = new Map();
}
var binding = new bindable_1.Binding(this, options);
this.bindings.set(targetProperty, binding);
var bindingSource = source;
if (bindingSource === defaultBindingSource) {
bindingSource = this.bindingContext;
binding.sourceIsBindingContext = true;
if (targetProperty === "bindingContext") {
this.bindingContextBoundToParentBindingContextChanged = true;
var parent_2 = this.parent;
if (parent_2) {
parent_2.on("bindingContextChange", this.bindingContextChanged, this);
}
else {
this.shouldAddHandlerToParentBindingContextChanged = true;
}
}
}
binding.bind(bindingSource);
};
ViewBase.prototype.unbind = function (property) {
var bindings = this.bindings;
if (!bindings) {
return;
}
var binding = bindings.get(property);
if (binding) {
binding.unbind();
bindings.delete(property);
if (binding.sourceIsBindingContext) {
if (property === "bindingContext") {
this.shouldAddHandlerToParentBindingContextChanged = false;
this.bindingContextBoundToParentBindingContextChanged = false;
var parent_3 = this.parent;
if (parent_3) {
parent_3.off("bindingContextChange", this.bindingContextChanged, this);
}
}
}
}
};
ViewBase.prototype.requestLayout = function () {
var parent = this.parent;
if (parent) {
parent.requestLayout();
}
};
ViewBase.prototype.eachChild = function (callback) {
};
ViewBase.prototype._addView = function (view, atIndex) {
if (bindable_1.traceEnabled()) {
bindable_1.traceWrite(this + "._addView(" + view + ", " + atIndex + ")", bindable_1.traceCategories.ViewHierarchy);
}
if (!view) {
throw new Error("Expecting a valid View instance.");
}
if (!(view instanceof ViewBase)) {
throw new Error(view + " is not a valid View instance.");
}
if (view.parent) {
throw new Error("View already has a parent. View: " + view + " Parent: " + view.parent);
}
view.parent = this;
this._addViewCore(view, atIndex);
view._parentChanged(null);
if (this.domNode) {
this.domNode.onChildAdded(view);
}
};
ViewBase.prototype._addViewCore = function (view, atIndex) {
properties_1.propagateInheritableProperties(this, view);
view._inheritStyleScope(this._styleScope);
properties_1.propagateInheritableCssProperties(this.style, view.style);
if (this._context) {
view._setupUI(this._context, atIndex);
}
if (this._isLoaded) {
this.loadView(view);
}
};
ViewBase.prototype.loadView = function (view) {
if (view && !view.isLoaded) {
view.callLoaded();
}
};
ViewBase.prototype.unloadView = function (view) {
if (view && view.isLoaded) {
view.callUnloaded();
}
};
ViewBase.prototype._removeView = function (view) {
if (bindable_1.traceEnabled()) {
bindable_1.traceWrite(this + "._removeView(" + view + ")", bindable_1.traceCategories.ViewHierarchy);
}
if (view.parent !== this) {
throw new Error("View not added to this instance. View: " + view + " CurrentParent: " + view.parent + " ExpectedParent: " + this);
}
if (this.domNode) {
this.domNode.onChildRemoved(view);
}
this._removeViewCore(view);
view.parent = undefined;
view._parentChanged(this);
};
ViewBase.prototype._removeViewCore = function (view) {
this.unloadView(view);
if (view._context) {
view._tearDownUI();
}
};
ViewBase.prototype.createNativeView = function () {
return undefined;
};
ViewBase.prototype.disposeNativeView = function () {
};
ViewBase.prototype.initNativeView = function () {
};
ViewBase.prototype.resetNativeView = function () {
};
ViewBase.prototype.resetNativeViewInternal = function () {
};
ViewBase.prototype._setupAsRootView = function (context) {
this._setupUI(context);
};
ViewBase.prototype._setupUI = function (context, atIndex, parentIsLoaded) {
if (this._context === context) {
return;
}
else if (this._context) {
this._tearDownUI(true);
}
this._context = context;
var nativeView = this.nativeViewProtected;
if (!nativeView) {
nativeView = this.createNativeView();
}
if (platform_1.isAndroid) {
this._androidView = nativeView;
if (nativeView) {
if (this._isPaddingRelative === undefined) {
this._isPaddingRelative = nativeView.isPaddingRelative();
}
var result = nativeView.defaultPaddings;
if (result === undefined) {
result = org.nativescript.widgets.ViewHelper.getPadding(nativeView);
nativeView.defaultPaddings = result;
}
this._defaultPaddingTop = result.top;
this._defaultPaddingRight = result.right;
this._defaultPaddingBottom = result.bottom;
this._defaultPaddingLeft = result.left;
var style = this.style;
if (!style_properties_1.paddingTopProperty.isSet(style)) {
this.effectivePaddingTop = this._defaultPaddingTop;
}
if (!style_properties_1.paddingRightProperty.isSet(style)) {
this.effectivePaddingRight = this._defaultPaddingRight;
}
if (!style_properties_1.paddingBottomProperty.isSet(style)) {
this.effectivePaddingBottom = this._defaultPaddingBottom;
}
if (!style_properties_1.paddingLeftProperty.isSet(style)) {
this.effectivePaddingLeft = this._defaultPaddingLeft;
}
}
}
else {
this._iosView = nativeView;
}
this.setNativeView(nativeView);
if (this.parent) {
var nativeIndex = this.parent._childIndexToNativeChildIndex(atIndex);
this._isAddedToNativeVisualTree = this.parent._addViewToNativeVisualTree(this, nativeIndex);
}
this._resumeNativeUpdates(SuspendType.UISetup);
this.eachChild(function (child) {
child._setupUI(context);
return true;
});
};
ViewBase.prototype.setNativeView = function (value) {
if (this.__nativeView === value) {
return;
}
if (this.__nativeView) {
this._suspendNativeUpdates(SuspendType.NativeView);
}
this.__nativeView = this.nativeViewProtected = value;
if (this.__nativeView) {
this._suspendedUpdates = undefined;
this.initNativeView();
this._resumeNativeUpdates(SuspendType.NativeView);
}
};
ViewBase.prototype._tearDownUI = function (force) {
if (!this._context) {
return;
}
this.resetNativeViewInternal();
this.eachChild(function (child) {
child._tearDownUI(force);
return true;
});
if (this.parent) {
this.parent._removeViewFromNativeVisualTree(this);
}
this.disposeNativeView();
this._suspendNativeUpdates(SuspendType.UISetup);
if (platform_1.isAndroid) {
this.setNativeView(null);
this._androidView = null;
}
this._context = null;
if (this.domNode) {
this.domNode.dispose();
this.domNode = undefined;
}
};
ViewBase.prototype._childIndexToNativeChildIndex = function (index) {
return index;
};
ViewBase.prototype._addViewToNativeVisualTree = function (view, atIndex) {
if (view._isAddedToNativeVisualTree) {
throw new Error("Child already added to the native visual tree.");
}
return true;
};
ViewBase.prototype._removeViewFromNativeVisualTree = function (view) {
view._isAddedToNativeVisualTree = false;
};
ViewBase.prototype._goToVisualState = function (state) {
if (bindable_1.traceEnabled()) {
bindable_1.traceWrite(this + " going to state: " + state, bindable_1.traceCategories.Style);
}
if (state === this._visualState) {
return;
}
this.deletePseudoClass(this._visualState);
this._visualState = state;
this.addPseudoClass(state);
};
ViewBase.prototype._applyXmlAttribute = function (attribute, value) {
if (attribute === "style" || attribute === "rows" || attribute === "columns" || attribute === "fontAttributes") {
this[attribute] = value;
return true;
}
return false;
};
ViewBase.prototype.setInlineStyle = function (style) {
if (typeof style !== "string") {
throw new Error("Parameter should be valid CSS string!");
}
ensureStyleScopeModule();
styleScopeModule.applyInlineStyle(this, style);
};
ViewBase.prototype._parentChanged = function (oldParent) {
var newParent = this.parent;
if (oldParent) {
properties_1.clearInheritedProperties(this);
if (this.bindingContextBoundToParentBindingContextChanged) {
oldParent.off("bindingContextChange", this.bindingContextChanged, this);
}
}
else if (this.shouldAddHandlerToParentBindingContextChanged) {
newParent.on("bindingContextChange", this.bindingContextChanged, this);
this.bindings.get("bindingContext").bind(newParent.bindingContext);
}
};
ViewBase.prototype.onResumeNativeUpdates = function () {
properties_1.initNativeView(this);
};
ViewBase.prototype.toString = function () {
var str = this.typeName;
if (this.id) {
str += "<" + this.id + ">";
}
else {
str += "(" + this._domId + ")";
}
var source = debug_1.Source.get(this);
if (source) {
str += "@" + source + ";";
}
return str;
};
ViewBase.prototype._onCssStateChange = function () {
this._cssState.onChange();
eachDescendant(this, function (child) {
child._cssState.onChange();
return true;
});
};
ViewBase.prototype._inheritStyleScope = function (styleScope) {
if (this._isStyleScopeHost) {
return;
}
if (this._styleScope !== styleScope) {
this._styleScope = styleScope;
this._onCssStateChange();
this.eachChild(function (child) {
child._inheritStyleScope(styleScope);
return true;
});
}
};
ViewBase.prototype.showModal = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var parent = this.parent;
return parent && parent.showModal.apply(parent, args);
};
ViewBase.prototype.closeModal = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var parent = this.parent;
if (parent) {
parent.closeModal.apply(parent, args);
}
};
ViewBase.prototype._dialogClosed = function () {
eachDescendant(this, function (child) {
child._dialogClosed();
return true;
});
};
ViewBase.prototype._onRootViewReset = function () {
eachDescendant(this, function (child) {
child._onRootViewReset();
return true;
});
};
ViewBase.loadedEvent = "loaded";
ViewBase.unloadedEvent = "unloaded";
__decorate([
profiling_1.profile
], ViewBase.prototype, "onLoaded", null);
__decorate([
profiling_1.profile
], ViewBase.prototype, "onUnloaded", null);
__decorate([
profiling_1.profile
], ViewBase.prototype, "addPseudoClass", null);
__decorate([
profiling_1.profile
], ViewBase.prototype, "deletePseudoClass", null);
__decorate([
profiling_1.profile
], ViewBase.prototype, "requestLayout", null);
__decorate([
profiling_1.profile
], ViewBase.prototype, "_addView", null);
__decorate([
profiling_1.profile
], ViewBase.prototype, "_setupUI", null);
__decorate([
profiling_1.profile
], ViewBase.prototype, "_tearDownUI", null);
return ViewBase;
}(bindable_1.Observable));
exports.ViewBase = ViewBase;
ViewBase.prototype.isCollapsed = false;
ViewBase.prototype._oldLeft = 0;
ViewBase.prototype._oldTop = 0;
ViewBase.prototype._oldRight = 0;
ViewBase.prototype._oldBottom = 0;
ViewBase.prototype.effectiveMinWidth = 0;
ViewBase.prototype.effectiveMinHeight = 0;
ViewBase.prototype.effectiveWidth = 0;
ViewBase.prototype.effectiveHeight = 0;
ViewBase.prototype.effectiveMarginTop = 0;
ViewBase.prototype.effectiveMarginRight = 0;
ViewBase.prototype.effectiveMarginBottom = 0;
ViewBase.prototype.effectiveMarginLeft = 0;
ViewBase.prototype.effectivePaddingTop = 0;
ViewBase.prototype.effectivePaddingRight = 0;
ViewBase.prototype.effectivePaddingBottom = 0;
ViewBase.prototype.effectivePaddingLeft = 0;
ViewBase.prototype.effectiveBorderTopWidth = 0;
ViewBase.prototype.effectiveBorderRightWidth = 0;
ViewBase.prototype.effectiveBorderBottomWidth = 0;
ViewBase.prototype.effectiveBorderLeftWidth = 0;
ViewBase.prototype._defaultPaddingTop = 0;
ViewBase.prototype._defaultPaddingRight = 0;
ViewBase.prototype._defaultPaddingBottom = 0;
ViewBase.prototype._defaultPaddingLeft = 0;
ViewBase.prototype._isViewBase = true;
ViewBase.prototype.recycleNativeView = "never";
ViewBase.prototype._suspendNativeUpdatesCount =
SuspendType.Loaded |
SuspendType.NativeView |
SuspendType.UISetup;
exports.bindingContextProperty = new properties_1.InheritedProperty({ name: "bindingContext" });
exports.bindingContextProperty.register(ViewBase);
exports.classNameProperty = new properties_1.Property({
name: "className",
valueChanged: function (view, oldValue, newValue) {
var classes = view.cssClasses;
classes.clear();
if (typeof newValue === "string") {
newValue.split(" ").forEach(function (c) { return classes.add(c); });
}
view._onCssStateChange();
}
});
exports.classNameProperty.register(ViewBase);
exports.idProperty = new properties_1.Property({ name: "id", valueChanged: function (view, oldValue, newValue) { return view._onCssStateChange(); } });
exports.idProperty.register(ViewBase);
function booleanConverter(v) {
var lowercase = (v + "").toLowerCase();
if (lowercase === "true") {
return true;
}
else if (lowercase === "false") {
return false;
}
throw new Error("Invalid boolean: " + v);
}
exports.booleanConverter = booleanConverter;
//# sourceMappingURL=view-base.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/core/view/view-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var view_base_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view-base/view-base.js");
var style_properties_1 = __webpack_require__("../node_modules/tns-core-modules/ui/styling/style-properties.js");
var gestures_1 = __webpack_require__("../node_modules/tns-core-modules/ui/gestures/gestures.js");
var builder_1 = __webpack_require__("../node_modules/tns-core-modules/ui/builder/builder.js");
var style_scope_1 = __webpack_require__("../node_modules/tns-core-modules/ui/styling/style-scope.js");
var linear_gradient_1 = __webpack_require__("../node_modules/tns-core-modules/ui/styling/linear-gradient.js");
exports.LinearGradient = linear_gradient_1.LinearGradient;
__export(__webpack_require__("../node_modules/tns-core-modules/ui/styling/style-properties.js"));
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/view-base/view-base.js"));
var animationModule;
function ensureAnimationModule() {
if (!animationModule) {
animationModule = __webpack_require__("../node_modules/tns-core-modules/ui/animation/animation.js");
}
}
function CSSType(type) {
return function (cls) {
cls.prototype.cssType = type;
};
}
exports.CSSType = CSSType;
function PseudoClassHandler() {
var pseudoClasses = [];
for (var _i = 0; _i < arguments.length; _i++) {
pseudoClasses[_i] = arguments[_i];
}
var stateEventNames = pseudoClasses.map(function (s) { return ":" + s; });
var listeners = Symbol("listeners");
return function (target, propertyKey, descriptor) {
function update(change) {
var prev = this[listeners] || 0;
var next = prev + change;
if (prev <= 0 && next > 0) {
this[propertyKey](true);
}
else if (prev > 0 && next <= 0) {
this[propertyKey](false);
}
}
stateEventNames.forEach(function (s) { return target[s] = update; });
};
}
exports.PseudoClassHandler = PseudoClassHandler;
exports._rootModalViews = new Array();
var ViewCommon = (function (_super) {
__extends(ViewCommon, _super);
function ViewCommon() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._gestureObservers = {};
return _this;
}
Object.defineProperty(ViewCommon.prototype, "css", {
get: function () {
var scope = this._styleScope;
return scope && scope.css;
},
set: function (value) {
this._updateStyleScope(undefined, undefined, value);
},
enumerable: true,
configurable: true
});
ViewCommon.prototype.addCss = function (cssString) {
this._updateStyleScope(undefined, cssString);
};
ViewCommon.prototype.addCssFile = function (cssFileName) {
this._updateStyleScope(cssFileName);
};
ViewCommon.prototype._updateStyleScope = function (cssFileName, cssString, css) {
var scope = this._styleScope;
if (!scope) {
scope = new style_scope_1.StyleScope();
this.setScopeProperty(scope, cssFileName, cssString, css);
this._inheritStyleScope(scope);
this._isStyleScopeHost = true;
}
else {
this.setScopeProperty(scope, cssFileName, cssString, css);
this._onCssStateChange();
}
};
ViewCommon.prototype.setScopeProperty = function (scope, cssFileName, cssString, css) {
if (cssFileName !== undefined) {
scope.addCssFile(cssFileName);
}
else if (cssString !== undefined) {
scope.addCss(cssString);
}
else if (css !== undefined) {
scope.css = css;
}
};
ViewCommon.prototype._setupAsRootView = function (context) {
_super.prototype._setupAsRootView.call(this, context);
if (!this._styleScope) {
this._updateStyleScope();
}
};
ViewCommon.prototype.observe = function (type, callback, thisArg) {
if (!this._gestureObservers[type]) {
this._gestureObservers[type] = [];
}
this._gestureObservers[type].push(gestures_1.observe(this, type, callback, thisArg));
};
ViewCommon.prototype.getGestureObservers = function (type) {
return this._gestureObservers[type];
};
ViewCommon.prototype.addEventListener = function (arg, callback, thisArg) {
if (typeof arg === "string") {
arg = view_base_1.getEventOrGestureName(arg);
var gesture = gestures_1.fromString(arg);
if (gesture && !this._isEvent(arg)) {
this.observe(gesture, callback, thisArg);
}
else {
var events = (arg).split(",");
if (events.length > 0) {
for (var i = 0; i < events.length; i++) {
var evt = events[i].trim();
var gst = gestures_1.fromString(evt);
if (gst && !this._isEvent(arg)) {
this.observe(gst, callback, thisArg);
}
else {
_super.prototype.addEventListener.call(this, evt, callback, thisArg);
}
}
}
else {
_super.prototype.addEventListener.call(this, arg, callback, thisArg);
}
}
}
else if (typeof arg === "number") {
this.observe(arg, callback, thisArg);
}
};
ViewCommon.prototype.removeEventListener = function (arg, callback, thisArg) {
if (typeof arg === "string") {
var gesture = gestures_1.fromString(arg);
if (gesture && !this._isEvent(arg)) {
this._disconnectGestureObservers(gesture);
}
else {
var events = arg.split(",");
if (events.length > 0) {
for (var i = 0; i < events.length; i++) {
var evt = events[i].trim();
var gst = gestures_1.fromString(evt);
if (gst && !this._isEvent(arg)) {
this._disconnectGestureObservers(gst);
}
else {
_super.prototype.removeEventListener.call(this, evt, callback, thisArg);
}
}
}
else {
_super.prototype.removeEventListener.call(this, arg, callback, thisArg);
}
}
}
else if (typeof arg === "number") {
this._disconnectGestureObservers(arg);
}
};
ViewCommon.prototype._onLivesync = function () {
exports._rootModalViews.forEach(function (v) { return v.closeModal(); });
exports._rootModalViews.length = 0;
return false;
};
ViewCommon.prototype.onBackPressed = function () {
return false;
};
ViewCommon.prototype._getFragmentManager = function () {
return undefined;
};
ViewCommon.prototype.showModal = function () {
if (arguments.length === 0) {
throw new Error("showModal without parameters is deprecated. Please call showModal on a view instance instead.");
}
else {
var firstAgrument = arguments[0];
var context_1 = arguments[1];
var closeCallback = arguments[2];
var fullscreen = arguments[3];
var animated = arguments[4];
var stretched = arguments[5];
var view = firstAgrument instanceof ViewCommon
? firstAgrument : builder_1.createViewFromEntry({ moduleName: firstAgrument });
view._showNativeModalView(this, context_1, closeCallback, fullscreen, animated, stretched);
return view;
}
};
ViewCommon.prototype.closeModal = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var closeCallback = this._closeModalCallback;
if (closeCallback) {
closeCallback.apply(undefined, arguments);
}
else {
var parent_1 = this.parent;
if (parent_1) {
parent_1.closeModal.apply(parent_1, args);
}
}
};
Object.defineProperty(ViewCommon.prototype, "modal", {
get: function () {
return this._modal;
},
enumerable: true,
configurable: true
});
ViewCommon.prototype._showNativeModalView = function (parent, context, closeCallback, fullscreen, animated, stretched) {
exports._rootModalViews.push(this);
parent._modal = this;
this._modalParent = parent;
this._modalContext = context;
var that = this;
this._closeModalCallback = function () {
if (that._closeModalCallback) {
var modalIndex = exports._rootModalViews.indexOf(that);
exports._rootModalViews.splice(modalIndex);
that._hideNativeModalView(parent);
that._modalParent = null;
that._modalContext = null;
that._closeModalCallback = null;
that._dialogClosed();
parent._modal = null;
if (typeof closeCallback === "function") {
closeCallback.apply(undefined, arguments);
}
}
};
};
ViewCommon.prototype._hideNativeModalView = function (parent) {
};
ViewCommon.prototype._raiseLayoutChangedEvent = function () {
var args = {
eventName: ViewCommon.layoutChangedEvent,
object: this
};
this.notify(args);
};
ViewCommon.prototype._raiseShownModallyEvent = function () {
var args = {
eventName: ViewCommon.shownModallyEvent,
object: this,
context: this._modalContext,
closeCallback: this._closeModalCallback
};
this.notify(args);
};
ViewCommon.prototype._raiseShowingModallyEvent = function () {
var args = {
eventName: ViewCommon.showingModallyEvent,
object: this,
context: this._modalContext,
closeCallback: this._closeModalCallback
};
this.notify(args);
};
ViewCommon.prototype._isEvent = function (name) {
return this.constructor && name + "Event" in this.constructor;
};
ViewCommon.prototype._disconnectGestureObservers = function (type) {
var observers = this.getGestureObservers(type);
if (observers) {
for (var i = 0; i < observers.length; i++) {
observers[i].disconnect();
}
}
};
Object.defineProperty(ViewCommon.prototype, "borderColor", {
get: function () {
return this.style.borderColor;
},
set: function (value) {
this.style.borderColor = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderTopColor", {
get: function () {
return this.style.borderTopColor;
},
set: function (value) {
this.style.borderTopColor = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderRightColor", {
get: function () {
return this.style.borderRightColor;
},
set: function (value) {
this.style.borderRightColor = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderBottomColor", {
get: function () {
return this.style.borderBottomColor;
},
set: function (value) {
this.style.borderBottomColor = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderLeftColor", {
get: function () {
return this.style.borderLeftColor;
},
set: function (value) {
this.style.borderLeftColor = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderWidth", {
get: function () {
return this.style.borderWidth;
},
set: function (value) {
this.style.borderWidth = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderTopWidth", {
get: function () {
return this.style.borderTopWidth;
},
set: function (value) {
this.style.borderTopWidth = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderRightWidth", {
get: function () {
return this.style.borderRightWidth;
},
set: function (value) {
this.style.borderRightWidth = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderBottomWidth", {
get: function () {
return this.style.borderBottomWidth;
},
set: function (value) {
this.style.borderBottomWidth = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderLeftWidth", {
get: function () {
return this.style.borderLeftWidth;
},
set: function (value) {
this.style.borderLeftWidth = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderRadius", {
get: function () {
return this.style.borderRadius;
},
set: function (value) {
this.style.borderRadius = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderTopLeftRadius", {
get: function () {
return this.style.borderTopLeftRadius;
},
set: function (value) {
this.style.borderTopLeftRadius = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderTopRightRadius", {
get: function () {
return this.style.borderTopRightRadius;
},
set: function (value) {
this.style.borderTopRightRadius = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderBottomRightRadius", {
get: function () {
return this.style.borderBottomRightRadius;
},
set: function (value) {
this.style.borderBottomRightRadius = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderBottomLeftRadius", {
get: function () {
return this.style.borderBottomLeftRadius;
},
set: function (value) {
this.style.borderBottomLeftRadius = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "color", {
get: function () {
return this.style.color;
},
set: function (value) {
this.style.color = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "background", {
get: function () {
return this.style.background;
},
set: function (value) {
this.style.background = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "backgroundColor", {
get: function () {
return this.style.backgroundColor;
},
set: function (value) {
this.style.backgroundColor = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "backgroundImage", {
get: function () {
return this.style.backgroundImage;
},
set: function (value) {
this.style.backgroundImage = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "minWidth", {
get: function () {
return this.style.minWidth;
},
set: function (value) {
this.style.minWidth = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "minHeight", {
get: function () {
return this.style.minHeight;
},
set: function (value) {
this.style.minHeight = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "width", {
get: function () {
return this.style.width;
},
set: function (value) {
this.style.width = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "height", {
get: function () {
return this.style.height;
},
set: function (value) {
this.style.height = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "margin", {
get: function () {
return this.style.margin;
},
set: function (value) {
this.style.margin = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "marginLeft", {
get: function () {
return this.style.marginLeft;
},
set: function (value) {
this.style.marginLeft = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "marginTop", {
get: function () {
return this.style.marginTop;
},
set: function (value) {
this.style.marginTop = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "marginRight", {
get: function () {
return this.style.marginRight;
},
set: function (value) {
this.style.marginRight = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "marginBottom", {
get: function () {
return this.style.marginBottom;
},
set: function (value) {
this.style.marginBottom = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "horizontalAlignment", {
get: function () {
return this.style.horizontalAlignment;
},
set: function (value) {
this.style.horizontalAlignment = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "verticalAlignment", {
get: function () {
return this.style.verticalAlignment;
},
set: function (value) {
this.style.verticalAlignment = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "visibility", {
get: function () {
return this.style.visibility;
},
set: function (value) {
this.style.visibility = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "opacity", {
get: function () {
return this.style.opacity;
},
set: function (value) {
this.style.opacity = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "rotate", {
get: function () {
return this.style.rotate;
},
set: function (value) {
this.style.rotate = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "translateX", {
get: function () {
return this.style.translateX;
},
set: function (value) {
this.style.translateX = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "translateY", {
get: function () {
return this.style.translateY;
},
set: function (value) {
this.style.translateY = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "scaleX", {
get: function () {
return this.style.scaleX;
},
set: function (value) {
this.style.scaleX = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "scaleY", {
get: function () {
return this.style.scaleY;
},
set: function (value) {
this.style.scaleY = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "isLayoutValid", {
get: function () {
return this._isLayoutValid;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "cssType", {
get: function () {
if (!this._cssType) {
this._cssType = this.typeName.toLowerCase();
}
return this._cssType;
},
set: function (type) {
this._cssType = type.toLowerCase();
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "isLayoutRequired", {
get: function () {
return true;
},
enumerable: true,
configurable: true
});
ViewCommon.prototype.measure = function (widthMeasureSpec, heightMeasureSpec) {
this._setCurrentMeasureSpecs(widthMeasureSpec, heightMeasureSpec);
};
ViewCommon.prototype.layout = function (left, top, right, bottom) {
this._setCurrentLayoutBounds(left, top, right, bottom);
};
ViewCommon.prototype.getMeasuredWidth = function () {
return this._measuredWidth & view_base_1.layout.MEASURED_SIZE_MASK || 0;
};
ViewCommon.prototype.getMeasuredHeight = function () {
return this._measuredHeight & view_base_1.layout.MEASURED_SIZE_MASK || 0;
};
ViewCommon.prototype.getMeasuredState = function () {
return (this._measuredWidth & view_base_1.layout.MEASURED_STATE_MASK)
| ((this._measuredHeight >> view_base_1.layout.MEASURED_HEIGHT_STATE_SHIFT)
& (view_base_1.layout.MEASURED_STATE_MASK >> view_base_1.layout.MEASURED_HEIGHT_STATE_SHIFT));
};
ViewCommon.prototype.setMeasuredDimension = function (measuredWidth, measuredHeight) {
this._measuredWidth = measuredWidth;
this._measuredHeight = measuredHeight;
if (view_base_1.traceEnabled()) {
view_base_1.traceWrite(this + " :setMeasuredDimension: " + measuredWidth + ", " + measuredHeight, view_base_1.traceCategories.Layout);
}
};
ViewCommon.prototype.requestLayout = function () {
this._isLayoutValid = false;
_super.prototype.requestLayout.call(this);
};
ViewCommon.resolveSizeAndState = function (size, specSize, specMode, childMeasuredState) {
var result = size;
switch (specMode) {
case view_base_1.layout.UNSPECIFIED:
result = Math.ceil(size);
break;
case view_base_1.layout.AT_MOST:
if (specSize < size) {
result = Math.ceil(specSize) | view_base_1.layout.MEASURED_STATE_TOO_SMALL;
}
break;
case view_base_1.layout.EXACTLY:
result = Math.ceil(specSize);
break;
}
return result | (childMeasuredState & view_base_1.layout.MEASURED_STATE_MASK);
};
ViewCommon.combineMeasuredStates = function (curState, newState) {
return curState | newState;
};
ViewCommon.layoutChild = function (parent, child, left, top, right, bottom, setFrame) {
if (setFrame === void 0) { setFrame = true; }
if (!child || child.isCollapsed) {
return;
}
var childStyle = child.style;
var childTop;
var childLeft;
var childWidth = child.getMeasuredWidth();
var childHeight = child.getMeasuredHeight();
var effectiveMarginTop = child.effectiveMarginTop;
var effectiveMarginBottom = child.effectiveMarginBottom;
var vAlignment;
if (child.effectiveHeight >= 0 && childStyle.verticalAlignment === "stretch") {
vAlignment = "middle";
}
else {
vAlignment = childStyle.verticalAlignment;
}
switch (vAlignment) {
case "top":
childTop = top + effectiveMarginTop;
break;
case "middle":
childTop = top + (bottom - top - childHeight + (effectiveMarginTop - effectiveMarginBottom)) / 2;
break;
case "bottom":
childTop = bottom - childHeight - effectiveMarginBottom;
break;
case "stretch":
default:
childTop = top + effectiveMarginTop;
childHeight = bottom - top - (effectiveMarginTop + effectiveMarginBottom);
break;
}
var effectiveMarginLeft = child.effectiveMarginLeft;
var effectiveMarginRight = child.effectiveMarginRight;
var hAlignment;
if (child.effectiveWidth >= 0 && childStyle.horizontalAlignment === "stretch") {
hAlignment = "center";
}
else {
hAlignment = childStyle.horizontalAlignment;
}
switch (hAlignment) {
case "left":
childLeft = left + effectiveMarginLeft;
break;
case "center":
childLeft = left + (right - left - childWidth + (effectiveMarginLeft - effectiveMarginRight)) / 2;
break;
case "right":
childLeft = right - childWidth - effectiveMarginRight;
break;
case "stretch":
default:
childLeft = left + effectiveMarginLeft;
childWidth = right - left - (effectiveMarginLeft + effectiveMarginRight);
break;
}
var childRight = Math.round(childLeft + childWidth);
var childBottom = Math.round(childTop + childHeight);
childLeft = Math.round(childLeft);
childTop = Math.round(childTop);
if (view_base_1.traceEnabled()) {
view_base_1.traceWrite(child.parent + " :layoutChild: " + child + " " + childLeft + ", " + childTop + ", " + childRight + ", " + childBottom, view_base_1.traceCategories.Layout);
}
child.layout(childLeft, childTop, childRight, childBottom, setFrame);
};
ViewCommon.measureChild = function (parent, child, widthMeasureSpec, heightMeasureSpec) {
var measureWidth = 0;
var measureHeight = 0;
if (child && !child.isCollapsed) {
var widthSpec = parent ? parent._currentWidthMeasureSpec : widthMeasureSpec;
var heightSpec = parent ? parent._currentHeightMeasureSpec : heightMeasureSpec;
var width = view_base_1.layout.getMeasureSpecSize(widthSpec);
var widthMode = view_base_1.layout.getMeasureSpecMode(widthSpec);
var height = view_base_1.layout.getMeasureSpecSize(heightSpec);
var heightMode = view_base_1.layout.getMeasureSpecMode(heightSpec);
child._updateEffectiveLayoutValues(width, widthMode, height, heightMode);
var style = child.style;
var horizontalMargins = child.effectiveMarginLeft + child.effectiveMarginRight;
var verticalMargins = child.effectiveMarginTop + child.effectiveMarginBottom;
var childWidthMeasureSpec = ViewCommon.getMeasureSpec(widthMeasureSpec, horizontalMargins, child.effectiveWidth, style.horizontalAlignment === "stretch");
var childHeightMeasureSpec = ViewCommon.getMeasureSpec(heightMeasureSpec, verticalMargins, child.effectiveHeight, style.verticalAlignment === "stretch");
if (view_base_1.traceEnabled()) {
view_base_1.traceWrite(child.parent + " :measureChild: " + child + " " + view_base_1.layout.measureSpecToString(childWidthMeasureSpec) + ", " + view_base_1.layout.measureSpecToString(childHeightMeasureSpec) + "}", view_base_1.traceCategories.Layout);
}
child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
measureWidth = Math.round(child.getMeasuredWidth() + horizontalMargins);
measureHeight = Math.round(child.getMeasuredHeight() + verticalMargins);
}
return { measuredWidth: measureWidth, measuredHeight: measureHeight };
};
ViewCommon.getMeasureSpec = function (parentSpec, margins, childLength, stretched) {
var parentLength = view_base_1.layout.getMeasureSpecSize(parentSpec);
var parentSpecMode = view_base_1.layout.getMeasureSpecMode(parentSpec);
var resultSize;
var resultMode;
if (childLength >= 0) {
resultSize = parentSpecMode === view_base_1.layout.UNSPECIFIED ? childLength : Math.min(parentLength, childLength);
resultMode = view_base_1.layout.EXACTLY;
}
else {
switch (parentSpecMode) {
case view_base_1.layout.EXACTLY:
resultSize = Math.max(0, parentLength - margins);
resultMode = stretched ? view_base_1.layout.EXACTLY : view_base_1.layout.AT_MOST;
break;
case view_base_1.layout.AT_MOST:
resultSize = Math.max(0, parentLength - margins);
resultMode = view_base_1.layout.AT_MOST;
break;
case view_base_1.layout.UNSPECIFIED:
resultSize = 0;
resultMode = view_base_1.layout.UNSPECIFIED;
break;
}
}
return view_base_1.layout.makeMeasureSpec(resultSize, resultMode);
};
ViewCommon.prototype._setCurrentMeasureSpecs = function (widthMeasureSpec, heightMeasureSpec) {
var changed = this._currentWidthMeasureSpec !== widthMeasureSpec || this._currentHeightMeasureSpec !== heightMeasureSpec;
this._currentWidthMeasureSpec = widthMeasureSpec;
this._currentHeightMeasureSpec = heightMeasureSpec;
return changed;
};
ViewCommon.prototype._getCurrentLayoutBounds = function () {
return { left: 0, top: 0, right: 0, bottom: 0 };
};
ViewCommon.prototype._setCurrentLayoutBounds = function (left, top, right, bottom) {
this._isLayoutValid = true;
var boundsChanged = this._oldLeft !== left || this._oldTop !== top || this._oldRight !== right || this._oldBottom !== bottom;
var sizeChanged = (this._oldRight - this._oldLeft !== right - left) || (this._oldBottom - this._oldTop !== bottom - top);
this._oldLeft = left;
this._oldTop = top;
this._oldRight = right;
this._oldBottom = bottom;
return { boundsChanged: boundsChanged, sizeChanged: sizeChanged };
};
ViewCommon.prototype.eachChild = function (callback) {
this.eachChildView(callback);
};
ViewCommon.prototype.eachChildView = function (callback) {
};
ViewCommon.prototype._getNativeViewsCount = function () {
return this._isAddedToNativeVisualTree ? 1 : 0;
};
ViewCommon.prototype._eachLayoutView = function (callback) {
return callback(this);
};
ViewCommon.prototype.focus = function () {
return undefined;
};
ViewCommon.prototype.getSafeAreaInsets = function () {
return { left: 0, top: 0, right: 0, bottom: 0 };
};
ViewCommon.prototype.getLocationInWindow = function () {
return undefined;
};
ViewCommon.prototype.getLocationOnScreen = function () {
return undefined;
};
ViewCommon.prototype.getLocationRelativeTo = function (otherView) {
return undefined;
};
ViewCommon.prototype.getActualSize = function () {
var currentBounds = this._getCurrentLayoutBounds();
if (!currentBounds) {
return undefined;
}
return {
width: view_base_1.layout.toDeviceIndependentPixels(currentBounds.right - currentBounds.left),
height: view_base_1.layout.toDeviceIndependentPixels(currentBounds.bottom - currentBounds.top),
};
};
ViewCommon.prototype.animate = function (animation) {
return this.createAnimation(animation).play();
};
ViewCommon.prototype.createAnimation = function (animation) {
ensureAnimationModule();
if (!this._localAnimations) {
this._localAnimations = new Set();
}
animation.target = this;
var anim = new animationModule.Animation([animation]);
this._localAnimations.add(anim);
return anim;
};
ViewCommon.prototype._removeAnimation = function (animation) {
var localAnimations = this._localAnimations;
if (localAnimations && localAnimations.has(animation)) {
localAnimations.delete(animation);
if (animation.isPlaying) {
animation.cancel();
}
return true;
}
return false;
};
ViewCommon.prototype.resetNativeView = function () {
var _this = this;
if (this._localAnimations) {
this._localAnimations.forEach(function (a) { return _this._removeAnimation(a); });
}
_super.prototype.resetNativeView.call(this);
};
ViewCommon.prototype._setNativeViewFrame = function (nativeView, frame) {
};
ViewCommon.prototype._getValue = function () {
throw new Error("The View._getValue is obsolete. There is a new property system.");
};
ViewCommon.prototype._setValue = function () {
throw new Error("The View._setValue is obsolete. There is a new property system.");
};
ViewCommon.prototype._updateEffectiveLayoutValues = function (parentWidthMeasureSize, parentWidthMeasureMode, parentHeightMeasureSize, parentHeightMeasureMode) {
var style = this.style;
var availableWidth = parentWidthMeasureMode === view_base_1.layout.UNSPECIFIED ? -1 : parentWidthMeasureSize;
this.effectiveWidth = style_properties_1.PercentLength.toDevicePixels(style.width, -2, availableWidth);
this.effectiveMarginLeft = style_properties_1.PercentLength.toDevicePixels(style.marginLeft, 0, availableWidth);
this.effectiveMarginRight = style_properties_1.PercentLength.toDevicePixels(style.marginRight, 0, availableWidth);
var availableHeight = parentHeightMeasureMode === view_base_1.layout.UNSPECIFIED ? -1 : parentHeightMeasureSize;
this.effectiveHeight = style_properties_1.PercentLength.toDevicePixels(style.height, -2, availableHeight);
this.effectiveMarginTop = style_properties_1.PercentLength.toDevicePixels(style.marginTop, 0, availableHeight);
this.effectiveMarginBottom = style_properties_1.PercentLength.toDevicePixels(style.marginBottom, 0, availableHeight);
};
ViewCommon.prototype._setNativeClipToBounds = function () {
};
ViewCommon.prototype._redrawNativeBackground = function (value) {
};
ViewCommon.prototype._onAttachedToWindow = function () {
};
ViewCommon.prototype._onDetachedFromWindow = function () {
};
ViewCommon.prototype._hasAncestorView = function (ancestorView) {
var matcher = function (view) { return view === ancestorView; };
for (var parent_2 = this.parent; parent_2 != null; parent_2 = parent_2.parent) {
if (matcher(parent_2)) {
return true;
}
}
return false;
};
ViewCommon.layoutChangedEvent = "layoutChanged";
ViewCommon.shownModallyEvent = "shownModally";
ViewCommon.showingModallyEvent = "showingModally";
return ViewCommon;
}(view_base_1.ViewBase));
exports.ViewCommon = ViewCommon;
exports.automationTextProperty = new view_base_1.Property({ name: "automationText" });
exports.automationTextProperty.register(ViewCommon);
exports.originXProperty = new view_base_1.Property({ name: "originX", defaultValue: 0.5, valueConverter: function (v) { return parseFloat(v); } });
exports.originXProperty.register(ViewCommon);
exports.originYProperty = new view_base_1.Property({ name: "originY", defaultValue: 0.5, valueConverter: function (v) { return parseFloat(v); } });
exports.originYProperty.register(ViewCommon);
exports.isEnabledProperty = new view_base_1.Property({
name: "isEnabled",
defaultValue: true,
valueConverter: view_base_1.booleanConverter,
valueChanged: function (target, oldValue, newValue) {
target._goToVisualState(newValue ? "normal" : "disabled");
}
});
exports.isEnabledProperty.register(ViewCommon);
exports.isUserInteractionEnabledProperty = new view_base_1.Property({ name: "isUserInteractionEnabled", defaultValue: true, valueConverter: view_base_1.booleanConverter });
exports.isUserInteractionEnabledProperty.register(ViewCommon);
exports.iosOverflowSafeAreaProperty = new view_base_1.Property({ name: "iosOverflowSafeArea", defaultValue: false, valueConverter: view_base_1.booleanConverter });
exports.iosOverflowSafeAreaProperty.register(ViewCommon);
//# sourceMappingURL=view-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/core/view/view.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var view_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view-common.js");
var style_properties_1 = __webpack_require__("../node_modules/tns-core-modules/ui/styling/style-properties.js");
var background_1 = __webpack_require__("../node_modules/tns-core-modules/ui/styling/background.js");
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
var frame_stack_1 = __webpack_require__("../node_modules/tns-core-modules/ui/frame/frame-stack.js");
var application_1 = __webpack_require__("../node_modules/tns-core-modules/application/application.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/view/view-common.js"));
var DOMID = "_domId";
var androidBackPressedEvent = "androidBackPressed";
var modalMap = new Map();
var TouchListener;
var disableUserInteractionListener;
var DialogFragment;
function initializeDisabledListener() {
if (disableUserInteractionListener) {
return;
}
disableUserInteractionListener = new org.nativescript.widgets.DisableUserInteractionListener();
}
function initializeTouchListener() {
if (TouchListener) {
return;
}
var TouchListenerImpl = (function (_super) {
__extends(TouchListenerImpl, _super);
function TouchListenerImpl(owner) {
var _this = _super.call(this) || this;
_this.owner = owner;
return global.__native(_this);
}
TouchListenerImpl.prototype.onTouch = function (view, event) {
var owner = this.owner;
owner.handleGestureTouch(event);
var nativeView = owner.nativeViewProtected;
if (!nativeView || !nativeView.onTouchEvent) {
return false;
}
return nativeView.onTouchEvent(event);
};
TouchListenerImpl = __decorate([
Interfaces([android.view.View.OnTouchListener])
], TouchListenerImpl);
return TouchListenerImpl;
}(java.lang.Object));
TouchListener = TouchListenerImpl;
}
function initializeDialogFragment() {
if (DialogFragment) {
return;
}
var DialogImpl = (function (_super) {
__extends(DialogImpl, _super);
function DialogImpl(fragment, context, themeResId) {
var _this = _super.call(this, context, themeResId) || this;
_this.fragment = fragment;
return global.__native(_this);
}
DialogImpl.prototype.onBackPressed = function () {
var view = this.fragment.owner;
var args = {
eventName: "activityBackPressed",
object: view,
activity: view._context,
cancel: false,
};
application_1.android.notify(args);
if (args.cancel) {
return;
}
view.notify(args);
if (!args.cancel && !view.onBackPressed()) {
_super.prototype.onBackPressed.call(this);
}
};
return DialogImpl;
}(android.app.Dialog));
var DialogFragmentImpl = (function (_super) {
__extends(DialogFragmentImpl, _super);
function DialogFragmentImpl() {
var _this = _super.call(this) || this;
return global.__native(_this);
}
DialogFragmentImpl.prototype.onCreateDialog = function (savedInstanceState) {
var ownerId = this.getArguments().getInt(DOMID);
var options = getModalOptions(ownerId);
this.owner = options.owner;
this._fullscreen = options.fullscreen;
this._stretched = options.stretched;
this._dismissCallback = options.dismissCallback;
this._shownCallback = options.shownCallback;
this.owner._dialogFragment = this;
this.setStyle(android.support.v4.app.DialogFragment.STYLE_NO_TITLE, 0);
var dialog = new DialogImpl(this, this.getActivity(), this.getTheme());
if (!this._fullscreen && !this._stretched) {
this.owner.horizontalAlignment = "center";
this.owner.verticalAlignment = "middle";
}
else {
this.owner.horizontalAlignment = "stretch";
this.owner.verticalAlignment = "stretch";
}
return dialog;
};
DialogFragmentImpl.prototype.onCreateView = function (inflater, container, savedInstanceState) {
var owner = this.owner;
owner._setupAsRootView(this.getActivity());
owner._isAddedToNativeVisualTree = true;
return owner.nativeViewProtected;
};
DialogFragmentImpl.prototype.onStart = function () {
_super.prototype.onStart.call(this);
if (this._fullscreen) {
var window_1 = this.getDialog().getWindow();
var length_1 = android.view.ViewGroup.LayoutParams.MATCH_PARENT;
window_1.setLayout(length_1, length_1);
window_1.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.WHITE));
}
var owner = this.owner;
if (owner && !owner.isLoaded) {
owner.callLoaded();
}
this._shownCallback();
};
DialogFragmentImpl.prototype.onDismiss = function (dialog) {
_super.prototype.onDismiss.call(this, dialog);
var manager = this.getFragmentManager();
if (manager) {
removeModal(this.owner._domId);
this._dismissCallback();
}
var owner = this.owner;
if (owner && owner.isLoaded) {
owner.callUnloaded();
}
};
DialogFragmentImpl.prototype.onDestroy = function () {
_super.prototype.onDestroy.call(this);
var owner = this.owner;
owner._isAddedToNativeVisualTree = false;
owner._tearDownUI(true);
};
return DialogFragmentImpl;
}(android.support.v4.app.DialogFragment));
DialogFragment = DialogFragmentImpl;
}
function saveModal(options) {
modalMap.set(options.owner._domId, options);
}
function removeModal(domId) {
modalMap.delete(domId);
}
function getModalOptions(domId) {
return modalMap.get(domId);
}
var View = (function (_super) {
__extends(View, _super);
function View() {
return _super !== null && _super.apply(this, arguments) || this;
}
View.prototype.observe = function (type, callback, thisArg) {
_super.prototype.observe.call(this, type, callback, thisArg);
if (this.isLoaded && !this.touchListenerIsSet) {
this.setOnTouchListener();
}
};
View.prototype.on = function (eventNames, callback, thisArg) {
_super.prototype.on.call(this, eventNames, callback, thisArg);
var isLayoutEvent = typeof eventNames === "string" ? eventNames.indexOf(view_common_1.ViewCommon.layoutChangedEvent) !== -1 : false;
if (this.isLoaded && !this.layoutChangeListenerIsSet && isLayoutEvent) {
this.setOnLayoutChangeListener();
}
};
View.prototype.off = function (eventNames, callback, thisArg) {
_super.prototype.off.call(this, eventNames, callback, thisArg);
var isLayoutEvent = typeof eventNames === "string" ? eventNames.indexOf(view_common_1.ViewCommon.layoutChangedEvent) !== -1 : false;
if (this.isLoaded && this.layoutChangeListenerIsSet && isLayoutEvent && !this.hasListeners(view_common_1.ViewCommon.layoutChangedEvent)) {
this.nativeViewProtected.removeOnLayoutChangeListener(this.layoutChangeListener);
this.layoutChangeListenerIsSet = false;
}
};
View.prototype._getChildFragmentManager = function () {
return null;
};
View.prototype._getRootFragmentManager = function () {
if (!this._rootManager && this._context) {
this._rootManager = this._context.getSupportFragmentManager();
}
return this._rootManager;
};
View.prototype._getFragmentManager = function () {
var manager = this._manager;
if (!manager) {
var view = this;
var frameOrTabViewItemFound = false;
while (view) {
var dialogFragment = view._dialogFragment;
if (dialogFragment) {
manager = dialogFragment.getChildFragmentManager();
break;
}
if (view._hasFragments) {
if (frameOrTabViewItemFound) {
manager = view._getChildFragmentManager();
break;
}
frameOrTabViewItemFound = true;
}
view = view.parent;
}
if (!manager) {
manager = this._getRootFragmentManager();
}
this._manager = manager;
}
return manager;
};
View.prototype.onLoaded = function () {
this._manager = null;
this._rootManager = null;
_super.prototype.onLoaded.call(this);
this.setOnTouchListener();
};
View.prototype.onUnloaded = function () {
if (this.touchListenerIsSet) {
this.nativeViewProtected.setOnTouchListener(null);
this.touchListenerIsSet = false;
this.nativeViewProtected.setClickable(this._isClickable);
}
this._manager = null;
this._rootManager = null;
_super.prototype.onUnloaded.call(this);
};
View.prototype.onBackPressed = function () {
var topmostFrame = frame_stack_1.topmost();
if (topmostFrame && topmostFrame._hasAncestorView(this)) {
return topmostFrame.onBackPressed();
}
return false;
};
View.prototype.handleGestureTouch = function (event) {
for (var type in this._gestureObservers) {
var list = this._gestureObservers[type];
list.forEach(function (element) {
element.androidOnTouchEvent(event);
});
}
if (this.parent instanceof View) {
this.parent.handleGestureTouch(event);
}
};
View.prototype.hasGestureObservers = function () {
return this._gestureObservers && Object.keys(this._gestureObservers).length > 0;
};
View.prototype.initNativeView = function () {
_super.prototype.initNativeView.call(this);
this._isClickable = this.nativeViewProtected.isClickable();
if (this.hasListeners(view_common_1.ViewCommon.layoutChangedEvent)) {
this.setOnLayoutChangeListener();
}
};
View.prototype.disposeNativeView = function () {
_super.prototype.disposeNativeView.call(this);
if (this.layoutChangeListenerIsSet) {
this.layoutChangeListenerIsSet = false;
this.nativeViewProtected.removeOnLayoutChangeListener(this.layoutChangeListener);
}
};
View.prototype.setOnTouchListener = function () {
if (!this.nativeViewProtected || !this.hasGestureObservers()) {
return;
}
initializeTouchListener();
this.touchListener = this.touchListener || new TouchListener(this);
this.nativeViewProtected.setOnTouchListener(this.touchListener);
this.touchListenerIsSet = true;
if (this.nativeViewProtected.setClickable) {
this.nativeViewProtected.setClickable(this.isUserInteractionEnabled);
}
};
View.prototype.setOnLayoutChangeListener = function () {
if (this.nativeViewProtected) {
var owner_1 = this;
this.layoutChangeListenerIsSet = true;
this.layoutChangeListener = this.layoutChangeListener || new android.view.View.OnLayoutChangeListener({
onLayoutChange: function (v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) {
if (left !== oldLeft || top !== oldTop || right !== oldRight || bottom !== oldBottom) {
owner_1._raiseLayoutChangedEvent();
}
}
});
this.nativeViewProtected.addOnLayoutChangeListener(this.layoutChangeListener);
}
};
Object.defineProperty(View.prototype, "isLayoutRequired", {
get: function () {
return !this.isLayoutValid;
},
enumerable: true,
configurable: true
});
Object.defineProperty(View.prototype, "isLayoutValid", {
get: function () {
if (this.nativeViewProtected) {
return !this.nativeViewProtected.isLayoutRequested();
}
return false;
},
enumerable: true,
configurable: true
});
Object.defineProperty(View.prototype, "_hasFragments", {
get: function () {
return false;
},
enumerable: true,
configurable: true
});
View.prototype.layoutNativeView = function (left, top, right, bottom) {
if (this.nativeViewProtected) {
this.nativeViewProtected.layout(left, top, right, bottom);
}
};
View.prototype.requestLayout = function () {
_super.prototype.requestLayout.call(this);
if (this.nativeViewProtected) {
this.nativeViewProtected.requestLayout();
}
};
View.prototype.measure = function (widthMeasureSpec, heightMeasureSpec) {
_super.prototype.measure.call(this, widthMeasureSpec, heightMeasureSpec);
this.onMeasure(widthMeasureSpec, heightMeasureSpec);
};
View.prototype.layout = function (left, top, right, bottom) {
_super.prototype.layout.call(this, left, top, right, bottom);
this.onLayout(left, top, right, bottom);
};
View.prototype.onMeasure = function (widthMeasureSpec, heightMeasureSpec) {
var view = this.nativeViewProtected;
if (view) {
view.measure(widthMeasureSpec, heightMeasureSpec);
this.setMeasuredDimension(view.getMeasuredWidth(), view.getMeasuredHeight());
}
};
View.prototype.onLayout = function (left, top, right, bottom) {
var view = this.nativeViewProtected;
if (view) {
this.layoutNativeView(left, top, right, bottom);
}
};
View.prototype._getCurrentLayoutBounds = function () {
if (this.nativeViewProtected && !this.isCollapsed) {
return {
left: this.nativeViewProtected.getLeft(),
top: this.nativeViewProtected.getTop(),
right: this.nativeViewProtected.getRight(),
bottom: this.nativeViewProtected.getBottom()
};
}
else {
return { left: 0, top: 0, right: 0, bottom: 0 };
}
};
View.prototype.getMeasuredWidth = function () {
if (this.nativeViewProtected) {
return this.nativeViewProtected.getMeasuredWidth();
}
return _super.prototype.getMeasuredWidth.call(this);
};
View.prototype.getMeasuredHeight = function () {
if (this.nativeViewProtected) {
return this.nativeViewProtected.getMeasuredHeight();
}
return _super.prototype.getMeasuredHeight.call(this);
};
View.prototype.focus = function () {
if (this.nativeViewProtected) {
return this.nativeViewProtected.requestFocus();
}
return false;
};
View.prototype.getLocationInWindow = function () {
if (!this.nativeViewProtected || !this.nativeViewProtected.getWindowToken()) {
return undefined;
}
var nativeArray = Array.create("int", 2);
this.nativeViewProtected.getLocationInWindow(nativeArray);
return {
x: view_common_1.layout.toDeviceIndependentPixels(nativeArray[0]),
y: view_common_1.layout.toDeviceIndependentPixels(nativeArray[1]),
};
};
View.prototype.getLocationOnScreen = function () {
if (!this.nativeViewProtected || !this.nativeViewProtected.getWindowToken()) {
return undefined;
}
var nativeArray = Array.create("int", 2);
this.nativeViewProtected.getLocationOnScreen(nativeArray);
return {
x: view_common_1.layout.toDeviceIndependentPixels(nativeArray[0]),
y: view_common_1.layout.toDeviceIndependentPixels(nativeArray[1]),
};
};
View.prototype.getLocationRelativeTo = function (otherView) {
if (!this.nativeViewProtected || !this.nativeViewProtected.getWindowToken() ||
!otherView || !otherView.nativeViewProtected || !otherView.nativeViewProtected.getWindowToken() ||
this.nativeViewProtected.getWindowToken() !== otherView.nativeViewProtected.getWindowToken()) {
return undefined;
}
var myArray = Array.create("int", 2);
this.nativeViewProtected.getLocationOnScreen(myArray);
var otherArray = Array.create("int", 2);
otherView.nativeViewProtected.getLocationOnScreen(otherArray);
return {
x: view_common_1.layout.toDeviceIndependentPixels(myArray[0] - otherArray[0]),
y: view_common_1.layout.toDeviceIndependentPixels(myArray[1] - otherArray[1]),
};
};
View.resolveSizeAndState = function (size, specSize, specMode, childMeasuredState) {
var result = size;
switch (specMode) {
case view_common_1.layout.UNSPECIFIED:
result = size;
break;
case view_common_1.layout.AT_MOST:
if (specSize < size) {
result = specSize | view_common_1.layout.MEASURED_STATE_TOO_SMALL;
}
break;
case view_common_1.layout.EXACTLY:
result = specSize;
break;
}
return result | (childMeasuredState & view_common_1.layout.MEASURED_STATE_MASK);
};
View.prototype._showNativeModalView = function (parent, context, closeCallback, fullscreen, animated, stretched) {
var _this = this;
_super.prototype._showNativeModalView.call(this, parent, context, closeCallback, fullscreen, stretched);
if (!this.backgroundColor) {
this.backgroundColor = new view_common_1.Color("White");
}
initializeDialogFragment();
var df = new DialogFragment();
var args = new android.os.Bundle();
args.putInt(DOMID, this._domId);
df.setArguments(args);
var dialogOptions = {
owner: this,
fullscreen: !!fullscreen,
stretched: !!stretched,
shownCallback: function () { return _this._raiseShownModallyEvent(); },
dismissCallback: function () { return _this.closeModal(); }
};
saveModal(dialogOptions);
this._dialogFragment = df;
this._raiseShowingModallyEvent();
this._dialogFragment.show(parent._getRootFragmentManager(), this._domId.toString());
};
View.prototype._hideNativeModalView = function (parent) {
var manager = this._dialogFragment.getFragmentManager();
if (manager) {
this._dialogFragment.dismissAllowingStateLoss();
}
this._dialogFragment = null;
_super.prototype._hideNativeModalView.call(this, parent);
};
View.prototype[view_common_1.isEnabledProperty.setNative] = function (value) {
this.nativeViewProtected.setEnabled(value);
};
View.prototype[view_common_1.originXProperty.getDefault] = function () {
return this.nativeViewProtected.getPivotX();
};
View.prototype[view_common_1.originXProperty.setNative] = function (value) {
org.nativescript.widgets.OriginPoint.setX(this.nativeViewProtected, value);
};
View.prototype[view_common_1.originYProperty.getDefault] = function () {
return this.nativeViewProtected.getPivotY();
};
View.prototype[view_common_1.originYProperty.setNative] = function (value) {
org.nativescript.widgets.OriginPoint.setY(this.nativeViewProtected, value);
};
View.prototype[view_common_1.automationTextProperty.getDefault] = function () {
return this.nativeViewProtected.getContentDescription();
};
View.prototype[view_common_1.automationTextProperty.setNative] = function (value) {
this.nativeViewProtected.setContentDescription(value);
};
View.prototype[view_common_1.isUserInteractionEnabledProperty.setNative] = function (value) {
if (this.nativeViewProtected.setClickable) {
this.nativeViewProtected.setClickable(value);
}
};
View.prototype[style_properties_1.visibilityProperty.getDefault] = function () {
var nativeVisibility = this.nativeViewProtected.getVisibility();
switch (nativeVisibility) {
case android.view.View.VISIBLE:
return "visible";
case android.view.View.INVISIBLE:
return "hidden";
case android.view.View.GONE:
return "collapse";
default:
throw new Error("Unsupported android.view.View visibility: " + nativeVisibility + ". Currently supported values are android.view.View.VISIBLE, android.view.View.INVISIBLE, android.view.View.GONE.");
}
};
View.prototype[style_properties_1.visibilityProperty.setNative] = function (value) {
switch (value) {
case "visible":
this.nativeViewProtected.setVisibility(android.view.View.VISIBLE);
break;
case "hidden":
this.nativeViewProtected.setVisibility(android.view.View.INVISIBLE);
break;
case "collapse":
this.nativeViewProtected.setVisibility(android.view.View.GONE);
break;
default:
throw new Error("Invalid visibility value: " + value + ". Valid values are: visible, hidden, collapse.");
}
};
View.prototype[style_properties_1.opacityProperty.getDefault] = function () {
return this.nativeViewProtected.getAlpha();
};
View.prototype[style_properties_1.opacityProperty.setNative] = function (value) {
this.nativeViewProtected.setAlpha(float(value));
};
View.prototype[style_properties_1.horizontalAlignmentProperty.getDefault] = function () {
return org.nativescript.widgets.ViewHelper.getHorizontalAlignment(this.nativeViewProtected);
};
View.prototype[style_properties_1.horizontalAlignmentProperty.setNative] = function (value) {
var nativeView = this.nativeViewProtected;
var lp = nativeView.getLayoutParams() || new org.nativescript.widgets.CommonLayoutParams();
if (lp.gravity !== undefined) {
switch (value) {
case "left":
lp.gravity = android.view.Gravity.LEFT | (lp.gravity & android.view.Gravity.VERTICAL_GRAVITY_MASK);
if (lp.weight < 0) {
lp.weight = -2;
}
break;
case "center":
lp.gravity = android.view.Gravity.CENTER_HORIZONTAL | (lp.gravity & android.view.Gravity.VERTICAL_GRAVITY_MASK);
if (lp.weight < 0) {
lp.weight = -2;
}
break;
case "right":
lp.gravity = android.view.Gravity.RIGHT | (lp.gravity & android.view.Gravity.VERTICAL_GRAVITY_MASK);
if (lp.weight < 0) {
lp.weight = -2;
}
break;
case "stretch":
lp.gravity = android.view.Gravity.FILL_HORIZONTAL | (lp.gravity & android.view.Gravity.VERTICAL_GRAVITY_MASK);
if (lp.weight < 0) {
lp.weight = -1;
}
break;
}
nativeView.setLayoutParams(lp);
}
};
View.prototype[style_properties_1.verticalAlignmentProperty.getDefault] = function () {
return org.nativescript.widgets.ViewHelper.getVerticalAlignment(this.nativeViewProtected);
};
View.prototype[style_properties_1.verticalAlignmentProperty.setNative] = function (value) {
var nativeView = this.nativeViewProtected;
var lp = nativeView.getLayoutParams() || new org.nativescript.widgets.CommonLayoutParams();
if (lp.gravity !== undefined) {
switch (value) {
case "top":
lp.gravity = android.view.Gravity.TOP | (lp.gravity & android.view.Gravity.HORIZONTAL_GRAVITY_MASK);
if (lp.height < 0) {
lp.height = -2;
}
break;
case "middle":
lp.gravity = android.view.Gravity.CENTER_VERTICAL | (lp.gravity & android.view.Gravity.HORIZONTAL_GRAVITY_MASK);
if (lp.height < 0) {
lp.height = -2;
}
break;
case "bottom":
lp.gravity = android.view.Gravity.BOTTOM | (lp.gravity & android.view.Gravity.HORIZONTAL_GRAVITY_MASK);
if (lp.height < 0) {
lp.height = -2;
}
break;
case "stretch":
lp.gravity = android.view.Gravity.FILL_VERTICAL | (lp.gravity & android.view.Gravity.HORIZONTAL_GRAVITY_MASK);
if (lp.height < 0) {
lp.height = -1;
}
break;
}
nativeView.setLayoutParams(lp);
}
};
View.prototype[style_properties_1.rotateProperty.setNative] = function (value) {
org.nativescript.widgets.ViewHelper.setRotate(this.nativeViewProtected, float(value));
};
View.prototype[style_properties_1.scaleXProperty.setNative] = function (value) {
org.nativescript.widgets.ViewHelper.setScaleX(this.nativeViewProtected, float(value));
};
View.prototype[style_properties_1.scaleYProperty.setNative] = function (value) {
org.nativescript.widgets.ViewHelper.setScaleY(this.nativeViewProtected, float(value));
};
View.prototype[style_properties_1.translateXProperty.setNative] = function (value) {
org.nativescript.widgets.ViewHelper.setTranslateX(this.nativeViewProtected, view_common_1.layout.toDevicePixels(value));
};
View.prototype[style_properties_1.translateYProperty.setNative] = function (value) {
org.nativescript.widgets.ViewHelper.setTranslateY(this.nativeViewProtected, view_common_1.layout.toDevicePixels(value));
};
View.prototype[style_properties_1.zIndexProperty.getDefault] = function () {
return 0;
};
View.prototype[style_properties_1.zIndexProperty.setNative] = function (value) {
org.nativescript.widgets.ViewHelper.setZIndex(this.nativeViewProtected, value);
};
View.prototype[style_properties_1.backgroundInternalProperty.getDefault] = function () {
var nativeView = this.nativeViewProtected;
var drawable = nativeView.getBackground();
if (drawable) {
var constantState = drawable.getConstantState();
if (constantState) {
try {
return constantState.newDrawable(nativeView.getResources());
}
catch (e) {
return drawable;
}
}
else {
return drawable;
}
}
return null;
};
View.prototype[style_properties_1.backgroundInternalProperty.setNative] = function (value) {
this._redrawNativeBackground(value);
};
View.prototype[style_properties_1.minWidthProperty.setNative] = function (value) {
if (this.parent instanceof CustomLayoutView && this.parent.nativeViewProtected) {
this.parent._setChildMinWidthNative(this);
}
else {
this._setMinWidthNative(this.minWidth);
}
};
View.prototype[style_properties_1.minHeightProperty.setNative] = function (value) {
if (this.parent instanceof CustomLayoutView && this.parent.nativeViewProtected) {
this.parent._setChildMinHeightNative(this);
}
else {
this._setMinHeightNative(this.minHeight);
}
};
View.prototype._redrawNativeBackground = function (value) {
if (value instanceof background_1.Background) {
background_1.ad.onBackgroundOrBorderPropertyChanged(this);
}
else {
var nativeView = this.nativeViewProtected;
nativeView.setBackground(value);
var style = this.style;
var paddingTop = view_common_1.paddingTopProperty.isSet(style) ? this.effectivePaddingTop : this._defaultPaddingTop;
var paddingRight = view_common_1.paddingRightProperty.isSet(style) ? this.effectivePaddingRight : this._defaultPaddingRight;
var paddingBottom = view_common_1.paddingBottomProperty.isSet(style) ? this.effectivePaddingBottom : this._defaultPaddingBottom;
var paddingLeft = view_common_1.paddingLeftProperty.isSet(style) ? this.effectivePaddingLeft : this._defaultPaddingLeft;
if (this._isPaddingRelative) {
nativeView.setPaddingRelative(paddingLeft, paddingTop, paddingRight, paddingBottom);
}
else {
nativeView.setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom);
}
nativeView.background = undefined;
}
};
View.androidBackPressedEvent = androidBackPressedEvent;
__decorate([
profiling_1.profile
], View.prototype, "onLoaded", null);
__decorate([
profiling_1.profile
], View.prototype, "onUnloaded", null);
__decorate([
profiling_1.profile
], View.prototype, "requestLayout", null);
return View;
}(view_common_1.ViewCommon));
exports.View = View;
var ContainerView = (function (_super) {
__extends(ContainerView, _super);
function ContainerView() {
return _super !== null && _super.apply(this, arguments) || this;
}
return ContainerView;
}(View));
exports.ContainerView = ContainerView;
var CustomLayoutView = (function (_super) {
__extends(CustomLayoutView, _super);
function CustomLayoutView() {
return _super !== null && _super.apply(this, arguments) || this;
}
CustomLayoutView.prototype.createNativeView = function () {
return new org.nativescript.widgets.ContentLayout(this._context);
};
CustomLayoutView.prototype._addViewToNativeVisualTree = function (child, atIndex) {
if (atIndex === void 0) { atIndex = Number.MAX_SAFE_INTEGER; }
_super.prototype._addViewToNativeVisualTree.call(this, child);
if (this.nativeViewProtected && child.nativeViewProtected) {
if (view_common_1.traceEnabled()) {
view_common_1.traceWrite(this + ".nativeView.addView(" + child + ".nativeView, " + atIndex + ")", view_common_1.traceCategories.VisualTreeEvents);
}
this.nativeViewProtected.addView(child.nativeViewProtected, atIndex);
if (child instanceof View) {
this._updateNativeLayoutParams(child);
}
return true;
}
return false;
};
CustomLayoutView.prototype._updateNativeLayoutParams = function (child) {
this._setChildMinWidthNative(child);
this._setChildMinHeightNative(child);
};
CustomLayoutView.prototype._setChildMinWidthNative = function (child) {
child._setMinWidthNative(child.minWidth);
};
CustomLayoutView.prototype._setChildMinHeightNative = function (child) {
child._setMinHeightNative(child.minHeight);
};
CustomLayoutView.prototype._removeViewFromNativeVisualTree = function (child) {
_super.prototype._removeViewFromNativeVisualTree.call(this, child);
var nativeView = this.nativeViewProtected;
var childView = child.nativeViewProtected;
if (nativeView && childView) {
nativeView.removeView(childView);
if (view_common_1.traceEnabled()) {
view_common_1.traceWrite(nativeView + ".removeView(" + childView + ")", view_common_1.traceCategories.VisualTreeEvents);
view_common_1.traceNotifyEvent(child, "childInLayoutRemovedFromNativeVisualTree");
}
}
};
return CustomLayoutView;
}(ContainerView));
exports.CustomLayoutView = CustomLayoutView;
var percentNotSupported = function (view, value) { throw new Error("PercentLength is not supported."); };
function createNativePercentLengthProperty(options) {
var getter = options.getter, setter = options.setter, _a = options.auto, auto = _a === void 0 ? 0 : _a;
var setPixels, getPixels, setPercent;
if (getter) {
View.prototype[getter] = function () {
if (options) {
setPixels = options.setPixels;
getPixels = options.getPixels;
setPercent = options.setPercent || percentNotSupported;
options = null;
}
var value = getPixels(this.nativeViewProtected);
if (value == auto) {
return "auto";
}
else {
return { value: value, unit: "px" };
}
};
}
if (setter) {
View.prototype[setter] = function (length) {
if (options) {
setPixels = options.setPixels;
getPixels = options.getPixels;
setPercent = options.setPercent || percentNotSupported;
options = null;
}
if (length == "auto") {
setPixels(this.nativeViewProtected, auto);
}
else if (typeof length === "number") {
setPixels(this.nativeViewProtected, view_common_1.layout.round(view_common_1.layout.toDevicePixels(length)));
}
else if (length.unit == "dip") {
setPixels(this.nativeViewProtected, view_common_1.layout.round(view_common_1.layout.toDevicePixels(length.value)));
}
else if (length.unit == "px") {
setPixels(this.nativeViewProtected, view_common_1.layout.round(length.value));
}
else if (length.unit == "%") {
setPercent(this.nativeViewProtected, length.value);
}
else {
throw new Error("Unsupported PercentLength " + length);
}
};
}
}
createNativePercentLengthProperty({
setter: style_properties_1.marginTopProperty.setNative,
get setPixels() { return org.nativescript.widgets.ViewHelper.setMarginTop; },
get setPercent() { return org.nativescript.widgets.ViewHelper.setMarginTopPercent; }
});
createNativePercentLengthProperty({
setter: style_properties_1.marginRightProperty.setNative,
get setPixels() { return org.nativescript.widgets.ViewHelper.setMarginRight; },
get setPercent() { return org.nativescript.widgets.ViewHelper.setMarginRightPercent; }
});
createNativePercentLengthProperty({
setter: style_properties_1.marginBottomProperty.setNative,
get setPixels() { return org.nativescript.widgets.ViewHelper.setMarginBottom; },
get setPercent() { return org.nativescript.widgets.ViewHelper.setMarginBottomPercent; }
});
createNativePercentLengthProperty({
setter: style_properties_1.marginLeftProperty.setNative,
get setPixels() { return org.nativescript.widgets.ViewHelper.setMarginLeft; },
get setPercent() { return org.nativescript.widgets.ViewHelper.setMarginLeftPercent; }
});
createNativePercentLengthProperty({
setter: style_properties_1.widthProperty.setNative,
auto: -1,
get setPixels() { return org.nativescript.widgets.ViewHelper.setWidth; },
get setPercent() { return org.nativescript.widgets.ViewHelper.setWidthPercent; }
});
createNativePercentLengthProperty({
setter: style_properties_1.heightProperty.setNative,
auto: -1,
get setPixels() { return org.nativescript.widgets.ViewHelper.setHeight; },
get setPercent() { return org.nativescript.widgets.ViewHelper.setHeightPercent; }
});
createNativePercentLengthProperty({
setter: "_setMinWidthNative",
get setPixels() { return org.nativescript.widgets.ViewHelper.setMinWidth; }
});
createNativePercentLengthProperty({
setter: "_setMinHeightNative",
get setPixels() { return org.nativescript.widgets.ViewHelper.setMinHeight; }
});
//# sourceMappingURL=view.android.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/core/weak-event-listener/weak-event-listener.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var handlersForEventName = new Map();
var sourcesMap = new WeakMap();
var TargetHandlerPair = (function () {
function TargetHandlerPair(target, handler) {
this.tagetRef = new WeakRef(target);
this.handler = handler;
}
return TargetHandlerPair;
}());
function getHandlerForEventName(eventName) {
var handler = handlersForEventName.get(eventName);
if (!handler) {
handler = function (eventData) {
var source = eventData.object;
var sourceEventMap = sourcesMap.get(source);
if (!sourceEventMap) {
source.removeEventListener(eventName, handlersForEventName.get(eventName));
return;
}
var targetHandlerPairList = sourceEventMap.get(eventName);
if (!targetHandlerPairList) {
return;
}
var deadPairsIndexes = [];
for (var i = 0; i < targetHandlerPairList.length; i++) {
var pair = targetHandlerPairList[i];
var target = pair.tagetRef.get();
if (target) {
pair.handler.call(target, eventData);
}
else {
deadPairsIndexes.push(i);
}
}
if (deadPairsIndexes.length === targetHandlerPairList.length) {
source.removeEventListener(eventName, handlersForEventName.get(eventName));
sourceEventMap.delete(eventName);
}
else {
for (var j = deadPairsIndexes.length - 1; j >= 0; j--) {
targetHandlerPairList.splice(deadPairsIndexes[j], 1);
}
}
};
handlersForEventName.set(eventName, handler);
}
return handler;
}
function validateArgs(source, eventName, handler, target) {
if (!source) {
throw new Error("source is null or undefined");
}
if (!target) {
throw new Error("target is null or undefined");
}
if (typeof eventName !== "string") {
throw new Error("eventName is not a string");
}
if (typeof handler !== "function") {
throw new Error("handler is not a function");
}
}
function addWeakEventListener(source, eventName, handler, target) {
validateArgs(source, eventName, handler, target);
var shouldAttach = false;
var sourceEventMap = sourcesMap.get(source);
if (!sourceEventMap) {
sourceEventMap = new Map();
sourcesMap.set(source, sourceEventMap);
shouldAttach = true;
}
var pairList = sourceEventMap.get(eventName);
if (!pairList) {
pairList = new Array();
sourceEventMap.set(eventName, pairList);
shouldAttach = true;
}
pairList.push(new TargetHandlerPair(target, handler));
if (shouldAttach) {
source.addEventListener(eventName, getHandlerForEventName(eventName));
}
}
exports.addWeakEventListener = addWeakEventListener;
function removeWeakEventListener(source, eventName, handler, target) {
validateArgs(source, eventName, handler, target);
var handlerForEventWithName = handlersForEventName.get(eventName);
if (!handlerForEventWithName) {
return;
}
var sourceEventMap = sourcesMap.get(source);
if (!sourceEventMap) {
return;
}
var targetHandlerPairList = sourceEventMap.get(eventName);
if (!targetHandlerPairList) {
return;
}
var targetHandlerPairsToRemove = [];
for (var i = 0; i < targetHandlerPairList.length; i++) {
var pair = targetHandlerPairList[i];
var registeredTarget = pair.tagetRef.get();
if (!registeredTarget || (registeredTarget === target && handler === pair.handler)) {
targetHandlerPairsToRemove.push(i);
}
}
if (targetHandlerPairsToRemove.length === targetHandlerPairList.length) {
source.removeEventListener(eventName, handlerForEventWithName);
sourceEventMap.delete(eventName);
}
else {
for (var j = targetHandlerPairsToRemove.length - 1; j >= 0; j--) {
targetHandlerPairList.splice(targetHandlerPairsToRemove[j], 1);
}
}
}
exports.removeWeakEventListener = removeWeakEventListener;
//# sourceMappingURL=weak-event-listener.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/date-picker/date-picker-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js"));
var defaultDate = new Date();
var dateComparer = function (x, y) { return (x <= y && x >= y); };
var DatePickerBase = (function (_super) {
__extends(DatePickerBase, _super);
function DatePickerBase() {
return _super !== null && _super.apply(this, arguments) || this;
}
DatePickerBase = __decorate([
view_1.CSSType("DatePicker")
], DatePickerBase);
return DatePickerBase;
}(view_1.View));
exports.DatePickerBase = DatePickerBase;
DatePickerBase.prototype.recycleNativeView = "auto";
exports.yearProperty = new view_1.Property({
name: "year",
defaultValue: defaultDate.getFullYear(),
valueConverter: function (v) { return parseInt(v); },
});
exports.yearProperty.register(DatePickerBase);
exports.monthProperty = new view_1.Property({
name: "month",
defaultValue: defaultDate.getMonth() + 1,
valueConverter: function (v) { return parseInt(v); },
});
exports.monthProperty.register(DatePickerBase);
exports.dayProperty = new view_1.Property({
name: "day",
defaultValue: defaultDate.getDate(),
valueConverter: function (v) { return parseInt(v); },
});
exports.dayProperty.register(DatePickerBase);
exports.maxDateProperty = new view_1.Property({
name: "maxDate",
equalityComparer: dateComparer,
valueConverter: function (v) { return new Date(v); },
});
exports.maxDateProperty.register(DatePickerBase);
exports.minDateProperty = new view_1.Property({
name: "minDate",
equalityComparer: dateComparer,
valueConverter: function (v) { return new Date(v); },
});
exports.minDateProperty.register(DatePickerBase);
exports.dateProperty = new view_1.Property({
name: "date",
defaultValue: defaultDate,
equalityComparer: dateComparer,
valueConverter: function (v) { return new Date(v); },
});
exports.dateProperty.register(DatePickerBase);
//# sourceMappingURL=date-picker-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/date-picker/date-picker.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var date_picker_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/date-picker/date-picker-common.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/date-picker/date-picker-common.js"));
var DateChangedListener;
function initializeDateChangedListener() {
if (DateChangedListener) {
return;
}
var DateChangedListenerImpl = (function (_super) {
__extends(DateChangedListenerImpl, _super);
function DateChangedListenerImpl(owner) {
var _this = _super.call(this) || this;
_this.owner = owner;
return global.__native(_this);
}
DateChangedListenerImpl.prototype.onDateChanged = function (picker, year, month, day) {
var owner = this.owner;
var dateChanged = false;
if (year !== owner.year) {
date_picker_common_1.yearProperty.nativeValueChange(owner, year);
dateChanged = true;
}
if (month !== (owner.month - 1)) {
date_picker_common_1.monthProperty.nativeValueChange(owner, month + 1);
dateChanged = true;
}
if (day !== owner.day) {
date_picker_common_1.dayProperty.nativeValueChange(owner, day);
dateChanged = true;
}
if (dateChanged) {
date_picker_common_1.dateProperty.nativeValueChange(owner, new Date(year, month, day));
}
};
DateChangedListenerImpl = __decorate([
Interfaces([android.widget.DatePicker.OnDateChangedListener])
], DateChangedListenerImpl);
return DateChangedListenerImpl;
}(java.lang.Object));
DateChangedListener = DateChangedListenerImpl;
}
var DatePicker = (function (_super) {
__extends(DatePicker, _super);
function DatePicker() {
return _super !== null && _super.apply(this, arguments) || this;
}
DatePicker.prototype.createNativeView = function () {
var picker = new android.widget.DatePicker(this._context);
picker.setCalendarViewShown(false);
return picker;
};
DatePicker.prototype.initNativeView = function () {
_super.prototype.initNativeView.call(this);
initializeDateChangedListener();
var nativeView = this.nativeViewProtected;
var listener = new DateChangedListener(this);
nativeView.init(this.year, this.month - 1, this.day, listener);
nativeView.listener = listener;
};
DatePicker.prototype.disposeNativeView = function () {
this.nativeViewProtected.listener.owner = null;
_super.prototype.disposeNativeView.call(this);
};
DatePicker.prototype.updateNativeDate = function () {
var nativeView = this.nativeViewProtected;
var year = typeof this.year === "number" ? this.year : nativeView.getYear();
var month = typeof this.month === "number" ? this.month - 1 : nativeView.getMonth();
var day = typeof this.day === "number" ? this.day : nativeView.getDayOfMonth();
this.date = new Date(year, month, day);
};
DatePicker.prototype[date_picker_common_1.yearProperty.setNative] = function (value) {
if (this.nativeViewProtected.getYear() !== value) {
this.updateNativeDate();
}
};
DatePicker.prototype[date_picker_common_1.monthProperty.setNative] = function (value) {
if (this.nativeViewProtected.getMonth() !== (value - 1)) {
this.updateNativeDate();
}
};
DatePicker.prototype[date_picker_common_1.dayProperty.setNative] = function (value) {
if (this.nativeViewProtected.getDayOfMonth() !== value) {
this.updateNativeDate();
}
};
DatePicker.prototype[date_picker_common_1.dateProperty.setNative] = function (value) {
var nativeView = this.nativeViewProtected;
if (nativeView.getDayOfMonth() !== value.getDate()
|| nativeView.getMonth() !== value.getMonth()
|| nativeView.getYear() !== value.getFullYear()) {
nativeView.updateDate(value.getFullYear(), value.getMonth(), value.getDate());
}
};
DatePicker.prototype[date_picker_common_1.maxDateProperty.getDefault] = function () {
return this.nativeViewProtected.getMaxDate();
};
DatePicker.prototype[date_picker_common_1.maxDateProperty.setNative] = function (value) {
var newValue = value instanceof Date ? value.getTime() : value;
this.nativeViewProtected.setMaxDate(newValue);
};
DatePicker.prototype[date_picker_common_1.minDateProperty.getDefault] = function () {
return this.nativeViewProtected.getMinDate();
};
DatePicker.prototype[date_picker_common_1.minDateProperty.setNative] = function (value) {
var newValue = value instanceof Date ? value.getTime() : value;
this.nativeViewProtected.setMinDate(newValue);
};
return DatePicker;
}(date_picker_common_1.DatePickerBase));
exports.DatePicker = DatePicker;
//# sourceMappingURL=date-picker.android.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/dialogs/dialogs-common.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var platform_1 = __webpack_require__("../node_modules/tns-core-modules/platform/platform.js");
exports.STRING = "string";
exports.PROMPT = "Prompt";
exports.CONFIRM = "Confirm";
exports.ALERT = "Alert";
exports.LOGIN = "Login";
exports.OK = "OK";
exports.CANCEL = "Cancel";
var inputType;
(function (inputType) {
inputType.text = "text";
inputType.password = "password";
inputType.email = "email";
inputType.number = "number";
inputType.phone = "phone";
})(inputType = exports.inputType || (exports.inputType = {}));
var capitalizationType;
(function (capitalizationType) {
capitalizationType.none = "none";
capitalizationType.all = "all";
capitalizationType.sentences = "sentences";
capitalizationType.words = "words";
})(capitalizationType = exports.capitalizationType || (exports.capitalizationType = {}));
var frame;
function getCurrentPage() {
if (!frame) {
frame = __webpack_require__("../node_modules/tns-core-modules/ui/frame/frame.js");
}
var topmostFrame = frame.topmost();
if (topmostFrame) {
return topmostFrame.currentPage;
}
return undefined;
}
exports.getCurrentPage = getCurrentPage;
function applySelectors(view, callback) {
var currentPage = getCurrentPage();
if (currentPage) {
var styleScope = currentPage._styleScope;
if (styleScope) {
view._inheritStyleScope(styleScope);
view.onLoaded();
callback(view);
view.onUnloaded();
}
}
}
var button;
var label;
var textField;
function getButtonColors() {
if (!button) {
var Button = __webpack_require__("../node_modules/tns-core-modules/ui/button/button.js").Button;
button = new Button;
if (platform_1.isIOS) {
button._setupUI({});
}
}
var buttonColor;
var buttonBackgroundColor;
applySelectors(button, function (btn) {
buttonColor = btn.color;
buttonBackgroundColor = btn.backgroundColor;
});
return { color: buttonColor, backgroundColor: buttonBackgroundColor };
}
exports.getButtonColors = getButtonColors;
function getLabelColor() {
if (!label) {
var Label = __webpack_require__("../node_modules/tns-core-modules/ui/label/label.js").Label;
label = new Label;
if (platform_1.isIOS) {
label._setupUI({});
}
}
var labelColor;
applySelectors(label, function (lbl) {
labelColor = lbl.color;
});
return labelColor;
}
exports.getLabelColor = getLabelColor;
function getTextFieldColor() {
if (!textField) {
var TextField = __webpack_require__("../node_modules/tns-core-modules/ui/text-field/text-field.js").TextField;
textField = new TextField();
if (platform_1.isIOS) {
textField._setupUI({});
}
}
var textFieldColor;
applySelectors(textField, function (tf) {
textFieldColor = tf.color;
});
return textFieldColor;
}
exports.getTextFieldColor = getTextFieldColor;
function isDialogOptions(arg) {
return arg && (arg.message || arg.title);
}
exports.isDialogOptions = isDialogOptions;
//# sourceMappingURL=dialogs-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/dialogs/dialogs.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var dialogs_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/dialogs/dialogs-common.js");
var application_1 = __webpack_require__("../node_modules/tns-core-modules/application/application.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/dialogs/dialogs-common.js"));
function isString(value) {
return typeof value === "string";
}
function createAlertDialog(options) {
var alert = new android.app.AlertDialog.Builder(application_1.android.foregroundActivity);
alert.setTitle(options && isString(options.title) ? options.title : "");
alert.setMessage(options && isString(options.message) ? options.message : "");
if (options && options.cancelable === false) {
alert.setCancelable(false);
}
return alert;
}
function showDialog(builder) {
var dlg = builder.show();
var labelColor = dialogs_common_1.getLabelColor();
if (labelColor) {
var textViewId = dlg.getContext().getResources().getIdentifier("android:id/alertTitle", null, null);
if (textViewId) {
var tv = dlg.findViewById(textViewId);
if (tv) {
tv.setTextColor(labelColor.android);
}
}
var messageTextViewId = dlg.getContext().getResources().getIdentifier("android:id/message", null, null);
if (messageTextViewId) {
var messageTextView = dlg.findViewById(messageTextViewId);
if (messageTextView) {
messageTextView.setTextColor(labelColor.android);
}
}
}
var _a = dialogs_common_1.getButtonColors(), color = _a.color, backgroundColor = _a.backgroundColor;
if (color) {
var buttons = [];
for (var i = 0; i < 3; i++) {
var id = dlg.getContext().getResources().getIdentifier("android:id/button" + i, null, null);
buttons[i] = dlg.findViewById(id);
}
buttons.forEach(function (button) {
if (button) {
if (color) {
button.setTextColor(color.android);
}
if (backgroundColor) {
button.setBackgroundColor(backgroundColor.android);
}
}
});
}
}
function addButtonsToAlertDialog(alert, options, callback) {
if (!options) {
return;
}
if (options.okButtonText) {
alert.setPositiveButton(options.okButtonText, new android.content.DialogInterface.OnClickListener({
onClick: function (dialog, id) {
dialog.cancel();
callback(true);
}
}));
}
if (options.cancelButtonText) {
alert.setNegativeButton(options.cancelButtonText, new android.content.DialogInterface.OnClickListener({
onClick: function (dialog, id) {
dialog.cancel();
callback(false);
}
}));
}
if (options.neutralButtonText) {
alert.setNeutralButton(options.neutralButtonText, new android.content.DialogInterface.OnClickListener({
onClick: function (dialog, id) {
dialog.cancel();
callback(undefined);
}
}));
}
alert.setOnDismissListener(new android.content.DialogInterface.OnDismissListener({
onDismiss: function () {
callback(false);
}
}));
}
function alert(arg) {
return new Promise(function (resolve, reject) {
try {
var options = !dialogs_common_1.isDialogOptions(arg) ? { title: dialogs_common_1.ALERT, okButtonText: dialogs_common_1.OK, message: arg + "" } : arg;
var alert_1 = createAlertDialog(options);
alert_1.setPositiveButton(options.okButtonText, new android.content.DialogInterface.OnClickListener({
onClick: function (dialog, id) {
dialog.cancel();
resolve();
}
}));
alert_1.setOnDismissListener(new android.content.DialogInterface.OnDismissListener({
onDismiss: function () {
resolve();
}
}));
showDialog(alert_1);
}
catch (ex) {
reject(ex);
}
});
}
exports.alert = alert;
function confirm(arg) {
return new Promise(function (resolve, reject) {
try {
var options = !dialogs_common_1.isDialogOptions(arg) ? { title: dialogs_common_1.CONFIRM, okButtonText: dialogs_common_1.OK, cancelButtonText: dialogs_common_1.CANCEL, message: arg + "" } : arg;
var alert_2 = createAlertDialog(options);
addButtonsToAlertDialog(alert_2, options, function (result) { resolve(result); });
showDialog(alert_2);
}
catch (ex) {
reject(ex);
}
});
}
exports.confirm = confirm;
function prompt(arg) {
var options;
var defaultOptions = {
title: dialogs_common_1.PROMPT,
okButtonText: dialogs_common_1.OK,
cancelButtonText: dialogs_common_1.CANCEL,
inputType: dialogs_common_1.inputType.text,
};
if (arguments.length === 1) {
if (isString(arg)) {
options = defaultOptions;
options.message = arg;
}
else {
options = arg;
}
}
else if (arguments.length === 2) {
if (isString(arguments[0]) && isString(arguments[1])) {
options = defaultOptions;
options.message = arguments[0];
options.defaultText = arguments[1];
}
}
return new Promise(function (resolve, reject) {
try {
var alert_3 = createAlertDialog(options);
var input_1 = new android.widget.EditText(application_1.android.foregroundActivity);
if (options) {
if (options.inputType === dialogs_common_1.inputType.password) {
input_1.setInputType(android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_PASSWORD);
}
else if (options.inputType === dialogs_common_1.inputType.email) {
input_1.setInputType(android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
}
else if (options.inputType === dialogs_common_1.inputType.number) {
input_1.setInputType(android.text.InputType.TYPE_CLASS_NUMBER);
}
else if (options.inputType === dialogs_common_1.inputType.phone) {
input_1.setInputType(android.text.InputType.TYPE_CLASS_PHONE);
}
switch (options.capitalizationType) {
case dialogs_common_1.capitalizationType.all: {
input_1.setInputType(input_1.getInputType() | android.text.InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS);
break;
}
case dialogs_common_1.capitalizationType.sentences: {
input_1.setInputType(input_1.getInputType() | android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);
break;
}
case dialogs_common_1.capitalizationType.words: {
input_1.setInputType(input_1.getInputType() | android.text.InputType.TYPE_TEXT_FLAG_CAP_WORDS);
break;
}
}
}
input_1.setText(options && options.defaultText || "");
alert_3.setView(input_1);
var getText_1 = function () { return input_1.getText().toString(); };
addButtonsToAlertDialog(alert_3, options, function (r) { resolve({ result: r, text: getText_1() }); });
showDialog(alert_3);
}
catch (ex) {
reject(ex);
}
});
}
exports.prompt = prompt;
function login(arg) {
var options;
var defaultOptions = { title: dialogs_common_1.LOGIN, okButtonText: dialogs_common_1.OK, cancelButtonText: dialogs_common_1.CANCEL };
if (arguments.length === 1) {
if (isString(arguments[0])) {
options = defaultOptions;
options.message = arguments[0];
}
else {
options = arguments[0];
}
}
else if (arguments.length === 2) {
if (isString(arguments[0]) && isString(arguments[1])) {
options = defaultOptions;
options.message = arguments[0];
options.userName = arguments[1];
}
}
else if (arguments.length === 3) {
if (isString(arguments[0]) && isString(arguments[1]) && isString(arguments[2])) {
options = defaultOptions;
options.message = arguments[0];
options.userName = arguments[1];
options.password = arguments[2];
}
}
return new Promise(function (resolve, reject) {
try {
var context_1 = application_1.android.foregroundActivity;
var alert_4 = createAlertDialog(options);
var userNameInput_1 = new android.widget.EditText(context_1);
userNameInput_1.setText(options.userName ? options.userName : "");
var passwordInput_1 = new android.widget.EditText(context_1);
passwordInput_1.setInputType(android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_PASSWORD);
passwordInput_1.setText(options.password ? options.password : "");
var layout = new android.widget.LinearLayout(context_1);
layout.setOrientation(1);
layout.addView(userNameInput_1);
layout.addView(passwordInput_1);
alert_4.setView(layout);
addButtonsToAlertDialog(alert_4, options, function (r) {
resolve({
result: r,
userName: userNameInput_1.getText().toString(),
password: passwordInput_1.getText().toString()
});
});
showDialog(alert_4);
}
catch (ex) {
reject(ex);
}
});
}
exports.login = login;
function action(arg) {
var options;
var defaultOptions = { title: null, cancelButtonText: dialogs_common_1.CANCEL };
if (arguments.length === 1) {
if (isString(arguments[0])) {
options = defaultOptions;
options.message = arguments[0];
}
else {
options = arguments[0];
}
}
else if (arguments.length === 2) {
if (isString(arguments[0]) && isString(arguments[1])) {
options = defaultOptions;
options.message = arguments[0];
options.cancelButtonText = arguments[1];
}
}
else if (arguments.length === 3) {
if (isString(arguments[0]) && isString(arguments[1]) && typeof arguments[2] !== "undefined") {
options = defaultOptions;
options.message = arguments[0];
options.cancelButtonText = arguments[1];
options.actions = arguments[2];
}
}
return new Promise(function (resolve, reject) {
try {
var activity = application_1.android.foregroundActivity || application_1.android.startActivity;
var alert_5 = new android.app.AlertDialog.Builder(activity);
var message = options && isString(options.message) ? options.message : "";
var title = options && isString(options.title) ? options.title : "";
if (options && options.cancelable === false) {
alert_5.setCancelable(false);
}
if (title) {
alert_5.setTitle(title);
if (!options.actions) {
alert_5.setMessage(message);
}
}
else {
alert_5.setTitle(message);
}
if (options.actions) {
alert_5.setItems(options.actions, new android.content.DialogInterface.OnClickListener({
onClick: function (dialog, which) {
resolve(options.actions[which]);
}
}));
}
if (isString(options.cancelButtonText)) {
alert_5.setNegativeButton(options.cancelButtonText, new android.content.DialogInterface.OnClickListener({
onClick: function (dialog, id) {
dialog.cancel();
resolve(options.cancelButtonText);
}
}));
}
alert_5.setOnDismissListener(new android.content.DialogInterface.OnDismissListener({
onDismiss: function () {
if (isString(options.cancelButtonText)) {
resolve(options.cancelButtonText);
}
else {
resolve("");
}
}
}));
showDialog(alert_5);
}
catch (ex) {
reject(ex);
}
});
}
exports.action = action;
//# sourceMappingURL=dialogs.android.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/editable-text-base/editable-text-base-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var text_base_1 = __webpack_require__("../node_modules/tns-core-modules/ui/text-base/text-base.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/text-base/text-base.js"));
var EditableTextBase = (function (_super) {
__extends(EditableTextBase, _super);
function EditableTextBase() {
return _super !== null && _super.apply(this, arguments) || this;
}
EditableTextBase.blurEvent = "blur";
EditableTextBase.focusEvent = "focus";
return EditableTextBase;
}(text_base_1.TextBase));
exports.EditableTextBase = EditableTextBase;
exports.placeholderColorProperty = new text_base_1.CssProperty({ name: "placeholderColor", cssName: "placeholder-color", equalityComparer: text_base_1.Color.equals, valueConverter: function (v) { return new text_base_1.Color(v); } });
exports.placeholderColorProperty.register(text_base_1.Style);
var keyboardTypeConverter = text_base_1.makeParser(text_base_1.makeValidator("datetime", "phone", "number", "url", "email"));
exports.keyboardTypeProperty = new text_base_1.Property({ name: "keyboardType", valueConverter: keyboardTypeConverter });
exports.keyboardTypeProperty.register(EditableTextBase);
var returnKeyTypeConverter = text_base_1.makeParser(text_base_1.makeValidator("done", "next", "go", "search", "send"));
exports.returnKeyTypeProperty = new text_base_1.Property({ name: "returnKeyType", valueConverter: returnKeyTypeConverter });
exports.returnKeyTypeProperty.register(EditableTextBase);
exports.editableProperty = new text_base_1.Property({ name: "editable", defaultValue: true, valueConverter: text_base_1.booleanConverter });
exports.editableProperty.register(EditableTextBase);
exports.updateTextTriggerProperty = new text_base_1.Property({ name: "updateTextTrigger", defaultValue: "textChanged" });
exports.updateTextTriggerProperty.register(EditableTextBase);
var autocapitalizationTypeConverter = text_base_1.makeParser(text_base_1.makeValidator("none", "words", "sentences", "allcharacters"));
exports.autocapitalizationTypeProperty = new text_base_1.Property({ name: "autocapitalizationType", defaultValue: "sentences", valueConverter: autocapitalizationTypeConverter });
exports.autocapitalizationTypeProperty.register(EditableTextBase);
exports.autocorrectProperty = new text_base_1.Property({ name: "autocorrect", valueConverter: text_base_1.booleanConverter });
exports.autocorrectProperty.register(EditableTextBase);
exports.hintProperty = new text_base_1.Property({ name: "hint", defaultValue: "" });
exports.hintProperty.register(EditableTextBase);
exports.maxLengthProperty = new text_base_1.Property({ name: "maxLength", defaultValue: Number.POSITIVE_INFINITY, valueConverter: parseInt });
exports.maxLengthProperty.register(EditableTextBase);
//# sourceMappingURL=editable-text-base-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/editable-text-base/editable-text-base.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var editable_text_base_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/editable-text-base/editable-text-base-common.js");
var utils_1 = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/editable-text-base/editable-text-base-common.js"));
var EditTextListeners;
function clearDismissTimer() {
exports.dismissKeyboardOwner = null;
if (exports.dismissKeyboardTimeoutId) {
clearTimeout(exports.dismissKeyboardTimeoutId);
exports.dismissKeyboardTimeoutId = null;
}
}
function dismissSoftInput(owner) {
clearDismissTimer();
if (!exports.dismissKeyboardTimeoutId) {
exports.dismissKeyboardTimeoutId = setTimeout(function () {
var owner = exports.dismissKeyboardOwner && exports.dismissKeyboardOwner.get();
var activity = (owner && owner._context);
var nativeView = owner && owner.nativeViewProtected;
exports.dismissKeyboardTimeoutId = null;
exports.dismissKeyboardOwner = null;
var focused = activity && activity.getCurrentFocus();
if (!focused || !(focused instanceof android.widget.EditText)) {
utils_1.ad.dismissSoftInput(nativeView);
}
}, 10);
}
}
function initializeEditTextListeners() {
if (EditTextListeners) {
return;
}
var EditTextListenersImpl = (function (_super) {
__extends(EditTextListenersImpl, _super);
function EditTextListenersImpl(owner) {
var _this = _super.call(this) || this;
_this.owner = owner;
return global.__native(_this);
}
EditTextListenersImpl.prototype.beforeTextChanged = function (text, start, count, after) {
};
EditTextListenersImpl.prototype.onTextChanged = function (text, start, before, count) {
};
EditTextListenersImpl.prototype.afterTextChanged = function (editable) {
var owner = this.owner;
if (!owner || owner._changeFromCode) {
return;
}
switch (owner.updateTextTrigger) {
case "focusLost":
owner._dirtyTextAccumulator = editable.toString();
break;
case "textChanged":
editable_text_base_common_1.textProperty.nativeValueChange(owner, editable.toString());
break;
default:
throw new Error("Invalid updateTextTrigger: " + owner.updateTextTrigger);
}
};
EditTextListenersImpl.prototype.onFocusChange = function (view, hasFocus) {
var owner = this.owner;
if (!owner) {
return;
}
if (hasFocus) {
clearDismissTimer();
owner.notify({ eventName: EditableTextBase.focusEvent, object: owner });
}
else {
if (owner._dirtyTextAccumulator || owner._dirtyTextAccumulator === "") {
editable_text_base_common_1.textProperty.nativeValueChange(owner, owner._dirtyTextAccumulator);
owner._dirtyTextAccumulator = undefined;
}
owner.notify({ eventName: EditableTextBase.blurEvent, object: owner });
dismissSoftInput(owner);
}
};
EditTextListenersImpl.prototype.onEditorAction = function (textView, actionId, event) {
var owner = this.owner;
if (!owner) {
return false;
}
if (actionId === android.view.inputmethod.EditorInfo.IME_ACTION_DONE ||
actionId === android.view.inputmethod.EditorInfo.IME_ACTION_UNSPECIFIED ||
(event && event.getKeyCode() === android.view.KeyEvent.KEYCODE_ENTER)) {
if (textView.getMaxLines() === 1) {
owner.dismissSoftInput();
}
owner._onReturnPress();
}
else if (actionId === android.view.inputmethod.EditorInfo.IME_ACTION_NEXT ||
actionId === android.view.inputmethod.EditorInfo.IME_ACTION_PREVIOUS) {
owner._onReturnPress();
}
return false;
};
EditTextListenersImpl = __decorate([
Interfaces([android.text.TextWatcher, android.view.View.OnFocusChangeListener, android.widget.TextView.OnEditorActionListener])
], EditTextListenersImpl);
return EditTextListenersImpl;
}(java.lang.Object));
EditTextListeners = EditTextListenersImpl;
}
var EditableTextBase = (function (_super) {
__extends(EditableTextBase, _super);
function EditableTextBase() {
return _super !== null && _super.apply(this, arguments) || this;
}
EditableTextBase.prototype._onReturnPress = function () {
};
EditableTextBase.prototype.createNativeView = function () {
return new android.widget.EditText(this._context);
};
EditableTextBase.prototype.initNativeView = function () {
_super.prototype.initNativeView.call(this);
var editText = this.nativeTextViewProtected;
this._configureEditText(editText);
initializeEditTextListeners();
var listeners = new EditTextListeners(this);
editText.addTextChangedListener(listeners);
editText.setOnFocusChangeListener(listeners);
editText.setOnEditorActionListener(listeners);
editText.listener = listeners;
this._inputType = editText.getInputType();
};
EditableTextBase.prototype.disposeNativeView = function () {
this.nativeTextViewProtected.listener.owner = null;
this._keyListenerCache = null;
_super.prototype.disposeNativeView.call(this);
};
EditableTextBase.prototype.resetNativeView = function () {
_super.prototype.resetNativeView.call(this);
this.nativeTextViewProtected.setInputType(this._inputType);
};
EditableTextBase.prototype.onUnloaded = function () {
this.dismissSoftInput();
_super.prototype.onUnloaded.call(this);
};
EditableTextBase.prototype.dismissSoftInput = function () {
var nativeView = this.nativeTextViewProtected;
if (!nativeView) {
return;
}
utils_1.ad.dismissSoftInput(nativeView);
};
EditableTextBase.prototype.focus = function () {
var nativeView = this.nativeTextViewProtected;
if (!nativeView) {
return;
}
var result = _super.prototype.focus.call(this);
if (result) {
utils_1.ad.showSoftInput(this.nativeTextViewProtected);
}
return result;
};
EditableTextBase.prototype._setInputType = function (inputType) {
var nativeView = this.nativeTextViewProtected;
try {
this._changeFromCode = true;
nativeView.setInputType(inputType);
}
finally {
this._changeFromCode = false;
}
var listener = nativeView.getKeyListener();
if (listener) {
this._keyListenerCache = listener;
}
if (!this.editable) {
nativeView.setKeyListener(null);
}
};
EditableTextBase.prototype[editable_text_base_common_1.textProperty.getDefault] = function () {
return editable_text_base_common_1.resetSymbol;
};
EditableTextBase.prototype[editable_text_base_common_1.textProperty.setNative] = function (value) {
try {
this._changeFromCode = true;
this._setNativeText(value === editable_text_base_common_1.resetSymbol);
}
finally {
this._changeFromCode = false;
}
};
EditableTextBase.prototype[editable_text_base_common_1.keyboardTypeProperty.getDefault] = function () {
return this.nativeTextViewProtected.getInputType();
};
EditableTextBase.prototype[editable_text_base_common_1.keyboardTypeProperty.setNative] = function (value) {
var newInputType;
switch (value) {
case "datetime":
newInputType = android.text.InputType.TYPE_CLASS_DATETIME | android.text.InputType.TYPE_DATETIME_VARIATION_NORMAL;
break;
case "phone":
newInputType = android.text.InputType.TYPE_CLASS_PHONE;
break;
case "number":
newInputType = android.text.InputType.TYPE_CLASS_NUMBER | android.text.InputType.TYPE_NUMBER_VARIATION_NORMAL | android.text.InputType.TYPE_NUMBER_FLAG_SIGNED | android.text.InputType.TYPE_NUMBER_FLAG_DECIMAL;
break;
case "url":
newInputType = android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_URI;
break;
case "email":
newInputType = android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
break;
default:
newInputType = value;
break;
}
this._setInputType(newInputType);
};
EditableTextBase.prototype[editable_text_base_common_1.returnKeyTypeProperty.getDefault] = function () {
var ime = this.nativeTextViewProtected.getImeOptions();
switch (ime) {
case android.view.inputmethod.EditorInfo.IME_ACTION_DONE:
return "done";
case android.view.inputmethod.EditorInfo.IME_ACTION_GO:
return "go";
case android.view.inputmethod.EditorInfo.IME_ACTION_NEXT:
return "next";
case android.view.inputmethod.EditorInfo.IME_ACTION_SEARCH:
return "search";
case android.view.inputmethod.EditorInfo.IME_ACTION_SEND:
return "send";
default:
return ime.toString();
}
};
EditableTextBase.prototype[editable_text_base_common_1.returnKeyTypeProperty.setNative] = function (value) {
var newImeOptions;
switch (value) {
case "done":
newImeOptions = android.view.inputmethod.EditorInfo.IME_ACTION_DONE;
break;
case "go":
newImeOptions = android.view.inputmethod.EditorInfo.IME_ACTION_GO;
break;
case "next":
newImeOptions = android.view.inputmethod.EditorInfo.IME_ACTION_NEXT;
break;
case "search":
newImeOptions = android.view.inputmethod.EditorInfo.IME_ACTION_SEARCH;
break;
case "send":
newImeOptions = android.view.inputmethod.EditorInfo.IME_ACTION_SEND;
break;
default:
var ime = +value;
if (!isNaN(ime)) {
newImeOptions = ime;
}
else {
newImeOptions = android.view.inputmethod.EditorInfo.IME_ACTION_UNSPECIFIED;
}
break;
}
this.nativeTextViewProtected.setImeOptions(newImeOptions);
};
EditableTextBase.prototype[editable_text_base_common_1.editableProperty.setNative] = function (value) {
var nativeView = this.nativeTextViewProtected;
if (value) {
nativeView.setKeyListener(this._keyListenerCache);
}
else {
if (!this._keyListenerCache) {
this._keyListenerCache = nativeView.getKeyListener();
}
nativeView.setKeyListener(null);
}
};
EditableTextBase.prototype[editable_text_base_common_1.autocapitalizationTypeProperty.getDefault] = function () {
var inputType = this.nativeTextViewProtected.getInputType();
if ((inputType & android.text.InputType.TYPE_TEXT_FLAG_CAP_WORDS) === android.text.InputType.TYPE_TEXT_FLAG_CAP_WORDS) {
return "words";
}
else if ((inputType & android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES) === android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES) {
return "sentences";
}
else if ((inputType & android.text.InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS) === android.text.InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS) {
return "allcharacters";
}
else {
return inputType.toString();
}
};
EditableTextBase.prototype[editable_text_base_common_1.autocapitalizationTypeProperty.setNative] = function (value) {
var inputType = this.nativeTextViewProtected.getInputType();
inputType = inputType & ~28672;
switch (value) {
case "none":
break;
case "words":
inputType = inputType | android.text.InputType.TYPE_TEXT_FLAG_CAP_WORDS;
break;
case "sentences":
inputType = inputType | android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;
break;
case "allcharacters":
inputType = inputType | android.text.InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS;
break;
default:
var number = +value;
if (!isNaN(number)) {
inputType = number;
}
else {
inputType = inputType | android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;
}
break;
}
this._setInputType(inputType);
};
EditableTextBase.prototype[editable_text_base_common_1.autocorrectProperty.getDefault] = function () {
var autocorrect = this.nativeTextViewProtected.getInputType();
if ((autocorrect & android.text.InputType.TYPE_TEXT_FLAG_AUTO_CORRECT) === android.text.InputType.TYPE_TEXT_FLAG_AUTO_CORRECT) {
return true;
}
return false;
};
EditableTextBase.prototype[editable_text_base_common_1.autocorrectProperty.setNative] = function (value) {
var inputType = this.nativeTextViewProtected.getInputType();
switch (value) {
case true:
inputType = inputType | android.text.InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE;
inputType = inputType | android.text.InputType.TYPE_TEXT_FLAG_AUTO_CORRECT;
inputType = inputType & ~android.text.InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
break;
case false:
inputType = inputType & ~android.text.InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE;
inputType = inputType & ~android.text.InputType.TYPE_TEXT_FLAG_AUTO_CORRECT;
inputType = inputType | android.text.InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
break;
default:
break;
}
this._setInputType(inputType);
};
EditableTextBase.prototype[editable_text_base_common_1.hintProperty.getDefault] = function () {
return this.nativeTextViewProtected.getHint();
};
EditableTextBase.prototype[editable_text_base_common_1.hintProperty.setNative] = function (value) {
var text = (value === null || value === undefined) ? null : value.toString();
this.nativeTextViewProtected.setHint(text);
};
EditableTextBase.prototype[editable_text_base_common_1.placeholderColorProperty.getDefault] = function () {
return this.nativeTextViewProtected.getHintTextColors();
};
EditableTextBase.prototype[editable_text_base_common_1.placeholderColorProperty.setNative] = function (value) {
var color = value instanceof editable_text_base_common_1.Color ? value.android : value;
this.nativeTextViewProtected.setHintTextColor(color);
};
EditableTextBase.prototype[editable_text_base_common_1.textTransformProperty.setNative] = function (value) {
};
EditableTextBase.prototype[editable_text_base_common_1.maxLengthProperty.setNative] = function (value) {
if (value === Number.POSITIVE_INFINITY) {
this.nativeTextViewProtected.setFilters([]);
}
else {
var lengthFilter = new android.text.InputFilter.LengthFilter(value);
var filters = this.nativeTextViewProtected.getFilters();
var newFilters = [];
for (var i = 0; i < filters.length; i++) {
var filter = filters[i];
if (!(filter instanceof android.text.InputFilter.LengthFilter)) {
newFilters.push(filter);
}
}
newFilters.push(lengthFilter);
this.nativeTextViewProtected.setFilters(newFilters);
}
};
return EditableTextBase;
}(editable_text_base_common_1.EditableTextBase));
exports.EditableTextBase = EditableTextBase;
//# sourceMappingURL=editable-text-base.android.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/enums/enums.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var KeyboardType;
(function (KeyboardType) {
KeyboardType.datetime = "datetime";
KeyboardType.phone = "phone";
KeyboardType.number = "number";
KeyboardType.url = "url";
KeyboardType.email = "email";
})(KeyboardType = exports.KeyboardType || (exports.KeyboardType = {}));
var ReturnKeyType;
(function (ReturnKeyType) {
ReturnKeyType.done = "done";
ReturnKeyType.next = "next";
ReturnKeyType.go = "go";
ReturnKeyType.search = "search";
ReturnKeyType.send = "send";
})(ReturnKeyType = exports.ReturnKeyType || (exports.ReturnKeyType = {}));
var TextAlignment;
(function (TextAlignment) {
TextAlignment.left = "left";
TextAlignment.center = "center";
TextAlignment.right = "right";
})(TextAlignment = exports.TextAlignment || (exports.TextAlignment = {}));
var TextDecoration;
(function (TextDecoration) {
TextDecoration.none = "none";
TextDecoration.underline = "underline";
TextDecoration.lineThrough = "line-through";
})(TextDecoration = exports.TextDecoration || (exports.TextDecoration = {}));
var TextTransform;
(function (TextTransform) {
TextTransform.none = "none";
TextTransform.capitalize = "capitalize";
TextTransform.uppercase = "uppercase";
TextTransform.lowercase = "lowercase";
})(TextTransform = exports.TextTransform || (exports.TextTransform = {}));
var WhiteSpace;
(function (WhiteSpace) {
WhiteSpace.normal = "normal";
WhiteSpace.nowrap = "nowrap";
})(WhiteSpace = exports.WhiteSpace || (exports.WhiteSpace = {}));
var Orientation;
(function (Orientation) {
Orientation.horizontal = "horizontal";
Orientation.vertical = "vertical";
})(Orientation = exports.Orientation || (exports.Orientation = {}));
var DeviceOrientation;
(function (DeviceOrientation) {
DeviceOrientation.portrait = "portrait";
DeviceOrientation.landscape = "landscape";
DeviceOrientation.unknown = "unknown";
})(DeviceOrientation = exports.DeviceOrientation || (exports.DeviceOrientation = {}));
var HorizontalAlignment;
(function (HorizontalAlignment) {
HorizontalAlignment.left = "left";
HorizontalAlignment.center = "center";
HorizontalAlignment.right = "right";
HorizontalAlignment.stretch = "stretch";
})(HorizontalAlignment = exports.HorizontalAlignment || (exports.HorizontalAlignment = {}));
var VerticalAlignment;
(function (VerticalAlignment) {
VerticalAlignment.top = "top";
VerticalAlignment.middle = "middle";
VerticalAlignment.bottom = "bottom";
VerticalAlignment.stretch = "stretch";
})(VerticalAlignment = exports.VerticalAlignment || (exports.VerticalAlignment = {}));
var Stretch;
(function (Stretch) {
Stretch.none = "none";
Stretch.aspectFill = "aspectFill";
Stretch.aspectFit = "aspectFit";
Stretch.fill = "fill";
})(Stretch = exports.Stretch || (exports.Stretch = {}));
var Visibility;
(function (Visibility) {
Visibility.visible = "visible";
Visibility.collapse = "collapse";
Visibility.collapsed = "collapsed";
})(Visibility = exports.Visibility || (exports.Visibility = {}));
var FontAttributes;
(function (FontAttributes) {
FontAttributes.Normal = 0;
FontAttributes.Bold = 1;
FontAttributes.Italic = 1 << 1;
})(FontAttributes = exports.FontAttributes || (exports.FontAttributes = {}));
var DeviceType;
(function (DeviceType) {
DeviceType.Phone = "Phone";
DeviceType.Tablet = "Tablet";
})(DeviceType = exports.DeviceType || (exports.DeviceType = {}));
var UpdateTextTrigger;
(function (UpdateTextTrigger) {
UpdateTextTrigger.focusLost = "focusLost";
UpdateTextTrigger.textChanged = "textChanged";
})(UpdateTextTrigger = exports.UpdateTextTrigger || (exports.UpdateTextTrigger = {}));
var Accuracy;
(function (Accuracy) {
Accuracy.any = 300;
Accuracy.high = 3;
})(Accuracy = exports.Accuracy || (exports.Accuracy = {}));
var Dock;
(function (Dock) {
Dock.left = "left";
Dock.top = "top";
Dock.right = "right";
Dock.bottom = "bottom";
})(Dock = exports.Dock || (exports.Dock = {}));
var AutocapitalizationType;
(function (AutocapitalizationType) {
AutocapitalizationType.none = "none";
AutocapitalizationType.words = "words";
AutocapitalizationType.sentences = "sentences";
AutocapitalizationType.allCharacters = "allcharacters";
})(AutocapitalizationType = exports.AutocapitalizationType || (exports.AutocapitalizationType = {}));
var NavigationBarVisibility;
(function (NavigationBarVisibility) {
NavigationBarVisibility.auto = "auto";
NavigationBarVisibility.never = "never";
NavigationBarVisibility.always = "always";
})(NavigationBarVisibility = exports.NavigationBarVisibility || (exports.NavigationBarVisibility = {}));
var AndroidActionBarIconVisibility;
(function (AndroidActionBarIconVisibility) {
AndroidActionBarIconVisibility.auto = "auto";
AndroidActionBarIconVisibility.never = "never";
AndroidActionBarIconVisibility.always = "always";
})(AndroidActionBarIconVisibility = exports.AndroidActionBarIconVisibility || (exports.AndroidActionBarIconVisibility = {}));
var AndroidActionItemPosition;
(function (AndroidActionItemPosition) {
AndroidActionItemPosition.actionBar = "actionBar";
AndroidActionItemPosition.actionBarIfRoom = "actionBarIfRoom";
AndroidActionItemPosition.popup = "popup";
})(AndroidActionItemPosition = exports.AndroidActionItemPosition || (exports.AndroidActionItemPosition = {}));
var IOSActionItemPosition;
(function (IOSActionItemPosition) {
IOSActionItemPosition.left = "left";
IOSActionItemPosition.right = "right";
})(IOSActionItemPosition = exports.IOSActionItemPosition || (exports.IOSActionItemPosition = {}));
var ImageFormat;
(function (ImageFormat) {
ImageFormat.png = "png";
ImageFormat.jpeg = "jpeg";
ImageFormat.jpg = "jpg";
})(ImageFormat = exports.ImageFormat || (exports.ImageFormat = {}));
var FontStyle;
(function (FontStyle) {
FontStyle.normal = "normal";
FontStyle.italic = "italic";
})(FontStyle = exports.FontStyle || (exports.FontStyle = {}));
var FontWeight;
(function (FontWeight) {
FontWeight.thin = "100";
FontWeight.extraLight = "200";
FontWeight.light = "300";
FontWeight.normal = "normal";
FontWeight.medium = "500";
FontWeight.semiBold = "600";
FontWeight.bold = "bold";
FontWeight.extraBold = "800";
FontWeight.black = "900";
})(FontWeight = exports.FontWeight || (exports.FontWeight = {}));
var BackgroundRepeat;
(function (BackgroundRepeat) {
BackgroundRepeat.repeat = "repeat";
BackgroundRepeat.repeatX = "repeat-x";
BackgroundRepeat.repeatY = "repeat-y";
BackgroundRepeat.noRepeat = "no-repeat";
})(BackgroundRepeat = exports.BackgroundRepeat || (exports.BackgroundRepeat = {}));
var animationModule;
var AnimationCurve;
(function (AnimationCurve) {
AnimationCurve.ease = "ease";
AnimationCurve.easeIn = "easeIn";
AnimationCurve.easeOut = "easeOut";
AnimationCurve.easeInOut = "easeInOut";
AnimationCurve.linear = "linear";
AnimationCurve.spring = "spring";
function cubicBezier(x1, y1, x2, y2) {
animationModule = animationModule || __webpack_require__("../node_modules/tns-core-modules/ui/animation/animation.js");
return new animationModule.CubicBezierAnimationCurve(x1, y1, x2, y2);
}
AnimationCurve.cubicBezier = cubicBezier;
})(AnimationCurve = exports.AnimationCurve || (exports.AnimationCurve = {}));
var StatusBarStyle;
(function (StatusBarStyle) {
StatusBarStyle.light = "light";
StatusBarStyle.dark = "dark";
})(StatusBarStyle = exports.StatusBarStyle || (exports.StatusBarStyle = {}));
//# sourceMappingURL=enums.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/frame/activity.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
var frame_1 = __webpack_require__("../node_modules/tns-core-modules/ui/frame/frame.js");
var globals = __webpack_require__("../node_modules/tns-core-modules/globals/globals.js");
var appModule = __webpack_require__("../node_modules/tns-core-modules/application/application.js");
if (global.__snapshot || global.__snapshotEnabled) {
globals.install();
}
var NativeScriptActivity = (function (_super) {
__extends(NativeScriptActivity, _super);
function NativeScriptActivity() {
var _this = _super.call(this) || this;
return global.__native(_this);
}
NativeScriptActivity.prototype.onCreate = function (savedInstanceState) {
appModule.android.init(this.getApplication());
this.isNativeScriptActivity = true;
if (!this._callbacks) {
frame_1.setActivityCallbacks(this);
}
this._callbacks.onCreate(this, savedInstanceState, _super.prototype.onCreate);
};
NativeScriptActivity.prototype.onNewIntent = function (intent) {
_super.prototype.onNewIntent.call(this, intent);
_super.prototype.setIntent.call(this, intent);
};
NativeScriptActivity.prototype.onSaveInstanceState = function (outState) {
this._callbacks.onSaveInstanceState(this, outState, _super.prototype.onSaveInstanceState);
};
NativeScriptActivity.prototype.onStart = function () {
this._callbacks.onStart(this, _super.prototype.onStart);
};
NativeScriptActivity.prototype.onStop = function () {
this._callbacks.onStop(this, _super.prototype.onStop);
};
NativeScriptActivity.prototype.onDestroy = function () {
this._callbacks.onDestroy(this, _super.prototype.onDestroy);
};
NativeScriptActivity.prototype.onBackPressed = function () {
this._callbacks.onBackPressed(this, _super.prototype.onBackPressed);
};
NativeScriptActivity.prototype.onRequestPermissionsResult = function (requestCode, permissions, grantResults) {
this._callbacks.onRequestPermissionsResult(this, requestCode, permissions, grantResults, undefined);
};
NativeScriptActivity.prototype.onActivityResult = function (requestCode, resultCode, data) {
this._callbacks.onActivityResult(this, requestCode, resultCode, data, _super.prototype.onActivityResult);
};
NativeScriptActivity = __decorate([
JavaProxy("com.tns.NativeScriptActivity")
], NativeScriptActivity);
return NativeScriptActivity;
}(android.support.v7.app.AppCompatActivity));
//# sourceMappingURL=activity.android.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/frame/fragment.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
var frame_1 = __webpack_require__("../node_modules/tns-core-modules/ui/frame/frame.js");
var FragmentClass = (function (_super) {
__extends(FragmentClass, _super);
function FragmentClass() {
var _this = _super.call(this) || this;
return global.__native(_this);
}
FragmentClass.prototype.onHiddenChanged = function (hidden) {
this._callbacks.onHiddenChanged(this, hidden, _super.prototype.onHiddenChanged);
};
FragmentClass.prototype.onCreateAnimator = function (transit, enter, nextAnim) {
var result = this._callbacks.onCreateAnimator(this, transit, enter, nextAnim, _super.prototype.onCreateAnimator);
return result;
};
FragmentClass.prototype.onStop = function () {
this._callbacks.onStop(this, _super.prototype.onStop);
};
FragmentClass.prototype.onCreate = function (savedInstanceState) {
if (!this._callbacks) {
frame_1.setFragmentCallbacks(this);
}
this.setHasOptionsMenu(true);
this._callbacks.onCreate(this, savedInstanceState, _super.prototype.onCreate);
};
FragmentClass.prototype.onCreateView = function (inflater, container, savedInstanceState) {
var result = this._callbacks.onCreateView(this, inflater, container, savedInstanceState, _super.prototype.onCreateView);
return result;
};
FragmentClass.prototype.onSaveInstanceState = function (outState) {
this._callbacks.onSaveInstanceState(this, outState, _super.prototype.onSaveInstanceState);
};
FragmentClass.prototype.onDestroyView = function () {
this._callbacks.onDestroyView(this, _super.prototype.onDestroyView);
};
FragmentClass.prototype.onDestroy = function () {
this._callbacks.onDestroy(this, _super.prototype.onDestroy);
};
FragmentClass.prototype.toString = function () {
var callbacks = this._callbacks;
if (callbacks) {
return callbacks.toStringOverride(this, _super.prototype.toString);
}
else {
_super.prototype.toString.call(this);
}
};
FragmentClass = __decorate([
JavaProxy("com.tns.FragmentClass")
], FragmentClass);
return FragmentClass;
}(android.support.v4.app.Fragment));
frame_1.setFragmentClass(FragmentClass);
//# sourceMappingURL=fragment.android.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/frame/fragment.transitions.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
var transition_1 = __webpack_require__("../node_modules/tns-core-modules/ui/transition/transition.js");
var slide_transition_1 = __webpack_require__("../node_modules/tns-core-modules/ui/transition/slide-transition.js");
var fade_transition_1 = __webpack_require__("../node_modules/tns-core-modules/ui/transition/fade-transition.js");
var flip_transition_1 = __webpack_require__("../node_modules/tns-core-modules/ui/transition/flip-transition.js");
var animation_1 = __webpack_require__("../node_modules/tns-core-modules/ui/animation/animation.js");
var platform_1 = __webpack_require__("../node_modules/tns-core-modules/platform/platform.js");
var lazy_1 = __webpack_require__("../node_modules/tns-core-modules/utils/lazy.js");
var trace_1 = __webpack_require__("../node_modules/tns-core-modules/trace/trace.js");
var sdkVersion = lazy_1.default(function () { return parseInt(platform_1.device.sdkVersion); });
var intEvaluator = lazy_1.default(function () { return new android.animation.IntEvaluator(); });
var defaultInterpolator = lazy_1.default(function () { return new android.view.animation.AccelerateDecelerateInterpolator(); });
exports.waitingQueue = new Map();
exports.completedEntries = new Map();
var TransitionListener;
var AnimationListener;
function _setAndroidFragmentTransitions(animated, navigationTransition, currentEntry, newEntry, fragmentTransaction, frameId) {
var currentFragment = currentEntry ? currentEntry.fragment : null;
var newFragment = newEntry.fragment;
var entries = exports.waitingQueue.get(frameId);
if (entries && entries.size > 0) {
throw new Error("Calling navigation before previous navigation finish.");
}
if (sdkVersion() >= 21) {
allowTransitionOverlap(currentFragment);
allowTransitionOverlap(newFragment);
}
var name = "";
var transition;
if (navigationTransition) {
transition = navigationTransition.instance;
name = navigationTransition.name ? navigationTransition.name.toLowerCase() : "";
}
var useLollipopTransition = name && (name.indexOf("slide") === 0 || name === "fade" || name === "explode") && sdkVersion() >= 21;
if (!animated) {
name = "none";
}
else if (transition) {
name = "custom";
useLollipopTransition = false;
}
else if (!useLollipopTransition && name.indexOf("slide") !== 0 && name !== "fade" && name.indexOf("flip") !== 0) {
name = "default";
}
var currentFragmentNeedsDifferentAnimation = false;
if (currentEntry) {
_updateTransitions(currentEntry);
if (currentEntry.transitionName !== name
|| currentEntry.transition !== transition) {
clearExitAndReenterTransitions(currentEntry, true);
currentFragmentNeedsDifferentAnimation = true;
}
}
if (name === "none") {
transition = new NoTransition(0, null);
}
else if (name === "default") {
transition = new fade_transition_1.FadeTransition(150, null);
}
else if (useLollipopTransition) {
if (name.indexOf("slide") === 0) {
setupNewFragmentSlideTransition(navigationTransition, newEntry, name);
if (currentFragmentNeedsDifferentAnimation) {
setupCurrentFragmentSlideTransition(navigationTransition, currentEntry, name);
}
}
else if (name === "fade") {
setupNewFragmentFadeTransition(navigationTransition, newEntry);
if (currentFragmentNeedsDifferentAnimation) {
setupCurrentFragmentFadeTransition(navigationTransition, currentEntry);
}
}
else if (name === "explode") {
setupNewFragmentExplodeTransition(navigationTransition, newEntry);
if (currentFragmentNeedsDifferentAnimation) {
setupCurrentFragmentExplodeTransition(navigationTransition, currentEntry);
}
}
}
else if (name.indexOf("slide") === 0) {
var direction = name.substr("slide".length) || "left";
transition = new slide_transition_1.SlideTransition(direction, navigationTransition.duration, navigationTransition.curve);
}
else if (name === "fade") {
transition = new fade_transition_1.FadeTransition(navigationTransition.duration, navigationTransition.curve);
}
else if (name.indexOf("flip") === 0) {
var direction = name.substr("flip".length) || "right";
transition = new flip_transition_1.FlipTransition(direction, navigationTransition.duration, navigationTransition.curve);
}
newEntry.transitionName = name;
if (name === "custom") {
newEntry.transition = transition;
}
if (transition) {
fragmentTransaction.setCustomAnimations(-10, -20);
setupAllAnimation(newEntry, transition);
if (currentFragmentNeedsDifferentAnimation) {
setupExitAndPopEnterAnimation(currentEntry, transition);
}
}
if (currentEntry) {
currentEntry.transitionName = name;
if (name === "custom") {
currentEntry.transition = transition;
}
}
setupDefaultAnimations(newEntry, new fade_transition_1.FadeTransition(150, null));
printTransitions(currentEntry);
printTransitions(newEntry);
}
exports._setAndroidFragmentTransitions = _setAndroidFragmentTransitions;
function _onFragmentCreateAnimator(entry, fragment, nextAnim, enter) {
var animator;
switch (nextAnim) {
case -10:
animator = entry.enterAnimator;
break;
case -20:
animator = entry.exitAnimator;
break;
case -30:
animator = entry.popEnterAnimator;
break;
case -40:
animator = entry.popExitAnimator;
break;
}
if (!animator && sdkVersion() >= 21) {
var view = fragment.getView();
var jsParent = entry.resolvedPage.parent;
var parent_1 = view.getParent() || (jsParent && jsParent.nativeViewProtected);
var animatedEntries = _getAnimatedEntries(entry.frameId);
if (!animatedEntries || !animatedEntries.has(entry)) {
if (parent_1 && !parent_1.isLaidOut()) {
animator = enter ? entry.defaultEnterAnimator : entry.defaultExitAnimator;
}
}
}
return animator;
}
exports._onFragmentCreateAnimator = _onFragmentCreateAnimator;
function _getAnimatedEntries(frameId) {
return exports.waitingQueue.get(frameId);
}
exports._getAnimatedEntries = _getAnimatedEntries;
function _updateTransitions(entry) {
var fragment = entry.fragment;
var enterTransitionListener = entry.enterTransitionListener;
if (enterTransitionListener) {
fragment.setEnterTransition(enterTransitionListener.transition);
}
var exitTransitionListener = entry.exitTransitionListener;
if (exitTransitionListener) {
fragment.setExitTransition(exitTransitionListener.transition);
}
var reenterTransitionListener = entry.reenterTransitionListener;
if (reenterTransitionListener) {
fragment.setReenterTransition(reenterTransitionListener.transition);
}
var returnTransitionListener = entry.returnTransitionListener;
if (returnTransitionListener) {
fragment.setReturnTransition(returnTransitionListener.transition);
}
}
exports._updateTransitions = _updateTransitions;
function _reverseTransitions(previousEntry, currentEntry) {
var previousFragment = previousEntry.fragment;
var currentFragment = currentEntry.fragment;
var transitionUsed = false;
if (sdkVersion() >= 21) {
var returnTransitionListener = currentEntry.returnTransitionListener;
if (returnTransitionListener) {
transitionUsed = true;
currentFragment.setExitTransition(returnTransitionListener.transition);
}
else {
currentFragment.setExitTransition(null);
}
var reenterTransitionListener = previousEntry.reenterTransitionListener;
if (reenterTransitionListener) {
transitionUsed = true;
previousFragment.setEnterTransition(reenterTransitionListener.transition);
}
else {
previousFragment.setEnterTransition(null);
}
}
return transitionUsed;
}
exports._reverseTransitions = _reverseTransitions;
function getTransitionListener(entry, transition) {
if (!TransitionListener) {
var TransitionListenerImpl = (function (_super) {
__extends(TransitionListenerImpl, _super);
function TransitionListenerImpl(entry, transition) {
var _this = _super.call(this) || this;
_this.entry = entry;
_this.transition = transition;
return global.__native(_this);
}
TransitionListenerImpl.prototype.onTransitionStart = function (transition) {
var entry = this.entry;
addToWaitingQueue(entry);
if (trace_1.isEnabled()) {
trace_1.write("START " + toShortString(transition) + " transition for " + entry.fragmentTag, trace_1.categories.Transition);
}
};
TransitionListenerImpl.prototype.onTransitionEnd = function (transition) {
var entry = this.entry;
if (trace_1.isEnabled()) {
trace_1.write("END " + toShortString(transition) + " transition for " + entry.fragmentTag, trace_1.categories.Transition);
}
transitionOrAnimationCompleted(entry);
};
TransitionListenerImpl.prototype.onTransitionResume = function (transition) {
if (trace_1.isEnabled()) {
var fragment = this.entry.fragmentTag;
trace_1.write("RESUME " + toShortString(transition) + " transition for " + fragment, trace_1.categories.Transition);
}
};
TransitionListenerImpl.prototype.onTransitionPause = function (transition) {
if (trace_1.isEnabled()) {
trace_1.write("PAUSE " + toShortString(transition) + " transition for " + this.entry.fragmentTag, trace_1.categories.Transition);
}
};
TransitionListenerImpl.prototype.onTransitionCancel = function (transition) {
if (trace_1.isEnabled()) {
trace_1.write("CANCEL " + toShortString(transition) + " transition for " + this.entry.fragmentTag, trace_1.categories.Transition);
}
};
TransitionListenerImpl = __decorate([
Interfaces([android.transition.Transition.TransitionListener])
], TransitionListenerImpl);
return TransitionListenerImpl;
}(java.lang.Object));
TransitionListener = TransitionListenerImpl;
}
return new TransitionListener(entry, transition);
}
function getAnimationListener() {
if (!AnimationListener) {
var AnimationListenerImpl = (function (_super) {
__extends(AnimationListenerImpl, _super);
function AnimationListenerImpl() {
var _this = _super.call(this) || this;
return global.__native(_this);
}
AnimationListenerImpl.prototype.onAnimationStart = function (animator) {
var entry = animator.entry;
addToWaitingQueue(entry);
if (trace_1.isEnabled()) {
trace_1.write("START " + animator.transitionType + " for " + entry.fragmentTag, trace_1.categories.Transition);
}
};
AnimationListenerImpl.prototype.onAnimationRepeat = function (animator) {
if (trace_1.isEnabled()) {
trace_1.write("REPEAT " + animator.transitionType + " for " + animator.entry.fragmentTag, trace_1.categories.Transition);
}
};
AnimationListenerImpl.prototype.onAnimationEnd = function (animator) {
if (trace_1.isEnabled()) {
trace_1.write("END " + animator.transitionType + " for " + animator.entry.fragmentTag, trace_1.categories.Transition);
}
transitionOrAnimationCompleted(animator.entry);
};
AnimationListenerImpl.prototype.onAnimationCancel = function (animator) {
if (trace_1.isEnabled()) {
trace_1.write("CANCEL " + animator.transitionType + " for " + animator.entry.fragmentTag, trace_1.categories.Transition);
}
};
AnimationListenerImpl = __decorate([
Interfaces([android.animation.Animator.AnimatorListener])
], AnimationListenerImpl);
return AnimationListenerImpl;
}(java.lang.Object));
AnimationListener = new AnimationListenerImpl();
}
return AnimationListener;
}
function addToWaitingQueue(entry) {
var frameId = entry.frameId;
var entries = exports.waitingQueue.get(frameId);
if (!entries) {
entries = new Set();
exports.waitingQueue.set(frameId, entries);
}
entries.add(entry);
}
function clearAnimationListener(animator, listener) {
if (!animator) {
return;
}
animator.removeListener(listener);
if (animator.entry && trace_1.isEnabled()) {
var entry = animator.entry;
trace_1.write("Clear " + animator.transitionType + " - " + entry.transition + " for " + entry.fragmentTag, trace_1.categories.Transition);
}
animator.entry = null;
}
function clearExitAndReenterTransitions(entry, removeListener) {
if (sdkVersion() >= 21) {
var fragment = entry.fragment;
var exitListener = entry.exitTransitionListener;
if (exitListener) {
var exitTransition = fragment.getExitTransition();
if (exitTransition) {
if (removeListener) {
exitTransition.removeListener(exitListener);
}
fragment.setExitTransition(null);
if (trace_1.isEnabled()) {
trace_1.write("Cleared Exit " + exitTransition.getClass().getSimpleName() + " transition for " + fragment, trace_1.categories.Transition);
}
}
if (removeListener) {
entry.exitTransitionListener = null;
}
}
var reenterListener = entry.reenterTransitionListener;
if (reenterListener) {
var reenterTransition = fragment.getReenterTransition();
if (reenterTransition) {
if (removeListener) {
reenterTransition.removeListener(reenterListener);
}
fragment.setReenterTransition(null);
if (trace_1.isEnabled()) {
trace_1.write("Cleared Reenter " + reenterTransition.getClass().getSimpleName() + " transition for " + fragment, trace_1.categories.Transition);
}
}
if (removeListener) {
entry.reenterTransitionListener = null;
}
}
}
}
function _clearFragment(entry) {
clearEntry(entry, false);
}
exports._clearFragment = _clearFragment;
function _clearEntry(entry) {
clearEntry(entry, true);
}
exports._clearEntry = _clearEntry;
function clearEntry(entry, removeListener) {
clearExitAndReenterTransitions(entry, removeListener);
if (sdkVersion() >= 21) {
var fragment = entry.fragment;
var enterListener = entry.enterTransitionListener;
if (enterListener) {
var enterTransition = fragment.getEnterTransition();
if (enterTransition) {
if (removeListener) {
enterTransition.removeListener(enterListener);
}
fragment.setEnterTransition(null);
if (trace_1.isEnabled()) {
trace_1.write("Cleared Enter " + enterTransition.getClass().getSimpleName() + " transition for " + fragment, trace_1.categories.Transition);
}
}
if (removeListener) {
entry.enterTransitionListener = null;
}
}
var returnListener = entry.returnTransitionListener;
if (returnListener) {
var returnTransition = fragment.getReturnTransition();
if (returnTransition) {
if (removeListener) {
returnTransition.removeListener(returnListener);
}
fragment.setReturnTransition(null);
if (trace_1.isEnabled()) {
trace_1.write("Cleared Return " + returnTransition.getClass().getSimpleName() + " transition for " + fragment, trace_1.categories.Transition);
}
}
if (removeListener) {
entry.returnTransitionListener = null;
}
}
}
if (removeListener) {
var listener = getAnimationListener();
clearAnimationListener(entry.enterAnimator, listener);
clearAnimationListener(entry.exitAnimator, listener);
clearAnimationListener(entry.popEnterAnimator, listener);
clearAnimationListener(entry.popExitAnimator, listener);
}
}
function allowTransitionOverlap(fragment) {
if (fragment) {
fragment.setAllowEnterTransitionOverlap(true);
fragment.setAllowReturnTransitionOverlap(true);
}
}
function setEnterTransition(navigationTransition, entry, transition) {
setUpNativeTransition(navigationTransition, transition);
var listener = addNativeTransitionListener(entry, transition);
entry.enterTransitionListener = listener;
var fragment = entry.fragment;
fragment.setEnterTransition(transition);
}
function setExitTransition(navigationTransition, entry, transition) {
setUpNativeTransition(navigationTransition, transition);
var listener = addNativeTransitionListener(entry, transition);
entry.exitTransitionListener = listener;
var fragment = entry.fragment;
fragment.setExitTransition(transition);
}
function setReenterTransition(navigationTransition, entry, transition) {
setUpNativeTransition(navigationTransition, transition);
var listener = addNativeTransitionListener(entry, transition);
entry.reenterTransitionListener = listener;
var fragment = entry.fragment;
fragment.setReenterTransition(transition);
}
function setReturnTransition(navigationTransition, entry, transition) {
setUpNativeTransition(navigationTransition, transition);
var listener = addNativeTransitionListener(entry, transition);
entry.returnTransitionListener = listener;
var fragment = entry.fragment;
fragment.setReturnTransition(transition);
}
function setupNewFragmentSlideTransition(navTransition, entry, name) {
setupCurrentFragmentSlideTransition(navTransition, entry, name);
var direction = name.substr("slide".length) || "left";
switch (direction) {
case "left":
setEnterTransition(navTransition, entry, new android.transition.Slide(android.view.Gravity.RIGHT));
setReturnTransition(navTransition, entry, new android.transition.Slide(android.view.Gravity.RIGHT));
break;
case "right":
setEnterTransition(navTransition, entry, new android.transition.Slide(android.view.Gravity.LEFT));
setReturnTransition(navTransition, entry, new android.transition.Slide(android.view.Gravity.LEFT));
break;
case "top":
setEnterTransition(navTransition, entry, new android.transition.Slide(android.view.Gravity.BOTTOM));
setReturnTransition(navTransition, entry, new android.transition.Slide(android.view.Gravity.BOTTOM));
break;
case "bottom":
setEnterTransition(navTransition, entry, new android.transition.Slide(android.view.Gravity.TOP));
setReturnTransition(navTransition, entry, new android.transition.Slide(android.view.Gravity.TOP));
break;
}
}
function setupCurrentFragmentSlideTransition(navTransition, entry, name) {
var direction = name.substr("slide".length) || "left";
switch (direction) {
case "left":
setExitTransition(navTransition, entry, new android.transition.Slide(android.view.Gravity.LEFT));
setReenterTransition(navTransition, entry, new android.transition.Slide(android.view.Gravity.LEFT));
break;
case "right":
setExitTransition(navTransition, entry, new android.transition.Slide(android.view.Gravity.RIGHT));
setReenterTransition(navTransition, entry, new android.transition.Slide(android.view.Gravity.RIGHT));
break;
case "top":
setExitTransition(navTransition, entry, new android.transition.Slide(android.view.Gravity.TOP));
setReenterTransition(navTransition, entry, new android.transition.Slide(android.view.Gravity.TOP));
break;
case "bottom":
setExitTransition(navTransition, entry, new android.transition.Slide(android.view.Gravity.BOTTOM));
setReenterTransition(navTransition, entry, new android.transition.Slide(android.view.Gravity.BOTTOM));
break;
}
}
function setupNewFragmentFadeTransition(navTransition, entry) {
setupCurrentFragmentFadeTransition(navTransition, entry);
var fadeInEnter = new android.transition.Fade(android.transition.Fade.IN);
setEnterTransition(navTransition, entry, fadeInEnter);
var fadeOutReturn = new android.transition.Fade(android.transition.Fade.OUT);
setReturnTransition(navTransition, entry, fadeOutReturn);
}
function setupCurrentFragmentFadeTransition(navTransition, entry) {
var fadeOutExit = new android.transition.Fade(android.transition.Fade.OUT);
setExitTransition(navTransition, entry, fadeOutExit);
var fadeInReenter = new android.transition.Fade(android.transition.Fade.IN);
setReenterTransition(navTransition, entry, fadeInReenter);
}
function setupCurrentFragmentExplodeTransition(navTransition, entry) {
setExitTransition(navTransition, entry, new android.transition.Explode());
setReenterTransition(navTransition, entry, new android.transition.Explode());
}
function setupNewFragmentExplodeTransition(navTransition, entry) {
setupCurrentFragmentExplodeTransition(navTransition, entry);
setEnterTransition(navTransition, entry, new android.transition.Explode());
setReturnTransition(navTransition, entry, new android.transition.Explode());
}
function setupExitAndPopEnterAnimation(entry, transition) {
var listener = getAnimationListener();
clearAnimationListener(entry.exitAnimator, listener);
clearAnimationListener(entry.popEnterAnimator, listener);
var exitAnimator = transition.createAndroidAnimator(transition_1.AndroidTransitionType.exit);
exitAnimator.transitionType = transition_1.AndroidTransitionType.exit;
exitAnimator.entry = entry;
exitAnimator.addListener(listener);
entry.exitAnimator = exitAnimator;
var popEnterAnimator = transition.createAndroidAnimator(transition_1.AndroidTransitionType.popEnter);
popEnterAnimator.transitionType = transition_1.AndroidTransitionType.popEnter;
popEnterAnimator.entry = entry;
popEnterAnimator.addListener(listener);
entry.popEnterAnimator = popEnterAnimator;
}
function setupAllAnimation(entry, transition) {
setupExitAndPopEnterAnimation(entry, transition);
var listener = getAnimationListener();
var enterAnimator = transition.createAndroidAnimator(transition_1.AndroidTransitionType.enter);
enterAnimator.transitionType = transition_1.AndroidTransitionType.enter;
enterAnimator.entry = entry;
enterAnimator.addListener(listener);
entry.enterAnimator = enterAnimator;
var popExitAnimator = transition.createAndroidAnimator(transition_1.AndroidTransitionType.popExit);
popExitAnimator.transitionType = transition_1.AndroidTransitionType.popExit;
popExitAnimator.entry = entry;
popExitAnimator.addListener(listener);
entry.popExitAnimator = popExitAnimator;
}
function setupDefaultAnimations(entry, transition) {
var listener = getAnimationListener();
var enterAnimator = transition.createAndroidAnimator(transition_1.AndroidTransitionType.enter);
enterAnimator.transitionType = transition_1.AndroidTransitionType.enter;
enterAnimator.entry = entry;
enterAnimator.addListener(listener);
entry.defaultEnterAnimator = enterAnimator;
var exitAnimator = transition.createAndroidAnimator(transition_1.AndroidTransitionType.exit);
exitAnimator.transitionType = transition_1.AndroidTransitionType.exit;
exitAnimator.entry = entry;
exitAnimator.addListener(listener);
entry.defaultExitAnimator = exitAnimator;
}
function setUpNativeTransition(navigationTransition, nativeTransition) {
if (navigationTransition.duration) {
nativeTransition.setDuration(navigationTransition.duration);
}
var interpolator = navigationTransition.curve ? animation_1._resolveAnimationCurve(navigationTransition.curve) : defaultInterpolator();
nativeTransition.setInterpolator(interpolator);
}
function addNativeTransitionListener(entry, nativeTransition) {
var listener = getTransitionListener(entry, nativeTransition);
nativeTransition.addListener(listener);
return listener;
}
function transitionOrAnimationCompleted(entry) {
var frameId = entry.frameId;
var entries = exports.waitingQueue.get(frameId);
if (!entries) {
return;
}
entries.delete(entry);
if (entries.size === 0) {
var frame_1 = entry.resolvedPage.frame;
var previousCompletedAnimationEntry = exports.completedEntries.get(frameId);
exports.completedEntries.delete(frameId);
exports.waitingQueue.delete(frameId);
var current_1 = frame_1.isCurrent(entry) ? previousCompletedAnimationEntry : entry;
current_1 = current_1 || entry;
if (current_1) {
var isBack_1 = frame_1._isBack;
setTimeout(function () { return frame_1.setCurrent(current_1, isBack_1); });
}
}
else {
exports.completedEntries.set(frameId, entry);
}
}
function toShortString(nativeTransition) {
return nativeTransition.getClass().getSimpleName() + "@" + nativeTransition.hashCode().toString(16);
}
function printTransitions(entry) {
if (entry && trace_1.isEnabled()) {
var result = entry.fragmentTag + " Transitions:";
if (entry.transitionName) {
result += "transitionName=" + entry.transitionName + ", ";
}
if (entry.transition) {
result += "enterAnimator=" + entry.enterAnimator + ", ";
result += "exitAnimator=" + entry.exitAnimator + ", ";
result += "popEnterAnimator=" + entry.popEnterAnimator + ", ";
result += "popExitAnimator=" + entry.popExitAnimator + ", ";
}
if (sdkVersion() >= 21) {
var fragment = entry.fragment;
result += "" + (fragment.getEnterTransition() ? " enter=" + toShortString(fragment.getEnterTransition()) : "");
result += "" + (fragment.getExitTransition() ? " exit=" + toShortString(fragment.getExitTransition()) : "");
result += "" + (fragment.getReenterTransition() ? " popEnter=" + toShortString(fragment.getReenterTransition()) : "");
result += "" + (fragment.getReturnTransition() ? " popExit=" + toShortString(fragment.getReturnTransition()) : "");
}
trace_1.write(result, trace_1.categories.Transition);
}
}
function javaObjectArray() {
var params = [];
for (var _i = 0; _i < arguments.length; _i++) {
params[_i] = arguments[_i];
}
var nativeArray = Array.create(java.lang.Object, params.length);
params.forEach(function (value, i) { return nativeArray[i] = value; });
return nativeArray;
}
function createDummyZeroDurationAnimator() {
var animator = android.animation.ValueAnimator.ofObject(intEvaluator(), javaObjectArray(java.lang.Integer.valueOf(0), java.lang.Integer.valueOf(1)));
animator.setDuration(0);
return animator;
}
var NoTransition = (function (_super) {
__extends(NoTransition, _super);
function NoTransition() {
return _super !== null && _super.apply(this, arguments) || this;
}
NoTransition.prototype.createAndroidAnimator = function (transitionType) {
return createDummyZeroDurationAnimator();
};
return NoTransition;
}(transition_1.Transition));
//# sourceMappingURL=fragment.transitions.android.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/frame/frame-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var view_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view-common.js");
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
var builder_1 = __webpack_require__("../node_modules/tns-core-modules/ui/builder/builder.js");
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
var frame_stack_1 = __webpack_require__("../node_modules/tns-core-modules/ui/frame/frame-stack.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js"));
function buildEntryFromArgs(arg) {
var entry;
if (typeof arg === "string") {
entry = {
moduleName: arg
};
}
else if (typeof arg === "function") {
entry = {
create: arg
};
}
else {
entry = arg;
}
return entry;
}
var FrameBase = (function (_super) {
__extends(FrameBase, _super);
function FrameBase() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._backStack = new Array();
_this._navigationQueue = new Array();
_this._isInFrameStack = false;
return _this;
}
FrameBase_1 = FrameBase;
FrameBase.prototype._addChildFromBuilder = function (name, value) {
throw new Error("Frame should not have a view. Use 'defaultPage' property instead.");
};
FrameBase.prototype.onLoaded = function () {
_super.prototype.onLoaded.call(this);
this._processNextNavigationEntry();
};
FrameBase.prototype.canGoBack = function () {
var _this = this;
var backstack = this._backStack.length;
var previousForwardNotInBackstack = false;
this._navigationQueue.forEach(function (item) {
var entry = item.entry;
if (item.isBackNavigation) {
previousForwardNotInBackstack = false;
if (!entry) {
backstack--;
}
else {
var backstackIndex = _this._backStack.indexOf(entry);
if (backstackIndex !== -1) {
backstack = backstackIndex;
}
else {
backstack--;
}
}
}
else if (entry.entry.clearHistory) {
previousForwardNotInBackstack = false;
backstack = 0;
}
else {
backstack++;
if (previousForwardNotInBackstack) {
backstack--;
}
previousForwardNotInBackstack = entry.entry.backstackVisible === false;
}
});
if (this._navigationQueue.length > 0 && !this._currentEntry) {
backstack--;
}
return backstack > 0;
};
FrameBase.prototype.goBack = function (backstackEntry) {
if (view_1.traceEnabled()) {
view_1.traceWrite("GO BACK", view_1.traceCategories.Navigation);
}
if (!this.canGoBack()) {
return;
}
if (backstackEntry) {
var index_1 = this._backStack.indexOf(backstackEntry);
if (index_1 < 0) {
return;
}
}
var navigationContext = {
entry: backstackEntry,
isBackNavigation: true
};
this._navigationQueue.push(navigationContext);
this._processNextNavigationEntry();
};
FrameBase.prototype._removeEntry = function (removed) {
var page = removed.resolvedPage;
var frame = page.frame;
page._frame = null;
if (frame) {
frame._removeView(page);
}
else {
page._tearDownUI(true);
}
};
FrameBase.prototype.navigate = function (param) {
if (view_1.traceEnabled()) {
view_1.traceWrite("NAVIGATE", view_1.traceCategories.Navigation);
}
var entry = buildEntryFromArgs(param);
var page = builder_1.createViewFromEntry(entry);
this._pushInFrameStack();
var backstackEntry = {
entry: entry,
resolvedPage: page,
navDepth: undefined,
fragmentTag: undefined
};
var navigationContext = {
entry: backstackEntry,
isBackNavigation: false
};
this._navigationQueue.push(navigationContext);
this._processNextNavigationEntry();
};
FrameBase.prototype.isCurrent = function (entry) {
return this._currentEntry === entry;
};
FrameBase.prototype.setCurrent = function (entry, isBack) {
var newPage = entry.resolvedPage;
if (!newPage.frame) {
this._addView(newPage);
newPage._frame = this;
}
this._currentEntry = entry;
if (isBack) {
this._pushInFrameStack();
}
newPage.onNavigatedTo(isBack);
this._executingEntry = null;
};
FrameBase.prototype._updateBackstack = function (entry, isBack) {
var _this = this;
this.raiseCurrentPageNavigatedEvents(isBack);
var current = this._currentEntry;
if (isBack) {
var index_2 = this._backStack.indexOf(entry);
this._backStack.splice(index_2 + 1).forEach(function (e) { return _this._removeEntry(e); });
this._backStack.pop();
}
else {
if (entry.entry.clearHistory) {
this._backStack.forEach(function (e) { return _this._removeEntry(e); });
this._backStack.length = 0;
}
else if (FrameBase_1._isEntryBackstackVisible(current)) {
this._backStack.push(current);
}
}
if (current && this._backStack.indexOf(current) < 0) {
this._removeEntry(current);
}
};
FrameBase.prototype.isNestedWithin = function (parentFrameCandidate) {
var frameAncestor = this;
while (frameAncestor) {
frameAncestor = view_common_1.getAncestor(frameAncestor, FrameBase_1);
if (frameAncestor === parentFrameCandidate) {
return true;
}
}
return false;
};
FrameBase.prototype.raiseCurrentPageNavigatedEvents = function (isBack) {
var page = this.currentPage;
if (page) {
if (page.isLoaded) {
page.callUnloaded();
}
page.onNavigatedFrom(isBack);
}
};
FrameBase.prototype._processNavigationQueue = function (page) {
if (this._navigationQueue.length === 0) {
return;
}
var entry = this._navigationQueue[0].entry;
var currentNavigationPage = entry.resolvedPage;
if (page !== currentNavigationPage) {
return;
}
this._navigationQueue.shift();
this._processNextNavigationEntry();
this._updateActionBar();
};
FrameBase.prototype._findEntryForTag = function (fragmentTag) {
var entry;
if (this._currentEntry && this._currentEntry.fragmentTag === fragmentTag) {
entry = this._currentEntry;
}
else {
entry = this._backStack.find(function (value) { return value.fragmentTag === fragmentTag; });
if (!entry) {
var navigationItem = this._navigationQueue.find(function (value) { return value.entry.fragmentTag === fragmentTag; });
entry = navigationItem ? navigationItem.entry : undefined;
}
}
return entry;
};
FrameBase.prototype.navigationQueueIsEmpty = function () {
return this._navigationQueue.length === 0;
};
FrameBase._isEntryBackstackVisible = function (entry) {
if (!entry) {
return false;
}
var backstackVisibleValue = entry.entry.backstackVisible;
var backstackHidden = backstackVisibleValue !== undefined && !backstackVisibleValue;
return !backstackHidden;
};
FrameBase.prototype._updateActionBar = function (page, disableNavBarAnimation) {
};
FrameBase.prototype._processNextNavigationEntry = function () {
if (!this.isLoaded || this._executingEntry) {
return;
}
if (this._navigationQueue.length > 0) {
var navigationContext = this._navigationQueue[0];
if (navigationContext.isBackNavigation) {
this.performGoBack(navigationContext);
}
else {
this.performNavigation(navigationContext);
}
}
};
FrameBase.prototype.performNavigation = function (navigationContext) {
var navContext = navigationContext.entry;
this._executingEntry = navContext;
this._onNavigatingTo(navContext, navigationContext.isBackNavigation);
this._navigateCore(navContext);
};
FrameBase.prototype.performGoBack = function (navigationContext) {
var backstackEntry = navigationContext.entry;
var backstack = this._backStack;
if (!backstackEntry) {
backstackEntry = backstack[backstack.length - 1];
navigationContext.entry = backstackEntry;
}
this._executingEntry = backstackEntry;
this._onNavigatingTo(backstackEntry, true);
this._goBackCore(backstackEntry);
};
FrameBase.prototype._goBackCore = function (backstackEntry) {
if (view_1.traceEnabled()) {
view_1.traceWrite("GO BACK CORE(" + this._backstackEntryTrace(backstackEntry) + "); currentPage: " + this.currentPage, view_1.traceCategories.Navigation);
}
};
FrameBase.prototype._navigateCore = function (backstackEntry) {
if (view_1.traceEnabled()) {
view_1.traceWrite("NAVIGATE CORE(" + this._backstackEntryTrace(backstackEntry) + "); currentPage: " + this.currentPage, view_1.traceCategories.Navigation);
}
};
FrameBase.prototype._onNavigatingTo = function (backstackEntry, isBack) {
if (this.currentPage) {
this.currentPage.onNavigatingFrom(isBack);
}
backstackEntry.resolvedPage.onNavigatingTo(backstackEntry.entry.context, isBack, backstackEntry.entry.bindingContext);
};
Object.defineProperty(FrameBase.prototype, "animated", {
get: function () {
return this._animated;
},
set: function (value) {
this._animated = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FrameBase.prototype, "transition", {
get: function () {
return this._transition;
},
set: function (value) {
this._transition = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FrameBase.prototype, "backStack", {
get: function () {
return this._backStack.slice();
},
enumerable: true,
configurable: true
});
Object.defineProperty(FrameBase.prototype, "currentPage", {
get: function () {
if (this._currentEntry) {
return this._currentEntry.resolvedPage;
}
return null;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FrameBase.prototype, "currentEntry", {
get: function () {
if (this._currentEntry) {
return this._currentEntry.entry;
}
return null;
},
enumerable: true,
configurable: true
});
FrameBase.prototype._pushInFrameStackRecursive = function () {
this._pushInFrameStack();
var framesToPush = [];
for (var _i = 0, frameStack_1 = frame_stack_1.frameStack; _i < frameStack_1.length; _i++) {
var frame = frameStack_1[_i];
if (frame.isNestedWithin(this)) {
framesToPush.push(frame);
}
}
for (var _a = 0, framesToPush_1 = framesToPush; _a < framesToPush_1.length; _a++) {
var frame = framesToPush_1[_a];
frame._pushInFrameStack();
}
};
FrameBase.prototype._pushInFrameStack = function () {
frame_stack_1._pushInFrameStack(this);
};
FrameBase.prototype._popFromFrameStack = function () {
frame_stack_1._popFromFrameStack(this);
};
FrameBase.prototype._removeFromFrameStack = function () {
frame_stack_1._removeFromFrameStack(this);
};
FrameBase.prototype._dialogClosed = function () {
this._removeFromFrameStack();
};
FrameBase.prototype._onRootViewReset = function () {
this._removeFromFrameStack();
_super.prototype._onRootViewReset.call(this);
};
Object.defineProperty(FrameBase.prototype, "_childrenCount", {
get: function () {
if (this.currentPage) {
return 1;
}
return 0;
},
enumerable: true,
configurable: true
});
FrameBase.prototype.eachChildView = function (callback) {
var page = this.currentPage;
if (page) {
callback(page);
}
};
FrameBase.prototype._getIsAnimatedNavigation = function (entry) {
if (entry && entry.animated !== undefined) {
return entry.animated;
}
if (this.animated !== undefined) {
return this.animated;
}
return FrameBase_1.defaultAnimatedNavigation;
};
FrameBase.prototype._getNavigationTransition = function (entry) {
if (entry) {
if (view_1.isIOS && entry.transitioniOS !== undefined) {
return entry.transitioniOS;
}
if (view_1.isAndroid && entry.transitionAndroid !== undefined) {
return entry.transitionAndroid;
}
if (entry.transition !== undefined) {
return entry.transition;
}
}
if (this.transition !== undefined) {
return this.transition;
}
return FrameBase_1.defaultTransition;
};
Object.defineProperty(FrameBase.prototype, "navigationBarHeight", {
get: function () {
return 0;
},
enumerable: true,
configurable: true
});
FrameBase.prototype._getNavBarVisible = function (page) {
throw new Error();
};
FrameBase.prototype._addViewToNativeVisualTree = function (child) {
return true;
};
FrameBase.prototype._removeViewFromNativeVisualTree = function (child) {
child._isAddedToNativeVisualTree = false;
};
FrameBase.prototype._printFrameBackStack = function () {
var length = this.backStack.length;
var i = length - 1;
console.log("Frame Back Stack: ");
while (i >= 0) {
var backstackEntry = this.backStack[i--];
console.log("\t" + backstackEntry.resolvedPage);
}
};
FrameBase.prototype._backstackEntryTrace = function (b) {
var result = "" + b.resolvedPage;
var backstackVisible = FrameBase_1._isEntryBackstackVisible(b);
if (!backstackVisible) {
result += " | INVISIBLE";
}
if (b.entry.clearHistory) {
result += " | CLEAR HISTORY";
}
var animated = this._getIsAnimatedNavigation(b.entry);
if (!animated) {
result += " | NOT ANIMATED";
}
var t = this._getNavigationTransition(b.entry);
if (t) {
result += " | Transition[" + JSON.stringify(t) + "]";
}
return result;
};
FrameBase.prototype._onLivesync = function () {
_super.prototype._onLivesync.call(this);
if (!this._currentEntry || !this._currentEntry.entry) {
return false;
}
var currentEntry = this._currentEntry.entry;
var newEntry = {
animated: false,
clearHistory: true,
context: currentEntry.context,
create: currentEntry.create,
moduleName: currentEntry.moduleName,
backstackVisible: currentEntry.backstackVisible
};
if (newEntry.create) {
var page = newEntry.create();
if (page === this.currentPage) {
return false;
}
}
this.navigate(newEntry);
return true;
};
var FrameBase_1;
FrameBase.androidOptionSelectedEvent = "optionSelected";
FrameBase.defaultAnimatedNavigation = true;
__decorate([
profiling_1.profile
], FrameBase.prototype, "onLoaded", null);
__decorate([
profiling_1.profile
], FrameBase.prototype, "performNavigation", null);
__decorate([
profiling_1.profile
], FrameBase.prototype, "performGoBack", null);
FrameBase = FrameBase_1 = __decorate([
view_1.CSSType("Frame")
], FrameBase);
return FrameBase;
}(view_1.CustomLayoutView));
exports.FrameBase = FrameBase;
function getFrameById(id) {
return frame_stack_1.frameStack.find(function (frame) { return frame.id && frame.id === id; });
}
exports.getFrameById = getFrameById;
function topmost() {
return frame_stack_1.topmost();
}
exports.topmost = topmost;
function goBack() {
var top = topmost();
if (top && top.canGoBack()) {
top.goBack();
return true;
}
else if (top) {
var parentFrameCanGoBack = false;
var parentFrame = view_common_1.getAncestor(top, "Frame");
while (parentFrame && !parentFrameCanGoBack) {
if (parentFrame && parentFrame.canGoBack()) {
parentFrameCanGoBack = true;
}
else {
parentFrame = view_common_1.getAncestor(parentFrame, "Frame");
}
}
if (parentFrame && parentFrameCanGoBack) {
parentFrame.goBack();
return true;
}
}
if (frame_stack_1.frameStack.length > 1) {
top._popFromFrameStack();
}
return false;
}
exports.goBack = goBack;
function stack() {
return frame_stack_1.frameStack;
}
exports.stack = stack;
exports.defaultPage = new view_1.Property({
name: "defaultPage", valueChanged: function (frame, oldValue, newValue) {
frame.navigate({ moduleName: newValue });
}
});
exports.defaultPage.register(FrameBase);
exports.actionBarVisibilityProperty = new view_1.Property({ name: "actionBarVisibility", defaultValue: "auto", affectsLayout: view_1.isIOS });
exports.actionBarVisibilityProperty.register(FrameBase);
//# sourceMappingURL=frame-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/frame/frame-stack.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.frameStack = [];
function topmost() {
if (exports.frameStack.length > 0) {
return exports.frameStack[exports.frameStack.length - 1];
}
return undefined;
}
exports.topmost = topmost;
function _pushInFrameStack(frame) {
if (frame._isInFrameStack && exports.frameStack[exports.frameStack.length - 1] === frame) {
return;
}
if (frame._isInFrameStack) {
var indexOfFrame = exports.frameStack.indexOf(frame);
exports.frameStack.splice(indexOfFrame, 1);
}
exports.frameStack.push(frame);
frame._isInFrameStack = true;
}
exports._pushInFrameStack = _pushInFrameStack;
function _popFromFrameStack(frame) {
if (!frame._isInFrameStack) {
return;
}
var top = topmost();
if (top !== frame) {
throw new Error("Cannot pop a Frame which is not at the top of the navigation stack.");
}
exports.frameStack.pop();
frame._isInFrameStack = false;
}
exports._popFromFrameStack = _popFromFrameStack;
function _removeFromFrameStack(frame) {
if (!frame._isInFrameStack) {
return;
}
var index = exports.frameStack.indexOf(frame);
exports.frameStack.splice(index, 1);
frame._isInFrameStack = false;
}
exports._removeFromFrameStack = _removeFromFrameStack;
//# sourceMappingURL=frame-stack.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/frame/frame.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var application = __webpack_require__("../node_modules/tns-core-modules/application/application.js");
var frame_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/frame/frame-common.js");
var fragment_transitions_1 = __webpack_require__("../node_modules/tns-core-modules/ui/frame/fragment.transitions.js");
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
var builder_1 = __webpack_require__("../node_modules/tns-core-modules/ui/builder/builder.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/frame/frame-common.js"));
var INTENT_EXTRA = "com.tns.activity";
var ROOT_VIEW_ID_EXTRA = "com.tns.activity.rootViewId";
var FRAMEID = "_frameId";
var CALLBACKS = "_callbacks";
var ownerSymbol = Symbol("_owner");
var activityRootViewsMap = new Map();
var navDepth = -1;
var fragmentId = -1;
if (global && global.__inspector) {
var devtools = __webpack_require__("../node_modules/tns-core-modules/debugger/devtools-elements.js");
devtools.attachDOMInspectorEventCallbacks(global.__inspector);
devtools.attachDOMInspectorCommandCallbacks(global.__inspector);
}
function getAttachListener() {
if (!exports.attachStateChangeListener) {
var AttachListener = (function (_super) {
__extends(AttachListener, _super);
function AttachListener() {
var _this = _super.call(this) || this;
return global.__native(_this);
}
AttachListener.prototype.onViewAttachedToWindow = function (view) {
var owner = view[ownerSymbol];
if (owner) {
owner._onAttachedToWindow();
}
};
AttachListener.prototype.onViewDetachedFromWindow = function (view) {
var owner = view[ownerSymbol];
if (owner) {
owner._onDetachedFromWindow();
}
};
AttachListener = __decorate([
Interfaces([android.view.View.OnAttachStateChangeListener])
], AttachListener);
return AttachListener;
}(java.lang.Object));
exports.attachStateChangeListener = new AttachListener();
}
return exports.attachStateChangeListener;
}
function reloadPage() {
var activity = application.android.foregroundActivity;
var callbacks = activity[CALLBACKS];
var rootView = callbacks.getRootView();
if (!rootView || !rootView._onLivesync()) {
callbacks.resetActivityContent(activity);
}
}
exports.reloadPage = reloadPage;
global.__onLiveSyncCore = reloadPage;
var Frame = (function (_super) {
__extends(Frame, _super);
function Frame() {
var _this = _super.call(this) || this;
_this._containerViewId = -1;
_this._tearDownPending = false;
_this._attachedToWindow = false;
_this._isBack = true;
_this._android = new AndroidFrame(_this);
return _this;
}
Object.defineProperty(Frame, "defaultAnimatedNavigation", {
get: function () {
return frame_common_1.FrameBase.defaultAnimatedNavigation;
},
set: function (value) {
frame_common_1.FrameBase.defaultAnimatedNavigation = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Frame, "defaultTransition", {
get: function () {
return frame_common_1.FrameBase.defaultTransition;
},
set: function (value) {
frame_common_1.FrameBase.defaultTransition = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Frame.prototype, "containerViewId", {
get: function () {
return this._containerViewId;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Frame.prototype, "android", {
get: function () {
return this._android;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Frame.prototype, "_hasFragments", {
get: function () {
return true;
},
enumerable: true,
configurable: true
});
Frame.prototype._onAttachedToWindow = function () {
_super.prototype._onAttachedToWindow.call(this);
this._attachedToWindow = true;
this._processNextNavigationEntry();
};
Frame.prototype._onDetachedFromWindow = function () {
_super.prototype._onDetachedFromWindow.call(this);
this._attachedToWindow = false;
};
Frame.prototype._processNextNavigationEntry = function () {
if (!this.isLoaded || this._executingEntry || !this._attachedToWindow) {
return;
}
var animatedEntries = fragment_transitions_1._getAnimatedEntries(this._android.frameId);
if (animatedEntries) {
if (animatedEntries.size > 0) {
return;
}
}
var manager = this._getFragmentManager();
var entry = this._currentEntry;
if (entry && manager && !manager.findFragmentByTag(entry.fragmentTag)) {
this._cachedAnimatorState = getAnimatorState(this._currentEntry);
this._currentEntry = null;
this._navigateCore(entry);
this._currentEntry = entry;
}
else {
_super.prototype._processNextNavigationEntry.call(this);
}
};
Frame.prototype._getChildFragmentManager = function () {
var backstackEntry = this._executingEntry || this._currentEntry;
if (backstackEntry && backstackEntry.fragment && backstackEntry.fragment.isAdded()) {
return backstackEntry.fragment.getChildFragmentManager();
}
return null;
};
Frame.prototype._onRootViewReset = function () {
this.disposeCurrentFragment();
_super.prototype._onRootViewReset.call(this);
};
Frame.prototype.onUnloaded = function () {
_super.prototype.onUnloaded.call(this);
this.disposeCurrentFragment();
};
Frame.prototype.disposeCurrentFragment = function () {
if (!this._currentEntry ||
!this._currentEntry.fragment ||
!this._currentEntry.fragment.isAdded()) {
return;
}
var manager = this._getFragmentManager();
var transaction = manager.beginTransaction();
transaction.remove(this._currentEntry.fragment);
transaction.commitNowAllowingStateLoss();
};
Frame.prototype.createFragment = function (backstackEntry, fragmentTag) {
ensureFragmentClass();
var newFragment = new fragmentClass();
var args = new android.os.Bundle();
args.putInt(FRAMEID, this._android.frameId);
newFragment.setArguments(args);
setFragmentCallbacks(newFragment);
var callbacks = newFragment[CALLBACKS];
callbacks.frame = this;
callbacks.entry = backstackEntry;
backstackEntry.fragment = newFragment;
backstackEntry.fragmentTag = fragmentTag;
backstackEntry.navDepth = navDepth;
return newFragment;
};
Frame.prototype.setCurrent = function (entry, isBack) {
var current = this._currentEntry;
var currentEntryChanged = current !== entry;
if (currentEntryChanged) {
this._updateBackstack(entry, isBack);
if (this._tearDownPending) {
this._tearDownPending = false;
if (!entry.recreated) {
clearEntry(entry);
}
if (current && !current.recreated) {
clearEntry(current);
}
var context_1 = this._context;
if (context_1 && !entry.recreated) {
entry.fragment = this.createFragment(entry, entry.fragmentTag);
entry.resolvedPage._setupUI(context_1);
}
entry.recreated = false;
if (current) {
current.recreated = false;
}
}
_super.prototype.setCurrent.call(this, entry, isBack);
this._processNavigationQueue(entry.resolvedPage);
}
else {
this._processNextNavigationEntry();
}
if (this._cachedAnimatorState) {
restoreAnimatorState(this._currentEntry, this._cachedAnimatorState);
this._cachedAnimatorState = null;
}
};
Frame.prototype.onBackPressed = function () {
if (this.canGoBack()) {
this.goBack();
return true;
}
if (!this.navigationQueueIsEmpty()) {
var manager = this._getFragmentManager();
if (manager) {
manager.executePendingTransactions();
return true;
}
}
return false;
};
Frame.prototype._navigateCore = function (newEntry) {
_super.prototype._navigateCore.call(this, newEntry);
this._isBack = false;
newEntry.frameId = this._android.frameId;
var activity = this._android.activity;
if (!activity) {
var currentActivity = this._android.currentActivity;
if (currentActivity) {
startActivity(currentActivity, this._android.frameId);
}
return;
}
var manager = this._getFragmentManager();
var clearHistory = newEntry.entry.clearHistory;
var currentEntry = this._currentEntry;
if (clearHistory) {
navDepth = -1;
}
navDepth++;
fragmentId++;
var newFragmentTag = "fragment" + fragmentId + "[" + navDepth + "]";
var newFragment = this.createFragment(newEntry, newFragmentTag);
var transaction = manager.beginTransaction();
var animated = currentEntry ? this._getIsAnimatedNavigation(newEntry.entry) : false;
var navigationTransition = this._currentEntry ? this._getNavigationTransition(newEntry.entry) : null;
fragment_transitions_1._setAndroidFragmentTransitions(animated, navigationTransition, currentEntry, newEntry, transaction, this._android.frameId);
if (currentEntry && animated && !navigationTransition) {
transaction.setTransition(android.support.v4.app.FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
}
transaction.replace(this.containerViewId, newFragment, newFragmentTag);
transaction.commitAllowingStateLoss();
};
Frame.prototype._goBackCore = function (backstackEntry) {
this._isBack = true;
_super.prototype._goBackCore.call(this, backstackEntry);
navDepth = backstackEntry.navDepth;
var manager = this._getFragmentManager();
var transaction = manager.beginTransaction();
if (!backstackEntry.fragment) {
backstackEntry.fragment = this.createFragment(backstackEntry, backstackEntry.fragmentTag);
fragment_transitions_1._updateTransitions(backstackEntry);
}
var transitionReversed = fragment_transitions_1._reverseTransitions(backstackEntry, this._currentEntry);
if (!transitionReversed) {
transaction.setCustomAnimations(-30, -40);
}
transaction.replace(this.containerViewId, backstackEntry.fragment, backstackEntry.fragmentTag);
transaction.commitAllowingStateLoss();
};
Frame.prototype._removeEntry = function (removed) {
_super.prototype._removeEntry.call(this, removed);
if (removed.fragment) {
fragment_transitions_1._clearEntry(removed);
}
removed.fragment = null;
removed.viewSavedState = null;
};
Frame.prototype.createNativeView = function () {
return new org.nativescript.widgets.ContentLayout(this._context);
};
Frame.prototype.initNativeView = function () {
_super.prototype.initNativeView.call(this);
var listener = getAttachListener();
this.nativeViewProtected.addOnAttachStateChangeListener(listener);
this.nativeViewProtected[ownerSymbol] = this;
this._android.rootViewGroup = this.nativeViewProtected;
if (this._containerViewId < 0) {
this._containerViewId = android.view.View.generateViewId();
}
this._android.rootViewGroup.setId(this._containerViewId);
};
Frame.prototype.disposeNativeView = function () {
var _this = this;
var listener = getAttachListener();
this.nativeViewProtected.removeOnAttachStateChangeListener(listener);
this.nativeViewProtected[ownerSymbol] = null;
this._tearDownPending = !!this._executingEntry;
var current = this._currentEntry;
this.backStack.forEach(function (entry) {
if (entry !== _this._executingEntry) {
clearEntry(entry);
}
});
if (current && !this._executingEntry) {
clearEntry(current);
}
this._android.rootViewGroup = null;
this._removeFromFrameStack();
_super.prototype.disposeNativeView.call(this);
};
Frame.prototype._popFromFrameStack = function () {
if (!this._isInFrameStack) {
return;
}
_super.prototype._popFromFrameStack.call(this);
};
Frame.prototype._getNavBarVisible = function (page) {
switch (this.actionBarVisibility) {
case "never":
return false;
case "always":
return true;
default:
if (page.actionBarHidden !== undefined) {
return !page.actionBarHidden;
}
if (this._android && this._android.showActionBar !== undefined) {
return this._android.showActionBar;
}
return true;
}
};
Frame.prototype._saveFragmentsState = function () {
this.backStack.forEach(function (entry) {
var view = entry.resolvedPage.nativeViewProtected;
if (!entry.viewSavedState && view) {
var viewState = new android.util.SparseArray();
view.saveHierarchyState(viewState);
entry.viewSavedState = viewState;
}
});
};
__decorate([
profiling_1.profile
], Frame.prototype, "_navigateCore", null);
return Frame;
}(frame_common_1.FrameBase));
exports.Frame = Frame;
function cloneExpandedAnimator(expandedAnimator) {
if (!expandedAnimator) {
return null;
}
var clone = expandedAnimator.clone();
clone.entry = expandedAnimator.entry;
clone.transitionType = expandedAnimator.transitionType;
return clone;
}
function getAnimatorState(entry) {
var expandedEntry = entry;
var animatorState = {};
animatorState.enterAnimator = cloneExpandedAnimator(expandedEntry.enterAnimator);
animatorState.exitAnimator = cloneExpandedAnimator(expandedEntry.exitAnimator);
animatorState.popEnterAnimator = cloneExpandedAnimator(expandedEntry.popEnterAnimator);
animatorState.popExitAnimator = cloneExpandedAnimator(expandedEntry.popExitAnimator);
animatorState.transitionName = expandedEntry.transitionName;
return animatorState;
}
function restoreAnimatorState(entry, snapshot) {
var expandedEntry = entry;
expandedEntry.enterAnimator = snapshot.enterAnimator;
expandedEntry.exitAnimator = snapshot.exitAnimator;
expandedEntry.popEnterAnimator = snapshot.popEnterAnimator;
expandedEntry.popExitAnimator = snapshot.popExitAnimator;
expandedEntry.transitionName = snapshot.transitionName;
}
function clearEntry(entry) {
if (entry.fragment) {
fragment_transitions_1._clearFragment(entry);
}
entry.recreated = false;
entry.fragment = null;
var page = entry.resolvedPage;
if (page._context) {
entry.resolvedPage._tearDownUI(true);
}
}
var framesCounter = 0;
var framesCache = new Array();
var AndroidFrame = (function (_super) {
__extends(AndroidFrame, _super);
function AndroidFrame(owner) {
var _this = _super.call(this) || this;
_this._showActionBar = true;
_this.cachePagesOnNavigate = true;
_this._owner = owner;
_this.frameId = framesCounter++;
framesCache.push(new WeakRef(_this));
return _this;
}
Object.defineProperty(AndroidFrame.prototype, "showActionBar", {
get: function () {
return this._showActionBar;
},
set: function (value) {
if (this._showActionBar !== value) {
this._showActionBar = value;
if (this.owner.currentPage) {
this.owner.currentPage.actionBar.update();
}
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(AndroidFrame.prototype, "activity", {
get: function () {
var activity = this.owner._context;
if (activity) {
return activity;
}
var currView = this._owner.parent;
while (currView) {
if (currView instanceof Frame) {
return currView.android.activity;
}
currView = currView.parent;
}
return undefined;
},
enumerable: true,
configurable: true
});
Object.defineProperty(AndroidFrame.prototype, "actionBar", {
get: function () {
var activity = this.currentActivity;
if (!activity) {
return undefined;
}
var bar = activity.getActionBar();
if (!bar) {
return undefined;
}
return bar;
},
enumerable: true,
configurable: true
});
Object.defineProperty(AndroidFrame.prototype, "currentActivity", {
get: function () {
var activity = this.activity;
if (activity) {
return activity;
}
var frames = frame_common_1.stack();
for (var length_1 = frames.length, i = length_1 - 1; i >= 0; i--) {
activity = frames[i].android.activity;
if (activity) {
return activity;
}
}
return undefined;
},
enumerable: true,
configurable: true
});
Object.defineProperty(AndroidFrame.prototype, "owner", {
get: function () {
return this._owner;
},
enumerable: true,
configurable: true
});
AndroidFrame.prototype.canGoBack = function () {
if (!this.activity) {
return false;
}
return this.activity.getIntent().getAction() !== android.content.Intent.ACTION_MAIN;
};
AndroidFrame.prototype.fragmentForPage = function (entry) {
var tag = entry && entry.fragmentTag;
if (tag) {
return this.owner._getFragmentManager().findFragmentByTag(tag);
}
return undefined;
};
return AndroidFrame;
}(frame_common_1.Observable));
function findPageForFragment(fragment, frame) {
var fragmentTag = fragment.getTag();
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("Finding page for " + fragmentTag + ".", frame_common_1.traceCategories.NativeLifecycle);
}
var entry;
var current = frame._currentEntry;
var navigating = frame._executingEntry;
if (current && current.fragmentTag === fragmentTag) {
entry = current;
}
else if (navigating && navigating.fragmentTag === fragmentTag) {
entry = navigating;
}
var page;
if (entry) {
entry.recreated = true;
page = entry.resolvedPage;
}
if (page) {
var callbacks = fragment[CALLBACKS];
callbacks.frame = frame;
callbacks.entry = entry;
entry.fragment = fragment;
fragment_transitions_1._updateTransitions(entry);
}
else {
throw new Error("Could not find a page for " + fragmentTag + ".");
}
}
function startActivity(activity, frameId) {
var intent = new android.content.Intent(activity, activity.getClass());
intent.setAction(android.content.Intent.ACTION_DEFAULT);
intent.putExtra(INTENT_EXTRA, frameId);
activity.startActivity(intent);
}
function getFrameByNumberId(frameId) {
for (var i = 0; i < framesCache.length; i++) {
var aliveFrame = framesCache[i].get();
if (aliveFrame && aliveFrame.frameId === frameId) {
return aliveFrame.owner;
}
}
return null;
}
function ensureFragmentClass() {
if (fragmentClass) {
return;
}
__webpack_require__("../node_modules/tns-core-modules/ui/frame/fragment.js");
if (!fragmentClass) {
throw new Error("Failed to initialize the extended android.support.v4.app.Fragment class");
}
}
var fragmentClass;
function setFragmentClass(clazz) {
if (fragmentClass) {
throw new Error("Fragment class already initialized");
}
fragmentClass = clazz;
}
exports.setFragmentClass = setFragmentClass;
var FragmentCallbacksImplementation = (function () {
function FragmentCallbacksImplementation() {
}
FragmentCallbacksImplementation.prototype.onHiddenChanged = function (fragment, hidden, superFunc) {
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite(fragment + ".onHiddenChanged(" + hidden + ")", frame_common_1.traceCategories.NativeLifecycle);
}
superFunc.call(fragment, hidden);
};
FragmentCallbacksImplementation.prototype.onCreateAnimator = function (fragment, transit, enter, nextAnim, superFunc) {
var nextAnimString;
switch (nextAnim) {
case -10:
nextAnimString = "enter";
break;
case -20:
nextAnimString = "exit";
break;
case -30:
nextAnimString = "popEnter";
break;
case -40:
nextAnimString = "popExit";
break;
}
var animator = fragment_transitions_1._onFragmentCreateAnimator(this.entry, fragment, nextAnim, enter);
if (!animator) {
animator = superFunc.call(fragment, transit, enter, nextAnim);
}
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite(fragment + ".onCreateAnimator(" + transit + ", " + (enter ? "enter" : "exit") + ", " + nextAnimString + "): " + (animator ? "animator" : "no animator"), frame_common_1.traceCategories.NativeLifecycle);
}
return animator;
};
FragmentCallbacksImplementation.prototype.onCreate = function (fragment, savedInstanceState, superFunc) {
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite(fragment + ".onCreate(" + savedInstanceState + ")", frame_common_1.traceCategories.NativeLifecycle);
}
superFunc.call(fragment, savedInstanceState);
if (!this.entry) {
var args = fragment.getArguments();
var frameId = args.getInt(FRAMEID);
var frame = getFrameByNumberId(frameId);
if (!frame) {
throw new Error("Cannot find Frame for " + fragment);
}
findPageForFragment(fragment, frame);
}
};
FragmentCallbacksImplementation.prototype.onCreateView = function (fragment, inflater, container, savedInstanceState, superFunc) {
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite(fragment + ".onCreateView(inflater, container, " + savedInstanceState + ")", frame_common_1.traceCategories.NativeLifecycle);
}
var entry = this.entry;
if (!entry) {
frame_common_1.traceError(fragment + ".onCreateView: entry is null or undefined");
return null;
}
var page = entry.resolvedPage;
if (!page) {
frame_common_1.traceError(fragment + ".onCreateView: entry has no resolvedPage");
return null;
}
var frame = this.frame;
if (!frame) {
frame_common_1.traceError(fragment + ".onCreateView: this.frame is null or undefined");
return null;
}
if (page.parent === frame) {
if (!page._context) {
var context_2 = container && container.getContext() || inflater && inflater.getContext();
page._setupUI(context_2);
}
}
else {
if (!frame._styleScope) {
page._updateStyleScope();
}
frame._addView(page);
}
if (frame.isLoaded && !page.isLoaded) {
page.callLoaded();
}
var savedState = entry.viewSavedState;
if (savedState) {
page.nativeViewProtected.restoreHierarchyState(savedState);
entry.viewSavedState = null;
}
var nativeView = page.nativeViewProtected;
if (nativeView != null) {
var parentView = nativeView.getParent();
if (parentView instanceof android.view.ViewGroup) {
if (parentView.getChildCount() === 0) {
parentView.addViewInLayout(nativeView, -1, new org.nativescript.widgets.CommonLayoutParams());
}
parentView.removeView(nativeView);
}
}
return page.nativeViewProtected;
};
FragmentCallbacksImplementation.prototype.onSaveInstanceState = function (fragment, outState, superFunc) {
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite(fragment + ".onSaveInstanceState(" + outState + ")", frame_common_1.traceCategories.NativeLifecycle);
}
superFunc.call(fragment, outState);
};
FragmentCallbacksImplementation.prototype.onDestroyView = function (fragment, superFunc) {
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite(fragment + ".onDestroyView()", frame_common_1.traceCategories.NativeLifecycle);
}
superFunc.call(fragment);
};
FragmentCallbacksImplementation.prototype.onDestroy = function (fragment, superFunc) {
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite(fragment + ".onDestroy()", frame_common_1.traceCategories.NativeLifecycle);
}
superFunc.call(fragment);
var entry = this.entry;
if (!entry) {
frame_common_1.traceError(fragment + ".onDestroy: entry is null or undefined");
return null;
}
var page = entry.resolvedPage;
if (!page) {
frame_common_1.traceError(fragment + ".onDestroy: entry has no resolvedPage");
return null;
}
};
FragmentCallbacksImplementation.prototype.onStop = function (fragment, superFunc) {
superFunc.call(fragment);
};
FragmentCallbacksImplementation.prototype.toStringOverride = function (fragment, superFunc) {
var entry = this.entry;
if (entry) {
return entry.fragmentTag + "<" + entry.resolvedPage + ">";
}
else {
return "NO ENTRY, " + superFunc.call(fragment);
}
};
__decorate([
profiling_1.profile
], FragmentCallbacksImplementation.prototype, "onHiddenChanged", null);
__decorate([
profiling_1.profile
], FragmentCallbacksImplementation.prototype, "onCreateAnimator", null);
__decorate([
profiling_1.profile
], FragmentCallbacksImplementation.prototype, "onCreate", null);
__decorate([
profiling_1.profile
], FragmentCallbacksImplementation.prototype, "onCreateView", null);
__decorate([
profiling_1.profile
], FragmentCallbacksImplementation.prototype, "onSaveInstanceState", null);
__decorate([
profiling_1.profile
], FragmentCallbacksImplementation.prototype, "onDestroyView", null);
__decorate([
profiling_1.profile
], FragmentCallbacksImplementation.prototype, "onDestroy", null);
__decorate([
profiling_1.profile
], FragmentCallbacksImplementation.prototype, "onStop", null);
__decorate([
profiling_1.profile
], FragmentCallbacksImplementation.prototype, "toStringOverride", null);
return FragmentCallbacksImplementation;
}());
var ActivityCallbacksImplementation = (function () {
function ActivityCallbacksImplementation() {
}
ActivityCallbacksImplementation.prototype.getRootView = function () {
return this._rootView;
};
ActivityCallbacksImplementation.prototype.onCreate = function (activity, savedInstanceState, superFunc) {
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("Activity.onCreate(" + savedInstanceState + ")", frame_common_1.traceCategories.NativeLifecycle);
}
var isRestart = !!savedInstanceState && exports.moduleLoaded;
superFunc.call(activity, isRestart ? savedInstanceState : null);
if (savedInstanceState) {
var rootViewId = savedInstanceState.getInt(ROOT_VIEW_ID_EXTRA, -1);
if (rootViewId !== -1 && activityRootViewsMap.has(rootViewId)) {
this._rootView = activityRootViewsMap.get(rootViewId).get();
}
}
this.setActivityContent(activity, savedInstanceState, true);
exports.moduleLoaded = true;
};
ActivityCallbacksImplementation.prototype.onSaveInstanceState = function (activity, outState, superFunc) {
superFunc.call(activity, outState);
var rootView = this._rootView;
if (rootView instanceof Frame) {
outState.putInt(INTENT_EXTRA, rootView.android.frameId);
rootView._saveFragmentsState();
}
outState.putInt(ROOT_VIEW_ID_EXTRA, rootView._domId);
};
ActivityCallbacksImplementation.prototype.onStart = function (activity, superFunc) {
superFunc.call(activity);
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("NativeScriptActivity.onStart();", frame_common_1.traceCategories.NativeLifecycle);
}
var rootView = this._rootView;
if (rootView && !rootView.isLoaded) {
rootView.callLoaded();
}
};
ActivityCallbacksImplementation.prototype.onStop = function (activity, superFunc) {
superFunc.call(activity);
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("NativeScriptActivity.onStop();", frame_common_1.traceCategories.NativeLifecycle);
}
var rootView = this._rootView;
if (rootView && rootView.isLoaded) {
rootView.callUnloaded();
}
};
ActivityCallbacksImplementation.prototype.onDestroy = function (activity, superFunc) {
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("NativeScriptActivity.onDestroy();", frame_common_1.traceCategories.NativeLifecycle);
}
var rootView = this._rootView;
if (rootView) {
rootView._tearDownUI(true);
}
var exitArgs = { eventName: application.exitEvent, object: application.android, android: activity };
application.notify(exitArgs);
superFunc.call(activity);
};
ActivityCallbacksImplementation.prototype.onBackPressed = function (activity, superFunc) {
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("NativeScriptActivity.onBackPressed;", frame_common_1.traceCategories.NativeLifecycle);
}
var args = {
eventName: "activityBackPressed",
object: application.android,
activity: activity,
cancel: false,
};
application.android.notify(args);
if (args.cancel) {
return;
}
var view = this._rootView;
var callSuper = false;
if (view instanceof Frame) {
callSuper = !frame_common_1.goBack();
}
else {
var viewArgs = {
eventName: "activityBackPressed",
object: view,
activity: activity,
cancel: false,
};
view.notify(viewArgs);
if (!viewArgs.cancel && !view.onBackPressed()) {
callSuper = true;
}
}
if (callSuper) {
superFunc.call(activity);
}
};
ActivityCallbacksImplementation.prototype.onRequestPermissionsResult = function (activity, requestCode, permissions, grantResults, superFunc) {
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("NativeScriptActivity.onRequestPermissionsResult;", frame_common_1.traceCategories.NativeLifecycle);
}
application.android.notify({
eventName: "activityRequestPermissions",
object: application.android,
activity: activity,
requestCode: requestCode,
permissions: permissions,
grantResults: grantResults
});
};
ActivityCallbacksImplementation.prototype.onActivityResult = function (activity, requestCode, resultCode, data, superFunc) {
superFunc.call(activity, requestCode, resultCode, data);
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("NativeScriptActivity.onActivityResult(" + requestCode + ", " + resultCode + ", " + data + ")", frame_common_1.traceCategories.NativeLifecycle);
}
application.android.notify({
eventName: "activityResult",
object: application.android,
activity: activity,
requestCode: requestCode,
resultCode: resultCode,
intent: data
});
};
ActivityCallbacksImplementation.prototype.resetActivityContent = function (activity) {
if (this._rootView) {
var manager = this._rootView._getFragmentManager();
manager.executePendingTransactions();
this._rootView._onRootViewReset();
}
this._rootView = null;
this.setActivityContent(activity, null, false);
this._rootView.callLoaded();
};
ActivityCallbacksImplementation.prototype.setActivityContent = function (activity, savedInstanceState, fireLaunchEvent) {
var shouldCreateRootFrame = application.shouldCreateRootFrame();
var rootView = this._rootView;
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("Frame.setActivityContent rootView: " + rootView + " shouldCreateRootFrame: " + shouldCreateRootFrame + " fireLaunchEvent: " + fireLaunchEvent, frame_common_1.traceCategories.NativeLifecycle);
}
if (!rootView) {
var mainEntry = application.getMainEntry();
var intent = activity.getIntent();
if (fireLaunchEvent) {
rootView = notifyLaunch(intent, savedInstanceState);
}
if (shouldCreateRootFrame) {
var extras = intent.getExtras();
var frameId = -1;
if (extras) {
frameId = extras.getInt(INTENT_EXTRA, -1);
}
if (savedInstanceState && frameId < 0) {
frameId = savedInstanceState.getInt(INTENT_EXTRA, -1);
}
if (!rootView) {
rootView = getFrameByNumberId(frameId) || new Frame();
}
if (rootView instanceof Frame) {
rootView.navigate(mainEntry);
}
else {
throw new Error("A Frame must be used to navigate to a Page.");
}
}
else {
rootView = rootView || builder_1.createViewFromEntry(mainEntry);
}
this._rootView = rootView;
activityRootViewsMap.set(rootView._domId, new WeakRef(rootView));
}
if (shouldCreateRootFrame) {
rootView._setupUI(activity);
}
else {
rootView._setupAsRootView(activity);
}
activity.setContentView(rootView.nativeViewProtected, new org.nativescript.widgets.CommonLayoutParams());
};
__decorate([
profiling_1.profile
], ActivityCallbacksImplementation.prototype, "onCreate", null);
__decorate([
profiling_1.profile
], ActivityCallbacksImplementation.prototype, "onSaveInstanceState", null);
__decorate([
profiling_1.profile
], ActivityCallbacksImplementation.prototype, "onStart", null);
__decorate([
profiling_1.profile
], ActivityCallbacksImplementation.prototype, "onStop", null);
__decorate([
profiling_1.profile
], ActivityCallbacksImplementation.prototype, "onDestroy", null);
__decorate([
profiling_1.profile
], ActivityCallbacksImplementation.prototype, "onBackPressed", null);
__decorate([
profiling_1.profile
], ActivityCallbacksImplementation.prototype, "onRequestPermissionsResult", null);
__decorate([
profiling_1.profile
], ActivityCallbacksImplementation.prototype, "onActivityResult", null);
return ActivityCallbacksImplementation;
}());
var notifyLaunch = profiling_1.profile("notifyLaunch", function notifyLaunch(intent, savedInstanceState) {
var launchArgs = {
eventName: application.launchEvent,
object: application.android,
android: intent, savedInstanceState: savedInstanceState
};
application.notify(launchArgs);
application.notify({ eventName: "loadAppCss", object: this, cssFile: application.getCssFileName() });
return launchArgs.root;
});
function setActivityCallbacks(activity) {
activity[CALLBACKS] = new ActivityCallbacksImplementation();
}
exports.setActivityCallbacks = setActivityCallbacks;
function setFragmentCallbacks(fragment) {
fragment[CALLBACKS] = new FragmentCallbacksImplementation();
}
exports.setFragmentCallbacks = setFragmentCallbacks;
//# sourceMappingURL=frame.android.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/gestures/gestures-common.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var GestureTypes;
(function (GestureTypes) {
GestureTypes[GestureTypes["tap"] = 1] = "tap";
GestureTypes[GestureTypes["doubleTap"] = 2] = "doubleTap";
GestureTypes[GestureTypes["pinch"] = 4] = "pinch";
GestureTypes[GestureTypes["pan"] = 8] = "pan";
GestureTypes[GestureTypes["swipe"] = 16] = "swipe";
GestureTypes[GestureTypes["rotation"] = 32] = "rotation";
GestureTypes[GestureTypes["longPress"] = 64] = "longPress";
GestureTypes[GestureTypes["touch"] = 128] = "touch";
})(GestureTypes = exports.GestureTypes || (exports.GestureTypes = {}));
var GestureStateTypes;
(function (GestureStateTypes) {
GestureStateTypes[GestureStateTypes["cancelled"] = 0] = "cancelled";
GestureStateTypes[GestureStateTypes["began"] = 1] = "began";
GestureStateTypes[GestureStateTypes["changed"] = 2] = "changed";
GestureStateTypes[GestureStateTypes["ended"] = 3] = "ended";
})(GestureStateTypes = exports.GestureStateTypes || (exports.GestureStateTypes = {}));
var SwipeDirection;
(function (SwipeDirection) {
SwipeDirection[SwipeDirection["right"] = 1] = "right";
SwipeDirection[SwipeDirection["left"] = 2] = "left";
SwipeDirection[SwipeDirection["up"] = 4] = "up";
SwipeDirection[SwipeDirection["down"] = 8] = "down";
})(SwipeDirection = exports.SwipeDirection || (exports.SwipeDirection = {}));
var TouchAction;
(function (TouchAction) {
TouchAction.down = "down";
TouchAction.up = "up";
TouchAction.move = "move";
TouchAction.cancel = "cancel";
})(TouchAction = exports.TouchAction || (exports.TouchAction = {}));
function toString(type, separator) {
var types = new Array();
if (type & GestureTypes.tap) {
types.push("tap");
}
if (type & GestureTypes.doubleTap) {
types.push("doubleTap");
}
if (type & GestureTypes.pinch) {
types.push("pinch");
}
if (type & GestureTypes.pan) {
types.push("pan");
}
if (type & GestureTypes.swipe) {
types.push("swipe");
}
if (type & GestureTypes.rotation) {
types.push("rotation");
}
if (type & GestureTypes.longPress) {
types.push("longPress");
}
if (type & GestureTypes.touch) {
types.push("touch");
}
return types.join(separator);
}
exports.toString = toString;
function fromString(type) {
var t = type.trim().toLowerCase();
if (t === "tap") {
return GestureTypes.tap;
}
else if (t === "doubletap") {
return GestureTypes.doubleTap;
}
else if (t === "pinch") {
return GestureTypes.pinch;
}
else if (t === "pan") {
return GestureTypes.pan;
}
else if (t === "swipe") {
return GestureTypes.swipe;
}
else if (t === "rotation") {
return GestureTypes.rotation;
}
else if (t === "longpress") {
return GestureTypes.longPress;
}
else if (t === "touch") {
return GestureTypes.touch;
}
return undefined;
}
exports.fromString = fromString;
var GesturesObserverBase = (function () {
function GesturesObserverBase(target, callback, context) {
this._target = target;
this._callback = callback;
this._context = context;
}
Object.defineProperty(GesturesObserverBase.prototype, "callback", {
get: function () {
return this._callback;
},
enumerable: true,
configurable: true
});
Object.defineProperty(GesturesObserverBase.prototype, "target", {
get: function () {
return this._target;
},
enumerable: true,
configurable: true
});
Object.defineProperty(GesturesObserverBase.prototype, "context", {
get: function () {
return this._context;
},
enumerable: true,
configurable: true
});
GesturesObserverBase.prototype.disconnect = function () {
if (this.target) {
var list = this.target.getGestureObservers(this.type);
if (list && list.length > 0) {
for (var i = 0; i < list.length; i++) {
if (list[i].callback === this.callback) {
break;
}
}
list.length = 0;
this.target._gestureObservers[this.type] = undefined;
delete this.target._gestureObservers[this.type];
}
}
this._target = null;
this._callback = null;
this._context = null;
};
return GesturesObserverBase;
}());
exports.GesturesObserverBase = GesturesObserverBase;
//# sourceMappingURL=gestures-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/gestures/gestures.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var gestures_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/gestures/gestures-common.js");
var utils_1 = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/gestures/gestures-common.js"));
var TapAndDoubleTapGestureListener;
function initializeTapAndDoubleTapGestureListener() {
if (TapAndDoubleTapGestureListener) {
return;
}
var TapAndDoubleTapGestureListenerImpl = (function (_super) {
__extends(TapAndDoubleTapGestureListenerImpl, _super);
function TapAndDoubleTapGestureListenerImpl(observer, target, type) {
var _this = _super.call(this) || this;
_this._observer = observer;
_this._target = target;
_this._type = type;
return global.__native(_this);
}
TapAndDoubleTapGestureListenerImpl.prototype.onSingleTapUp = function (motionEvent) {
if (this._type & gestures_common_1.GestureTypes.tap) {
var args = _getArgs(gestures_common_1.GestureTypes.tap, this._target, motionEvent);
_executeCallback(this._observer, args);
}
return true;
};
TapAndDoubleTapGestureListenerImpl.prototype.onDoubleTap = function (motionEvent) {
if (this._type & gestures_common_1.GestureTypes.doubleTap) {
var args = _getArgs(gestures_common_1.GestureTypes.doubleTap, this._target, motionEvent);
_executeCallback(this._observer, args);
}
return true;
};
TapAndDoubleTapGestureListenerImpl.prototype.onDown = function (motionEvent) {
return true;
};
TapAndDoubleTapGestureListenerImpl.prototype.onLongPress = function (motionEvent) {
if (this._type & gestures_common_1.GestureTypes.longPress) {
var args = _getArgs(gestures_common_1.GestureTypes.longPress, this._target, motionEvent);
_executeCallback(this._observer, args);
}
};
return TapAndDoubleTapGestureListenerImpl;
}(android.view.GestureDetector.SimpleOnGestureListener));
TapAndDoubleTapGestureListener = TapAndDoubleTapGestureListenerImpl;
}
var PinchGestureListener;
function initializePinchGestureListener() {
if (PinchGestureListener) {
return;
}
var PinchGestureListenerImpl = (function (_super) {
__extends(PinchGestureListenerImpl, _super);
function PinchGestureListenerImpl(observer, target) {
var _this = _super.call(this) || this;
_this._observer = observer;
_this._target = target;
return global.__native(_this);
}
PinchGestureListenerImpl.prototype.onScaleBegin = function (detector) {
this._scale = detector.getScaleFactor();
var args = new PinchGestureEventData(this._target, detector, this._scale, this._target, gestures_common_1.GestureStateTypes.began);
_executeCallback(this._observer, args);
return true;
};
PinchGestureListenerImpl.prototype.onScale = function (detector) {
this._scale *= detector.getScaleFactor();
var args = new PinchGestureEventData(this._target, detector, this._scale, this._target, gestures_common_1.GestureStateTypes.changed);
_executeCallback(this._observer, args);
return true;
};
PinchGestureListenerImpl.prototype.onScaleEnd = function (detector) {
this._scale *= detector.getScaleFactor();
var args = new PinchGestureEventData(this._target, detector, this._scale, this._target, gestures_common_1.GestureStateTypes.ended);
_executeCallback(this._observer, args);
};
return PinchGestureListenerImpl;
}(android.view.ScaleGestureDetector.SimpleOnScaleGestureListener));
PinchGestureListener = PinchGestureListenerImpl;
}
var SwipeGestureListener;
function initializeSwipeGestureListener() {
if (SwipeGestureListener) {
return;
}
var SwipeGestureListenerImpl = (function (_super) {
__extends(SwipeGestureListenerImpl, _super);
function SwipeGestureListenerImpl(observer, target) {
var _this = _super.call(this) || this;
_this._observer = observer;
_this._target = target;
return global.__native(_this);
}
SwipeGestureListenerImpl.prototype.onDown = function (motionEvent) {
return true;
};
SwipeGestureListenerImpl.prototype.onFling = function (initialEvent, currentEvent, velocityX, velocityY) {
var result = false;
var args;
try {
var deltaY = currentEvent.getY() - initialEvent.getY();
var deltaX = currentEvent.getX() - initialEvent.getX();
if (Math.abs(deltaX) > Math.abs(deltaY)) {
if (Math.abs(deltaX) > SWIPE_THRESHOLD
&& Math.abs(velocityX) > SWIPE_VELOCITY_THRESHOLD) {
if (deltaX > 0) {
args = _getSwipeArgs(gestures_common_1.SwipeDirection.right, this._target, initialEvent, currentEvent);
_executeCallback(this._observer, args);
result = true;
}
else {
args = _getSwipeArgs(gestures_common_1.SwipeDirection.left, this._target, initialEvent, currentEvent);
_executeCallback(this._observer, args);
result = true;
}
}
}
else {
if (Math.abs(deltaY) > SWIPE_THRESHOLD
&& Math.abs(velocityY) > SWIPE_VELOCITY_THRESHOLD) {
if (deltaY > 0) {
args = _getSwipeArgs(gestures_common_1.SwipeDirection.down, this._target, initialEvent, currentEvent);
_executeCallback(this._observer, args);
result = true;
}
else {
args = _getSwipeArgs(gestures_common_1.SwipeDirection.up, this._target, initialEvent, currentEvent);
_executeCallback(this._observer, args);
result = true;
}
}
}
}
catch (ex) {
}
return result;
};
return SwipeGestureListenerImpl;
}(android.view.GestureDetector.SimpleOnGestureListener));
SwipeGestureListener = SwipeGestureListenerImpl;
}
var SWIPE_THRESHOLD = 100;
var SWIPE_VELOCITY_THRESHOLD = 100;
var INVALID_POINTER_ID = -1;
var TO_DEGREES = (180 / Math.PI);
function observe(target, type, callback, context) {
var observer = new GesturesObserver(target, callback, context);
observer.observe(type);
return observer;
}
exports.observe = observe;
var GesturesObserver = (function (_super) {
__extends(GesturesObserver, _super);
function GesturesObserver() {
return _super !== null && _super.apply(this, arguments) || this;
}
GesturesObserver.prototype.observe = function (type) {
var _this = this;
if (this.target) {
this.type = type;
this._onTargetLoaded = function (args) {
_this._attach(_this.target, type);
};
this._onTargetUnloaded = function (args) {
_this._detach();
};
this.target.on("loaded", this._onTargetLoaded);
this.target.on("unloaded", this._onTargetUnloaded);
if (this.target.isLoaded) {
this._attach(this.target, type);
}
}
};
GesturesObserver.prototype.disconnect = function () {
this._detach();
if (this.target) {
this.target.off("loaded", this._onTargetLoaded);
this.target.off("unloaded", this._onTargetUnloaded);
this._onTargetLoaded = null;
this._onTargetUnloaded = null;
}
_super.prototype.disconnect.call(this);
};
GesturesObserver.prototype._detach = function () {
this._notifyTouch = false;
this._simpleGestureDetector = null;
this._scaleGestureDetector = null;
this._swipeGestureDetector = null;
this._panGestureDetector = null;
this._rotateGestureDetector = null;
this._eventData = null;
};
GesturesObserver.prototype._attach = function (target, type) {
this._detach();
if (type & gestures_common_1.GestureTypes.tap || type & gestures_common_1.GestureTypes.doubleTap || type & gestures_common_1.GestureTypes.longPress) {
initializeTapAndDoubleTapGestureListener();
this._simpleGestureDetector = new android.support.v4.view.GestureDetectorCompat(target._context, new TapAndDoubleTapGestureListener(this, this.target, type));
}
if (type & gestures_common_1.GestureTypes.pinch) {
initializePinchGestureListener();
this._scaleGestureDetector = new android.view.ScaleGestureDetector(target._context, new PinchGestureListener(this, this.target));
}
if (type & gestures_common_1.GestureTypes.swipe) {
initializeSwipeGestureListener();
this._swipeGestureDetector = new android.support.v4.view.GestureDetectorCompat(target._context, new SwipeGestureListener(this, this.target));
}
if (type & gestures_common_1.GestureTypes.pan) {
this._panGestureDetector = new CustomPanGestureDetector(this, this.target);
}
if (type & gestures_common_1.GestureTypes.rotation) {
this._rotateGestureDetector = new CustomRotateGestureDetector(this, this.target);
}
if (type & gestures_common_1.GestureTypes.touch) {
this._notifyTouch = true;
}
};
GesturesObserver.prototype.androidOnTouchEvent = function (motionEvent) {
if (this._notifyTouch) {
if (!this._eventData) {
this._eventData = new TouchGestureEventData();
}
this._eventData.prepare(this.target, motionEvent);
_executeCallback(this, this._eventData);
}
if (this._simpleGestureDetector) {
this._simpleGestureDetector.onTouchEvent(motionEvent);
}
if (this._scaleGestureDetector) {
this._scaleGestureDetector.onTouchEvent(motionEvent);
}
if (this._swipeGestureDetector) {
this._swipeGestureDetector.onTouchEvent(motionEvent);
}
if (this._panGestureDetector) {
this._panGestureDetector.onTouchEvent(motionEvent);
}
if (this._rotateGestureDetector) {
this._rotateGestureDetector.onTouchEvent(motionEvent);
}
};
return GesturesObserver;
}(gestures_common_1.GesturesObserverBase));
exports.GesturesObserver = GesturesObserver;
function _getArgs(type, view, e) {
return {
type: type,
view: view,
android: e,
ios: undefined,
object: view,
eventName: gestures_common_1.toString(type),
};
}
function _getSwipeArgs(direction, view, initialEvent, currentEvent) {
return {
type: gestures_common_1.GestureTypes.swipe,
view: view,
android: { initial: initialEvent, current: currentEvent },
direction: direction,
ios: undefined,
object: view,
eventName: gestures_common_1.toString(gestures_common_1.GestureTypes.swipe),
};
}
function _getPanArgs(deltaX, deltaY, view, state, initialEvent, currentEvent) {
return {
type: gestures_common_1.GestureTypes.pan,
view: view,
android: { initial: initialEvent, current: currentEvent },
deltaX: deltaX,
deltaY: deltaY,
ios: undefined,
object: view,
eventName: gestures_common_1.toString(gestures_common_1.GestureTypes.pan),
state: state
};
}
function _executeCallback(observer, args) {
if (observer && observer.callback) {
observer.callback.call(observer._context, args);
}
}
var PinchGestureEventData = (function () {
function PinchGestureEventData(view, android, scale, object, state) {
this.view = view;
this.android = android;
this.scale = scale;
this.object = object;
this.state = state;
this.type = gestures_common_1.GestureTypes.pinch;
this.eventName = gestures_common_1.toString(gestures_common_1.GestureTypes.pinch);
}
PinchGestureEventData.prototype.getFocusX = function () {
return this.android.getFocusX() / utils_1.layout.getDisplayDensity();
};
PinchGestureEventData.prototype.getFocusY = function () {
return this.android.getFocusY() / utils_1.layout.getDisplayDensity();
};
return PinchGestureEventData;
}());
var CustomPanGestureDetector = (function () {
function CustomPanGestureDetector(observer, target) {
this.observer = observer;
this.target = target;
this.isTracking = false;
this.density = utils_1.layout.getDisplayDensity();
}
CustomPanGestureDetector.prototype.onTouchEvent = function (event) {
switch (event.getActionMasked()) {
case android.view.MotionEvent.ACTION_UP:
case android.view.MotionEvent.ACTION_CANCEL:
this.trackStop(event, false);
break;
case android.view.MotionEvent.ACTION_DOWN:
case android.view.MotionEvent.ACTION_POINTER_DOWN:
case android.view.MotionEvent.ACTION_POINTER_UP:
this.trackStop(event, true);
break;
case android.view.MotionEvent.ACTION_MOVE:
if (!this.isTracking) {
this.trackStart(event);
}
this.trackChange(event);
break;
}
return true;
};
CustomPanGestureDetector.prototype.trackStop = function (currentEvent, cahceEvent) {
if (this.isTracking) {
var args = _getPanArgs(this.deltaX, this.deltaY, this.target, gestures_common_1.GestureStateTypes.ended, null, currentEvent);
_executeCallback(this.observer, args);
this.deltaX = undefined;
this.deltaY = undefined;
this.isTracking = false;
}
if (cahceEvent) {
this.lastEventCache = currentEvent;
}
else {
this.lastEventCache = undefined;
}
};
CustomPanGestureDetector.prototype.trackStart = function (currentEvent) {
var inital = this.getEventCoordinates(this.lastEventCache ? this.lastEventCache : currentEvent);
this.initialX = inital.x;
this.initialY = inital.y;
this.isTracking = true;
var args = _getPanArgs(0, 0, this.target, gestures_common_1.GestureStateTypes.began, null, currentEvent);
_executeCallback(this.observer, args);
};
CustomPanGestureDetector.prototype.trackChange = function (currentEvent) {
var current = this.getEventCoordinates(currentEvent);
this.deltaX = current.x - this.initialX;
this.deltaY = current.y - this.initialY;
var args = _getPanArgs(this.deltaX, this.deltaY, this.target, gestures_common_1.GestureStateTypes.changed, null, currentEvent);
_executeCallback(this.observer, args);
};
CustomPanGestureDetector.prototype.getEventCoordinates = function (event) {
var count = event.getPointerCount();
if (count === 1) {
return {
x: event.getRawX() / this.density,
y: event.getRawY() / this.density
};
}
else {
var offX = event.getRawX() - event.getX();
var offY = event.getRawY() - event.getY();
var res = { x: 0, y: 0 };
for (var i = 0; i < count; i++) {
res.x += event.getX(i) + offX;
res.y += event.getY(i) + offY;
}
res.x /= (count * this.density);
res.y /= (count * this.density);
return res;
}
};
return CustomPanGestureDetector;
}());
var CustomRotateGestureDetector = (function () {
function CustomRotateGestureDetector(observer, target) {
this.observer = observer;
this.target = target;
this.trackedPtrId1 = INVALID_POINTER_ID;
this.trackedPtrId2 = INVALID_POINTER_ID;
}
Object.defineProperty(CustomRotateGestureDetector.prototype, "isTracking", {
get: function () {
return this.trackedPtrId1 !== INVALID_POINTER_ID && this.trackedPtrId2 !== INVALID_POINTER_ID;
},
enumerable: true,
configurable: true
});
CustomRotateGestureDetector.prototype.onTouchEvent = function (event) {
var pointerID = event.getPointerId(event.getActionIndex());
var wasTracking = this.isTracking;
switch (event.getActionMasked()) {
case android.view.MotionEvent.ACTION_DOWN:
case android.view.MotionEvent.ACTION_POINTER_DOWN:
var assigned = false;
if (this.trackedPtrId1 === INVALID_POINTER_ID && pointerID !== this.trackedPtrId2) {
this.trackedPtrId1 = pointerID;
assigned = true;
}
else if (this.trackedPtrId2 === INVALID_POINTER_ID && pointerID !== this.trackedPtrId1) {
this.trackedPtrId2 = pointerID;
assigned = true;
}
if (assigned && this.isTracking) {
this.angle = 0;
this.initalPointersAngle = this.getPointersAngle(event);
this.executeCallback(event, gestures_common_1.GestureStateTypes.began);
}
break;
case android.view.MotionEvent.ACTION_MOVE:
if (this.isTracking) {
this.updateAngle(event);
this.executeCallback(event, gestures_common_1.GestureStateTypes.changed);
}
break;
case android.view.MotionEvent.ACTION_UP:
case android.view.MotionEvent.ACTION_POINTER_UP:
if (pointerID === this.trackedPtrId1) {
this.trackedPtrId1 = INVALID_POINTER_ID;
}
else if (pointerID === this.trackedPtrId2) {
this.trackedPtrId2 = INVALID_POINTER_ID;
}
if (wasTracking && !this.isTracking) {
this.executeCallback(event, gestures_common_1.GestureStateTypes.ended);
}
break;
case android.view.MotionEvent.ACTION_CANCEL:
this.trackedPtrId1 = INVALID_POINTER_ID;
this.trackedPtrId2 = INVALID_POINTER_ID;
if (wasTracking) {
this.executeCallback(event, gestures_common_1.GestureStateTypes.cancelled);
}
break;
}
return true;
};
CustomRotateGestureDetector.prototype.executeCallback = function (event, state) {
var args = {
type: gestures_common_1.GestureTypes.rotation,
view: this.target,
android: event,
rotation: this.angle,
ios: undefined,
object: this.target,
eventName: gestures_common_1.toString(gestures_common_1.GestureTypes.rotation),
state: state
};
_executeCallback(this.observer, args);
};
CustomRotateGestureDetector.prototype.updateAngle = function (event) {
var newPointersAngle = this.getPointersAngle(event);
var result = ((newPointersAngle - this.initalPointersAngle) * TO_DEGREES) % 360;
if (result < -180) {
result += 360;
}
if (result > 180) {
result -= 360;
}
this.angle = result;
};
CustomRotateGestureDetector.prototype.getPointersAngle = function (event) {
var firstX = event.getX(event.findPointerIndex(this.trackedPtrId1));
var firstY = event.getY(event.findPointerIndex(this.trackedPtrId1));
var secondX = event.getX(event.findPointerIndex(this.trackedPtrId2));
var secondY = event.getY(event.findPointerIndex(this.trackedPtrId2));
return Math.atan2((secondY - firstY), (secondX - firstX));
};
return CustomRotateGestureDetector;
}());
var Pointer = (function () {
function Pointer(id, event) {
this.event = event;
this.ios = undefined;
this.android = id;
}
Pointer.prototype.getX = function () {
return this.event.getX(this.android) / utils_1.layout.getDisplayDensity();
};
Pointer.prototype.getY = function () {
return this.event.getY(this.android) / utils_1.layout.getDisplayDensity();
};
return Pointer;
}());
var TouchGestureEventData = (function () {
function TouchGestureEventData() {
this.eventName = gestures_common_1.toString(gestures_common_1.GestureTypes.touch);
this.type = gestures_common_1.GestureTypes.touch;
this.ios = undefined;
}
TouchGestureEventData.prototype.prepare = function (view, e) {
this.view = view;
this.object = view;
this.android = e;
this.action = this.getActionType(e);
this._activePointers = undefined;
this._allPointers = undefined;
};
TouchGestureEventData.prototype.getPointerCount = function () {
return this.android.getPointerCount();
};
TouchGestureEventData.prototype.getActivePointers = function () {
if (!this._activePointers) {
this._activePointers = [new Pointer(this.android.getActionIndex(), this.android)];
}
return this._activePointers;
};
TouchGestureEventData.prototype.getAllPointers = function () {
if (!this._allPointers) {
this._allPointers = [];
for (var i = 0; i < this.getPointerCount(); i++) {
this._allPointers.push(new Pointer(i, this.android));
}
}
return this._allPointers;
};
TouchGestureEventData.prototype.getX = function () {
return this.getActivePointers()[0].getX();
};
TouchGestureEventData.prototype.getY = function () {
return this.getActivePointers()[0].getY();
};
TouchGestureEventData.prototype.getActionType = function (e) {
switch (e.getActionMasked()) {
case android.view.MotionEvent.ACTION_DOWN:
case android.view.MotionEvent.ACTION_POINTER_DOWN:
return gestures_common_1.TouchAction.down;
case android.view.MotionEvent.ACTION_MOVE:
return gestures_common_1.TouchAction.move;
case android.view.MotionEvent.ACTION_UP:
case android.view.MotionEvent.ACTION_POINTER_UP:
return gestures_common_1.TouchAction.up;
case android.view.MotionEvent.ACTION_CANCEL:
return gestures_common_1.TouchAction.cancel;
}
return "";
};
return TouchGestureEventData;
}());
//# sourceMappingURL=gestures.android.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/html-view/html-view-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js"));
var HtmlViewBase = (function (_super) {
__extends(HtmlViewBase, _super);
function HtmlViewBase() {
return _super !== null && _super.apply(this, arguments) || this;
}
HtmlViewBase = __decorate([
view_1.CSSType("HtmlView")
], HtmlViewBase);
return HtmlViewBase;
}(view_1.View));
exports.HtmlViewBase = HtmlViewBase;
HtmlViewBase.prototype.recycleNativeView = "auto";
exports.htmlProperty = new view_1.Property({ name: "html", defaultValue: "", affectsLayout: true });
exports.htmlProperty.register(HtmlViewBase);
//# sourceMappingURL=html-view-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/html-view/html-view.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var html_view_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/html-view/html-view-common.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/html-view/html-view-common.js"));
var HtmlView = (function (_super) {
__extends(HtmlView, _super);
function HtmlView() {
return _super !== null && _super.apply(this, arguments) || this;
}
HtmlView.prototype.createNativeView = function () {
return new android.widget.TextView(this._context);
};
HtmlView.prototype.initNativeView = function () {
_super.prototype.initNativeView.call(this);
var nativeView = this.nativeViewProtected;
nativeView.setLinksClickable(true);
nativeView.setMovementMethod(android.text.method.LinkMovementMethod.getInstance());
};
HtmlView.prototype.resetNativeView = function () {
_super.prototype.resetNativeView.call(this);
this.nativeViewProtected.setAutoLinkMask(0);
};
HtmlView.prototype[html_view_common_1.htmlProperty.getDefault] = function () {
return "";
};
HtmlView.prototype[html_view_common_1.htmlProperty.setNative] = function (value) {
var mask = 15;
if (value.search(/<a\s/i) >= 0) {
mask = 0;
}
this.nativeViewProtected.setAutoLinkMask(mask);
this.nativeViewProtected.setText(android.text.Html.fromHtml(value));
};
return HtmlView;
}(html_view_common_1.HtmlViewBase));
exports.HtmlView = HtmlView;
//# sourceMappingURL=html-view.android.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/image/image-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
var image_asset_1 = __webpack_require__("../node_modules/tns-core-modules/image-asset/image-asset.js");
exports.ImageAsset = image_asset_1.ImageAsset;
var image_source_1 = __webpack_require__("../node_modules/tns-core-modules/image-source/image-source.js");
exports.ImageSource = image_source_1.ImageSource;
exports.fromAsset = image_source_1.fromAsset;
exports.fromNativeSource = image_source_1.fromNativeSource;
exports.fromUrl = image_source_1.fromUrl;
var utils_1 = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
exports.isDataURI = utils_1.isDataURI;
exports.isFileOrResourcePath = utils_1.isFileOrResourcePath;
exports.RESOURCE_PREFIX = utils_1.RESOURCE_PREFIX;
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js"));
var ImageBase = (function (_super) {
__extends(ImageBase, _super);
function ImageBase() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(ImageBase.prototype, "tintColor", {
get: function () {
return this.style.tintColor;
},
set: function (value) {
this.style.tintColor = value;
},
enumerable: true,
configurable: true
});
ImageBase.prototype._createImageSourceFromSrc = function (value) {
var _this = this;
var originalValue = value;
var sync = this.loadMode === "sync";
if (typeof value === "string" || value instanceof String) {
value = value.trim();
this.imageSource = null;
this["_url"] = value;
this.isLoading = true;
var source_1 = new image_source_1.ImageSource();
var imageLoaded = function () {
var currentValue = _this.src;
if (currentValue !== originalValue) {
return;
}
_this.imageSource = source_1;
_this.isLoading = false;
};
if (utils_1.isDataURI(value)) {
var base64Data = value.split(",")[1];
if (base64Data !== undefined) {
if (sync) {
source_1.loadFromBase64(base64Data);
imageLoaded();
}
else {
source_1.fromBase64(base64Data).then(imageLoaded);
}
}
}
else if (utils_1.isFileOrResourcePath(value)) {
if (value.indexOf(utils_1.RESOURCE_PREFIX) === 0) {
var resPath = value.substr(utils_1.RESOURCE_PREFIX.length);
if (sync) {
source_1.loadFromResource(resPath);
imageLoaded();
}
else {
this.imageSource = null;
source_1.fromResource(resPath).then(imageLoaded);
}
}
else {
if (sync) {
source_1.loadFromFile(value);
imageLoaded();
}
else {
this.imageSource = null;
source_1.fromFile(value).then(imageLoaded);
}
}
}
else {
this.imageSource = null;
image_source_1.fromUrl(value).then(function (r) {
if (_this["_url"] === value) {
_this.imageSource = r;
_this.isLoading = false;
}
}, function (err) {
_this.isLoading = false;
if (view_1.traceEnabled()) {
if (typeof err === "object" && err.message) {
err = err.message;
}
view_1.traceWrite(err, view_1.traceCategories.Debug);
}
});
}
}
else if (value instanceof image_source_1.ImageSource) {
this.imageSource = value;
this.isLoading = false;
}
else if (value instanceof image_asset_1.ImageAsset) {
image_source_1.fromAsset(value).then(function (result) {
_this.imageSource = result;
_this.isLoading = false;
});
}
else {
this.imageSource = image_source_1.fromNativeSource(value);
this.isLoading = false;
}
};
ImageBase = __decorate([
view_1.CSSType("Image")
], ImageBase);
return ImageBase;
}(view_1.View));
exports.ImageBase = ImageBase;
ImageBase.prototype.recycleNativeView = "auto";
exports.imageSourceProperty = new view_1.Property({ name: "imageSource" });
exports.imageSourceProperty.register(ImageBase);
exports.srcProperty = new view_1.Property({ name: "src" });
exports.srcProperty.register(ImageBase);
exports.loadModeProperty = new view_1.Property({ name: "loadMode", defaultValue: "sync" });
exports.loadModeProperty.register(ImageBase);
exports.isLoadingProperty = new view_1.Property({ name: "isLoading", defaultValue: false, valueConverter: view_1.booleanConverter });
exports.isLoadingProperty.register(ImageBase);
exports.stretchProperty = new view_1.Property({ name: "stretch", defaultValue: "aspectFit", affectsLayout: view_1.isIOS });
exports.stretchProperty.register(ImageBase);
exports.tintColorProperty = new view_1.InheritedCssProperty({ name: "tintColor", cssName: "tint-color", equalityComparer: view_1.Color.equals, valueConverter: function (value) { return new view_1.Color(value); } });
exports.tintColorProperty.register(view_1.Style);
exports.decodeHeightProperty = new view_1.Property({ name: "decodeHeight", defaultValue: { value: 0, unit: "dip" }, valueConverter: view_1.Length.parse });
exports.decodeHeightProperty.register(ImageBase);
exports.decodeWidthProperty = new view_1.Property({ name: "decodeWidth", defaultValue: { value: 0, unit: "dip" }, valueConverter: view_1.Length.parse });
exports.decodeWidthProperty.register(ImageBase);
//# sourceMappingURL=image-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/image/image.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var image_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/image/image-common.js");
var file_system_1 = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system.js");
var platform = __webpack_require__("../node_modules/tns-core-modules/platform/platform.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/image/image-common.js"));
var FILE_PREFIX = "file:///";
var ASYNC = "async";
var AndroidImageView;
var ImageLoadedListener;
function initializeImageLoadedListener() {
if (ImageLoadedListener) {
return;
}
var ImageLoadedListenerImpl = (function (_super) {
__extends(ImageLoadedListenerImpl, _super);
function ImageLoadedListenerImpl(owner) {
var _this = _super.call(this) || this;
_this.owner = owner;
return global.__native(_this);
}
ImageLoadedListenerImpl.prototype.onImageLoaded = function (success) {
var owner = this.owner;
if (owner) {
owner.isLoading = false;
}
};
ImageLoadedListenerImpl = __decorate([
Interfaces([org.nativescript.widgets.image.Worker.OnImageLoadedListener])
], ImageLoadedListenerImpl);
return ImageLoadedListenerImpl;
}(java.lang.Object));
ImageLoadedListener = ImageLoadedListenerImpl;
}
var Image = (function (_super) {
__extends(Image, _super);
function Image() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.useCache = true;
return _this;
}
Image.prototype.createNativeView = function () {
if (!AndroidImageView) {
AndroidImageView = org.nativescript.widgets.ImageView;
}
return new AndroidImageView(this._context);
};
Image.prototype.initNativeView = function () {
_super.prototype.initNativeView.call(this);
initializeImageLoadedListener();
var nativeView = this.nativeViewProtected;
var listener = new ImageLoadedListener(this);
nativeView.setImageLoadedListener(listener);
nativeView.listener = listener;
};
Image.prototype.disposeNativeView = function () {
this.nativeViewProtected.listener.owner = null;
_super.prototype.disposeNativeView.call(this);
};
Image.prototype.resetNativeView = function () {
_super.prototype.resetNativeView.call(this);
this.nativeViewProtected.setImageMatrix(new android.graphics.Matrix());
};
Image.prototype._createImageSourceFromSrc = function (value) {
var imageView = this.nativeViewProtected;
if (!imageView) {
return;
}
if (!value) {
imageView.setUri(null, 0, 0, false, false, true);
return;
}
var screen = platform.screen.mainScreen;
var decodeWidth = Math.min(image_common_1.Length.toDevicePixels(this.decodeWidth, 0), screen.widthPixels);
var decodeHeight = Math.min(image_common_1.Length.toDevicePixels(this.decodeHeight, 0), screen.heightPixels);
var keepAspectRatio = this._calculateKeepAspectRatio();
if (value instanceof image_common_1.ImageAsset) {
if (value.options) {
decodeWidth = value.options.width || decodeWidth;
decodeHeight = value.options.height || decodeHeight;
keepAspectRatio = !!value.options.keepAspectRatio;
}
value = value.android;
}
var async = this.loadMode === ASYNC;
if (typeof value === "string" || value instanceof String) {
value = value.trim();
this.isLoading = true;
if (image_common_1.isDataURI(value)) {
_super.prototype._createImageSourceFromSrc.call(this, value);
}
else if (image_common_1.isFileOrResourcePath(value)) {
if (value.indexOf(image_common_1.RESOURCE_PREFIX) === 0) {
imageView.setUri(value, decodeWidth, decodeHeight, keepAspectRatio, this.useCache, async);
}
else {
var fileName = value;
if (fileName.indexOf("~/") === 0) {
fileName = file_system_1.knownFolders.currentApp().path + "/" + fileName.replace("~/", "");
}
imageView.setUri(FILE_PREFIX + fileName, decodeWidth, decodeHeight, keepAspectRatio, this.useCache, async);
}
}
else {
imageView.setUri(value, decodeWidth, decodeHeight, keepAspectRatio, this.useCache, true);
}
}
else {
_super.prototype._createImageSourceFromSrc.call(this, value);
}
};
Image.prototype._calculateKeepAspectRatio = function () {
return this.stretch === "fill" ? false : true;
};
Image.prototype[image_common_1.stretchProperty.getDefault] = function () {
return "aspectFit";
};
Image.prototype[image_common_1.stretchProperty.setNative] = function (value) {
switch (value) {
case "aspectFit":
this.nativeViewProtected.setScaleType(android.widget.ImageView.ScaleType.FIT_CENTER);
break;
case "aspectFill":
this.nativeViewProtected.setScaleType(android.widget.ImageView.ScaleType.CENTER_CROP);
break;
case "fill":
this.nativeViewProtected.setScaleType(android.widget.ImageView.ScaleType.FIT_XY);
break;
case "none":
default:
this.nativeViewProtected.setScaleType(android.widget.ImageView.ScaleType.MATRIX);
break;
}
};
Image.prototype[image_common_1.tintColorProperty.getDefault] = function () {
return undefined;
};
Image.prototype[image_common_1.tintColorProperty.setNative] = function (value) {
if (value === undefined) {
this.nativeViewProtected.clearColorFilter();
}
else {
this.nativeViewProtected.setColorFilter(value.android);
}
};
Image.prototype[image_common_1.imageSourceProperty.getDefault] = function () {
return undefined;
};
Image.prototype[image_common_1.imageSourceProperty.setNative] = function (value) {
var nativeView = this.nativeViewProtected;
if (value && value.android) {
var rotation = value.rotationAngle ? value.rotationAngle : 0;
nativeView.setRotationAngle(rotation);
nativeView.setImageBitmap(value.android);
}
else {
nativeView.setRotationAngle(0);
nativeView.setImageBitmap(null);
}
};
Image.prototype[image_common_1.srcProperty.getDefault] = function () {
return undefined;
};
Image.prototype[image_common_1.srcProperty.setNative] = function (value) {
this._createImageSourceFromSrc(value);
};
return Image;
}(image_common_1.ImageBase));
exports.Image = Image;
//# sourceMappingURL=image.android.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/label/label.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var text_base_1 = __webpack_require__("../node_modules/tns-core-modules/ui/text-base/text-base.js");
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/text-base/text-base.js"));
var TextView;
var Label = (function (_super) {
__extends(Label, _super);
function Label() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(Label.prototype, "textWrap", {
get: function () {
return this.style.whiteSpace === "normal";
},
set: function (value) {
if (typeof value === "string") {
value = text_base_1.booleanConverter(value);
}
this.style.whiteSpace = value ? "normal" : "nowrap";
},
enumerable: true,
configurable: true
});
Label.prototype.createNativeView = function () {
if (!TextView) {
TextView = android.widget.TextView;
}
return new TextView(this._context);
};
Label.prototype.initNativeView = function () {
_super.prototype.initNativeView.call(this);
var textView = this.nativeTextViewProtected;
textView.setSingleLine(true);
textView.setEllipsize(android.text.TextUtils.TruncateAt.END);
};
Label.prototype[text_base_1.whiteSpaceProperty.setNative] = function (value) {
var newValue = value === "initial" ? "nowrap" : value;
_super.prototype[text_base_1.whiteSpaceProperty.setNative].call(this, newValue);
};
__decorate([
profiling_1.profile
], Label.prototype, "createNativeView", null);
Label = __decorate([
text_base_1.CSSType("Label")
], Label);
return Label;
}(text_base_1.TextBase));
exports.Label = Label;
Label.prototype._isSingleLine = true;
Label.prototype.recycleNativeView = "auto";
//# sourceMappingURL=label.android.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/layouts/absolute-layout/absolute-layout-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var layout_base_1 = __webpack_require__("../node_modules/tns-core-modules/ui/layouts/layout-base.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/layouts/layout-base.js"));
layout_base_1.View.prototype.effectiveLeft = 0;
layout_base_1.View.prototype.effectiveTop = 0;
function validateArgs(element) {
if (!element) {
throw new Error("element cannot be null or undefinied.");
}
return element;
}
var AbsoluteLayoutBase = (function (_super) {
__extends(AbsoluteLayoutBase, _super);
function AbsoluteLayoutBase() {
return _super !== null && _super.apply(this, arguments) || this;
}
AbsoluteLayoutBase.getLeft = function (element) {
return validateArgs(element).left;
};
AbsoluteLayoutBase.setLeft = function (element, value) {
validateArgs(element).left = value;
};
AbsoluteLayoutBase.getTop = function (element) {
return validateArgs(element).top;
};
AbsoluteLayoutBase.setTop = function (element, value) {
validateArgs(element).top = value;
};
AbsoluteLayoutBase.prototype.onLeftChanged = function (view, oldValue, newValue) {
};
AbsoluteLayoutBase.prototype.onTopChanged = function (view, oldValue, newValue) {
};
AbsoluteLayoutBase = __decorate([
layout_base_1.CSSType("AbsoluteLayout")
], AbsoluteLayoutBase);
return AbsoluteLayoutBase;
}(layout_base_1.LayoutBase));
exports.AbsoluteLayoutBase = AbsoluteLayoutBase;
AbsoluteLayoutBase.prototype.recycleNativeView = "auto";
exports.leftProperty = new layout_base_1.Property({
name: "left", defaultValue: layout_base_1.zeroLength,
valueChanged: function (target, oldValue, newValue) {
target.effectiveLeft = layout_base_1.Length.toDevicePixels(newValue, 0);
var layout = target.parent;
if (layout instanceof AbsoluteLayoutBase) {
layout.onLeftChanged(target, oldValue, newValue);
}
}, valueConverter: function (v) { return layout_base_1.Length.parse(v); }
});
exports.leftProperty.register(layout_base_1.View);
exports.topProperty = new layout_base_1.Property({
name: "top", defaultValue: layout_base_1.zeroLength,
valueChanged: function (target, oldValue, newValue) {
target.effectiveTop = layout_base_1.Length.toDevicePixels(newValue, 0);
var layout = target.parent;
if (layout instanceof AbsoluteLayoutBase) {
layout.onTopChanged(target, oldValue, newValue);
}
}, valueConverter: function (v) { return layout_base_1.Length.parse(v); }
});
exports.topProperty.register(layout_base_1.View);
//# sourceMappingURL=absolute-layout-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/layouts/absolute-layout/absolute-layout.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var absolute_layout_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/layouts/absolute-layout/absolute-layout-common.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/layouts/absolute-layout/absolute-layout-common.js"));
function makeNativeSetter(setter) {
return function (value) {
var nativeView = this.nativeViewProtected;
var lp = nativeView.getLayoutParams() || new org.nativescript.widgets.CommonLayoutParams();
if (lp instanceof org.nativescript.widgets.CommonLayoutParams) {
setter.call(this, lp, value);
nativeView.setLayoutParams(lp);
}
};
}
absolute_layout_common_1.View.prototype[absolute_layout_common_1.topProperty.setNative] = makeNativeSetter(function (lp, value) { lp.top = absolute_layout_common_1.Length.toDevicePixels(value, 0); });
absolute_layout_common_1.View.prototype[absolute_layout_common_1.leftProperty.setNative] = makeNativeSetter(function (lp, value) { lp.left = absolute_layout_common_1.Length.toDevicePixels(value, 0); });
var AbsoluteLayout = (function (_super) {
__extends(AbsoluteLayout, _super);
function AbsoluteLayout() {
return _super !== null && _super.apply(this, arguments) || this;
}
AbsoluteLayout.prototype.createNativeView = function () {
return new org.nativescript.widgets.AbsoluteLayout(this._context);
};
return AbsoluteLayout;
}(absolute_layout_common_1.AbsoluteLayoutBase));
exports.AbsoluteLayout = AbsoluteLayout;
//# sourceMappingURL=absolute-layout.android.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/layouts/dock-layout/dock-layout-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var layout_base_1 = __webpack_require__("../node_modules/tns-core-modules/ui/layouts/layout-base.js");
function validateArgs(element) {
if (!element) {
throw new Error("element cannot be null or undefinied.");
}
return element;
}
__export(__webpack_require__("../node_modules/tns-core-modules/ui/layouts/layout-base.js"));
var DockLayoutBase = (function (_super) {
__extends(DockLayoutBase, _super);
function DockLayoutBase() {
return _super !== null && _super.apply(this, arguments) || this;
}
DockLayoutBase.getDock = function (element) {
return validateArgs(element).dock;
};
DockLayoutBase.setDock = function (element, value) {
validateArgs(element).dock = value;
};
DockLayoutBase.prototype.onDockChanged = function (view, oldValue, newValue) {
};
DockLayoutBase = __decorate([
layout_base_1.CSSType("DockLayout")
], DockLayoutBase);
return DockLayoutBase;
}(layout_base_1.LayoutBase));
exports.DockLayoutBase = DockLayoutBase;
DockLayoutBase.prototype.recycleNativeView = "auto";
var dockConverter = layout_base_1.makeParser(layout_base_1.makeValidator("left", "top", "right", "bottom"));
exports.dockProperty = new layout_base_1.Property({
name: "dock", defaultValue: "left", valueChanged: function (target, oldValue, newValue) {
if (target instanceof layout_base_1.View) {
var layout = target.parent;
if (layout instanceof DockLayoutBase) {
layout.onDockChanged(target, oldValue, newValue);
}
}
}, valueConverter: dockConverter
});
exports.dockProperty.register(layout_base_1.View);
exports.stretchLastChildProperty = new layout_base_1.Property({
name: "stretchLastChild", defaultValue: true, affectsLayout: layout_base_1.isIOS, valueConverter: layout_base_1.booleanConverter
});
exports.stretchLastChildProperty.register(DockLayoutBase);
//# sourceMappingURL=dock-layout-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/layouts/dock-layout/dock-layout.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var dock_layout_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/layouts/dock-layout/dock-layout-common.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/layouts/dock-layout/dock-layout-common.js"));
dock_layout_common_1.View.prototype[dock_layout_common_1.dockProperty.setNative] = function (value) {
var nativeView = this.nativeViewProtected;
var lp = nativeView.getLayoutParams() || new org.nativescript.widgets.CommonLayoutParams();
if (lp instanceof org.nativescript.widgets.CommonLayoutParams) {
switch (value) {
case "left":
lp.dock = org.nativescript.widgets.Dock.left;
break;
case "top":
lp.dock = org.nativescript.widgets.Dock.top;
break;
case "right":
lp.dock = org.nativescript.widgets.Dock.right;
break;
case "bottom":
lp.dock = org.nativescript.widgets.Dock.bottom;
break;
default:
throw new Error("Invalid value for dock property: " + value);
}
nativeView.setLayoutParams(lp);
}
};
var DockLayout = (function (_super) {
__extends(DockLayout, _super);
function DockLayout() {
return _super !== null && _super.apply(this, arguments) || this;
}
DockLayout.prototype.createNativeView = function () {
return new org.nativescript.widgets.DockLayout(this._context);
};
DockLayout.prototype[dock_layout_common_1.stretchLastChildProperty.getDefault] = function () {
return true;
};
DockLayout.prototype[dock_layout_common_1.stretchLastChildProperty.setNative] = function (value) {
this.nativeViewProtected.setStretchLastChild(value);
};
return DockLayout;
}(dock_layout_common_1.DockLayoutBase));
exports.DockLayout = DockLayout;
//# sourceMappingURL=dock-layout.android.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/layouts/flexbox-layout/flexbox-layout-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var layout_base_1 = __webpack_require__("../node_modules/tns-core-modules/ui/layouts/layout-base.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/layouts/layout-base.js"));
exports.ORDER_DEFAULT = 1;
exports.FLEX_GROW_DEFAULT = 0.0;
exports.FLEX_SHRINK_DEFAULT = 1.0;
var FlexDirection;
(function (FlexDirection) {
FlexDirection.ROW = "row";
FlexDirection.ROW_REVERSE = "row-reverse";
FlexDirection.COLUMN = "column";
FlexDirection.COLUMN_REVERSE = "column-reverse";
FlexDirection.isValid = layout_base_1.makeValidator(FlexDirection.ROW, FlexDirection.ROW_REVERSE, FlexDirection.COLUMN, FlexDirection.COLUMN_REVERSE);
FlexDirection.parse = layout_base_1.makeParser(FlexDirection.isValid);
})(FlexDirection = exports.FlexDirection || (exports.FlexDirection = {}));
var FlexWrap;
(function (FlexWrap) {
FlexWrap.NOWRAP = "nowrap";
FlexWrap.WRAP = "wrap";
FlexWrap.WRAP_REVERSE = "wrap-reverse";
FlexWrap.isValid = layout_base_1.makeValidator(FlexWrap.NOWRAP, FlexWrap.WRAP, FlexWrap.WRAP_REVERSE);
FlexWrap.parse = layout_base_1.makeParser(FlexWrap.isValid);
})(FlexWrap = exports.FlexWrap || (exports.FlexWrap = {}));
var JustifyContent;
(function (JustifyContent) {
JustifyContent.FLEX_START = "flex-start";
JustifyContent.FLEX_END = "flex-end";
JustifyContent.CENTER = "center";
JustifyContent.SPACE_BETWEEN = "space-between";
JustifyContent.SPACE_AROUND = "space-around";
JustifyContent.isValid = layout_base_1.makeValidator(JustifyContent.FLEX_START, JustifyContent.FLEX_END, JustifyContent.CENTER, JustifyContent.SPACE_BETWEEN, JustifyContent.SPACE_AROUND);
JustifyContent.parse = layout_base_1.makeParser(JustifyContent.isValid);
})(JustifyContent = exports.JustifyContent || (exports.JustifyContent = {}));
var FlexBasisPercent;
(function (FlexBasisPercent) {
FlexBasisPercent.DEFAULT = -1;
})(FlexBasisPercent = exports.FlexBasisPercent || (exports.FlexBasisPercent = {}));
var AlignItems;
(function (AlignItems) {
AlignItems.FLEX_START = "flex-start";
AlignItems.FLEX_END = "flex-end";
AlignItems.CENTER = "center";
AlignItems.BASELINE = "baseline";
AlignItems.STRETCH = "stretch";
AlignItems.isValid = layout_base_1.makeValidator(AlignItems.FLEX_START, AlignItems.FLEX_END, AlignItems.CENTER, AlignItems.BASELINE, AlignItems.STRETCH);
AlignItems.parse = layout_base_1.makeParser(AlignItems.isValid);
})(AlignItems = exports.AlignItems || (exports.AlignItems = {}));
var AlignContent;
(function (AlignContent) {
AlignContent.FLEX_START = "flex-start";
AlignContent.FLEX_END = "flex-end";
AlignContent.CENTER = "center";
AlignContent.SPACE_BETWEEN = "space-between";
AlignContent.SPACE_AROUND = "space-around";
AlignContent.STRETCH = "stretch";
AlignContent.isValid = layout_base_1.makeValidator(AlignContent.FLEX_START, AlignContent.FLEX_END, AlignContent.CENTER, AlignContent.SPACE_BETWEEN, AlignContent.SPACE_AROUND, AlignContent.STRETCH);
AlignContent.parse = layout_base_1.makeParser(AlignContent.isValid);
})(AlignContent = exports.AlignContent || (exports.AlignContent = {}));
var Order;
(function (Order) {
function isValid(value) {
return isFinite(parseInt(value));
}
Order.isValid = isValid;
Order.parse = parseInt;
})(Order = exports.Order || (exports.Order = {}));
var FlexGrow;
(function (FlexGrow) {
function isValid(value) {
var parsed = parseInt(value);
return isFinite(parsed) && value >= 0;
}
FlexGrow.isValid = isValid;
FlexGrow.parse = parseFloat;
})(FlexGrow = exports.FlexGrow || (exports.FlexGrow = {}));
var FlexShrink;
(function (FlexShrink) {
function isValid(value) {
var parsed = parseInt(value);
return isFinite(parsed) && value >= 0;
}
FlexShrink.isValid = isValid;
FlexShrink.parse = parseFloat;
})(FlexShrink = exports.FlexShrink || (exports.FlexShrink = {}));
var FlexWrapBefore;
(function (FlexWrapBefore) {
function isValid(value) {
if (typeof value === "boolean") {
return true;
}
if (typeof value === "string") {
var str = value.trim().toLowerCase();
return str === "true" || str === "false";
}
return false;
}
FlexWrapBefore.isValid = isValid;
function parse(value) {
return value && value.toString().trim().toLowerCase() === "true";
}
FlexWrapBefore.parse = parse;
})(FlexWrapBefore = exports.FlexWrapBefore || (exports.FlexWrapBefore = {}));
var AlignSelf;
(function (AlignSelf) {
AlignSelf.AUTO = "auto";
AlignSelf.FLEX_START = "flex-start";
AlignSelf.FLEX_END = "flex-end";
AlignSelf.CENTER = "center";
AlignSelf.BASELINE = "baseline";
AlignSelf.STRETCH = "stretch";
AlignSelf.isValid = layout_base_1.makeValidator(AlignSelf.AUTO, AlignSelf.FLEX_START, AlignSelf.FLEX_END, AlignSelf.CENTER, AlignSelf.BASELINE, AlignSelf.STRETCH);
AlignSelf.parse = layout_base_1.makeParser(AlignSelf.isValid);
})(AlignSelf = exports.AlignSelf || (exports.AlignSelf = {}));
function validateArgs(element) {
if (!element) {
throw new Error("element cannot be null or undefinied.");
}
return element;
}
var FlexboxLayoutBase = (function (_super) {
__extends(FlexboxLayoutBase, _super);
function FlexboxLayoutBase() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(FlexboxLayoutBase.prototype, "flexDirection", {
get: function () {
return this.style.flexDirection;
},
set: function (value) {
this.style.flexDirection = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FlexboxLayoutBase.prototype, "flexWrap", {
get: function () {
return this.style.flexWrap;
},
set: function (value) {
this.style.flexWrap = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FlexboxLayoutBase.prototype, "justifyContent", {
get: function () {
return this.style.justifyContent;
},
set: function (value) {
this.style.justifyContent = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FlexboxLayoutBase.prototype, "alignItems", {
get: function () {
return this.style.alignItems;
},
set: function (value) {
this.style.alignItems = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FlexboxLayoutBase.prototype, "alignContent", {
get: function () {
return this.style.alignContent;
},
set: function (value) {
this.style.alignContent = value;
},
enumerable: true,
configurable: true
});
FlexboxLayoutBase.setOrder = function (view, order) {
validateArgs(view).style.order = order;
};
FlexboxLayoutBase.getOrder = function (view) {
return validateArgs(view).style.order;
};
FlexboxLayoutBase.setFlexGrow = function (view, grow) {
validateArgs(view).style.flexGrow = grow;
};
FlexboxLayoutBase.getFlexGrow = function (view) {
return validateArgs(view).style.flexGrow;
};
FlexboxLayoutBase.setFlexShrink = function (view, shrink) {
validateArgs(view).style.flexShrink = shrink;
};
FlexboxLayoutBase.getFlexShrink = function (view) {
return validateArgs(view).style.flexShrink;
};
FlexboxLayoutBase.setAlignSelf = function (view, align) {
validateArgs(view).style.alignSelf = align;
};
FlexboxLayoutBase.getAlignSelf = function (view) {
return validateArgs(view).style.alignSelf;
};
FlexboxLayoutBase.setFlexWrapBefore = function (view, wrap) {
validateArgs(view).style.flexWrapBefore = wrap;
};
FlexboxLayoutBase.getFlexWrapBefore = function (view) {
return validateArgs(view).style.flexWrapBefore;
};
FlexboxLayoutBase = __decorate([
layout_base_1.CSSType("FlexboxLayout")
], FlexboxLayoutBase);
return FlexboxLayoutBase;
}(layout_base_1.LayoutBase));
exports.FlexboxLayoutBase = FlexboxLayoutBase;
FlexboxLayoutBase.prototype.recycleNativeView = "auto";
exports.flexDirectionProperty = new layout_base_1.CssProperty({ name: "flexDirection", cssName: "flex-direction", defaultValue: FlexDirection.ROW, affectsLayout: layout_base_1.isIOS, valueConverter: FlexDirection.parse });
exports.flexDirectionProperty.register(layout_base_1.Style);
exports.flexWrapProperty = new layout_base_1.CssProperty({ name: "flexWrap", cssName: "flex-wrap", defaultValue: "nowrap", affectsLayout: layout_base_1.isIOS, valueConverter: FlexWrap.parse });
exports.flexWrapProperty.register(layout_base_1.Style);
exports.justifyContentProperty = new layout_base_1.CssProperty({ name: "justifyContent", cssName: "justify-content", defaultValue: JustifyContent.FLEX_START, affectsLayout: layout_base_1.isIOS, valueConverter: JustifyContent.parse });
exports.justifyContentProperty.register(layout_base_1.Style);
exports.alignItemsProperty = new layout_base_1.CssProperty({ name: "alignItems", cssName: "align-items", defaultValue: AlignItems.STRETCH, affectsLayout: layout_base_1.isIOS, valueConverter: AlignItems.parse });
exports.alignItemsProperty.register(layout_base_1.Style);
exports.alignContentProperty = new layout_base_1.CssProperty({ name: "alignContent", cssName: "align-content", defaultValue: AlignContent.STRETCH, affectsLayout: layout_base_1.isIOS, valueConverter: AlignContent.parse });
exports.alignContentProperty.register(layout_base_1.Style);
exports.orderProperty = new layout_base_1.CssProperty({ name: "order", cssName: "order", defaultValue: exports.ORDER_DEFAULT, valueConverter: Order.parse });
exports.orderProperty.register(layout_base_1.Style);
Object.defineProperty(layout_base_1.View.prototype, "order", {
get: function () {
return this.style.order;
},
set: function (value) {
this.style.order = value;
},
enumerable: true,
configurable: true
});
exports.flexGrowProperty = new layout_base_1.CssProperty({ name: "flexGrow", cssName: "flex-grow", defaultValue: exports.FLEX_GROW_DEFAULT, valueConverter: FlexGrow.parse });
exports.flexGrowProperty.register(layout_base_1.Style);
Object.defineProperty(layout_base_1.View.prototype, "flexGrow", {
get: function () {
return this.style.flexGrow;
},
set: function (value) {
this.style.flexGrow = value;
},
enumerable: true,
configurable: true
});
exports.flexShrinkProperty = new layout_base_1.CssProperty({ name: "flexShrink", cssName: "flex-shrink", defaultValue: exports.FLEX_SHRINK_DEFAULT, valueConverter: FlexShrink.parse });
exports.flexShrinkProperty.register(layout_base_1.Style);
Object.defineProperty(layout_base_1.View.prototype, "flexShrink", {
get: function () {
return this.style.flexShrink;
},
set: function (value) {
this.style.flexShrink = value;
},
enumerable: true,
configurable: true
});
exports.flexWrapBeforeProperty = new layout_base_1.CssProperty({ name: "flexWrapBefore", cssName: "flex-wrap-before", defaultValue: false, valueConverter: FlexWrapBefore.parse });
exports.flexWrapBeforeProperty.register(layout_base_1.Style);
Object.defineProperty(layout_base_1.View.prototype, "flexWrapBefore", {
get: function () {
return this.style.flexWrapBefore;
},
set: function (value) {
this.style.flexWrapBefore = value;
},
enumerable: true,
configurable: true
});
exports.alignSelfProperty = new layout_base_1.CssProperty({ name: "alignSelf", cssName: "align-self", defaultValue: AlignSelf.AUTO, valueConverter: AlignSelf.parse });
exports.alignSelfProperty.register(layout_base_1.Style);
Object.defineProperty(layout_base_1.View.prototype, "alignSelf", {
get: function () {
return this.style.alignSelf;
},
set: function (value) {
this.style.alignSelf = value;
},
enumerable: true,
configurable: true
});
var flexFlowProperty = new layout_base_1.ShorthandProperty({
name: "flexFlow", cssName: "flex-flow",
getter: function () {
return this.flexDirection + " " + this.flexWrap;
},
converter: function (value) {
var properties = [];
if (value === layout_base_1.unsetValue) {
properties.push([exports.flexDirectionProperty, value]);
properties.push([exports.flexWrapProperty, value]);
}
else {
var trimmed = value && value.trim();
if (trimmed) {
var values = trimmed.split(/\s+/);
if (values.length >= 1 && FlexDirection.isValid(values[0])) {
properties.push([exports.flexDirectionProperty, FlexDirection.parse(values[0])]);
}
if (value.length >= 2 && FlexWrap.isValid(values[1])) {
properties.push([exports.flexWrapProperty, FlexWrap.parse(values[1])]);
}
}
}
return properties;
}
});
flexFlowProperty.register(layout_base_1.Style);
var flexProperty = new layout_base_1.ShorthandProperty({
name: "flex", cssName: "flex",
getter: function () {
return this.flexGrow + " " + this.flexShrink;
},
converter: function (value) {
var properties = [];
if (value === layout_base_1.unsetValue) {
properties.push([exports.flexGrowProperty, value]);
properties.push([exports.flexShrinkProperty, value]);
}
else {
var trimmed = value && value.trim();
if (trimmed) {
var values = trimmed.split(/\s+/);
if (values.length === 1) {
switch (values[0]) {
case "inital":
properties.push([exports.flexGrowProperty, 0]);
properties.push([exports.flexShrinkProperty, 1]);
break;
case "auto":
properties.push([exports.flexGrowProperty, 1]);
properties.push([exports.flexShrinkProperty, 1]);
break;
case "none":
properties.push([exports.flexGrowProperty, 0]);
properties.push([exports.flexShrinkProperty, 0]);
break;
default:
if (FlexGrow.isValid(values[0])) {
properties.push([exports.flexGrowProperty, FlexGrow.parse(values[0])]);
properties.push([exports.flexShrinkProperty, 1]);
}
}
}
if (values.length >= 2) {
if (FlexGrow.isValid(values[0]) && FlexShrink.isValid(values[1])) {
properties.push([exports.flexGrowProperty, FlexGrow.parse(values[0])]);
properties.push([exports.flexShrinkProperty, FlexShrink.parse(values[1])]);
}
}
}
}
return properties;
}
});
flexProperty.register(layout_base_1.Style);
//# sourceMappingURL=flexbox-layout-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/layouts/flexbox-layout/flexbox-layout.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var _a, _b, _c, _d, _e, _f;
var flexbox_layout_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/layouts/flexbox-layout/flexbox-layout-common.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/layouts/flexbox-layout/flexbox-layout-common.js"));
var widgetFlexboxLayout;
var widgetLayoutParams;
function makeNativeSetter(setter) {
return function (value) {
var nativeView = this.nativeViewProtected;
var lp = nativeView.getLayoutParams() || new widgetLayoutParams();
if (lp instanceof widgetLayoutParams) {
setter(lp, value);
nativeView.setLayoutParams(lp);
}
};
}
flexbox_layout_common_1.View.prototype[flexbox_layout_common_1.orderProperty.setNative] = makeNativeSetter(function (lp, value) { return lp.order = value; });
flexbox_layout_common_1.View.prototype[flexbox_layout_common_1.flexGrowProperty.setNative] = makeNativeSetter(function (lp, value) { return lp.flexGrow = value; });
flexbox_layout_common_1.View.prototype[flexbox_layout_common_1.flexShrinkProperty.setNative] = makeNativeSetter(function (lp, value) { return lp.flexShrink = value; });
flexbox_layout_common_1.View.prototype[flexbox_layout_common_1.flexWrapBeforeProperty.setNative] = makeNativeSetter(function (lp, value) { return lp.wrapBefore = value; });
flexbox_layout_common_1.View.prototype[flexbox_layout_common_1.alignSelfProperty.setNative] = makeNativeSetter(function (lp, value) { return lp.alignSelf = alignSelfMap[value]; });
var flexDirectionMap = (_a = {},
_a[flexbox_layout_common_1.FlexDirection.ROW] = 0,
_a[flexbox_layout_common_1.FlexDirection.ROW_REVERSE] = 1,
_a[flexbox_layout_common_1.FlexDirection.COLUMN] = 2,
_a[flexbox_layout_common_1.FlexDirection.COLUMN_REVERSE] = 3,
_a);
var flexWrapMap = (_b = {},
_b[flexbox_layout_common_1.FlexWrap.NOWRAP] = 0,
_b[flexbox_layout_common_1.FlexWrap.WRAP] = 1,
_b[flexbox_layout_common_1.FlexWrap.WRAP_REVERSE] = 2,
_b);
var justifyContentMap = (_c = {},
_c[flexbox_layout_common_1.JustifyContent.FLEX_START] = 0,
_c[flexbox_layout_common_1.JustifyContent.FLEX_END] = 1,
_c[flexbox_layout_common_1.JustifyContent.CENTER] = 2,
_c[flexbox_layout_common_1.JustifyContent.SPACE_BETWEEN] = 3,
_c[flexbox_layout_common_1.JustifyContent.SPACE_AROUND] = 4,
_c);
var alignItemsMap = (_d = {},
_d[flexbox_layout_common_1.AlignItems.FLEX_START] = 0,
_d[flexbox_layout_common_1.AlignItems.FLEX_END] = 1,
_d[flexbox_layout_common_1.AlignItems.CENTER] = 2,
_d[flexbox_layout_common_1.AlignItems.BASELINE] = 3,
_d[flexbox_layout_common_1.AlignItems.STRETCH] = 4,
_d);
var alignContentMap = (_e = {},
_e[flexbox_layout_common_1.AlignContent.FLEX_START] = 0,
_e[flexbox_layout_common_1.AlignContent.FLEX_END] = 1,
_e[flexbox_layout_common_1.AlignContent.CENTER] = 2,
_e[flexbox_layout_common_1.AlignContent.SPACE_BETWEEN] = 3,
_e[flexbox_layout_common_1.AlignContent.SPACE_AROUND] = 4,
_e[flexbox_layout_common_1.AlignContent.STRETCH] = 5,
_e);
var alignSelfMap = (_f = {},
_f[flexbox_layout_common_1.AlignSelf.AUTO] = -1,
_f[flexbox_layout_common_1.AlignSelf.FLEX_START] = 0,
_f[flexbox_layout_common_1.AlignSelf.FLEX_END] = 1,
_f[flexbox_layout_common_1.AlignSelf.CENTER] = 2,
_f[flexbox_layout_common_1.AlignSelf.BASELINE] = 3,
_f[flexbox_layout_common_1.AlignSelf.STRETCH] = 4,
_f);
var FlexboxLayout = (function (_super) {
__extends(FlexboxLayout, _super);
function FlexboxLayout() {
var _this = _super.call(this) || this;
if (!widgetFlexboxLayout) {
widgetFlexboxLayout = org.nativescript.widgets.FlexboxLayout;
widgetLayoutParams = widgetFlexboxLayout.LayoutParams;
}
return _this;
}
FlexboxLayout.prototype.createNativeView = function () {
return new widgetFlexboxLayout(this._context);
};
FlexboxLayout.prototype.resetNativeView = function () {
_super.prototype.resetNativeView.call(this);
this.nativeViewProtected.invalidateOrdersCache();
};
FlexboxLayout.prototype[flexbox_layout_common_1.flexDirectionProperty.getDefault] = function () {
return flexbox_layout_common_1.flexDirectionProperty.defaultValue;
};
FlexboxLayout.prototype[flexbox_layout_common_1.flexDirectionProperty.setNative] = function (flexDirection) {
this.nativeViewProtected.setFlexDirection(flexDirectionMap[flexDirection]);
};
FlexboxLayout.prototype[flexbox_layout_common_1.flexWrapProperty.getDefault] = function () {
return flexbox_layout_common_1.flexWrapProperty.defaultValue;
};
FlexboxLayout.prototype[flexbox_layout_common_1.flexWrapProperty.setNative] = function (flexWrap) {
this.nativeViewProtected.setFlexWrap(flexWrapMap[flexWrap]);
};
FlexboxLayout.prototype[flexbox_layout_common_1.justifyContentProperty.getDefault] = function () {
return flexbox_layout_common_1.justifyContentProperty.defaultValue;
};
FlexboxLayout.prototype[flexbox_layout_common_1.justifyContentProperty.setNative] = function (justifyContent) {
this.nativeViewProtected.setJustifyContent(justifyContentMap[justifyContent]);
};
FlexboxLayout.prototype[flexbox_layout_common_1.alignItemsProperty.getDefault] = function () {
return flexbox_layout_common_1.alignItemsProperty.defaultValue;
};
FlexboxLayout.prototype[flexbox_layout_common_1.alignItemsProperty.setNative] = function (alignItems) {
this.nativeViewProtected.setAlignItems(alignItemsMap[alignItems]);
};
FlexboxLayout.prototype[flexbox_layout_common_1.alignContentProperty.getDefault] = function () {
return flexbox_layout_common_1.alignContentProperty.defaultValue;
};
FlexboxLayout.prototype[flexbox_layout_common_1.alignContentProperty.setNative] = function (alignContent) {
this.nativeViewProtected.setAlignContent(alignContentMap[alignContent]);
};
FlexboxLayout.prototype._updateNativeLayoutParams = function (child) {
_super.prototype._updateNativeLayoutParams.call(this, child);
var lp = child.nativeViewProtected.getLayoutParams();
var style = child.style;
lp.order = style.order;
lp.flexGrow = style.flexGrow;
lp.flexShrink = style.flexShrink;
lp.wrapBefore = style.flexWrapBefore;
lp.alignSelf = alignSelfMap[style.alignSelf];
child.nativeViewProtected.setLayoutParams(lp);
};
FlexboxLayout.prototype._setChildMinWidthNative = function (child) {
child._setMinWidthNative(0);
var nativeView = child.nativeViewProtected;
var lp = nativeView.getLayoutParams();
if (lp instanceof widgetLayoutParams) {
lp.minWidth = flexbox_layout_common_1.Length.toDevicePixels(child.style.minWidth, 0);
nativeView.setLayoutParams(lp);
}
};
FlexboxLayout.prototype._setChildMinHeightNative = function (child) {
child._setMinHeightNative(0);
var nativeView = child.nativeViewProtected;
var lp = nativeView.getLayoutParams();
if (lp instanceof widgetLayoutParams) {
lp.minHeight = flexbox_layout_common_1.Length.toDevicePixels(child.style.minHeight, 0);
nativeView.setLayoutParams(lp);
}
};
return FlexboxLayout;
}(flexbox_layout_common_1.FlexboxLayoutBase));
exports.FlexboxLayout = FlexboxLayout;
//# sourceMappingURL=flexbox-layout.android.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/layouts/grid-layout/grid-layout-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var layout_base_1 = __webpack_require__("../node_modules/tns-core-modules/ui/layouts/layout-base.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/layouts/layout-base.js"));
function validateArgs(element) {
if (!element) {
throw new Error("element cannot be null or undefinied.");
}
return element;
}
layout_base_1.View.prototype.row = 0;
layout_base_1.View.prototype.col = 0;
layout_base_1.View.prototype.rowSpan = 1;
layout_base_1.View.prototype.colSpan = 1;
function validateItemSpec(itemSpec) {
if (!itemSpec) {
throw new Error("Value cannot be undefined.");
}
if (itemSpec.owner) {
throw new Error("itemSpec is already added to GridLayout.");
}
}
function convertGridLength(value) {
if (value === GridUnitType.AUTO) {
return ItemSpec.create(1, GridUnitType.AUTO);
}
else if (value.indexOf("*") !== -1) {
var starCount = parseInt(value.replace("*", "") || "1");
return ItemSpec.create(starCount, GridUnitType.STAR);
}
else if (!isNaN(parseInt(value))) {
return ItemSpec.create(parseInt(value), GridUnitType.PIXEL);
}
else {
throw new Error("Cannot parse item spec from string: " + value);
}
}
function parseAndAddItemSpecs(value, func) {
var arr = value.split(/[\s,]+/);
for (var i = 0, length_1 = arr.length; i < length_1; i++) {
var str = arr[i].trim();
if (str.length > 0) {
func(convertGridLength(arr[i].trim()));
}
}
}
var ItemSpec = (function (_super) {
__extends(ItemSpec, _super);
function ItemSpec() {
var _this = _super.call(this) || this;
_this._actualLength = 0;
if (arguments.length === 0) {
_this._value = 1;
_this._unitType = GridUnitType.STAR;
}
else if (arguments.length === 2) {
var value = arguments[0];
var type = arguments[1];
if (typeof value === "number" && typeof type === "string") {
if (value < 0 || isNaN(value) || !isFinite(value)) {
throw new Error("Value should not be negative, NaN or Infinity: " + value);
}
_this._value = value;
_this._unitType = GridUnitType.parse(type);
}
else {
throw new Error("First argument should be number, second argument should be string.");
}
}
else {
throw new Error("ItemSpec expects 0 or 2 arguments");
}
_this.index = -1;
return _this;
}
ItemSpec.create = function (value, type) {
var spec = new ItemSpec();
spec._value = value;
spec._unitType = type;
return spec;
};
Object.defineProperty(ItemSpec.prototype, "actualLength", {
get: function () {
return this._actualLength;
},
enumerable: true,
configurable: true
});
ItemSpec.equals = function (value1, value2) {
return (value1.gridUnitType === value2.gridUnitType) && (value1.value === value2.value) && (value1.owner === value2.owner) && (value1.index === value2.index);
};
Object.defineProperty(ItemSpec.prototype, "gridUnitType", {
get: function () {
return this._unitType;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ItemSpec.prototype, "isAbsolute", {
get: function () {
return this._unitType === GridUnitType.PIXEL;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ItemSpec.prototype, "isAuto", {
get: function () {
return this._unitType === GridUnitType.AUTO;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ItemSpec.prototype, "isStar", {
get: function () {
return this._unitType === GridUnitType.STAR;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ItemSpec.prototype, "value", {
get: function () {
return this._value;
},
enumerable: true,
configurable: true
});
return ItemSpec;
}(layout_base_1.Observable));
exports.ItemSpec = ItemSpec;
var GridLayoutBase = (function (_super) {
__extends(GridLayoutBase, _super);
function GridLayoutBase() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._rows = new Array();
_this._cols = new Array();
return _this;
}
GridLayoutBase_1 = GridLayoutBase;
GridLayoutBase.getColumn = function (element) {
return validateArgs(element).col;
};
GridLayoutBase.setColumn = function (element, value) {
validateArgs(element).col = value;
};
GridLayoutBase.getColumnSpan = function (element) {
return validateArgs(element).colSpan;
};
GridLayoutBase.setColumnSpan = function (element, value) {
validateArgs(element).colSpan = value;
};
GridLayoutBase.getRow = function (element) {
return validateArgs(element).row;
};
GridLayoutBase.setRow = function (element, value) {
validateArgs(element).row = value;
};
GridLayoutBase.getRowSpan = function (element) {
return validateArgs(element).rowSpan;
};
GridLayoutBase.setRowSpan = function (element, value) {
validateArgs(element).rowSpan = value;
};
GridLayoutBase.prototype.addRow = function (itemSpec) {
validateItemSpec(itemSpec);
itemSpec.owner = this;
this._rows.push(itemSpec);
this._onRowAdded(itemSpec);
this.invalidate();
};
GridLayoutBase.prototype.addColumn = function (itemSpec) {
validateItemSpec(itemSpec);
itemSpec.owner = this;
this._cols.push(itemSpec);
this._onColumnAdded(itemSpec);
this.invalidate();
};
GridLayoutBase.prototype.addChildAtCell = function (view, row, column, rowSpan, columnSpan) {
this.addChild(view);
GridLayoutBase_1.setRow(view, row);
GridLayoutBase_1.setColumn(view, column);
if (rowSpan) {
GridLayoutBase_1.setRowSpan(view, rowSpan);
}
if (columnSpan) {
GridLayoutBase_1.setColumnSpan(view, columnSpan);
}
};
GridLayoutBase.prototype.removeRow = function (itemSpec) {
if (!itemSpec) {
throw new Error("Value is null.");
}
var index = this._rows.indexOf(itemSpec);
if (itemSpec.owner !== this || index < 0) {
throw new Error("Row is not child of this GridLayout");
}
itemSpec.index = -1;
this._rows.splice(index, 1);
this._onRowRemoved(itemSpec, index);
this.invalidate();
};
GridLayoutBase.prototype.removeColumn = function (itemSpec) {
if (!itemSpec) {
throw new Error("Value is null.");
}
var index = this._cols.indexOf(itemSpec);
if (itemSpec.owner !== this || index < 0) {
throw new Error("Column is not child of this GridLayout");
}
itemSpec.index = -1;
this._cols.splice(index, 1);
this._onColumnRemoved(itemSpec, index);
this.invalidate();
};
GridLayoutBase.prototype.removeColumns = function () {
for (var i = this._cols.length - 1; i >= 0; i--) {
var colSpec = this._cols[i];
this._onColumnRemoved(colSpec, i);
colSpec.index = -1;
}
this._cols.length = 0;
this.invalidate();
};
GridLayoutBase.prototype.removeRows = function () {
for (var i = this._rows.length - 1; i >= 0; i--) {
var rowSpec = this._rows[i];
this._onRowRemoved(rowSpec, i);
rowSpec.index = -1;
}
this._rows.length = 0;
this.invalidate();
};
GridLayoutBase.prototype.onRowChanged = function (element, oldValue, newValue) {
this.invalidate();
};
GridLayoutBase.prototype.onRowSpanChanged = function (element, oldValue, newValue) {
this.invalidate();
};
GridLayoutBase.prototype.onColumnChanged = function (element, oldValue, newValue) {
this.invalidate();
};
GridLayoutBase.prototype.onColumnSpanChanged = function (element, oldValue, newValue) {
this.invalidate();
};
GridLayoutBase.prototype._onRowAdded = function (itemSpec) {
};
GridLayoutBase.prototype._onColumnAdded = function (itemSpec) {
};
GridLayoutBase.prototype._onRowRemoved = function (itemSpec, index) {
};
GridLayoutBase.prototype._onColumnRemoved = function (itemSpec, index) {
};
GridLayoutBase.prototype.getColumns = function () {
return this._cols.slice();
};
GridLayoutBase.prototype.getRows = function () {
return this._rows.slice();
};
Object.defineProperty(GridLayoutBase.prototype, "columnsInternal", {
get: function () {
return this._cols;
},
enumerable: true,
configurable: true
});
Object.defineProperty(GridLayoutBase.prototype, "rowsInternal", {
get: function () {
return this._rows;
},
enumerable: true,
configurable: true
});
GridLayoutBase.prototype.invalidate = function () {
};
Object.defineProperty(GridLayoutBase.prototype, "rows", {
set: function (value) {
var _this = this;
this.removeRows();
parseAndAddItemSpecs(value, function (spec) { return _this.addRow(spec); });
},
enumerable: true,
configurable: true
});
Object.defineProperty(GridLayoutBase.prototype, "columns", {
set: function (value) {
var _this = this;
this.removeColumns();
parseAndAddItemSpecs(value, function (spec) { return _this.addColumn(spec); });
},
enumerable: true,
configurable: true
});
var GridLayoutBase_1;
GridLayoutBase = GridLayoutBase_1 = __decorate([
layout_base_1.CSSType("GridLayout")
], GridLayoutBase);
return GridLayoutBase;
}(layout_base_1.LayoutBase));
exports.GridLayoutBase = GridLayoutBase;
GridLayoutBase.prototype.recycleNativeView = "auto";
exports.columnProperty = new layout_base_1.Property({
name: "col", defaultValue: 0,
valueChanged: function (target, oldValue, newValue) {
var grid = target.parent;
if (grid instanceof GridLayoutBase) {
grid.onColumnChanged(target, oldValue, newValue);
}
},
valueConverter: function (v) { return Math.max(0, parseInt(v)); }
});
exports.columnProperty.register(layout_base_1.View);
exports.columnSpanProperty = new layout_base_1.Property({
name: "colSpan", defaultValue: 1,
valueChanged: function (target, oldValue, newValue) {
var grid = target.parent;
if (grid instanceof GridLayoutBase) {
grid.onColumnSpanChanged(target, oldValue, newValue);
}
},
valueConverter: function (v) { return Math.max(1, parseInt(v)); }
});
exports.columnSpanProperty.register(layout_base_1.View);
exports.rowProperty = new layout_base_1.Property({
name: "row", defaultValue: 0,
valueChanged: function (target, oldValue, newValue) {
var grid = target.parent;
if (grid instanceof GridLayoutBase) {
grid.onRowChanged(target, oldValue, newValue);
}
},
valueConverter: function (v) { return Math.max(0, parseInt(v)); }
});
exports.rowProperty.register(layout_base_1.View);
exports.rowSpanProperty = new layout_base_1.Property({
name: "rowSpan", defaultValue: 1,
valueChanged: function (target, oldValue, newValue) {
var grid = target.parent;
if (grid instanceof GridLayoutBase) {
grid.onRowSpanChanged(target, oldValue, newValue);
}
},
valueConverter: function (v) { return Math.max(1, parseInt(v)); }
});
exports.rowSpanProperty.register(layout_base_1.View);
var GridUnitType;
(function (GridUnitType) {
GridUnitType.PIXEL = "pixel";
GridUnitType.STAR = "star";
GridUnitType.AUTO = "auto";
GridUnitType.isValid = layout_base_1.makeValidator(GridUnitType.PIXEL, GridUnitType.STAR, GridUnitType.AUTO);
GridUnitType.parse = layout_base_1.makeParser(GridUnitType.isValid);
})(GridUnitType = exports.GridUnitType || (exports.GridUnitType = {}));
//# sourceMappingURL=grid-layout-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/layouts/grid-layout/grid-layout.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var grid_layout_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/layouts/grid-layout/grid-layout-common.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/layouts/grid-layout/grid-layout-common.js"));
function makeNativeSetter(setter) {
return function (value) {
var nativeView = this.nativeViewProtected;
var lp = nativeView.getLayoutParams() || new org.nativescript.widgets.CommonLayoutParams();
if (lp instanceof org.nativescript.widgets.CommonLayoutParams) {
setter(lp, value);
nativeView.setLayoutParams(lp);
}
};
}
grid_layout_common_1.View.prototype[grid_layout_common_1.rowProperty.setNative] = makeNativeSetter(function (lp, value) { return lp.row = value; });
grid_layout_common_1.View.prototype[grid_layout_common_1.columnProperty.setNative] = makeNativeSetter(function (lp, value) { return lp.column = value; });
grid_layout_common_1.View.prototype[grid_layout_common_1.rowSpanProperty.setNative] = makeNativeSetter(function (lp, value) { return lp.rowSpan = value; });
grid_layout_common_1.View.prototype[grid_layout_common_1.columnSpanProperty.setNative] = makeNativeSetter(function (lp, value) { return lp.columnSpan = value; });
function createNativeSpec(itemSpec) {
switch (itemSpec.gridUnitType) {
case grid_layout_common_1.GridUnitType.AUTO:
return new org.nativescript.widgets.ItemSpec(itemSpec.value, org.nativescript.widgets.GridUnitType.auto);
case grid_layout_common_1.GridUnitType.STAR:
return new org.nativescript.widgets.ItemSpec(itemSpec.value, org.nativescript.widgets.GridUnitType.star);
case grid_layout_common_1.GridUnitType.PIXEL:
return new org.nativescript.widgets.ItemSpec(itemSpec.value * grid_layout_common_1.layout.getDisplayDensity(), org.nativescript.widgets.GridUnitType.pixel);
default:
throw new Error("Invalid gridUnitType: " + itemSpec.gridUnitType);
}
}
var ItemSpec = (function (_super) {
__extends(ItemSpec, _super);
function ItemSpec() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(ItemSpec.prototype, "actualLength", {
get: function () {
if (this.nativeSpec) {
return Math.round(this.nativeSpec.getActualLength() / grid_layout_common_1.layout.getDisplayDensity());
}
return 0;
},
enumerable: true,
configurable: true
});
return ItemSpec;
}(grid_layout_common_1.ItemSpec));
exports.ItemSpec = ItemSpec;
var GridLayout = (function (_super) {
__extends(GridLayout, _super);
function GridLayout() {
return _super !== null && _super.apply(this, arguments) || this;
}
GridLayout.prototype.createNativeView = function () {
return new org.nativescript.widgets.GridLayout(this._context);
};
GridLayout.prototype.initNativeView = function () {
var _this = this;
_super.prototype.initNativeView.call(this);
this.rowsInternal.forEach(function (itemSpec, index, rows) { _this._onRowAdded(itemSpec); }, this);
this.columnsInternal.forEach(function (itemSpec, index, rows) { _this._onColumnAdded(itemSpec); }, this);
};
GridLayout.prototype.resetNativeView = function () {
for (var i = this.rowsInternal.length; i--; i >= 0) {
var itemSpec = this.rowsInternal[i];
this._onRowRemoved(itemSpec, i);
}
for (var i = this.columnsInternal.length; i--; i >= 0) {
var itemSpec = this.columnsInternal[i];
this._onColumnRemoved(itemSpec, i);
}
_super.prototype.resetNativeView.call(this);
};
GridLayout.prototype._onRowAdded = function (itemSpec) {
if (this.nativeViewProtected) {
var nativeSpec = createNativeSpec(itemSpec);
itemSpec.nativeSpec = nativeSpec;
this.nativeViewProtected.addRow(nativeSpec);
}
};
GridLayout.prototype._onColumnAdded = function (itemSpec) {
if (this.nativeViewProtected) {
var nativeSpec = createNativeSpec(itemSpec);
itemSpec.nativeSpec = nativeSpec;
this.nativeViewProtected.addColumn(nativeSpec);
}
};
GridLayout.prototype._onRowRemoved = function (itemSpec, index) {
itemSpec.nativeSpec = null;
if (this.nativeViewProtected) {
this.nativeViewProtected.removeRowAt(index);
}
};
GridLayout.prototype._onColumnRemoved = function (itemSpec, index) {
itemSpec.nativeSpec = null;
if (this.nativeViewProtected) {
this.nativeViewProtected.removeColumnAt(index);
}
};
GridLayout.prototype.invalidate = function () {
};
return GridLayout;
}(grid_layout_common_1.GridLayoutBase));
exports.GridLayout = GridLayout;
//# sourceMappingURL=grid-layout.android.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/layouts/layout-base-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js"));
var LayoutBaseCommon = (function (_super) {
__extends(LayoutBaseCommon, _super);
function LayoutBaseCommon() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._subViews = new Array();
return _this;
}
LayoutBaseCommon.prototype._addChildFromBuilder = function (name, value) {
if (value instanceof view_1.View) {
this.addChild(value);
}
};
LayoutBaseCommon.prototype.getChildrenCount = function () {
return this._subViews.length;
};
Object.defineProperty(LayoutBaseCommon.prototype, "_childrenCount", {
get: function () {
return this._subViews.length;
},
enumerable: true,
configurable: true
});
LayoutBaseCommon.prototype.getChildAt = function (index) {
return this._subViews[index];
};
LayoutBaseCommon.prototype.getChildIndex = function (child) {
return this._subViews.indexOf(child);
};
LayoutBaseCommon.prototype.getChildById = function (id) {
return view_1.getViewById(this, id);
};
LayoutBaseCommon.prototype._registerLayoutChild = function (child) {
};
LayoutBaseCommon.prototype._unregisterLayoutChild = function (child) {
};
LayoutBaseCommon.prototype.addChild = function (child) {
this._subViews.push(child);
this._addView(child);
this._registerLayoutChild(child);
};
LayoutBaseCommon.prototype.insertChild = function (child, atIndex) {
this._subViews.splice(atIndex, 0, child);
this._addView(child, atIndex);
this._registerLayoutChild(child);
};
LayoutBaseCommon.prototype.remov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment