text:
/*!
 * reveal.js 3.5.0 (2017-05-27, 23:22)
 * http://lab.hakim.se/reveal-js
 * MIT licensed
 *
 * Copyright (C) 2017 Hakim El Hattab, http://hakim.se
 */
!function(a,b){"function"==typeof define&&define.amd?define(function(){return a.Reveal=b(),a.Reveal}):"object"==typeof exports?module.exports=b():a.Reveal=b()}(this,function(){"use strict";function a(a){if(!0!==Pb)if(Pb=!0,b(),Yb.transforms2d||Yb.transforms3d){Xb.wrapper=document.querySelector(".reveal"),Xb.slides=document.querySelector(".reveal .slides"),window.addEventListener("load",N,!1);var d=zb.getQueryHash();void 0!==d.dependencies&&delete d.dependencies,q(Ob,a),q(Ob,d),C(),c()}else{document.body.setAttribute("class","no-transforms");for(var e=r(document.getElementsByTagName("img")),f=r(document.getElementsByTagName("iframe")),g=e.concat(f),h=0,i=g.length;h<i;h++){var j=g[h];j.getAttribute("data-src")&&(j.setAttribute("src",j.getAttribute("data-src")),j.removeAttribute("data-src"))}}}function b(){Fb=/(iphone|ipod|ipad|android)/gi.test(Nb),Gb=/chrome/i.test(Nb)&&!/edge/i.test(Nb);var a=document.createElement("div");Yb.transforms3d="WebkitPerspective"in a.style||"MozPerspective"in a.style||"msPerspective"in a.style||"OPerspective"in a.style||"perspective"in a.style,Yb.transforms2d="WebkitTransform"in a.style||"MozTransform"in a.style||"msTransform"in a.style||"OTransform"in a.style||"transform"in a.style,Yb.requestAnimationFrameMethod=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame,Yb.requestAnimationFrame="function"==typeof Yb.requestAnimationFrameMethod,Yb.canvas=!!document.createElement("canvas").getContext,Yb.overviewTransitions=!/Version\/[\d\.]+.*Safari/.test(Nb),Yb.zoom="zoom"in a.style&&!Fb&&(Gb||/Version\/[\d\.]+.*Safari/.test(Nb))}function c(){function a(){e.length&&head.js.apply(null,e),d()}function b(b){head.ready(b.src.match(/([\w\d_\-]*)\.?js$|[^\\\/]*$/i)[0],function(){"function"==typeof b.callback&&b.callback.apply(this),0==--f&&a()})}for(var c=[],e=[],f=0,g=0,h=Ob.dependencies.length;g<h;g++){var i=Ob.dependencies[g];i.condition&&!i.condition()||(i.async?e.push(i.src):c.push(i.src),b(i))}c.length?(f=c.length,head.js.apply(null,c)):a()}function d(){e(),m(),i(),ga(),n(),Ea(),qa(!0),setTimeout(function(){Xb.slides.classList.remove("no-transition"),Qb=!0,Xb.wrapper.classList.add("ready"),E("ready",{indexh:Ab,indexv:Bb,currentSlide:Db})},1),B()&&(p(),"complete"===document.readyState?h():window.addEventListener("load",h))}function e(){Xb.slides.classList.add("no-transition"),Xb.background=j(Xb.wrapper,"div","backgrounds",null),Xb.progress=j(Xb.wrapper,"div","progress",""),Xb.progressbar=Xb.progress.querySelector("span"),j(Xb.wrapper,"aside","controls",'<button class="navigate-left" aria-label="previous slide"></button><button class="navigate-right" aria-label="next slide"></button><button class="navigate-up" aria-label="above slide"></button><button class="navigate-down" aria-label="below slide"></button>'),Xb.slideNumber=j(Xb.wrapper,"div","slide-number",""),Xb.speakerNotes=j(Xb.wrapper,"div","speaker-notes",null),Xb.speakerNotes.setAttribute("data-prevent-swipe",""),Xb.speakerNotes.setAttribute("tabindex","0"),j(Xb.wrapper,"div","pause-overlay",null),Xb.controls=document.querySelector(".reveal .controls"),Xb.wrapper.setAttribute("role","application"),Xb.controlsLeft=r(document.querySelectorAll(".navigate-left")),Xb.controlsRight=r(document.querySelectorAll(".navigate-right")),Xb.controlsUp=r(document.querySelectorAll(".navigate-up")),Xb.controlsDown=r(document.querySelectorAll(".navigate-down")),Xb.controlsPrev=r(document.querySelectorAll(".navigate-prev")),Xb.controlsNext=r(document.querySelectorAll(".navigate-next")),Xb.statusDiv=f()}function f(){var a=document.getElementById("aria-status-div");return a||(a=document.createElement("div"),a.style.position="absolute",a.style.height="1px",a.style.width="1px",a.style.overflow="hidden",a.style.clip="rect( 1px, 1px, 1px, 1px )",a.setAttribute("id","aria-status-div"),a.setAttribute("aria-live","polite"),a.setAttribute("aria-atomic","true"),Xb.wrapper.appendChild(a)),a}function g(a){var b="";if(3===a.nodeType)b+=a.textContent;else if(1===a.nodeType){var c=a.getAttribute("aria-hidden"),d="none"===window.getComputedStyle(a).display;"true"===c||d||r(a.childNodes).forEach(function(a){b+=g(a)})}return b}function h(){var a=P(window.innerWidth,window.innerHeight),b=Math.floor(a.width*(1+Ob.margin)),c=Math.floor(a.height*(1+Ob.margin)),d=a.width,e=a.height;w("@page{size:"+b+"px "+c+"px; margin: 0px;}"),w(".reveal section>img, .reveal section>video, .reveal section>iframe{max-width: "+d+"px; max-height:"+e+"px}"),document.body.classList.add("print-pdf"),document.body.style.width=b+"px",document.body.style.height=c+"px",O(d,e),r(Xb.wrapper.querySelectorAll(Kb)).forEach(function(a,b){a.setAttribute("data-index-h",b),a.classList.contains("stack")&&r(a.querySelectorAll("section")).forEach(function(a,c){a.setAttribute("data-index-h",b),a.setAttribute("data-index-v",c)})}),r(Xb.wrapper.querySelectorAll(Jb)).forEach(function(a){if(!1===a.classList.contains("stack")){var f=(b-d)/2,g=(c-e)/2,h=a.scrollHeight,i=Math.max(Math.ceil(h/c),1);i=Math.min(i,Ob.pdfMaxPagesPerSlide),(1===i&&Ob.center||a.classList.contains("center"))&&(g=Math.max((c-h)/2,0));var j=document.createElement("div");if(j.className="pdf-page",j.style.height=(c+Ob.pdfPageHeightOffset)*i+"px",a.parentNode.insertBefore(j,a),j.appendChild(a),a.style.left=f+"px",a.style.top=g+"px",a.style.width=d+"px",a.slideBackgroundElement&&j.insertBefore(a.slideBackgroundElement,a),Ob.showNotes){var k=La(a);if(k){var l=8,m="string"==typeof Ob.showNotes?Ob.showNotes:"inline",n=document.createElement("div");n.classList.add("speaker-notes"),n.classList.add("speaker-notes-pdf"),n.setAttribute("data-layout",m),n.innerHTML=k,"separate-page"===m?j.parentNode.insertBefore(n,j.nextSibling):(n.style.left=l+"px",n.style.bottom=l+"px",n.style.width=b-2*l+"px",j.appendChild(n))}}if(Ob.slideNumber&&/all|print/i.test(Ob.showSlideNumber)){var o=parseInt(a.getAttribute("data-index-h"),10)+1,p=parseInt(a.getAttribute("data-index-v"),10)+1,q=document.createElement("div");q.classList.add("slide-number"),q.classList.add("slide-number-pdf"),q.innerHTML=oa(o,".",p),j.appendChild(q)}}}),r(Xb.wrapper.querySelectorAll(Jb+" .fragment")).forEach(function(a){a.classList.add("visible")}),E("pdf-ready")}function i(){setInterval(function(){0===Xb.wrapper.scrollTop&&0===Xb.wrapper.scrollLeft||(Xb.wrapper.scrollTop=0,Xb.wrapper.scrollLeft=0)},1e3)}function j(a,b,c,d){for(var e=a.querySelectorAll("."+c),f=0;f<e.length;f++){var g=e[f];if(g.parentNode===a)return g}var h=document.createElement(b);return h.classList.add(c),"string"==typeof d&&(h.innerHTML=d),a.appendChild(h),h}function k(){B();Xb.background.innerHTML="",Xb.background.classList.add("no-transition"),r(Xb.wrapper.querySelectorAll(Kb)).forEach(function(a){var b=l(a,Xb.background);r(a.querySelectorAll("section")).forEach(function(a){l(a,b),b.classList.add("stack")})}),Ob.parallaxBackgroundImage?(Xb.background.style.backgroundImage='url("'+Ob.parallaxBackgroundImage+'")',Xb.background.style.backgroundSize=Ob.parallaxBackgroundSize,setTimeout(function(){Xb.wrapper.classList.add("has-parallax-background")},1)):(Xb.background.style.backgroundImage="",Xb.wrapper.classList.remove("has-parallax-background"))}function l(a,b){var c={background:a.getAttribute("data-background"),backgroundSize:a.getAttribute("data-background-size"),backgroundImage:a.getAttribute("data-background-image"),backgroundVideo:a.getAttribute("data-background-video"),backgroundIframe:a.getAttribute("data-background-iframe"),backgroundColor:a.getAttribute("data-background-color"),backgroundRepeat:a.getAttribute("data-background-repeat"),backgroundPosition:a.getAttribute("data-background-position"),backgroundTransition:a.getAttribute("data-background-transition")},d=document.createElement("div");d.className="slide-background "+a.className.replace(/present|past|future/,""),c.background&&(/^(http|file|\/\/)/gi.test(c.background)||/\.(svg|png|jpg|jpeg|gif|bmp)([?#]|$)/gi.test(c.background)?a.setAttribute("data-background-image",c.background):d.style.background=c.background),(c.background||c.backgroundColor||c.backgroundImage||c.backgroundVideo||c.backgroundIframe)&&d.setAttribute("data-background-hash",c.background+c.backgroundSize+c.backgroundImage+c.backgroundVideo+c.backgroundIframe+c.backgroundColor+c.backgroundRepeat+c.backgroundPosition+c.backgroundTransition),c.backgroundSize&&(d.style.backgroundSize=c.backgroundSize),c.backgroundSize&&d.setAttribute("data-background-size",c.backgroundSize),c.backgroundColor&&(d.style.backgroundColor=c.backgroundColor),c.backgroundRepeat&&(d.style.backgroundRepeat=c.backgroundRepeat),c.backgroundPosition&&(d.style.backgroundPosition=c.backgroundPosition),c.backgroundTransition&&d.setAttribute("data-background-transition",c.backgroundTransition),b.appendChild(d),a.classList.remove("has-dark-background"),a.classList.remove("has-light-background"),a.slideBackgroundElement=d;var e=window.getComputedStyle(d);if(e&&e.backgroundColor){var f=y(e.backgroundColor);f&&0!==f.a&&(z(e.backgroundColor)<128?a.classList.add("has-dark-background"):a.classList.add("has-light-background"))}return d}function m(){Ob.postMessage&&window.addEventListener("message",function(a){var b=a.data;"string"==typeof b&&"{"===b.charAt(0)&&"}"===b.charAt(b.length-1)&&(b=JSON.parse(b),b.method&&"function"==typeof zb[b.method]&&zb[b.method].apply(zb,b.args))},!1)}function n(a){var b=Xb.wrapper.querySelectorAll(Jb).length;Xb.wrapper.classList.remove(Ob.transition),"object"==typeof a&&q(Ob,a),!1===Yb.transforms3d&&(Ob.transition="linear"),Xb.wrapper.classList.add(Ob.transition),Xb.wrapper.setAttribute("data-transition-speed",Ob.transitionSpeed),Xb.wrapper.setAttribute("data-background-transition",Ob.backgroundTransition),Xb.controls.style.display=Ob.controls?"block":"none",Xb.progress.style.display=Ob.progress?"block":"none",Ob.shuffle&&ia(),Ob.rtl?Xb.wrapper.classList.add("rtl"):Xb.wrapper.classList.remove("rtl"),Ob.center?Xb.wrapper.classList.add("center"):Xb.wrapper.classList.remove("center"),!1===Ob.pause&&_(),Ob.showNotes?(Xb.speakerNotes.classList.add("visible"),Xb.speakerNotes.setAttribute("data-layout","string"==typeof Ob.showNotes?Ob.showNotes:"inline")):Xb.speakerNotes.classList.remove("visible"),Ob.mouseWheel?(document.addEventListener("DOMMouseScroll",kb,!1),document.addEventListener("mousewheel",kb,!1)):(document.removeEventListener("DOMMouseScroll",kb,!1),document.removeEventListener("mousewheel",kb,!1)),Ob.rollingLinks?F():G(),Ob.previewLinks?(H(),I("[data-preview-link=false]")):(I(),H("[data-preview-link]:not([data-preview-link=false])")),Hb&&(Hb.destroy(),Hb=null),b>1&&Ob.autoSlide&&Ob.autoSlideStoppable&&Yb.canvas&&Yb.requestAnimationFrame&&(Hb=new yb(Xb.wrapper,function(){return Math.min(Math.max((Date.now()-cc)/ac,0),1)}),Hb.on("click",xb),dc=!1),!1===Ob.fragments&&r(Xb.slides.querySelectorAll(".fragment")).forEach(function(a){a.classList.add("visible"),a.classList.remove("current-fragment")});var c="none";Ob.slideNumber&&!B()&&("all"===Ob.showSlideNumber?c="block":"speaker"===Ob.showSlideNumber&&Da()&&(c="block")),Xb.slideNumber.style.display=c,fa()}function o(){if(_b=!0,window.addEventListener("hashchange",sb,!1),window.addEventListener("resize",tb,!1),Ob.touch&&(Xb.wrapper.addEventListener("touchstart",eb,!1),Xb.wrapper.addEventListener("touchmove",fb,!1),Xb.wrapper.addEventListener("touchend",gb,!1),window.navigator.pointerEnabled?(Xb.wrapper.addEventListener("pointerdown",hb,!1),Xb.wrapper.addEventListener("pointermove",ib,!1),Xb.wrapper.addEventListener("pointerup",jb,!1)):window.navigator.msPointerEnabled&&(Xb.wrapper.addEventListener("MSPointerDown",hb,!1),Xb.wrapper.addEventListener("MSPointerMove",ib,!1),Xb.wrapper.addEventListener("MSPointerUp",jb,!1))),Ob.keyboard&&(document.addEventListener("keydown",db,!1),document.addEventListener("keypress",cb,!1)),Ob.progress&&Xb.progress&&Xb.progress.addEventListener("click",lb,!1),Ob.focusBodyOnPageVisibilityChange){var a;"hidden"in document?a="visibilitychange":"msHidden"in document?a="msvisibilitychange":"webkitHidden"in document&&(a="webkitvisibilitychange"),a&&document.addEventListener(a,ub,!1)}var b=["touchstart","click"];Nb.match(/android/gi)&&(b=["touchstart"]),b.forEach(function(a){Xb.controlsLeft.forEach(function(b){b.addEventListener(a,mb,!1)}),Xb.controlsRight.forEach(function(b){b.addEventListener(a,nb,!1)}),Xb.controlsUp.forEach(function(b){b.addEventListener(a,ob,!1)}),Xb.controlsDown.forEach(function(b){b.addEventListener(a,pb,!1)}),Xb.controlsPrev.forEach(function(b){b.addEventListener(a,qb,!1)}),Xb.controlsNext.forEach(function(b){b.addEventListener(a,rb,!1)})})}function p(){_b=!1,document.removeEventListener("keydown",db,!1),document.removeEventListener("keypress",cb,!1),window.removeEventListener("hashchange",sb,!1),window.removeEventListener("resize",tb,!1),Xb.wrapper.removeEventListener("touchstart",eb,!1),Xb.wrapper.removeEventListener("touchmove",fb,!1),Xb.wrapper.removeEventListener("touchend",gb,!1),window.navigator.pointerEnabled?(Xb.wrapper.removeEventListener("pointerdown",hb,!1),Xb.wrapper.removeEventListener("pointermove",ib,!1),Xb.wrapper.removeEventListener("pointerup",jb,!1)):window.navigator.msPointerEnabled&&(Xb.wrapper.removeEventListener("MSPointerDown",hb,!1),Xb.wrapper.removeEventListener("MSPointerMove",ib,!1),Xb.wrapper.removeEventListener("MSPointerUp",jb,!1)),Ob.progress&&Xb.progress&&Xb.progress.removeEventListener("click",lb,!1),["touchstart","click"].forEach(function(a){Xb.controlsLeft.forEach(function(b){b.removeEventListener(a,mb,!1)}),Xb.controlsRight.forEach(function(b){b.removeEventListener(a,nb,!1)}),Xb.controlsUp.forEach(function(b){b.removeEventListener(a,ob,!1)}),Xb.controlsDown.forEach(function(b){b.removeEventListener(a,pb,!1)}),Xb.controlsPrev.forEach(function(b){b.removeEventListener(a,qb,!1)}),Xb.controlsNext.forEach(function(b){b.removeEventListener(a,rb,!1)})})}function q(a,b){for(var c in b)a[c]=b[c]}function r(a){return Array.prototype.slice.call(a)}function s(a){if("string"==typeof a){if("null"===a)return null;if("true"===a)return!0;if("false"===a)return!1;if(a.match(/^[\d\.]+$/))return parseFloat(a)}return a}function t(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)}function u(a,b){a.style.WebkitTransform=b,a.style.MozTransform=b,a.style.msTransform=b,a.style.transform=b}function v(a){"string"==typeof a.layout&&(Wb.layout=a.layout),"string"==typeof a.overview&&(Wb.overview=a.overview),Wb.layout?u(Xb.slides,Wb.layout+" "+Wb.overview):u(Xb.slides,Wb.overview)}function w(a){var b=document.createElement("style");b.type="text/css",b.styleSheet?b.styleSheet.cssText=a:b.appendChild(document.createTextNode(a)),document.getElementsByTagName("head")[0].appendChild(b)}function x(a,b){for(var c=a.parentNode;c;){var d=c.matches||c.matchesSelector||c.msMatchesSelector;if(d&&d.call(c,b))return c;c=c.parentNode}return null}function y(a){var b=a.match(/^#([0-9a-f]{3})$/i);if(b&&b[1])return b=b[1],{r:17*parseInt(b.charAt(0),16),g:17*parseInt(b.charAt(1),16),b:17*parseInt(b.charAt(2),16)};var c=a.match(/^#([0-9a-f]{6})$/i);if(c&&c[1])return c=c[1],{r:parseInt(c.substr(0,2),16),g:parseInt(c.substr(2,2),16),b:parseInt(c.substr(4,2),16)};var d=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(d)return{r:parseInt(d[1],10),g:parseInt(d[2],10),b:parseInt(d[3],10)};var e=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\,\s*([\d]+|[\d]*.[\d]+)\s*\)$/i);return e?{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10),a:parseFloat(e[4])}:null}function z(a){return"string"==typeof a&&(a=y(a)),a?(299*a.r+587*a.g+114*a.b)/1e3:null}function A(a,b){if(b=b||0,a){var c,d=a.style.height;return a.style.height="0px",c=b-a.parentNode.offsetHeight,a.style.height=d+"px",c}return b}function B(){return/print-pdf/gi.test(window.location.search)}function C(){Ob.hideAddressBar&&Fb&&(window.addEventListener("load",D,!1),window.addEventListener("orientationchange",D,!1))}function D(){setTimeout(function(){window.scrollTo(0,1)},10)}function E(a,b){var c=document.createEvent("HTMLEvents",1,2);c.initEvent(a,!0,!0),q(c,b),Xb.wrapper.dispatchEvent(c),Ob.postMessageEvents&&window.parent!==window.self&&window.parent.postMessage(JSON.stringify({namespace:"reveal",eventName:a,state:Ma()}),"*")}function F(){if(Yb.transforms3d&&!("msPerspective"in document.body.style))for(var a=Xb.wrapper.querySelectorAll(Jb+" a"),b=0,c=a.length;b<c;b++){var d=a[b];if(d.textContent&&!d.querySelector("*")&&(!d.className||!d.classList.contains(d,"roll"))){var e=document.createElement("span");e.setAttribute("data-title",d.text),e.innerHTML=d.innerHTML,d.classList.add("roll"),d.innerHTML="",d.appendChild(e)}}}function G(){for(var a=Xb.wrapper.querySelectorAll(Jb+" a.roll"),b=0,c=a.length;b<c;b++){var d=a[b],e=d.querySelector("span");e&&(d.classList.remove("roll"),d.innerHTML=e.innerHTML)}}function H(a){r(document.querySelectorAll(a||"a")).forEach(function(a){/^(http|www)/gi.test(a.getAttribute("href"))&&a.addEventListener("click",wb,!1)})}function I(a){r(document.querySelectorAll(a||"a")).forEach(function(a){/^(http|www)/gi.test(a.getAttribute("href"))&&a.removeEventListener("click",wb,!1)})}function J(a){M(),Xb.overlay=document.createElement("div"),Xb.overlay.classList.add("overlay"),Xb.overlay.classList.add("overlay-preview"),Xb.wrapper.appendChild(Xb.overlay),Xb.overlay.innerHTML=["",'','',"",'

','
','','','Unable to load iframe. This is likely due to the site\'s policy (x-frame-options).',"","
"].join(""),Xb.overlay.querySelector("iframe").addEventListener("load",function(a){Xb.overlay.classList.add("loaded")},!1),Xb.overlay.querySelector(".close").addEventListener("click",function(a){M(),a.preventDefault()},!1),Xb.overlay.querySelector(".external").addEventListener("click",function(a){M()},!1),setTimeout(function(){Xb.overlay.classList.add("visible")},1)}function K(a){"boolean"==typeof a?a?L():M():Xb.overlay?M():L()}function L(){if(Ob.help){M(),Xb.overlay=document.createElement("div"),Xb.overlay.classList.add("overlay"),Xb.overlay.classList.add("overlay-help"),Xb.wrapper.appendChild(Xb.overlay);var a='
Keyboard Shortcuts

';a+="
KEY	ACTION	";for(var b in fc)a+="
"+b+"	"+fc[b]+"
";a+="
",Xb.overlay.innerHTML=["",'',"",'
','
'+a+"
","
"].join(""),Xb.overlay.querySelector(".close").addEventListener("click",function(a){M(),a.preventDefault()},!1),setTimeout(function(){Xb.overlay.classList.add("visible")},1)}}function M(){Xb.overlay&&(Xb.overlay.parentNode.removeChild(Xb.overlay),Xb.overlay=null)}function N(){if(Xb.wrapper&&!B()){var a=P();O(Ob.width,Ob.height),Xb.slides.style.width=a.width+"px",Xb.slides.style.height=a.height+"px",Vb=Math.min(a.presentationWidth/a.width,a.presentationHeight/a.height),Vb=Math.max(Vb,Ob.minScale),Vb=Math.min(Vb,Ob.maxScale),1===Vb?(Xb.slides.style.zoom="",Xb.slides.style.left="",Xb.slides.style.top="",Xb.slides.style.bottom="",Xb.slides.style.right="",v({layout:""})):Vb>1&&Yb.zoom?(Xb.slides.style.zoom=Vb,Xb.slides.style.left="",Xb.slides.style.top="",Xb.slides.style.bottom="",Xb.slides.style.right="",v({layout:""})):(Xb.slides.style.zoom="",Xb.slides.style.left="50%",Xb.slides.style.top="50%",Xb.slides.style.bottom="auto",Xb.slides.style.right="auto",v({layout:"translate(-50%, -50%) scale("+Vb+")"}));for(var b=r(Xb.wrapper.querySelectorAll(Jb)),c=0,d=b.length;c<d;c++){var e=b[c];"none"!==e.style.display&&(Ob.center||e.classList.contains("center")?e.classList.contains("stack")?e.style.top=0:e.style.top=Math.max((a.height-e.scrollHeight)/2,0)+"px":e.style.top="")}ma(),ra(),X()&&U()}}function


text:
import React from "react";

const EuiIconGlasses = props => <svg width={16} height={16} viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" {...props}><path d="M9.035 9A3.5 3.5 0 0 1 15 7.05V4.5c0-1.072-.648-1.72-2.098-2.01a.5.5 0 0 1 .196-.98C14.981 1.886 16 2.905 16 4.5v4.25c0 .072-.015.14-.043.202A3.5 3.5 0 0 1 9.035 10h-2.07A3.5 3.5 0 1 1 .043 8.952.498.498 0 0 1 0 8.75V4.5c0-1.595 1.019-2.614 2.902-2.99a.5.5 0 0 1 .196.98C1.648 2.78 1 3.428 1 4.5v2.55A3.5 3.5 0 0 1 6.965 9h2.07zM3.5 12a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zm9 0a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z" /></svg>;

export const icon = EuiIconGlasses;

domain: javascript


text:
'use strict'

const asyncify = require('express-asyncify')
const express = require('express')
const passport = require('passport')
const middlewareAuth = require('../middleware/auth')

const app = asyncify(express.Router())

app.post('/login',passport.authenticate('json'),async (req, res, next) => {
 res.json(Object.assign({success: true}, req.user))
})

app.post('/isLogin',middlewareAuth ,(req, res) => {
  res.json({success:true, login: true})
})

app.post('/logout', function(req, res){
  req.logout()
  res.send({})
})

module.exports = app


text:
import { expect } from '@dimensionalpocket/development'
import { JSDOM } from 'jsdom'
import { KeyboardInput } from '../src/KeyboardInput.js'

var events = []
function dispatcher (handler, event) { events.unshift([handler.id, event]) }

var dom = new JSDOM('', {})
var windowInstance = dom.window

function event (eventName, code, options) {
  options = options || {}
  Object.assign(options, { code })
  var evt = new windowInstance.KeyboardEvent(eventName, options)
  return windowInstance.dispatchEvent(evt)
}

describe('KeyboardInput', function () {
  before(function () {
    this.input = new KeyboardInput(windowInstance)
    this.input.dispatch = dispatcher
  })

  after(function () {
    windowInstance.close()
  })

  describe('constructor', function () {
    it('throws without providing window instance', function () {
      var fn = () => { return new KeyboardInput() }
      expect(fn).to.throw('F-KI-WDW')
    })
  })

  describe('#capture', function () {
    it('does not dispatch event for invalid codes', function () {
      event('keydown', 'DONOTEXIST')
      expect(events).to.have.length(0)
      event('keyup', 'DONOTEXIST')
      expect(events).to.have.length(0)
      event('keydown', undefined, 0)
      expect(events).to.have.length(0)
      event('keyup', undefined, 0)
      expect(events).to.have.length(0)
      event('keydown', undefined, undefined, 0)
      expect(events).to.have.length(0)
      event('keyup', undefined, undefined, 0)
      expect(events).to.have.length(0)
    })

    it('does not emit twice when KeyDown event is spammed', function () {
      event('keydown', 'KeyW')
      expect(events).to.have.length(1)
      event('keydown', 'KeyW')
      expect(events).to.have.length(1)
      event('keyup', 'KeyW')
      expect(events).to.have.length(2)
      event('keydown', 'KeyW', { repeat: true })
      expect(events).to.have.length(2)
    })

    it('captures event.code', function () {
      event('keydown', 'KeyW')
      expect(events[0][1]).to.equal('8')
      event('keyup', 'KeyW')
      expect(events[0][1]).to.equal('5')
    })

    it('captures event.which', function () {
      event('keydown', undefined, { which: 87 })
      expect(events[0][1]).to.equal('8')
      event('keyup', undefined, { which: 87 })
      expect(events[0][1]).to.equal('5')
    })

    it('captures event.keyCode', function () {
      event('keydown', undefined, { keyCode: 87 })
      expect(events[0][1]).to.equal('8')
      event('keyup', undefined, { keyCode: 87 })
      expect(events[0][1]).to.equal('5')
    })

    it('calls preventDefault() on event', function () {
      var prevented = false
      var evt = new windowInstance.KeyboardEvent('keydown', { code: 'KeyW' })
      evt.preventDefault = () => { prevented = true }
      windowInstance.dispatchEvent(evt)
      expect(prevented).to.equal(true)
      event('keyup', 'KeyW') // reset state
    })
  })

  describe('#defaults', function () {
    it('assigns correct directions', function () {
      event('keydown', 'KeyD')
      expect(events[0][1]).to.equal('6')
      event('keydown', 'KeyW')
      expect(events[0][1]).to.equal('9')
      event('keyup', 'KeyD')
      expect(events[0][1]).to.equal('8')
      event('keydown', 'KeyA')
      expect(events[0][1]).to.equal('7')
      event('keyup', 'KeyW')
      expect(events[0][1]).to.equal('4')
      event('keydown', 'KeyS')
      expect(events[0][1]).to.equal('1')
      event('keyup', 'KeyA')
      expect(events[0][1]).to.equal('2')
      event('keydown', 'KeyD')
      expect(events[0][1]).to.equal('3')
      event('keyup', 'KeyS')
      expect(events[0][1]).to.equal('6')
      event('keyup', 'KeyD')
      expect(events[0][1]).to.equal('5')
    })

    it('assigns correct buttons', function () {
      event('keydown', 'KeyY')
      expect(events[0][1]).to.equal('X')
      event('keyup', 'KeyY')
      expect(events[0][1]).to.equal('x')
      event('keydown', 'KeyU')
      expect(events[0][1]).to.equal('Y')
      event('keyup', 'KeyU')
      expect(events[0][1]).to.equal('y')
      event('keydown', 'KeyI')
      expect(events[0][1]).to.equal('Z')
      event('keyup', 'KeyI')
      expect(events[0][1]).to.equal('z')
      event('keydown', 'KeyO')
      expect(events[0][1]).to.equal('L')
      event('keyup', 'KeyO')
      expect(events[0][1]).to.equal('l')
      event('keydown', 'KeyH')
      expect(events[0][1]).to.equal('A')
      event('keyup', 'KeyH')
      expect(events[0][1]).to.equal('a')
      event('keydown', 'KeyJ')
      expect(events[0][1]).to.equal('B')
      event('keyup', 'KeyJ')
      expect(events[0][1]).to.equal('b')
      event('keydown', 'KeyK')
      expect(events[0][1]).to.equal('C')
      event('keyup', 'KeyK')
      expect(events[0][1]).to.equal('c')
      event('keydown', 'KeyL')
      expect(events[0][1]).to.equal('R')
      event('keyup', 'KeyL')
      expect(events[0][1]).to.equal('r')
      event('keydown', 'Enter')
      expect(events[0][1]).to.equal('S')
      event('keyup', 'Enter')
      expect(events[0][1]).to.equal('s')
      event('keydown', 'Backspace')
      expect(events[0][1]).to.equal('T')
      event('keyup', 'Backspace')
      expect(events[0][1]).to.equal('t')
    })
  })

  describe('#onWindowBlur', function () {
    before(function () {
      event('keydown', 'KeyW')
      windowInstance.dispatchEvent(new windowInstance.FocusEvent('blur'))
    })

    it('resets directional state', function () {
      expect(events[0][1]).to.equal('5')
    })
  })

  describe('#uninstall', function () {
    before(function () {
      events.length = 0
      this.input.uninstall()
    })

    it('removes listeners', function () {
      event('keydown', 'KeyW')
      expect(events).to.have.length(0)
    })
  })
})


text:
#!/usr/bin/env nodejs
// -*- mode: JavaScript; js-indent-level: 2

const BotKit = require('botkit');
const Conf = require('conf');
const DocOpt = require('docopt');
const Mustache = require('mustache');
const ShellQuote = require('shell-quote');

const config = new Conf({
  configName: 'pickupthebot',
});

const controller = BotKit.slackbot({
  debug: process.env.DEBUG,
  retry: 10,
});

function getSlackToken() {
  return config.get('slack.token') || process.env.SLACK_TOKEN;
}

if (!getSlackToken()) {
  console.error('Error: Missing SLACK_TOKEN in environment');
  process.exit(1);
};

function spawnSlackbot(controller, args) {
  controller.log('Connecting...')
  const defaults = {
    token: getSlackToken(),
  };
  return controller
    .spawn(Object.assign(defaults, args))
    .startRTM();
}

function docopt(doc, message, args) {
  return DocOpt.docopt(doc, {
    argv: ShellQuote.parse(message.text),
    exit: false,
    help: false});
}

function renderUsage(bot, doc, context) {
  var usage = doc
      .replace(/^Usage:/i, '*Usage:*')
      .replace(/^ +/gim, '>')
      .replace(/\b([A-Z-]+)\b/g, '_$1_');
  return Mustache.render(
    usage,
    Object.assign({botname: bot.identity.name}, context || {}));
}

spawnSlackbot(controller);

controller.hears(['^help'], 'direct_message,direct_mention,mention',
  function onHelp(bot, message) {
    const USAGE = `
Usage:
  @{{botname}} help
  @{{botname}} info
  @{{botname}} quit
  @{{botname}} reconnect
  @{{botname}} hipchat help
  @{{botname}} yammer help
`.trim();
    var opts = docopt(USAGE, message);
    if (opts.help) {
      bot.reply(message, renderUsage(bot, USAGE));
      return;
    }
  });

controller.hears(['^info'], 'direct_message,direct_mention,mention',
  function onInfo(bot, message) {
    // foo
  });

controller.hears(['^quit'], 'direct_message,direct_mention,mention',
  function onQuit(bot, message) {
    controller.log('Quitting...')
    process.exit(0);
  });

controller.hears(['^reconnect'], 'direct_message,direct_mention,mention',
  function onReconnect(bot, message) {
    controller.log('Disconnecting...')
    bot.destroy();
    bot = spawnSlackbot(controller);
  });

controller.hears(['^hipchat'], 'direct_message,direct_mention,mention',
  function onHipchat(bot, message) {
    const USAGE = `
Usage:
  @{{botname}} hipchat help
  @{{botname}} hipchat info
  @{{botname}} hipchat connect API-KEY
  @{{botname}} hipchat disconnect
`.trim();
    var opts = docopt(USAGE, message);
    if (opts.help) {
      bot.reply(message, renderUsage(bot, USAGE));
      return;
    }
  });

controller.hears(['^yammer'], 'direct_message,direct_mention,mention',
  function onYammer(bot, message) {
    const USAGE = `
Usage:
  @{{botname}} yammer help
  @{{botname}} yammer info
  @{{botname}} yammer connect API-KEY
  @{{botname}} yammer disconnect
`.trim();
    var opts = docopt(USAGE, message);
    if (opts.help) {
      bot.reply(message, renderUsage(bot, USAGE));
      return;
    }
  });


text:
// import routes and models
const router = require('express').Router();
const { Comment, Pet, Post, User } = require('../models');

// home route
router.get('/', async (req, res) => {
  try {
    const postData = await Post.findAll({
      include: [{ model: User }],
      order: [["id", "DESC"]],
    });

    // serialize the data
    const posts = postData.map((post) => post.get({ plain: true }));

    // render home-posts view
    res.render('home-posts', {
      layout: 'home',
      posts,
      logged_in: req.session.logged_in
    });

  } catch (err) {
    res.status(500).json(err);
  }
});

// single post route
router.get('/posts/:id', async (req, res) => {
  try {
    const postData = await Post.findByPk(req.params.id, {
      include: [
        { model: User },
        { model: Comment, include: { model: User } }
      ]
    });

    // serialize the data
    const post = postData.get({ plain: true });

    // render create-comment view
    res.render('create-comment', {
      layout: 'home',
      ...post,
      logged_in: req.session.logged_in
    });

  } catch (err) {
    res.status(500).json(err);
  }
});

// login route
router.get('/login', (req, res) => {

  // if the user is logged in, redirect to home
  if (req.session.logged_in) {
    res.redirect('/');
    return;
  }

  // render login view
  res.render('login', {
    layout: 'home'
  });
});

// sign up route
router.get('/signup', (req, res) => {

  // if the user is logged in, redirect to home
  if (req.session.logged_in) {
    res.redirect('/');
    return;
  }

  // render sign-up view
  res.render('sign-up', {
    layout: 'home'
  });
});

module.exports = router;


text:
/*! For license information please see 4882.js.LICENSE.txt */
(self.webpackChunk=self.webpackChunk||[]).push([[4882],{6308:(e,t,n)=>{"use strict";n.d(t,{K:()=>a});var a=function(){function e(e){void 0===e&&(e={}),this.adapter=e}return Object.defineProperty(e,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.destroy=function(){},e}()},79397:(e,t,n)=>{"use strict";function a(e){return void 0===e&&(e=window),!!function(e){void 0===e&&(e=window);var t=!1;try{var n={get passive(){return t=!0,!1}},a=function(){};e.document.addEventListener("test",a,n),e.document.removeEventListener("test",a,n)}catch(e){t=!1}return t}(e)&&{passive:!0}}n.r(t),n.d(t,{applyPassive:()=>a})},42851:(e,t,n)=>{"use strict";function a(e,t){if(e.closest)return e.closest(t);for(var n=e;n;){if(i(n,t))return n;n=n.parentElement}return null}function i(e,t){return(e.matches||e.webkitMatchesSelector||e.msMatchesSelector).call(e,t)}function r(e){var t=e;if(null!==t.offsetParent)return t.scrollWidth;var n=t.cloneNode(!0);n.style.setProperty("position","absolute"),n.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(n);var a=n.scrollWidth;return document.documentElement.removeChild(n),a}n.r(t),n.d(t,{closest:()=>a,matches:()=>i,estimateScrollWidth:()=>r})},17211:(e,t,n)=>{"use strict";function a(e){var t=e.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left,x:t.left,y:t.top}}function i(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function r(e){var t=i(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function o(e){return e instanceof i(e).Element||e instanceof Element}function s(e){return e instanceof i(e).HTMLElement||e instanceof HTMLElement}function l(e){return"undefined"!=typeof ShadowRoot&&(e instanceof i(e).ShadowRoot||e instanceof ShadowRoot)}function d(e){return e?(e.nodeName||"").toLowerCase():null}function c(e){return((o(e)?e.ownerDocument:e.document)||window.document).documentElement}function u(e){return a(c(e)).left+r(e).scrollLeft}function m(e){return i(e).getComputedStyle(e)}function _(e){var t=m(e),n=t.overflow,a=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+a)}function p(e,t,n){void 0===n&&(n=!1);var o,l=c(t),m=a(e),p=s(t),f={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(p||!p&&!n)&&(("body"!==d(t)||_(l))&&(f=(o=t)!==i(o)&&s(o)?function(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}(o):r(o)),s(t)?((h=a(t)).x+=t.clientLeft,h.y+=t.clientTop):l&&(h.x=u(l))),{x:m.left+f.scrollLeft-h.x,y:m.top+f.scrollTop-h.y,width:m.width,height:m.height}}function f(e){var t=a(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function h(e){return"html"===d(e)?e:e.assignedSlot||e.parentNode||(l(e)?e.host:null)||c(e)}function g(e){return["html","body","#document"].indexOf(d(e))>=0?e.ownerDocument.body:s(e)&&_(e)?e:g(h(e))}function v(e,t){var n;void 0===t&&(t=[]);var a=g(e),r=a===(null==(n=e.ownerDocument)?void 0:n.body),o=i(a),s=r?[o].concat(o.visualViewport||[],_(a)?a:[]):a,l=t.concat(s);return r?l:l.concat(v(h(s)))}function b(e){return["table","td","th"].indexOf(d(e))>=0}function L(e){return s(e)&&"fixed"!==m(e).position?e.offsetParent:null}function y(e){for(var t=i(e),n=L(e);n&&b(n)&&"static"===m(n).position;)n=L(n);return n&&("html"===d(n)||"body"===d(n)&&"static"===m(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&s(e)&&"fixed"===m(e).position)return null;for(var n=h(e);s(n)&&["html","body"].indexOf(d(n))<0;){var a=m(n);if("none"!==a.transform||"none"!==a.perspective||"paint"===a.contain||-1!==["transform","perspective"].indexOf(a.willChange)||t&&"filter"===a.willChange||t&&a.filter&&"none"!==a.filter)return n;n=n.parentNode}return null}(e)||t}n.d(t,{fi:()=>ue});var M="top",Y="bottom",$="right",w="left",j="auto",k=[M,Y,$,w],T="start",D="end",x="viewport",S="popper",H=k.reduce((function(e,t){return e.concat([t+"-"+T,t+"-"+D])}),[]),C=[].concat(k,[j]).reduce((function(e,t){return e.concat([t,t+"-"+T,t+"-"+D])}),[]),O=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function R(e){var t=new Map,n=new Set,a=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var a=t.get(e);a&&i(a)}})),a.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),a}var E={placement:"bottom",modifiers:[],strategy:"absolute"};function A(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function I(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,a=void 0===n?[]:n,i=t.defaultOptions,r=void 0===i?E:i;return function(e,t,n){void 0===n&&(n=r);var i,s,l={placement:"bottom",orderedModifiers:[],options:Object.assign({},E,r),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},d=[],c=!1,u={state:l,setOptions:function(n){m(),l.options=Object.assign({},r,l.options,n),l.scrollParents={reference:o(e)?v(e):e.contextElement?v(e.contextElement):[],popper:v(t)};var i=function(e){var t=R(e);return O.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(a,l.options.modifiers)));return l.orderedModifiers=i.filter((function(e){return e.enabled})),l.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,a=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var r=i({state:l,name:t,instance:u,options:a}),o=function(){};d.push(r||o)}})),u.update()},forceUpdate:function(){if(!c){var e=l.elements,t=e.reference,n=e.popper;if(A(t,n)){l.rects={reference:p(t,y(n),"fixed"===l.options.strategy),popper:f(n)},l.reset=!1,l.placement=l.options.placement,l.orderedModifiers.forEach((function(e){return l.modifiersData[e.name]=Object.assign({},e.data)}));for(var a=0;a<l.orderedModifiers.length;a++)if(!0!==l.reset){var i=l.orderedModifiers[a],r=i.fn,o=i.options,s=void 0===o?{}:o,d=i.name;"function"==typeof r&&(l=r({state:l,options:s,name:d,instance:u})||l)}else l.reset=!1,a=-1}}},update:(i=function(){return new Promise((function(e){u.forceUpdate(),e(l)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(i())}))}))),s}),destroy:function(){m(),c=!0}};if(!A(e,t))return u;function m(){d.forEach((function(e){return e()})),d=[]}return u.setOptions(n).then((function(e){!c&&n.onFirstUpdate&&n.onFirstUpdate(e)})),u}}var P={passive:!0};const F={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,a=e.options,r=a.scroll,o=void 0===r||r,s=a.resize,l=void 0===s||s,d=i(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach((function(e){e.addEventListener("scroll",n.update,P)})),l&&d.addEventListener("resize",n.update,P),function(){o&&c.forEach((function(e){e.removeEventListener("scroll",n.update,P)})),l&&d.removeEventListener("resize",n.update,P)}},data:{}};function U(e){return e.split("-")[0]}function z(e){return e.split("-")[1]}function N(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function q(e){var t,n=e.reference,a=e.element,i=e.placement,r=i?U(i):null,o=i?z(i):null,s=n.x+n.width/2-a.width/2,l=n.y+n.height/2-a.height/2;switch(r){case M:t={x:s,y:n.y-a.height};break;case Y:t={x:s,y:n.y+n.height};break;case $:t={x:n.x+n.width,y:l};break;case w:t={x:n.x-a.width,y:l};break;default:t={x:n.x,y:n.y}}var d=r?N(r):null;if(null!=d){var c="y"===d?"height":"width";switch(o){case T:t[d]=t[d]-(n[c]/2-a[c]/2);break;case D:t[d]=t[d]+(n[c]/2-a[c]/2)}}return t}const G={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=q({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var W=Math.max,V=Math.min,Z=Math.round,B={top:"auto",right:"auto",bottom:"auto",left:"auto"};function J(e){var t,n=e.popper,a=e.popperRect,r=e.placement,o=e.offsets,s=e.position,l=e.gpuAcceleration,d=e.adaptive,u=e.roundOffsets,_=!0===u?function(e){var t=e.x,n=e.y,a=window.devicePixelRatio||1;return{x:Z(Z(t*a)/a)||0,y:Z(Z(n*a)/a)||0}}(o):"function"==typeof u?u(o):o,p=_.x,f=void 0===p?0:p,h=_.y,g=void 0===h?0:h,v=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),L=w,j=M,k=window;if(d){var T=y(n),D="clientHeight",x="clientWidth";T===i(n)&&"static"!==m(T=c(n)).position&&(D="scrollHeight",x="scrollWidth"),T=T,r===M&&(j=Y,g-=T[D]-a.height,g*=l?1:-1),r===w&&(L=$,f-=T[x]-a.width,f*=l?1:-1)}var S,H=Object.assign({position:s},d&&B);return l?Object.assign({},H,((S={})[j]=b?"0":"",S[L]=v?"0":"",S.transform=(k.devicePixelRatio||1)<2?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",S)):Object.assign({},H,((t={})[j]=b?g+"px":"",t[L]=v?f+"px":"",t.transform="",t))}var K={left:"right",right:"left",bottom:"top",top:"bottom"};function X(e){return e.replace(/left|right|bottom|top/g,(function(e){return K[e]}))}var Q={start:"end",end:"start"};function ee(e){return e.replace(/start|end/g,(function(e){return Q[e]}))}function te(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&l(n)){var a=t;do{if(a&&e.isSameNode(a))return!0;a=a.parentNode||a.host}while(a)}return!1}function ne(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ae(e,t){return t===x?ne(function(e){var t=i(e),n=c(e),a=t.visualViewport,r=n.clientWidth,o=n.clientHeight,s=0,l=0;return a&&(r=a.width,o=a.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=a.offsetLeft,l=a.offsetTop)),{width:r,height:o,x:s+u(e),y:l}}(e)):s(t)?function(e){var t=a(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):ne(function(e){var t,n=c(e),a=r(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=W(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=W(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-a.scrollLeft+u(e),d=-a.scrollTop;return"rtl"===m(i||n).direction&&(l+=W(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:d}}(c(e)))}function ie(e,t,n){var a="clippingParents"===t?function(e){var t=v(h(e)),n=["absolute","fixed"].indexOf(m(e).position)>=0&&s(e)?y(e):e;return o(n)?t.filter((function(e){return o(e)&&te(e,n)&&"body"!==d(e)})):[]}(e):[].concat(t),i=[].concat(a,[n]),r=i[0],l=i.reduce((function(t,n){var a=ae(e,n);return t.top=W(a.top,t.top),t.right=V(a.right,t.right),t.bottom=V(a.bottom,t.bottom),t.left=W(a.left,t.left),t}),ae(e,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function re(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function oe(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function se(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=void 0===i?e.placement:i,s=n.boundary,l=void 0===s?"clippingParents":s,d=n.rootBoundary,u=void 0===d?x:d,m=n.elementContext,_=void 0===m?S:m,p=n.altBoundary,f=void 0!==p&&p,h=n.padding,g=void 0===h?0:h,v=re("number"!=typeof g?g:oe(g,k)),b=_===S?"reference":S,L=e.elements.reference,y=e.rects.popper,w=e.elements[f?b:_],j=ie(o(w)?w:w.contextElement||c(e.elements.popper),l,u),T=a(L),D=q({reference:T,element:y,strategy:"absolute",placement:r}),H=ne(Object.assign({},y,D)),C=_===S?H:T,O={top:j.top-C.top+v.top,bottom:C.bottom-j.bottom+v.bottom,left:j.left-C.left+v.left,right:C.right-j.right+v.right},R=e.modifiersData.offset;if(_===S&&R){var E=R[r];Object.keys(O).forEach((function(e){var t=[$,Y].indexOf(e)>=0?1:-1,n=[M,Y].indexOf(e)>=0?"y":"x";O[e]+=E[n]*t}))}return O}function le(e,t,n){return W(e,V(t,n))}function de(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ce(e){return[M,$,Y,w].some((function(t){return e[t]>=0}))}var ue=I({defaultModifiers:[F,G,{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,a=n.gpuAcceleration,i=void 0===a||a,r=n.adaptive,o=void 0===r||r,s=n.roundOffsets,l=void 0===s||s,d={placement:U(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,J(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,J(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},a=t.attributes[e]||{},i=t.elements[e];s(i)&&d(i)&&(Object.assign(i.style,n),Object.keys(a).forEach((function(e){var t=a[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var a=t.elements[e],i=t.attributes[e]||{},r=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});s(a)&&d(a)&&(Object.assign(a.style,r),Object.keys(i).forEach((function(e){a.removeAttribute(e)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,a=e.name,i=n.offset,r=void 0===i?[0,0]:i,o=C.reduce((function(e,n){return e[n]=function(e,t,n){var a=U(e),i=[w,M].indexOf(a)>=0?-1:1,r="function"==typeof n?n(Object.assign({},t,{placement:e})):n,o=r[0],s=r[1];return o=o||0,s=(s||0)*i,[w,$].indexOf(a)>=0?{x:s,y:o}:{x:o,y:s}}(n,t.rects,r),e}),{}),s=o[t.placement],l=s.x,d=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=d),t.modifiersData[a]=o}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,a=e.name;if(!t.modifiersData[a]._skip){for(var i=n.mainAxis,r=void 0===i||i,o=n.altAxis,s=void 0===o||o,l=n.fallbackPlacements,d=n.padding,c=n.boundary,u=n.rootBoundary,m=n.altBoundary,_=n.flipVariations,p=void 0===_||_,f=n.allowedAutoPlacements,h=t.options.placement,g=U(h),v=l||(g===h||!p?[X(h)]:function(e){if(U(e)===j)return[];var t=X(e);return[ee(e),t,ee(t)]}(h)),b=[h].concat(v).reduce((function(e,n){return e.concat(U(n)===j?function(e,t){void 0===t&&(t={});var n=t,a=n.placement,i=n.boundary,r=n.rootBoundary,o=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,d=void 0===l?C:l,c=z(a),u=c?s?H:H.filter((function(e){return z(e)===c})):k,m=u.filter((function(e){return d.indexOf(e)>=0}));0===m.length&&(m=u);var _=m.reduce((function(t,n){return t[n]=se(e,{placement:n,boundary:i,rootBoundary:r,padding:o})[U(n)],t}),{});return Object.keys(_).sort((function(e,t){return _[e]-_[t]}))}(t,{placement:n,boundary:c,rootBoundary:u,padding:d,flipVariations:p,allowedAutoPlacements:f}):n)}),[]),L=t.rects.reference,y=t.rects.popper,D=new Map,x=!0,S=b[0],O=0;O<b.length;O++){var R=b[O],E=U(R),A=z(R)===T,I=[M,Y].indexOf(E)>=0,P=I?"width":"height",F=se(t,{placement:R,boundary:c,rootBoundary:u,altBoundary:m,padding:d}),N=I?A?$:w:A?Y:M;L[P]>y[P]&&(N=X(N));var q=X(N),G=[];if(r&&G.push(F[E]<=0),s&&G.push(F[N]<=0,F[q]<=0),G.every((function(e){return e}))){S=R,x=!1;break}D.set(R,G)}if(x)for(var W=function(e){var t=b.find((function(t){var n=D.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},V=p?3:1;V>0;V--){if("break"===W(V))break}t.placement!==S&&(t.modifiersData[a]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,a=e.name,i=n.mainAxis,r=void 0===i||i,o=n.altAxis,s=void 0!==o&&o,l=n.boundary,d=n.rootBoundary,c=n.altBoundary,u=n.padding,m=n.tether,_=void 0===m||m,p=n.tetherOffset,h=void 0===p?0:p,g=se(t,{boundary:l,rootBoundary:d,padding:u,altBoundary:c}),v=U(t.placement),b=z(t.placement),L=!b,j=N(v),k="x"===j?"y":"x",D=t.modifiersData.popperOffsets,x=t.rects.reference,S=t.rects.popper,H="function"==typeof h?h(Object.assign({},t.rects,{placement:t.placement})):h,C={x:0,y:0};if(D){if(r||s){var O="y"===j?M:w,R="y"===j?Y:$,E="y"===j?"height":"width",A=D[j],I=D[j]+g[O],P=D[j]-g[R],F=_?-S[E]/2:0,q=b===T?x[E]:S[E],G=b===T?-S[E]:-x[E],Z=t.elements.arrow,B=_&&Z?f(Z):{width:0,height:0},J=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},K=J[O],X=J[R],Q=le(0,x[E],B[E]),ee=L?x[E]/2-F-Q-K-H:q-Q-K-H,te=L?-x[E]/2+F+Q+X+H:G+Q+X+H,ne=t.elements.arrow&&y(t.elements.arrow),ae=ne?"y"===j?ne.clientTop||0:ne.clientLeft||0:0,ie=t.modifiersData.offset?t.modifiersData.offset[t.placement][j]:0,re=D[j]+ee-ie-ae,oe=D[j]+te-ie;if(r){var de=le(_?V(I,re):I,A,_?W(P,oe):P);D[j]=de,C[j]=de-A}if(s){var ce="x"===j?M:w,ue="x"===j?Y:$,me=D[k],_e=me+g[ce],pe=me-g[ue],fe=le(_?V(_e,re):_e,me,_?W(pe,oe):pe);D[k]=fe,C[k]=fe-me}}t.modifiersData[a]=C}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,a=e.name,i=e.options,r=n.elements.arrow,o=n.modifiersData.popperOffsets,s=U(n.placement),l=N(s),d=[w,$].indexOf(s)>=0?"height":"width";if(r&&o){var c=function(e,t){return re("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:oe(e,k))}(i.padding,n),u=f(r),m="y"===l?M:w,_="y"===l?Y:$,p=n.rects.reference[d]+n.rects.reference[l]-o[l]-n.rects.popper[d],h=o[l]-n.rects.reference[l],g=y(r),v=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=p/2-h/2,L=c[m],j=v-u[d]-c[_],T=v/2-u[d]/2+b,D=le(L,T,j),x=l;n.modifiersData[a]=((t={})[x]=D,t.centerOffset=D-T,t)}},effect:function(e){var t=e.state,n=e.options.element,a=void 0===n?"[data-popper-arrow]":n;null!=a&&("string"!=typeof a||(a=t.elements.popper.querySelector(a)))&&te(t.elements.popper,a)&&(t.elements.arrow=a)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,a=t.rects.reference,i=t.rects.popper,r=t.modifiersData.preventOverflow,o=se(t,{elementContext:"reference"}),s=se(t,{altBoundary:!0}),l=de(o,a),d=de(s,i,r),c=ce(l),u=ce(d);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:c,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":u})}}]})},50942:(e,t,n)=>{"use strict";n.d(t,{__:()=>$,ZP:()=>w});var a=n(21379),i=n(90400),r=n(22730),o=n(86551),s=n(41727);function l(e){let t,n,i,o,s,l;const d=e[6].default,c=(0,a.nu)(d,e,e[5],null);let u=[e[3]],m={};for(let e=0;e<u.length;e+=1)m=(0,a.f0)(m,u[e]);return{c(){t=(0,a.bG)("button"),c&&c.c(),(0,a.UF)(t,m)},m(d,u){(0,a.$T)(d,t,u),c&&c.m(t,null),e[7](t),o=!0,s||(l=[(0,a.TV)(n=r.ol.call(null,t,e[0])),(0,a.TV)(i=e[2].call(null,t))],s=!0)},p(e,[i]){c&&c.p&&(!o||32&i)&&(0,a.Tj)(c,d,e,e[5],o?i:-1,null,null),(0,a.UF)(t,m=(0,a.Lo)(u,[8&i&&e[3]])),n&&(0,a.sB)(n.update)&&1&i&&n.update.call(null,e[0])},i(e){o||((0,a.Ui)(c,e),o=!0)},o(e){(0,a.et)(c,e),o=!1},d(n){n&&(0,a.og)(t),c&&c.d(n),e[7](null),s=!1,(0,a.j7)(l)}}}function


text:
/*
 * Copyright (c) 2008-2013 The Open Source Geospatial Foundation
 *
 * Published under the BSD license.
 * See https://github.com/geoext/geoext2/blob/master/license.txt for the full
 * text of the license.
 */

/*
 * @include OpenLayers/Symbolizer/Raster.js
 */

/**
 * A specific model for Raster Symbolizer classifications.
 *
 * Preconfigured with an Ajax proxy and a JSON reader.
 *
 * @class GeoExt.data.RasterStyleModel
 */
Ext.define('GeoExt.data.RasterStyleModel',{
    extend: 'Ext.data.Model',
    requires : [
         'Ext.data.JsonReader',
         'GeoExt.Version'
    ],
    idProperty: "filter",
    fields: [
        {name: "symbolizers", mapping: function(v) {
            return {
                fillColor: v.color,
                fillOpacity: v.opacity,
                stroke: false
            };
        }, defaultValue: null},
        {name: "filter", mapping: "quantity", type: "float", sortType: 'asFloat', sortDir: 'ASC'},
        {name: "label", mapping: function(v) {
            // fill label with quantity if empty
            return v.label || v.quantity;
        }}
    ],
    proxy: {
        type: 'memory',
        reader: {
            type: 'json',
            root: 'colorMap'
        }
    },
    listeners:{
        idchanged:function(rec){
            for(var i=0;i<rec.stores.length;i++){
                var store = rec.stores[i];
                store.sort();
            }
        }
    }
});


text:
import React from "react";
import { Radio } from "../../src";

const RadioGroup = Radio.Group;

const plainOptions = ["Apple", "Pear", "Orange"];
const defaultCheckedList = ["Apple", "Orange"];

export default class Demo2 extends React.Component {
	state = {
		checkedList: defaultCheckedList,
		indeterminate: true,
		checkAll: false,
	};

	onChange = (checkedList) => {
		this.setState({
			checkedList,
			indeterminate: !!checkedList.length && checkedList.length < plainOptions.length,
			checkAll: checkedList.length === plainOptions.length,
		});
	};

	onCheckAllChange = (checked, e) => {
		this.setState({
			checkedList: checked ? plainOptions : [],
			indeterminate: false,
			checkAll: checked,
		});
	};

	render() {
		return (
			<div>
				<RadioGroup options={plainOptions} />
			</div>
		);
	}
}


text:
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(require("@actions/core"));
const node_ssh_1 = require("node-ssh");
const keyboard_1 = require("./keyboard");
function run() {
    return __awaiter(this, void 0, void 0, function* () {
        const command = core.getInput('command');
        const host = core.getInput('host') || 'localhost';
        const username = core.getInput('username');
        const port = +core.getInput('port') || 22;
        const key = core.getInput('key');
        const password = core.getInput('password');
        const passphrase = core.getInput('passphrase');
        const tryKeyboard = !!core.getInput('tryKeyboard');
        try {
            const ssh = yield connect(host, username, port, key, password, passphrase, tryKeyboard);
            yield executeCommand(ssh, command);
            ssh.dispose();
        }
        catch (err) {
            core.setFailed(err);
        }
    });
}
function connect(host = 'localhost', username, port = 22, key, password, passphrase, tryKeyboard) {
    return __awaiter(this, void 0, void 0, function* () {
        const ssh = new node_ssh_1.NodeSSH();
        try {
            const config = {
                host: host,
                port: port,
                username: username,
                password: password,
                passphrase: passphrase,
                tryKeyboard: tryKeyboard,
                onKeyboardInteractive: tryKeyboard ? keyboard_1.keyboardFunction(password) : null
            };
            if (key) {
                config.privateKey = key;
            }
            yield ssh.connect(config);
        }
        catch (err) {
            console.error(`⚠ GitHub Action couldn't connect to ${host}`, err);
            core.setFailed(err.message);
        }
        return ssh;
    });
}
function executeCommand(ssh, command) {
    var _a;
    return __awaiter(this, void 0, void 0, function* () {
        console.log(`${command}`);
        try {
            const { code } = yield ssh.exec(command, [], {
                stream: 'both',
                onStdout(chunk) {
                    console.log(chunk.toString('utf8'));
                },
                onStderr(chunk) {
                    console.log(chunk.toString('utf8'));
                }
            });
            if (code > 0) {
                throw Error(`Command exited with code ${code}`);
            }
            console.log('✅ SSH Action Finished');
            if (ssh.isConnected()) {
                ssh.dispose();
            }
        }
        catch (err) {
            console.error(`⚠ An error happened executing command ${command}.`, (_a = err === null || err === void 0 ? void 0 : err.message) !== null && _a !== void 0 ? _a : err);
            core.setFailed(err.message);
            process.abort();
        }
    });
}
process.on('uncaughtException', err => {
    if (err['code'] !== 'ECONNRESET')
        throw err;
});
run();


text:
/*!
 * Vue.js v2.6.11
 * (c) 2014-2020 Evan You
 * Released under the MIT License.
 */
/*  */

var emptyObject = Object.freeze({});

// These helpers produce better VM code in JS engines due to their
// explicitness and function inlining.
function isUndef (v) {
  return v === undefined || v === null
}

function isDef (v) {
  return v !== undefined && v !== null
}

function isTrue (v) {
  return v === true
}

function isFalse (v) {
  return v === false
}

/**
 * Check if value is primitive.
 */
function isPrimitive (value) {
  return (
    typeof value === 'string' ||
    typeof value === 'number' ||
    // $flow-disable-line
    typeof value === 'symbol' ||
    typeof value === 'boolean'
  )
}

/**
 * Quick object check - this is primarily used to tell
 * Objects from primitive values when we know the value
 * is a JSON-compliant type.
 */
function isObject (obj) {
  return obj !== null && typeof obj === 'object'
}

/**
 * Get the raw type string of a value, e.g., [object Object].
 */
var _toString = Object.prototype.toString;

function toRawType (value) {
  return _toString.call(value).slice(8, -1)
}

/**
 * Strict object type check. Only returns true
 * for plain JavaScript objects.
 */
function isPlainObject (obj) {
  return _toString.call(obj) === '[object Object]'
}

function isRegExp (v) {
  return _toString.call(v) === '[object RegExp]'
}

/**
 * Check if val is a valid array index.
 */
function isValidArrayIndex (val) {
  var n = parseFloat(String(val));
  return n >= 0 && Math.floor(n) === n && isFinite(val)
}

function isPromise (val) {
  return (
    isDef(val) &&
    typeof val.then === 'function' &&
    typeof val.catch === 'function'
  )
}

/**
 * Convert a value to a string that is actually rendered.
 */
function toString (val) {
  return val == null
    ? ''
    : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
      ? JSON.stringify(val, null, 2)
      : String(val)
}

/**
 * Convert an input value to a number for persistence.
 * If the conversion fails, return original string.
 */
function toNumber (val) {
  var n = parseFloat(val);
  return isNaN(n) ? val : n
}

/**
 * Make a map and return a function for checking if a key
 * is in that map.
 */
function makeMap (
  str,
  expectsLowerCase
) {
  var map = Object.create(null);
  var list = str.split(',');
  for (var i = 0; i < list.length; i++) {
    map[list[i]] = true;
  }
  return expectsLowerCase
    ? function (val) { return map[val.toLowerCase()]; }
    : function (val) { return map[val]; }
}

/**
 * Check if a tag is a built-in tag.
 */
var isBuiltInTag = makeMap('slot,component', true);

/**
 * Check if an attribute is a reserved attribute.
 */
var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');

/**
 * Remove an item from an array.
 */
function remove (arr, item) {
  if (arr.length) {
    var index = arr.indexOf(item);
    if (index > -1) {
      return arr.splice(index, 1)
    }
  }
}

/**
 * Check whether an object has the property.
 */
var hasOwnProperty = Object.prototype.hasOwnProperty;
function hasOwn (obj, key) {
  return hasOwnProperty.call(obj, key)
}

/**
 * Create a cached version of a pure function.
 */
function cached (fn) {
  var cache = Object.create(null);
  return (function cachedFn (str) {
    var hit = cache[str];
    return hit || (cache[str] = fn(str))
  })
}

/**
 * Camelize a hyphen-delimited string.
 */
var camelizeRE = /-(\w)/g;
var camelize = cached(function (str) {
  return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
});

/**
 * Capitalize a string.
 */
var capitalize = cached(function (str) {
  return str.charAt(0).toUpperCase() + str.slice(1)
});

/**
 * Hyphenate a camelCase string.
 */
var hyphenateRE = /\B([A-Z])/g;
var hyphenate = cached(function (str) {
  return str.replace(hyphenateRE, '-$1').toLowerCase()
});

/**
 * Simple bind polyfill for environments that do not support it,
 * e.g., PhantomJS 1.x. Technically, we don't need this anymore
 * since native bind is now performant enough in most browsers.
 * But removing it would mean breaking code that was able to run in
 * PhantomJS 1.x, so this must be kept for backward compatibility.
 */

/* istanbul ignore next */
function polyfillBind (fn, ctx) {
  function boundFn (a) {
    var l = arguments.length;
    return l
      ? l > 1
        ? fn.apply(ctx, arguments)
        : fn.call(ctx, a)
      : fn.call(ctx)
  }

  boundFn._length = fn.length;
  return boundFn
}

function nativeBind (fn, ctx) {
  return fn.bind(ctx)
}

var bind = Function.prototype.bind
  ? nativeBind
  : polyfillBind;

/**
 * Convert an Array-like object to a real Array.
 */
function toArray (list, start) {
  start = start || 0;
  var i = list.length - start;
  var ret = new Array(i);
  while (i--) {
    ret[i] = list[i + start];
  }
  return ret
}

/**
 * Mix properties into target object.
 */
function extend (to, _from) {
  for (var key in _from) {
    to[key] = _from[key];
  }
  return to
}

/**
 * Merge an Array of Objects into a single Object.
 */
function toObject (arr) {
  var res = {};
  for (var i = 0; i < arr.length; i++) {
    if (arr[i]) {
      extend(res, arr[i]);
    }
  }
  return res
}

/* eslint-disable no-unused-vars */

/**
 * Perform no operation.
 * Stubbing args to make Flow happy without leaving useless transpiled code
 * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
 */
function noop (a, b, c) {}

/**
 * Always return false.
 */
var no = function (a, b, c) { return false; };

/* eslint-enable no-unused-vars */

/**
 * Return the same value.
 */
var identity = function (_) { return _; };

/**
 * Generate a string containing static keys from compiler modules.
 */
function genStaticKeys (modules) {
  return modules.reduce(function (keys, m) {
    return keys.concat(m.staticKeys || [])
  }, []).join(',')
}

/**
 * Check if two values are loosely equal - that is,
 * if they are plain objects, do they have the same shape?
 */
function looseEqual (a, b) {
  if (a === b) { return true }
  var isObjectA = isObject(a);
  var isObjectB = isObject(b);
  if (isObjectA && isObjectB) {
    try {
      var isArrayA = Array.isArray(a);
      var isArrayB = Array.isArray(b);
      if (isArrayA && isArrayB) {
        return a.length === b.length && a.every(function (e, i) {
          return looseEqual(e, b[i])
        })
      } else if (a instanceof Date && b instanceof Date) {
        return a.getTime() === b.getTime()
      } else if (!isArrayA && !isArrayB) {
        var keysA = Object.keys(a);
        var keysB = Object.keys(b);
        return keysA.length === keysB.length && keysA.every(function (key) {
          return looseEqual(a[key], b[key])
        })
      } else {
        /* istanbul ignore next */
        return false
      }
    } catch (e) {
      /* istanbul ignore next */
      return false
    }
  } else if (!isObjectA && !isObjectB) {
    return String(a) === String(b)
  } else {
    return false
  }
}

/**
 * Return the first index at which a loosely equal value can be
 * found in the array (if value is a plain object, the array must
 * contain an object of the same shape), or -1 if it is not present.
 */
function looseIndexOf (arr, val) {
  for (var i = 0; i < arr.length; i++) {
    if (looseEqual(arr[i], val)) { return i }
  }
  return -1
}

/**
 * Ensure a function is called only once.
 */
function once (fn) {
  var called = false;
  return function () {
    if (!called) {
      called = true;
      fn.apply(this, arguments);
    }
  }
}

var SSR_ATTR = 'data-server-rendered';

var ASSET_TYPES = [
  'component',
  'directive',
  'filter'
];

var LIFECYCLE_HOOKS = [
  'beforeCreate',
  'created',
  'beforeMount',
  'mounted',
  'beforeUpdate',
  'updated',
  'beforeDestroy',
  'destroyed',
  'activated',
  'deactivated',
  'errorCaptured',
  'serverPrefetch'
];

/*  */

var config = ({
  /**
   * Option merge strategies (used in core/util/options)
   */
  // $flow-disable-line
  optionMergeStrategies: Object.create(null),

  /**
   * Whether to suppress warnings.
   */
  silent: false,

  /**
   * Show production mode tip message on boot?
   */
  productionTip: process.env.NODE_ENV !== 'production',

  /**
   * Whether to enable devtools
   */
  devtools: process.env.NODE_ENV !== 'production',

  /**
   * Whether to record perf
   */
  performance: false,

  /**
   * Error handler for watcher errors
   */
  errorHandler: null,

  /**
   * Warn handler for watcher warns
   */
  warnHandler: null,

  /**
   * Ignore certain custom elements
   */
  ignoredElements: [],

  /**
   * Custom user key aliases for v-on
   */
  // $flow-disable-line
  keyCodes: Object.create(null),

  /**
   * Check if a tag is reserved so that it cannot be registered as a
   * component. This is platform-dependent and may be overwritten.
   */
  isReservedTag: no,

  /**
   * Check if an attribute is reserved so that it cannot be used as a component
   * prop. This is platform-dependent and may be overwritten.
   */
  isReservedAttr: no,

  /**
   * Check if a tag is an unknown element.
   * Platform-dependent.
   */
  isUnknownElement: no,

  /**
   * Get the namespace of an element
   */
  getTagNamespace: noop,

  /**
   * Parse the real tag name for the specific platform.
   */
  parsePlatformTagName: identity,

  /**
   * Check if an attribute must be bound using property, e.g. value
   * Platform-dependent.
   */
  mustUseProp: no,

  /**
   * Perform updates asynchronously. Intended to be used by Vue Test Utils
   * This will significantly reduce performance if set to false.
   */
  async: true,

  /**
   * Exposed for legacy reasons
   */
  _lifecycleHooks: LIFECYCLE_HOOKS
});

/*  */

/**
 * unicode letters used for parsing html tags, component names and property paths.
 * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
 * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
 */
var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;

/**
 * Check if a string starts with $ or _
 */
function isReserved (str) {
  var c = (str + '').charCodeAt(0);
  return c === 0x24 || c === 0x5F
}

/**
 * Define a property.
 */
function def (obj, key, val, enumerable) {
  Object.defineProperty(obj, key, {
    value: val,
    enumerable: !!enumerable,
    writable: true,
    configurable: true
  });
}

/**
 * Parse simple path.
 */
var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
function parsePath (path) {
  if (bailRE.test(path)) {
    return
  }
  var segments = path.split('.');
  return function (obj) {
    for (var i = 0; i < segments.length; i++) {
      if (!obj) { return }
      obj = obj[segments[i]];
    }
    return obj
  }
}

/*  */

// can we use __proto__?
var hasProto = '__proto__' in {};

// Browser environment sniffing
var inBrowser = typeof window !== 'undefined';
var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
var UA = inBrowser && window.navigator.userAgent.toLowerCase();
var isIE = UA && /msie|trident/.test(UA);
var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
var isEdge = UA && UA.indexOf('edge/') > 0;
var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
var isPhantomJS = UA && /phantomjs/.test(UA);
var isFF = UA && UA.match(/firefox\/(\d+)/);

// Firefox has a "watch" function on Object.prototype...
var nativeWatch = ({}).watch;

var supportsPassive = false;
if (inBrowser) {
  try {
    var opts = {};
    Object.defineProperty(opts, 'passive', ({
      get: function get () {
        /* istanbul ignore next */
        supportsPassive = true;
      }
    })); // https://github.com/facebook/flow/issues/285
    window.addEventListener('test-passive', null, opts);
  } catch (e) {}
}

// this needs to be lazy-evaled because vue may be required before
// vue-server-renderer can set VUE_ENV
var _isServer;
var isServerRendering = function () {
  if (_isServer === undefined) {
    /* istanbul ignore if */
    if (!inBrowser && !inWeex && typeof global !== 'undefined') {
      // detect presence of vue-server-renderer and avoid
      // Webpack shimming the process
      _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
    } else {
      _isServer = false;
    }
  }
  return _isServer
};

// detect devtools
var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;

/* istanbul ignore next */
function isNative (Ctor) {
  return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
}

var hasSymbol =
  typeof Symbol !== 'undefined' && isNative(Symbol) &&
  typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);

var _Set;
/* istanbul ignore if */ // $flow-disable-line
if (typeof Set !== 'undefined' && isNative(Set)) {
  // use native Set when available.
  _Set = Set;
} else {
  // a non-standard Set polyfill that only works with primitive keys.
  _Set = /*@__PURE__*/(function () {
    function Set () {
      this.set = Object.create(null);
    }
    Set.prototype.has = function has (key) {
      return this.set[key] === true
    };
    Set.prototype.add = function add (key) {
      this.set[key] = true;
    };
    Set.prototype.clear = function clear () {
      this.set = Object.create(null);
    };

    return Set;
  }());
}

/*  */

var warn = noop;
var tip = noop;
var generateComponentTrace = (noop); // work around flow check
var formatComponentName = (noop);

if (process.env.NODE_ENV !== 'production') {
  var hasConsole = typeof console !== 'undefined';
  var classifyRE = /(?:^|[-_])(\w)/g;
  var classify = function (str) { return str
    .replace(classifyRE, function (c) { return c.toUpperCase(); })
    .replace(/[-_]/g, ''); };

  warn = function (msg, vm) {
    var trace = vm ? generateComponentTrace(vm) : '';

    if (config.warnHandler) {
      config.warnHandler.call(null, msg, vm, trace);
    } else if (hasConsole && (!config.silent)) {
      console.error(("[Vue warn]: " + msg + trace));
    }
  };

  tip = function (msg, vm) {
    if (hasConsole && (!config.silent)) {
      console.warn("[Vue tip]: " + msg + (
        vm ? generateComponentTrace(vm) : ''
      ));
    }
  };

  formatComponentName = function (vm, includeFile) {
    if (vm.$root === vm) {
      if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
        return ('at ') + vm.$options.__file
      }
      return '<Root>'
    }
    var options = typeof vm === 'function' && vm.cid != null
      ? vm.options
      : vm._isVue
        ? vm.$options || vm.constructor.options
        : vm;
    var name = options.name || options._componentTag;
    var file = options.__file;
    if (!name && file) {
      var match = file.match(/([^/\\]+)\.vue$/);
      name = match && match[1];
    }

    return (
      (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
      (file && includeFile !== false ? (" at " + file) : '')
    )
  };

  var repeat = function (str, n) {
    var res = '';
    while (n) {
      if (n % 2 === 1) { res += str; }
      if (n > 1) { str += str; }
      n >>= 1;
    }
    return res
  };

  generateComponentTrace = function (vm) {
    if (vm._isVue && vm.$parent) {
      var tree = [];
      var currentRecursiveSequence = 0;
      while (vm && vm.$options.name !== 'PageBody') {
        if (tree.length > 0) {
          var last = tree[tree.length - 1];
          if (last.constructor === vm.constructor) {
            currentRecursiveSequence++;
            vm = vm.$parent;
            continue
          } else if (currentRecursiveSequence > 0) {
            tree[tree.length - 1] = [last, currentRecursiveSequence];
            currentRecursiveSequence = 0;
          }
        }
        !vm.$options.isReserved && tree.push(vm);
        vm = vm.$parent;
      }
      return '\n\nfound in\n\n' + tree
        .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
            ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
            : formatComponentName(vm))); })
        .join('\n')
    } else {
      return ("\n\n(found in " + (formatComponentName(vm)) + ")")
    }
  };
}

