{"version":3,"sources":["webpack:///../src/apmonth.js","webpack:///../src/apdate.js","webpack:///../src/apdatetab.js","webpack:///../src/utils.js","webpack:///../src/aptime.js","webpack:///../src/capfirst.js","webpack:///../src/widont.js","webpack:///./node_modules/classnames/index.js","webpack:///./node_modules/intersection-observer/intersection-observer.js","webpack:///./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack:///./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack:///./node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack:///./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack:///./node_modules/@babel/runtime/helpers/esm/extends.js","webpack:///../src/vnode.js","webpack:///../src/options.js","webpack:///../src/h.js","webpack:///../src/util.js","webpack:///../src/clone-element.js","webpack:///../src/constants.js","webpack:///../src/render-queue.js","webpack:///../src/vdom/index.js","webpack:///../src/dom/index.js","webpack:///../src/vdom/diff.js","webpack:///../src/vdom/component.js","webpack:///../src/vdom/component-recycler.js","webpack:///../src/component.js"],"names":["0","1","2","3","4","5","6","7","8","9","10","11","n","Date","t","getMonth","r","getDate","getFullYear","u","c","String","charAt","toUpperCase","slice","RegExp","hasOwn","hasOwnProperty","classNames","classes","i","arguments","length","arg","appendClass","parseValue","Array","isArray","apply","toString","Object","prototype","includes","key","call","value","newClass","module","exports","default","window","document","IntersectionObserverEntry","defineProperty","get","this","intersectionRatio","registry","IntersectionObserver","THROTTLE_TIMEOUT","POLL_INTERVAL","USE_MUTATION_OBSERVER","observe","target","_observationTargets","some","item","element","nodeType","Error","_registerInstance","push","entry","_monitorIntersections","_checkForIntersections","unobserve","filter","_unmonitorIntersections","_unregisterInstance","disconnect","takeRecords","records","_queuedEntries","_initThresholds","opt_threshold","threshold","sort","a","isNaN","_parseRootMargin","opt_rootMargin","margins","split","map","margin","parts","exec","parseFloat","unit","_monitoringIntersections","_monitoringInterval","setInterval","addEvent","_domObserver","MutationObserver","attributes","childList","characterData","subtree","clearInterval","removeEvent","rootIsInDom","_rootIsInDom","rootRect","_getRootRect","top","bottom","left","right","width","height","forEach","targetRect","getBoundingClientRect","rootContainsTarget","_rootContainsTarget","oldEntry","intersectionRect","_computeTargetAndRootIntersection","newEntry","time","performance","now","boundingClientRect","rootBounds","_hasCrossedThreshold","isIntersecting","_callback","getComputedStyle","display","rect1","rect2","parent","getParentNode","atRoot","parentRect","parentComputedStyle","root","body","documentElement","overflow","Math","max","min","html","clientWidth","clientHeight","_expandRectByRootMargin","rect","_rootMarginValues","newRect","oldRatio","newRatio","thresholds","containsDeep","indexOf","index","splice","targetArea","intersectionArea","Number","toFixed","callback","opt_options","fn","timeout","timer","options","bind","setTimeout","rootMargin","join","node","event","opt_useCapture","addEventListener","attachEvent","removeEventListener","detatchEvent","el","err","child","parentNode","host","_typeof","o","Symbol","iterator","constructor","toPropertyKey","e","toPrimitive","TypeError","_defineProperty","enumerable","configurable","writable","_extends","assign","VNode","stack","EMPTY_CHILDREN","h","nodeName","lastSimple","simple","children","pop","undefined","p","vnode","extend","obj","props","applyRef","ref","current","defer","Promise","resolve","then","cloneElement","IS_NON_DIMENSIONAL","items","enqueueRender","component","debounceRendering","rerender","_componentConstructor","isNamedNode","normalizedNodeName","toLowerCase","getNodeProps","defaultProps","setAccessor","name","old","isSvg","style","cssText","test","innerHTML","__html","replace","eventProxy","useCapture","_listeners","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","className","mounts","hydrating","shift","componentDidMount","diff","dom","context","mountAll","componentRoot","isSvgMode","ownerSVGElement","diffLevel","flushMounts","ret","out","splitText","_component","createTextNode","replaceChild","isDirectOwner","isOwner","_parentComponent","base","originalComponent","oldDom","nextBase","vnodeName","createElementNS","createElement","firstChild","vchildren","fc","nextSibling","nodeValue","isHydrating","f","vchild","len","_child","originalChildren","vlen","__key","trim","keyedLen","childrenLen","j","idiff","keyed","recollectNodeTree","dangerouslySetInnerHTML","attrs","prevSvgMode","unmountOnly","removeChildren","previousSibling","recyclerComponents","inst","Component","render","doRender","Ctor","state","componentWillMount","componentWillReceiveProps","prevProps","renderMode","syncComponentUpdates","__ref","renderComponent","isChild","rendered","cbase","prevState","initialBase","isUpdate","skip","snapshot","previousContext","getDerivedStateFromProps","previousProps","previousState","componentWillUpdate","prevContext","_dirty","getChildContext","getSnapshotBeforeUpdate","childProps","createComponent","childComponent","initialChildComponent","toUnmount","componentRef","componentDidUpdate","_renderCallbacks","beforeUnmount","componentWillUnmount","inner","merge"],"mappings":"uKAOyB,CACvBA,EAAG,OACHC,EAAG,OACHC,EAAG,QACHC,EAAG,QACHC,EAAG,MACHC,EAAG,OACHC,EAAG,OACHC,EAAG,OACHC,EAAG,QACHC,EAAG,OACHC,GAAI,OACJC,GAAI,iBAAAC,EAsB0BA,GAC9B,YAAO,IADuBA,MAAO,IAAAC,MAAAC,EACpBF,EAAKG,YACxB,SAAAC,ECtB+BF,GAK7B,YAAO,IALsBA,MAAO,IAAAD,MACtBD,EAAQE,GAAA,IACHA,EAAKG,UAAA,KACXH,EAAKI,cCGpB,SAAAC,ECpBsBL,GACpB,OAAgB,MAAAA,ECoDlB,SAAAM,EC9CiCN,GAE/B,GAAIK,EAAML,GAAM,MAAO,GAGvB,IAAAF,EAAYS,OAAOP,GAEnB,MAAM,GAAIF,EAAIU,OAAO,GAAGC,cAAgBX,EAAIY,MAAM,GCJhC,IAAAC,OAAW,oB,qBCjB/B;;;;;GAOC,WACA,aAEA,IAAIC,EAAS,GAAGC,eAEhB,SAASC,IAGR,IAFA,IAAIC,EAAU,GAELC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CAC1C,IAAIG,EAAMF,UAAUD,GAChBG,IACHJ,EAAUK,EAAYL,EAASM,EAAWF,KAI5C,OAAOJ,EAGR,SAASM,EAAYF,GACpB,GAAmB,iBAARA,GAAmC,iBAARA,EACrC,OAAOA,EAGR,GAAmB,iBAARA,EACV,MAAO,GAGR,GAAIG,MAAMC,QAAQJ,GACjB,OAAOL,EAAWU,MAAM,KAAML,GAG/B,GAAIA,EAAIM,W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ACVoF,EAAA8B,EAAP,EAAAhF,GAAA,G,eAKKkD,EAAAlC,U,OAICmE,K,IAEazE,WAAM,O,gBAIbuD,EAAZvD,WAAA,MAnBDM,EAqBKlB,EAAAmE,EAAAD,EAAAhE,EAAAC,IAAAmE,EAAAD,KAAAhJ,YAAA,I,MAKW6F,IAAAmD,GAAAjB,IAAAiC,EAAA,C,MACNhB,EAAAhJ,W,+BAIJiK,I,EACQ1E,WAAO,K,kBAOR0E,G,OAGEpE,E,MACM,C,gEAMHqE,E,+CAKbpF,E,EACHvM,KAAIoK,GACGuG,I,wBAGHiB,mBAAab,EAAlBC,EAAAJ,G,iCAKGxG,EAAYyH,iBAAUpU,Q,EACnBoU,iBAAP3I,MAAA7K,KAAA+L,GADDuC,GAGgB0D,GAAAzD,K,gBA0DXkF,eAAgBpL,EAAQoL,cAAA1H,G,QAETkD,K,gBAIpByE,sBAAA3H,EAAA2H,uB,gBAWIC,EAAQ5H,EAAA4C,W,IAEDgF,G,IAEX,M,EAAA,eAAAvI,EAAA6D,EAAA,cAAA5D,IAAA,M,EAEI+D,SAAUH,E,EAEJA,G,YAICA,I,EAINlD,EAAA+F,MAAgB,M,6BAIT,E,uCAMH,KAAAN,OAAiB,G,kCE1OrBH,EAAUrG,EAAK9E,EAAA0N,G,WACnB5I,EAAA,MAAA9E,GAAA,G,wBAnCI,SAALsL,EAAAxJ,G,iDAMKwJ,MAAQvG,EAAbA,EAAA,GAAAtK,KAAA6Q,OAAA,mBAAAA,IAAA7Q,KAAA6Q,MAAA7Q,KAAAwK,OAAAqG,G,mCAMa7Q,O,YAER,SAALqH,G,mDAI2B","file":"8.59c52e4836.mjs","sourcesContent":["/**\n * Map of AP month abbreviations. Note that they are zero-indexed due to\n * JavaScript's life choices. Exported for testing purposes.\n *\n * @private\n * @type {object}\n */\nexport const AP_MONTHS = {\n  0: 'Jan.',\n  1: 'Feb.',\n  2: 'March',\n  3: 'April',\n  4: 'May',\n  5: 'June',\n  6: 'July',\n  7: 'Aug.',\n  8: 'Sept.',\n  9: 'Oct.',\n  10: 'Nov.',\n  11: 'Dec.',\n};\n\n/**\n * Returns an AP-formatted month string that corresponds with the supplied\n * Date. If an `input` is not passed, it will use the result of `new Date();`.\n *\n * @param  {Date} [date] JavaScript Date object, defaults to current date if\n *                       not passed\n * @return {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * // Remember that JavaScript zero-indexes months!\n * journalize.apmonth(new Date(2016, 10, 8));\n * // returns 'Nov.'\n *\n * // Uses the current date if no parameter is passed\n * journalize.apmonth();\n * // returns 'July' (pretend it is actually July)\n */\nexport default function apmonth(date = new Date()) {\n  return AP_MONTHS[date.getMonth()];\n}\n","import apmonth from './apmonth';\n\n/**\n * Returns an AP-formatted date string that corresponds with the supplied\n * Date. If an `input` is not passed, it will use the result of `new Date();`.\n *\n * @param  {Date} [date] JavaScript Date object, defaults to current date if\n *                       not passed\n * @return {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * // Remember that JavaScript zero-indexes months!\n * journalize.apdate(new Date(2016, 10, 8));\n * // returns 'Nov. 8, 2016'\n *\n * // Uses the current date if no parameter is passed\n * journalize.apdate();\n * // returns 'July 4, 2016' (pretend it is actually July 4, 2016)\n */\nexport default function apdate(date = new Date()) {\n  const month = apmonth(date);\n  const dayOfMonth = date.getDate();\n  const year = date.getFullYear();\n\n  return `${month} ${dayOfMonth}, ${year}`;\n}\n","import apmonthtab from './apmonthtab';\n\n/**\n * Returns a tabular AP-formatted date string that corresponds with the supplied\n * Date. If an `input` is not passed, it will use the result of `new Date();`.\n *\n * @param  {Date} [date] JavaScript Date object, defaults to current date if\n *                       not passed\n * @return {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * // Remember that JavaScript zero-indexes months!\n * journalize.apdate(new Date(2016, 10, 8));\n * // returns 'Nov 8, 2016'\n *\n * // Uses the current date if no parameter is passed\n * journalize.apdate();\n * // returns 'Jul 4, 2016' (pretend it is actually July 4, 2016)\n */\nexport default function apdatetab(date = new Date()) {\n  const month = apmonthtab(date);\n  const dayOfMonth = date.getDate();\n  const year = date.getFullYear();\n\n  return `${month} ${dayOfMonth}, ${year}`;\n}\n","/**\n * Returns true if `value` is null or undefined;\n *\n * @private\n * @param  {*}  value\n * @return {boolean}\n */\nexport function isNil(value) {\n  return value == null;\n}\n\n/**\n * Returns true if `value` is a finite number.\n *\n * Based on: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite\n *\n * @private\n * @param  {*}  value\n * @return {boolean}\n */\nexport function _isFinite(value) {\n  return typeof value === 'number' && isFinite(value);\n}\n\n/**\n * Returns true if `value` is an integer.\n *\n * Based on: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger\n *\n * @private\n * @param  {*}  value\n * @return {boolean}\n */\nexport function isInteger(value) {\n  return _isFinite(value) && Math.floor(value) === value;\n}\n","/**\n * Returns an AP-formatted time string that corresponds with the supplied\n * Date. If an `input` is not passed, it will use the result of `new Date();`.\n *\n * @param  {Date} [date] JavaScript Date object, defaults to current date if\n *                       not passed\n * @return {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * // Bright and early\n * journalize.aptime(new Date(2016, 10, 8, 6, 30));\n * // returns '6:30 a.m.'\n *\n * // It can handle `p.m.` too\n * journalize.aptime(new Date(2016, 10, 8, 16, 30));\n * // returns '4:30 p.m.'\n *\n * // Uses the current time if no parameter is passed\n * journalize.aptime();\n * // returns '6:45 p.m.' (pretend it is actually 6:45 p.m. right now)\n */\nexport default function aptime(date = new Date()) {\n  const hours = date.getHours();\n  const minutes = date.getMinutes();\n\n  const minutesAreZero = minutes === 0;\n\n  if (minutesAreZero) {\n    if (hours === 0) return 'midnight';\n    if (hours === 12) return 'noon';\n  }\n\n  let period, hour;\n\n  if (hours < 12) {\n    period = 'a.m.';\n    // account for how Date() returns 12 a.m. as 0\n    if (hours > 0) {\n      hour = hours;\n    } else {\n      hour = 12;\n    }\n  } else {\n    period = 'p.m.';\n\n    if (hours === 12) {\n      hour = hours;\n    } else {\n      hour = hours - 12;\n    }\n  }\n\n  if (minutesAreZero) {\n    return hour + ' ' + period;\n  }\n\n  const minute = minutes < 10 ? '0' + minutes : minutes;\n  return hour + ':' + minute + ' ' + period;\n}\n","import { isNil } from './utils';\n\n/**\n * Capitalizes the first character of a value and returns it.\n *\n * @param {any} val\n * @returns {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * journalize.capfirst('hello world');\n * // returns 'Hello world'\n */\nexport default function capfirst(val) {\n  // if `val` is undefined or null, return an empty string\n  if (isNil(val)) return '';\n\n  // coerce value to a String\n  const str = String(val);\n\n  return `${str.charAt(0).toUpperCase()}${str.slice(1)}`;\n}\n","import { isNil } from './utils';\n\n/**\n * The non-breaking space character added to the string passed to widont.\n * Exported for testing purposes.\n *\n * @private\n * @type {string}\n */\nexport const nbsp = '\\xA0';\n\n/**\n * The regular expression to find the final space in a string for widont.\n *\n * @private\n * @type {RegExp}\n */\nconst widontRegex = new RegExp(/\\s+([^\\s]*)\\s*$/);\n\n/**\n * Prevents \"widows\" - a word by itself on a line - from appearing in strings\n * by replacing the space between the last two words with a non-breaking space\n * character.\n *\n * @param {string} val\n * @param {string} [replaceChar='\\xA0'] The character to replace the space with\n * @returns {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * journalize.widont('this is a string');\n * // returns 'this is a&nbsp;string'\n *\n * journalize.widont('this is a string', 'HELLO');\n * // returns 'this is aHELLOstring'\n *\n */\nexport default function widont(val, replaceChar = nbsp) {\n  // if `val` is undefined or null, return an empty string\n  if (isNil(val)) return '';\n\n  // coerce value to a String\n  const str = String(val);\n\n  return str.replace(widontRegex, `${replaceChar}$1`);\n}\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","/**\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE.\n *\n *  https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document\n *\n */\n\n(function(window, document) {\n'use strict';\n\n\n// Exits early if all IntersectionObserver and IntersectionObserverEntry\n// features are natively supported.\nif ('IntersectionObserver' in window &&\n    'IntersectionObserverEntry' in window &&\n    'intersectionRatio' in window.IntersectionObserverEntry.prototype) {\n\n  // Minimal polyfill for Edge 15's lack of `isIntersecting`\n  // See: https://github.com/w3c/IntersectionObserver/issues/211\n  if (!('isIntersecting' in window.IntersectionObserverEntry.prototype)) {\n    Object.defineProperty(window.IntersectionObserverEntry.prototype,\n      'isIntersecting', {\n      get: function () {\n        return this.intersectionRatio > 0;\n      }\n    });\n  }\n  return;\n}\n\n\n/**\n * An IntersectionObserver registry. This registry exists to hold a strong\n * reference to IntersectionObserver instances currently observing a target\n * element. Without this registry, instances without another reference may be\n * garbage collected.\n */\nvar registry = [];\n\n\n/**\n * Creates the global IntersectionObserverEntry constructor.\n * https://w3c.github.io/IntersectionObserver/#intersection-observer-entry\n * @param {Object} entry A dictionary of instance properties.\n * @constructor\n */\nfunction IntersectionObserverEntry(entry) {\n  this.time = entry.time;\n  this.target = entry.target;\n  this.rootBounds = entry.rootBounds;\n  this.boundingClientRect = entry.boundingClientRect;\n  this.intersectionRect = entry.intersectionRect || getEmptyRect();\n  this.isIntersecting = !!entry.intersectionRect;\n\n  // Calculates the intersection ratio.\n  var targetRect = this.boundingClientRect;\n  var targetArea = targetRect.width * targetRect.height;\n  var intersectionRect = this.intersectionRect;\n  var intersectionArea = intersectionRect.width * intersectionRect.height;\n\n  // Sets intersection ratio.\n  if (targetArea) {\n    // Round the intersection ratio to avoid floating point math issues:\n    // https://github.com/w3c/IntersectionObserver/issues/324\n    this.intersectionRatio = Number((intersectionArea / targetArea).toFixed(4));\n  } else {\n    // If area is zero and is intersecting, sets to 1, otherwise to 0\n    this.intersectionRatio = this.isIntersecting ? 1 : 0;\n  }\n}\n\n\n/**\n * Creates the global IntersectionObserver constructor.\n * https://w3c.github.io/IntersectionObserver/#intersection-observer-interface\n * @param {Function} callback The function to be invoked after intersection\n *     changes have queued. The function is not invoked if the queue has\n *     been emptied by calling the `takeRecords` method.\n * @param {Object=} opt_options Optional configuration options.\n * @constructor\n */\nfunction IntersectionObserver(callback, opt_options) {\n\n  var options = opt_options || {};\n\n  if (typeof callback != 'function') {\n    throw new Error('callback must be a function');\n  }\n\n  if (options.root && options.root.nodeType != 1) {\n    throw new Error('root must be an Element');\n  }\n\n  // Binds and throttles `this._checkForIntersections`.\n  this._checkForIntersections = throttle(\n      this._checkForIntersections.bind(this), this.THROTTLE_TIMEOUT);\n\n  // Private properties.\n  this._callback = callback;\n  this._observationTargets = [];\n  this._queuedEntries = [];\n  this._rootMarginValues = this._parseRootMargin(options.rootMargin);\n\n  // Public properties.\n  this.thresholds = this._initThresholds(options.threshold);\n  this.root = options.root || null;\n  this.rootMargin = this._rootMarginValues.map(function(margin) {\n    return margin.value + margin.unit;\n  }).join(' ');\n}\n\n\n/**\n * The minimum interval within which the document will be checked for\n * intersection changes.\n */\nIntersectionObserver.prototype.THROTTLE_TIMEOUT = 100;\n\n\n/**\n * The frequency in which the polyfill polls for intersection changes.\n * this can be updated on a per instance basis and must be set prior to\n * calling `observe` on the first target.\n */\nIntersectionObserver.prototype.POLL_INTERVAL = null;\n\n/**\n * Use a mutation observer on the root element\n * to detect intersection changes.\n */\nIntersectionObserver.prototype.USE_MUTATION_OBSERVER = true;\n\n\n/**\n * Starts observing a target element for intersection changes based on\n * the thresholds values.\n * @param {Element} target The DOM element to observe.\n */\nIntersectionObserver.prototype.observe = function(target) {\n  var isTargetAlreadyObserved = this._observationTargets.some(function(item) {\n    return item.element == target;\n  });\n\n  if (isTargetAlreadyObserved) {\n    return;\n  }\n\n  if (!(target && target.nodeType == 1)) {\n    throw new Error('target must be an Element');\n  }\n\n  this._registerInstance();\n  this._observationTargets.push({element: target, entry: null});\n  this._monitorIntersections();\n  this._checkForIntersections();\n};\n\n\n/**\n * Stops observing a target element for intersection changes.\n * @param {Element} target The DOM element to observe.\n */\nIntersectionObserver.prototype.unobserve = function(target) {\n  this._observationTargets =\n      this._observationTargets.filter(function(item) {\n\n    return item.element != target;\n  });\n  if (!this._observationTargets.length) {\n    this._unmonitorIntersections();\n    this._unregisterInstance();\n  }\n};\n\n\n/**\n * Stops observing all target elements for intersection changes.\n */\nIntersectionObserver.prototype.disconnect = function() {\n  this._observationTargets = [];\n  this._unmonitorIntersections();\n  this._unregisterInstance();\n};\n\n\n/**\n * Returns any queue entries that have not yet been reported to the\n * callback and clears the queue. This can be used in conjunction with the\n * callback to obtain the absolute most up-to-date intersection information.\n * @return {Array} The currently queued entries.\n */\nIntersectionObserver.prototype.takeRecords = function() {\n  var records = this._queuedEntries.slice();\n  this._queuedEntries = [];\n  return records;\n};\n\n\n/**\n * Accepts the threshold value from the user configuration object and\n * returns a sorted array of unique threshold values. If a value is not\n * between 0 and 1 and error is thrown.\n * @private\n * @param {Array|number=} opt_threshold An optional threshold value or\n *     a list of threshold values, defaulting to [0].\n * @return {Array} A sorted list of unique and valid threshold values.\n */\nIntersectionObserver.prototype._initThresholds = function(opt_threshold) {\n  var threshold = opt_threshold || [0];\n  if (!Array.isArray(threshold)) threshold = [threshold];\n\n  return threshold.sort().filter(function(t, i, a) {\n    if (typeof t != 'number' || isNaN(t) || t < 0 || t > 1) {\n      throw new Error('threshold must be a number between 0 and 1 inclusively');\n    }\n    return t !== a[i - 1];\n  });\n};\n\n\n/**\n * Accepts the rootMargin value from the user configuration object\n * and returns an array of the four margin values as an object containing\n * the value and unit properties. If any of the values are not properly\n * formatted or use a unit other than px or %, and error is thrown.\n * @private\n * @param {string=} opt_rootMargin An optional rootMargin value,\n *     defaulting to '0px'.\n * @return {Array<Object>} An array of margin objects with the keys\n *     value and unit.\n */\nIntersectionObserver.prototype._parseRootMargin = function(opt_rootMargin) {\n  var marginString = opt_rootMargin || '0px';\n  var margins = marginString.split(/\\s+/).map(function(margin) {\n    var parts = /^(-?\\d*\\.?\\d+)(px|%)$/.exec(margin);\n    if (!parts) {\n      throw new Error('rootMargin must be specified in pixels or percent');\n    }\n    return {value: parseFloat(parts[1]), unit: parts[2]};\n  });\n\n  // Handles shorthand.\n  margins[1] = margins[1] || margins[0];\n  margins[2] = margins[2] || margins[0];\n  margins[3] = margins[3] || margins[1];\n\n  return margins;\n};\n\n\n/**\n * Starts polling for intersection changes if the polling is not already\n * happening, and if the page's visibility state is visible.\n * @private\n */\nIntersectionObserver.prototype._monitorIntersections = function() {\n  if (!this._monitoringIntersections) {\n    this._monitoringIntersections = true;\n\n    // If a poll interval is set, use polling instead of listening to\n    // resize and scroll events or DOM mutations.\n    if (this.POLL_INTERVAL) {\n      this._monitoringInterval = setInterval(\n          this._checkForIntersections, this.POLL_INTERVAL);\n    }\n    else {\n      addEvent(window, 'resize', this._checkForIntersections, true);\n      addEvent(document, 'scroll', this._checkForIntersections, true);\n\n      if (this.USE_MUTATION_OBSERVER && 'MutationObserver' in window) {\n        this._domObserver = new MutationObserver(this._checkForIntersections);\n        this._domObserver.observe(document, {\n          attributes: true,\n          childList: true,\n          characterData: true,\n          subtree: true\n        });\n      }\n    }\n  }\n};\n\n\n/**\n * Stops polling for intersection changes.\n * @private\n */\nIntersectionObserver.prototype._unmonitorIntersections = function() {\n  if (this._monitoringIntersections) {\n    this._monitoringIntersections = false;\n\n    clearInterval(this._monitoringInterval);\n    this._monitoringInterval = null;\n\n    removeEvent(window, 'resize', this._checkForIntersections, true);\n    removeEvent(document, 'scroll', this._checkForIntersections, true);\n\n    if (this._domObserver) {\n      this._domObserver.disconnect();\n      this._domObserver = null;\n    }\n  }\n};\n\n\n/**\n * Scans each observation target for intersection changes and adds them\n * to the internal entries queue. If new entries are found, it\n * schedules the callback to be invoked.\n * @private\n */\nIntersectionObserver.prototype._checkForIntersections = function() {\n  var rootIsInDom = this._rootIsInDom();\n  var rootRect = rootIsInDom ? this._getRootRect() : getEmptyRect();\n\n  this._observationTargets.forEach(function(item) {\n    var target = item.element;\n    var targetRect = getBoundingClientRect(target);\n    var rootContainsTarget = this._rootContainsTarget(target);\n    var oldEntry = item.entry;\n    var intersectionRect = rootIsInDom && rootContainsTarget &&\n        this._computeTargetAndRootIntersection(target, rootRect);\n\n    var newEntry = item.entry = new IntersectionObserverEntry({\n      time: now(),\n      target: target,\n      boundingClientRect: targetRect,\n      rootBounds: rootRect,\n      intersectionRect: intersectionRect\n    });\n\n    if (!oldEntry) {\n      this._queuedEntries.push(newEntry);\n    } else if (rootIsInDom && rootContainsTarget) {\n      // If the new entry intersection ratio has crossed any of the\n      // thresholds, add a new entry.\n      if (this._hasCrossedThreshold(oldEntry, newEntry)) {\n        this._queuedEntries.push(newEntry);\n      }\n    } else {\n      // If the root is not in the DOM or target is not contained within\n      // root but the previous entry for this target had an intersection,\n      // add a new record indicating removal.\n      if (oldEntry && oldEntry.isIntersecting) {\n        this._queuedEntries.push(newEntry);\n      }\n    }\n  }, this);\n\n  if (this._queuedEntries.length) {\n    this._callback(this.takeRecords(), this);\n  }\n};\n\n\n/**\n * Accepts a target and root rect computes the intersection between then\n * following the algorithm in the spec.\n * TODO(philipwalton): at this time clip-path is not considered.\n * https://w3c.github.io/IntersectionObserver/#calculate-intersection-rect-algo\n * @param {Element} target The target DOM element\n * @param {Object} rootRect The bounding rect of the root after being\n *     expanded by the rootMargin value.\n * @return {?Object} The final intersection rect object or undefined if no\n *     intersection is found.\n * @private\n */\nIntersectionObserver.prototype._computeTargetAndRootIntersection =\n    function(target, rootRect) {\n\n  // If the element isn't displayed, an intersection can't happen.\n  if (window.getComputedStyle(target).display == 'none') return;\n\n  var targetRect = getBoundingClientRect(target);\n  var intersectionRect = targetRect;\n  var parent = getParentNode(target);\n  var atRoot = false;\n\n  while (!atRoot) {\n    var parentRect = null;\n    var parentComputedStyle = parent.nodeType == 1 ?\n        window.getComputedStyle(parent) : {};\n\n    // If the parent isn't displayed, an intersection can't happen.\n    if (parentComputedStyle.display == 'none') return;\n\n    if (parent == this.root || parent == document) {\n      atRoot = true;\n      parentRect = rootRect;\n    } else {\n      // If the element has a non-visible overflow, and it's not the <body>\n      // or <html> element, update the intersection rect.\n      // Note: <body> and <html> cannot be clipped to a rect that's not also\n      // the document rect, so no need to compute a new intersection.\n      if (parent != document.body &&\n          parent != document.documentElement &&\n          parentComputedStyle.overflow != 'visible') {\n        parentRect = getBoundingClientRect(parent);\n      }\n    }\n\n    // If either of the above conditionals set a new parentRect,\n    // calculate new intersection data.\n    if (parentRect) {\n      intersectionRect = computeRectIntersection(parentRect, intersectionRect);\n\n      if (!intersectionRect) break;\n    }\n    parent = getParentNode(parent);\n  }\n  return intersectionRect;\n};\n\n\n/**\n * Returns the root rect after being expanded by the rootMargin value.\n * @return {Object} The expanded root rect.\n * @private\n */\nIntersectionObserver.prototype._getRootRect = function() {\n  var rootRect;\n  if (this.root) {\n    rootRect = getBoundingClientRect(this.root);\n  } else {\n    // Use <html>/<body> instead of window since scroll bars affect size.\n    var html = document.documentElement;\n    var body = document.body;\n    rootRect = {\n      top: 0,\n      left: 0,\n      right: html.clientWidth || body.clientWidth,\n      width: html.clientWidth || body.clientWidth,\n      bottom: html.clientHeight || body.clientHeight,\n      height: html.clientHeight || body.clientHeight\n    };\n  }\n  return this._expandRectByRootMargin(rootRect);\n};\n\n\n/**\n * Accepts a rect and expands it by the rootMargin value.\n * @param {Object} rect The rect object to expand.\n * @return {Object} The expanded rect.\n * @private\n */\nIntersectionObserver.prototype._expandRectByRootMargin = function(rect) {\n  var margins = this._rootMarginValues.map(function(margin, i) {\n    return margin.unit == 'px' ? margin.value :\n        margin.value * (i % 2 ? rect.width : rect.height) / 100;\n  });\n  var newRect = {\n    top: rect.top - margins[0],\n    right: rect.right + margins[1],\n    bottom: rect.bottom + margins[2],\n    left: rect.left - margins[3]\n  };\n  newRect.width = newRect.right - newRect.left;\n  newRect.height = newRect.bottom - newRect.top;\n\n  return newRect;\n};\n\n\n/**\n * Accepts an old and new entry and returns true if at least one of the\n * threshold values has been crossed.\n * @param {?IntersectionObserverEntry} oldEntry The previous entry for a\n *    particular target element or null if no previous entry exists.\n * @param {IntersectionObserverEntry} newEntry The current entry for a\n *    particular target element.\n * @return {boolean} Returns true if a any threshold has been crossed.\n * @private\n */\nIntersectionObserver.prototype._hasCrossedThreshold =\n    function(oldEntry, newEntry) {\n\n  // To make comparing easier, an entry that has a ratio of 0\n  // but does not actually intersect is given a value of -1\n  var oldRatio = oldEntry && oldEntry.isIntersecting ?\n      oldEntry.intersectionRatio || 0 : -1;\n  var newRatio = newEntry.isIntersecting ?\n      newEntry.intersectionRatio || 0 : -1;\n\n  // Ignore unchanged ratios\n  if (oldRatio === newRatio) return;\n\n  for (var i = 0; i < this.thresholds.length; i++) {\n    var threshold = this.thresholds[i];\n\n    // Return true if an entry matches a threshold or if the new ratio\n    // and the old ratio are on the opposite sides of a threshold.\n    if (threshold == oldRatio || threshold == newRatio ||\n        threshold < oldRatio !== threshold < newRatio) {\n      return true;\n    }\n  }\n};\n\n\n/**\n * Returns whether or not the root element is an element and is in the DOM.\n * @return {boolean} True if the root element is an element and is in the DOM.\n * @private\n */\nIntersectionObserver.prototype._rootIsInDom = function() {\n  return !this.root || containsDeep(document, this.root);\n};\n\n\n/**\n * Returns whether or not the target element is a child of root.\n * @param {Element} target The target element to check.\n * @return {boolean} True if the target element is a child of root.\n * @private\n */\nIntersectionObserver.prototype._rootContainsTarget = function(target) {\n  return containsDeep(this.root || document, target);\n};\n\n\n/**\n * Adds the instance to the global IntersectionObserver registry if it isn't\n * already present.\n * @private\n */\nIntersectionObserver.prototype._registerInstance = function() {\n  if (registry.indexOf(this) < 0) {\n    registry.push(this);\n  }\n};\n\n\n/**\n * Removes the instance from the global IntersectionObserver registry.\n * @private\n */\nIntersectionObserver.prototype._unregisterInstance = function() {\n  var index = registry.indexOf(this);\n  if (index != -1) registry.splice(index, 1);\n};\n\n\n/**\n * Returns the result of the performance.now() method or null in browsers\n * that don't support the API.\n * @return {number} The elapsed time since the page was requested.\n */\nfunction now() {\n  return window.performance && performance.now && performance.now();\n}\n\n\n/**\n * Throttles a function and delays its execution, so it's only called at most\n * once within a given time period.\n * @param {Function} fn The function to throttle.\n * @param {number} timeout The amount of time that must pass before the\n *     function can be called again.\n * @return {Function} The throttled function.\n */\nfunction throttle(fn, timeout) {\n  var timer = null;\n  return function () {\n    if (!timer) {\n      timer = setTimeout(function() {\n        fn();\n        timer = null;\n      }, timeout);\n    }\n  };\n}\n\n\n/**\n * Adds an event handler to a DOM node ensuring cross-browser compatibility.\n * @param {Node} node The DOM node to add the event handler to.\n * @param {string} event The event name.\n * @param {Function} fn The event handler to add.\n * @param {boolean} opt_useCapture Optionally adds the even to the capture\n *     phase. Note: this only works in modern browsers.\n */\nfunction addEvent(node, event, fn, opt_useCapture) {\n  if (typeof node.addEventListener == 'function') {\n    node.addEventListener(event, fn, opt_useCapture || false);\n  }\n  else if (typeof node.attachEvent == 'function') {\n    node.attachEvent('on' + event, fn);\n  }\n}\n\n\n/**\n * Removes a previously added event handler from a DOM node.\n * @param {Node} node The DOM node to remove the event handler from.\n * @param {string} event The event name.\n * @param {Function} fn The event handler to remove.\n * @param {boolean} opt_useCapture If the event handler was added with this\n *     flag set to true, it should be set to true here in order to remove it.\n */\nfunction removeEvent(node, event, fn, opt_useCapture) {\n  if (typeof node.removeEventListener == 'function') {\n    node.removeEventListener(event, fn, opt_useCapture || false);\n  }\n  else if (typeof node.detatchEvent == 'function') {\n    node.detatchEvent('on' + event, fn);\n  }\n}\n\n\n/**\n * Returns the intersection between two rect objects.\n * @param {Object} rect1 The first rect.\n * @param {Object} rect2 The second rect.\n * @return {?Object} The intersection rect or undefined if no intersection\n *     is found.\n */\nfunction computeRectIntersection(rect1, rect2) {\n  var top = Math.max(rect1.top, rect2.top);\n  var bottom = Math.min(rect1.bottom, rect2.bottom);\n  var left = Math.max(rect1.left, rect2.left);\n  var right = Math.min(rect1.right, rect2.right);\n  var width = right - left;\n  var height = bottom - top;\n\n  return (width >= 0 && height >= 0) && {\n    top: top,\n    bottom: bottom,\n    left: left,\n    right: right,\n    width: width,\n    height: height\n  };\n}\n\n\n/**\n * Shims the native getBoundingClientRect for compatibility with older IE.\n * @param {Element} el The element whose bounding rect to get.\n * @return {Object} The (possibly shimmed) rect of the element.\n */\nfunction getBoundingClientRect(el) {\n  var rect;\n\n  try {\n    rect = el.getBoundingClientRect();\n  } catch (err) {\n    // Ignore Windows 7 IE11 \"Unspecified error\"\n    // https://github.com/w3c/IntersectionObserver/pull/205\n  }\n\n  if (!rect) return getEmptyRect();\n\n  // Older IE\n  if (!(rect.width && rect.height)) {\n    rect = {\n      top: rect.top,\n      right: rect.right,\n      bottom: rect.bottom,\n      left: rect.left,\n      width: rect.right - rect.left,\n      height: rect.bottom - rect.top\n    };\n  }\n  return rect;\n}\n\n\n/**\n * Returns an empty rect object. An empty rect is returned when an element\n * is not in the DOM.\n * @return {Object} The empty rect.\n */\nfunction getEmptyRect() {\n  return {\n    top: 0,\n    bottom: 0,\n    left: 0,\n    right: 0,\n    width: 0,\n    height: 0\n  };\n}\n\n/**\n * Checks to see if a parent element contains a child element (including inside\n * shadow DOM).\n * @param {Node} parent The parent element.\n * @param {Node} child The child element.\n * @return {boolean} True if the parent node contains the child node.\n */\nfunction containsDeep(parent, child) {\n  var node = child;\n  while (node) {\n    if (node == parent) return true;\n\n    node = getParentNode(node);\n  }\n  return false;\n}\n\n\n/**\n * Gets the parent node of an element or its host element if the parent node\n * is a shadow root.\n * @param {Node} node The node whose parent to get.\n * @return {Node|null} The parent node or null if no parent exists.\n */\nfunction getParentNode(node) {\n  var parent = node.parentNode;\n\n  if (parent && parent.nodeType == 11 && parent.host) {\n    // If the parent is a shadow root, return the host element.\n    return parent.host;\n  }\n  return parent;\n}\n\n\n// Exposes the constructors globally.\nwindow.IntersectionObserver = IntersectionObserver;\nwindow.IntersectionObserverEntry = IntersectionObserverEntry;\n\n}(window, document));\n","function _typeof(o) {\n  \"@babel/helpers - typeof\";\n\n  return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n    return typeof o;\n  } : function (o) {\n    return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n  }, _typeof(o);\n}\nexport { _typeof as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n  var i = toPrimitive(t, \"string\");\n  return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n  if (\"object\" != _typeof(t) || !t) return t;\n  var e = t[Symbol.toPrimitive];\n  if (void 0 !== e) {\n    var i = e.call(t, r || \"default\");\n    if (\"object\" != _typeof(i)) return i;\n    throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n  }\n  return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n    value: t,\n    enumerable: !0,\n    configurable: !0,\n    writable: !0\n  }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","function _extends() {\n  return _extends = Object.assign ? Object.assign.bind() : function (n) {\n    for (var e = 1; e < arguments.length; e++) {\n      var t = arguments[e];\n      for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n    }\n    return n;\n  }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","/**\n * Virtual DOM Node\n * @typedef VNode\n * @property {string | function} nodeName The string of the DOM node to create or Component constructor to render\n * @property {Array<VNode | string>} children The children of node\n * @property {string | number | undefined} key The key used to identify this VNode in a list\n * @property {object} attributes The properties of this VNode\n */\nexport const VNode = function VNode() {};\n","/**\n * @typedef {import('./component').Component} Component\n * @typedef {import('./vnode').VNode} VNode\n */\n\n/**\n * Global options\n * @public\n * @typedef Options\n * @property {boolean} [syncComponentUpdates] If `true`, `prop` changes trigger synchronous component updates. Defaults to true.\n * @property {(vnode: VNode) => void} [vnode] Processes all created VNodes.\n * @property {(component: Component) => void} [afterMount] Hook invoked after a component is mounted.\n * @property {(component: Component) => void} [afterUpdate] Hook invoked after the DOM is updated with a component's latest render.\n * @property {(component: Component) => void} [beforeUnmount] Hook invoked immediately before a component is unmounted.\n * @property {(rerender: function) => void} [debounceRendering] Hook invoked whenever a rerender is requested. Can be used to debounce rerenders.\n * @property {(event: Event) => Event | void} [event] Hook invoked before any Preact event listeners. The return value (if any) replaces the native browser event given to event listeners\n */\n\n/** @type {Options}  */\nconst options = {};\n\nexport default options;\n","import { VNode } from './vnode';\nimport options from './options';\n\n\nconst stack = [];\n\nconst EMPTY_CHILDREN = [];\n\n/**\n * JSX/hyperscript reviver.\n * @see http://jasonformat.com/wtf-is-jsx\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\n *\n * Note: this is exported as both `h()` and `createElement()` for compatibility\n * reasons.\n *\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a\n * lightweight representation of the structure of a DOM tree. This structure can\n * be realized by recursively comparing it against the current _actual_ DOM\n * structure, and applying only the differences.\n *\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\n * and optionally children to append to the element.\n *\n * @example The following DOM tree\n *\n * `<div id=\"foo\" name=\"bar\">Hello!</div>`\n *\n * can be constructed using this function as:\n *\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\n *\n * @param {string | function} nodeName An element name. Ex: `div`, `a`, `span`, etc.\n * @param {object | null} attributes Any attributes/props to set on the created element.\n * @param {VNode[]} [rest] Additional arguments are taken to be children to\n *  append. Can be infinitely nested Arrays.\n *\n * @public\n */\nexport function h(nodeName, attributes) {\n\tlet children=EMPTY_CHILDREN, lastSimple, child, simple, i;\n\tfor (i=arguments.length; i-- > 2; ) {\n\t\tstack.push(arguments[i]);\n\t}\n\tif (attributes && attributes.children!=null) {\n\t\tif (!stack.length) stack.push(attributes.children);\n\t\tdelete attributes.children;\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop!==undefined) {\n\t\t\tfor (i=child.length; i--; ) stack.push(child[i]);\n\t\t}\n\t\telse {\n\t\t\tif (typeof child==='boolean') child = null;\n\n\t\t\tif ((simple = typeof nodeName!=='function')) {\n\t\t\t\tif (child==null) child = '';\n\t\t\t\telse if (typeof child==='number') child = String(child);\n\t\t\t\telse if (typeof child!=='string') simple = false;\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length-1] += child;\n\t\t\t}\n\t\t\telse if (children===EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tchildren.push(child);\n\t\t\t}\n\n\t\t\tlastSimple = simple;\n\t\t}\n\t}\n\n\tlet p = new VNode();\n\tp.nodeName = nodeName;\n\tp.children = children;\n\tp.attributes = attributes==null ? undefined : attributes;\n\tp.key = attributes==null ? undefined : attributes.key;\n\n\t// if a \"vnode hook\" is defined, pass every created VNode to it\n\tif (options.vnode!==undefined) options.vnode(p);\n\n\treturn p;\n}\n","/**\n * Copy all properties from `props` onto `obj`.\n * @param {object} obj Object onto which properties should be copied.\n * @param {object} props Object from which to copy properties.\n * @returns {object}\n * @private\n */\nexport function extend(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn obj;\n}\n\n/** Invoke or update a ref, depending on whether it is a function or object ref.\n *  @param {object|function} [ref=null]\n *  @param {any} [value]\n */\nexport function applyRef(ref, value) {\n\tif (ref) {\n\t\tif (typeof ref=='function') ref(value);\n\t\telse ref.current = value;\n\t}\n}\n\n/**\n * Call a function asynchronously, as soon as possible. Makes\n * use of HTML Promise to schedule the callback if available,\n * otherwise falling back to `setTimeout` (mainly for IE<11).\n * @type {(callback: function) => void}\n */\nexport const defer = typeof Promise=='function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\n","import { extend } from './util';\nimport { h } from './h';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its\n * children.\n * @param {import('./vnode').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array<import('./vnode').VNode>} [rest] Any additional arguments will be used as replacement\n *  children.\n */\nexport function cloneElement(vnode, props) {\n\treturn h(\n\t\tvnode.nodeName,\n\t\textend(extend({}, vnode.attributes), props),\n\t\targuments.length>2 ? [].slice.call(arguments, 2) : vnode.children\n\t);\n}\n","// render modes\n\n/** Do not re-render a component */\nexport const NO_RENDER = 0;\n/** Synchronously re-render a component and its children */\nexport const SYNC_RENDER = 1;\n/** Synchronously re-render a component, even if its lifecycle methods attempt to prevent it. */\nexport const FORCE_RENDER = 2;\n/** Queue asynchronous re-render of a component and it's children */\nexport const ASYNC_RENDER = 3;\n\n\nexport const ATTR_KEY = '__preactattr_';\n\n/** DOM properties that should NOT have \"px\" added when numeric */\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\n","import options from './options';\nimport { defer } from './util';\nimport { renderComponent } from './vdom/component';\n\n/**\n * Managed queue of dirty components to be re-rendered\n * @type {Array<import('./component').Component>}\n */\nlet items = [];\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./component').Component} component The component to rerender\n */\nexport function enqueueRender(component) {\n\tif (!component._dirty && (component._dirty = true) && items.push(component)==1) {\n\t\t(options.debounceRendering || defer)(rerender);\n\t}\n}\n\n/** Rerender all enqueued dirty components */\nexport function rerender() {\n\tlet p;\n\twhile ( (p = items.pop()) ) {\n\t\tif (p._dirty) renderComponent(p);\n\t}\n}\n","import { extend } from '../util';\n\n\n/**\n * Check if two nodes are equivalent.\n * @param {import('../dom').PreactElement} node DOM Node to compare\n * @param {import('../vnode').VNode} vnode Virtual DOM node to compare\n * @param {boolean} [hydrating=false] If true, ignores component constructors\n *  when comparing.\n * @private\n */\nexport function isSameNodeType(node, vnode, hydrating) {\n\tif (typeof vnode==='string' || typeof vnode==='number') {\n\t\treturn node.splitText!==undefined;\n\t}\n\tif (typeof vnode.nodeName==='string') {\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName);\n\t}\n\treturn hydrating || node._componentConstructor===vnode.nodeName;\n}\n\n\n/**\n * Check if an Element has a given nodeName, case-insensitively.\n * @param {import('../dom').PreactElement} node A DOM Element to inspect the name of.\n * @param {string} nodeName Unnormalized name to compare against.\n */\nexport function isNamedNode(node, nodeName) {\n\treturn node.normalizedNodeName===nodeName || node.nodeName.toLowerCase()===nodeName.toLowerCase();\n}\n\n\n/**\n * Reconstruct Component-style `props` from a VNode.\n * Ensures default/fallback values from `defaultProps`:\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\n * @param {import('../vnode').VNode} vnode The VNode to get props for\n * @returns {object} The props to use for this VNode\n */\nexport function getNodeProps(vnode) {\n\tlet props = extend({}, vnode.attributes);\n\tprops.children = vnode.children;\n\n\tlet defaultProps = vnode.nodeName.defaultProps;\n\tif (defaultProps!==undefined) {\n\t\tfor (let i in defaultProps) {\n\t\t\tif (props[i]===undefined) {\n\t\t\t\tprops[i] = defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn props;\n}\n","import { IS_NON_DIMENSIONAL } from '../constants';\nimport { applyRef } from '../util';\nimport options from '../options';\n\n/**\n * A DOM event listener\n * @typedef {(e: Event) => void} EventListner\n */\n\n/**\n * A mapping of event types to event listeners\n * @typedef {Object.<string, EventListener>} EventListenerMap\n */\n\n/**\n * Properties Preact adds to elements it creates\n * @typedef PreactElementExtensions\n * @property {string} [normalizedNodeName] A normalized node name to use in diffing\n * @property {EventListenerMap} [_listeners] A map of event listeners added by components to this DOM node\n * @property {import('../component').Component} [_component] The component that rendered this DOM node\n * @property {function} [_componentConstructor] The constructor of the component that rendered this DOM node\n */\n\n/**\n * A DOM element that has been extended with Preact properties\n * @typedef {Element & ElementCSSInlineStyle & PreactElementExtensions} PreactElement\n */\n\n/**\n * Create an element with the given nodeName.\n * @param {string} nodeName The DOM node to create\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\n *  namespace.\n * @returns {PreactElement} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n\t/** @type {PreactElement} */\n\tlet node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n\tnode.normalizedNodeName = nodeName;\n\treturn node;\n}\n\n\n/**\n * Remove a child node from its parent if attached.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n\tlet parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\n\n/**\n * Set a named attribute on the given Node, with special behavior for some names\n * and event handlers. If `value` is `null`, the attribute/handler will be\n * removed.\n * @param {PreactElement} node An element to mutate\n * @param {string} name The name/key to set, such as an event or attribute name\n * @param {*} old The last value that was set for this name/node pair\n * @param {*} value An attribute value, such as a function to be used as an\n *  event handler\n * @param {boolean} isSvg Are we currently diffing inside an svg?\n * @private\n */\nexport function setAccessor(node, name, old, value, isSvg) {\n\tif (name==='className') name = 'class';\n\n\n\tif (name==='key') {\n\t\t// ignore\n\t}\n\telse if (name==='ref') {\n\t\tapplyRef(old, null);\n\t\tapplyRef(value, node);\n\t}\n\telse if (name==='class' && !isSvg) {\n\t\tnode.className = value || '';\n\t}\n\telse if (name==='style') {\n\t\tif (!value || typeof value==='string' || typeof old==='string') {\n\t\t\tnode.style.cssText = value || '';\n\t\t}\n\t\tif (value && typeof value==='object') {\n\t\t\tif (typeof old!=='string') {\n\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = '';\n\t\t\t}\n\t\t\tfor (let i in value) {\n\t\t\t\tnode.style[i] = typeof value[i]==='number' && IS_NON_DIMENSIONAL.test(i)===false ? (value[i]+'px') : value[i];\n\t\t\t}\n\t\t}\n\t}\n\telse if (name==='dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || '';\n\t}\n\telse if (name[0]=='o' && name[1]=='n') {\n\t\tlet useCapture = name !== (name=name.replace(/Capture$/, ''));\n\t\tname = name.toLowerCase().substring(2);\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\telse {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value;\n\t}\n\telse if (name!=='list' && name!=='type' && !isSvg && name in node) {\n\t\t// Attempt to set a DOM property to the given value.\n\t\t// IE & FF throw for certain property-value combinations.\n\t\ttry {\n\t\t\tnode[name] = value==null ? '' : value;\n\t\t} catch (e) { }\n\t\tif ((value==null || value===false) && name!='spellcheck') node.removeAttribute(name);\n\t}\n\telse {\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')));\n\t\t// spellcheck is treated differently than all other boolean values and\n\t\t// should not be removed when the value is `false`. See:\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\n\t\tif (value==null || value===false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());\n\t\t\telse node.removeAttribute(name);\n\t\t}\n\t\telse if (typeof value!=='function') {\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);\n\t\t\telse node.setAttribute(name, value);\n\t\t}\n\t}\n}\n\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @private\n */\nfunction eventProxy(e) {\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\n}\n","import { ATTR_KEY } from '../constants';\nimport { isSameNodeType, isNamedNode } from './index';\nimport { buildComponentFromVNode } from './component';\nimport { createNode, setAccessor } from '../dom/index';\nimport { unmountComponent } from './component';\nimport options from '../options';\nimport { applyRef } from '../util';\nimport { removeNode } from '../dom/index';\n\n/**\n * Queue of components that have been mounted and are awaiting componentDidMount\n * @type {Array<import('../component').Component>}\n */\nexport const mounts = [];\n\n/** Diff recursion count, used to track the end of the diff cycle. */\nexport let diffLevel = 0;\n\n/** Global flag indicating if the diff is currently within an SVG */\nlet isSvgMode = false;\n\n/** Global flag indicating if the diff is performing hydration */\nlet hydrating = false;\n\n/** Invoke queued componentDidMount lifecycle methods */\nexport function flushMounts() {\n\tlet c;\n\twhile ((c = mounts.shift())) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}\n\n\n/**\n * Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n * @param {import('../dom').PreactElement} dom A DOM node to mutate into the shape of a `vnode`\n * @param {import('../vnode').VNode} vnode A VNode (with descendants forming a tree) representing\n *  the desired DOM structure\n * @param {object} context The current context\n * @param {boolean} mountAll Whether or not to immediately mount all components\n * @param {Element} parent ?\n * @param {boolean} componentRoot ?\n * @returns {import('../dom').PreactElement} The created/mutated element\n * @private\n */\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\n\t// diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n\tif (!diffLevel++) {\n\t\t// when first starting the diff, check if we're diffing an SVG or within an SVG\n\t\tisSvgMode = parent!=null && parent.ownerSVGElement!==undefined;\n\n\t\t// hydration is indicated by the existing element to be diffed not having a prop cache\n\t\thydrating = dom!=null && !(ATTR_KEY in dom);\n\t}\n\n\tlet ret = idiff(dom, vnode, context, mountAll, componentRoot);\n\n\t// append the element if its a new parent\n\tif (parent && ret.parentNode!==parent) parent.appendChild(ret);\n\n\t// diffLevel being reduced to 0 means we're exiting the diff\n\tif (!--diffLevel) {\n\t\thydrating = false;\n\t\t// invoke queued componentDidMount lifecycle methods\n\t\tif (!componentRoot) flushMounts();\n\t}\n\n\treturn ret;\n}\n\n\n/**\n * Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing.\n * @param {import('../dom').PreactElement} dom A DOM node to mutate into the shape of a `vnode`\n * @param {import('../vnode').VNode} vnode A VNode (with descendants forming a tree) representing the desired DOM structure\n * @param {object} context The current context\n * @param {boolean} mountAll Whether or not to immediately mount all components\n * @param {boolean} [componentRoot] ?\n * @private\n */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tlet out = dom,\n\t\tprevSvgMode = isSvgMode;\n\n\t// empty values (null, undefined, booleans) render as empty Text nodes\n\tif (vnode==null || typeof vnode==='boolean') vnode = '';\n\n\n\t// Fast case: Strings & Numbers create/update Text nodes.\n\tif (typeof vnode==='string' || typeof vnode==='number') {\n\n\t\t// update if it's already a Text node:\n\t\tif (dom && dom.splitText!==undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\t/* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n\t\t\tif (dom.nodeValue!=vnode) {\n\t\t\t\tdom.nodeValue = vnode;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// it wasn't a Text node: replace it with one and recycle the old Element\n\t\t\tout = document.createTextNode(vnode);\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\t\t\t\trecollectNodeTree(dom, true);\n\t\t\t}\n\t\t}\n\n\t\tout[ATTR_KEY] = true;\n\n\t\treturn out;\n\t}\n\n\n\t// If the VNode represents a Component, perform a component diff:\n\tlet vnodeName = vnode.nodeName;\n\tif (typeof vnodeName==='function') {\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\n\t}\n\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tisSvgMode = vnodeName==='svg' ? true : vnodeName==='foreignObject' ? false : isSvgMode;\n\n\n\t// If there's no existing element or it's the wrong type, create a new one:\n\tvnodeName = String(vnodeName);\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode);\n\n\t\tif (dom) {\n\t\t\t// move children into the replacement node\n\t\t\twhile (dom.firstChild) out.appendChild(dom.firstChild);\n\n\t\t\t// if the previous Element was mounted into the DOM, replace it inline\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\n\t\t\t// recycle the old element (skips non-Element node types)\n\t\t\trecollectNodeTree(dom, true);\n\t\t}\n\t}\n\n\n\tlet fc = out.firstChild,\n\t\tprops = out[ATTR_KEY],\n\t\tvchildren = vnode.children;\n\n\tif (props==null) {\n\t\tprops = out[ATTR_KEY] = {};\n\t\tfor (let a=out.attributes, i=a.length; i--; ) props[a[i].name] = a[i].value;\n\t}\n\n\t// Optimization: fast-path for elements containing a single TextNode:\n\tif (!hydrating && vchildren && vchildren.length===1 && typeof vchildren[0]==='string' && fc!=null && fc.splitText!==undefined && fc.nextSibling==null) {\n\t\tif (fc.nodeValue!=vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0];\n\t\t}\n\t}\n\t// otherwise, if there are existing or new children, diff them:\n\telse if (vchildren && vchildren.length || fc!=null) {\n\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML!=null);\n\t}\n\n\n\t// Apply attributes/props from VNode to the DOM Element:\n\tdiffAttributes(out, vnode.attributes, props);\n\n\n\t// restore previous SVG mode: (in case we're exiting an SVG namespace)\n\tisSvgMode = prevSvgMode;\n\n\treturn out;\n}\n\n\n/**\n * Apply child and attribute changes between a VNode and a DOM Node to the DOM.\n * @param {import('../dom').PreactElement} dom Element whose children should be compared & mutated\n * @param {Array<import('../vnode').VNode>} vchildren Array of VNodes to compare to `dom.childNodes`\n * @param {object} context Implicitly descendant context object (from most\n *  recent `getChildContext()`)\n * @param {boolean} mountAll Whether or not to immediately mount all components\n * @param {boolean} isHydrating if `true`, consumes externally created elements\n *  similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n\tlet originalChildren = dom.childNodes,\n\t\tchildren = [],\n\t\tkeyed = {},\n\t\tkeyedLen = 0,\n\t\tmin = 0,\n\t\tlen = originalChildren.length,\n\t\tchildrenLen = 0,\n\t\tvlen = vchildren ? vchildren.length : 0,\n\t\tj, c, f, vchild, child;\n\n\t// Build up a map of keyed children and an Array of unkeyed children:\n\tif (len!==0) {\n\t\tfor (let i=0; i<len; i++) {\n\t\t\tlet child = originalChildren[i],\n\t\t\t\tprops = child[ATTR_KEY],\n\t\t\t\tkey = vlen && props ? child._component ? child._component.__key : props.key : null;\n\t\t\tif (key!=null) {\n\t\t\t\tkeyedLen++;\n\t\t\t\tkeyed[key] = child;\n\t\t\t}\n\t\t\telse if (props || (child.splitText!==undefined ? (isHydrating ? child.nodeValue.trim() : true) : isHydrating)) {\n\t\t\t\tchildren[childrenLen++] = child;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (vlen!==0) {\n\t\tfor (let i=0; i<vlen; i++) {\n\t\t\tvchild = vchildren[i];\n\t\t\tchild = null;\n\n\t\t\t// attempt to find a node based on key matching\n\t\t\tlet key = vchild.key;\n\t\t\tif (key!=null) {\n\t\t\t\tif (keyedLen && keyed[key]!==undefined) {\n\t\t\t\t\tchild = keyed[key];\n\t\t\t\t\tkeyed[key] = undefined;\n\t\t\t\t\tkeyedLen--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// attempt to pluck a node of the same type from the existing children\n\t\t\telse if (min<childrenLen) {\n\t\t\t\tfor (j=min; j<childrenLen; j++) {\n\t\t\t\t\tif (children[j]!==undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {\n\t\t\t\t\t\tchild = c;\n\t\t\t\t\t\tchildren[j] = undefined;\n\t\t\t\t\t\tif (j===childrenLen-1) childrenLen--;\n\t\t\t\t\t\tif (j===min) min++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// morph the matched/found/created DOM child to match vchild (deep)\n\t\t\tchild = idiff(child, vchild, context, mountAll);\n\n\t\t\tf = originalChildren[i];\n\t\t\tif (child && child!==dom && child!==f) {\n\t\t\t\tif (f==null) {\n\t\t\t\t\tdom.appendChild(child);\n\t\t\t\t}\n\t\t\t\telse if (child===f.nextSibling) {\n\t\t\t\t\tremoveNode(f);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdom.insertBefore(child, f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\t// remove unused keyed children:\n\tif (keyedLen) {\n\t\tfor (let i in keyed) if (keyed[i]!==undefined) recollectNodeTree(keyed[i], false);\n\t}\n\n\t// remove orphaned unkeyed children:\n\twhile (min<=childrenLen) {\n\t\tif ((child = children[childrenLen--])!==undefined) recollectNodeTree(child, false);\n\t}\n}\n\n\n\n/**\n * Recursively recycle (or just unmount) a node and its descendants.\n * @param {import('../dom').PreactElement} node DOM node to start\n *  unmount/removal from\n * @param {boolean} [unmountOnly=false] If `true`, only triggers unmount\n *  lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\n\tlet component = node._component;\n\tif (component) {\n\t\t// if node is owned by a Component, unmount that component (ends up recursing back here)\n\t\tunmountComponent(component);\n\t}\n\telse {\n\t\t// If the node's VNode had a ref function, invoke it with null here.\n\t\t// (this is part of the React spec, and smart for unsetting references)\n\t\tif (node[ATTR_KEY]!=null) applyRef(node[ATTR_KEY].ref, null);\n\n\t\tif (unmountOnly===false || node[ATTR_KEY]==null) {\n\t\t\tremoveNode(node);\n\t\t}\n\n\t\tremoveChildren(node);\n\t}\n}\n\n\n/**\n * Recollect/unmount all children.\n *\t- we use .lastChild here because it causes less reflow than .firstChild\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\n */\nexport function removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tlet next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}\n\n\n/**\n * Apply differences in attributes from a VNode to the given DOM Element.\n * @param {import('../dom').PreactElement} dom Element with attributes to diff `attrs` against\n * @param {object} attrs The desired end-state key-value attribute pairs\n * @param {object} old Current/previous attributes (from previous VNode or\n *  element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old) {\n\tlet name;\n\n\t// remove attributes no longer present on the vnode by setting them to undefined\n\tfor (name in old) {\n\t\tif (!(attrs && attrs[name]!=null) && old[name]!=null) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);\n\t\t}\n\t}\n\n\t// add new & update changed attributes\n\tfor (name in attrs) {\n\t\tif (name!=='children' && name!=='innerHTML' && (!(name in old) || attrs[name]!==(name==='value' || name==='checked' ? dom[name] : old[name]))) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n\t\t}\n\t}\n}\n","import { SYNC_RENDER, NO_RENDER, FORCE_RENDER, ASYNC_RENDER, ATTR_KEY } from '../constants';\nimport options from '../options';\nimport { extend, applyRef } from '../util';\nimport { enqueueRender } from '../render-queue';\nimport { getNodeProps } from './index';\nimport { diff, mounts, diffLevel, flushMounts, recollectNodeTree, removeChildren } from './diff';\nimport { createComponent, recyclerComponents } from './component-recycler';\nimport { removeNode } from '../dom/index';\n\n/**\n * Set a component's `props` and possibly re-render the component\n * @param {import('../component').Component} component The Component to set props on\n * @param {object} props The new props\n * @param {number} renderMode Render options - specifies how to re-render the component\n * @param {object} context The new context\n * @param {boolean} mountAll Whether or not to immediately mount all components\n */\nexport function setComponentProps(component, props, renderMode, context, mountAll) {\n\tif (component._disable) return;\n\tcomponent._disable = true;\n\n\tcomponent.__ref = props.ref;\n\tcomponent.__key = props.key;\n\tdelete props.ref;\n\tdelete props.key;\n\n\tif (typeof component.constructor.getDerivedStateFromProps === 'undefined') {\n\t\tif (!component.base || mountAll) {\n\t\t\tif (component.componentWillMount) component.componentWillMount();\n\t\t}\n\t\telse if (component.componentWillReceiveProps) {\n\t\t\tcomponent.componentWillReceiveProps(props, context);\n\t\t}\n\t}\n\n\tif (context && context!==component.context) {\n\t\tif (!component.prevContext) component.prevContext = component.context;\n\t\tcomponent.context = context;\n\t}\n\n\tif (!component.prevProps) component.prevProps = component.props;\n\tcomponent.props = props;\n\n\tcomponent._disable = false;\n\n\tif (renderMode!==NO_RENDER) {\n\t\tif (renderMode===SYNC_RENDER || options.syncComponentUpdates!==false || !component.base) {\n\t\t\trenderComponent(component, SYNC_RENDER, mountAll);\n\t\t}\n\t\telse {\n\t\t\tenqueueRender(component);\n\t\t}\n\t}\n\n\tapplyRef(component.__ref, component);\n}\n\n\n\n/**\n * Render a Component, triggering necessary lifecycle events and taking\n * High-Order Components into account.\n * @param {import('../component').Component} component The component to render\n * @param {number} [renderMode] render mode, see constants.js for available options.\n * @param {boolean} [mountAll] Whether or not to immediately mount all components\n * @param {boolean} [isChild] ?\n * @private\n */\nexport function renderComponent(component, renderMode, mountAll, isChild) {\n\tif (component._disable) return;\n\n\tlet props = component.props,\n\t\tstate = component.state,\n\t\tcontext = component.context,\n\t\tpreviousProps = component.prevProps || props,\n\t\tpreviousState = component.prevState || state,\n\t\tpreviousContext = component.prevContext || context,\n\t\tisUpdate = component.base,\n\t\tnextBase = component.nextBase,\n\t\tinitialBase = isUpdate || nextBase,\n\t\tinitialChildComponent = component._component,\n\t\tskip = false,\n\t\tsnapshot = previousContext,\n\t\trendered, inst, cbase;\n\n\tif (component.constructor.getDerivedStateFromProps) {\n\t\tstate = extend(extend({}, state), component.constructor.getDerivedStateFromProps(props, state));\n\t\tcomponent.state = state;\n\t}\n\n\t// if updating\n\tif (isUpdate) {\n\t\tcomponent.props = previousProps;\n\t\tcomponent.state = previousState;\n\t\tcomponent.context = previousContext;\n\t\tif (renderMode!==FORCE_RENDER\n\t\t\t&& component.shouldComponentUpdate\n\t\t\t&& component.shouldComponentUpdate(props, state, context) === false) {\n\t\t\tskip = true;\n\t\t}\n\t\telse if (component.componentWillUpdate) {\n\t\t\tcomponent.componentWillUpdate(props, state, context);\n\t\t}\n\t\tcomponent.props = props;\n\t\tcomponent.state = state;\n\t\tcomponent.context = context;\n\t}\n\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\n\tcomponent._dirty = false;\n\n\tif (!skip) {\n\t\trendered = component.render(props, state, context);\n\n\t\t// context to pass to the child, can be updated via (grand-)parent component\n\t\tif (component.getChildContext) {\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\n\t\t}\n\n\t\tif (isUpdate && component.getSnapshotBeforeUpdate) {\n\t\t\tsnapshot = component.getSnapshotBeforeUpdate(previousProps, previousState);\n\t\t}\n\n\t\tlet childComponent = rendered && rendered.nodeName,\n\t\t\ttoUnmount, base;\n\n\t\tif (typeof childComponent==='function') {\n\t\t\t// set up high order component link\n\n\t\t\tlet childProps = getNodeProps(rendered);\n\t\t\tinst = initialChildComponent;\n\n\t\t\tif (inst && inst.constructor===childComponent && childProps.key==inst.__key) {\n\t\t\t\tsetComponentProps(inst, childProps, SYNC_RENDER, context, false);\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttoUnmount = inst;\n\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\n\t\t\t\tinst._parentComponent = component;\n\t\t\t\tsetComponentProps(inst, childProps, NO_RENDER, context, false);\n\t\t\t\trenderComponent(inst, SYNC_RENDER, mountAll, true);\n\t\t\t}\n\n\t\t\tbase = inst.base;\n\t\t}\n\t\telse {\n\t\t\tcbase = initialBase;\n\n\t\t\t// destroy high order component link\n\t\t\ttoUnmount = initialChildComponent;\n\t\t\tif (toUnmount) {\n\t\t\t\tcbase = component._component = null;\n\t\t\t}\n\n\t\t\tif (initialBase || renderMode===SYNC_RENDER) {\n\t\t\t\tif (cbase) cbase._component = null;\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\n\t\t\t}\n\t\t}\n\n\t\tif (initialBase && base!==initialBase && inst!==initialChildComponent) {\n\t\t\tlet baseParent = initialBase.parentNode;\n\t\t\tif (baseParent && base!==baseParent) {\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\n\n\t\t\t\tif (!toUnmount) {\n\t\t\t\t\tinitialBase._component = null;\n\t\t\t\t\trecollectNodeTree(initialBase, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (toUnmount) {\n\t\t\tunmountComponent(toUnmount);\n\t\t}\n\n\t\tcomponent.base = base;\n\t\tif (base && !isChild) {\n\t\t\tlet componentRef = component,\n\t\t\t\tt = component;\n\t\t\twhile ((t=t._parentComponent)) {\n\t\t\t\t(componentRef = t).base = base;\n\t\t\t}\n\t\t\tbase._component = componentRef;\n\t\t\tbase._componentConstructor = componentRef.constructor;\n\t\t}\n\t}\n\n\tif (!isUpdate || mountAll) {\n\t\tmounts.push(component);\n\t}\n\telse if (!skip) {\n\t\t// Ensure that pending componentDidMount() hooks of child components\n\t\t// are called before the componentDidUpdate() hook in the parent.\n\t\t// Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\n\t\t// flushMounts();\n\n\t\tif (component.componentDidUpdate) {\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, snapshot);\n\t\t}\n\t\tif (options.afterUpdate) options.afterUpdate(component);\n\t}\n\n\twhile (component._renderCallbacks.length) component._renderCallbacks.pop().call(component);\n\n\tif (!diffLevel && !isChild) flushMounts();\n}\n\n\n\n/**\n * Apply the Component referenced by a VNode to the DOM.\n * @param {import('../dom').PreactElement} dom The DOM node to mutate\n * @param {import('../vnode').VNode} vnode A Component-referencing VNode\n * @param {object} context The current context\n * @param {boolean} mountAll Whether or not to immediately mount all components\n * @returns {import('../dom').PreactElement} The created/mutated element\n * @private\n */\nexport function buildComponentFromVNode(dom, vnode, context, mountAll) {\n\tlet c = dom && dom._component,\n\t\toriginalComponent = c,\n\t\toldDom = dom,\n\t\tisDirectOwner = c && dom._componentConstructor===vnode.nodeName,\n\t\tisOwner = isDirectOwner,\n\t\tprops = getNodeProps(vnode);\n\twhile (c && !isOwner && (c=c._parentComponent)) {\n\t\tisOwner = c.constructor===vnode.nodeName;\n\t}\n\n\tif (c && isOwner && (!mountAll || c._component)) {\n\t\tsetComponentProps(c, props, ASYNC_RENDER, context, mountAll);\n\t\tdom = c.base;\n\t}\n\telse {\n\t\tif (originalComponent && !isDirectOwner) {\n\t\t\tunmountComponent(originalComponent);\n\t\t\tdom = oldDom = null;\n\t\t}\n\n\t\tc = createComponent(vnode.nodeName, props, context);\n\t\tif (dom && !c.nextBase) {\n\t\t\tc.nextBase = dom;\n\t\t\t// passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\n\t\t\toldDom = null;\n\t\t}\n\t\tsetComponentProps(c, props, SYNC_RENDER, context, mountAll);\n\t\tdom = c.base;\n\n\t\tif (oldDom && dom!==oldDom) {\n\t\t\toldDom._component = null;\n\t\t\trecollectNodeTree(oldDom, false);\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n\n\n/**\n * Remove a component from the DOM and recycle it.\n * @param {import('../component').Component} component The Component instance to unmount\n * @private\n */\nexport function unmountComponent(component) {\n\tif (options.beforeUnmount) options.beforeUnmount(component);\n\n\tlet base = component.base;\n\n\tcomponent._disable = true;\n\n\tif (component.componentWillUnmount) component.componentWillUnmount();\n\n\tcomponent.base = null;\n\n\t// recursively tear down & recollect high-order component children:\n\tlet inner = component._component;\n\tif (inner) {\n\t\tunmountComponent(inner);\n\t}\n\telse if (base) {\n\t\tif (base[ATTR_KEY]!=null) applyRef(base[ATTR_KEY].ref, null);\n\n\t\tcomponent.nextBase = base;\n\n\t\tremoveNode(base);\n\t\trecyclerComponents.push(component);\n\n\t\tremoveChildren(base);\n\t}\n\n\tapplyRef(component.__ref, null);\n}\n","import { Component } from '../component';\n\n/**\n * Retains a pool of Components for re-use.\n * @type {Component[]}\n * @private\n */\nexport const recyclerComponents = [];\n\n\n/**\n * Create a component. Normalizes differences between PFC's and classful\n * Components.\n * @param {function} Ctor The constructor of the component to create\n * @param {object} props The initial props of the component\n * @param {object} context The initial context of the component\n * @returns {import('../component').Component}\n */\nexport function createComponent(Ctor, props, context) {\n\tlet inst, i = recyclerComponents.length;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t}\n\telse {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\n\twhile (i--) {\n\t\tif (recyclerComponents[i].constructor===Ctor) {\n\t\t\tinst.nextBase = recyclerComponents[i].nextBase;\n\t\t\trecyclerComponents.splice(i, 1);\n\t\t\treturn inst;\n\t\t}\n\t}\n\n\treturn inst;\n}\n\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n","import { FORCE_RENDER } from './constants';\nimport { extend } from './util';\nimport { renderComponent } from './vdom/component';\nimport { enqueueRender } from './render-queue';\n/**\n * Base Component class.\n * Provides `setState()` and `forceUpdate()`, which trigger rendering.\n * @typedef {object} Component\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components' getChildContext\n * @public\n *\n * @example\n * class MyFoo extends Component {\n *   render(props, state) {\n *     return <div />;\n *   }\n * }\n */\nexport function Component(props, context) {\n\tthis._dirty = true;\n\n\t/**\n\t * @public\n\t * @type {object}\n\t */\n\tthis.context = context;\n\n\t/**\n\t * @public\n\t * @type {object}\n\t */\n\tthis.props = props;\n\n\t/**\n\t * @public\n\t * @type {object}\n\t */\n\tthis.state = this.state || {};\n\n\tthis._renderCallbacks = [];\n}\n\n\nextend(Component.prototype, {\n\n\t/**\n\t * Update component state and schedule a re-render.\n\t * @param {object} state A dict of state properties to be shallowly merged\n\t * \tinto the current state, or a function that will produce such a dict. The\n\t * \tfunction is called with the current state and props.\n\t * @param {() => void} callback A function to be called once component state is\n\t * \tupdated\n\t */\n\tsetState(state, callback) {\n\t\tif (!this.prevState) this.prevState = this.state;\n\t\tthis.state = extend(\n\t\t\textend({}, this.state),\n\t\t\ttypeof state === 'function' ? state(this.state, this.props) : state\n\t\t);\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t},\n\n\n\t/**\n\t * Immediately perform a synchronous re-render of the component.\n\t * @param {() => void} callback A function to be called after component is\n\t * \tre-rendered.\n\t * @private\n\t */\n\tforceUpdate(callback) {\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\trenderComponent(this, FORCE_RENDER);\n\t},\n\n\n\t/**\n\t * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n\t * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n\t * @param {object} props Props (eg: JSX attributes) received from parent\n\t * \telement/component\n\t * @param {object} state The component's current state\n\t * @param {object} context Context object, as returned by the nearest\n\t *  ancestor's `getChildContext()`\n\t * @returns {import('./vnode').VNode | void}\n\t */\n\trender() {}\n\n});\n"],"sourceRoot":""}