diff --git a/.gitignore b/.gitignore index 4a11e89..c511cfa 100644 --- a/.gitignore +++ b/.gitignore @@ -61,3 +61,7 @@ typings/ # next.js build output .next +test/300-API.spec.js +routes/api.js +public/jsd/main.js +package-lock.json diff --git a/.idea/dictionaries/manabu.xml b/.idea/dictionaries/manabu.xml new file mode 100644 index 0000000..85e6581 --- /dev/null +++ b/.idea/dictionaries/manabu.xml @@ -0,0 +1,10 @@ + + + + imanabu + pacs + qido + studyuid + + + \ No newline at end of file diff --git a/Confg.js b/Confg.js deleted file mode 100644 index 8e762c7..0000000 --- a/Confg.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.departments = [ - { active: true, - department: "1234", - modalities: ["US", "DX", "VL"], - reasons: ["Minor Burn", "Fall", "Cut", "Fracture"] - }, - { - active: true, - department: "5672", - modalities: ["CT", "MR", "US", "DX", "VL"], - reasons: ["Flu", "Cold Symptoms", "Acute Abdominal Pain", "Food obstruction"] - }, - { - active: true, - department: "2456", - modalities: ["CT", "MR", "VL"], - reasons: ["Eye Infection", "Acute Ocular Trauma", "Retinal Detachment", "Foreign Object Removal"] - }, -]; -//# sourceMappingURL=Confg.js.map \ No newline at end of file diff --git a/README.md b/README.md index dcdadb9..dcb8ef2 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,18 @@ ## Modality Worklist Test Generator and QIDO Server System Manabu Tokunaga, GitHub: imanabu -Version 0.0.4 -Release Date: 20190413 +Version 0.0.7 +Release Date: 20190616 ## New Features and Changes +### 0.0.6 - 0.0.7 + +* Manually add new patient-studies with your choice of information. + Use this to create a correlated encounter already on the EHR/PACS. + +### 0.0.5 + * The configuration is now a plain json and stored in config/appConfig.js * More realistic generation of encounters now. Repeated default /api/studies will only provide list changes as specified in the configuration. So for example, if you set up 12 encounter per hour, @@ -21,9 +28,11 @@ Release Date: 20190413 * URL `limit` and `hourly` parameters will persist for the duration of the server's lifecycle. Once the `limit` or `hourly` in a query is used that value will persist and will be used - for next request even without the limit and hourly parameter. + for next request even without the limit and hourly parameter *if* `persistConfig` is true. By default the configuration is set to 96 encounters for 8 hours or 12 new encounters per hour. + +* In preparation for public access, rate and quantity limit is now enforceable and configurable. ## Fixed In This Release @@ -40,11 +49,7 @@ associated, and serve them up via the DICOM QIDO /studies API. Because I do need departments with real existing ones at the hospital, you can also configure realistic clinical department configurations as well. -I am keeping this as simple as possible without a asking you to configure Java or MogoDB or MySQL. I think -this will just work if you have ever worked with Node.js with npm without you needing to fuss about -configurations. All the defaults should be adequate to get you started. The only thing you may not have -done is to code the stuff in TypeScript. I like it. It removes my own coding hassles. But TS now -very popular with React and Angular 2 camps so you are likely exposed to it. +I am keeping this as simple as possible without a asking you to configure Java or MongoDB or MySQL. ## What It Does @@ -110,17 +115,16 @@ And by default it should be listening at the Port 3000 of your local system. `http://localhost:3000/api/studies` -We really do not need any fancy QIDO query param stuff here. So no date range query nor +At this point no date range query nor element level query is supported. (You are welcome to add those things. Just fork it.) Go ahead and specify them but they will be ignored. -Only exception to that is that it supports `?limit=number` so that you can -pull 100's and 1000's of entries at a time, and it will be very quick to do so. -In this case the limit is used as a requested number of entry you'd want to generate. +Only exception to that is that it supports `?limit=number` can be used to request the generation quantity. +This is limited to 250 by configuration, but can be changed. 1000s of entries can be generated quickly. The default is hardwired to 10. -Example with Limit: `http://localhost:3000/api/studies?limit=1000` +Example with Limit: `http://localhost:3000/api/studies?limit=200` ## Configuring Departments and Associated Reasons for Study diff --git a/app.js b/app.js index 078aa59..477802e 100644 --- a/app.js +++ b/app.js @@ -1,7 +1,8 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const createError = require("http-errors"); +const config = require("./config/appConfig"); const express = require("express"); +const slowDown = require("express-slow-down"); const path = require("path"); const cookieParser = require("cookie-parser"); const lessMiddleware = require("less-middleware"); @@ -9,6 +10,9 @@ const logger = require("morgan"); const isProduction = process.env.NODE_ENV === "production"; const indexRouter = require("./routes"); const app = express(); +const speedLimiter = slowDown(config.speedLimit); +app.enable("trust proxy"); +app.use(speedLimiter); app.use(logger("dev")); app.use(express.json()); app.use(express.urlencoded({ extended: false })); diff --git a/app.ts b/app.ts index ec37e5a..2a45eb6 100644 --- a/app.ts +++ b/app.ts @@ -1,6 +1,7 @@ -import {Application, NextFunction, Request, Response} from "express"; -const createError: any = require("http-errors"); +import {Application} from "express"; +import config = require("./config/appConfig"); import express = require("express"); +import slowDown = require("express-slow-down"); import path = require("path"); const cookieParser: any = require("cookie-parser"); const lessMiddleware: any = require("less-middleware"); @@ -11,6 +12,10 @@ const indexRouter: Application = require("./routes"); const app = express(); +const speedLimiter = slowDown(config.speedLimit); + +app.enable("trust proxy"); +app.use(speedLimiter); app.use(logger("dev")); app.use(express.json()); app.use(express.urlencoded({ extended: false })); diff --git a/client/AddComponent.ts b/client/AddComponent.ts new file mode 100644 index 0000000..3bbcb8a --- /dev/null +++ b/client/AddComponent.ts @@ -0,0 +1,184 @@ +import {ClassComponent, RequestOptions} from "mithril"; +import {IApiResponse, INewStudy, INewStudyDto} from "../model/dtos"; +import m = require("mithril"); + +export class AddComponent implements ClassComponent { + + constructor() {} + + private ent: INewStudy = {} as INewStudy; + private _status: string = ""; + private set status(v: string) { + this._status = v; + m.redraw(); + } + + private get status() { + return this._status; + } + + oninit = () => { + this.ent.studyDate = new Date(); + }; + + public view = () => { + const my = this; + + const dateParse = (v: string) => { + try { + let nd = new Date(v); + if (nd.toLocaleDateString().indexOf("Invalid") === 0) { + my.status = `Please correct the date ${v}`; + return undefined; + } else { + return nd; + } + } catch (why) { + my.status = `Bad date string ${v} ${why}`; + } + }; + + const oninput = (e: Event) => { + const t = e.currentTarget as HTMLInputElement; + const v = t.value; + switch (t.id) { + case "acc": + my.ent.accession = v ? v : ""; + break; + case "dob": + const dp = dateParse(v); + my.ent.dob = dp; + break; + case "gender": + my.ent.gender = (v === "F" || v === "M" || v === "O") ? v : "O"; + break; + case "mrn": + my.ent.mrn = v ? v : ""; + break; + case "modality": + my.ent.modality = v ? v : ""; + break; + case "name": + if (v.indexOf("^") >= 0) { + my.ent.patientName = v ? v.toUpperCase() : ""; + } else { + my.status = "Name must be in the DICOM/HL7 Format: SMITH^JOHN^A"; + } + break; + case "reason": + my.ent.reason = v ? v : ""; + break; + case "sd": + const sd = dateParse(v); + my.ent.studyDate = sd; + break; + case "studyuid": + my.ent.studyUid = v ? v : ""; + break; + } + }; + + const onCreate = () => { + const my = this; + let opt = {} as RequestOptions>; + opt.method = "POST"; + let data: INewStudyDto = {} as INewStudyDto; + opt.data = data; + const ent = my.ent; + + data.accession = ent.accession; + data.gender = ent.gender ? ent.gender : "O"; + data.mrn = ent.mrn ? ent.mrn : ""; + data.modality = ent.modality ? ent.modality : "VL"; + data.patientName = ent.patientName ? ent.patientName : ""; + data.reason = ent.reason ? ent.reason : ""; + data.studyUid = ent.studyUid ? ent.studyUid : ""; + + if (!ent.dob) { + my.status = "DOB cannot be left empty"; + return; + } + + data.dob = ent.dob ? ent.dob.toISOString() : ""; + data.studyDate = ent.studyDate? ent.studyDate!.toISOString(): ""; + + m.request("api/study/add", opt) + .then((res) => { + my.status = res.message; + return res; + }) + .catch((err: Error) => { + my.status = err.message; + return err; + }); + }; + + return m("", + m("h4", my.status), + m("", + m("label.lbl-input[for=mrn])", "MRN: "), + m("input[id=mrn][type=text]", { + onchange: oninput, + placeholder: "Optional", + value: my.ent.mrn })), + m("", + m("label.lbl-input[for=name])","Name: "), + m("input[id=name][type=text]", { + onchange: oninput, + placeholder: "Temple^Zen^M^Jr.", + value: my.ent.patientName})), + m("", + m("label.lbl-input[for=gender])", "Gender: " + ), + m("input.lbl-input[id=gender][type=text]", { + onchange: oninput, + placeholder: "F, M or O", + value: my.ent.gender})), + m("", + m("label.lbl-input[for=dob])", "DOB: "), + m("input[id=dob][type=text]", { + onchange: oninput, + placeholder: "Like 2/29/2000", + value: my.ent.dob ? my.ent.dob.toLocaleDateString(): ""})), + m("", + m("label.lbl-input[for=sd])", "Study Date: "), + m("input[id=sd][type=text]", { + onchange: oninput, + value: my.ent.studyDate ? my.ent.studyDate.toLocaleDateString() : "" + })), + m("", + m("label.lbl-input[for=acc])", "Accession: "), + m("input[id=acc][type=text]", { + onchange: oninput, + placeholder: "Optional", + value: my.ent.accession })), + m("", + m("label.lbl-input[for=modality])", "Modality: "), + m("input[id=modality][type=text]", { + onchange: oninput, + placeholder: "CT, MR, XR, VL...", + value: my.ent.modality })), + m("", + m("label.lbl-input[for=reason])", "Reason: "), + m("input[id=reason][type=text]", { + onchange: oninput, + placeholder: "Optional", + style: "width:60%", + value: my.ent.reason })), + m("", + m("label.lbl-input[for=studyuid])", "StudyUID: "), + m("input[id=studyuid][type=text]", { + onchange: oninput, + placeholder: "Critical! Leave blank unless you know what to do.", + style: "width:60%", + value: my.ent.studyUid })), + m("", + m("button.btn-md.btn-success", + { + onclick: onCreate + }, + "Create") + ) + ); + } +} \ No newline at end of file diff --git a/client/Main.js b/client/Main.js index 78a92ad..15470e8 100644 --- a/client/Main.js +++ b/client/Main.js @@ -2,6 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); var m = require("mithril"); var _ = require("lodash/fp"); +var AddComponent_1 = require("./AddComponent"); /** * THE MAIN */ @@ -9,22 +10,47 @@ var _ = require("lodash/fp"); var content = document.getElementById("content"); var Main = /** @class */ (function () { function Main() { + var _this = this; + this.addComponent = new AddComponent_1.AddComponent(); this.rawMwl = []; this.mode = "mwl"; - this.listMode = true; this.limit = 0; this.usedUrl = ""; + this.getMwl = function () { + var my = _this; + my.mode = "mwl"; + var url = my.limit ? "api/studies?limit=" + my.limit : + "api/studies"; + my.usedUrl = url; + var options = {}; + options.method = "GET"; + return m.request(url, options).then(function (data) { + my.rawMwl = data; + my.mwl = JSON.stringify(data, null, 3); + }).catch(function (error) { + my.mwl = error.toString(); + }); + }; + this.getDepartments = function () { + var my = _this; + my.mode = "dept"; + var url = "api/departments"; + var options = {}; + options.method = "GET"; + return m.request(url, options).then(function (data) { + my.departments = JSON.stringify(data, null, 3); + }).catch(function (error) { + my.mwl = error.toString(); + }); + }; this.mwl = ""; this.departments = ""; } Main.prototype.view = function () { var my = this; - var spacer = m("[style=margin-botton:10px;]", m.trust(" ")); + var spacer = m("[style=margin-bottom:10px;]", m.trust(" ")); var h = m("h2", {}, "ZenSnapMD MWL Test Suite"); - var dp = m("pre", my.departments); - var help = my.mode === "mwl" ? - m(".col.head-room", "Used QIDO API URL: " + my.usedUrl) : - m(".col.head-room", "To change this, Edit Config.ts file, rebuild and run."); + var help = m(""); var limitLabel = m("label[for=limit]", "Limit: "); var limit = m("input[id=limit][type=text][style=margin-left:10px]", { onchange: m.withAttr("value", function (v) { my.limit = parseInt(v, 10); }), @@ -34,78 +60,75 @@ var Main = /** @class */ (function () { var limitCell = m(".col", [limitLabel, limit]); var listButton = m("button.btn-margin.col.btn-med.btn-info", { onclick: function () { - my.listMode = true; - my.getMwl.bind(my)(); + my.mode = "mwl"; + return my.getMwl(); }, }, "Gen & Show List"); var rawButton = m("button.brn-margin.col.btn-med.btn-info", { onclick: function () { - my.listMode = false; - my.getMwl.bind(my)(); + my.mode = "raw"; + return my.getMwl(); }, }, "Gen & Show JSON"); + var addButton = m("button.btn-margin.col.btn-med.btn-info", { + onclick: function () { + my.mode = "add"; + }, + }, "Add New"); var deptButton = m("button.btn-margin.col.btn-med.btn-info", { - onclick: my.getDepartments.bind(my), + onclick: function () { + my.mode = "dept"; + return my.getDepartments(); + }, }, "Show Departments"); var ctrlRow = m(".row", [ limitCell, rawButton, listButton, + addButton, deptButton ]); - var listHead = m(".row.list-header", m(".col-1", "Date"), - // m(".col", item["00400100"].Value[0]["00400003"].Value[0]), - m(".col-2", "Patient Name"), m(".col-1", "MRN"), m(".col-1", "DOB"), m(".col-1", "Gender"), m(".col-1", "Modality"), m(".col-1", "Accession"), m(".col-1", "Dept."), m(".col-1", "Reason")); - var getList = _.map(function (item) { - var name = item["00100010"].Value[0].Alphabetic; - var nameParts = name.split("^"); - var finalName = ""; - for (var i = 0; i < nameParts.length; i++) { - finalName = finalName + nameParts[i]; - if (i === 0) { - finalName = finalName + ", "; - } - else { - finalName = finalName + " "; - } - } - return m(".row", m(".col-1", item["00400100"].Value[0]["00400002"].Value[0]), + var body = m(""); + if (my.mode === "mwl") { + help = m(".col.head-room", "Used QIDO API URL: " + my.usedUrl); + var listHead = m(".row.list-header", m(".col-1", "Date"), // m(".col", item["00400100"].Value[0]["00400003"].Value[0]), - m(".col-2", finalName), m(".col-1", item["00100020"].Value[0]), m(".col-1", item["00100030"].Value[0]), m(".col-1", item["00100040"].Value[0]), m(".col-1", item["00400100"].Value[0]["00080060"].Value[0]), m(".col-1", item["00080050"].Value[0]), m(".col-1", item["00081040"].Value[0]), m(".col-2", item["00081030"].Value[0])); - }); - var mw = my.listMode ? m("", listHead, getList(my.rawMwl)) : m("pre", my.mwl); + m(".col-2", "Patient Name"), m(".col-1", "MRN"), m(".col-1", "DOB"), m(".col-1", "Gender"), m(".col-1", "Modality"), m(".col-1", "Accession"), m(".col-1", "Dept."), m(".col-1", "Reason")); + var getList = _.map(function (item) { + var name = item["00100010"].Value[0].Alphabetic; + var nameParts = name.split("^"); + var finalName = ""; + for (var i = 0; i < nameParts.length; i++) { + finalName = finalName + nameParts[i]; + if (i === 0) { + finalName = finalName + ", "; + } + else { + finalName = finalName + " "; + } + } + return m(".row", m(".col-1", item["00400100"].Value[0]["00400002"].Value[0]), + // m(".col", item["00400100"].Value[0]["00400003"].Value[0]), + m(".col-2", finalName), m(".col-1", item["00100020"].Value[0]), m(".col-1", item["00100030"].Value[0]), m(".col-1", item["00100040"].Value[0]), m(".col-1", item["00400100"].Value[0]["00080060"].Value[0]), m(".col-1", item["00080050"].Value[0]), m(".col-1", item["00081040"].Value[0]), m(".col-2", item["00081030"].Value[0])); + }); + body = m("", listHead, getList(my.rawMwl)); + } + else if (my.mode === "raw") { + body = m("pre", my.mwl); + } + else if (my.mode === "add") { + help = m(".col.head-room", "Generate a specific patient on the next gen cycle."); + body = m(my.addComponent); + } + else if (my.mode === "dept") { + help = m(".col.head-room", "To change this, Edit Config.ts file, rebuild and run."); + body = m("pre", my.departments); + } return m("", [h, ctrlRow, m(".row", help), spacer, - my.mode === "mwl" ? mw : dp]); - }; - Main.prototype.getMwl = function () { - var my = this; - my.mode = "mwl"; - var url = my.limit ? "api/studies?limit=" + my.limit : - "api/studies"; - my.usedUrl = url; - var options = {}; - options.method = "GET"; - return m.request(url, options).then(function (data) { - my.rawMwl = data; - my.mwl = JSON.stringify(data, null, 3); - }).catch(function (error) { - my.mwl = error.toString(); - }); - }; - Main.prototype.getDepartments = function () { - var my = this; - my.mode = "dept"; - var url = "api/departments"; - var options = {}; - options.method = "GET"; - return m.request(url, options).then(function (data) { - my.departments = JSON.stringify(data, null, 3); - }).catch(function (error) { - my.mwl = error.toString(); - }); + body]); }; return Main; }()); diff --git a/client/Main.ts b/client/Main.ts index ff7ce8d..25445ec 100644 --- a/client/Main.ts +++ b/client/Main.ts @@ -1,5 +1,7 @@ import m = require("mithril"); import _ = require("lodash/fp"); +import {Vnode} from "mithril"; +import {AddComponent} from "./AddComponent"; /** * THE MAIN @@ -9,10 +11,10 @@ const content = document.getElementById("content") as Element; export class Main implements m.ClassComponent { + private addComponent = new AddComponent(); private mwl: string; private rawMwl: any[] = []; - private mode = "mwl"; - private listMode = true; + private mode: "add" | "dept" | "mwl" | "raw" = "mwl"; private departments: string; private limit = 0; private usedUrl = ""; @@ -24,14 +26,10 @@ export class Main implements m.ClassComponent { public view() { const my = this; - const spacer = m("[style=margin-botton:10px;]", m.trust(" ")); + const spacer = m("[style=margin-bottom:10px;]", m.trust(" ")); const h = m(`h2`, {}, `ZenSnapMD MWL Test Suite`); - const dp = m(`pre`, my.departments); - - const help = my.mode === "mwl" ? - m(".col.head-room", `Used QIDO API URL: ${my.usedUrl}`) : - m(".col.head-room", `To change this, Edit Config.ts file, rebuild and run.`); + let help = m(""); const limitLabel = m("label[for=limit]", "Limit: "); const limit = m("input[id=limit][type=text][style=margin-left:10px]", @@ -44,18 +42,27 @@ export class Main implements m.ClassComponent { const listButton = m("button.btn-margin.col.btn-med.btn-info", { onclick: () => { - my.listMode = true; - my.getMwl.bind(my)(); }, + my.mode = "mwl"; + return my.getMwl(); }, }, "Gen & Show List"); const rawButton = m("button.brn-margin.col.btn-med.btn-info", { onclick: () => { - my.listMode = false; - my.getMwl.bind(my)(); }, + my.mode = "raw"; + return my.getMwl(); }, }, "Gen & Show JSON"); + const addButton = m("button.btn-margin.col.btn-med.btn-info", { + onclick: () => { + my.mode = "add"; + }, + }, "Add New"); + const deptButton = m("button.btn-margin.col.btn-med.btn-info", { - onclick: my.getDepartments.bind(my), + onclick: () => { + my.mode = "dept"; + return my.getDepartments(); + }, }, "Show Departments"); const ctrlRow = m(".row", @@ -63,63 +70,79 @@ export class Main implements m.ClassComponent { limitCell, rawButton, listButton, + addButton, deptButton]); - const listHead = m(".row.list-header", - m(".col-1", "Date"), - // m(".col", item["00400100"].Value[0]["00400003"].Value[0]), - m(".col-2", "Patient Name"), - m(".col-1", "MRN"), - m(".col-1", "DOB"), - m(".col-1", "Gender"), - m(".col-1", "Modality"), - m(".col-1", "Accession"), - m(".col-1", "Dept."), - m(".col-1", "Reason"), - ) - - const getList = _.map((item: any) => { - let name = item["00100010"].Value[0].Alphabetic; - let nameParts = name.split("^"); - let finalName = ""; - for (let i = 0; i < nameParts.length; i++) { - finalName = finalName + nameParts[i]; - if (i === 0) { - finalName = finalName + ", "; - } else { - finalName = finalName + " "; - } - } + let body: Vnode = m(""); + + if (my.mode === "mwl") { + + help = m(".col.head-room", `Used QIDO API URL: ${my.usedUrl}`); - return m(".row", - m(".col-1", item["00400100"].Value[0]["00400002"].Value[0]), + const listHead = m(".row.list-header", + m(".col-1", "Date"), // m(".col", item["00400100"].Value[0]["00400003"].Value[0]), - m(".col-2", finalName), - m(".col-1", item["00100020"].Value[0]), - m(".col-1", item["00100030"].Value[0]), - m(".col-1", item["00100040"].Value[0]), - m(".col-1", item["00400100"].Value[0]["00080060"].Value[0]), - m(".col-1", item["00080050"].Value[0]), - m(".col-1", item["00081040"].Value[0]), - m(".col-2", item["00081030"].Value[0]), - ) - }); - - const mw = my.listMode ? m("", listHead, getList(my.rawMwl)) : m(`pre`, my.mwl); + m(".col-2", "Patient Name"), + m(".col-1", "MRN"), + m(".col-1", "DOB"), + m(".col-1", "Gender"), + m(".col-1", "Modality"), + m(".col-1", "Accession"), + m(".col-1", "Dept."), + m(".col-1", "Reason"), + ); + + const getList = _.map((item: any) => { + let name = item["00100010"].Value[0].Alphabetic; + let nameParts = name.split("^"); + let finalName = ""; + for (let i = 0; i < nameParts.length; i++) { + finalName = finalName + nameParts[i]; + if (i === 0) { + finalName = finalName + ", "; + } else { + finalName = finalName + " "; + } + } + + return m(".row", + m(".col-1", item["00400100"].Value[0]["00400002"].Value[0]), + // m(".col", item["00400100"].Value[0]["00400003"].Value[0]), + m(".col-2", finalName), + m(".col-1", item["00100020"].Value[0]), + m(".col-1", item["00100030"].Value[0]), + m(".col-1", item["00100040"].Value[0]), + m(".col-1", item["00400100"].Value[0]["00080060"].Value[0]), + m(".col-1", item["00080050"].Value[0]), + m(".col-1", item["00081040"].Value[0]), + m(".col-2", item["00081030"].Value[0]), + ) + }); + + body = m("", listHead, getList(my.rawMwl)); + + } else if (my.mode === "raw") { + body = m(`pre`, my.mwl); + } else if (my.mode === "add") { + help = m(".col.head-room", `Generate a specific patient on the next gen cycle.`); + body = m(my.addComponent); + } else if (my.mode === "dept") { + help = m(".col.head-room", `To change this, Edit Config.ts file, rebuild and run.`); + body = m(`pre`, my.departments); + } return m("", [h, ctrlRow, m(".row", help), spacer, - my.mode === "mwl" ? mw : dp]); + body]); } - private getMwl() { + private getMwl = () => { const my = this; my.mode = "mwl"; const url = my.limit ? `api/studies?limit=${my.limit}` : - `api/studies` - ; + `api/studies`; my.usedUrl = url; @@ -135,9 +158,9 @@ export class Main implements m.ClassComponent { my.mwl = error.toString(); } ); - } + }; - private getDepartments() { + private getDepartments = () => { const my = this; my.mode = "dept"; const url = `api/departments`; @@ -154,7 +177,7 @@ export class Main implements m.ClassComponent { } ); - } + }; } // Content DIV to insert the content into diff --git a/config/appConfig.js b/config/appConfig.js index f066adc..7cca6e1 100644 --- a/config/appConfig.js +++ b/config/appConfig.js @@ -2,27 +2,579 @@ const appConfig = { generator: { // 12 makes about 100 case a day hospital. + absoluteMax: 250, + defaultMax: 20, hourlyPatients: 12, - defaultMax: 20 + persistConfig: false, + }, + + speedLimit: { + // See https://www.npmjs.com/package/express-slow-down + windowMs: 15 * 60 * 1000, // 15 minutes + delayAfter: 120, // allow 100 requests per 15 minutes, then... + delayMs: 1500 // begin adding 500ms of delay per request above 100: }, departments: [ { active: true, - department: "1234" , - modalities: ["US", "DX", "VL"], - reasons: ["Minor Burn", "Fall", "Cut", "Fracture"] + department: "CARD" , + modalities: ["US", "MR", "DX", "VL"], + reasons: ["Unstable angina", "Precordial pain", + "Pleurodynia", "Intercostal pain", + "Nonrheumatic aortic (valve) stenosis", + "Coronary artery aneurysm" + ] }, { active: true, - department: "5672" , + department: "ORTHO" , modalities: ["CT", "MR", "US", "DX", "VL"], - reasons: ["Flu", "Cold Symptoms", "Acute Abdominal Pain", "Food obstruction"] + reasons: [ + "20520 Removal of foreign body in muscle or tendon sheath; simple", + "20525 Removal of foreign body in muscle or tendon sheath; deep or complicated", + "20670 Removal of implant; superficial, (eg, buried wire, pin or rod) (separate procedure)", + "20680 Removal of implant; deep (eg, buried wire, pin, screw, metal band, nail, rod or plate)", + "20920 Fascia lata graft; by stripper", + "20922 Fascia lata graft; by incision and area exposure, complex or sheet", + "20924 Tendon graft, from a distance (eg, palmaris, toe extensor, plantaris)", + "23030 Incision and drainage, shoulder area; deep abscess or hematoma", + "23031 Incision and drainage, shoulder area; infected bursa", + "23035 Incision, bone cortex (eg, osteomyelitis or bone abscess), shoulder area", + "23040 Arthrotomy, glenohumeral joint, including exploration, drainage, or removal of foreign body", + "23044 Arthrotomy, acromioclavicular, sternoclavicular joint, including exploration, drainage, or removal of", + "23101 Arthrotomy, acromioclavicular joint or sternoclavicular joint, including biopsy and/or excision of torn", + "23105 Arthrotomy; glenohumeral joint, with synovectomy, with or without biopsy", + "23106 Arthrotomy; sternoclavicular joint, with synovectomy, with or without biopsy", + "23107 Arthrotomy, glenohumeral joint, with joint exploration, with or without removal of loose or foreign", + "23120 Claviculectomy; partial", + "23125 Claviculectomy; total", + "23130 Acromioplasty or acromionectomy, partial, with or without coracoacromial ligament release", + "23410 Repair of ruptured musculotendinous cuff (eg, rotator cuff) open; acute", + "23412 Repair of ruptured musculotendinous cuff (eg, rotator cuff) open; chronic", + "23415 Coracoacromial ligament release, with or without acromioplasty", + "23420 Reconstruction of complete shoulder (rotator) cuff avulsion, chronic (includes acromioplasty)", + "23430 Tenodesis of long tendon of biceps", + "23440 Resection or transplantation of long tendon of biceps", + "23450 Capsulorrhaphy, anterior; Putti-Platt procedure or Magnuson type operation", + "23455 Capsulorrhaphy, anterior; with labral repair (eg, Bankart procedure)", + "23460 Capsulorrhaphy, anterior, any type; with bone block", + "23462 Capsulorrhaphy, anterior, any type; with coracoid process transfer", + "23465 Capsulorrhaphy, glenohumeral joint, posterior, with or without bone block", + "23466 Capsulorrhaphy, glenohumeral joint, any type multi-directional instability", + "23485 Osteotomy, clavicle, with or without internal fixation; with bone graft for nonunion or malunion (includes obtaining graft and/or necessary fixation)", + "23500 Closed treatment of clavicular fracture; without manipulation", + "23505 Closed treatment of clavicular fracture; with manipulation", + "23515 Open treatment of clavicular fracture, with or without internal or external fixation", + "23520 Closed treatment of sternoclavicular dislocation; without manipulation", + "23525 Closed treatment of sternoclavicular dislocation; with manipulation", + "23530 Open treatment of sternoclavicular dislocation, acute or chronic", + "23532 Open treatment of sternoclavicular dislocation, acute or chronic; with fascial graft (includes obtaining", + "23540 Closed treatment of acromioclavicular dislocation; without manipulation", + "23545 Closed treatment of acromioclavicular dislocation; with manipulation", + "23550 Open treatment of acromioclavicular dislocation, acute or chronic;", + "23552 Open treatment of acromioclavicular dislocation, acute or chronic; with fascial graft (includes", + "23570 Closed treatment of scapular fracture; without manipulation", + "23615 Open treatment of proximal humeral (surgical or anatomical neck) fracture, with or without internal or external fixation, with or without repair of tuberosity(s);", + "23650 Closed treatment of shoulder dislocation, with manipulation; without anesthesia", + "23655 Closed treatment of shoulder dislocation, with manipulation; requiring anesthesia", + "23660 Open treatment of acute shoulder dislocation", + "23665 Closed treatment of shoulder dislocation, with fracture of greater humeral tuberosity, with", + "23670 Open treatment of shoulder dislocation, with fracture of greater humeral tuberosity, with or without", + "23675 Closed treatment of shoulder dislocation, with surgical or anatomical neck fracture, with", + "23700 Manipulation under anesthesia, shoulder joint, including application of fixation apparatus (dislocation", + "24006 Arthrotomy of the elbow, with capsular excision for capsular release (separate procedure)", + "24101 Arthrotomy, elbow; with joint exploration, with or without biopsy, with or without removal of loose or", + "24200 Removal of foreign body, upper arm or elbow area; subcutaneous", + "24201 Removal of foreign body, upper arm or elbow area; deep (subfascial or intramuscular)", + "24301 Muscle or tendon transfer, any type, upper arm or elbow, single (excluding 24320-24331)", + "24305 Tendon lengthening, upper arm or elbow, each tendon", + "24310 Tenotomy, open, elbow to shoulder, each tendon", + "24320 Tenoplasty, with muscle transfer, with or without free graft, elbow to shoulder, single (Seddon-", + "24332 Tenolysis, triceps", + "24340 Tenodesis of biceps tendon at elbow (separate procedure)", + "24341 Repair, tendon or muscle, upper arm or elbow, each tendon or muscle, primary or secondary", + "24342 Reinsertion of ruptured biceps or triceps tendon, distal, with or without tendon graft", + "24343 Repair lateral collateral ligament, elbow, with local tissue", + "24344 Reconstruction lateral collateral ligament, elbow, with tendon graft (includes harvesting of graft)", + "24345 Repair medial collateral ligament, elbow, with local tissue", + "24346 Reconstruction medial collateral ligament, elbow, with tendon graft (includes harvesting of graft)", + "24350 Fasciotomy, lateral or medial (eg, tennis elbow or epicondylitis);", + "24351 Fasciotomy, lateral or medial (eg, tennis elbow or epicondylitis); with extensor origin detachment", + "24352 Fasciotomy, lateral or medial (eg, tennis elbow or epicondylitis); with annular ligament resection", + "24354 Fasciotomy, lateral or medial (eg, tennis elbow or epicondylitis); with stripping", + "24356 Fasciotomy, lateral or medial (eg, tennis elbow or epicondylitis); with partial ostectomy", + "24500 Closed treatment of humeral shaft fracture; without manipulation", + "24505 Closed treatment of humeral shaft fracture; with manipulation, with or without skeletal traction", + "24515 Open treatment of humeral shaft fracture with plate/screws, with or without cerclage", + "24516 Treatment of humeral shaft fracture, with insertion of intramedullary implant, with or without cerclage", + "24530 Closed treatment of supracondylar or transcondylar humeral fracture, with or without intercondylar extension; without manipulation", + "24535 Closed treatment of supracondylar or transcondylar humeral fracture, with or without intercondylar extension; with manipulation, with or without skin or skeletal traction", + "24538 Percutaneous skeletal fixation of supracondylar or transcondylar humeral fracture, with or without", + "24545 Open treatment of humeral supracondylar or transcondylar fracture, with or without internal or external fixation; without intercondylar extension", + "24546 Open treatment of humeral supracondylar or transcondylar fracture, with or without internal or external fixation; with intercondylar extension", + "24560 Closed treatment of humeral epicondylar fracture, medial or lateral; without manipulation", + "24565 Closed treatment of humeral epicondylar fracture, medial or lateral; with manipulation", + "24566 Percutaneous skeletal fixation of humeral epicondylar fracture, medial or lateral, with manipulation", + "24575 Open treatment of humeral epicondylar fracture, medial or lateral, with or without internal or external", + "24576 Closed treatment of humeral condylar fracture, medial or lateral; without manipulation", + "24577 Closed treatment of humeral condylar fracture, medial or lateral; with manipulation", + "24579 Open treatment of humeral condylar fracture, medial or lateral, with or without internal or external", + "24582 Percutaneous skeletal fixation of humeral condylar fracture, medial or lateral, with manipulation", + "24586 Open treatment of periarticular fracture and/or dislocation of the elbow (fracture distal humerus and proximal ulna and/or proximal radius);", + "24600 Treatment of closed elbow dislocation; without anesthesia", + "24605 Treatment of closed elbow dislocation; requiring anesthesia", + "24615 Open treatment of acute or chronic elbow dislocation", + "24620 Closed treatment of Monteggia type of fracture dislocation at elbow (fracture proximal end of ulna with dislocation of radial head), with manipulation", + "24635 Open treatment of Monteggia type of fracture dislocation at elbow (fracture proximal end of ulna with dislocation of radial head), with or without internal or external fixation", + "24640 Closed treatment of radial head subluxation in child, nursemaid elbow, with manipulation", + "24650 Closed treatment of radial head or neck fracture; without manipulation", + "24655 Closed treatment of radial head or neck fracture; with manipulation", + "24665 Open treatment of radial head or neck fracture, with or without internal fixation or radial head", + "24666 Open treatment of radial head or neck fracture, with or without internal fixation or radial head excision; with radial head prosthetic replacement", + "24670 Closed treatment of ulnar fracture, proximal end (olecranon process); without manipulation", + "24675 Closed treatment of ulnar fracture, proximal end (olecranon process); with manipulation", + "24685 Open treatment of ulnar fracture proximal end (olecranon process), with or without internal or", + "25020 Decompression fasciotomy, forearm and/or wrist, flexor OR extensor compartment; without debridement of nonviable muscle and/or nerve", + "25023 Decompression fasciotomy, forearm and/or wrist, flexor OR extensor compartment; with debridement of nonviable muscle and/or nerve", + "25024 Decompression fasciotomy, forearm and/or wrist, flexor AND extensor compartment; without debridement of nonviable muscle and/or nerve", + "25025 Decompression fasciotomy, forearm and/or wrist, flexor AND extensor compartment; with debridement of nonviable muscle and/or nerve", + "25028 Incision and drainage, forearm and/or wrist; deep abscess or hematoma", + "25031 Incision and drainage, forearm and/or wrist; bursa", + "25035 Incision, deep, bone cortex, forearm and/or wrist (eg, osteomyelitis or bone abscess)", + "25040 Arthrotomy, radiocarpal or midcarpal joint, with exploration, drainage, or removal of foreign body", + "25260 Repair, tendon or muscle, flexor, forearm and/or wrist; primary, single, each tendon or muscle", + "25263 Repair, tendon or muscle, flexor, forearm and/or wrist; secondary, single, each tendon or muscle", + "25265 Repair, tendon or muscle, flexor, forearm and/or wrist; secondary, with free graft (includes obtaining graft), each tendon or muscle", + "25270 Repair, tendon or muscle, extensor, forearm and/or wrist; primary, single, each tendon or muscle", + "25272 Repair, tendon or muscle, extensor, forearm and/or wrist; secondary, single, each tendon or muscle", + "25274 Repair, tendon or muscle, extensor, forearm and/or wrist; secondary, with free graft (includes obtaining graft), each tendon or muscle", + "25275 Repair, tendon sheath, extensor, forearm and/or wrist, with free graft (includes obtaining graft) (eg, for extensor carpi ulnaris subluxation)", + "25320 Capsulorrhaphy or reconstruction, wrist, open (eg, capsulodesis, ligament repair, tendon transfer or graft) (includes synovectomy, capsulotomy and open reduction) for carpal instability", + "25337 Reconstruction for stabilization of unstable distal ulna or distal radioulnar joint, secondary by soft tissue stabilization (eg, tendon transfer, tendon graft or weave, or tenodesis) with or without open", + "25430 Insertion of vascular pedicle into carpal bone (eg, Hori procedure)", + "25431 Repair of nonunion of carpal bone (excluding carpal scaphoid (navicular)) (includes obtaining graft and necessary fixation), each bone", + "25440 Repair of nonunion, scaphoid carpal (navicular) bone, with or without radial styloidectomy (includes obtaining graft and necessary fixation)", + "25500 Closed treatment of radial shaft fracture; without manipulation", + "25505 Closed treatment of radial shaft fracture; with manipulation", + "25515 Open treatment of radial shaft fracture, with or without internal or external fixation", + "25520 Closed treatment of radial shaft fracture and closed treatment of dislocation of distal radioulnar joint (Galeazzi fracture/dislocation)", + "25525 Open treatment of radial shaft fracture, with internal and/ or external fixation and closed treatment of dislocation of distal radioulnar joint (Galeazzi fracture/dislocation), with or without percutaneous", + "25526 Open treatment of radial shaft fracture, with internal and/or external fixation and open treatment, with or without internal or external fixation of distal radioulnar joint (Galeazzi fracture/dislocation),", + "25530 Closed treatment of ulnar shaft fracture; without manipulation", + "25535 Closed treatment of ulnar shaft fracture; with manipulation", + "25545 Open treatment of ulnar shaft fracture, with or without internal or external fixation", + "25560 Closed treatment of radial and ulnar shaft fractures; without manipulation", + "25565 Closed treatment of radial and ulnar shaft fractures; with manipulation", + "25574 Open treatment of radial AND ulnar shaft fractures, with internal or external fixation; of radius OR", + "25575 Open treatment of radial AND ulnar shaft fractures, with internal or external fixation; of radius AND", + "25600 Closed treatment of distal radial fracture (eg, Colles or Smith type) or epiphyseal separation, with or without fracture of ulnar styloid; without manipulation", + "25605 Closed treatment of distal radial fracture (eg, Colles or Smith type) or epiphyseal separation, with or without fracture of ulnar styloid; with manipulation", + "25606 Percutaneous skeletal fixation of distal radial fracture or epiphyseal separation", + "25607 Open treatment of distal radial extra-articular fracture or epiphyseal separation, with internal fixation", + "25608 Open treatment of distal radial intra-articular fracture or epiphyseal separation; with internal fixation", + "25609 With internal fixation of 3 or more fragments", + "25622 Closed treatment of carpal scaphoid (navicular) fracture; without manipulation", + "25624 Closed treatment of carpal scaphoid (navicular) fracture; with manipulation", + "25628 Open treatment of carpal scaphoid (navicular) fracture, with or without internal or external fixation", + "25630 Closed treatment of carpal bone fracture (excluding carpal scaphoid (navicular)); without", + "25635 Closed treatment of carpal bone fracture (excluding carpal scaphoid (navicular)); with manipulation,", + "25645 Open treatment of carpal bone fracture (other than carpal scaphoid (navicular)), each bone", + "25650 Closed treatment of ulnar styloid fracture", + "25651 Percutaneous skeletal fixation of ulnar styloid fracture", + "25652 Open treatment of ulnar styloid fracture", + "25660 Closed treatment of radiocarpal or intercarpal dislocation, one or more bones, with manipulation", + "25670 Open treatment of radiocarpal or intercarpal dislocation, one or more bones", + "25671 Percutaneous skeletal fixation of distal radioulnar dislocation", + "25675 Closed treatment of distal radioulnar dislocation with manipulation", + "25676 Open treatment of distal radioulnar dislocation, acute or chronic", + "25680 Closed treatment of trans-scaphoperilunar type of fracture dislocation, with manipulation", + "25685 Open treatment of trans-scaphoperilunar type of fracture dislocation", + "25690 Closed treatment of lunate dislocation, with manipulation", + "25695 Open treatment of lunate dislocation", + "26010 Drainage of finger abscess; simple", + "26011 Drainage of finger abscess; complicated (eg, felon)", + "26020 Drainage of tendon sheath, digit and/or palm, each", + "26025 Drainage of palmar bursa; single, bursa", + "26030 Drainage of palmar bursa; multiple bursa", + "26037 Decompressive fasciotomy, hand (excludes 26035)", + "26055 Tendon sheath incision (eg, for trigger finger)", + "26060 Tenotomy, percutaneous, single, each digit", + "26070 Arthrotomy, with exploration, drainage, or removal of loose or foreign body; carpometacarpal joint", + "26075 Arthrotomy, with exploration, drainage, or removal of loose or foreign body; metacarpophalangeal", + "26080 Arthrotomy, with exploration, drainage, or removal of loose or foreign body; interphalangeal joint,", + "26185 Sesamoidectomy, thumb or finger (separate procedure)", + "26320 Removal of implant from finger or hand", + "26356 Repair or advancement, flexor tendon, in zone 2 digital flexor tendon sheath (eg, no man's land); primary, without free graft, each tendon", + "26357 Repair or advancement, flexor tendon, in zone 2 digital flexor tendon sheath (eg, no man's land); secondary, without free graft, each tendon", + "26358 Repair or advancement, flexor tendon, in zone 2 digital flexor tendon sheath (eg, no man's land); secondary, with free graft (includes obtaining graft), each tendon", + "26370 Repair or advancement of profundus tendon, with intact superficialis tendon; primary, each tendon", + "26372 Repair or advancement of profundus tendon, with intact superficialis tendon; secondary with free graft (includes obtaining graft), each tendon", + "26373 Repair or advancement of profundus tendon, with intact superficialis tendon; secondary without free", + "26426 Repair of extensor tendon, central slip, secondary (eg, boutonniere deformity); using local tissue(s), including lateral band(s), each finger", + "26428 Repair of extensor tendon, central slip, secondary (eg, boutonniere deformity); with free graft (includes obtaining graft), each finger", + "26432 Closed treatment of distal extensor tendon insertion, with or without percutaneous pinning (eg,", + "26433 Repair of extensor tendon, distal insertion, primary or secondary; without graft (eg, mallet finger)", + "26434 Repair of extensor tendon, distal insertion, primary or secondary; with free graft (includes obtaining", + "26437 Realignment of extensor tendon, hand, each tendon", + "26500 Reconstruction of tendon pulley, each tendon; with local tissues (separate procedure)", + "26502 Reconstruction of tendon pulley, each tendon; with tendon or fascial graft (includes obtaining graft)", + "26540 Repair of collateral ligament, metacarpophalangeal or interphalangeal joint", + "26541 Reconstruction, collateral ligament, metacarpophalangeal joint, single; with tendon or fascial graft", + "26542 Reconstruction, collateral ligament, metacarpophalangeal joint, single; with local tissue (eg,", + "26545 Reconstruction, collateral ligament, interphalangeal joint, single, including graft, each joint", + "26548 Repair and reconstruction, finger, volar plate, interphalangeal joint", + "26600 Closed treatment of metacarpal fracture, single; without manipulation, each bone", + "26605 Closed treatment of metacarpal fracture, single; with manipulation, each bone", + "26607 Closed treatment of metacarpal fracture, with manipulation, with external fixation, each bone", + "26608 Percutaneous skeletal fixation of metacarpal fracture, each bone", + "26615 Open treatment of metacarpal fracture, single, with or without internal or external fixation, each bone", + "26641 Closed treatment of carpometacarpal dislocation, thumb, with manipulation", + "26645 Closed treatment of carpometacarpal fracture dislocation, thumb (Bennett fracture), with", + "26650 Percutaneous skeletal fixation of carpometacarpal fracture dislocation, thumb (Bennett fracture), with manipulation, with or without external fixation", + "26665 Open treatment of carpometacarpal fracture dislocation, thumb (Bennett fracture), with or without", + "26670 Closed treatment of carpometacarpal dislocation, other than thumb, with manipulation, each joint;", + "26675 Closed treatment of carpometacarpal dislocation, other than thumb, with manipulation, each joint;", + "26676 Percutaneous skeletal fixation of carpometacarpal dislocation, other than thumb, with manipulation,", + "26685 Open treatment of carpometacarpal dislocation, other than thumb; with or without internal or", + "26686 Open treatment of carpometacarpal dislocation, other than thumb; complex, multiple or delayed", + "26700 Closed treatment of metacarpophalangeal dislocation, single, with manipulation; without anesthesia", + "26705 Closed treatment of metacarpophalangeal dislocation, single, with manipulation; requiring", + "26706 Percutaneous skeletal fixation of metacarpophalangeal dislocation, single, with manipulation", + "26715 Open treatment of metacarpophalangeal dislocation, single, with or without internal or external", + "26720 Closed treatment of phalangeal shaft fracture, proximal or middle phalanx, finger or thumb; without", + "26725 Closed treatment of phalangeal shaft fracture, proximal or middle phalanx, finger or thumb; with manipulation, with or without skin or skeletal traction, each", + "26727 Percutaneous skeletal fixation of unstable phalangeal shaft fracture, proximal or middle phalanx, finger or thumb, with manipulation, each", + "26735 Open treatment of phalangeal shaft fracture, proximal or middle phalanx, finger or thumb, with or without internal or external fixation, each", + "26740 Closed treatment of articular fracture, involving metacarpophalangeal or interphalangeal joint;", + "26742 Closed treatment of articular fracture, involving metacarpophalangeal or interphalangeal joint; with", + "26746 Open treatment of articular fracture, involving metacarpophalangeal or interphalangeal joint, with or without internal or external fixation, each", + "26750 Closed treatment of distal phalangeal fracture, finger or thumb; without manipulation, each", + "26755 Closed treatment of distal phalangeal fracture, finger or thumb; with manipulation, each", + "26756 Percutaneous skeletal fixation of distal phalangeal fracture, finger or thumb, each", + "26765 Open treatment of distal phalangeal fracture, finger or thumb, with or without internal or external", + "26770 Closed treatment of interphalangeal joint dislocation, single, with manipulation; without anesthesia", + "26775 Closed treatment of interphalangeal joint dislocation, single, with manipulation; requiring anesthesia", + "26776 Percutaneous skeletal fixation of interphalangeal joint dislocation, single, with manipulation", + "26785 Open treatment of interphalangeal joint dislocation, with or without internal or external fixation, single", + "26990 Incision and drainage, pelvis or hip joint area; deep abscess or hematoma", + "26991 Incision and drainage, pelvis or hip joint area; infected bursa", + "27086 Removal of foreign body, pelvis or hip; subcutaneous tissue", + "27087 Removal of foreign body, pelvis or hip; deep (subfascial or intramuscular)", + "27230 Closed treatment of femoral fracture, proximal end, neck; without manipulation", + "27232 Closed treatment of femoral fracture, proximal end, neck; with manipulation, with or without skeletal", + "27235 Percutaneous skeletal fixation of femoral fracture, proximal end, neck", + "27236 Open treatment of femoral fracture, proximal end, neck, internal fixation or prosthetic replacement", + "27238 Closed treatment of intertrochanteric, pertrochanteric, or subtrochanteric femoral fracture; without", + "27240 Closed treatment of intertrochanteric, pertrochanteric, or subtrochanteric femoral fracture; with manipulation, with or without skin or skeletal traction", + "27244 Treatment of intertrochanteric, pertrochanteric, or subtrochanteric femoral fracture; with plate/screw type implant, with or without cerclage", + "27245 Treatment of intertrochanteric, pertrochanteric, or subtrochanteric femoral fracture; with intramedullary implant, with or without interlocking screws and/or cerclage", + "27246 Closed treatment of greater trochanteric fracture, without manipulation", + "27248 Open treatment of greater trochanteric fracture, with or without internal or external fixation", + "27250 Closed treatment of hip dislocation, traumatic; without anesthesia", + "27252 Closed treatment of hip dislocation, traumatic; requiring anesthesia", + "27253 Open treatment of hip dislocation, traumatic, without internal fixation", + "27254 Open treatment of hip dislocation, traumatic, with acetabular wall and femoral head fracture, with or without internal or external fixation", + "27256 Treatment of spontaneous hip dislocation (developmental, including congenital or pathological), by abduction, splint or traction; without anesthesia, without manipulation", + "27257 Treatment of spontaneous hip dislocation (developmental, including congenital or pathological), by abduction, splint or traction; with manipulation, requiring anesthesia", + "27258 Open treatment of spontaneous hip dislocation (developmental, including congenital or pathological), replacement of femoral head in acetabulum (including tenotomy, etc);", + "27259 Open treatment of spontaneous hip dislocation (developmental, including congenital or pathological), replacement of femoral head in acetabulum (including tenotomy, etc); with femoral", + "27265 Closed treatment of post hip arthroplasty dislocation; without anesthesia", + "27266 Closed treatment of post hip arthroplasty dislocation; requiring regional or general anesthesia", + "27301 Incision and drainage, deep abscess, bursa, or hematoma, thigh or knee region", + "27303 Incision, deep, with opening of bone cortex, femur or knee (eg, osteomyelitis or bone abscess)", + "27305 Fasciotomy, iliotibial (tenotomy), open", + "27306 Tenotomy, percutaneous, adductor or hamstring; single tendon (separate procedure)", + "27307 Tenotomy, percutaneous, adductor or hamstring; multiple tendons", + "27310 Arthrotomy, knee, with exploration, drainage, or removal of foreign body (eg, infection)", + "27330 Arthrotomy, knee; with synovial biopsy only", + "27331 Arthrotomy, knee; including joint exploration, biopsy, or removal of loose or foreign bodies", + "27332 Arthrotomy, with excision of semilunar cartilage (meniscectomy) knee; medial OR lateral", + "27333 Arthrotomy, with excision of semilunar cartilage (meniscectomy) knee; medial AND lateral", + "27334 Arthrotomy, with synovectomy, knee; anterior OR posterior", + "27335 Arthrotomy, with synovectomy, knee; anterior AND posterior including popliteal area", + "27340 excision, prepatellar bursa", + "27345 Excision of synovial cyst of popliteal space (eg, Baker's cyst)", + "27347 Excision of lesion of meniscus or capsule (eg, cyst, ganglion), knee", + "27350 Patellectomy or hemipatellectomy", + "27355 Excision or curettage of bone cyst or benign tumor of femur;", + "27356 Excision or curettage of bone cyst or benign tumor of femur; with allograft", + "27357 Excision or curettage of bone cyst or benign tumor of femur; with autograft (includes obtaining graft)", + "27358 Excision or curettage of bone cyst or benign tumor of femur; with internal fixation (List in addition to code for primary procedure)", + "27360 Partial excision (craterization, saucerization, or diaphysectomy) bone, femur, proximal tibia and/or fibula (eg, osteomyelitis or bone abscess)", + "27372 Removal of foreign body, deep, thigh region or knee area", + "27380 Suture of infrapatellar tendon; primary", + "27381 Suture of infrapatellar tendon; secondary reconstruction, including fascial or tendon graft", + "27385 Suture of quadriceps or hamstring muscle rupture; primary", + "27386 Suture of quadriceps or hamstring muscle rupture; secondary reconstruction, including fascial or", + "27390 Tenotomy, open, hamstring, knee to hip; single tendon", + "27391 Tenotomy, open, hamstring, knee to hip; multiple tendons, one leg", + "27392 Tenotomy, open, hamstring, knee to hip; multiple tendons, bilateral", + "27393 Lengthening of hamstring tendon; single tendon", + "27394 Lengthening of hamstring tendon; multiple tendons, one leg", + "27395 Lengthening of hamstring tendon; multiple tendons, bilateral", + "27396 Transplant, hamstring tendon to patella; single tendon", + "27397 Transplant, hamstring tendon to patella; multiple tendons", + "27400 Transfer, tendon or muscle, hamstrings to femur (eg, Egger's type procedure)", + "27403 Arthrotomy with meniscus repair, knee", + "27405 Repair, primary, torn ligament and/or capsule, knee; collateral", + "27407 Repair, primary, torn ligament and/or capsule, knee; cruciate", + "27409 Repair, primary, torn ligament and/or capsule, knee; collateral and cruciate ligaments", + "27412 Autologous chondrocyte implantation, knee", + "27415 Osteochondral allograft, knee, open", + "27418 Anterior tibial tubercleplasty (eg, Maquet type procedure)", + "27420 Reconstruction of dislocating patella; (eg, Hauser type procedure)", + "27422 Reconstruction of dislocating patella; with extensor realignment and/or muscle advancement or release (eg, Campbell, Goldwaite type procedure)", + "27424 Reconstruction of dislocating patella; with patellectomy", + "27425 Lateral retinacular release, open", + "27427 Ligamentous reconstruction (augmentation), knee; extra-articular", + "27428 Ligamentous reconstruction (augmentation), knee; intra-articular (open)", + "27429 Ligamentous reconstruction (augmentation), knee; intra-articular (open) and extra-articular", + "27430 Quadricepsplasty (eg, Bennett or Thompson type)", + "27435 Capsulotomy, posterior capsular release, knee", + "27448 Osteotomy, femur, shaft or supracondylar; without fixation", + "27450 Osteotomy, femur, shaft or supracondylar; with fixation", + "27455 Osteotomy, proximal tibia, including fibular excision or osteotomy (includes correction of genu varus (bowleg) or genu valgus (knock-knee)); before epiphyseal closure", + "27457 Osteotomy, proximal tibia, including fibular excision or osteotomy (includes correction of genu varus (bowleg) or genu valgus (knock-knee)); after epiphyseal closure", + "27496 Decompression fasciotomy, thigh and/or knee, one compartment (flexor or extensor or adductor);", + "27497 Decompression fasciotomy, thigh and/or knee, one compartment (flexor or extensor or adductor); with debridement of nonviable muscle and/or nerve", + "27498 Decompression fasciotomy, thigh and/or knee, multiple compartments;", + "27499 Decompression fasciotomy, thigh and/or knee, multiple compartments; with debridement of", + "27500 Closed treatment of femoral shaft fracture, without manipulation", + "27501 Closed treatment of supracondylar or transcondylar femoral fracture with or without intercondylar", + "27502 Closed treatment of femoral shaft fracture, with manipulation, with or without skin or skeletal traction", + "27503 Closed treatment of supracondylar or transcondylar femoral fracture with or without intercondylar extension, with manipulation, with or without skin or skeletal traction", + "27506 Open treatment of femoral shaft fracture, with or without external fixation, with insertion of intramedullary implant, with or without cerclage and/or locking screws", + "27507 Open treatment of femoral shaft fracture with plate/screws, with or without cerclage", + "27508 Closed treatment of femoral fracture, distal end, medial or lateral condyle, without manipulation", + "27509 Percutaneous skeletal fixation of femoral fracture, distal end, medial or lateral condyle, or supracondylar or transcondylar, with or without intercondylar extension, or distal femoral epiphyseal", + "27510 Closed treatment of femoral fracture, distal end, medial or lateral condyle, with manipulation", + "27511 Open treatment of femoral supracondylar or transcondylar fracture without intercondylar extension, with or without internal or external fixation", + "27513 Open treatment of femoral supracondylar or transcondylar fracture with intercondylar extension, with or without internal or external fixation", + "27514 Open treatment of femoral fracture, distal end, medial or lateral condyle, with or without internal or", + "27516 Closed treatment of distal femoral epiphyseal separation; without manipulation", + "27517 Closed treatment of distal femoral epiphyseal separation; with manipulation, with or without skin or", + "27519 Open treatment of distal femoral epiphyseal separation, with or without internal or external fixation", + "27520 Closed treatment of patellar fracture, without manipulation", + "27524 Open treatment of patellar fracture, with internal fixation and/or partial or complete patellectomy and", + "27530 Closed treatment of tibial fracture, proximal (plateau); without manipulation", + "27532 Closed treatment of tibial fracture, proximal (plateau); with or without manipulation, with skeletal", + "27535 Open treatment of tibial fracture, proximal (plateau); unicondylar, with or without internal or external", + "27536 Open treatment of tibial fracture, proximal (plateau); bicondylar, with or without internal fixation", + "27538 Closed treatment of intercondylar spine(s) and/or tuberosity fracture(s) of knee, with or without", + "27540 Open treatment of intercondylar spine(s) and/or tuberosity fracture(s) of the knee, with or without", + "27550 Closed treatment of knee dislocation; without anesthesia", + "27552 Closed treatment of knee dislocation; requiring anesthesia", + "27556 Open treatment of knee dislocation, with or without internal or external fixation; without primary ligamentous repair or augmentation/reconstruction", + "27557 Open treatment of knee dislocation, with or without internal or external fixation; with primary", + "27558 Open treatment of knee dislocation, with or without internal or external fixation; with primary ligamentous repair, with augmentation/reconstruction", + "27560 Closed treatment of patellar dislocation; without anesthesia", + "27562 Closed treatment of patellar dislocation; requiring anesthesia", + "27566 Open treatment of patellar dislocation, with or without partial or total patellectomy", + "27570 Manipulation of knee joint under general anesthesia (includes application of traction or other fixation", + "27600 Decompression fasciotomy, leg; anterior and/or lateral compartments only", + "27601 Decompression fasciotomy, leg; posterior compartment(s) only", + "27602 Decompression fasciotomy, leg; anterior and/or lateral, and posterior compartment(s)", + "27603 Incision and drainage, leg or ankle; deep abscess or hematoma", + "27604 Incision and drainage, leg or ankle; infected bursa", + "27605 Tenotomy, percutaneous, Achilles tendon (separate procedure); local anesthesia", + "27606 Tenotomy, percutaneous, Achilles tendon (separate procedure); general anesthesia", + "27607 Incision (eg, osteomyelitis or bone abscess), leg or ankle", + "27610 Arthrotomy, ankle, including exploration, drainage, or removal of foreign body", + "27612 Arthrotomy, posterior capsular release, ankle, with or without Achilles tendon lengthening", + "27620 Arthrotomy, ankle, with joint exploration, with or without biopsy, with or without removal of loose or", + "27625 Arthrotomy, with synovectomy, ankle;", + "27626 Arthrotomy, with synovectomy, ankle; including tenosynovectomy", + "27630 Excision of lesion of tendon sheath or capsule (eg, cyst or ganglion), leg and/or ankle", + "27650 Repair, primary, open or percutaneous, ruptured Achilles tendon;", + "27652 Repair, primary, open or percutaneous, ruptured Achilles tendon; with graft (includes obtaining graft)", + "27654 Repair, secondary, Achilles tendon, with or without graft", + "27656 Repair, fascial defect of leg", + "27658 Repair, flexor tendon, leg; primary, without graft, each tendon", + "27659 Repair, flexor tendon, leg; secondary, with or without graft, each tendon", + "27664 Repair, extensor tendon, leg; primary, without graft, each tendon", + "27665 Repair, extensor tendon, leg; secondary, with or without graft, each tendon", + "27675 Repair, dislocating peroneal tendons; without fibular osteotomy", + "27676 Repair, dislocating peroneal tendons; with fibular osteotomy", + "27680 Tenolysis, flexor or extensor tendon, leg and/or ankle; single, each tendon", + "27681 Tenolysis, flexor or extensor tendon, leg and/or ankle; multiple tendons (through separate", + "27695 Repair, primary, disrupted ligament, ankle; collateral", + "27696 Repair, primary, disrupted ligament, ankle; both collateral ligaments", + "27698 Repair, secondary, disrupted ligament, ankle, collateral (eg, Watson-Jones procedure)", + "27705 Osteotomy; tibia", + "27707 Osteotomy; fibula", + "27709 Osteotomy; tibia and fibula", + "27750 Closed treatment of tibial shaft fracture (with or without fibular fracture); without manipulation", + "27752 Closed treatment of tibial shaft fracture (with or without fibular fracture); with manipulation, with or", + "27756 Percutaneous skeletal fixation of tibial shaft fracture (with or without fibular fracture) (eg, pins or", + "27758 Open treatment of tibial shaft fracture, (with or without fibular fracture) with plate/screws, with or", + "27759 Treatment of tibial shaft fracture (with or without fibular fracture) by intramedullary implant, with or without interlocking screws and/or cerclage", + "27760 Closed treatment of medial malleolus fracture; without manipulation", + "27762 Closed treatment of medial malleolus fracture; with manipulation, with or without skin or skeletal", + "27766 Open treatment of medial malleolus fracture, with or without internal or external fixation", + "27780 Closed treatment of proximal fibula or shaft fracture; without manipulation", + "27781 Closed treatment of proximal fibula or shaft fracture; with manipulation", + "27784 Open treatment of proximal fibula or shaft fracture, with or without internal or external fixation", + "27786 Closed treatment of distal fibular fracture (lateral malleolus); without manipulation", + "27788 Closed treatment of distal fibular fracture (lateral malleolus); with manipulation", + "27792 Open treatment of distal fibular fracture (lateral malleolus), with or without internal or external", + "27808 Closed treatment of bimalleolar ankle fracture, (including Potts); without manipulation", + "27810 Closed treatment of bimalleolar ankle fracture, (including Potts); with manipulation", + "27814 Open treatment of bimalleolar ankle fracture, with or without internal or external fixation", + "27816 Closed treatment of trimalleolar ankle fracture; without manipulation", + "27818 Closed treatment of trimalleolar ankle fracture; with manipulation", + "27822 Open treatment of trimalleolar ankle fracture, with or without internal or external fixation, medial and/or lateral malleolus; without fixation of posterior lip", + "27823 Open treatment of trimalleolar ankle fracture, with or without internal or external fixation, medial and/or lateral malleolus; with fixation of posterior lip", + "27824 Closed treatment of fracture of weight bearing articular portion of distal tibia (eg, pilon or tibial plafond), with or without anesthesia; without manipulation", + "27825 Closed treatment of fracture of weight bearing articular portion of distal tibia (eg, pilon or tibial plafond), with or without anesthesia; with skeletal traction and/or requiring manipulation", + "27826 Open treatment of fracture of weight bearing articular surface/portion of distal tibia (eg, pilon or tibial plafond), with internal or external fixation; of fibula only", + "27827 Open treatment of fracture of weight bearing articular surface/portion of distal tibia (eg, pilon or tibial plafond), with internal or external fixation; of tibia only", + "27828 Open treatment of fracture of weight bearing articular surface/portion of distal tibia (eg, pilon or tibial plafond), with internal or external fixation; of both tibia and fibula", + "27829 Open treatment of distal tibiofibular joint (syndesmosis) disruption, with or without internal or", + "27830 Closed treatment of proximal tibiofibular joint dislocation; without anesthesia", + "27831 Closed treatment of proximal tibiofibular joint dislocation; requiring anesthesia", + "27832 Open treatment of proximal tibiofibular joint dislocation, with or without internal or external fixation, or with excision of proximal fibula", + "27840 Closed treatment of ankle dislocation; without anesthesia", + "27842 Closed treatment of ankle dislocation; requiring anesthesia, with or without percutaneous skeletal", + "27846 Open treatment of ankle dislocation, with or without percutaneous skeletal fixation; without repair or", + "27848 Open treatment of ankle dislocation, with or without percutaneous skeletal fixation; with repair or", + "27860 Manipulation of ankle under general anesthesia (includes application of traction or other fixation", + "27892 Decompression fasciotomy, leg; anterior and/or lateral compartments only, with debridement of", + "27893 Decompression fasciotomy, leg; posterior compartment(s) only, with debridement of nonviable", + "27894 Decompression fasciotomy, leg; anterior and/or lateral, and posterior compartment(s), with debridement of nonviable muscle and/or nerve", + "28035 Release, tarsal tunnel (posterior tibial nerve decompression)", + "28080 Excision, interdigital (Morton) neuroma, single, each", + "28090 Excision of lesion, tendon, tendon sheath, or capsule (including synovectomy) (eg, cyst or ganglion);", + "28092 Excision of lesion, tendon, tendon sheath, or capsule (including synovectomy) (eg, cyst or ganglion);", + "28110 Ostectomy, partial excision, fifth metatarsal head (bunionette) (separate procedure)", + "28116 Ostectomy, excision of tarsal coalition", + "28118 Ostectomy, calcaneus;", + "28119 Ostectomy, calcaneus; for spur, with or without plantar fascial release", + "28190 Removal of foreign body, foot; subcutaneous", + "28192 Removal of foreign body, foot; deep", + "28193 Removal of foreign body, foot; complicated", + "28288 Ostectomy, partial, exostectomy or condylectomy, metatarsal head, each metatarsal head", + "28289 Hallux rigidus correction with cheilectomy, debridement and capsular release of the first", + "28315 Sesamoidectomy, first toe (separate procedure)", + "28400 Closed treatment of calcaneal fracture; without manipulation", + "28405 Closed treatment of calcaneal fracture; with manipulation", + "28406 Percutaneous skeletal fixation of calcaneal fracture, with manipulation", + "28415 Open treatment of calcaneal fracture, with or without internal or external fixation;", + "28420 Open treatment of calcaneal fracture, with or without internal or external fixation; with primary iliac or other autogenous bone graft (includes obtaining graft)", + "28430 Closed treatment of talus fracture; without manipulation", + "28435 Closed treatment of talus fracture; with manipulation", + "28436 Percutaneous skeletal fixation of talus fracture, with manipulation", + "28445 Open treatment of talus fracture, with or without internal or external fixation", + "28450 Treatment of tarsal bone fracture (except talus and calcaneus); without manipulation, each", + "28455 Treatment of tarsal bone fracture (except talus and calcaneus); with manipulation, each", + "28456 Percutaneous skeletal fixation of tarsal bone fracture (except talus and calcaneus), with", + "28465 Open treatment of tarsal bone fracture (except talus and calcaneus), with or without internal or", + "28470 Closed treatment of metatarsal fracture; without manipulation, each", + "28475 Closed treatment of metatarsal fracture; with manipulation, each", + "28476 Percutaneous skeletal fixation of metatarsal fracture, with manipulation, each", + "28485 Open treatment of metatarsal fracture, with or without internal or external fixation, each", + "28490 Closed treatment of fracture great toe, phalanx or phalanges; without manipulation", + "28495 Closed treatment of fracture great toe, phalanx or phalanges; with manipulation", + "28496 Percutaneous skeletal fixation of fracture great toe, phalanx or phalanges, with manipulation", + "28505 Open treatment of fracture great toe, phalanx or phalanges, with or without internal or external", + "28510 Closed treatment of fracture, phalanx or phalanges, other than great toe; without manipulation, each", + "28515 Closed treatment of fracture, phalanx or phalanges, other than great toe; with manipulation, each", + "28525 Open treatment of fracture, phalanx or phalanges, other than great toe, with or without internal or", + "28530 Closed treatment of sesamoid fracture", + "28531 Open treatment of sesamoid fracture, with or without internal fixation", + "28540 Closed treatment of tarsal bone dislocation, other than talotarsal; without anesthesia", + "28545 Closed treatment of tarsal bone dislocation, other than talotarsal; requiring anesthesia", + "28546 Percutaneous skeletal fixation of tarsal bone dislocation, other than talotarsal, with manipulation", + "28555 Open treatment of tarsal bone dislocation, with or without internal or external fixation", + "28570 Closed treatment of talotarsal joint dislocation; without anesthesia", + "28575 Closed treatment of talotarsal joint dislocation; requiring anesthesia", + "28576 Percutaneous skeletal fixation of talotarsal joint dislocation, with manipulation", + "28585 Open treatment of talotarsal joint dislocation, with or without internal or external fixation", + "28600 Closed treatment of tarsometatarsal joint dislocation; without anesthesia", + "28605 Closed treatment of tarsometatarsal joint dislocation; requiring anesthesia", + "28606 Percutaneous skeletal fixation of tarsometatarsal joint dislocation, with manipulation", + "28615 Open treatment of tarsometatarsal joint dislocation, with or without internal or external fixation", + "28630 Closed treatment of metatarsophalangeal joint dislocation; without anesthesia", + "28635 Closed treatment of metatarsophalangeal joint dislocation; requiring anesthesia", + "28636 Percutaneous skeletal fixation of metatarsophalangeal joint dislocation, with manipulation", + "28645 Open treatment of metatarsophalangeal joint dislocation, with or without internal or external fixation", + "28660 Closed treatment of interphalangeal joint dislocation; without anesthesia", + "28665 Closed treatment of interphalangeal joint dislocation; requiring anesthesia", + "28666 Percutaneous skeletal fixation of interphalangeal joint dislocation, with manipulation", + "28675 Open treatment of interphalangeal joint dislocation, with or without internal or external fixation", + "29805 Arthroscopy, shoulder, diagnostic, with or without synovial biopsy (separate procedure)", + "29806 Arthroscopy, shoulder, surgical; capsulorrhaphy", + "29807 Arthroscopy, shoulder, surgical; repair of SLAP lesion", + "29819 Arthroscopy, shoulder, surgical; with removal of loose body or foreign body", + "29820 Arthroscopy, shoulder, surgical; synovectomy, partial", + "29821 Arthroscopy, shoulder, surgical; synovectomy, complete", + "29822 Arthroscopy, shoulder, surgical; debridement, limited", + "29823 Arthroscopy, shoulder, surgical; debridement, extensive", + "29824 Arthroscopy, shoulder, surgical; distal claviculectomy including distal articular surface (Mumford", + "29825 Arthroscopy, shoulder, surgical; with lysis and resection of adhesions, with or without manipulation", + "29826 Arthroscopy, shoulder, surgical; decompression of subacromial space with partial acromioplasty, with or without coracoacromial release", + "29827 Arthroscopy, shoulder, surgical; with rotator cuff repair", + "29828 Treatment for arthroscopic surgical biceps tenodesis", + "29830 Arthroscopy, elbow, diagnostic, with or without synovial biopsy (separate procedure)", + "29834 Arthroscopy, elbow, surgical; with removal of loose body or foreign body", + "29835 Arthroscopy, elbow, surgical; synovectomy, partial", + "29836 Arthroscopy, elbow, surgical; synovectomy, complete", + "29837 Arthroscopy, elbow, surgical; debridement, limited", + "29838 Arthroscopy, elbow, surgical; debridement, extensive", + "29844 Arthroscopy, wrist, surgical; synovectomy, partial", + "29845 Arthroscopy, wrist, surgical; synovectomy, complete", + "29846 Arthroscopy, wrist, surgical; excision and/or repair of triangular fibrocartilage and/or joint", + "29847 Arthroscopy, wrist, surgical; internal fixation for fracture or instability", + "29848 Endoscopy, wrist, surgical, with release of transverse carpal ligament", + "29850 Arthroscopically aided treatment of intercondylar spine(s) and/or tuberosity fracture(s) of the knee, with or without manipulation; without internal or external fixation (includes arthroscopy)", + "29851 Arthroscopically aided treatment of intercondylar spine(s) and/or tuberosity fracture(s) of the knee, with or without manipulation; with internal or external fixation (includes arthroscopy)", + "29855 Arthroscopically aided treatment of tibial fracture, proximal (plateau); unicondylar, with or without internal or external fixation (includes arthroscopy)", + "29856 Arthroscopically aided treatment of tibial fracture, proximal (plateau); bicondylar, with or without internal or external fixation (includes arthroscopy)", + "29860 Arthroscopy, hip, diagnostic with or without synovial biopsy (separate procedure)", + "29861 Arthroscopy, hip, surgical; with removal of loose body or foreign body", + "29862 Arthroscopy, hip, surgical; with debridement/shaving of articular cartilage (chondroplasty), abrasion arthroplasty, and/or resection of labrum", + "29863 Arthroscopy, hip, surgical; with synovectomy", + "29866 Arthroscopy, knee, surgical; osteochondral autograft(s) (eg, mosaicplasty) (includes harvesting of", + "29867 Arthroscopy, knee, surgical; osteochondral allograft (eg, mosaicplasty)", + "29868 Arthroscopy, knee, surgical; meniscal transplantation (includes arthrotomy for meniscal insertion),", + "29870 Arthroscopy, knee, diagnostic, with or without synovial biopsy (separate procedure)", + "29871 Arthroscopy, knee, surgical; for infection, lavage and drainage", + "29873 Arthroscopy, knee, surgical; with lateral release", + "29874 Arthroscopy, knee, surgical; for removal of loose body or foreign body (eg, osteochondritis dissecans fragmentation, chondral fragmentation)", + "29875 Arthroscopy, knee, surgical; synovectomy, limited (eg, plica or shelf resection) (separate procedure)", + "29876 Arthroscopy, knee, surgical; synovectomy, major, two or more compartments (eg, medial or lateral)", + "29877 Arthroscopy, knee, surgical; debridement/shaving of articular cartilage (chondroplasty)", + "29879 Arthroscopy, knee, surgical; abrasion arthroplasty (includes chondroplasty where necessary) or", + "29880 Arthroscopy, knee, surgical; with meniscectomy (medial AND lateral, including any meniscal", + "29881 Arthroscopy, knee, surgical; with meniscectomy (medial OR lateral, including any meniscal shaving)", + "29882 Arthroscopy, knee, surgical; with meniscus repair (medial OR lateral)", + "29883 Arthroscopy, knee, surgical; with meniscus repair (medial AND lateral)", + "29884 Arthroscopy, knee, surgical; with lysis of adhesions, with or without manipulation (separate", + "29885 Arthroscopy, knee, surgical; drilling for osteochondritis dissecans with bone grafting, with or without internal fixation (including debridement of base of lesion)", + "29886 Arthroscopy, knee, surgical; drilling for intact osteochondritis dissecans lesion", + "29887 Arthroscopy, knee, surgical; drilling for intact osteochondritis dissecans lesion with internal fixation", + "29888 Arthroscopically aided anterior cruciate ligament repair/augmentation or reconstruction", + "29889 Arthroscopically aided posterior cruciate ligament repair/augmentation or reconstruction", + "29891 Arthroscopy, ankle, surgical, excision of osteochondral defect of talus and/or tibia, including drilling", + "29892 Arthroscopically aided repair of large osteochondritis dissecans lesion, talar dome fracture, or tibial plafond fracture, with or without internal fixation (includes arthroscopy)", + "29893 Endoscopic plantar fasciotomy", + "29894 Arthroscopy, ankle (tibiotalar and fibulotalar joints), surgical; with removal of loose body or foreign", + "29895 Arthroscopy, ankle (tibiotalar and fibulotalar joints), surgical; synovectomy, partial", + "29897 Arthroscopy, ankle (tibiotalar and fibulotalar joints), surgical; debridement, limited", + "29898 Arthroscopy, ankle (tibiotalar and fibulotalar joints), surgical; debridement, extensive", + "29899 Arthroscopy, ankle (tibiotalar and fibulotalar joints), surgical; with ankle arthrodesis", + "64718 Neuroplasty and/or transposition; ulnar nerve at elbow", + "64719 Neuroplasty and/or transposition; ulnar nerve at wrist", + "64721 Neuroplasty and/or transposition; median nerve at carpal tunnel" + ] }, { active: true, - department: "2456" , - modalities: ["CT", "MR", "VL"], - reasons: ["Eye Infection", "Acute Ocular Trauma", "Retinal Detachment", "Foreign Object Removal"] + department: "ENT" , + modalities: ["CT", "US", "VL"], + reasons: [ + "Infection Ear, Left", "Infection Ear, Right", "Sore Throat", + "Sinus infection" + ] }, ] }; diff --git a/model/dtos.ts b/model/dtos.ts new file mode 100644 index 0000000..491bbf4 --- /dev/null +++ b/model/dtos.ts @@ -0,0 +1,29 @@ +export interface INewStudy { + accession: string; + dob?: Date; + gender: "F" | "M" | "O"; + modality: string; + mrn: string; + patientName: string; + reason?: string; + studyDate?: Date; + studyUid?: string; +} + +export interface INewStudyDto { + accession: string; + dob: string; + gender: "F" | "M" | "O"; + mrn: string; + modality: string; + patientName: string; + reason: string; + studyDate: string; + studyUid: string; +} + +export interface IApiResponse { + code: number; + data: T; + message: string; +} diff --git a/package.json b/package.json index 228d2a4..76a489c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dcmwebmwltestgen", - "version": "0.0.4", + "version": "0.0.7", "description": "DICOM Web Based Modality Worklist Test Generator", "main": "app.js", "repository": "https://imanabu@github.com/imanabu/dcmWebMwlTestGen.git", @@ -27,6 +27,7 @@ "errorhandler": "^1.5.0", "express-jwt": "^5.3.1", "express-session": "^1.15.6", + "express-slow-down": "^1.3.1", "font-awesome": "^4.7.0", "global-npm": "^0.3.0", "glyphicons": "^0.2.0", diff --git a/public/css/style.less b/public/css/style.less index a72438d..6e2dcc6 100644 --- a/public/css/style.less +++ b/public/css/style.less @@ -74,6 +74,10 @@ body { margin-top:7px; } +.lbl-input { + width: 90px; +} + .btn-margin { margin-left:5px; } @@ -90,3 +94,7 @@ body { 100% {background-color: white;} } +.lbl-input { + width: 100px; +} + diff --git a/public/index.html b/public/index.html index 9b0989d..282b903 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ - + diff --git a/public/jsd/main.js b/public/jsd/main.js deleted file mode 100644 index edc5af0..0000000 --- a/public/jsd/main.js +++ /dev/null @@ -1,3159 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // 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 = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 0); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "../node_modules/lodash/fp.js": -/*!************************************!*\ - !*** ../node_modules/lodash/fp.js ***! - \************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var _ = __webpack_require__(/*! ./lodash.min */ "../node_modules/lodash/lodash.min.js").runInContext(); -module.exports = __webpack_require__(/*! ./fp/_baseConvert */ "../node_modules/lodash/fp/_baseConvert.js")(_, _); - - -/***/ }), - -/***/ "../node_modules/lodash/fp/_baseConvert.js": -/*!*************************************************!*\ - !*** ../node_modules/lodash/fp/_baseConvert.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var mapping = __webpack_require__(/*! ./_mapping */ "../node_modules/lodash/fp/_mapping.js"), - fallbackHolder = __webpack_require__(/*! ./placeholder */ "../node_modules/lodash/fp/placeholder.js"); - -/** Built-in value reference. */ -var push = Array.prototype.push; - -/** - * Creates a function, with an arity of `n`, that invokes `func` with the - * arguments it receives. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} n The arity of the new function. - * @returns {Function} Returns the new function. - */ -function baseArity(func, n) { - return n == 2 - ? function(a, b) { return func.apply(undefined, arguments); } - : function(a) { return func.apply(undefined, arguments); }; -} - -/** - * Creates a function that invokes `func`, with up to `n` arguments, ignoring - * any additional arguments. - * - * @private - * @param {Function} func The function to cap arguments for. - * @param {number} n The arity cap. - * @returns {Function} Returns the new function. - */ -function baseAry(func, n) { - return n == 2 - ? function(a, b) { return func(a, b); } - : function(a) { return func(a); }; -} - -/** - * Creates a clone of `array`. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the cloned array. - */ -function cloneArray(array) { - var length = array ? array.length : 0, - result = Array(length); - - while (length--) { - result[length] = array[length]; - } - return result; -} - -/** - * Creates a function that clones a given object using the assignment `func`. - * - * @private - * @param {Function} func The assignment function. - * @returns {Function} Returns the new cloner function. - */ -function createCloner(func) { - return function(object) { - return func({}, object); - }; -} - -/** - * A specialized version of `_.spread` which flattens the spread array into - * the arguments of the invoked `func`. - * - * @private - * @param {Function} func The function to spread arguments over. - * @param {number} start The start position of the spread. - * @returns {Function} Returns the new function. - */ -function flatSpread(func, start) { - return function() { - var length = arguments.length, - lastIndex = length - 1, - args = Array(length); - - while (length--) { - args[length] = arguments[length]; - } - var array = args[start], - otherArgs = args.slice(0, start); - - if (array) { - push.apply(otherArgs, array); - } - if (start != lastIndex) { - push.apply(otherArgs, args.slice(start + 1)); - } - return func.apply(this, otherArgs); - }; -} - -/** - * Creates a function that wraps `func` and uses `cloner` to clone the first - * argument it receives. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} cloner The function to clone arguments. - * @returns {Function} Returns the new immutable function. - */ -function wrapImmutable(func, cloner) { - return function() { - var length = arguments.length; - if (!length) { - return; - } - var args = Array(length); - while (length--) { - args[length] = arguments[length]; - } - var result = args[0] = cloner.apply(undefined, args); - func.apply(undefined, args); - return result; - }; -} - -/** - * The base implementation of `convert` which accepts a `util` object of methods - * required to perform conversions. - * - * @param {Object} util The util object. - * @param {string} name The name of the function to convert. - * @param {Function} func The function to convert. - * @param {Object} [options] The options object. - * @param {boolean} [options.cap=true] Specify capping iteratee arguments. - * @param {boolean} [options.curry=true] Specify currying. - * @param {boolean} [options.fixed=true] Specify fixed arity. - * @param {boolean} [options.immutable=true] Specify immutable operations. - * @param {boolean} [options.rearg=true] Specify rearranging arguments. - * @returns {Function|Object} Returns the converted function or object. - */ -function baseConvert(util, name, func, options) { - var isLib = typeof name == 'function', - isObj = name === Object(name); - - if (isObj) { - options = func; - func = name; - name = undefined; - } - if (func == null) { - throw new TypeError; - } - options || (options = {}); - - var config = { - 'cap': 'cap' in options ? options.cap : true, - 'curry': 'curry' in options ? options.curry : true, - 'fixed': 'fixed' in options ? options.fixed : true, - 'immutable': 'immutable' in options ? options.immutable : true, - 'rearg': 'rearg' in options ? options.rearg : true - }; - - var defaultHolder = isLib ? func : fallbackHolder, - forceCurry = ('curry' in options) && options.curry, - forceFixed = ('fixed' in options) && options.fixed, - forceRearg = ('rearg' in options) && options.rearg, - pristine = isLib ? func.runInContext() : undefined; - - var helpers = isLib ? func : { - 'ary': util.ary, - 'assign': util.assign, - 'clone': util.clone, - 'curry': util.curry, - 'forEach': util.forEach, - 'isArray': util.isArray, - 'isError': util.isError, - 'isFunction': util.isFunction, - 'isWeakMap': util.isWeakMap, - 'iteratee': util.iteratee, - 'keys': util.keys, - 'rearg': util.rearg, - 'toInteger': util.toInteger, - 'toPath': util.toPath - }; - - var ary = helpers.ary, - assign = helpers.assign, - clone = helpers.clone, - curry = helpers.curry, - each = helpers.forEach, - isArray = helpers.isArray, - isError = helpers.isError, - isFunction = helpers.isFunction, - isWeakMap = helpers.isWeakMap, - keys = helpers.keys, - rearg = helpers.rearg, - toInteger = helpers.toInteger, - toPath = helpers.toPath; - - var aryMethodKeys = keys(mapping.aryMethod); - - var wrappers = { - 'castArray': function(castArray) { - return function() { - var value = arguments[0]; - return isArray(value) - ? castArray(cloneArray(value)) - : castArray.apply(undefined, arguments); - }; - }, - 'iteratee': function(iteratee) { - return function() { - var func = arguments[0], - arity = arguments[1], - result = iteratee(func, arity), - length = result.length; - - if (config.cap && typeof arity == 'number') { - arity = arity > 2 ? (arity - 2) : 1; - return (length && length <= arity) ? result : baseAry(result, arity); - } - return result; - }; - }, - 'mixin': function(mixin) { - return function(source) { - var func = this; - if (!isFunction(func)) { - return mixin(func, Object(source)); - } - var pairs = []; - each(keys(source), function(key) { - if (isFunction(source[key])) { - pairs.push([key, func.prototype[key]]); - } - }); - - mixin(func, Object(source)); - - each(pairs, function(pair) { - var value = pair[1]; - if (isFunction(value)) { - func.prototype[pair[0]] = value; - } else { - delete func.prototype[pair[0]]; - } - }); - return func; - }; - }, - 'nthArg': function(nthArg) { - return function(n) { - var arity = n < 0 ? 1 : (toInteger(n) + 1); - return curry(nthArg(n), arity); - }; - }, - 'rearg': function(rearg) { - return function(func, indexes) { - var arity = indexes ? indexes.length : 0; - return curry(rearg(func, indexes), arity); - }; - }, - 'runInContext': function(runInContext) { - return function(context) { - return baseConvert(util, runInContext(context), options); - }; - } - }; - - /*--------------------------------------------------------------------------*/ - - /** - * Casts `func` to a function with an arity capped iteratee if needed. - * - * @private - * @param {string} name The name of the function to inspect. - * @param {Function} func The function to inspect. - * @returns {Function} Returns the cast function. - */ - function castCap(name, func) { - if (config.cap) { - var indexes = mapping.iterateeRearg[name]; - if (indexes) { - return iterateeRearg(func, indexes); - } - var n = !isLib && mapping.iterateeAry[name]; - if (n) { - return iterateeAry(func, n); - } - } - return func; - } - - /** - * Casts `func` to a curried function if needed. - * - * @private - * @param {string} name The name of the function to inspect. - * @param {Function} func The function to inspect. - * @param {number} n The arity of `func`. - * @returns {Function} Returns the cast function. - */ - function castCurry(name, func, n) { - return (forceCurry || (config.curry && n > 1)) - ? curry(func, n) - : func; - } - - /** - * Casts `func` to a fixed arity function if needed. - * - * @private - * @param {string} name The name of the function to inspect. - * @param {Function} func The function to inspect. - * @param {number} n The arity cap. - * @returns {Function} Returns the cast function. - */ - function castFixed(name, func, n) { - if (config.fixed && (forceFixed || !mapping.skipFixed[name])) { - var data = mapping.methodSpread[name], - start = data && data.start; - - return start === undefined ? ary(func, n) : flatSpread(func, start); - } - return func; - } - - /** - * Casts `func` to an rearged function if needed. - * - * @private - * @param {string} name The name of the function to inspect. - * @param {Function} func The function to inspect. - * @param {number} n The arity of `func`. - * @returns {Function} Returns the cast function. - */ - function castRearg(name, func, n) { - return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name])) - ? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n]) - : func; - } - - /** - * Creates a clone of `object` by `path`. - * - * @private - * @param {Object} object The object to clone. - * @param {Array|string} path The path to clone by. - * @returns {Object} Returns the cloned object. - */ - function cloneByPath(object, path) { - path = toPath(path); - - var index = -1, - length = path.length, - lastIndex = length - 1, - result = clone(Object(object)), - nested = result; - - while (nested != null && ++index < length) { - var key = path[index], - value = nested[key]; - - if (value != null && - !(isFunction(value) || isError(value) || isWeakMap(value))) { - nested[key] = clone(index == lastIndex ? value : Object(value)); - } - nested = nested[key]; - } - return result; - } - - /** - * Converts `lodash` to an immutable auto-curried iteratee-first data-last - * version with conversion `options` applied. - * - * @param {Object} [options] The options object. See `baseConvert` for more details. - * @returns {Function} Returns the converted `lodash`. - */ - function convertLib(options) { - return _.runInContext.convert(options)(undefined); - } - - /** - * Create a converter function for `func` of `name`. - * - * @param {string} name The name of the function to convert. - * @param {Function} func The function to convert. - * @returns {Function} Returns the new converter function. - */ - function createConverter(name, func) { - var realName = mapping.aliasToReal[name] || name, - methodName = mapping.remap[realName] || realName, - oldOptions = options; - - return function(options) { - var newUtil = isLib ? pristine : helpers, - newFunc = isLib ? pristine[methodName] : func, - newOptions = assign(assign({}, oldOptions), options); - - return baseConvert(newUtil, realName, newFunc, newOptions); - }; - } - - /** - * Creates a function that wraps `func` to invoke its iteratee, with up to `n` - * arguments, ignoring any additional arguments. - * - * @private - * @param {Function} func The function to cap iteratee arguments for. - * @param {number} n The arity cap. - * @returns {Function} Returns the new function. - */ - function iterateeAry(func, n) { - return overArg(func, function(func) { - return typeof func == 'function' ? baseAry(func, n) : func; - }); - } - - /** - * Creates a function that wraps `func` to invoke its iteratee with arguments - * arranged according to the specified `indexes` where the argument value at - * the first index is provided as the first argument, the argument value at - * the second index is provided as the second argument, and so on. - * - * @private - * @param {Function} func The function to rearrange iteratee arguments for. - * @param {number[]} indexes The arranged argument indexes. - * @returns {Function} Returns the new function. - */ - function iterateeRearg(func, indexes) { - return overArg(func, function(func) { - var n = indexes.length; - return baseArity(rearg(baseAry(func, n), indexes), n); - }); - } - - /** - * Creates a function that invokes `func` with its first argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ - function overArg(func, transform) { - return function() { - var length = arguments.length; - if (!length) { - return func(); - } - var args = Array(length); - while (length--) { - args[length] = arguments[length]; - } - var index = config.rearg ? 0 : (length - 1); - args[index] = transform(args[index]); - return func.apply(undefined, args); - }; - } - - /** - * Creates a function that wraps `func` and applys the conversions - * rules by `name`. - * - * @private - * @param {string} name The name of the function to wrap. - * @param {Function} func The function to wrap. - * @returns {Function} Returns the converted function. - */ - function wrap(name, func, placeholder) { - var result, - realName = mapping.aliasToReal[name] || name, - wrapped = func, - wrapper = wrappers[realName]; - - if (wrapper) { - wrapped = wrapper(func); - } - else if (config.immutable) { - if (mapping.mutate.array[realName]) { - wrapped = wrapImmutable(func, cloneArray); - } - else if (mapping.mutate.object[realName]) { - wrapped = wrapImmutable(func, createCloner(func)); - } - else if (mapping.mutate.set[realName]) { - wrapped = wrapImmutable(func, cloneByPath); - } - } - each(aryMethodKeys, function(aryKey) { - each(mapping.aryMethod[aryKey], function(otherName) { - if (realName == otherName) { - var data = mapping.methodSpread[realName], - afterRearg = data && data.afterRearg; - - result = afterRearg - ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey) - : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey); - - result = castCap(realName, result); - result = castCurry(realName, result, aryKey); - return false; - } - }); - return !result; - }); - - result || (result = wrapped); - if (result == func) { - result = forceCurry ? curry(result, 1) : function() { - return func.apply(this, arguments); - }; - } - result.convert = createConverter(realName, func); - result.placeholder = func.placeholder = placeholder; - - return result; - } - - /*--------------------------------------------------------------------------*/ - - if (!isObj) { - return wrap(name, func, defaultHolder); - } - var _ = func; - - // Convert methods by ary cap. - var pairs = []; - each(aryMethodKeys, function(aryKey) { - each(mapping.aryMethod[aryKey], function(key) { - var func = _[mapping.remap[key] || key]; - if (func) { - pairs.push([key, wrap(key, func, _)]); - } - }); - }); - - // Convert remaining methods. - each(keys(_), function(key) { - var func = _[key]; - if (typeof func == 'function') { - var length = pairs.length; - while (length--) { - if (pairs[length][0] == key) { - return; - } - } - func.convert = createConverter(key, func); - pairs.push([key, func]); - } - }); - - // Assign to `_` leaving `_.prototype` unchanged to allow chaining. - each(pairs, function(pair) { - _[pair[0]] = pair[1]; - }); - - _.convert = convertLib; - _.placeholder = _; - - // Assign aliases. - each(keys(_), function(key) { - each(mapping.realToAlias[key] || [], function(alias) { - _[alias] = _[key]; - }); - }); - - return _; -} - -module.exports = baseConvert; - - -/***/ }), - -/***/ "../node_modules/lodash/fp/_mapping.js": -/*!*********************************************!*\ - !*** ../node_modules/lodash/fp/_mapping.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** Used to map aliases to their real names. */ -exports.aliasToReal = { - - // Lodash aliases. - 'each': 'forEach', - 'eachRight': 'forEachRight', - 'entries': 'toPairs', - 'entriesIn': 'toPairsIn', - 'extend': 'assignIn', - 'extendAll': 'assignInAll', - 'extendAllWith': 'assignInAllWith', - 'extendWith': 'assignInWith', - 'first': 'head', - - // Methods that are curried variants of others. - 'conforms': 'conformsTo', - 'matches': 'isMatch', - 'property': 'get', - - // Ramda aliases. - '__': 'placeholder', - 'F': 'stubFalse', - 'T': 'stubTrue', - 'all': 'every', - 'allPass': 'overEvery', - 'always': 'constant', - 'any': 'some', - 'anyPass': 'overSome', - 'apply': 'spread', - 'assoc': 'set', - 'assocPath': 'set', - 'complement': 'negate', - 'compose': 'flowRight', - 'contains': 'includes', - 'dissoc': 'unset', - 'dissocPath': 'unset', - 'dropLast': 'dropRight', - 'dropLastWhile': 'dropRightWhile', - 'equals': 'isEqual', - 'identical': 'eq', - 'indexBy': 'keyBy', - 'init': 'initial', - 'invertObj': 'invert', - 'juxt': 'over', - 'omitAll': 'omit', - 'nAry': 'ary', - 'path': 'get', - 'pathEq': 'matchesProperty', - 'pathOr': 'getOr', - 'paths': 'at', - 'pickAll': 'pick', - 'pipe': 'flow', - 'pluck': 'map', - 'prop': 'get', - 'propEq': 'matchesProperty', - 'propOr': 'getOr', - 'props': 'at', - 'symmetricDifference': 'xor', - 'symmetricDifferenceBy': 'xorBy', - 'symmetricDifferenceWith': 'xorWith', - 'takeLast': 'takeRight', - 'takeLastWhile': 'takeRightWhile', - 'unapply': 'rest', - 'unnest': 'flatten', - 'useWith': 'overArgs', - 'where': 'conformsTo', - 'whereEq': 'isMatch', - 'zipObj': 'zipObject' -}; - -/** Used to map ary to method names. */ -exports.aryMethod = { - '1': [ - 'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create', - 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow', - 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll', - 'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome','rest', 'reverse', - 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', - 'uniqueId', 'words', 'zipAll' - ], - '2': [ - 'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith', - 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith', - 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN', - 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference', - 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', - 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex', - 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach', - 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get', - 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', - 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', - 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', - 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit', - 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', - 'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll', - 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', - 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', - 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', - 'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', - 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', - 'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', - 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', - 'zipObjectDeep' - ], - '3': [ - 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', - 'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr', - 'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith', - 'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', - 'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd', - 'padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight', - 'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy', - 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy', - 'xorWith', 'zipWith' - ], - '4': [ - 'fill', 'setWith', 'updateWith' - ] -}; - -/** Used to map ary to rearg configs. */ -exports.aryRearg = { - '2': [1, 0], - '3': [2, 0, 1], - '4': [3, 2, 0, 1] -}; - -/** Used to map method names to their iteratee ary. */ -exports.iterateeAry = { - 'dropRightWhile': 1, - 'dropWhile': 1, - 'every': 1, - 'filter': 1, - 'find': 1, - 'findFrom': 1, - 'findIndex': 1, - 'findIndexFrom': 1, - 'findKey': 1, - 'findLast': 1, - 'findLastFrom': 1, - 'findLastIndex': 1, - 'findLastIndexFrom': 1, - 'findLastKey': 1, - 'flatMap': 1, - 'flatMapDeep': 1, - 'flatMapDepth': 1, - 'forEach': 1, - 'forEachRight': 1, - 'forIn': 1, - 'forInRight': 1, - 'forOwn': 1, - 'forOwnRight': 1, - 'map': 1, - 'mapKeys': 1, - 'mapValues': 1, - 'partition': 1, - 'reduce': 2, - 'reduceRight': 2, - 'reject': 1, - 'remove': 1, - 'some': 1, - 'takeRightWhile': 1, - 'takeWhile': 1, - 'times': 1, - 'transform': 2 -}; - -/** Used to map method names to iteratee rearg configs. */ -exports.iterateeRearg = { - 'mapKeys': [1], - 'reduceRight': [1, 0] -}; - -/** Used to map method names to rearg configs. */ -exports.methodRearg = { - 'assignInAllWith': [1, 0], - 'assignInWith': [1, 2, 0], - 'assignAllWith': [1, 0], - 'assignWith': [1, 2, 0], - 'differenceBy': [1, 2, 0], - 'differenceWith': [1, 2, 0], - 'getOr': [2, 1, 0], - 'intersectionBy': [1, 2, 0], - 'intersectionWith': [1, 2, 0], - 'isEqualWith': [1, 2, 0], - 'isMatchWith': [2, 1, 0], - 'mergeAllWith': [1, 0], - 'mergeWith': [1, 2, 0], - 'padChars': [2, 1, 0], - 'padCharsEnd': [2, 1, 0], - 'padCharsStart': [2, 1, 0], - 'pullAllBy': [2, 1, 0], - 'pullAllWith': [2, 1, 0], - 'rangeStep': [1, 2, 0], - 'rangeStepRight': [1, 2, 0], - 'setWith': [3, 1, 2, 0], - 'sortedIndexBy': [2, 1, 0], - 'sortedLastIndexBy': [2, 1, 0], - 'unionBy': [1, 2, 0], - 'unionWith': [1, 2, 0], - 'updateWith': [3, 1, 2, 0], - 'xorBy': [1, 2, 0], - 'xorWith': [1, 2, 0], - 'zipWith': [1, 2, 0] -}; - -/** Used to map method names to spread configs. */ -exports.methodSpread = { - 'assignAll': { 'start': 0 }, - 'assignAllWith': { 'start': 0 }, - 'assignInAll': { 'start': 0 }, - 'assignInAllWith': { 'start': 0 }, - 'defaultsAll': { 'start': 0 }, - 'defaultsDeepAll': { 'start': 0 }, - 'invokeArgs': { 'start': 2 }, - 'invokeArgsMap': { 'start': 2 }, - 'mergeAll': { 'start': 0 }, - 'mergeAllWith': { 'start': 0 }, - 'partial': { 'start': 1 }, - 'partialRight': { 'start': 1 }, - 'without': { 'start': 1 }, - 'zipAll': { 'start': 0 } -}; - -/** Used to identify methods which mutate arrays or objects. */ -exports.mutate = { - 'array': { - 'fill': true, - 'pull': true, - 'pullAll': true, - 'pullAllBy': true, - 'pullAllWith': true, - 'pullAt': true, - 'remove': true, - 'reverse': true - }, - 'object': { - 'assign': true, - 'assignAll': true, - 'assignAllWith': true, - 'assignIn': true, - 'assignInAll': true, - 'assignInAllWith': true, - 'assignInWith': true, - 'assignWith': true, - 'defaults': true, - 'defaultsAll': true, - 'defaultsDeep': true, - 'defaultsDeepAll': true, - 'merge': true, - 'mergeAll': true, - 'mergeAllWith': true, - 'mergeWith': true, - }, - 'set': { - 'set': true, - 'setWith': true, - 'unset': true, - 'update': true, - 'updateWith': true - } -}; - -/** Used to map real names to their aliases. */ -exports.realToAlias = (function() { - var hasOwnProperty = Object.prototype.hasOwnProperty, - object = exports.aliasToReal, - result = {}; - - for (var key in object) { - var value = object[key]; - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } - } - return result; -}()); - -/** Used to map method names to other names. */ -exports.remap = { - 'assignAll': 'assign', - 'assignAllWith': 'assignWith', - 'assignInAll': 'assignIn', - 'assignInAllWith': 'assignInWith', - 'curryN': 'curry', - 'curryRightN': 'curryRight', - 'defaultsAll': 'defaults', - 'defaultsDeepAll': 'defaultsDeep', - 'findFrom': 'find', - 'findIndexFrom': 'findIndex', - 'findLastFrom': 'findLast', - 'findLastIndexFrom': 'findLastIndex', - 'getOr': 'get', - 'includesFrom': 'includes', - 'indexOfFrom': 'indexOf', - 'invokeArgs': 'invoke', - 'invokeArgsMap': 'invokeMap', - 'lastIndexOfFrom': 'lastIndexOf', - 'mergeAll': 'merge', - 'mergeAllWith': 'mergeWith', - 'padChars': 'pad', - 'padCharsEnd': 'padEnd', - 'padCharsStart': 'padStart', - 'propertyOf': 'get', - 'rangeStep': 'range', - 'rangeStepRight': 'rangeRight', - 'restFrom': 'rest', - 'spreadFrom': 'spread', - 'trimChars': 'trim', - 'trimCharsEnd': 'trimEnd', - 'trimCharsStart': 'trimStart', - 'zipAll': 'zip' -}; - -/** Used to track methods that skip fixing their arity. */ -exports.skipFixed = { - 'castArray': true, - 'flow': true, - 'flowRight': true, - 'iteratee': true, - 'mixin': true, - 'rearg': true, - 'runInContext': true -}; - -/** Used to track methods that skip rearranging arguments. */ -exports.skipRearg = { - 'add': true, - 'assign': true, - 'assignIn': true, - 'bind': true, - 'bindKey': true, - 'concat': true, - 'difference': true, - 'divide': true, - 'eq': true, - 'gt': true, - 'gte': true, - 'isEqual': true, - 'lt': true, - 'lte': true, - 'matchesProperty': true, - 'merge': true, - 'multiply': true, - 'overArgs': true, - 'partial': true, - 'partialRight': true, - 'propertyOf': true, - 'random': true, - 'range': true, - 'rangeRight': true, - 'subtract': true, - 'zip': true, - 'zipObject': true, - 'zipObjectDeep': true -}; - - -/***/ }), - -/***/ "../node_modules/lodash/fp/placeholder.js": -/*!************************************************!*\ - !*** ../node_modules/lodash/fp/placeholder.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -/** - * The default argument placeholder value for methods. - * - * @type {Object} - */ -module.exports = {}; - - -/***/ }), - -/***/ "../node_modules/lodash/lodash.min.js": -/*!********************************************!*\ - !*** ../node_modules/lodash/lodash.min.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/** - * @license - * Lodash lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE - */ -;(function(){function n(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function t(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u"']/g,G=RegExp(V.source),H=RegExp(K.source),J=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nn=/^\w*$/,tn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rn=/[\\^$.*+?()[\]{}|]/g,en=RegExp(rn.source),un=/^\s+|\s+$/g,on=/^\s+/,fn=/\s+$/,cn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,an=/\{\n\/\* \[wrapped with (.+)\] \*/,ln=/,? & /,sn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,hn=/\\(\\)?/g,pn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_n=/\w*$/,vn=/^[-+]0x[0-9a-f]+$/i,gn=/^0b[01]+$/i,dn=/^\[object .+?Constructor\]$/,yn=/^0o[0-7]+$/i,bn=/^(?:0|[1-9]\d*)$/,xn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,jn=/($^)/,wn=/['\n\r\u2028\u2029\\]/g,mn="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?)*",An="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+mn,kn="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]?|[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",En=RegExp("['\u2019]","g"),Sn=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),On=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+kn+mn,"g"),In=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+",An].join("|"),"g"),Rn=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),zn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wn="Array Buffer DataView Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Promise RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),Un={}; -Un["[object Float32Array]"]=Un["[object Float64Array]"]=Un["[object Int8Array]"]=Un["[object Int16Array]"]=Un["[object Int32Array]"]=Un["[object Uint8Array]"]=Un["[object Uint8ClampedArray]"]=Un["[object Uint16Array]"]=Un["[object Uint32Array]"]=true,Un["[object Arguments]"]=Un["[object Array]"]=Un["[object ArrayBuffer]"]=Un["[object Boolean]"]=Un["[object DataView]"]=Un["[object Date]"]=Un["[object Error]"]=Un["[object Function]"]=Un["[object Map]"]=Un["[object Number]"]=Un["[object Object]"]=Un["[object RegExp]"]=Un["[object Set]"]=Un["[object String]"]=Un["[object WeakMap]"]=false; -var Bn={};Bn["[object Arguments]"]=Bn["[object Array]"]=Bn["[object ArrayBuffer]"]=Bn["[object DataView]"]=Bn["[object Boolean]"]=Bn["[object Date]"]=Bn["[object Float32Array]"]=Bn["[object Float64Array]"]=Bn["[object Int8Array]"]=Bn["[object Int16Array]"]=Bn["[object Int32Array]"]=Bn["[object Map]"]=Bn["[object Number]"]=Bn["[object Object]"]=Bn["[object RegExp]"]=Bn["[object Set]"]=Bn["[object String]"]=Bn["[object Symbol]"]=Bn["[object Uint8Array]"]=Bn["[object Uint8ClampedArray]"]=Bn["[object Uint16Array]"]=Bn["[object Uint32Array]"]=true, -Bn["[object Error]"]=Bn["[object Function]"]=Bn["[object WeakMap]"]=false;var Ln={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Cn=parseFloat,Dn=parseInt,Mn=typeof global=="object"&&global&&global.Object===Object&&global,Tn=typeof self=="object"&&self&&self.Object===Object&&self,$n=Mn||Tn||Function("return this")(),Fn= true&&exports&&!exports.nodeType&&exports,Nn=Fn&&typeof module=="object"&&module&&!module.nodeType&&module,Pn=Nn&&Nn.exports===Fn,Zn=Pn&&Mn.process,qn=function(){ -try{var n=Nn&&Nn.require&&Nn.require("util").types;return n?n:Zn&&Zn.binding&&Zn.binding("util")}catch(n){}}(),Vn=qn&&qn.isArrayBuffer,Kn=qn&&qn.isDate,Gn=qn&&qn.isMap,Hn=qn&&qn.isRegExp,Jn=qn&&qn.isSet,Yn=qn&&qn.isTypedArray,Qn=b("length"),Xn=x({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e", -"\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a", -"\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I", -"\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r", -"\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ", -"\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),nt=x({"&":"&","<":"<",">":">",'"':""","'":"'"}),tt=x({"&":"&","<":"<",">":">",""":'"',"'":"'"}),rt=function x(mn){function An(n){if(yu(n)&&!ff(n)&&!(n instanceof Ln)){if(n instanceof On)return n;if(oi.call(n,"__wrapped__"))return Fe(n)}return new On(n)}function kn(){}function On(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=T}function Ln(n){ -this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Mn(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t=t?n:t)),n}function _t(n,t,e,u,i,o){var f,c=1&t,a=2&t,l=4&t;if(e&&(f=i?e(n,u,i,o):e(n)),f!==T)return f;if(!du(n))return n;if(u=ff(n)){if(f=me(n),!c)return Lr(n,f)}else{var s=vo(n),h="[object Function]"==s||"[object GeneratorFunction]"==s;if(af(n))return Ir(n,c);if("[object Object]"==s||"[object Arguments]"==s||h&&!i){if(f=a||h?{}:Ae(n),!c)return a?Mr(n,lt(f,n)):Dr(n,at(f,n))}else{if(!Bn[s])return i?n:{};f=ke(n,s,c)}}if(o||(o=new Zn), -i=o.get(n))return i;if(o.set(n,f),pf(n))return n.forEach(function(r){f.add(_t(r,t,e,r,n,o))}),f;if(sf(n))return n.forEach(function(r,u){f.set(u,_t(r,t,e,u,n,o))}),f;var a=l?a?ve:_e:a?Uu:Wu,p=u?T:a(n);return r(p||n,function(r,u){p&&(u=r,r=n[u]),ot(f,u,_t(r,t,e,u,n,o))}),f}function vt(n){var t=Wu(n);return function(r){return gt(r,n,t)}}function gt(n,t,r){var e=r.length;if(null==n)return!e;for(n=Qu(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===T&&!(u in n)||!i(o))return false}return true}function dt(n,t,r){if(typeof n!="function")throw new ti("Expected a function"); -return bo(function(){n.apply(T,r)},t)}function yt(n,t,r,e){var u=-1,i=o,a=true,l=n.length,s=[],h=t.length;if(!l)return s;r&&(t=c(t,E(r))),e?(i=f,a=false):200<=t.length&&(i=O,a=false,t=new Nn(t));n:for(;++ut}function Rt(n,t){return null!=n&&oi.call(n,t)}function zt(n,t){return null!=n&&t in Qu(n)}function Wt(n,t,r){for(var e=r?f:o,u=n[0].length,i=n.length,a=i,l=Ku(i),s=1/0,h=[];a--;){var p=n[a];a&&t&&(p=c(p,E(t))),s=Ci(p.length,s), -l[a]=!r&&(t||120<=u&&120<=p.length)?new Nn(a&&p):T}var p=n[0],_=-1,v=l[0];n:for(;++_r.length?t:Et(t,hr(r,0,-1)),r=null==t?t:t[Me(Ve(r))],null==r?T:n(r,t,e)}function Lt(n){return yu(n)&&"[object Arguments]"==Ot(n)}function Ct(n){ -return yu(n)&&"[object ArrayBuffer]"==Ot(n)}function Dt(n){return yu(n)&&"[object Date]"==Ot(n)}function Mt(n,t,r,e,u){if(n===t)return true;if(null==n||null==t||!yu(n)&&!yu(t))return n!==n&&t!==t;n:{var i=ff(n),o=ff(t),f=i?"[object Array]":vo(n),c=o?"[object Array]":vo(t),f="[object Arguments]"==f?"[object Object]":f,c="[object Arguments]"==c?"[object Object]":c,a="[object Object]"==f,o="[object Object]"==c;if((c=f==c)&&af(n)){if(!af(t)){t=false;break n}i=true,a=false}if(c&&!a)u||(u=new Zn),t=i||_f(n)?se(n,t,r,e,Mt,u):he(n,t,f,r,e,Mt,u);else{ -if(!(1&r)&&(i=a&&oi.call(n,"__wrapped__"),f=o&&oi.call(t,"__wrapped__"),i||f)){n=i?n.value():n,t=f?t.value():t,u||(u=new Zn),t=Mt(n,t,r,e,u);break n}if(c)t:if(u||(u=new Zn),i=1&r,f=_e(n),o=f.length,c=_e(t).length,o==c||i){for(a=o;a--;){var l=f[a];if(!(i?l in t:oi.call(t,l))){t=false;break t}}if((c=u.get(n))&&u.get(t))t=c==t;else{c=true,u.set(n,t),u.set(t,n);for(var s=i;++at?r:0,Se(t,r)?n[t]:T}function Xt(n,t,r){var e=-1;return t=c(t.length?t:[$u],E(ye())),n=Gt(n,function(n,r,u){return{a:c(t,function(t){return t(n)}), -b:++e,c:n}}),w(n,function(n,t){var e;n:{e=-1;for(var u=n.a,i=t.a,o=u.length,f=r.length;++e=f){e=c;break n}e=c*("desc"==r[e]?-1:1);break n}}e=n.b-t.b}return e})}function nr(n,t){return tr(n,t,function(t,r){return zu(n,r)})}function tr(n,t,r){for(var e=-1,u=t.length,i={};++et||9007199254740991t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Ku(u);++e=u){for(;e>>1,o=n[i];null!==o&&!wu(o)&&(r?o<=t:ot.length?n:Et(n,hr(t,0,-1)),null==n||delete n[Me(Ve(t))]}function jr(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++ie)return e?br(n[0]):[];for(var u=-1,i=Ku(e);++u=e?n:hr(n,t,r)}function Ir(n,t){if(t)return n.slice();var r=n.length,r=gi?gi(r):new n.constructor(r);return n.copy(r),r}function Rr(n){var t=new n.constructor(n.byteLength);return new vi(t).set(new vi(n)),t}function zr(n,t){return new n.constructor(t?Rr(n.buffer):n.buffer,n.byteOffset,n.length); -}function Wr(n,t){if(n!==t){var r=n!==T,e=null===n,u=n===n,i=wu(n),o=t!==T,f=null===t,c=t===t,a=wu(t);if(!f&&!a&&!i&&n>t||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&nu?T:i,u=1),t=Qu(t);++eo&&f[0]!==a&&f[o-1]!==a?[]:B(f,a),o-=c.length,or?r?or(t,n):t:(r=or(t,Oi(n/D(t))),Rn.test(t)?Or(M(r),0,n).join(""):r.slice(0,n))}function te(t,r,e,u){function i(){for(var r=-1,c=arguments.length,a=-1,l=u.length,s=Ku(l+c),h=this&&this!==$n&&this instanceof i?f:t;++at||e)&&(1&n&&(i[2]=h[2],t|=1&r?0:4),(r=h[3])&&(e=i[3],i[3]=e?Ur(e,r,h[4]):r,i[4]=e?B(i[3],"__lodash_placeholder__"):h[4]),(r=h[5])&&(e=i[5],i[5]=e?Br(e,r,h[6]):r,i[6]=e?B(i[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(i[7]=r),128&n&&(i[8]=null==i[8]?h[8]:Ci(i[8],h[8])),null==i[9]&&(i[9]=h[9]),i[0]=h[0],i[1]=t),n=i[0],t=i[1], -r=i[2],e=i[3],u=i[4],f=i[9]=i[9]===T?c?0:n.length:Li(i[9]-a,0),!f&&24&t&&(t&=-25),c=t&&1!=t?8==t||16==t?Kr(n,t,f):32!=t&&33!=t||u.length?Jr.apply(T,i):te(n,t,r,e):Pr(n,t,r),Le((h?co:yo)(c,i),n,t)}function ce(n,t,r,e){return n===T||lu(n,ei[r])&&!oi.call(e,r)?t:n}function ae(n,t,r,e,u,i){return du(n)&&du(t)&&(i.set(t,n),Yt(n,t,T,ae,i),i.delete(t)),n}function le(n){return xu(n)?T:n}function se(n,t,r,e,u,i){var o=1&r,f=n.length,c=t.length;if(f!=c&&!(o&&c>f))return false;if((c=i.get(n))&&i.get(t))return c==t; -var c=-1,a=true,l=2&r?new Nn:T;for(i.set(n,t),i.set(t,n);++cr&&(r=Li(e+r,0)),_(n,ye(t,3),r)):-1}function Pe(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e-1;return r!==T&&(u=ku(r),u=0>r?Li(e+u,0):Ci(u,e-1)),_(n,ye(t,3),u,true)}function Ze(n){return(null==n?0:n.length)?wt(n,1):[]; -}function qe(n){return n&&n.length?n[0]:T}function Ve(n){var t=null==n?0:n.length;return t?n[t-1]:T}function Ke(n,t){return n&&n.length&&t&&t.length?er(n,t):n}function Ge(n){return null==n?n:$i.call(n)}function He(n){if(!n||!n.length)return[];var t=0;return n=i(n,function(n){if(hu(n))return t=Li(n.length,t),true}),A(t,function(t){return c(n,b(t))})}function Je(t,r){if(!t||!t.length)return[];var e=He(t);return null==r?e:c(e,function(t){return n(r,T,t)})}function Ye(n){return n=An(n),n.__chain__=true,n; -}function Qe(n,t){return t(n)}function Xe(){return this}function nu(n,t){return(ff(n)?r:uo)(n,ye(t,3))}function tu(n,t){return(ff(n)?e:io)(n,ye(t,3))}function ru(n,t){return(ff(n)?c:Gt)(n,ye(t,3))}function eu(n,t,r){return t=r?T:t,t=n&&null==t?n.length:t,fe(n,128,T,T,T,T,t)}function uu(n,t){var r;if(typeof t!="function")throw new ti("Expected a function");return n=ku(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=T),r}}function iu(n,t,r){return t=r?T:t,n=fe(n,8,T,T,T,T,T,t),n.placeholder=iu.placeholder, -n}function ou(n,t,r){return t=r?T:t,n=fe(n,16,T,T,T,T,T,t),n.placeholder=ou.placeholder,n}function fu(n,t,r){function e(t){var r=c,e=a;return c=a=T,_=t,s=n.apply(e,r)}function u(n){var r=n-p;return n-=_,p===T||r>=t||0>r||g&&n>=l}function i(){var n=Go();if(u(n))return o(n);var r,e=bo;r=n-_,n=t-(n-p),r=g?Ci(n,l-r):n,h=e(i,r)}function o(n){return h=T,d&&c?e(n):(c=a=T,s)}function f(){var n=Go(),r=u(n);if(c=arguments,a=this,p=n,r){if(h===T)return _=n=p,h=bo(i,t),v?e(n):s;if(g)return h=bo(i,t),e(p)}return h===T&&(h=bo(i,t)), -s}var c,a,l,s,h,p,_=0,v=false,g=false,d=true;if(typeof n!="function")throw new ti("Expected a function");return t=Su(t)||0,du(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Li(Su(r.maxWait)||0,t):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==T&&lo(h),_=0,c=p=a=h=T},f.flush=function(){return h===T?s:o(Go())},f}function cu(n,t){if(typeof n!="function"||null!=t&&typeof t!="function")throw new ti("Expected a function");var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;return i.has(u)?i.get(u):(e=n.apply(this,e), -r.cache=i.set(u,e)||i,e)};return r.cache=new(cu.Cache||Fn),r}function au(n){if(typeof n!="function")throw new ti("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function lu(n,t){return n===t||n!==n&&t!==t}function su(n){return null!=n&&gu(n.length)&&!_u(n)}function hu(n){return yu(n)&&su(n)}function pu(n){if(!yu(n))return false; -var t=Ot(n);return"[object Error]"==t||"[object DOMException]"==t||typeof n.message=="string"&&typeof n.name=="string"&&!xu(n)}function _u(n){return!!du(n)&&(n=Ot(n),"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function vu(n){return typeof n=="number"&&n==ku(n)}function gu(n){return typeof n=="number"&&-1=n}function du(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function yu(n){return null!=n&&typeof n=="object"; -}function bu(n){return typeof n=="number"||yu(n)&&"[object Number]"==Ot(n)}function xu(n){return!(!yu(n)||"[object Object]"!=Ot(n))&&(n=di(n),null===n||(n=oi.call(n,"constructor")&&n.constructor,typeof n=="function"&&n instanceof n&&ii.call(n)==li))}function ju(n){return typeof n=="string"||!ff(n)&&yu(n)&&"[object String]"==Ot(n)}function wu(n){return typeof n=="symbol"||yu(n)&&"[object Symbol]"==Ot(n)}function mu(n){if(!n)return[];if(su(n))return ju(n)?M(n):Lr(n);if(wi&&n[wi]){n=n[wi]();for(var t,r=[];!(t=n.next()).done;)r.push(t.value); -return r}return t=vo(n),("[object Map]"==t?W:"[object Set]"==t?L:Lu)(n)}function Au(n){return n?(n=Su(n),n===$||n===-$?1.7976931348623157e308*(0>n?-1:1):n===n?n:0):0===n?n:0}function ku(n){n=Au(n);var t=n%1;return n===n?t?n-t:n:0}function Eu(n){return n?pt(ku(n),0,4294967295):0}function Su(n){if(typeof n=="number")return n;if(wu(n))return F;if(du(n)&&(n=typeof n.valueOf=="function"?n.valueOf():n,n=du(n)?n+"":n),typeof n!="string")return 0===n?n:+n;n=n.replace(un,"");var t=gn.test(n);return t||yn.test(n)?Dn(n.slice(2),t?2:8):vn.test(n)?F:+n; -}function Ou(n){return Cr(n,Uu(n))}function Iu(n){return null==n?"":yr(n)}function Ru(n,t,r){return n=null==n?T:Et(n,t),n===T?r:n}function zu(n,t){return null!=n&&we(n,t,zt)}function Wu(n){return su(n)?qn(n):Vt(n)}function Uu(n){if(su(n))n=qn(n,true);else if(du(n)){var t,r=ze(n),e=[];for(t in n)("constructor"!=t||!r&&oi.call(n,t))&&e.push(t);n=e}else{if(t=[],null!=n)for(r in Qu(n))t.push(r);n=t}return n}function Bu(n,t){if(null==n)return{};var r=c(ve(n),function(n){return[n]});return t=ye(t),tr(n,r,function(n,r){ -return t(n,r[0])})}function Lu(n){return null==n?[]:S(n,Wu(n))}function Cu(n){return $f(Iu(n).toLowerCase())}function Du(n){return(n=Iu(n))&&n.replace(xn,Xn).replace(Sn,"")}function Mu(n,t,r){return n=Iu(n),t=r?T:t,t===T?zn.test(n)?n.match(In)||[]:n.match(sn)||[]:n.match(t)||[]}function Tu(n){return function(){return n}}function $u(n){return n}function Fu(n){return qt(typeof n=="function"?n:_t(n,1))}function Nu(n,t,e){var u=Wu(t),i=kt(t,u);null!=e||du(t)&&(i.length||!u.length)||(e=t,t=n,n=this,i=kt(t,Wu(t))); -var o=!(du(e)&&"chain"in e&&!e.chain),f=_u(n);return r(i,function(r){var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=n(this.__wrapped__);return(r.__actions__=Lr(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,a([this.value()],arguments))})}),n}function Pu(){}function Zu(n){return Ie(n)?b(Me(n)):rr(n)}function qu(){return[]}function Vu(){return false}mn=null==mn?$n:rt.defaults($n.Object(),mn,rt.pick($n,Wn));var Ku=mn.Array,Gu=mn.Date,Hu=mn.Error,Ju=mn.Function,Yu=mn.Math,Qu=mn.Object,Xu=mn.RegExp,ni=mn.String,ti=mn.TypeError,ri=Ku.prototype,ei=Qu.prototype,ui=mn["__core-js_shared__"],ii=Ju.prototype.toString,oi=ei.hasOwnProperty,fi=0,ci=function(){ -var n=/[^.]+$/.exec(ui&&ui.keys&&ui.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),ai=ei.toString,li=ii.call(Qu),si=$n._,hi=Xu("^"+ii.call(oi).replace(rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pi=Pn?mn.Buffer:T,_i=mn.Symbol,vi=mn.Uint8Array,gi=pi?pi.allocUnsafe:T,di=U(Qu.getPrototypeOf,Qu),yi=Qu.create,bi=ei.propertyIsEnumerable,xi=ri.splice,ji=_i?_i.isConcatSpreadable:T,wi=_i?_i.iterator:T,mi=_i?_i.toStringTag:T,Ai=function(){try{var n=je(Qu,"defineProperty"); -return n({},"",{}),n}catch(n){}}(),ki=mn.clearTimeout!==$n.clearTimeout&&mn.clearTimeout,Ei=Gu&&Gu.now!==$n.Date.now&&Gu.now,Si=mn.setTimeout!==$n.setTimeout&&mn.setTimeout,Oi=Yu.ceil,Ii=Yu.floor,Ri=Qu.getOwnPropertySymbols,zi=pi?pi.isBuffer:T,Wi=mn.isFinite,Ui=ri.join,Bi=U(Qu.keys,Qu),Li=Yu.max,Ci=Yu.min,Di=Gu.now,Mi=mn.parseInt,Ti=Yu.random,$i=ri.reverse,Fi=je(mn,"DataView"),Ni=je(mn,"Map"),Pi=je(mn,"Promise"),Zi=je(mn,"Set"),qi=je(mn,"WeakMap"),Vi=je(Qu,"create"),Ki=qi&&new qi,Gi={},Hi=Te(Fi),Ji=Te(Ni),Yi=Te(Pi),Qi=Te(Zi),Xi=Te(qi),no=_i?_i.prototype:T,to=no?no.valueOf:T,ro=no?no.toString:T,eo=function(){ -function n(){}return function(t){return du(t)?yi?yi(t):(n.prototype=t,t=new n,n.prototype=T,t):{}}}();An.templateSettings={escape:J,evaluate:Y,interpolate:Q,variable:"",imports:{_:An}},An.prototype=kn.prototype,An.prototype.constructor=An,On.prototype=eo(kn.prototype),On.prototype.constructor=On,Ln.prototype=eo(kn.prototype),Ln.prototype.constructor=Ln,Mn.prototype.clear=function(){this.__data__=Vi?Vi(null):{},this.size=0},Mn.prototype.delete=function(n){return n=this.has(n)&&delete this.__data__[n], -this.size-=n?1:0,n},Mn.prototype.get=function(n){var t=this.__data__;return Vi?(n=t[n],"__lodash_hash_undefined__"===n?T:n):oi.call(t,n)?t[n]:T},Mn.prototype.has=function(n){var t=this.__data__;return Vi?t[n]!==T:oi.call(t,n)},Mn.prototype.set=function(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=Vi&&t===T?"__lodash_hash_undefined__":t,this},Tn.prototype.clear=function(){this.__data__=[],this.size=0},Tn.prototype.delete=function(n){var t=this.__data__;return n=ft(t,n),!(0>n)&&(n==t.length-1?t.pop():xi.call(t,n,1), ---this.size,true)},Tn.prototype.get=function(n){var t=this.__data__;return n=ft(t,n),0>n?T:t[n][1]},Tn.prototype.has=function(n){return-1e?(++this.size,r.push([n,t])):r[e][1]=t,this},Fn.prototype.clear=function(){this.size=0,this.__data__={hash:new Mn,map:new(Ni||Tn),string:new Mn}},Fn.prototype.delete=function(n){return n=be(this,n).delete(n),this.size-=n?1:0,n},Fn.prototype.get=function(n){return be(this,n).get(n); -},Fn.prototype.has=function(n){return be(this,n).has(n)},Fn.prototype.set=function(n,t){var r=be(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this},Nn.prototype.add=Nn.prototype.push=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this},Nn.prototype.has=function(n){return this.__data__.has(n)},Zn.prototype.clear=function(){this.__data__=new Tn,this.size=0},Zn.prototype.delete=function(n){var t=this.__data__;return n=t.delete(n),this.size=t.size,n},Zn.prototype.get=function(n){ -return this.__data__.get(n)},Zn.prototype.has=function(n){return this.__data__.has(n)},Zn.prototype.set=function(n,t){var r=this.__data__;if(r instanceof Tn){var e=r.__data__;if(!Ni||199>e.length)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new Fn(e)}return r.set(n,t),this.size=r.size,this};var uo=Fr(mt),io=Fr(At,true),oo=Nr(),fo=Nr(true),co=Ki?function(n,t){return Ki.set(n,t),n}:$u,ao=Ai?function(n,t){return Ai(n,"toString",{configurable:true,enumerable:false,value:Tu(t),writable:true})}:$u,lo=ki||function(n){ -return $n.clearTimeout(n)},so=Zi&&1/L(new Zi([,-0]))[1]==$?function(n){return new Zi(n)}:Pu,ho=Ki?function(n){return Ki.get(n)}:Pu,po=Ri?function(n){return null==n?[]:(n=Qu(n),i(Ri(n),function(t){return bi.call(n,t)}))}:qu,_o=Ri?function(n){for(var t=[];n;)a(t,po(n)),n=di(n);return t}:qu,vo=Ot;(Fi&&"[object DataView]"!=vo(new Fi(new ArrayBuffer(1)))||Ni&&"[object Map]"!=vo(new Ni)||Pi&&"[object Promise]"!=vo(Pi.resolve())||Zi&&"[object Set]"!=vo(new Zi)||qi&&"[object WeakMap]"!=vo(new qi))&&(vo=function(n){ -var t=Ot(n);if(n=(n="[object Object]"==t?n.constructor:T)?Te(n):"")switch(n){case Hi:return"[object DataView]";case Ji:return"[object Map]";case Yi:return"[object Promise]";case Qi:return"[object Set]";case Xi:return"[object WeakMap]"}return t});var go=ui?_u:Vu,yo=Ce(co),bo=Si||function(n,t){return $n.setTimeout(n,t)},xo=Ce(ao),jo=function(n){n=cu(n,function(n){return 500===t.size&&t.clear(),n});var t=n.cache;return n}(function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(tn,function(n,r,e,u){ -t.push(e?u.replace(hn,"$1"):r||n)}),t}),wo=fr(function(n,t){return hu(n)?yt(n,wt(t,1,hu,true)):[]}),mo=fr(function(n,t){var r=Ve(t);return hu(r)&&(r=T),hu(n)?yt(n,wt(t,1,hu,true),ye(r,2)):[]}),Ao=fr(function(n,t){var r=Ve(t);return hu(r)&&(r=T),hu(n)?yt(n,wt(t,1,hu,true),T,r):[]}),ko=fr(function(n){var t=c(n,kr);return t.length&&t[0]===n[0]?Wt(t):[]}),Eo=fr(function(n){var t=Ve(n),r=c(n,kr);return t===Ve(r)?t=T:r.pop(),r.length&&r[0]===n[0]?Wt(r,ye(t,2)):[]}),So=fr(function(n){var t=Ve(n),r=c(n,kr);return(t=typeof t=="function"?t:T)&&r.pop(), -r.length&&r[0]===n[0]?Wt(r,T,t):[]}),Oo=fr(Ke),Io=pe(function(n,t){var r=null==n?0:n.length,e=ht(n,t);return ur(n,c(t,function(n){return Se(n,r)?+n:n}).sort(Wr)),e}),Ro=fr(function(n){return br(wt(n,1,hu,true))}),zo=fr(function(n){var t=Ve(n);return hu(t)&&(t=T),br(wt(n,1,hu,true),ye(t,2))}),Wo=fr(function(n){var t=Ve(n),t=typeof t=="function"?t:T;return br(wt(n,1,hu,true),T,t)}),Uo=fr(function(n,t){return hu(n)?yt(n,t):[]}),Bo=fr(function(n){return mr(i(n,hu))}),Lo=fr(function(n){var t=Ve(n);return hu(t)&&(t=T), -mr(i(n,hu),ye(t,2))}),Co=fr(function(n){var t=Ve(n),t=typeof t=="function"?t:T;return mr(i(n,hu),T,t)}),Do=fr(He),Mo=fr(function(n){var t=n.length,t=1=t}),of=Lt(function(){return arguments}())?Lt:function(n){return yu(n)&&oi.call(n,"callee")&&!bi.call(n,"callee")},ff=Ku.isArray,cf=Vn?E(Vn):Ct,af=zi||Vu,lf=Kn?E(Kn):Dt,sf=Gn?E(Gn):Tt,hf=Hn?E(Hn):Nt,pf=Jn?E(Jn):Pt,_f=Yn?E(Yn):Zt,vf=ee(Kt),gf=ee(function(n,t){return n<=t}),df=$r(function(n,t){ -if(ze(t)||su(t))Cr(t,Wu(t),n);else for(var r in t)oi.call(t,r)&&ot(n,r,t[r])}),yf=$r(function(n,t){Cr(t,Uu(t),n)}),bf=$r(function(n,t,r,e){Cr(t,Uu(t),n,e)}),xf=$r(function(n,t,r,e){Cr(t,Wu(t),n,e)}),jf=pe(ht),wf=fr(function(n,t){n=Qu(n);var r=-1,e=t.length,u=2--n)return t.apply(this,arguments)}},An.ary=eu,An.assign=df,An.assignIn=yf,An.assignInWith=bf,An.assignWith=xf,An.at=jf,An.before=uu,An.bind=Ho,An.bindAll=Nf,An.bindKey=Jo,An.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return ff(n)?n:[n]},An.chain=Ye,An.chunk=function(n,t,r){if(t=(r?Oe(n,t,r):t===T)?1:Li(ku(t),0),r=null==n?0:n.length,!r||1>t)return[];for(var e=0,u=0,i=Ku(Oi(r/t));et?0:t,e)):[]},An.dropRight=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===T?1:ku(t),t=e-t,hr(n,0,0>t?0:t)):[]},An.dropRightWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),true,true):[]; -},An.dropWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),true):[]},An.fill=function(n,t,r,e){var u=null==n?0:n.length;if(!u)return[];for(r&&typeof r!="number"&&Oe(n,t,r)&&(r=0,e=u),u=n.length,r=ku(r),0>r&&(r=-r>u?0:u+r),e=e===T||e>u?u:ku(e),0>e&&(e+=u),e=r>e?0:Eu(e);r>>0,r?(n=Iu(n))&&(typeof t=="string"||null!=t&&!hf(t))&&(t=yr(t),!t&&Rn.test(n))?Or(M(n),0,r):n.split(t,r):[]},An.spread=function(t,r){if(typeof t!="function")throw new ti("Expected a function");return r=null==r?0:Li(ku(r),0), -fr(function(e){var u=e[r];return e=Or(e,0,r),u&&a(e,u),n(t,this,e)})},An.tail=function(n){var t=null==n?0:n.length;return t?hr(n,1,t):[]},An.take=function(n,t,r){return n&&n.length?(t=r||t===T?1:ku(t),hr(n,0,0>t?0:t)):[]},An.takeRight=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===T?1:ku(t),t=e-t,hr(n,0>t?0:t,e)):[]},An.takeRightWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),false,true):[]},An.takeWhile=function(n,t){return n&&n.length?jr(n,ye(t,3)):[]},An.tap=function(n,t){return t(n), -n},An.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new ti("Expected a function");return du(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),fu(n,t,{leading:e,maxWait:t,trailing:u})},An.thru=Qe,An.toArray=mu,An.toPairs=zf,An.toPairsIn=Wf,An.toPath=function(n){return ff(n)?c(n,Me):wu(n)?[n]:Lr(jo(Iu(n)))},An.toPlainObject=Ou,An.transform=function(n,t,e){var u=ff(n),i=u||af(n)||_f(n);if(t=ye(t,4),null==e){var o=n&&n.constructor;e=i?u?new o:[]:du(n)&&_u(o)?eo(di(n)):{}; -}return(i?r:mt)(n,function(n,r,u){return t(e,n,r,u)}),e},An.unary=function(n){return eu(n,1)},An.union=Ro,An.unionBy=zo,An.unionWith=Wo,An.uniq=function(n){return n&&n.length?br(n):[]},An.uniqBy=function(n,t){return n&&n.length?br(n,ye(t,2)):[]},An.uniqWith=function(n,t){return t=typeof t=="function"?t:T,n&&n.length?br(n,T,t):[]},An.unset=function(n,t){return null==n||xr(n,t)},An.unzip=He,An.unzipWith=Je,An.update=function(n,t,r){return null!=n&&(r=Er(r),n=lr(n,t,r(Et(n,t)),void 0)),n},An.updateWith=function(n,t,r,e){ -return e=typeof e=="function"?e:T,null!=n&&(r=Er(r),n=lr(n,t,r(Et(n,t)),e)),n},An.values=Lu,An.valuesIn=function(n){return null==n?[]:S(n,Uu(n))},An.without=Uo,An.words=Mu,An.wrap=function(n,t){return nf(Er(t),n)},An.xor=Bo,An.xorBy=Lo,An.xorWith=Co,An.zip=Do,An.zipObject=function(n,t){return Ar(n||[],t||[],ot)},An.zipObjectDeep=function(n,t){return Ar(n||[],t||[],lr)},An.zipWith=Mo,An.entries=zf,An.entriesIn=Wf,An.extend=yf,An.extendWith=bf,Nu(An,An),An.add=Qf,An.attempt=Ff,An.camelCase=Uf,An.capitalize=Cu, -An.ceil=Xf,An.clamp=function(n,t,r){return r===T&&(r=t,t=T),r!==T&&(r=Su(r),r=r===r?r:0),t!==T&&(t=Su(t),t=t===t?t:0),pt(Su(n),t,r)},An.clone=function(n){return _t(n,4)},An.cloneDeep=function(n){return _t(n,5)},An.cloneDeepWith=function(n,t){return t=typeof t=="function"?t:T,_t(n,5,t)},An.cloneWith=function(n,t){return t=typeof t=="function"?t:T,_t(n,4,t)},An.conformsTo=function(n,t){return null==t||gt(n,t,Wu(t))},An.deburr=Du,An.defaultTo=function(n,t){return null==n||n!==n?t:n},An.divide=nc,An.endsWith=function(n,t,r){ -n=Iu(n),t=yr(t);var e=n.length,e=r=r===T?e:pt(ku(r),0,e);return r-=t.length,0<=r&&n.slice(r,e)==t},An.eq=lu,An.escape=function(n){return(n=Iu(n))&&H.test(n)?n.replace(K,nt):n},An.escapeRegExp=function(n){return(n=Iu(n))&&en.test(n)?n.replace(rn,"\\$&"):n},An.every=function(n,t,r){var e=ff(n)?u:bt;return r&&Oe(n,t,r)&&(t=T),e(n,ye(t,3))},An.find=Fo,An.findIndex=Ne,An.findKey=function(n,t){return p(n,ye(t,3),mt)},An.findLast=No,An.findLastIndex=Pe,An.findLastKey=function(n,t){return p(n,ye(t,3),At); -},An.floor=tc,An.forEach=nu,An.forEachRight=tu,An.forIn=function(n,t){return null==n?n:oo(n,ye(t,3),Uu)},An.forInRight=function(n,t){return null==n?n:fo(n,ye(t,3),Uu)},An.forOwn=function(n,t){return n&&mt(n,ye(t,3))},An.forOwnRight=function(n,t){return n&&At(n,ye(t,3))},An.get=Ru,An.gt=ef,An.gte=uf,An.has=function(n,t){return null!=n&&we(n,t,Rt)},An.hasIn=zu,An.head=qe,An.identity=$u,An.includes=function(n,t,r,e){return n=su(n)?n:Lu(n),r=r&&!e?ku(r):0,e=n.length,0>r&&(r=Li(e+r,0)),ju(n)?r<=e&&-1r&&(r=Li(e+r,0)),v(n,t,r)):-1},An.inRange=function(n,t,r){return t=Au(t),r===T?(r=t,t=0):r=Au(r),n=Su(n),n>=Ci(t,r)&&n=n},An.isSet=pf,An.isString=ju,An.isSymbol=wu,An.isTypedArray=_f,An.isUndefined=function(n){return n===T},An.isWeakMap=function(n){return yu(n)&&"[object WeakMap]"==vo(n)},An.isWeakSet=function(n){return yu(n)&&"[object WeakSet]"==Ot(n)},An.join=function(n,t){return null==n?"":Ui.call(n,t)},An.kebabCase=Bf,An.last=Ve,An.lastIndexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e;if(r!==T&&(u=ku(r),u=0>u?Li(e+u,0):Ci(u,e-1)), -t===t)n:{for(r=u+1;r--;)if(n[r]===t){n=r;break n}n=r}else n=_(n,d,u,true);return n},An.lowerCase=Lf,An.lowerFirst=Cf,An.lt=vf,An.lte=gf,An.max=function(n){return n&&n.length?xt(n,$u,It):T},An.maxBy=function(n,t){return n&&n.length?xt(n,ye(t,2),It):T},An.mean=function(n){return y(n,$u)},An.meanBy=function(n,t){return y(n,ye(t,2))},An.min=function(n){return n&&n.length?xt(n,$u,Kt):T},An.minBy=function(n,t){return n&&n.length?xt(n,ye(t,2),Kt):T},An.stubArray=qu,An.stubFalse=Vu,An.stubObject=function(){ -return{}},An.stubString=function(){return""},An.stubTrue=function(){return true},An.multiply=rc,An.nth=function(n,t){return n&&n.length?Qt(n,ku(t)):T},An.noConflict=function(){return $n._===this&&($n._=si),this},An.noop=Pu,An.now=Go,An.pad=function(n,t,r){n=Iu(n);var e=(t=ku(t))?D(n):0;return!t||e>=t?n:(t=(t-e)/2,ne(Ii(t),r)+n+ne(Oi(t),r))},An.padEnd=function(n,t,r){n=Iu(n);var e=(t=ku(t))?D(n):0;return t&&et){var e=n;n=t,t=e}return r||n%1||t%1?(r=Ti(),Ci(n+r*(t-n+Cn("1e-"+((r+"").length-1))),t)):ir(n,t)},An.reduce=function(n,t,r){var e=ff(n)?l:j,u=3>arguments.length;return e(n,ye(t,4),r,u,uo)},An.reduceRight=function(n,t,r){ -var e=ff(n)?s:j,u=3>arguments.length;return e(n,ye(t,4),r,u,io)},An.repeat=function(n,t,r){return t=(r?Oe(n,t,r):t===T)?1:ku(t),or(Iu(n),t)},An.replace=function(){var n=arguments,t=Iu(n[0]);return 3>n.length?t:t.replace(n[1],n[2])},An.result=function(n,t,r){t=Sr(t,n);var e=-1,u=t.length;for(u||(u=1,n=T);++en||9007199254740991=i)return n;if(i=r-D(e),1>i)return e;if(r=o?Or(o,0,i).join(""):n.slice(0,i),u===T)return r+e;if(o&&(i+=r.length-i),hf(u)){if(n.slice(i).search(u)){var f=r;for(u.global||(u=Xu(u.source,Iu(_n.exec(u))+"g")), -u.lastIndex=0;o=u.exec(f);)var c=o.index;r=r.slice(0,c===T?i:c)}}else n.indexOf(yr(u),i)!=i&&(u=r.lastIndexOf(u),-1e.__dir__?"Right":"")}),e},Ln.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),r(["filter","map","takeWhile"],function(n,t){var r=t+1,e=1==r||3==r;Ln.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({ -iteratee:ye(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),r(["head","last"],function(n,t){var r="take"+(t?"Right":"");Ln.prototype[n]=function(){return this[r](1).value()[0]}}),r(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Ln.prototype[n]=function(){return this.__filtered__?new Ln(this):this[r](1)}}),Ln.prototype.compact=function(){return this.filter($u)},Ln.prototype.find=function(n){return this.filter(n).head()},Ln.prototype.findLast=function(n){return this.reverse().find(n); -},Ln.prototype.invokeMap=fr(function(n,t){return typeof n=="function"?new Ln(this):this.map(function(r){return Bt(r,n,t)})}),Ln.prototype.reject=function(n){return this.filter(au(ye(n)))},Ln.prototype.slice=function(n,t){n=ku(n);var r=this;return r.__filtered__&&(0t)?new Ln(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==T&&(t=ku(t),r=0>t?r.dropRight(-t):r.take(t-n)),r)},Ln.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Ln.prototype.toArray=function(){return this.take(4294967295); -},mt(Ln.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=An[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t);u&&(An.prototype[t]=function(){var t=this.__wrapped__,o=e?[1]:arguments,f=t instanceof Ln,c=o[0],l=f||ff(t),s=function(n){return n=u.apply(An,a([n],o)),e&&h?n[0]:n};l&&r&&typeof c=="function"&&1!=c.length&&(f=l=false);var h=this.__chain__,p=!!this.__actions__.length,c=i&&!h,f=f&&!p;return!i&&l?(t=f?t:new Ln(this),t=n.apply(t,o),t.__actions__.push({ -func:Qe,args:[s],thisArg:T}),new On(t,h)):c&&f?n.apply(this,o):(t=this.thru(s),c?e?t.value()[0]:t.value():t)})}),r("pop push shift sort splice unshift".split(" "),function(n){var t=ri[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);An.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(ff(u)?u:[],n)}return this[r](function(r){return t.apply(ff(r)?r:[],n)})}}),mt(Ln.prototype,function(n,t){var r=An[t];if(r){var e=r.name+""; -(Gi[e]||(Gi[e]=[])).push({name:t,func:r})}}),Gi[Jr(T,2).name]=[{name:"wrapper",func:T}],Ln.prototype.clone=function(){var n=new Ln(this.__wrapped__);return n.__actions__=Lr(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Lr(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Lr(this.__views__),n},Ln.prototype.reverse=function(){if(this.__filtered__){var n=new Ln(this);n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n; -},Ln.prototype.value=function(){var n,t=this.__wrapped__.value(),r=this.__dir__,e=ff(t),u=0>r,i=e?t.length:0;n=0;for(var o=i,f=this.__views__,c=-1,a=f.length;++c=this.__values__.length;return{done:n,value:n?T:this.__values__[this.__index__++]}},An.prototype.plant=function(n){for(var t,r=this;r instanceof kn;){ -var e=Fe(r);e.__index__=0,e.__values__=T,t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},An.prototype.reverse=function(){var n=this.__wrapped__;return n instanceof Ln?(this.__actions__.length&&(n=new Ln(this)),n=n.reverse(),n.__actions__.push({func:Qe,args:[Ge],thisArg:T}),new On(n,this.__chain__)):this.thru(Ge)},An.prototype.toJSON=An.prototype.valueOf=An.prototype.value=function(){return wr(this.__wrapped__,this.__actions__)},An.prototype.first=An.prototype.head,wi&&(An.prototype[wi]=Xe), -An}(); true?($n._=rt, !(__WEBPACK_AMD_DEFINE_RESULT__ = (function(){return rt}).call(exports, __webpack_require__, exports, module), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))):undefined}).call(this); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "../node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../webpack/buildin/module.js */ "../node_modules/webpack/buildin/module.js")(module))) - -/***/ }), - -/***/ "../node_modules/mithril/mithril.js": -/*!******************************************!*\ - !*** ../node_modules/mithril/mithril.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(setImmediate, global) {;(function() { -"use strict" -function Vnode(tag, key, attrs0, children, text, dom) { - return {tag: tag, key: key, attrs: attrs0, children: children, text: text, dom: dom, domSize: undefined, state: undefined, _state: undefined, events: undefined, instance: undefined, skip: false} -} -Vnode.normalize = function(node) { - if (Array.isArray(node)) return Vnode("[", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined) - if (node != null && typeof node !== "object") return Vnode("#", undefined, undefined, node === false ? "" : node, undefined, undefined) - return node -} -Vnode.normalizeChildren = function normalizeChildren(children) { - for (var i = 0; i < children.length; i++) { - children[i] = Vnode.normalize(children[i]) - } - return children -} -var selectorParser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g -var selectorCache = {} -var hasOwn = {}.hasOwnProperty -function isEmpty(object) { - for (var key in object) if (hasOwn.call(object, key)) return false - return true -} -function compileSelector(selector) { - var match, tag = "div", classes = [], attrs = {} - while (match = selectorParser.exec(selector)) { - var type = match[1], value = match[2] - if (type === "" && value !== "") tag = value - else if (type === "#") attrs.id = value - else if (type === ".") classes.push(value) - else if (match[3][0] === "[") { - var attrValue = match[6] - if (attrValue) attrValue = attrValue.replace(/\\(["'])/g, "$1").replace(/\\\\/g, "\\") - if (match[4] === "class") classes.push(attrValue) - else attrs[match[4]] = attrValue === "" ? attrValue : attrValue || true - } - } - if (classes.length > 0) attrs.className = classes.join(" ") - return selectorCache[selector] = {tag: tag, attrs: attrs} -} -function execSelector(state, attrs, children) { - var hasAttrs = false, childList, text - var className = attrs.className || attrs.class - if (!isEmpty(state.attrs) && !isEmpty(attrs)) { - var newAttrs = {} - for(var key in attrs) { - if (hasOwn.call(attrs, key)) { - newAttrs[key] = attrs[key] - } - } - attrs = newAttrs - } - for (var key in state.attrs) { - if (hasOwn.call(state.attrs, key)) { - attrs[key] = state.attrs[key] - } - } - if (className !== undefined) { - if (attrs.class !== undefined) { - attrs.class = undefined - attrs.className = className - } - if (state.attrs.className != null) { - attrs.className = state.attrs.className + " " + className - } - } - for (var key in attrs) { - if (hasOwn.call(attrs, key) && key !== "key") { - hasAttrs = true - break - } - } - if (Array.isArray(children) && children.length === 1 && children[0] != null && children[0].tag === "#") { - text = children[0].children - } else { - childList = children - } - return Vnode(state.tag, attrs.key, hasAttrs ? attrs : undefined, childList, text) -} -function hyperscript(selector) { - // Because sloppy mode sucks - var attrs = arguments[1], start = 2, children - if (selector == null || typeof selector !== "string" && typeof selector !== "function" && typeof selector.view !== "function") { - throw Error("The selector must be either a string or a component."); - } - if (typeof selector === "string") { - var cached = selectorCache[selector] || compileSelector(selector) - } - if (attrs == null) { - attrs = {} - } else if (typeof attrs !== "object" || attrs.tag != null || Array.isArray(attrs)) { - attrs = {} - start = 1 - } - if (arguments.length === start + 1) { - children = arguments[start] - if (!Array.isArray(children)) children = [children] - } else { - children = [] - while (start < arguments.length) children.push(arguments[start++]) - } - var normalized = Vnode.normalizeChildren(children) - if (typeof selector === "string") { - return execSelector(cached, attrs, normalized) - } else { - return Vnode(selector, attrs.key, attrs, normalized) - } -} -hyperscript.trust = function(html) { - if (html == null) html = "" - return Vnode("<", undefined, undefined, html, undefined, undefined) -} -hyperscript.fragment = function(attrs1, children) { - return Vnode("[", attrs1.key, attrs1, Vnode.normalizeChildren(children), undefined, undefined) -} -var m = hyperscript -/** @constructor */ -var PromisePolyfill = function(executor) { - if (!(this instanceof PromisePolyfill)) throw new Error("Promise must be called with `new`") - if (typeof executor !== "function") throw new TypeError("executor must be a function") - var self = this, resolvers = [], rejectors = [], resolveCurrent = handler(resolvers, true), rejectCurrent = handler(rejectors, false) - var instance = self._instance = {resolvers: resolvers, rejectors: rejectors} - var callAsync = typeof setImmediate === "function" ? setImmediate : setTimeout - function handler(list, shouldAbsorb) { - return function execute(value) { - var then - try { - if (shouldAbsorb && value != null && (typeof value === "object" || typeof value === "function") && typeof (then = value.then) === "function") { - if (value === self) throw new TypeError("Promise can't be resolved w/ itself") - executeOnce(then.bind(value)) - } - else { - callAsync(function() { - if (!shouldAbsorb && list.length === 0) console.error("Possible unhandled promise rejection:", value) - for (var i = 0; i < list.length; i++) list[i](value) - resolvers.length = 0, rejectors.length = 0 - instance.state = shouldAbsorb - instance.retry = function() {execute(value)} - }) - } - } - catch (e) { - rejectCurrent(e) - } - } - } - function executeOnce(then) { - var runs = 0 - function run(fn) { - return function(value) { - if (runs++ > 0) return - fn(value) - } - } - var onerror = run(rejectCurrent) - try {then(run(resolveCurrent), onerror)} catch (e) {onerror(e)} - } - executeOnce(executor) -} -PromisePolyfill.prototype.then = function(onFulfilled, onRejection) { - var self = this, instance = self._instance - function handle(callback, list, next, state) { - list.push(function(value) { - if (typeof callback !== "function") next(value) - else try {resolveNext(callback(value))} catch (e) {if (rejectNext) rejectNext(e)} - }) - if (typeof instance.retry === "function" && state === instance.state) instance.retry() - } - var resolveNext, rejectNext - var promise = new PromisePolyfill(function(resolve, reject) {resolveNext = resolve, rejectNext = reject}) - handle(onFulfilled, instance.resolvers, resolveNext, true), handle(onRejection, instance.rejectors, rejectNext, false) - return promise -} -PromisePolyfill.prototype.catch = function(onRejection) { - return this.then(null, onRejection) -} -PromisePolyfill.resolve = function(value) { - if (value instanceof PromisePolyfill) return value - return new PromisePolyfill(function(resolve) {resolve(value)}) -} -PromisePolyfill.reject = function(value) { - return new PromisePolyfill(function(resolve, reject) {reject(value)}) -} -PromisePolyfill.all = function(list) { - return new PromisePolyfill(function(resolve, reject) { - var total = list.length, count = 0, values = [] - if (list.length === 0) resolve([]) - else for (var i = 0; i < list.length; i++) { - (function(i) { - function consume(value) { - count++ - values[i] = value - if (count === total) resolve(values) - } - if (list[i] != null && (typeof list[i] === "object" || typeof list[i] === "function") && typeof list[i].then === "function") { - list[i].then(consume, reject) - } - else consume(list[i]) - })(i) - } - }) -} -PromisePolyfill.race = function(list) { - return new PromisePolyfill(function(resolve, reject) { - for (var i = 0; i < list.length; i++) { - list[i].then(resolve, reject) - } - }) -} -if (typeof window !== "undefined") { - if (typeof window.Promise === "undefined") window.Promise = PromisePolyfill - var PromisePolyfill = window.Promise -} else if (typeof global !== "undefined") { - if (typeof global.Promise === "undefined") global.Promise = PromisePolyfill - var PromisePolyfill = global.Promise -} else { -} -var buildQueryString = function(object) { - if (Object.prototype.toString.call(object) !== "[object Object]") return "" - var args = [] - for (var key0 in object) { - destructure(key0, object[key0]) - } - return args.join("&") - function destructure(key0, value) { - if (Array.isArray(value)) { - for (var i = 0; i < value.length; i++) { - destructure(key0 + "[" + i + "]", value[i]) - } - } - else if (Object.prototype.toString.call(value) === "[object Object]") { - for (var i in value) { - destructure(key0 + "[" + i + "]", value[i]) - } - } - else args.push(encodeURIComponent(key0) + (value != null && value !== "" ? "=" + encodeURIComponent(value) : "")) - } -} -var FILE_PROTOCOL_REGEX = new RegExp("^file://", "i") -var _8 = function($window, Promise) { - var callbackCount = 0 - var oncompletion - function setCompletionCallback(callback) {oncompletion = callback} - function finalizer() { - var count = 0 - function complete() {if (--count === 0 && typeof oncompletion === "function") oncompletion()} - return function finalize(promise0) { - var then0 = promise0.then - promise0.then = function() { - count++ - var next = then0.apply(promise0, arguments) - next.then(complete, function(e) { - complete() - if (count === 0) throw e - }) - return finalize(next) - } - return promise0 - } - } - function normalize(args, extra) { - if (typeof args === "string") { - var url = args - args = extra || {} - if (args.url == null) args.url = url - } - return args - } - function request(args, extra) { - var finalize = finalizer() - args = normalize(args, extra) - var promise0 = new Promise(function(resolve, reject) { - if (args.method == null) args.method = "GET" - args.method = args.method.toUpperCase() - var useBody = (args.method === "GET" || args.method === "TRACE") ? false : (typeof args.useBody === "boolean" ? args.useBody : true) - if (typeof args.serialize !== "function") args.serialize = typeof FormData !== "undefined" && args.data instanceof FormData ? function(value) {return value} : JSON.stringify - if (typeof args.deserialize !== "function") args.deserialize = deserialize - if (typeof args.extract !== "function") args.extract = extract - args.url = interpolate(args.url, args.data) - if (useBody) args.data = args.serialize(args.data) - else args.url = assemble(args.url, args.data) - var xhr = new $window.XMLHttpRequest(), - aborted = false, - _abort = xhr.abort - xhr.abort = function abort() { - aborted = true - _abort.call(xhr) - } - xhr.open(args.method, args.url, typeof args.async === "boolean" ? args.async : true, typeof args.user === "string" ? args.user : undefined, typeof args.password === "string" ? args.password : undefined) - if (args.serialize === JSON.stringify && useBody && !(args.headers && args.headers.hasOwnProperty("Content-Type"))) { - xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8") - } - if (args.deserialize === deserialize && !(args.headers && args.headers.hasOwnProperty("Accept"))) { - xhr.setRequestHeader("Accept", "application/json, text/*") - } - if (args.withCredentials) xhr.withCredentials = args.withCredentials - for (var key in args.headers) if ({}.hasOwnProperty.call(args.headers, key)) { - xhr.setRequestHeader(key, args.headers[key]) - } - if (typeof args.config === "function") xhr = args.config(xhr, args) || xhr - xhr.onreadystatechange = function() { - // Don't throw errors on xhr.abort(). - if(aborted) return - if (xhr.readyState === 4) { - try { - var response = (args.extract !== extract) ? args.extract(xhr, args) : args.deserialize(args.extract(xhr, args)) - if ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304 || FILE_PROTOCOL_REGEX.test(args.url)) { - resolve(cast(args.type, response)) - } - else { - var error = new Error(xhr.responseText) - for (var key in response) error[key] = response[key] - reject(error) - } - } - catch (e) { - reject(e) - } - } - } - if (useBody && (args.data != null)) xhr.send(args.data) - else xhr.send() - }) - return args.background === true ? promise0 : finalize(promise0) - } - function jsonp(args, extra) { - var finalize = finalizer() - args = normalize(args, extra) - var promise0 = new Promise(function(resolve, reject) { - var callbackName = args.callbackName || "_mithril_" + Math.round(Math.random() * 1e16) + "_" + callbackCount++ - var script = $window.document.createElement("script") - $window[callbackName] = function(data) { - script.parentNode.removeChild(script) - resolve(cast(args.type, data)) - delete $window[callbackName] - } - script.onerror = function() { - script.parentNode.removeChild(script) - reject(new Error("JSONP request failed")) - delete $window[callbackName] - } - if (args.data == null) args.data = {} - args.url = interpolate(args.url, args.data) - args.data[args.callbackKey || "callback"] = callbackName - script.src = assemble(args.url, args.data) - $window.document.documentElement.appendChild(script) - }) - return args.background === true? promise0 : finalize(promise0) - } - function interpolate(url, data) { - if (data == null) return url - var tokens = url.match(/:[^\/]+/gi) || [] - for (var i = 0; i < tokens.length; i++) { - var key = tokens[i].slice(1) - if (data[key] != null) { - url = url.replace(tokens[i], data[key]) - } - } - return url - } - function assemble(url, data) { - var querystring = buildQueryString(data) - if (querystring !== "") { - var prefix = url.indexOf("?") < 0 ? "?" : "&" - url += prefix + querystring - } - return url - } - function deserialize(data) { - try {return data !== "" ? JSON.parse(data) : null} - catch (e) {throw new Error(data)} - } - function extract(xhr) {return xhr.responseText} - function cast(type0, data) { - if (typeof type0 === "function") { - if (Array.isArray(data)) { - for (var i = 0; i < data.length; i++) { - data[i] = new type0(data[i]) - } - } - else return new type0(data) - } - return data - } - return {request: request, jsonp: jsonp, setCompletionCallback: setCompletionCallback} -} -var requestService = _8(window, PromisePolyfill) -var coreRenderer = function($window) { - var $doc = $window.document - var $emptyFragment = $doc.createDocumentFragment() - var nameSpace = { - svg: "http://www.w3.org/2000/svg", - math: "http://www.w3.org/1998/Math/MathML" - } - var onevent - function setEventCallback(callback) {return onevent = callback} - function getNameSpace(vnode) { - return vnode.attrs && vnode.attrs.xmlns || nameSpace[vnode.tag] - } - //create - function createNodes(parent, vnodes, start, end, hooks, nextSibling, ns) { - for (var i = start; i < end; i++) { - var vnode = vnodes[i] - if (vnode != null) { - createNode(parent, vnode, hooks, ns, nextSibling) - } - } - } - function createNode(parent, vnode, hooks, ns, nextSibling) { - var tag = vnode.tag - if (typeof tag === "string") { - vnode.state = {} - if (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks) - switch (tag) { - case "#": return createText(parent, vnode, nextSibling) - case "<": return createHTML(parent, vnode, nextSibling) - case "[": return createFragment(parent, vnode, hooks, ns, nextSibling) - default: return createElement(parent, vnode, hooks, ns, nextSibling) - } - } - else return createComponent(parent, vnode, hooks, ns, nextSibling) - } - function createText(parent, vnode, nextSibling) { - vnode.dom = $doc.createTextNode(vnode.children) - insertNode(parent, vnode.dom, nextSibling) - return vnode.dom - } - function createHTML(parent, vnode, nextSibling) { - var match1 = vnode.children.match(/^\s*?<(\w+)/im) || [] - var parent1 = {caption: "table", thead: "table", tbody: "table", tfoot: "table", tr: "tbody", th: "tr", td: "tr", colgroup: "table", col: "colgroup"}[match1[1]] || "div" - var temp = $doc.createElement(parent1) - temp.innerHTML = vnode.children - vnode.dom = temp.firstChild - vnode.domSize = temp.childNodes.length - var fragment = $doc.createDocumentFragment() - var child - while (child = temp.firstChild) { - fragment.appendChild(child) - } - insertNode(parent, fragment, nextSibling) - return fragment - } - function createFragment(parent, vnode, hooks, ns, nextSibling) { - var fragment = $doc.createDocumentFragment() - if (vnode.children != null) { - var children = vnode.children - createNodes(fragment, children, 0, children.length, hooks, null, ns) - } - vnode.dom = fragment.firstChild - vnode.domSize = fragment.childNodes.length - insertNode(parent, fragment, nextSibling) - return fragment - } - function createElement(parent, vnode, hooks, ns, nextSibling) { - var tag = vnode.tag - var attrs2 = vnode.attrs - var is = attrs2 && attrs2.is - ns = getNameSpace(vnode) || ns - var element = ns ? - is ? $doc.createElementNS(ns, tag, {is: is}) : $doc.createElementNS(ns, tag) : - is ? $doc.createElement(tag, {is: is}) : $doc.createElement(tag) - vnode.dom = element - if (attrs2 != null) { - setAttrs(vnode, attrs2, ns) - } - insertNode(parent, element, nextSibling) - if (vnode.attrs != null && vnode.attrs.contenteditable != null) { - setContentEditable(vnode) - } - else { - if (vnode.text != null) { - if (vnode.text !== "") element.textContent = vnode.text - else vnode.children = [Vnode("#", undefined, undefined, vnode.text, undefined, undefined)] - } - if (vnode.children != null) { - var children = vnode.children - createNodes(element, children, 0, children.length, hooks, null, ns) - setLateAttrs(vnode) - } - } - return element - } - function initComponent(vnode, hooks) { - var sentinel - if (typeof vnode.tag.view === "function") { - vnode.state = Object.create(vnode.tag) - sentinel = vnode.state.view - if (sentinel.$$reentrantLock$$ != null) return $emptyFragment - sentinel.$$reentrantLock$$ = true - } else { - vnode.state = void 0 - sentinel = vnode.tag - if (sentinel.$$reentrantLock$$ != null) return $emptyFragment - sentinel.$$reentrantLock$$ = true - vnode.state = (vnode.tag.prototype != null && typeof vnode.tag.prototype.view === "function") ? new vnode.tag(vnode) : vnode.tag(vnode) - } - vnode._state = vnode.state - if (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks) - initLifecycle(vnode._state, vnode, hooks) - vnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode)) - if (vnode.instance === vnode) throw Error("A view cannot return the vnode it received as argument") - sentinel.$$reentrantLock$$ = null - } - function createComponent(parent, vnode, hooks, ns, nextSibling) { - initComponent(vnode, hooks) - if (vnode.instance != null) { - var element = createNode(parent, vnode.instance, hooks, ns, nextSibling) - vnode.dom = vnode.instance.dom - vnode.domSize = vnode.dom != null ? vnode.instance.domSize : 0 - insertNode(parent, element, nextSibling) - return element - } - else { - vnode.domSize = 0 - return $emptyFragment - } - } - //update - function updateNodes(parent, old, vnodes, recycling, hooks, nextSibling, ns) { - if (old === vnodes || old == null && vnodes == null) return - else if (old == null) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, ns) - else if (vnodes == null) removeNodes(old, 0, old.length, vnodes) - else { - if (old.length === vnodes.length) { - var isUnkeyed = false - for (var i = 0; i < vnodes.length; i++) { - if (vnodes[i] != null && old[i] != null) { - isUnkeyed = vnodes[i].key == null && old[i].key == null - break - } - } - if (isUnkeyed) { - for (var i = 0; i < old.length; i++) { - if (old[i] === vnodes[i]) continue - else if (old[i] == null && vnodes[i] != null) createNode(parent, vnodes[i], hooks, ns, getNextSibling(old, i + 1, nextSibling)) - else if (vnodes[i] == null) removeNodes(old, i, i + 1, vnodes) - else updateNode(parent, old[i], vnodes[i], hooks, getNextSibling(old, i + 1, nextSibling), recycling, ns) - } - return - } - } - recycling = recycling || isRecyclable(old, vnodes) - if (recycling) { - var pool = old.pool - old = old.concat(old.pool) - } - var oldStart = 0, start = 0, oldEnd = old.length - 1, end = vnodes.length - 1, map - while (oldEnd >= oldStart && end >= start) { - var o = old[oldStart], v = vnodes[start] - if (o === v && !recycling) oldStart++, start++ - else if (o == null) oldStart++ - else if (v == null) start++ - else if (o.key === v.key) { - var shouldRecycle = (pool != null && oldStart >= old.length - pool.length) || ((pool == null) && recycling) - oldStart++, start++ - updateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), shouldRecycle, ns) - if (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling) - } - else { - var o = old[oldEnd] - if (o === v && !recycling) oldEnd--, start++ - else if (o == null) oldEnd-- - else if (v == null) start++ - else if (o.key === v.key) { - var shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling) - updateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns) - if (recycling || start < end) insertNode(parent, toFragment(o), getNextSibling(old, oldStart, nextSibling)) - oldEnd--, start++ - } - else break - } - } - while (oldEnd >= oldStart && end >= start) { - var o = old[oldEnd], v = vnodes[end] - if (o === v && !recycling) oldEnd--, end-- - else if (o == null) oldEnd-- - else if (v == null) end-- - else if (o.key === v.key) { - var shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling) - updateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns) - if (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling) - if (o.dom != null) nextSibling = o.dom - oldEnd--, end-- - } - else { - if (!map) map = getKeyMap(old, oldEnd) - if (v != null) { - var oldIndex = map[v.key] - if (oldIndex != null) { - var movable = old[oldIndex] - var shouldRecycle = (pool != null && oldIndex >= old.length - pool.length) || ((pool == null) && recycling) - updateNode(parent, movable, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), recycling, ns) - insertNode(parent, toFragment(movable), nextSibling) - old[oldIndex].skip = true - if (movable.dom != null) nextSibling = movable.dom - } - else { - var dom = createNode(parent, v, hooks, ns, nextSibling) - nextSibling = dom - } - } - end-- - } - if (end < start) break - } - createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns) - removeNodes(old, oldStart, oldEnd + 1, vnodes) - } - } - function updateNode(parent, old, vnode, hooks, nextSibling, recycling, ns) { - var oldTag = old.tag, tag = vnode.tag - if (oldTag === tag) { - vnode.state = old.state - vnode._state = old._state - vnode.events = old.events - if (!recycling && shouldNotUpdate(vnode, old)) return - if (typeof oldTag === "string") { - if (vnode.attrs != null) { - if (recycling) { - vnode.state = {} - initLifecycle(vnode.attrs, vnode, hooks) - } - else updateLifecycle(vnode.attrs, vnode, hooks) - } - switch (oldTag) { - case "#": updateText(old, vnode); break - case "<": updateHTML(parent, old, vnode, nextSibling); break - case "[": updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns); break - default: updateElement(old, vnode, recycling, hooks, ns) - } - } - else updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns) - } - else { - removeNode(old, null) - createNode(parent, vnode, hooks, ns, nextSibling) - } - } - function updateText(old, vnode) { - if (old.children.toString() !== vnode.children.toString()) { - old.dom.nodeValue = vnode.children - } - vnode.dom = old.dom - } - function updateHTML(parent, old, vnode, nextSibling) { - if (old.children !== vnode.children) { - toFragment(old) - createHTML(parent, vnode, nextSibling) - } - else vnode.dom = old.dom, vnode.domSize = old.domSize - } - function updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns) { - updateNodes(parent, old.children, vnode.children, recycling, hooks, nextSibling, ns) - var domSize = 0, children = vnode.children - vnode.dom = null - if (children != null) { - for (var i = 0; i < children.length; i++) { - var child = children[i] - if (child != null && child.dom != null) { - if (vnode.dom == null) vnode.dom = child.dom - domSize += child.domSize || 1 - } - } - if (domSize !== 1) vnode.domSize = domSize - } - } - function updateElement(old, vnode, recycling, hooks, ns) { - var element = vnode.dom = old.dom - ns = getNameSpace(vnode) || ns - if (vnode.tag === "textarea") { - if (vnode.attrs == null) vnode.attrs = {} - if (vnode.text != null) { - vnode.attrs.value = vnode.text //FIXME handle0 multiple children - vnode.text = undefined - } - } - updateAttrs(vnode, old.attrs, vnode.attrs, ns) - if (vnode.attrs != null && vnode.attrs.contenteditable != null) { - setContentEditable(vnode) - } - else if (old.text != null && vnode.text != null && vnode.text !== "") { - if (old.text.toString() !== vnode.text.toString()) old.dom.firstChild.nodeValue = vnode.text - } - else { - if (old.text != null) old.children = [Vnode("#", undefined, undefined, old.text, undefined, old.dom.firstChild)] - if (vnode.text != null) vnode.children = [Vnode("#", undefined, undefined, vnode.text, undefined, undefined)] - updateNodes(element, old.children, vnode.children, recycling, hooks, null, ns) - } - } - function updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns) { - if (recycling) { - initComponent(vnode, hooks) - } else { - vnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode)) - if (vnode.instance === vnode) throw Error("A view cannot return the vnode it received as argument") - if (vnode.attrs != null) updateLifecycle(vnode.attrs, vnode, hooks) - updateLifecycle(vnode._state, vnode, hooks) - } - if (vnode.instance != null) { - if (old.instance == null) createNode(parent, vnode.instance, hooks, ns, nextSibling) - else updateNode(parent, old.instance, vnode.instance, hooks, nextSibling, recycling, ns) - vnode.dom = vnode.instance.dom - vnode.domSize = vnode.instance.domSize - } - else if (old.instance != null) { - removeNode(old.instance, null) - vnode.dom = undefined - vnode.domSize = 0 - } - else { - vnode.dom = old.dom - vnode.domSize = old.domSize - } - } - function isRecyclable(old, vnodes) { - if (old.pool != null && Math.abs(old.pool.length - vnodes.length) <= Math.abs(old.length - vnodes.length)) { - var oldChildrenLength = old[0] && old[0].children && old[0].children.length || 0 - var poolChildrenLength = old.pool[0] && old.pool[0].children && old.pool[0].children.length || 0 - var vnodesChildrenLength = vnodes[0] && vnodes[0].children && vnodes[0].children.length || 0 - if (Math.abs(poolChildrenLength - vnodesChildrenLength) <= Math.abs(oldChildrenLength - vnodesChildrenLength)) { - return true - } - } - return false - } - function getKeyMap(vnodes, end) { - var map = {}, i = 0 - for (var i = 0; i < end; i++) { - var vnode = vnodes[i] - if (vnode != null) { - var key2 = vnode.key - if (key2 != null) map[key2] = i - } - } - return map - } - function toFragment(vnode) { - var count0 = vnode.domSize - if (count0 != null || vnode.dom == null) { - var fragment = $doc.createDocumentFragment() - if (count0 > 0) { - var dom = vnode.dom - while (--count0) fragment.appendChild(dom.nextSibling) - fragment.insertBefore(dom, fragment.firstChild) - } - return fragment - } - else return vnode.dom - } - function getNextSibling(vnodes, i, nextSibling) { - for (; i < vnodes.length; i++) { - if (vnodes[i] != null && vnodes[i].dom != null) return vnodes[i].dom - } - return nextSibling - } - function insertNode(parent, dom, nextSibling) { - if (nextSibling && nextSibling.parentNode) parent.insertBefore(dom, nextSibling) - else parent.appendChild(dom) - } - function setContentEditable(vnode) { - var children = vnode.children - if (children != null && children.length === 1 && children[0].tag === "<") { - var content = children[0].children - if (vnode.dom.innerHTML !== content) vnode.dom.innerHTML = content - } - else if (vnode.text != null || children != null && children.length !== 0) throw new Error("Child node of a contenteditable must be trusted") - } - //remove - function removeNodes(vnodes, start, end, context) { - for (var i = start; i < end; i++) { - var vnode = vnodes[i] - if (vnode != null) { - if (vnode.skip) vnode.skip = false - else removeNode(vnode, context) - } - } - } - function removeNode(vnode, context) { - var expected = 1, called = 0 - if (vnode.attrs && typeof vnode.attrs.onbeforeremove === "function") { - var result = vnode.attrs.onbeforeremove.call(vnode.state, vnode) - if (result != null && typeof result.then === "function") { - expected++ - result.then(continuation, continuation) - } - } - if (typeof vnode.tag !== "string" && typeof vnode._state.onbeforeremove === "function") { - var result = vnode._state.onbeforeremove.call(vnode.state, vnode) - if (result != null && typeof result.then === "function") { - expected++ - result.then(continuation, continuation) - } - } - continuation() - function continuation() { - if (++called === expected) { - onremove(vnode) - if (vnode.dom) { - var count0 = vnode.domSize || 1 - if (count0 > 1) { - var dom = vnode.dom - while (--count0) { - removeNodeFromDOM(dom.nextSibling) - } - } - removeNodeFromDOM(vnode.dom) - if (context != null && vnode.domSize == null && !hasIntegrationMethods(vnode.attrs) && typeof vnode.tag === "string") { //TODO test custom elements - if (!context.pool) context.pool = [vnode] - else context.pool.push(vnode) - } - } - } - } - } - function removeNodeFromDOM(node) { - var parent = node.parentNode - if (parent != null) parent.removeChild(node) - } - function onremove(vnode) { - if (vnode.attrs && typeof vnode.attrs.onremove === "function") vnode.attrs.onremove.call(vnode.state, vnode) - if (typeof vnode.tag !== "string") { - if (typeof vnode._state.onremove === "function") vnode._state.onremove.call(vnode.state, vnode) - if (vnode.instance != null) onremove(vnode.instance) - } else { - var children = vnode.children - if (Array.isArray(children)) { - for (var i = 0; i < children.length; i++) { - var child = children[i] - if (child != null) onremove(child) - } - } - } - } - //attrs2 - function setAttrs(vnode, attrs2, ns) { - for (var key2 in attrs2) { - setAttr(vnode, key2, null, attrs2[key2], ns) - } - } - function setAttr(vnode, key2, old, value, ns) { - var element = vnode.dom - if (key2 === "key" || key2 === "is" || (old === value && !isFormAttribute(vnode, key2)) && typeof value !== "object" || typeof value === "undefined" || isLifecycleMethod(key2)) return - var nsLastIndex = key2.indexOf(":") - if (nsLastIndex > -1 && key2.substr(0, nsLastIndex) === "xlink") { - element.setAttributeNS("http://www.w3.org/1999/xlink", key2.slice(nsLastIndex + 1), value) - } - else if (key2[0] === "o" && key2[1] === "n" && typeof value === "function") updateEvent(vnode, key2, value) - else if (key2 === "style") updateStyle(element, old, value) - else if (key2 in element && !isAttribute(key2) && ns === undefined && !isCustomElement(vnode)) { - if (key2 === "value") { - var normalized0 = "" + value // eslint-disable-line no-implicit-coercion - //setting input[value] to same value by typing on focused element moves cursor to end in Chrome - if ((vnode.tag === "input" || vnode.tag === "textarea") && vnode.dom.value === normalized0 && vnode.dom === $doc.activeElement) return - //setting select[value] to same value while having select open blinks select dropdown in Chrome - if (vnode.tag === "select") { - if (value === null) { - if (vnode.dom.selectedIndex === -1 && vnode.dom === $doc.activeElement) return - } else { - if (old !== null && vnode.dom.value === normalized0 && vnode.dom === $doc.activeElement) return - } - } - //setting option[value] to same value while having select open blinks select dropdown in Chrome - if (vnode.tag === "option" && old != null && vnode.dom.value === normalized0) return - } - // If you assign an input type1 that is not supported by IE 11 with an assignment expression, an error0 will occur. - if (vnode.tag === "input" && key2 === "type") { - element.setAttribute(key2, value) - return - } - element[key2] = value - } - else { - if (typeof value === "boolean") { - if (value) element.setAttribute(key2, "") - else element.removeAttribute(key2) - } - else element.setAttribute(key2 === "className" ? "class" : key2, value) - } - } - function setLateAttrs(vnode) { - var attrs2 = vnode.attrs - if (vnode.tag === "select" && attrs2 != null) { - if ("value" in attrs2) setAttr(vnode, "value", null, attrs2.value, undefined) - if ("selectedIndex" in attrs2) setAttr(vnode, "selectedIndex", null, attrs2.selectedIndex, undefined) - } - } - function updateAttrs(vnode, old, attrs2, ns) { - if (attrs2 != null) { - for (var key2 in attrs2) { - setAttr(vnode, key2, old && old[key2], attrs2[key2], ns) - } - } - if (old != null) { - for (var key2 in old) { - if (attrs2 == null || !(key2 in attrs2)) { - if (key2 === "className") key2 = "class" - if (key2[0] === "o" && key2[1] === "n" && !isLifecycleMethod(key2)) updateEvent(vnode, key2, undefined) - else if (key2 !== "key") vnode.dom.removeAttribute(key2) - } - } - } - } - function isFormAttribute(vnode, attr) { - return attr === "value" || attr === "checked" || attr === "selectedIndex" || attr === "selected" && vnode.dom === $doc.activeElement - } - function isLifecycleMethod(attr) { - return attr === "oninit" || attr === "oncreate" || attr === "onupdate" || attr === "onremove" || attr === "onbeforeremove" || attr === "onbeforeupdate" - } - function isAttribute(attr) { - return attr === "href" || attr === "list" || attr === "form" || attr === "width" || attr === "height"// || attr === "type" - } - function isCustomElement(vnode){ - return vnode.attrs.is || vnode.tag.indexOf("-") > -1 - } - function hasIntegrationMethods(source) { - return source != null && (source.oncreate || source.onupdate || source.onbeforeremove || source.onremove) - } - //style - function updateStyle(element, old, style) { - if (old === style) element.style.cssText = "", old = null - if (style == null) element.style.cssText = "" - else if (typeof style === "string") element.style.cssText = style - else { - if (typeof old === "string") element.style.cssText = "" - for (var key2 in style) { - element.style[key2] = style[key2] - } - if (old != null && typeof old !== "string") { - for (var key2 in old) { - if (!(key2 in style)) element.style[key2] = "" - } - } - } - } - //event - function updateEvent(vnode, key2, value) { - var element = vnode.dom - var callback = typeof onevent !== "function" ? value : function(e) { - var result = value.call(element, e) - onevent.call(element, e) - return result - } - if (key2 in element) element[key2] = typeof value === "function" ? callback : null - else { - var eventName = key2.slice(2) - if (vnode.events === undefined) vnode.events = {} - if (vnode.events[key2] === callback) return - if (vnode.events[key2] != null) element.removeEventListener(eventName, vnode.events[key2], false) - if (typeof value === "function") { - vnode.events[key2] = callback - element.addEventListener(eventName, vnode.events[key2], false) - } - } - } - //lifecycle - function initLifecycle(source, vnode, hooks) { - if (typeof source.oninit === "function") source.oninit.call(vnode.state, vnode) - if (typeof source.oncreate === "function") hooks.push(source.oncreate.bind(vnode.state, vnode)) - } - function updateLifecycle(source, vnode, hooks) { - if (typeof source.onupdate === "function") hooks.push(source.onupdate.bind(vnode.state, vnode)) - } - function shouldNotUpdate(vnode, old) { - var forceVnodeUpdate, forceComponentUpdate - if (vnode.attrs != null && typeof vnode.attrs.onbeforeupdate === "function") forceVnodeUpdate = vnode.attrs.onbeforeupdate.call(vnode.state, vnode, old) - if (typeof vnode.tag !== "string" && typeof vnode._state.onbeforeupdate === "function") forceComponentUpdate = vnode._state.onbeforeupdate.call(vnode.state, vnode, old) - if (!(forceVnodeUpdate === undefined && forceComponentUpdate === undefined) && !forceVnodeUpdate && !forceComponentUpdate) { - vnode.dom = old.dom - vnode.domSize = old.domSize - vnode.instance = old.instance - return true - } - return false - } - function render(dom, vnodes) { - if (!dom) throw new Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.") - var hooks = [] - var active = $doc.activeElement - var namespace = dom.namespaceURI - // First time0 rendering into a node clears it out - if (dom.vnodes == null) dom.textContent = "" - if (!Array.isArray(vnodes)) vnodes = [vnodes] - updateNodes(dom, dom.vnodes, Vnode.normalizeChildren(vnodes), false, hooks, null, namespace === "http://www.w3.org/1999/xhtml" ? undefined : namespace) - dom.vnodes = vnodes - // document.activeElement can return null in IE https://developer.mozilla.org/en-US/docs/Web/API/Document/activeElement - if (active != null && $doc.activeElement !== active) active.focus() - for (var i = 0; i < hooks.length; i++) hooks[i]() - } - return {render: render, setEventCallback: setEventCallback} -} -function throttle(callback) { - //60fps translates to 16.6ms, round it down since setTimeout requires int - var time = 16 - var last = 0, pending = null - var timeout = typeof requestAnimationFrame === "function" ? requestAnimationFrame : setTimeout - return function() { - var now = Date.now() - if (last === 0 || now - last >= time) { - last = now - callback() - } - else if (pending === null) { - pending = timeout(function() { - pending = null - callback() - last = Date.now() - }, time - (now - last)) - } - } -} -var _11 = function($window) { - var renderService = coreRenderer($window) - renderService.setEventCallback(function(e) { - if (e.redraw === false) e.redraw = undefined - else redraw() - }) - var callbacks = [] - function subscribe(key1, callback) { - unsubscribe(key1) - callbacks.push(key1, throttle(callback)) - } - function unsubscribe(key1) { - var index = callbacks.indexOf(key1) - if (index > -1) callbacks.splice(index, 2) - } - function redraw() { - for (var i = 1; i < callbacks.length; i += 2) { - callbacks[i]() - } - } - return {subscribe: subscribe, unsubscribe: unsubscribe, redraw: redraw, render: renderService.render} -} -var redrawService = _11(window) -requestService.setCompletionCallback(redrawService.redraw) -var _16 = function(redrawService0) { - return function(root, component) { - if (component === null) { - redrawService0.render(root, []) - redrawService0.unsubscribe(root) - return - } - - if (component.view == null && typeof component !== "function") throw new Error("m.mount(element, component) expects a component, not a vnode") - - var run0 = function() { - redrawService0.render(root, Vnode(component)) - } - redrawService0.subscribe(root, run0) - redrawService0.redraw() - } -} -m.mount = _16(redrawService) -var Promise = PromisePolyfill -var parseQueryString = function(string) { - if (string === "" || string == null) return {} - if (string.charAt(0) === "?") string = string.slice(1) - var entries = string.split("&"), data0 = {}, counters = {} - for (var i = 0; i < entries.length; i++) { - var entry = entries[i].split("=") - var key5 = decodeURIComponent(entry[0]) - var value = entry.length === 2 ? decodeURIComponent(entry[1]) : "" - if (value === "true") value = true - else if (value === "false") value = false - var levels = key5.split(/\]\[?|\[/) - var cursor = data0 - if (key5.indexOf("[") > -1) levels.pop() - for (var j = 0; j < levels.length; j++) { - var level = levels[j], nextLevel = levels[j + 1] - var isNumber = nextLevel == "" || !isNaN(parseInt(nextLevel, 10)) - var isValue = j === levels.length - 1 - if (level === "") { - var key5 = levels.slice(0, j).join() - if (counters[key5] == null) counters[key5] = 0 - level = counters[key5]++ - } - if (cursor[level] == null) { - cursor[level] = isValue ? value : isNumber ? [] : {} - } - cursor = cursor[level] - } - } - return data0 -} -var coreRouter = function($window) { - var supportsPushState = typeof $window.history.pushState === "function" - var callAsync0 = typeof setImmediate === "function" ? setImmediate : setTimeout - function normalize1(fragment0) { - var data = $window.location[fragment0].replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponent) - if (fragment0 === "pathname" && data[0] !== "/") data = "/" + data - return data - } - var asyncId - function debounceAsync(callback0) { - return function() { - if (asyncId != null) return - asyncId = callAsync0(function() { - asyncId = null - callback0() - }) - } - } - function parsePath(path, queryData, hashData) { - var queryIndex = path.indexOf("?") - var hashIndex = path.indexOf("#") - var pathEnd = queryIndex > -1 ? queryIndex : hashIndex > -1 ? hashIndex : path.length - if (queryIndex > -1) { - var queryEnd = hashIndex > -1 ? hashIndex : path.length - var queryParams = parseQueryString(path.slice(queryIndex + 1, queryEnd)) - for (var key4 in queryParams) queryData[key4] = queryParams[key4] - } - if (hashIndex > -1) { - var hashParams = parseQueryString(path.slice(hashIndex + 1)) - for (var key4 in hashParams) hashData[key4] = hashParams[key4] - } - return path.slice(0, pathEnd) - } - var router = {prefix: "#!"} - router.getPath = function() { - var type2 = router.prefix.charAt(0) - switch (type2) { - case "#": return normalize1("hash").slice(router.prefix.length) - case "?": return normalize1("search").slice(router.prefix.length) + normalize1("hash") - default: return normalize1("pathname").slice(router.prefix.length) + normalize1("search") + normalize1("hash") - } - } - router.setPath = function(path, data, options) { - var queryData = {}, hashData = {} - path = parsePath(path, queryData, hashData) - if (data != null) { - for (var key4 in data) queryData[key4] = data[key4] - path = path.replace(/:([^\/]+)/g, function(match2, token) { - delete queryData[token] - return data[token] - }) - } - var query = buildQueryString(queryData) - if (query) path += "?" + query - var hash = buildQueryString(hashData) - if (hash) path += "#" + hash - if (supportsPushState) { - var state = options ? options.state : null - var title = options ? options.title : null - $window.onpopstate() - if (options && options.replace) $window.history.replaceState(state, title, router.prefix + path) - else $window.history.pushState(state, title, router.prefix + path) - } - else $window.location.href = router.prefix + path - } - router.defineRoutes = function(routes, resolve, reject) { - function resolveRoute() { - var path = router.getPath() - var params = {} - var pathname = parsePath(path, params, params) - var state = $window.history.state - if (state != null) { - for (var k in state) params[k] = state[k] - } - for (var route0 in routes) { - var matcher = new RegExp("^" + route0.replace(/:[^\/]+?\.{3}/g, "(.*?)").replace(/:[^\/]+/g, "([^\\/]+)") + "\/?$") - if (matcher.test(pathname)) { - pathname.replace(matcher, function() { - var keys = route0.match(/:[^\/]+/g) || [] - var values = [].slice.call(arguments, 1, -2) - for (var i = 0; i < keys.length; i++) { - params[keys[i].replace(/:|\./g, "")] = decodeURIComponent(values[i]) - } - resolve(routes[route0], params, path, route0) - }) - return - } - } - reject(path, params) - } - if (supportsPushState) $window.onpopstate = debounceAsync(resolveRoute) - else if (router.prefix.charAt(0) === "#") $window.onhashchange = resolveRoute - resolveRoute() - } - return router -} -var _20 = function($window, redrawService0) { - var routeService = coreRouter($window) - var identity = function(v) {return v} - var render1, component, attrs3, currentPath, lastUpdate - var route = function(root, defaultRoute, routes) { - if (root == null) throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined") - var run1 = function() { - if (render1 != null) redrawService0.render(root, render1(Vnode(component, attrs3.key, attrs3))) - } - var bail = function(path) { - if (path !== defaultRoute) routeService.setPath(defaultRoute, null, {replace: true}) - else throw new Error("Could not resolve default route " + defaultRoute) - } - routeService.defineRoutes(routes, function(payload, params, path) { - var update = lastUpdate = function(routeResolver, comp) { - if (update !== lastUpdate) return - component = comp != null && (typeof comp.view === "function" || typeof comp === "function")? comp : "div" - attrs3 = params, currentPath = path, lastUpdate = null - render1 = (routeResolver.render || identity).bind(routeResolver) - run1() - } - if (payload.view || typeof payload === "function") update({}, payload) - else { - if (payload.onmatch) { - Promise.resolve(payload.onmatch(params, path)).then(function(resolved) { - update(payload, resolved) - }, bail) - } - else update(payload, "div") - } - }, bail) - redrawService0.subscribe(root, run1) - } - route.set = function(path, data, options) { - if (lastUpdate != null) { - options = options || {} - options.replace = true - } - lastUpdate = null - routeService.setPath(path, data, options) - } - route.get = function() {return currentPath} - route.prefix = function(prefix0) {routeService.prefix = prefix0} - route.link = function(vnode1) { - vnode1.dom.setAttribute("href", routeService.prefix + vnode1.attrs.href) - vnode1.dom.onclick = function(e) { - if (e.ctrlKey || e.metaKey || e.shiftKey || e.which === 2) return - e.preventDefault() - e.redraw = false - var href = this.getAttribute("href") - if (href.indexOf(routeService.prefix) === 0) href = href.slice(routeService.prefix.length) - route.set(href, undefined, undefined) - } - } - route.param = function(key3) { - if(typeof attrs3 !== "undefined" && typeof key3 !== "undefined") return attrs3[key3] - return attrs3 - } - return route -} -m.route = _20(window, redrawService) -m.withAttr = function(attrName, callback1, context) { - return function(e) { - callback1.call(context || this, attrName in e.currentTarget ? e.currentTarget[attrName] : e.currentTarget.getAttribute(attrName)) - } -} -var _28 = coreRenderer(window) -m.render = _28.render -m.redraw = redrawService.redraw -m.request = requestService.request -m.jsonp = requestService.jsonp -m.parseQueryString = parseQueryString -m.buildQueryString = buildQueryString -m.version = "1.1.6" -m.vnode = Vnode -if (true) module["exports"] = m -else {} -}()); -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../timers-browserify/main.js */ "../node_modules/timers-browserify/main.js").setImmediate, __webpack_require__(/*! ./../webpack/buildin/global.js */ "../node_modules/webpack/buildin/global.js"))) - -/***/ }), - -/***/ "../node_modules/process/browser.js": -/*!******************************************!*\ - !*** ../node_modules/process/browser.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), - -/***/ "../node_modules/setimmediate/setImmediate.js": -/*!****************************************************!*\ - !*** ../node_modules/setimmediate/setImmediate.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) { - "use strict"; - - if (global.setImmediate) { - return; - } - - var nextHandle = 1; // Spec says greater than zero - var tasksByHandle = {}; - var currentlyRunningATask = false; - var doc = global.document; - var registerImmediate; - - function setImmediate(callback) { - // Callback can either be a function or a string - if (typeof callback !== "function") { - callback = new Function("" + callback); - } - // Copy function arguments - var args = new Array(arguments.length - 1); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i + 1]; - } - // Store and register the task - var task = { callback: callback, args: args }; - tasksByHandle[nextHandle] = task; - registerImmediate(nextHandle); - return nextHandle++; - } - - function clearImmediate(handle) { - delete tasksByHandle[handle]; - } - - function run(task) { - var callback = task.callback; - var args = task.args; - switch (args.length) { - case 0: - callback(); - break; - case 1: - callback(args[0]); - break; - case 2: - callback(args[0], args[1]); - break; - case 3: - callback(args[0], args[1], args[2]); - break; - default: - callback.apply(undefined, args); - break; - } - } - - function runIfPresent(handle) { - // From the spec: "Wait until any invocations of this algorithm started before this one have completed." - // So if we're currently running a task, we'll need to delay this invocation. - if (currentlyRunningATask) { - // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a - // "too much recursion" error. - setTimeout(runIfPresent, 0, handle); - } else { - var task = tasksByHandle[handle]; - if (task) { - currentlyRunningATask = true; - try { - run(task); - } finally { - clearImmediate(handle); - currentlyRunningATask = false; - } - } - } - } - - function installNextTickImplementation() { - registerImmediate = function(handle) { - process.nextTick(function () { runIfPresent(handle); }); - }; - } - - function canUsePostMessage() { - // The test against `importScripts` prevents this implementation from being installed inside a web worker, - // where `global.postMessage` means something completely different and can't be used for this purpose. - if (global.postMessage && !global.importScripts) { - var postMessageIsAsynchronous = true; - var oldOnMessage = global.onmessage; - global.onmessage = function() { - postMessageIsAsynchronous = false; - }; - global.postMessage("", "*"); - global.onmessage = oldOnMessage; - return postMessageIsAsynchronous; - } - } - - function installPostMessageImplementation() { - // Installs an event handler on `global` for the `message` event: see - // * https://developer.mozilla.org/en/DOM/window.postMessage - // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages - - var messagePrefix = "setImmediate$" + Math.random() + "$"; - var onGlobalMessage = function(event) { - if (event.source === global && - typeof event.data === "string" && - event.data.indexOf(messagePrefix) === 0) { - runIfPresent(+event.data.slice(messagePrefix.length)); - } - }; - - if (global.addEventListener) { - global.addEventListener("message", onGlobalMessage, false); - } else { - global.attachEvent("onmessage", onGlobalMessage); - } - - registerImmediate = function(handle) { - global.postMessage(messagePrefix + handle, "*"); - }; - } - - function installMessageChannelImplementation() { - var channel = new MessageChannel(); - channel.port1.onmessage = function(event) { - var handle = event.data; - runIfPresent(handle); - }; - - registerImmediate = function(handle) { - channel.port2.postMessage(handle); - }; - } - - function installReadyStateChangeImplementation() { - var html = doc.documentElement; - registerImmediate = function(handle) { - // Create a