/*  */

var uid = 0;

/**
 * A dep is an observable that can have multiple
 * directives subscribing to it.
 */
var Dep = function Dep () {
  // fixed by xxxxxx (nvue vuex)
  /* eslint-disable no-undef */
  if(typeof SharedObject !== 'undefined'){
    this.id = SharedObject.uid++;
  } else {
    this.id = uid++;
  }
  this.subs = [];
};

Dep.prototype.addSub = function addSub (sub) {
  this.subs.push(sub);
};

Dep.prototype.removeSub = function removeSub (sub) {
  remove(this.subs, sub);
};

Dep.prototype.depend = function depend () {
  if (Dep.SharedObject.target) {
    Dep.SharedObject.target.addDep(this);
  }
};

Dep.prototype.notify = function notify () {
  // stabilize the subscriber list first
  var subs = this.subs.slice();
  if (process.env.NODE_ENV !== 'production' && !config.async) {
    // subs aren't sorted in scheduler if not running async
    // we need to sort them now to make sure they fire in correct
    // order
    subs.sort(function (a, b) { return a.id - b.id; });
  }
  for (var i = 0, l = subs.length; i < l; i++) {
    subs[i].update();
  }
};

// The current target watcher being evaluated.
// This is globally unique because only one watcher
// can be evaluated at a time.
// fixed by xxxxxx (nvue shared vuex)
/* eslint-disable no-undef */
Dep.SharedObject = typeof SharedObject !== 'undefined' ? SharedObject : {};
Dep.SharedObject.target = null;
Dep.SharedObject.targetStack = [];

function pushTarget (target) {
  Dep.SharedObject.targetStack.push(target);
  Dep.SharedObject.target = target;
}

function popTarget () {
  Dep.SharedObject.targetStack.pop();
  Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
}

/*  */

var VNode = function VNode (
  tag,
  data,
  children,
  text,
  elm,
  context,
  componentOptions,
  asyncFactory
) {
  this.tag = tag;
  this.data = data;
  this.children = children;
  this.text = text;
  this.elm = elm;
  this.ns = undefined;
  this.context = context;
  this.fnContext = undefined;
  this.fnOptions = undefined;
  this.fnScopeId = undefined;
  this.key = data && data.key;
  this.componentOptions = componentOptions;
  this.componentInstance = undefined;
  this.parent = undefined;
  this.raw = false;
  this.isStatic = false;
  this.isRootInsert = true;
  this.isComment = false;
  this.isCloned = false;
  this.isOnce = false;
  this.asyncFactory = asyncFactory;
  this.asyncMeta = undefined;
  this.isAsyncPlaceholder = false;
};

var prototypeAccessors = { child: { configurable: true } };

// DEPRECATED: alias for componentInstance for backwards compat.
/* istanbul ignore next */
prototypeAccessors.child.get = function () {
  return this.componentInstance
};

Object.defineProperties( VNode.prototype, prototypeAccessors );

var createEmptyVNode = function (text) {
  if ( text === void 0 ) text = '';

  var node = new VNode();
  node.text = text;
  node.isComment = true;
  return node
};

function createTextVNode (val) {
  return new VNode(undefined, undefined, undefined, String(val))
}

// optimized shallow clone
// used for static nodes and slot nodes because they may be reused across
// multiple renders, cloning them avoids errors when DOM manipulations rely
// on their elm reference.
function cloneVNode (vnode) {
  var cloned = new VNode(
    vnode.tag,
    vnode.data,
    // #7975
    // clone children array to avoid mutating original in case of cloning
    // a child.
    vnode.children && vnode.children.slice(),
    vnode.text,
    vnode.elm,
    vnode.context,


text:
// based on rc-input-number 4.5.5
import PropTypes from '../../_util/vue-types';
import BaseMixin from '../../_util/BaseMixin';
import { initDefaultProps, hasProp, getOptionProps, getListeners } from '../../_util/props-util';
import classNames from 'classnames';
import KeyCode from '../../_util/KeyCode';
import InputHandler from './InputHandler';

function noop() {}

function preventDefault(e) {
  e.preventDefault();
}

function defaultParser(input) {
  return input.replace(/[^\w\.-]+/g, '');
}

/**
 * When click and hold on a button - the speed of auto changin the value.
 */
const SPEED = 200;

/**
 * When click and hold on a button - the delay before auto changin the value.
 */
const DELAY = 600;

/**
 * Max Safe Integer -- on IE this is not available, so manually set the number in that case.
 * The reason this is used, instead of Infinity is because numbers above the MSI are unstable
 */
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1;

const isValidProps = value => value !== undefined && value !== null;

const isEqual = (oldValue, newValue) =>
  newValue === oldValue ||
  (typeof newValue === 'number' &&
    typeof oldValue === 'number' &&
    isNaN(newValue) &&
    isNaN(oldValue));

const inputNumberProps = {
  value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
  defaultValue: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
  focusOnUpDown: PropTypes.bool,
  autoFocus: PropTypes.bool,
  // onChange: PropTypes.func,
  // onKeyDown: PropTypes.func,
  // onKeyUp: PropTypes.func,
  prefixCls: PropTypes.string,
  tabIndex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  placeholder: PropTypes.string,
  disabled: PropTypes.bool,
  // onFocus: PropTypes.func,
  // onBlur: PropTypes.func,
  readOnly: PropTypes.bool,
  max: PropTypes.number,
  min: PropTypes.number,
  step: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
  upHandler: PropTypes.any,
  downHandler: PropTypes.any,
  useTouch: PropTypes.bool,
  formatter: PropTypes.func,
  parser: PropTypes.func,
  // onMouseEnter: PropTypes.func,
  // onMouseLeave: PropTypes.func,
  // onMouseOver: PropTypes.func,
  // onMouseOut: PropTypes.func,
  precision: PropTypes.number,
  required: PropTypes.bool,
  pattern: PropTypes.string,
  decimalSeparator: PropTypes.string,
  autoComplete: PropTypes.string,
  title: PropTypes.string,
  name: PropTypes.string,
  id: PropTypes.string,
};

export default {
  name: 'VCInputNumber',
  mixins: [BaseMixin],
  model: {
    prop: 'value',
    event: 'change',
  },
  props: initDefaultProps(inputNumberProps, {
    focusOnUpDown: true,
    useTouch: false,
    prefixCls: 'rc-input-number',
    min: -MAX_SAFE_INTEGER,
    step: 1,
    parser: defaultParser,
    required: false,
    autoComplete: 'off',
  }),
  data() {
    const props = getOptionProps(this);
    this.prevProps = { ...props };
    let value;
    if ('value' in props) {
      value = this.value;
    } else {
      value = this.defaultValue;
    }
    const validValue = this.getValidValue(this.toNumber(value));
    return {
      inputValue: this.toPrecisionAsStep(validValue),
      sValue: validValue,
      focused: this.autoFocus,
    };
  },
  mounted() {
    this.$nextTick(() => {
      if (this.autoFocus && !this.disabled) {
        this.focus();
      }
      this.updatedFunc();
    });
  },
  updated() {
    const { value, max, min } = this.$props;
    const { focused } = this.$data;
    const { prevProps } = this;
    const props = getOptionProps(this);
    // Don't trigger in componentDidMount
    if (prevProps) {
      if (
        !isEqual(prevProps.value, value) ||
        !isEqual(prevProps.max, max) ||
        !isEqual(prevProps.min, min)
      ) {
        const validValue = focused ? value : this.getValidValue(value);
        let nextInputValue;
        if (this.pressingUpOrDown) {
          nextInputValue = validValue;
        } else if (this.inputting) {
          nextInputValue = this.rawInput;
        } else {
          nextInputValue = this.toPrecisionAsStep(validValue);
        }
        this.setState({
          // eslint-disable-line
          sValue: validValue,
          inputValue: nextInputValue,
        });
      }

      // Trigger onChange when max or min change
      // https://github.com/ant-design/ant-design/issues/11574
      const nextValue = 'value' in props ? value : this.sValue;
      // ref: null < 20 === true
      // https://github.com/ant-design/ant-design/issues/14277
      if (
        'max' in props &&
        prevProps.max !== max &&
        typeof nextValue === 'number' &&
        nextValue > max
      ) {
        this.$emit('change', max);
      }
      if (
        'min' in props &&
        prevProps.min !== min &&
        typeof nextValue === 'number' &&
        nextValue < min
      ) {
        this.$emit('change', min);
      }
    }
    this.prevProps = { ...props };
    this.$nextTick(() => {
      this.updatedFunc();
    });
  },
  beforeDestroy() {
    this.stop();
  },
  methods: {
    updatedFunc() {
      const inputElem = this.$refs.inputRef;
      // Restore cursor
      try {
        // Firefox set the input cursor after it get focused.
        // This caused that if an input didn't init with the selection,
        // set will cause cursor not correct when first focus.
        // Safari will focus input if set selection. We need skip this.
        if (this.cursorStart !== undefined && this.focused) {
          // In most cases, the string after cursor is stable.
          // We can move the cursor before it

          if (
            // If not match full str, try to match part of str
            !this.partRestoreByAfter(this.cursorAfter) &&
            this.sValue !== this.value
          ) {
            // If not match any of then, let's just keep the position
            // TODO: Logic should not reach here, need check if happens
            let pos = this.cursorStart + 1;

            // If not have last string, just position to the end
            if (!this.cursorAfter) {
              pos = inputElem.value.length;
            } else if (this.lastKeyCode === KeyCode.BACKSPACE) {
              pos = this.cursorStart - 1;
            } else if (this.lastKeyCode === KeyCode.DELETE) {
              pos = this.cursorStart;
            }
            this.fixCaret(pos, pos);
          } else if (this.currentValue === inputElem.value) {
            // Handle some special key code
            switch (this.lastKeyCode) {
              case KeyCode.BACKSPACE:
                this.fixCaret(this.cursorStart - 1, this.cursorStart - 1);
                break;
              case KeyCode.DELETE:
                this.fixCaret(this.cursorStart + 1, this.cursorStart + 1);
                break;
              default:
              // Do nothing
            }
          }
        }
      } catch (e) {
        // Do nothing
      }
      // Reset last key
      this.lastKeyCode = null;

      // pressingUpOrDown is true means that someone just click up or down button
      if (!this.pressingUpOrDown) {
        return;
      }
      if (this.focusOnUpDown && this.focused) {
        if (document.activeElement !== inputElem) {
          this.focus();
        }
      }

      this.pressingUpOrDown = false;
    },
    onKeyDown(e, ...args) {
      if (e.keyCode === KeyCode.UP) {
        const ratio = this.getRatio(e);
        this.up(e, ratio);
        this.stop();
      } else if (e.keyCode === KeyCode.DOWN) {
        const ratio = this.getRatio(e);
        this.down(e, ratio);
        this.stop();
      } else if (e.keyCode === KeyCode.ENTER) {
        this.$emit('pressEnter', e);
      }
      // Trigger user key down
      this.recordCursorPosition();
      this.lastKeyCode = e.keyCode;
      this.$emit('keydown', e, ...args);
    },
    onKeyUp(e, ...args) {
      this.stop();

      this.recordCursorPosition();

      this.$emit('keyup', e, ...args);
    },
    onChange(e) {
      if (this.focused) {
        this.inputting = true;
      }
      this.rawInput = this.parser(this.getValueFromEvent(e));
      this.setState({ inputValue: this.rawInput });
      this.$emit('change', this.toNumber(this.rawInput)); // valid number or invalid string
    },
    onFocus(...args) {
      this.setState({
        focused: true,
      });
      this.$emit('focus', ...args);
    },
    onBlur(...args) {
      this.inputting = false;
      this.setState({
        focused: false,
      });
      const value = this.getCurrentValidValue(this.inputValue);
      const newValue = this.setValue(value);
      if (this.$listeners.blur) {
        const originValue = this.$refs.inputRef.value;
        const inputValue = this.getInputDisplayValue({ focused: false, sValue: newValue });
        this.$refs.inputRef.value = inputValue;
        this.$emit('blur', ...args);
        this.$refs.inputRef.value = originValue;
      }
    },
    getCurrentValidValue(value) {
      let val = value;
      if (val === '') {
        val = '';
      } else if (!this.isNotCompleteNumber(parseFloat(val, 10))) {
        val = this.getValidValue(val);
      } else {
        val = this.sValue;
      }
      return this.toNumber(val);
    },
    getRatio(e) {
      let ratio = 1;
      if (e.metaKey || e.ctrlKey) {
        ratio = 0.1;
      } else if (e.shiftKey) {
        ratio = 10;
      }
      return ratio;
    },
    getValueFromEvent(e) {
      // optimize for chinese input expierence
      // https://github.com/ant-design/ant-design/issues/8196
      let value = e.target.value.trim().replace(/。/g, '.');

      if (isValidProps(this.decimalSeparator)) {
        value = value.replace(this.decimalSeparator, '.');
      }

      return value;
    },
    getValidValue(value, min = this.min, max = this.max) {
      let val = parseFloat(value, 10);
      // https://github.com/ant-design/ant-design/issues/7358
      if (isNaN(val)) {
        return value;
      }
      if (val < min) {
        val = min;
      }
      if (val > max) {
        val = max;
      }
      return val;
    },
    setValue(v, callback) {
      // trigger onChange
      const { precision } = this.$props;
      const newValue = this.isNotCompleteNumber(parseFloat(v, 10)) ? null : parseFloat(v, 10);
      const { sValue: value = null, inputValue = null } = this.$data;
      // https://github.com/ant-design/ant-design/issues/7363
      // https://github.com/ant-design/ant-design/issues/16622
      const newValueInString =
        typeof newValue === 'number' ? newValue.toFixed(precision) : `${newValue}`;
      const changed = newValue !== value || newValueInString !== `${inputValue}`;
      if (!hasProp(this, 'value')) {
        this.setState(
          {
            sValue: newValue,
            inputValue: this.toPrecisionAsStep(v),
          },
          callback,
        );
      } else {
        // always set input value same as value
        this.setState(
          {
            inputValue: this.toPrecisionAsStep(this.sValue),
          },
          callback,
        );
      }
      if (changed) {
        this.$emit('change', newValue);
      }
      return newValue;
    },
    getPrecision(value) {
      if (isValidProps(this.precision)) {
        return this.precision;
      }
      const valueString = value.toString();
      if (valueString.indexOf('e-') >= 0) {
        return parseInt(valueString.slice(valueString.indexOf('e-') + 2), 10);
      }
      let precision = 0;
      if (valueString.indexOf('.') >= 0) {
        precision = valueString.length - valueString.indexOf('.') - 1;
      }
      return precision;
    },
    // step={1.0} value={1.51}
    // press +
    // then value should be 2.51, rather than 2.5
    // if this.$props.precision is undefined
    // https://github.com/react-component/input-number/issues/39
    getMaxPrecision(currentValue, ratio = 1) {
      if (isValidProps(this.precision)) {
        return this.precision;
      }
      const { step } = this;
      const ratioPrecision = this.getPrecision(ratio);
      const stepPrecision = this.getPrecision(step);
      const currentValuePrecision = this.getPrecision(currentValue);
      if (!currentValue) {
        return ratioPrecision + stepPrecision;
      }
      return Math.max(currentValuePrecision, ratioPrecision + stepPrecision);
    },
    getPrecisionFactor(currentValue, ratio = 1) {
      const precision = this.getMaxPrecision(currentValue, ratio);
      return Math.pow(10, precision);
    },
    getInputDisplayValue(state) {
      const { focused, inputValue, sValue } = state || this.$data;
      let inputDisplayValue;
      if (focused) {
        inputDisplayValue = inputValue;
      } else {
        inputDisplayValue = this.toPrecisionAsStep(sValue);
      }

      if (inputDisplayValue === undefined || inputDisplayValue === null) {
        inputDisplayValue = '';
      }

      let inputDisplayValueFormat = this.formatWrapper(inputDisplayValue);
      if (isValidProps(this.$props.decimalSeparator)) {
        inputDisplayValueFormat = inputDisplayValueFormat
          .toString()
          .replace('.', this.$props.decimalSeparator);
      }

      return inputDisplayValueFormat;
    },
    recordCursorPosition() {
      // Record position
      try {
        const inputElem = this.$refs.inputRef;
        this.cursorStart = inputElem.selectionStart;
        this.cursorEnd = inputElem.selectionEnd;
        this.currentValue = inputElem.value;
        this.cursorBefore = inputElem.value.substring(0, this.cursorStart);
        this.cursorAfter = inputElem.value.substring(this.cursorEnd);
      } catch (e) {
        // Fix error in Chrome:
        // Failed to read the 'selectionStart' property from 'HTMLInputElement'
        // http://stackoverflow.com/q/21177489/3040605
      }
    },
    fixCaret(start, end) {
      if (
        start === undefined ||
        end === undefined ||
        !this.$refs.inputRef ||
        !this.$refs.inputRef.value
      ) {
        return;
      }

      try {
        const inputElem = this.$refs.inputRef;
        const currentStart = inputElem.selectionStart;
        const currentEnd = inputElem.selectionEnd;

        if (start !== currentStart || end !== currentEnd) {
          inputElem.setSelectionRange(start, end);
        }
      } catch (e) {
        // Fix error in Chrome:
        // Failed to read the 'selectionStart' property from 'HTMLInputElement'
        // http://stackoverflow.com/q/21177489/3040605
      }
    },
    restoreByAfter(str) {
      if (str === undefined) return false;

      const fullStr = this.$refs.inputRef.value;
      const index = fullStr.lastIndexOf(str);

      if (index === -1) return false;

      const prevCursorPos = this.cursorBefore.length;
      if (
        this.lastKeyCode === KeyCode.DELETE &&
        this.cursorBefore.charAt(prevCursorPos - 1) === str[0]
      ) {
        this.fixCaret(prevCursorPos, prevCursorPos);
        return true;
      }
      if (index + str.length === fullStr.length) {
        this.fixCaret(index, index);

        return true;
      }
      return false;
    },
    partRestoreByAfter(str) {
      if (str === undefined) return false;

      // For loop from full str to the str with last char to map. e.g. 123
      // -> 123
      // -> 23
      // -> 3
      return Array.prototype.some.call(str, (_, start) => {
        const partStr = str.substring(start);

        return this.restoreByAfter(partStr);
      });
    },
    focus() {
      this.$refs.inputRef.focus();
      this.recordCursorPosition();
    },
    blur() {
      this.$refs.inputRef.blur();
    },
    formatWrapper(num) {
      // http://2ality.com/2012/03/signedzero.html
      // https://github.com/ant-design/ant-design/issues/9439
      if (this.formatter) {
        return this.formatter(num);
      }
      return num;
    },
    toPrecisionAsStep(num) {
      if (this.isNotCompleteNumber(num) || num === '') {
        return num;
      }
      const precision = Math.abs(this.getMaxPrecision(num));
      if (!isNaN(precision)) {
        return Number(num).toFixed(precision);
      }
      return num.toString();
    },
    // '1.' '1x' 'xx' '' => are not complete numbers
    isNotCompleteNumber(num) {
      return (
        isNaN(num) ||
        num === '' ||
        num === null ||
        (num && num.toString().indexOf('.') === num.toString().length - 1)
      );
    },
    toNumber(num) {
      const { precision, autoFocus } = this.$props;
      const { focused = autoFocus } = this;
      // num.length > 16 => This is to prevent input of large numbers
      const numberIsTooLarge = num && num.length > 16 && focused;
      if (this.isNotCompleteNumber(num) || numberIsTooLarge) {
        return num;
      }
      if (isValidProps(precision)) {
        return Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision);
      }
      return Number(num);
    },
    upStep(val, rat) {
      const { step } = this;
      const precisionFactor = this.getPrecisionFactor(val, rat);
      const precision = Math.abs(this.getMaxPrecision(val, rat));
      const result = (
        (precisionFactor * val + precisionFactor * step * rat) /
        precisionFactor
      ).toFixed(precision);
      return this.toNumber(result);
    },
    downStep(val, rat) {
      const { step } = this;
      const precisionFactor = this.getPrecisionFactor(val, rat);
      const precision = Math.abs(this.getMaxPrecision(val, rat));
      const result = (
        (precisionFactor * val - precisionFactor * step * rat) /
        precisionFactor
      ).toFixed(precision);
      return this.toNumber(result);
    },
    stepFn(type, e, ratio = 1, recursive) {
      this.stop();
      if (e) {
        // e.persist()
        e.preventDefault();
      }
      if (this.disabled) {
        return;
      }
      const { max, min } = this;
      const value = this.getCurrentValidValue(this.inputValue) || 0;
      if (this.isNotCompleteNumber(value)) {
        return;
      }
      let val = this[`${type}Step`](value, ratio);
      const outOfRange = val > max || val < min;
      if (val > max) {
        val = max;
      } else if (val < min) {
        val = min;
      }
      this.setValue(val);
      this.setState({
        focused: true,
      });
      if (outOfRange) {
        return;
      }
      this.autoStepTimer = setTimeout(
        () => {
          this[type](e, ratio, true);
        },
        recursive ? SPEED : DELAY,
      );
    },
    stop() {
      if (this.autoStepTimer) {
        clearTimeout(this.autoStepTimer);
      }
    },
    down(e, ratio, recursive) {
      this.pressingUpOrDown = true;
      this.stepFn('down', e, ratio, recursive);
    },
    up(e, ratio, recursive) {
      this.pressingUpOrDown = true;
      this.stepFn('up', e, ratio, recursive);
    },
    handleInputClick() {
      this.$emit('click');
    },
  },
  render() {
    const {
      prefixCls,
      disabled,
      readOnly,
      useTouch,
      autoComplete,
      upHandler,
      downHandler,
    } = this.$props;
    const classes = classNames({
      [prefixCls]: true,
      [`${prefixCls}-disabled`]: disabled,
      [`${prefixCls}-focused`]: this.focused,
    });
    let upDisabledClass = '';
    let downDisabledClass = '';
    const { sValue } = this;
    if (sValue || sValue === 0) {
      if (!isNaN(sValue)) {
        const val = Number(sValue);
        if (val >= this.max) {
          upDisabledClass = `${prefixCls}-handler-up-disabled`;
        }
        if (val <= this.min) {
          downDisabledClass = `${prefixCls}-handler-down-disabled`;
        }
      } else {
        upDisabledClass = `${prefixCls}-handler-up-disabled`;
        downDisabledClass = `${prefixCls}-handler-down-disabled`;
      }
    }

    const editable = !this.readOnly && !this.disabled;

    // focus state, show input value
    // unfocus state, show valid value
    const inputDisplayValue = this.getInputDisplayValue();

    let upEvents;


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var isArray_1 = require("../util/isArray");
var combineLatest_1 = require("../observable/combineLatest");
var from_1 = require("../observable/from");
var none = {};
function combineLatest() {
    var observables = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        observables[_i] = arguments[_i];
    }
    var project = null;
    if (typeof observables[observables.length - 1] === 'function') {
        project = observables.pop();
    }
    if (observables.length === 1 && isArray_1.isArray(observables[0])) {
        observables = observables[0].slice();
    }
    return function (source) { return source.lift.call(from_1.from([source].concat(observables)), new combineLatest_1.CombineLatestOperator(project)); };
}
exports.combineLatest = combineLatest;
//# sourceMappingURL=combineLatest.js.map